Skip to content

Commit

Permalink
Merge branch 'release/0.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
albertoleoncio committed Dec 19, 2023
2 parents e821458 + 71d3b5e commit 20758c1
Show file tree
Hide file tree
Showing 6 changed files with 338 additions and 5 deletions.
37 changes: 35 additions & 2 deletions bin/triage.php
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,42 @@ function movePosition(){
}
}

function getSelectedText() {
var text = "";
if (window.getSelection) {
text = window.getSelection().toString();
} else if (document.selection && document.selection.type !== "Control") {
text = document.selection.createRange().text;
}
return text;
}

function countBytes(text) {
// Count the number of bytes using the TextEncoder API
var encoder = new TextEncoder();
var bytes = encoder.encode(text);
return bytes.length;
}

function updateTooltip() {
var selectedText = getSelectedText();
var byteCount = countBytes(selectedText);
var tooltip = document.getElementById("tooltip");

if (byteCount > 0) {
tooltip.parentElement.style.visibility = "visible";
tooltip.innerHTML = "<?=§('triage-counter')?>: " + byteCount;
} else {
tooltip.parentElement.style.visibility = "hidden";
}
}

var domReady = function(callback) {
document.readyState === "interactive" || document.readyState === "complete" ? callback() : document.addEventListener("DOMContentLoaded", callback);
};
domReady(function() {
movePosition()
movePosition();
document.getElementById("text-container").addEventListener("mouseup", updateTooltip);
});

window.onresize = function(event) {
Expand Down Expand Up @@ -712,7 +742,10 @@ class="w3-button w3-red w3-leftbar w3-rightbar w3-border-light-grey w3-block"
<?=htmlspecialchars($output['compare']['tocomment']??'')?>
</div>
</div>
<div class="w3-container">
<div class="tooltip w3-button w3-orange" style="visibility: hidden;">
<span class="tooltiptext" id="tooltip"><?=§('triage-counter')?>: 0</span>
</div>
<div class="w3-container" id="text-container">
<h3><?=§('triage-differential')?></h3>
<table
role="presentation"
Expand Down
1 change: 1 addition & 0 deletions translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
"triage-onlycat": "Mere categorization",
"triage-onlytag": "Mere insertion of maintenance marks",
"triage-outreach": "Outreach Dashboard",
"triage-counter": "Bytes in selected text",
"manage-invalidcode": "Error: Invalid internal code!",
"manage-alreadyexist": "Error: Tables already exist!",
"manage-creationerror": "Error: Unable to create tables!",
Expand Down
1 change: 1 addition & 0 deletions translations/qqq.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
"triage-images": "Maximum number of points accepted by each participant in each article.\n\nParameters:\n* $1: number of points",
"triage-indef": "{{Identical|Undefined}}",
"triage-noimages": "{{Identical|Disabled}}",
"triage-counter": "Label for the byte counter referring to the text of an edition selected by the user",
"triage-list": "Name of the tool page that redirects the evaluator to the official list of articles on the wiki.",
"triage-cat": "Name of the page of the tool that redirects the contest page categorization system. Corresponds a category on the wiki or a [[:m:PetScan|PetScan search]].",
"triage-differential": "Title of the section where the changes between two revisions of a page are displayed.",
Expand Down
7 changes: 4 additions & 3 deletions translations/sl.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
]
},
"main-title": "WikiScore",
"contest-enter": "Pridružitev natečaju",
"contest-enter": "Pridružitev tekmovanju",
"contest-manage": "Upravljanje tekmovanj",
"contest-select": "Izberite svoje tekmovanje",
"language-select": "Izberite jezik",
Expand Down Expand Up @@ -112,7 +112,7 @@
"counter-redefine": "Ponastavi",
"counter-confirm": "Vse ocene urejanj tega udeleženca bodo razveljavljene. Želite nadaljevati?",
"counter-success": "Urejanja uspešno ponastavljena! V kratkem bo izvedena nova posodobitev podatkovne zbirke.",
"counter-denied": "Dejanje ni dovoljeno. Niste upravitelj natečaja.",
"counter-denied": "Dejanje ni dovoljeno. Niste upravitelj tekmovanja.",
"compare": "Primerjava",
"compare-ended": "Tekmovanje je končano. Nadaljnjih posodobitev ne bo.",
"compare-next": "Naslednja posodobitev čez:",
Expand Down Expand Up @@ -154,7 +154,7 @@
"login-newbytes": "KB dodanih na dan",
"login-validbytes": "KB potrjenih na dan",
"login-cancel": "Prekliči",
"login-manage": "Upravljanje natečaja",
"login-manage": "Upravljanje tekmovanja",
"recover-reset": "Ponastavitev gesla",
"recover-about": "Ta stran omogoča ponastavitev gesla ocenjevalca/upravitelja.",
"recover-email": "E-poštni naslov",
Expand All @@ -179,6 +179,7 @@
"password-wrongpass": "Napačno staro geslo!",
"edits": "Urejanja",
"edits-csv": "Prenos",
"edits-about": "Na tej strani so navedeni vsi popravki udeležencev tekmovanja. Za dostop do urejanj vseh uporabnikov prenesite datoteko CSV.",
"triage": "Triaža",
"triage-lasteval": "Zadnje ocenjevanje",
"triage-welcome": "Pozdravljeni, $1",
Expand Down
1 change: 1 addition & 0 deletions translations/xal.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
"password-username": "Керглгчин нерн",
"password-oldpassword": "Хуучн нууц үг",
"password-wrongpass": "Хуучн нууц үг буру!",
"edits": "Ясврмуд",
"edits-csv": "Татад авх",
"edits-about": "Эн халхд темцәнә орлцачнрин кесн бүк ясвриг җигсәв. Бүк кергләчнрин кесн ясврт хандхин төлә CSV файлыг татад автн.",
"triage": "Йилһх",
Expand Down
Loading

0 comments on commit 20758c1

Please sign in to comment.