summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'MLEB/Translate/resources')
-rw-r--r--MLEB/Translate/resources/css/ext.translate.css68
-rw-r--r--MLEB/Translate/resources/css/ext.translate.dropdownmenu.css8
-rw-r--r--MLEB/Translate/resources/css/ext.translate.editor.css233
-rw-r--r--MLEB/Translate/resources/css/ext.translate.groupselector.css222
-rw-r--r--MLEB/Translate/resources/css/ext.translate.helplink.css21
-rw-r--r--MLEB/Translate/resources/css/ext.translate.loader.css18
-rw-r--r--MLEB/Translate/resources/css/ext.translate.messagetable.css382
-rw-r--r--MLEB/Translate/resources/css/ext.translate.navitoggle.css12
-rw-r--r--MLEB/Translate/resources/css/ext.translate.pagemode.css41
-rw-r--r--MLEB/Translate/resources/css/ext.translate.proofread.css60
-rw-r--r--MLEB/Translate/resources/css/ext.translate.quickedit.css66
-rw-r--r--MLEB/Translate/resources/css/ext.translate.special.aggregategroups.css33
-rw-r--r--MLEB/Translate/resources/css/ext.translate.special.languagestats.css4
-rw-r--r--MLEB/Translate/resources/css/ext.translate.special.managetranslatorsandbox.css81
-rw-r--r--MLEB/Translate/resources/css/ext.translate.special.pagemigration.css54
-rw-r--r--MLEB/Translate/resources/css/ext.translate.special.searchtranslations.css97
-rw-r--r--MLEB/Translate/resources/css/ext.translate.special.supportedlanguages.css2
-rw-r--r--MLEB/Translate/resources/css/ext.translate.special.translate.css147
-rw-r--r--MLEB/Translate/resources/css/ext.translate.special.translationstash.css21
-rw-r--r--MLEB/Translate/resources/css/ext.translate.statsbar.css13
-rw-r--r--MLEB/Translate/resources/css/ext.translate.workflowselector.css33
-rw-r--r--MLEB/Translate/resources/images/action-edit.pngbin393 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/action-edit.svg38
-rw-r--r--MLEB/Translate/resources/images/add.pngbin816 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/add.svg24
-rw-r--r--MLEB/Translate/resources/images/check-small.pngbin366 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/check-small.svg30
-rw-r--r--MLEB/Translate/resources/images/check-sprite-ltr.pngbin5906 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/check-sprite-ltr.svg102
-rw-r--r--MLEB/Translate/resources/images/check-sprite-rtl.pngbin6168 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/check-sprite-rtl.svg97
-rw-r--r--MLEB/Translate/resources/images/close.pngbin180 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/close.svg43
-rw-r--r--MLEB/Translate/resources/images/contract-ltr.pngbin390 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/contract-ltr.svg55
-rw-r--r--MLEB/Translate/resources/images/contract-rtl.pngbin390 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/contract-rtl.svg57
-rw-r--r--MLEB/Translate/resources/images/edit-mark.pngbin480 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/edit-mark.svg34
-rw-r--r--MLEB/Translate/resources/images/expand-ltr.pngbin425 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/expand-ltr.svg55
-rw-r--r--MLEB/Translate/resources/images/expand-rtl.pngbin423 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/expand-rtl.svg57
-rw-r--r--MLEB/Translate/resources/images/help.pngbin428 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/help.svg1
-rw-r--r--MLEB/Translate/resources/images/label-clock.pngbin364 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/label-clock.svg33
-rw-r--r--MLEB/Translate/resources/images/label-flag.pngbin233 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/label-flag.svg33
-rw-r--r--MLEB/Translate/resources/images/label-page-tick.pngbin441 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/label-page-tick.svg40
-rw-r--r--MLEB/Translate/resources/images/label-page.pngbin300 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/label-page.svg42
-rw-r--r--MLEB/Translate/resources/images/label-pen.pngbin362 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/label-pen.svg33
-rw-r--r--MLEB/Translate/resources/images/label-tick.pngbin412 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/label-tick.svg33
-rw-r--r--MLEB/Translate/resources/images/loading.svg44
-rw-r--r--MLEB/Translate/resources/images/outdated-ltr.pngbin743 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/outdated-ltr.svg38
-rw-r--r--MLEB/Translate/resources/images/outdated-rtl.pngbin971 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/outdated-rtl.svg38
-rw-r--r--MLEB/Translate/resources/images/paste.pngbin3271 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/paste.svg20
-rw-r--r--MLEB/Translate/resources/images/plus_darkgray.pngbin733 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/plus_darkgray.svg5
-rw-r--r--MLEB/Translate/resources/images/prog-3.pngbin315 -> 315 bytes
-rw-r--r--MLEB/Translate/resources/images/prog-4.pngbin311 -> 308 bytes
-rw-r--r--MLEB/Translate/resources/images/prog-5.pngbin239 -> 236 bytes
-rw-r--r--MLEB/Translate/resources/images/project.pngbin1016 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/project.svg75
-rw-r--r--MLEB/Translate/resources/images/remove.pngbin787 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/remove.svg24
-rw-r--r--MLEB/Translate/resources/images/search.pngbin664 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/search.svg34
-rw-r--r--MLEB/Translate/resources/images/switch.pngbin6395 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/switch.svg6
-rw-r--r--MLEB/Translate/resources/images/translate-ltr.pngbin586 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/translate-ltr.svg34
-rw-r--r--MLEB/Translate/resources/images/translate-rtl.pngbin723 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/translate-rtl.svg34
-rw-r--r--MLEB/Translate/resources/images/trash_darkgray.pngbin1037 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/trash_darkgray.svg5
-rw-r--r--MLEB/Translate/resources/images/user-small.pngbin304 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/user-small.svg14
-rw-r--r--MLEB/Translate/resources/images/view-list-hi.pngbin239 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/view-list-hi.svg54
-rw-r--r--MLEB/Translate/resources/images/view-list.pngbin239 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/view-list.svg55
-rw-r--r--MLEB/Translate/resources/images/view-page-hi.pngbin271 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/view-page-hi.svg42
-rw-r--r--MLEB/Translate/resources/images/view-page.pngbin271 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/view-page.svg51
-rw-r--r--MLEB/Translate/resources/images/view-proofread-hi.pngbin336 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/view-proofread-hi.svg38
-rw-r--r--MLEB/Translate/resources/images/view-proofread.pngbin415 -> 0 bytes
-rw-r--r--MLEB/Translate/resources/images/view-proofread.svg38
-rw-r--r--MLEB/Translate/resources/js/ext.translate.base.js67
-rw-r--r--MLEB/Translate/resources/js/ext.translate.dropdownmenu.js4
-rw-r--r--MLEB/Translate/resources/js/ext.translate.editor.helpers.js145
-rw-r--r--MLEB/Translate/resources/js/ext.translate.editor.js390
-rw-r--r--MLEB/Translate/resources/js/ext.translate.editor.shortcuts.js22
-rw-r--r--MLEB/Translate/resources/js/ext.translate.groupselector.js217
-rw-r--r--MLEB/Translate/resources/js/ext.translate.hooks.js16
-rw-r--r--MLEB/Translate/resources/js/ext.translate.messagetable.js505
-rw-r--r--MLEB/Translate/resources/js/ext.translate.multiselectautocomplete.js22
-rw-r--r--MLEB/Translate/resources/js/ext.translate.navitoggle.js36
-rw-r--r--MLEB/Translate/resources/js/ext.translate.pagemode.js16
-rw-r--r--MLEB/Translate/resources/js/ext.translate.pagetranslation.uls.js14
-rw-r--r--MLEB/Translate/resources/js/ext.translate.parsers.js19
-rw-r--r--MLEB/Translate/resources/js/ext.translate.proofread.js65
-rw-r--r--MLEB/Translate/resources/js/ext.translate.quickedit.js394
-rw-r--r--MLEB/Translate/resources/js/ext.translate.selecttoinput.js22
-rw-r--r--MLEB/Translate/resources/js/ext.translate.special.aggregategroups.js135
-rw-r--r--MLEB/Translate/resources/js/ext.translate.special.importtranslations.js6
-rw-r--r--MLEB/Translate/resources/js/ext.translate.special.languagestats.js222
-rw-r--r--MLEB/Translate/resources/js/ext.translate.special.managetranslatorsandbox.js135
-rw-r--r--MLEB/Translate/resources/js/ext.translate.special.pagemigration.js187
-rw-r--r--MLEB/Translate/resources/js/ext.translate.special.pagepreparation.js192
-rw-r--r--MLEB/Translate/resources/js/ext.translate.special.pagetranslation.js26
-rw-r--r--MLEB/Translate/resources/js/ext.translate.special.searchtranslations.js280
-rw-r--r--MLEB/Translate/resources/js/ext.translate.special.translate.js396
-rw-r--r--MLEB/Translate/resources/js/ext.translate.special.translationstash.js41
-rw-r--r--MLEB/Translate/resources/js/ext.translate.special.translationstats.js75
-rw-r--r--MLEB/Translate/resources/js/ext.translate.statsbar.js107
-rw-r--r--MLEB/Translate/resources/js/ext.translate.storage.js15
-rw-r--r--MLEB/Translate/resources/js/ext.translate.translationstashstorage.js30
-rw-r--r--MLEB/Translate/resources/js/ext.translate.workflowselector.js42
-rw-r--r--MLEB/Translate/resources/js/jquery.ajaxdispatcher.js20
-rw-r--r--MLEB/Translate/resources/js/jquery.autosize.js415
-rw-r--r--MLEB/Translate/resources/js/jquery.textchange.js9
-rw-r--r--MLEB/Translate/resources/js/jquery.ui.position.js498
132 files changed, 2932 insertions, 4925 deletions
diff --git a/MLEB/Translate/resources/css/ext.translate.css b/MLEB/Translate/resources/css/ext.translate.css
index de49a987..9b4c65d6 100644
--- a/MLEB/Translate/resources/css/ext.translate.css
+++ b/MLEB/Translate/resources/css/ext.translate.css
@@ -1,72 +1,8 @@
-.mw-translate-page-info {
- font-size: x-small;
- text-align: center;
- direction: ltr;
-}
-
-.mw-pt-languages {
- display: table;
- border: 1px solid rgb(170, 170, 170);
- background: rgb(246, 249, 237) none repeat scroll 0 0;
- border-collapse: collapse;
- line-height: 1.2;
- width: 100%;
- clear: both;
- overflow: auto;
-}
-
-.mw-pt-languages-label {
- display: table-cell;
- border-right: 1px solid rgb(170, 170, 170);
- padding: 0.5em;
- background: rgb(238, 243, 226) none repeat scroll 0 0;
- font-weight: bold;
- width: 15%;
-}
-
-.mw-pt-languages-list {
- padding-left: 0.5em;
- padding-bottom: 0.7em;
- display: table-cell;
- width: 80%;
-}
-
-.mw-pt-languages-list a {
- white-space: nowrap;
+.mw-translate-fuzzy {
+ background-color: #fdd;
}
.mw-pt-translate-header {
font-size: x-small;
text-align: center;
}
-
-.mw-pt-languages-selected,
-.mw-pt-languages-ui {
- font-weight: bold;
-}
-
-.mw-pt-progress {
- padding-right: 11px;
- background: transparent right center no-repeat;
- background-size: 9px 9px;
-}
-
-.mw-pt-progress--stub {
- background-image: url('../images/prog-1.png');
-}
-
-.mw-pt-progress--low {
- background-image: url('../images/prog-2.png');
-}
-
-.mw-pt-progress--med {
- background-image: url('../images/prog-3.png');
-}
-
-.mw-pt-progress--high {
- background-image: url('../images/prog-4.png');
-}
-
-.mw-pt-progress--complete {
- background-image: url('../images/prog-5.png');
-}
diff --git a/MLEB/Translate/resources/css/ext.translate.dropdownmenu.css b/MLEB/Translate/resources/css/ext.translate.dropdownmenu.css
index 10dc335b..46d17ed8 100644
--- a/MLEB/Translate/resources/css/ext.translate.dropdownmenu.css
+++ b/MLEB/Translate/resources/css/ext.translate.dropdownmenu.css
@@ -1,15 +1,11 @@
.tux-dropdown-menu {
- padding-top: 2em;
border: 1px solid #c9c9c9;
/* @noflip */
- -webkit-box-shadow: 0 3px 3px -3px rgba(0, 0, 0, 0.5);
- /* @noflip */
- box-shadow: 0 3px 3px -3px rgba(0, 0, 0, 0.5);
+ box-shadow: 0 3px 3px -3px rgba( 0, 0, 0, 0.5 );
font-size: 14px;
- margin: 0 5px;
+ margin: 0;
list-style: none;
padding: 4px;
- width: 200px;
z-index: 300;
background: #fff;
display: block;
diff --git a/MLEB/Translate/resources/css/ext.translate.editor.css b/MLEB/Translate/resources/css/ext.translate.editor.css
index d02b6091..868a6129 100644
--- a/MLEB/Translate/resources/css/ext.translate.editor.css
+++ b/MLEB/Translate/resources/css/ext.translate.editor.css
@@ -1,64 +1,102 @@
.tux-message-editor {
position: relative;
border: 1px solid #777;
- background-color: #FFFFFF;
+ background-color: #fff;
cursor: default;
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
+ box-shadow: 0 2px 6px rgba( 0, 0, 0, 0.3 );
}
-.tux-message-editor .close {
- background: url('../images/close.png') no-repeat scroll center center transparent;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/close.svg);
+.grid .tux-message-editor .close {
+ background: no-repeat center center;
/* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/close.svg);
- padding: 15px;
+ background-image: linear-gradient( transparent, transparent ), url( ../images/close.svg );
+ padding: 16px;
cursor: pointer;
float: right;
+ opacity: 0.87;
}
-.tux-message-editor .editor-info-toggle {
- padding: 15px;
+.grid .tux-message-editor .editor-info-toggle {
+ padding: 16px;
cursor: pointer;
float: right;
}
.tux-message-editor .editor-contract {
- background: url('../images/contract-ltr.png') no-repeat scroll center center transparent;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/contract-ltr.svg);
+ background: no-repeat center center;
/* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/contract-ltr.svg);
+ background-image: linear-gradient( transparent, transparent ), url( ../images/contract-ltr.svg );
}
.tux-message-editor .editor-expand {
- background: url('../images/expand-ltr.png') no-repeat scroll center center transparent;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/expand-ltr.svg);
+ background: no-repeat center center;
/* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/expand-ltr.svg);
+ background-image: linear-gradient( transparent, transparent ), url( ../images/expand-ltr.svg );
}
.tux-message-editor .editcolumn {
- border-right: 1px solid #AAA;
- -webkit-transition: width 0.5s;
+ border-right: 1px solid #aaa;
transition: width 0.5s;
+ background-color: #fff;
+ z-index: 1;
+ /* Padding to have space for the arrow indicating split section */
+ padding-right: 40px;
+}
+
+.grid .tux-message-editor--expanded .editcolumn {
+ width: 100%;
+ padding-right: 5px;
+}
+
+.grid .tux-message-editor .tux-editor-titletools {
+ /* Ignore the padding added for the arrow */
+ margin-right: -40px;
+}
+
+.grid .tux-message-editor--expanded .tux-editor-titletools {
+ margin-right: -5px;
}
.tux-message-editor textarea {
border: 1px solid #555;
font-size: 16px;
- padding: 5px 5px 30px 5px;
+ /* The (30px + 5px paddings) 40px for bottom is for the insertables */
+ padding: 5px 5px 40px 5px;
+ /* Normalize margin across skins (esp. Timeless) */
+ margin: 0;
height: 100px;
min-height: 150px;
overflow-y: auto;
position: relative;
z-index: 100;
+ /* We have automatic resizing for height, and horizontal makes no sense */
+ resize: none;
+ /* Avoid weird extra space appearing at the bottom of enclosing div when
+ * the default value inline-block is used in Chrome.
+ * https://stackoverflow.com/questions/5196424/inconsistent-textarea-handling-in-browsers */
+ display: block;
+}
+
+.tux-editor-editsummary-block input {
+ border: 1px solid #c0c0c0;
+ font-size: 14px;
+ width: 100%;
+ height: 30px;
+ margin: 5px 0 0;
+ padding: 1px 4px;
+}
+
+.tux-editor-editsummary-block input:disabled {
+ background-color: #f8f8f8;
}
.tux-message-editor .editarea {
position: relative;
}
-.tux-message-editor .messagekey {
- color: #252525;
+/* Temporary fix for T111685 */
+.grid .tux-message-editor .messagekey {
+ color: #222;
font-size: 13px;
font-weight: bold;
padding: 5px 0 5px 10px;
@@ -66,7 +104,7 @@
}
.tux-message-editor .messagekey .caret {
- border-top: 4px solid #252525;
+ border-top: 4px solid #222;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
display: inline-block;
@@ -74,7 +112,8 @@
margin: 0 4px;
}
-.tux-message-editor .sourcemessage {
+/* Temporary fix for T111685 */
+.grid .tux-message-editor .sourcemessage {
font-size: 18px;
line-height: 1.6em;
padding: 5px 0 10px 10px;
@@ -89,17 +128,17 @@
font-size: 14px;
}
-.tux-message-editor .button {
- text-overflow: ellipsis;
- font-size: 16px;
- height: 35px;
- margin: 10px 5px;
-}
-
.tux-message-editor .shortcutinfo {
+ color: #54595d;
font-size: 13px;
- color: #555;
padding: 0 5px 5px 10px;
+ display: none;
+}
+
+@media screen and ( min-width: 980px ) {
+ .tux-message-editor .shortcutinfo {
+ display: block;
+ }
}
.tux-message-editor .infocolumn-block .infocolumn {
@@ -112,38 +151,41 @@
overflow: auto;
}
-.tux-message-editor .infocolumn-block {
+/* Temporary fix for T111685 */
+.grid .tux-message-editor .infocolumn-block {
font-size: 12pt;
- background: #FCFCFC;
+ background: #fcfcfc;
position: absolute;
top: 0;
right: 0;
bottom: 0;
padding: 0;
- -webkit-transition: width 0.5s;
transition: width 0.5s;
}
-.tux-message-editor .infocolumn-block .caret:before {
+.tux-message-editor__caret:before,
+.tux-message-editor__caret:after {
border-top: 20px solid transparent;
- border-right: 20px solid #AAA;
+ border-right: 20px solid #aaa;
border-bottom: 20px solid transparent;
- content: "";
+ content: '';
display: inline-block;
left: -21px;
position: absolute;
bottom: 50%;
+ z-index: 2;
+ transition: visibility 0s 0.5s;
}
-.tux-message-editor .infocolumn-block .caret:after {
- border-top: 20px solid transparent;
- border-right: 20px solid #FCFCFC;
- border-bottom: 20px solid transparent;
- content: "";
- display: inline-block;
+.tux-message-editor__caret:after {
+ border-right: 20px solid #fcfcfc;
left: -20px;
- position: absolute;
- bottom: 50%;
+}
+
+.tux-message-editor--expanded .tux-message-editor__caret:before,
+.tux-message-editor--expanded .tux-message-editor__caret:after {
+ visibility: hidden;
+ transition: visibility 0s 0s;
}
.infocolumn-block .infocolumn .message-desc-editor {
@@ -164,7 +206,7 @@
.infocolumn-block .infocolumn .message-desc.long {
font-size: 14px;
- border-bottom: 1px solid #DDD;
+ border-bottom: 1px solid #ddd;
}
.infocolumn-block .infocolumn .message-desc.compact {
@@ -180,16 +222,14 @@
.message-desc-control .read-more {
font-size: 14px;
- color: #3366BB;
+ color: #36c;
cursor: pointer;
margin-right: 5px;
}
.message-desc-edit {
- background: transparent url(../images/action-edit.png) left center no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/action-edit.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/action-edit.svg);
+ background: left center no-repeat;
+ background-image: /* @embed */ linear-gradient( transparent, transparent ), url( ../images/action-edit.svg );
background-size: 18px 18px;
padding-left: 19px;
}
@@ -205,7 +245,7 @@
.in-other-language {
font-size: 14px;
border: 1px solid #ddd;
- border-left: 2px solid #3366BB;
+ border-left: 2px solid #36c;
padding: 5px 5px 5px 10px;
background-color: #f5f5f5;
}
@@ -218,11 +258,11 @@
.tm-suggestion:hover,
.in-other-language:hover {
cursor: pointer;
- box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
+ box-shadow: 0 0 3px rgba( 0, 0, 0, 0.2 );
}
.in-other-language .language {
- color: #565656;
+ color: #54595d;
overflow: hidden;
text-overflow: ellipsis;
}
@@ -242,11 +282,11 @@
}
.tux-warning {
- background-color: #FFFFCC;
+ background-color: #ffc;
}
.tux-highlight {
- background-color: #C9C9C9;
+ background-color: #c9c9c9;
}
.tux-warning-message {
@@ -265,7 +305,7 @@
}
.editarea .tux-more-warnings {
- background-color: #FBF6AD;
+ background-color: #fbf6ad;
position: absolute;
right: 0;
padding: 2px 5px;
@@ -275,31 +315,25 @@
}
.tux-warning-message.validation {
- background-image: url(../images/label-flag.png);
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/label-flag.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/label-flag.svg);
+ background-image: /* @embed */ linear-gradient( transparent, transparent ), url( ../images/label-flag.svg );
}
.tux-warning-message.diff {
- background-image: url(../images/label-clock.png);
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/label-clock.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/label-clock.svg);
+ background-image: /* @embed */ linear-gradient( transparent, transparent ), url( ../images/label-clock.svg );
}
.tux-warning-message .show-diff-link {
- color: #3366BB;
+ color: #36c;
cursor: pointer;
padding-left: 5px;
}
.editarea .tux-more-warnings:before {
- content: "";
- border-bottom: 1em solid #FBF6AD;
+ content: '';
+ border-bottom: 1em solid #fbf6ad;
border-top: 1em solid transparent;
border-left: 1em solid transparent;
- border-right: 1em solid #FBF6AD;
+ border-right: 1em solid #fbf6ad;
display: inline-block;
position: absolute;
right: 100%;
@@ -309,7 +343,7 @@
.tux-editor-request-right {
font-size: 13px;
padding: 0 5px;
- color: #555;
+ color: #54595d;
}
.tux-editor-ask-permission {
@@ -320,47 +354,62 @@
padding: 0 5px;
}
+.tux-editor-editsummary-block {
+ padding: 0 5px;
+}
+
.tux-editor-actions-block {
position: relative;
}
-.tux-editor-actions-block .tux-editor-insert-buttons {
+/* Temporary fix for T111685 */
+.grid .tux-editor-actions-block .tux-editor-insert-buttons {
position: absolute;
- top: -38px;
+ /* 30px + 5px padding on bottom */
+ top: -35px;
margin: 0 10px;
z-index: 110;
}
.tux-editor-insert-buttons button {
- padding: 4px;
- border: 1px solid #DDD;
- background: #FBFBFB;
- color: #252525;
+ padding: 0 5px;
+ min-width: 30px;
+ margin-right: 5px;
+ margin-bottom: 5px;
+ border: 1px solid #ddd;
+ background: #fbfbfb;
+ color: #222;
font-size: 13px;
+ line-height: 30px;
+ height: 30px;
}
.tux-editor-insert-buttons .tux-editor-paste-original-button {
- background: #FBFBFB url(../images/paste.png) left center no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/paste.svg);
+ background: #fbfbfb left center no-repeat;
/* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/paste.svg);
+ background-image: linear-gradient( transparent, transparent ), url( ../images/paste.svg );
background-size: 16px 16px;
padding-left: 18px;
}
+.message-desc-editor .mw-ui-button,
+.tux-editor-control-buttons .mw-ui-button {
+ margin: 10px 5px;
+}
+
.sourcemessage,
.suggestiontext {
white-space: pre-wrap;
}
.infocolumn .loading {
+ color: #54595d;
padding: 10px;
font-size: 14px;
- color: #565656;
}
.tux-message-tools-menu li a {
- color: #555555;
+ color: #54595d;
display: block;
font-size: 14px;
padding: 0 2px;
@@ -370,15 +419,14 @@
.tux-message-tools-menu li a:hover {
cursor: pointer;
background-color: #f0f0f0;
- color: #252525;
+ color: #222;
}
.tux-message-tools-menu li.selected {
- background: url(../images/label-tick.png) right no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/label-tick.svg);
+ background: right no-repeat;
/* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/label-tick.svg);
- color: #252525;
+ background-image: linear-gradient( transparent, transparent ), url( ../images/label-tick.svg );
+ color: #222;
}
/*
@@ -398,19 +446,14 @@
}
.shortcut-popup {
- /* Firefox likes to add "relative" inline for elements with offset */
- position: absolute !important;
- width: 17px;
- height: 17px;
- line-height: 17px;
+ width: 18px;
+ height: 18px;
+ line-height: 18px;
overflow: hidden;
font-size: 13px;
text-align: center;
- border: 1px dashed gray;
+ border: 1px dashed #808080;
border-radius: 100%;
z-index: 110;
- background-color: white;
- margin-top: -10px;
- /* @noflip */
- margin-left: -10px;
+ background-color: #fff;
}
diff --git a/MLEB/Translate/resources/css/ext.translate.groupselector.css b/MLEB/Translate/resources/css/ext.translate.groupselector.css
deleted file mode 100644
index d3fdca56..00000000
--- a/MLEB/Translate/resources/css/ext.translate.groupselector.css
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Breadcrumb
- */
-.tux-breadcrumb {
- margin-bottom: 10px;
-}
-
-.tux-breadcrumb .grouplink + .grouplink:before {
- border-left: 4px solid #777;
- border-top: 4px solid transparent;
- border-bottom: 4px solid transparent;
- content: "";
- display: inline-block;
- vertical-align: middle;
- position: relative;
- left: -5px;
-}
-
-.tux-breadcrumb span {
- border: medium none;
- color: #555555;
- font-size: 14pt;
- font-weight: normal;
- line-height: 1.25em;
- padding-bottom: 3px;
- padding-left: 15px;
- padding-top: 1.25em;
-}
-
-.tux-breadcrumb span.grouptitle {
- float: left;
- padding: 0 6px 0 0;
-}
-
-.tux-breadcrumb span.grouplink {
- color: #0645AD;
- cursor: pointer;
- float: left;
- min-height: 1px;
- padding: 0 6px;
- position: relative;
-}
-
-/**
- * Group selector
- */
-.tux-groupselector {
- position: absolute;
- top: 14px;
- right: 0;
- z-index: 1000;
- display: none;
- float: left;
- margin-top: 13px;
- min-width: 600px;
- width: 600px;
- padding: 0;
- border: 1px solid #888;
- background-color: #F0F0F0;
- border-radius: 5px;
- -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
- -webkit-background-clip: padding-box;
- -moz-background-clip: padding;
- background-clip: padding-box;
- text-align: left;
-}
-
-/* The triangle shaped callout */
-.tux-groupselector:before {
- border-bottom: 7px solid #888;
- border-left: 7px solid transparent;
- border-right: 7px solid transparent;
- content: "";
- display: inline-block;
- left: 99px;
- position: absolute;
- top: -7px;
-}
-
-.tux-groupselector:after {
- border-bottom: 6px solid #F0F0F0;
- border-left: 6px solid transparent;
- border-right: 6px solid transparent;
- content: "";
- display: inline-block;
- left: 100px;
- position: absolute;
- top: -6px;
-}
-
-/* Remove the triangle shaped callout */
-.tux-groupselector.removecallout:before,
-.tux-groupselector.removecallout:after {
- content: none;
-}
-
-.grid .tux-groupselector__title {
- border: none;
- color: #555555;
- font-size: 14pt;
- font-weight: normal;
- line-height: 1.25em;
- padding: 5px 0 0 10px; /* grid override */
- margin: 0;
-}
-
-.tux-groupselector__filter {
- position: relative;
- height: 36px;
- border-bottom: solid 1px #c9c9c9;
-}
-
-.grid .tux-groupselector__filter__tabs {
- position: absolute; /* grid override */
- bottom: 0;
-}
-
-.grid .tux-groupselector__filter__search {
- position: absolute; /* grid override */
- padding-right: 0; /* grid override */
- right: 0;
- bottom: 2px;
-}
-
-.tux-groupselector__filter__search__input {
- font-size: 14px;
- width: 100%;
- height: 28px;
- border: 1px solid #C9C9C9;
- padding: 0 5px;
-}
-
-.tux-groupselector__filter__search__icon {
- background: url('../images/search.png') no-repeat scroll right center transparent;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/search.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/search.svg);
- background-size: 25px;
- height: 28px;
- width: 28px;
- float: right;
-}
-
-.tux-groupselector button {
- height: 32px;
- margin: 5px;
- font-weight: bold;
-}
-
-/*
- * Group tab
- */
-.tux-grouptab {
- color: #252525;
- cursor: pointer;
- padding: 2px 5px;
- margin: 0 4px;
- display: inline-block;
-}
-
-.tux-grouptab--selected {
- border-bottom: 2px solid #0645AD;
-}
-
-/*
- * Group list
- */
-.tux-grouplist {
- max-height: 400px;
- overflow-y: auto;
- overflow-x: hidden;
- background-color: #FFFFFF;
- min-height: 200px;
- border-radius: 0 0 5px 5px;
-}
-
-.tux-grouplist__item {
- position: relative;
- border-bottom: 1px solid #EEEEEE;
- height: 50px;
- cursor: pointer;
-}
-
-.grid .tux-grouplist__item__label {
- padding-bottom: 3px; /* grid override */
- padding-left: 15px; /* grid override */
- font-weight: normal;
- line-height: 40px;
- cursor: pointer;
- white-space: nowrap;
-}
-
-.tux-grouplist__item__label .tux-statsbar {
- position: absolute;
- bottom: 0;
- width: 150px;
-}
-
-.tux-grouplist__item__icon {
- background: url(../images/project.png) no-repeat scroll right center transparent;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/project.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/project.svg);
- /* Keep this in sync with js! */
- background-size: 32px;
- height: 50px;
- width: 50px;
-}
-
-.grid .tux-grouplist__item__subgroups {
- position: absolute; /* grid override */
- padding: 0 15px 2px 0; /* grid override */
- font-weight: normal;
- line-height: 1.25em;
- bottom: 0;
- right: 0;
- text-align: right;
- color: #777;
- font-size: 10pt;
-}
diff --git a/MLEB/Translate/resources/css/ext.translate.helplink.css b/MLEB/Translate/resources/css/ext.translate.helplink.css
deleted file mode 100644
index 26457498..00000000
--- a/MLEB/Translate/resources/css/ext.translate.helplink.css
+++ /dev/null
@@ -1,21 +0,0 @@
-.mw-translate-helplink {
- background: url(../images/help.png) no-repeat scroll left center transparent;
- /* @embed */
- background-image: -webkit-linear-gradient(transparent, transparent), url('../images/help.svg');
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url('../images/help.svg');
- padding-left: 20px;
-}
-
-/* BC for MW <= 1.24 */
-.mw-translate-helplink-wrapper {
- float: right;
- width: 100%;
- display: block;
- margin-top: -10px;
- margin-bottom: -10px;
-}
-
-.mw-translate-helplink-wrapper .mw-translate-helplink {
- float: right;
-}
diff --git a/MLEB/Translate/resources/css/ext.translate.loader.css b/MLEB/Translate/resources/css/ext.translate.loader.css
index 73594ea0..2c6c5619 100644
--- a/MLEB/Translate/resources/css/ext.translate.loader.css
+++ b/MLEB/Translate/resources/css/ext.translate.loader.css
@@ -2,28 +2,27 @@
@-webkit-keyframes tux-loading-indicator-spin {
from {
- -webkit-transform: rotate(0deg);
+ -webkit-transform: rotate( 0deg );
}
to {
- -webkit-transform: rotate(360deg);
+ -webkit-transform: rotate( 360deg );
}
}
@keyframes tux-loading-indicator-spin {
from {
- transform: rotate(0deg);
+ transform: rotate( 0deg );
}
to {
- transform: rotate(360deg);
+ transform: rotate( 360deg );
}
}
.tux-loading-indicator {
float: left;
- background: transparent url(../images/loading.gif) right bottom no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/loading.svg);
+ background: transparent url( ../images/loading.gif ) right bottom no-repeat;
/* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/loading.svg);
+ background-image: linear-gradient( transparent, transparent ), url( ../images/loading.svg );
background-size: 100%;
-webkit-animation-name: tux-loading-indicator-spin;
-webkit-animation-duration: 1.5s;
@@ -43,3 +42,8 @@
left: 50%;
position: absolute;
}
+
+.tux-loading-indicator--stopped {
+ -webkit-animation: none;
+ animation: none;
+}
diff --git a/MLEB/Translate/resources/css/ext.translate.messagetable.css b/MLEB/Translate/resources/css/ext.translate.messagetable.css
deleted file mode 100644
index 5da964d2..00000000
--- a/MLEB/Translate/resources/css/ext.translate.messagetable.css
+++ /dev/null
@@ -1,382 +0,0 @@
-.mw-sp-translate-table {
- width: 100%;
- border-width: 1px;
- border-collapse: collapse;
-}
-
-.mw-sp-translate-table th {
- background-color: #b2b2ff;
- border: 1px solid;
-}
-
-.mw-sp-translate-table tr.orig {
- background-color: #ffe2e2;
-}
-
-.mw-sp-translate-table tr.new {
- background-color: #e2ffe2;
-}
-
-.mw-sp-translate-table tr.def {
- background-color: #f0f0ff;
-}
-
-.mw-sp-translate-table tr.ign {
- background-color: #202020;
-}
-
-.mw-sp-translate-table tr.opt {
- background-color: #F2F200;
-}
-
-.mw-sp-translate-table .untranslated {
- background-color: #a2f290;
-}
-
-.mw-sp-translate-table > tbody > tr > * {
- vertical-align: top;
- border: 1px solid #909090;
-}
-
-.mw-translate-messagereviewbutton {
- float: right;
-}
-
-.mw-translate-messagereviewstatus {
- clear: right;
- text-align: right;
-}
-
-/*
- * Tux MessageTable
- */
-
-/* Default colors */
-.tux-messagelist {
- color: #252525;
- background-color: #F8F8F8;
- max-width: 800px;
-}
-
-.tux-message {
- height: auto;
- cursor: pointer;
-}
-
-/* The "block" views of page mode and proofreading mode have 0 margin on
- * .tux-message. To make the actual editor be of same width, set 0 margin on
- * the open editor (overriding the -5px set by the grid) */
-.grid .tux-message.open {
- margin: 0 auto;
-}
-
-.tux-message-item {
- line-height: 50px;
- height: 50px;
- overflow: hidden;
- margin-right: 5px !important;
- margin-left: 5px !important;
- vertical-align: middle;
- border-bottom: 1px solid #C9C9C9;
- background: #FFFFFF;
-}
-
-.tux-message-item.translated,
-.tux-message-item.translated:hover,
-.tux-message-item.proofread,
-.tux-message-item.proofread:hover {
- background-color: #F0F0F0;
-}
-
-.tux-message-item:hover {
- background-color: #F8F8F8;
-}
-
-.tux-list-status span,
-.tux-list-edit {
- padding: 5px;
- /* 15px space for icon */
- padding-left: 20px;
- /* Do not combine these two, unless you also fix the
- * tux-status-* styles below. That includes you, Siebrand ;)
- */
- background-position: left;
- background-repeat: no-repeat;
-}
-
-.tux-info {
- background-color: #F0F0F0;
-}
-
-.tux-list-source {
- white-space: nowrap;
- text-overflow: ellipsis;
- unicode-bidi: -webkit-isolate;
- unicode-bidi: -moz-isolate;
- unicode-bidi: isolate;
-}
-
-.tux-list-translation {
- white-space: nowrap;
- color: #565656;
- padding-left: 5px;
- text-overflow: ellipsis;
- unicode-bidi: -webkit-isolate;
- unicode-bidi: -moz-isolate;
- unicode-bidi: isolate;
-}
-
-.tux-list-message {
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.tux-status-unsaved {
- background-image: url(../images/label-pen.png);
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/label-pen.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/label-pen.svg);
-}
-
-.tux-status-translated,
-.tux-status-proofread {
- background-image: url(../images/label-tick.png);
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/label-tick.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/label-tick.svg);
-}
-
-.tux-status-fuzzy {
- background-image: url(../images/label-clock.png);
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/label-clock.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/label-clock.svg);
-}
-
-.tux-list-edit a {
- background: transparent url(../images/action-edit.png) left center no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/action-edit.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/action-edit.svg);
- background-size: 18px 18px;
- padding-left: 19px;
-}
-
-.tux-messagetable-loader {
- height: 75px;
- color: #565656;
- padding: 15px;
- top: 0;
- background: #F0F0F0 16px 50%;
- -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 0, 0, 0.1) inset;
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 0, 0, 0.1) inset;
-}
-
-.tux-messagetable-loader-count {
- padding: 0 0 5px 46px;
- font-size: 25px;
-}
-
-.tux-messagetable-loader-more {
- padding-left: 46px;
- font-size: 15px;
-}
-
-.tux-action-bar {
- background-color: #F0F0F0;
- color: #252525;
- -webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
- transition: width 250ms;
-}
-
-.tux-action-bar.floating {
- border-top: 1px solid #DDD;
- position: fixed;
- bottom: 0;
- z-index: 200;
-}
-
-.tux-action-bar .tux-statsbar {
- position: relative;
- top: 30px;
-}
-
-.tux-action-bar .toggle.button {
- min-height: 40px;
- font-size: 14px;
- vertical-align: middle;
- border-radius: 0;
- text-shadow: none;
- margin: 5px 0;
- text-indent: 0;
-}
-
-.tux-action-bar .tux-view-switcher {
- padding: 0 5px;
-}
-
-.tux-action-bar .tux-view-switcher .toggle.button {
- padding: 0 2px 0 0;
-}
-
-.tux-action-bar .tux-view-switcher .toggle.button:first-child {
- border-radius: 3px 0 0 3px;
- border-right: none;
-}
-
-.tux-action-bar .tux-view-switcher .toggle.button:last-child {
- border-radius: 0 3px 3px 0;
- border-left: none;
-}
-
-.tux-action-bar .tux-view-switcher .toggle.button:before {
- content: "";
- height: 15px;
- width: 25px;
- display: inline-block;
- vertical-align: bottom;
-}
-
-.tux-action-bar .translate-mode-button {
- width: 30%;
-}
-
-.tux-action-bar .translate-mode-button:before {
- background: transparent url(../images/view-list.png) center center no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/view-list.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/view-list.svg);
-}
-
-.tux-action-bar .translate-mode-button.down:before {
- background: transparent url(../images/view-list-hi.png) center center no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/view-list-hi.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/view-list-hi.svg);
-}
-
-.tux-action-bar .page-mode-button {
- width: 30%;
-}
-
-.tux-action-bar .page-mode-button:before {
- background: transparent url(../images/view-page.png) center center no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/view-page.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/view-page.svg);
-}
-
-.tux-action-bar .page-mode-button.down:before {
- background: transparent url(../images/view-list-hi.png) center center no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/view-page-hi.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/view-page-hi.svg);
-}
-
-.tux-action-bar .proofread-mode-button {
- width: 36%;
-}
-
-.tux-action-bar .proofread-mode-button:before {
- background: transparent url(../images/view-proofread.png) center center no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/view-proofread.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/view-proofread.svg);
-}
-
-.tux-action-bar .proofread-mode-button.down:before {
- background: transparent url(../images/view-proofread-hi.png) center center no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/view-proofread-hi.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/view-proofread-hi.svg);
-}
-
-.tux-action-bar .toggle.button.down {
- color: #FFF;
- background: #252525;
-}
-
-.ext-translate-container .tux-messagelist .tux-message-filter-result {
- color: #252525;
- line-height: 35px;
- font-size: 15px;
- vertical-align: middle;
- border-bottom: 1px solid #C9C9C9;
- margin: 0;
- padding: 0 5px;
-}
-
-.tux-message-filter-result.highlight {
- background: #FFF5AA;
-}
-
-.tux-message-filter-result .button {
- float: right;
- padding: 5px;
- margin: 5px 0;
- font-size: 15px;
- vertical-align: middle;
-}
-
-.tux-empty-list {
- padding: 20px;
-}
-
-.tux-empty-list-header {
- font-size: 25px;
- padding: 5px 0;
-}
-
-.tux-empty-list-guide {
- font-size: 15px;
- color: #565656;
- padding: 5px 0;
-}
-
-.tux-empty-list-actions {
- font-size: 15px;
- padding: 8px 0;
-}
-
-.tux-empty-list-actions a {
- cursor: pointer;
- margin: 0 10px;
-}
-
-
-.ext-translate-language-selector-label {
- color: #555555;
-}
-
-.ext-translate-language-selector {
- float: right;
- text-align: right;
- border: medium none;
- font-size: 14pt;
- font-weight: normal;
- line-height: 1.25em;
- padding-bottom: 3px;
- padding-left: 15px;
- padding-top: 1.25em;
-}
-
-/* The triangle shaped down-pointing callout after the language name
- * in the target language selector
- */
-.ext-translate-language-selector:after {
- margin-left: 4px;
- border-left: 4px solid transparent;
- border-right: 4px solid transparent;
- border-top: 4px solid #0645AD;
- content: "";
- display: inline-block;
- vertical-align: middle;
-}
-
-.ext-translate-language-selector .uls {
- color: #0645AD;
- cursor: pointer;
- min-height: 1px;
- position: relative;
-}
diff --git a/MLEB/Translate/resources/css/ext.translate.navitoggle.css b/MLEB/Translate/resources/css/ext.translate.navitoggle.css
index 96882ad7..4ac921a7 100644
--- a/MLEB/Translate/resources/css/ext.translate.navitoggle.css
+++ b/MLEB/Translate/resources/css/ext.translate.navitoggle.css
@@ -1,7 +1,7 @@
/**
* Introduces a toggle icon than can be used to hide navigation menu in vector
* @author Niklas Laxström
- * @license GPL-2.0+
+ * @license GPL-2.0-or-later
*/
.tux-navitoggle {
@@ -14,17 +14,15 @@
}
.tux-navitoggle {
- background: url('../images/expand-rtl.png') no-repeat scroll right center transparent;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/expand-rtl.svg);
+ background: no-repeat scroll right center transparent;
/* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/expand-rtl.svg);
+ background-image: linear-gradient( transparent, transparent ), url( ../images/expand-rtl.svg );
}
.tux-navi-collapsed .tux-navitoggle {
- background: url('../images/expand-ltr.png') no-repeat scroll right center transparent;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/expand-ltr.svg);
+ background: no-repeat scroll right center transparent;
/* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/expand-ltr.svg);
+ background-image: linear-gradient( transparent, transparent ), url( ../images/expand-ltr.svg );
}
.tux-navi-collapsed #mw-panel {
diff --git a/MLEB/Translate/resources/css/ext.translate.pagemode.css b/MLEB/Translate/resources/css/ext.translate.pagemode.css
index b249d9d2..d1f1d274 100644
--- a/MLEB/Translate/resources/css/ext.translate.pagemode.css
+++ b/MLEB/Translate/resources/css/ext.translate.pagemode.css
@@ -2,7 +2,7 @@
min-height: 50px;
margin: 0 auto;
vertical-align: middle;
- background: #F8F8F8;
+ background: #f8f8f8;
}
.ext-translate-container .tux-messagelist .tux-message-pagemode .tux-message-item-compact {
@@ -13,26 +13,26 @@
margin-left: auto;
vertical-align: middle;
border-bottom: 1px solid #f0f0f0;
- border-left: 1px solid #DDDDDD;
- border-right: 1px solid #DDDDDD;
- background: #FFFFFF;
+ border-left: 1px solid #ddd;
+ border-right: 1px solid #ddd;
+ background: #fff;
max-width: 900px;
}
.ext-translate-container .tux-messagelist .tux-message-pagemode .tux-message-item-compact:hover {
- background: #FCFCFC;
+ background: #fcfcfc;
}
.ext-translate-container .tux-messagelist .tux-message-pagemode:first-child .tux-message-item-compact {
margin-top: 10px;
padding-top: 60px;
- border-top: 1px solid #DDDDDD;
+ border-top: 1px solid #ddd;
}
.ext-translate-container .tux-messagelist .tux-message-pagemode:last-child .tux-message-item-compact {
margin-bottom: 10px;
padding-bottom: 60px;
- border-bottom: 1px solid #DDDDDD;
+ border-bottom: 1px solid #ddd;
}
.tux-pagemode-source,
@@ -48,7 +48,7 @@
}
.tux-messagelist .tux-message-pagemode .tux-pagemode-source {
- color: #555;
+ color: #54595d;
font-size: 16px;
line-height: 1.5em;
padding-right: 25px;
@@ -56,7 +56,7 @@
}
.tux-messagelist .tux-message-pagemode .tux-pagemode-translation {
- color: #252525;
+ color: #222;
font-size: 16px;
line-height: 1.5em;
padding-left: 20px;
@@ -69,29 +69,25 @@
.tux-pagemode-status {
top: -10px;
+ height: 40px;
}
.tux-pagemode-status.fuzzy {
- background: url(../images/outdated-ltr.png) left center no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/outdated-ltr.svg);
+ background: left center no-repeat;
/* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/outdated-ltr.svg);
- height: 40px;
+ background-image: linear-gradient( transparent, transparent ), url( ../images/outdated-ltr.svg );
}
.tux-pagemode-status.untranslated {
- background: url(../images/translate-ltr.png) left center no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/translate-ltr.svg);
+ background: left center no-repeat;
/* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/translate-ltr.svg);
- height: 40px;
+ background-image: linear-gradient( transparent, transparent ), url( ../images/translate-ltr.svg );
}
.tux-pagemode-action {
- background: url(../images/check-sprite-ltr.png) right top no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/check-sprite-ltr.svg);
+ background: right top no-repeat;
/* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/check-sprite-ltr.svg);
+ background-image: linear-gradient( transparent, transparent ), url( ../images/check-sprite-ltr.svg );
height: 31px;
cursor: pointer;
}
@@ -101,10 +97,7 @@
}
.tux-pagemode-edit {
- background-image: url(../images/edit-mark.png);
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/edit-mark.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/edit-mark.svg);
+ background-image: /* @embed */ linear-gradient( transparent, transparent ), url( ../images/edit-mark.svg );
background-repeat: no-repeat;
background-position: right center;
height: 40px;
diff --git a/MLEB/Translate/resources/css/ext.translate.proofread.css b/MLEB/Translate/resources/css/ext.translate.proofread.css
index 2e9c8d49..69eddee1 100644
--- a/MLEB/Translate/resources/css/ext.translate.proofread.css
+++ b/MLEB/Translate/resources/css/ext.translate.proofread.css
@@ -2,7 +2,7 @@
min-height: 50px;
margin: 0 auto;
vertical-align: middle;
- background: #F8F8F8;
+ background: #f8f8f8;
}
.ext-translate-container .tux-messagelist .tux-message-proofread .tux-message-item-compact {
@@ -12,26 +12,26 @@
margin-left: auto;
vertical-align: middle;
border-bottom: 1px solid #f0f0f0;
- border-left: 1px solid #DDDDDD;
- border-right: 1px solid #DDDDDD;
- background: #FFFFFF;
+ border-left: 1px solid #ddd;
+ border-right: 1px solid #ddd;
+ background: #fff;
max-width: 900px;
}
.ext-translate-container .tux-messagelist .tux-message-proofread .tux-message-item-compact:hover {
- background: #FCFCFC;
+ background: #fcfcfc;
}
.ext-translate-container .tux-messagelist .tux-message-proofread:first-child .tux-message-item-compact {
margin-top: 10px;
padding-top: 60px;
- border-top: 1px solid #DDDDDD;
+ border-top: 1px solid #ddd;
}
.ext-translate-container .tux-messagelist .tux-message-proofread:last-child .tux-message-item-compact {
margin-bottom: 10px;
padding-bottom: 60px;
- border-bottom: 1px solid #DDDDDD;
+ border-bottom: 1px solid #ddd;
}
.tux-proofread-source,
@@ -48,7 +48,7 @@
}
.tux-messagelist .tux-message-proofread .tux-proofread-source {
- color: #555;
+ color: #54595d;
font-size: 16px;
line-height: 1.5em;
padding-right: 25px;
@@ -56,7 +56,7 @@
}
.tux-messagelist .tux-message-proofread .tux-proofread-translation {
- color: #252525;
+ color: #222;
font-size: 16px;
line-height: 1.5em;
padding-left: 20px;
@@ -69,21 +69,24 @@
.ext-translate-container .tux-messagelist .tux-message-proofread.own-translation,
.ext-translate-container .tux-messagelist .tux-message-proofread.own-translation:hover {
- background: #FBFBFB;
+ background: #fbfbfb;
+}
+
+.tux-messagelist.tux-hide-own .tux-message-proofread.own-translation {
+ display: none;
}
.translated-by-self {
- color: #777;
+ color: #72777d;
text-align: right;
font-size: 12px;
margin-right: 5px;
margin-left: auto;
width: 18px;
height: 18px; /* Icon height + 3px */
- background: url(../images/user-small.png) top right no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/user-small.svg);
+ background: top right no-repeat;
/* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/user-small.svg);
+ background-image: linear-gradient( transparent, transparent ), url( ../images/user-small.svg );
}
.tux-proofread-status {
@@ -91,28 +94,23 @@
}
.tux-proofread-status.fuzzy {
- background: url(../images/outdated-ltr.png) left center no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/outdated-ltr.svg);
+ background: left center no-repeat;
/* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/outdated-ltr.svg);
+ background-image: linear-gradient( transparent, transparent ), url( ../images/outdated-ltr.svg );
height: 40px;
}
.tux-proofread-status.untranslated {
- background: url(../images/translate-ltr.png) left center no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/translate-ltr.svg);
+ background: left center no-repeat;
/* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/translate-ltr.svg);
+ background-image: linear-gradient( transparent, transparent ), url( ../images/translate-ltr.svg );
height: 40px;
}
.tux-proofread-action {
background-position: right top;
background-repeat: no-repeat;
- background-image: url(../images/check-sprite-ltr.png);
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/check-sprite-ltr.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/check-sprite-ltr.svg);
+ background-image: /* @embed */ linear-gradient( transparent, transparent ), url( ../images/check-sprite-ltr.svg );
/* There is 1px white row between each icon */
height: 30px;
cursor: pointer;
@@ -141,10 +139,7 @@
}
.tux-proofread-edit {
- background-image: url(../images/edit-mark.png);
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/edit-mark.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/edit-mark.svg);
+ background-image: /* @embed */ linear-gradient( transparent, transparent ), url( ../images/edit-mark.svg );
background-repeat: no-repeat;
background-position: right center;
height: 50px;
@@ -158,8 +153,8 @@
}
.tux-proofread-edit-label {
+ color: #72777d;
position: relative;
- color: #777777;
display: inline-block;
font-size: 13px;
padding-top: 30px;
@@ -167,7 +162,7 @@
}
.tux-proofread-count {
- color: #777;
+ color: #72777d;
font-size: 15px;
padding-right: 5px;
text-align: right;
@@ -176,10 +171,9 @@
.tux-proofread-count:before {
content: '';
display: inline-block;
- background: url(../images/check-small.png) left bottom no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/check-small.svg);
+ background: left bottom no-repeat;
/* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/check-small.svg);
+ background-image: linear-gradient( transparent, transparent ), url( ../images/check-small.svg );
height: 12px;
width: 14px;
}
diff --git a/MLEB/Translate/resources/css/ext.translate.quickedit.css b/MLEB/Translate/resources/css/ext.translate.quickedit.css
index 3e8c7efc..c64d03fa 100644
--- a/MLEB/Translate/resources/css/ext.translate.quickedit.css
+++ b/MLEB/Translate/resources/css/ext.translate.quickedit.css
@@ -1,25 +1,5 @@
-.mw-ajax-dialog .mw-ajax-loader {
- margin: 2em;
-}
-
-.mw-ajax-dialog {
- font-size: small;
-}
-
-.tqe-inlineeditable {
- height: auto;
-}
-
-table .tqe-inlineeditable .mw-ajax-dialog {
- margin: 10px;
-}
-
-.tqe-editor-loaded {
- background-color: #FFF !important;
-}
-
.mw-sp-translate-edit-fields a {
- color: blue;
+ color: #00f;
}
.mw-translate-tmsug {
@@ -29,7 +9,7 @@ table .tqe-inlineeditable .mw-ajax-dialog {
.mw-sp-translate-edit-fields fieldset {
line-height: normal;
margin: 0;
- border: 1px solid #DBDBDB;
+ border: 1px solid #dbdbdb;
/* Browsers suck
max-height: 250px; */
overflow: auto;
@@ -40,7 +20,7 @@ table .tqe-inlineeditable .mw-ajax-dialog {
}
.mw-translate-edit-extra {
- border-bottom: 1px solid black;
+ border-bottom: 1px solid #000;
}
.mw-translate-legend {
@@ -48,7 +28,7 @@ table .tqe-inlineeditable .mw-ajax-dialog {
}
.mw-translate-legend {
- border-left: 1px solid black;
+ border-left: 1px solid #000;
float: right;
margin-left: 1em;
padding-left: 5pt;
@@ -101,51 +81,23 @@ table .tqe-inlineeditable .mw-ajax-dialog {
/* Blue tints for translate fieldsets */
.mw-sp-translate-edit-inother {
- background-color: #F8F8FF;
+ background-color: #f8f8ff;
}
.mw-sp-translate-in-other-small {
- background-color: #F0F8FF;
+ background-color: #f0f8ff;
}
.mw-sp-translate-in-other-big {
- background-color: #F0F8FF;
+ background-color: #f0f8ff;
}
.mw-sp-translate-message-documentation {
- background-color: #EBEBEB;
+ background-color: #ebebeb;
}
.mw-sp-translate-edit-definition {
- background-color: #EAF3FC;
-}
-
-.mw-sp-translate-edit-warnings {
- background-color: #FFDBDB;
-}
-
-.mw-translate-edit-tmsugs {
- background-color: #C0F9B6;
-}
-
-.mw-sp-translate-latestchange {
- padding-bottom: 0;
-}
-
-.tqe-fakeheader {
- border: 1px solid #CCC;
- padding: .75em;
- font-weight: bold;
- line-height: 2em;
-}
-
-.tqe-fakeheader input {
- height: 2em;
- font-weight: bold;
-}
-
-.mw-translate-close {
- float: right;
+ background-color: #eaf3fc;
}
.mw-translate-inputs {
diff --git a/MLEB/Translate/resources/css/ext.translate.special.aggregategroups.css b/MLEB/Translate/resources/css/ext.translate.special.aggregategroups.css
index 7b7b3385..98c80b09 100644
--- a/MLEB/Translate/resources/css/ext.translate.special.aggregategroups.css
+++ b/MLEB/Translate/resources/css/ext.translate.special.aggregategroups.css
@@ -1,31 +1,22 @@
span.tp-aggregate-remove-ag-button,
span.tp-aggregate-remove-button {
- background: url(../images/remove.png) no-repeat scroll left center transparent;
- /* @embed */
- background-image: -webkit-linear-gradient(transparent, transparent), url('../images/remove.svg');
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url('../images/remove.svg');
+ background: no-repeat scroll left center transparent;
+ background-image: /* @embed */ linear-gradient( transparent, transparent ), url( ../images/remove.svg );
padding: 10px;
cursor: pointer;
}
span.tp-aggregate-edit-ag-button {
- background: url(../images/action-edit.png) no-repeat scroll left center transparent;
- /* @embed */
- background-image: -webkit-linear-gradient(transparent, transparent), url('../images/action-edit.svg');
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url('../images/action-edit.svg');
+ background: no-repeat scroll left center transparent;
+ background-image: /* @embed */ linear-gradient( transparent, transparent ), url( ../images/action-edit.svg );
background-size: 18px 18px;
padding: 10px;
cursor: pointer;
}
a.tpt-add-new-group {
- background: url(../images/add.png) no-repeat scroll left center transparent;
- /* @embed */
- background-image: -webkit-linear-gradient(transparent, transparent), url('../images/add.svg');
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url('../images/add.svg');
+ background: no-repeat scroll left center transparent;
+ background-image: /* @embed */ linear-gradient( transparent, transparent ), url( ../images/add.svg );
padding-left: 20px;
}
@@ -48,3 +39,15 @@ div.hidden {
.tp-aggregategroup-edit-description {
width: 500px;
}
+
+.client-nojs .tpt-add-new-group,
+.client-nojs .tp-aggregate-edit-ag-button,
+.client-nojs .tp-aggregate-remove-button,
+.client-nojs .tp-aggregate-remove-ag-button,
+.client-nojs .mw-tpa-group input {
+ display: none;
+}
+
+.client-js .tux-nojs {
+ display: none;
+}
diff --git a/MLEB/Translate/resources/css/ext.translate.special.languagestats.css b/MLEB/Translate/resources/css/ext.translate.special.languagestats.css
index 79bf9a18..0e9a7bb0 100644
--- a/MLEB/Translate/resources/css/ext.translate.special.languagestats.css
+++ b/MLEB/Translate/resources/css/ext.translate.special.languagestats.css
@@ -1,5 +1,5 @@
-.mw-sp-translate-table.wikitable tr:hover td {
- background: white;
+.statstable tr:hover td {
+ background: #fff;
}
.groupexpander-all {
diff --git a/MLEB/Translate/resources/css/ext.translate.special.managetranslatorsandbox.css b/MLEB/Translate/resources/css/ext.translate.special.managetranslatorsandbox.css
index a00c27e0..bd463a29 100644
--- a/MLEB/Translate/resources/css/ext.translate.special.managetranslatorsandbox.css
+++ b/MLEB/Translate/resources/css/ext.translate.special.managetranslatorsandbox.css
@@ -3,7 +3,7 @@
* @author Niklas Laxström
* @author Sucheta Ghoshal
* @author Pau Giner
- * @license GPL-2.0+
+ * @license GPL-2.0-or-later
*/
/* Hide the page title to give more space for the content */
@@ -20,11 +20,9 @@
font-size: 24px;
}
-.search.pane {
- background: url('../images/search.png') no-repeat scroll left top transparent;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/search.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/search.svg);
+.grid .search.pane {
+ background: no-repeat scroll left top transparent;
+ background-image: /* @embed */ linear-gradient( transparent, transparent ), url( ../images/search.svg );
background-size: 25px;
padding-left: 25px;
}
@@ -33,13 +31,13 @@
font-size: 14px;
height: 28px;
width: 100%;
- border: 1px solid #C9C9C9;
+ border: 1px solid #c9c9c9;
padding: 0 5px;
}
.tsb-body {
border: 1px solid #c9c9c9;
- border-top: none;
+ border-top: 0;
}
.requests.pane,
@@ -52,16 +50,16 @@
overflow: auto;
}
-.details.pane {
- border-left: 1px solid #DDDDDD;
+.grid .details.pane {
+ border-left: 1px solid #ddd;
left: -1px;
padding: 5px 20px 10px 20px;
}
/* Requests pane */
-.requests.pane,
-.requests.pane .request,
-.requests.pane .request-header {
+.grid .requests.pane,
+.grid .requests.pane .request,
+.grid .requests.pane .request-header {
margin: 0;
padding: 0;
}
@@ -73,7 +71,7 @@
}
.request:last-child {
- border-bottom: none;
+ border-bottom: 0;
}
.request:hover {
@@ -84,10 +82,10 @@
background-color: #f0f0f0;
}
-.request .amount {
+.grid .request .amount {
height: 100%;
font-size: 3em;
- color: #96989A;
+ color: #96989a;
background-color: #f7f8f8;
padding: 20px 5px;
text-align: center;
@@ -98,7 +96,7 @@
height: 30px;
line-height: 30px;
font-size: 16px;
- text-wrap: nowrap;
+ white-space: nowrap;
}
.request .email,
@@ -107,14 +105,14 @@
line-height: 20px;
font-size: 12px;
color: #6c6d70;
- text-wrap: nowrap;
+ white-space: nowrap;
}
.request .tsb-header,
.request .username,
.request .email {
padding-left: 10px;
- overflow: ellipsis;
+ text-overflow: ellipsis;
}
.request .signup-age {
@@ -122,23 +120,23 @@
overflow: hidden;
}
-.request .request-info,
-.request .approval {
+.grid .request .request-info,
+.grid .request .approval {
padding-top: 5px;
}
/* Details pane */
.tsb-details-no-translations {
- color: #999999;
+ color: #72777d;
}
.signup-comment-label {
- color: #E85355;
+ color: #e85355;
font-size: 14px;
}
.signup-comment-text {
- color: #333333;
+ color: #222;
font-size: 16px;
line-height: 1.5em;
padding: 5px 0;
@@ -179,25 +177,25 @@
font-size: 22px;
}
-.actions .button {
+.actions button {
margin-right: 1.5em;
}
.request-header {
+ color: #72777d;
border-right: 1px solid #c9c9c9;
- border-bottom: 1px solid #AAAAAA;
+ border-bottom: 1px solid #aaa;
line-height: 40px;
- color: #969696;
- background-color: #F8F8F8;
+ background-color: #f8f8f8;
}
.request-footer {
+ color: #72777d;
border-right: 1px solid #c9c9c9;
- border-top: 1px solid #AAAAAA;
- color: #969696;
+ border-top: 1px solid #aaa;
line-height: 40px;
padding: 0 5px;
- background-color: #F8F8F8;
+ background-color: #f8f8f8;
}
.request-footer .selected-counter,
@@ -212,17 +210,16 @@
margin: 10px 0;
border-radius: 3px;
background: #f8f8f8;
- border: 1px solid #CCCCCC;
+ border: 1px solid #ccc;
cursor: pointer;
font-size: 1em;
display: block;
float: left;
- border-radius: 3px;
}
.clear-language-selector {
border-radius: 0 3px 3px 0;
- border-left: none;
+ border-left: 0;
}
.language-selector.selected {
@@ -236,12 +233,12 @@
}
.language-selector:hover {
- border-color: #AAAAAA;
+ border-color: #aaa;
}
.language-selector.unselected:after {
- content: "";
- border-top: 4px solid #AAAAAA;
+ content: '';
+ border-top: 4px solid #aaa;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
display: inline-block;
@@ -262,7 +259,7 @@ textarea.body {
.translations .title {
font-size: 16px;
- background-color: #F7F8F8;
+ background-color: #f7f8f8;
font-weight: bold;
}
@@ -276,3 +273,11 @@ textarea.body {
*/
text-align: left;
}
+
+.client-nojs .grid {
+ display: none;
+}
+
+.client-js .tux-nojs {
+ display: none;
+}
diff --git a/MLEB/Translate/resources/css/ext.translate.special.pagemigration.css b/MLEB/Translate/resources/css/ext.translate.special.pagemigration.css
index 514bab8a..09c313b0 100644
--- a/MLEB/Translate/resources/css/ext.translate.special.pagemigration.css
+++ b/MLEB/Translate/resources/css/ext.translate.special.pagemigration.css
@@ -2,11 +2,11 @@
.mw-tpm-sp-unit__target {
overflow-y: auto;
height: 150px;
- border: 2px solid gray;
+ border: 2px solid #808080;
}
-.mw-tpm-sp-unit__actions {
- border: 2px solid transparent;
+#title {
+ width: 35%;
}
.hide {
@@ -22,6 +22,10 @@
padding-bottom: 10px;
}
+.grid .mw-tpm-sp-unit textarea {
+ padding: 10px;
+}
+
.mw-tpm-sp-unit__source,
.mw-tpm-sp-unit__target,
.mw-tpm-sp-unit__actions {
@@ -29,37 +33,45 @@
}
.mw-tpm-sp-action {
- width: 10%;
- height: 10%;
- float: left;
- margin-left: 5%;
- margin-right: 5%;
+ width: 25px;
+ height: 150px;
cursor: pointer;
display: inline-block;
+ margin-left: 20px;
+
+ background-position: center;
+ background-repeat: no-repeat;
+ background-size: 25px 25px;
}
.mw-tpm-sp-action--delete {
- background: url('../images/trash_darkgray.png') transparent no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url('../images/trash_darkgray.svg');
- background-image: linear-gradient(transparent, transparent), url('../images/trash_darkgray.svg');
+ background-image: linear-gradient( transparent, transparent ), url( ../images/trash_darkgray.svg );
}
.mw-tpm-sp-action--swap {
- background: url('../images/switch.png') transparent no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url('../images/switch.svg');
- background-image: linear-gradient(transparent, transparent), url('../images/switch.svg');
+ background-image: linear-gradient( transparent, transparent ), url( ../images/switch.svg );
}
.mw-tpm-sp-action--add {
- background: url('../images/plus_darkgray.png') transparent no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url('../images/plus_darkgray.svg');
- background-image: linear-gradient(transparent, transparent), url('../images/plus_darkgray.svg');
+ background-image: linear-gradient( transparent, transparent ), url( ../images/plus_darkgray.svg );
}
.mw-tpm-sp-error__message {
font-size: 0.9em;
word-wrap: break-word;
- color: #C00;
- border: 1px solid #FAC5C5;
- background-color: #FAE3E3;
-} \ No newline at end of file
+ color: #c00;
+ border: 1px solid #fac5c5;
+ background-color: #fae3e3;
+}
+
+.mw-tpm-sp-instructions {
+ margin: 0.7em 0;
+}
+
+.client-nojs .grid {
+ display: none;
+}
+
+.client-js .tux-nojs {
+ display: none;
+}
diff --git a/MLEB/Translate/resources/css/ext.translate.special.searchtranslations.css b/MLEB/Translate/resources/css/ext.translate.special.searchtranslations.css
index d4d0ae56..c866a818 100644
--- a/MLEB/Translate/resources/css/ext.translate.special.searchtranslations.css
+++ b/MLEB/Translate/resources/css/ext.translate.special.searchtranslations.css
@@ -4,17 +4,23 @@
* @since 2013-01-10
*/
-/* Facets */
-.tux-searchpage .facet {
- font-size: 24px;
- color: #252525;
- padding: 20px 0 10px 0;
+.tux-searchpage .tux-selectedbox .facet-item {
+ background-color: #ededed;
+ margin-right: 5px;
}
+.tux-searchpage .tux-searchboxform .tux-selectedbox,
.tux-searchpage .searchcontent .facets {
padding: 0 15px 0 5px;
}
+/* Facets */
+.tux-searchpage .facet {
+ color: #222;
+ font-size: 24px;
+ padding: 20px 0 10px 0;
+}
+
.tux-searchpage .facet-item {
font-size: 16px;
padding: 4px 5px;
@@ -25,12 +31,12 @@
cursor: pointer;
}
-.tux-searchpage .facet-item:first-child {
+.grid.tux-searchpage .facet-item:first-child {
margin-top: 10px;
}
.tux-searchpage .facet-item .facet-count {
- color: #AAA;
+ color: #aaa;
float: right;
margin-right: 5%;
}
@@ -55,15 +61,20 @@
font-weight: bold;
}
+.tux-searchpage .facet-item a:visited,
+.tux-searchpage .facet-item a:link {
+ color: #0645ad;
+}
+
/* Results */
.tux-searchpage .count {
- color: #555;
+ color: #54595d;
font-size: 16px;
padding-bottom: 10px;
}
.tux-searchpage .searchcontent .results {
- color: #252525;
+ color: #222;
padding-left: 10px;
}
@@ -75,7 +86,7 @@
.tux-searchpage .results .tux-title {
text-align: left;
- color: #555;
+ color: #54595d;
}
/* Pagination links */
@@ -96,43 +107,13 @@
}
.tux-searchpage .searchinput .searchinputbox {
- font-size: 16px;
- padding: 5px;
width: 60%;
-}
-
-.tux-searchpage .searchinput input.button {
- font-size: 16px;
- background-color: #E6E6E6;
- background-image: -webkit-linear-gradient(top, #f0f0f0, #e6e6e6);
- background-image: -moz-linear-gradient(center top, #F0F0F0, #E6E6E6);
- background-image: linear-gradient(#F0F0F0, #E6E6E6);
- border: 1px solid #C9C9C9;
- border-radius: 3px 3px 3px 3px;
- color: #252525;
- cursor: pointer;
display: inline-block;
- padding: 6px 20px;
- text-align: center;
- text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
- margin: 0 5px;
-}
-
-.tux-searchpage .searchinput input.button:hover {
- background-color: #F0F0F0;
- background-image: -webkit-linear-gradient(top, #f8f8f8, #f0f0f0);
- background-image: -moz-linear-gradient(center top, #F8F8F8, #F0F0F0);
- background-image: linear-gradient(#F8F8F8, #F0F0F0);
- border-color: #C9C9C9;
+ margin-right: 5px;
}
-.tux-searchpage .searchinput input.button:active,
-.tux-searchpage .searchinput input.button.down {
- background-color: #D8D8D8;
- background-image: -webkit-linear-gradient(top, #d3d3d3, #d8d8d8);
- background-image: -moz-linear-gradient(center top, #D3D3D3, #D8D8D8);
- background-image: linear-gradient(#D3D3D3, #D8D8D8);
- border-color: #C9C9C9;
+.tux-search-operators {
+ margin: 5px 0;
}
h1.firstHeading {
@@ -141,24 +122,44 @@ h1.firstHeading {
.translate-search-more-groups,
.translate-search-more-languages {
- background-color: #F0F0F0;
+ background-color: #f0f0f0;
font-size: 16px;
cursor: pointer;
padding: 0 6px;
border-radius: 2px;
- border: 1px solid #EEE;
+ border: 1px solid #eee;
}
.translate-search-more-groups:hover,
.translate-search-more-languages:hover {
- border: 1px solid #CCC;
+ border: 1px solid #ccc;
text-decoration: none;
}
.translate-search-more-groups-info,
.translate-search-more-languages-info {
- padding: 5px;
- color: #888;
+ color: #72777d;
font-size: 14px;
padding: 0 8px;
}
+
+/* Override tabs */
+.tux-searchpage .tux-messagetable-header .seven {
+ width: 100%;
+}
+
+.tux-searchpage .tux-message-selector .more ul {
+ width: auto;
+}
+
+.tux-searchpage .tux-message-selector .more ul a {
+ white-space: pre-wrap;
+}
+
+.tux-searchpage .successbox {
+ margin-left: 25%;
+}
+
+.tux-search-highlight {
+ background-color: #c9c9c9;
+}
diff --git a/MLEB/Translate/resources/css/ext.translate.special.supportedlanguages.css b/MLEB/Translate/resources/css/ext.translate.special.supportedlanguages.css
index 7cca22dd..fff66837 100644
--- a/MLEB/Translate/resources/css/ext.translate.special.supportedlanguages.css
+++ b/MLEB/Translate/resources/css/ext.translate.special.supportedlanguages.css
@@ -16,5 +16,5 @@
.tagcloud .tag {
white-space: nowrap;
margin: 0.5ex;
- color: black;
+ color: #000;
}
diff --git a/MLEB/Translate/resources/css/ext.translate.special.translate.css b/MLEB/Translate/resources/css/ext.translate.special.translate.css
index e34c8720..8bb45be8 100644
--- a/MLEB/Translate/resources/css/ext.translate.special.translate.css
+++ b/MLEB/Translate/resources/css/ext.translate.special.translate.css
@@ -1,35 +1,78 @@
/*
- * Form at Special:Translate
+ * Breadcrumb for message group selector
*/
-.mw-sp-translate-error {
- font-style: italic;
- background-color: yellow;
+.tux-breadcrumb {
+ color: #54595d;
+ margin-bottom: 10px;
+ font-size: 14pt;
+ line-height: 1.25em;
}
-/* This gets pretty far on wide screens... */
-.mw-sp-translate-settings input[type=submit] {
- float: right;
+/* Arrow between breadcrumb items */
+.tux-breadcrumb .grouplink + .grouplink:before {
+ border-left: 4px solid #777;
+ border-top: 4px solid transparent;
+ border-bottom: 4px solid transparent;
+ content: '';
+ display: inline-block;
+ vertical-align: middle;
+ position: relative;
+ left: -5px;
}
-/* For some reason a non-breaking space is not enough to keep the label
- * with the dropdown. */
-.mw-sp-translate-settings label {
- white-space: nowrap;
+/* This applies to all items in the breadcrumb */
+.tux-breadcrumb .grouptitle {
+ float: left;
+ padding: 0 6px 0 0;
}
-/*
- * This reserves one corner with curvy lines for the message group status.
- */
-#mw-sp-translate-workflow {
+/* Not all of these are links, so name is wrong besides being too generic.
+ * This excludes the first item which says "message group". */
+.tux-breadcrumb .grouplink {
+ padding: 0 6px;
+}
+
+/* Color clickable groups to look as links */
+.tux-breadcrumb__item--aggregate {
+ cursor: pointer;
+ color: #0645ad;
+}
+
+/* Language selector */
+.ext-translate-language-selector-label {
+ color: #54595d;
+}
+
+.ext-translate-language-selector {
float: right;
+ text-align: right;
+ border: medium none;
+ font-size: 14pt;
+ font-weight: normal;
+ line-height: 1.25em;
+ padding-bottom: 3px;
+ padding-left: 15px;
+ padding-top: 1.25em;
+}
+
+/* The triangle shaped down-pointing callout after the language name
+ * in the target language selector
+ */
+.ext-translate-language-selector .uls:after {
+ margin-left: 4px;
+ border-left: 4px solid transparent;
+ border-right: 4px solid transparent;
+ border-top: 4px solid #0645ad;
+ content: '';
+ display: inline-block;
vertical-align: middle;
- padding: 0.5em;
- margin-left: 20px;
- margin-right: -1em;
- margin-top: -1em;
- border-bottom: 2px dotted #666;
- border-left: 1px dotted #AAA;
- border-bottom-left-radius: 10px;
+}
+
+.ext-translate-language-selector .uls {
+ color: #0645ad;
+ cursor: pointer;
+ min-height: 1px;
+ position: relative;
}
.tux-message-selector {
@@ -39,7 +82,7 @@
list-style: none;
}
-.tux-message-selector li {
+.tux-message-selector .column {
border: medium none;
font-size: 14pt;
cursor: pointer;
@@ -88,28 +131,28 @@
}
.tux-message-selector li.selected {
- border-bottom: 2px solid #3366BB;
+ border-bottom: 2px solid #36c;
}
.tux-message-selector li.selected a {
- color: #3366BB;
+ color: #36c;
}
.tux-message-selector li a {
- color: #555555;
+ color: #54595d;
text-decoration: none;
white-space: nowrap;
margin-left: 1px;
}
.tux-message-selector label {
+ color: #54595d;
font-size: 12pt;
- color: #555555;
top: 1px;
}
.tux-editor-header {
- color: #252525;
+ color: #222;
font-size: 14px;
padding-bottom: 20px;
}
@@ -119,7 +162,7 @@
}
.group-warning {
- background: #FFF5AA;
+ background: #fff5aa;
padding: 5px;
margin: 5px 0;
}
@@ -132,40 +175,46 @@
padding-top: 5px;
border-bottom: 1px solid #777;
/* @noflip */
- -webkit-box-shadow: 0 3px 3px -3px rgba(0, 0, 0, 0.5);
- /* @noflip */
- box-shadow: 0 3px 3px -3px rgba(0, 0, 0, 0.5);
+ box-shadow: 0 3px 3px -3px rgba( 0, 0, 0, 0.5 );
font-size: 14px;
margin: 0;
list-style: none;
transition: width 250ms;
}
-.tux-messagetable-header.floating {
- background: white;
- position: fixed;
- padding-top: 5px;
- top: 0;
- z-index: 200;
-}
+@media screen and ( min-height: 600px ) {
+ .tux-messagetable-header.floating {
+ background: #fff;
+ position: fixed;
+ padding-top: 5px;
+ top: 0;
+ z-index: 200;
+ }
-.tux-messagetable-header.floating+.tux-messagelist {
- margin-top: 50px;
+ .tux-messagetable-header.floating + .tux-messagelist {
+ margin-top: 50px;
+ }
}
-.tux-messagetable-header .tux-message-filter-box {
+.tux-message-filter-box {
font-size: 14px;
height: 28px;
- border: 1px solid #C9C9C9;
+ border: 1px solid #c9c9c9;
width: 100%;
padding: 0 5px;
}
-.tux-messagetable-header .tux-message-filter-box-icon {
- background: url('../images/search.png') no-repeat scroll right center transparent;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/search.svg);
- /* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/search.svg);
+.tux-message-filter-wrapper {
+ background: no-repeat scroll left center transparent;
+ background-image: /* @embed */ linear-gradient( transparent, transparent ), url( ../images/search.svg );
background-size: 25px;
- height: 28px;
+ padding-left: 30px;
+}
+
+.client-nojs .tux-messagetable-header {
+ display: none;
+}
+
+.client-js .tux-nojs {
+ display: none;
}
diff --git a/MLEB/Translate/resources/css/ext.translate.special.translationstash.css b/MLEB/Translate/resources/css/ext.translate.special.translationstash.css
index 5031c9ef..f451cb53 100644
--- a/MLEB/Translate/resources/css/ext.translate.special.translationstash.css
+++ b/MLEB/Translate/resources/css/ext.translate.special.translationstash.css
@@ -1,6 +1,6 @@
/**
* @author Santhosh Thottingal
- * @license GPL-2.0+
+ * @license GPL-2.0-or-later
* @since 2013.10
*/
@@ -10,17 +10,17 @@ h1.firstHeading {
h1 {
text-decoration: none;
- border-bottom: none;
+ border-bottom: 0;
}
.translate-welcome-header > p {
- color: #555555;
+ color: #54595d;
font-size: 1.2em;
}
.translate-welcome-header {
- background-color: #F8F8F8;
- background-image: linear-gradient(#fAFAFA, #f8f8f8);
+ background-color: #f8f8f8;
+ background-image: linear-gradient( #fafafa, #f8f8f8 );
border-bottom: 1px solid #eee;
padding: 10px;
}
@@ -37,20 +37,19 @@ h1 {
}
.translate-stash-control {
+ color: #54595d;
font-size: 1.5em;
- color: #555555;
padding: 35px 10px 20px 5px;
}
.ext-translate-language-selector-label {
- color: #555555;
+ color: #54595d;
}
.ext-translate-language-selector {
text-align: right;
}
-
/* The triangle shaped down-pointing callout after the language name
* in the target language selector
*/
@@ -58,8 +57,8 @@ h1 {
margin-left: 4px;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
- border-top: 4px solid #0645AD;
- content: "";
+ border-top: 4px solid #0645ad;
+ content: '';
display: inline-block;
vertical-align: middle;
}
@@ -87,7 +86,7 @@ h1 {
}
.tux-message:first-child .tux-message-item {
- border-top: 1px solid #C9C9C9;
+ border-top: 1px solid #c9c9c9;
}
.tux-message-item.translated {
diff --git a/MLEB/Translate/resources/css/ext.translate.statsbar.css b/MLEB/Translate/resources/css/ext.translate.statsbar.css
index 95a96ad2..32df390c 100644
--- a/MLEB/Translate/resources/css/ext.translate.statsbar.css
+++ b/MLEB/Translate/resources/css/ext.translate.statsbar.css
@@ -2,29 +2,26 @@
max-width: 400px;
padding: 0;
height: 5px;
- background-color: #BBB;
+ background-color: #bbb;
}
.tux-statsbar span {
height: 5px;
float: left;
padding: 0;
- -webkit-transition: width 1s;
- -moz-transition: width 1s;
- -o-transition: width 1s;
transition: width 1s;
}
.tux-statsbar .tux-proofread {
- background-color: #23567F;
+ background-color: #00af89;
}
.tux-statsbar .tux-translated {
- background-color: #3A89C9;
+ background-color: #2a4b8d;
}
.tux-statsbar .tux-fuzzy {
- background-color: #EBCC6E;
+ background-color: #fc3;
}
.tux-statsbar .tux-untranslated {
@@ -32,9 +29,9 @@
}
.tux-statsbar-info {
+ color: #72777d;
font-weight: normal;
line-height: 1.25em;
- color: #777;
font-size: 10pt;
position: absolute;
padding-top: 5px;
diff --git a/MLEB/Translate/resources/css/ext.translate.workflowselector.css b/MLEB/Translate/resources/css/ext.translate.workflowselector.css
index f8ce19b6..0181650d 100644
--- a/MLEB/Translate/resources/css/ext.translate.workflowselector.css
+++ b/MLEB/Translate/resources/css/ext.translate.workflowselector.css
@@ -1,44 +1,53 @@
.tux-workflow-status {
background: #eee;
+ color: #222;
border: 1px solid #ddd;
- color: #252525;
cursor: pointer;
display: inline-block;
padding: 2px 4px;
- margin: 5px 0;
+ margin-top: 5px;
+ min-width: 150px;
}
.tux-workflow-status:hover {
border: 1px solid #c9c9c9;
}
-.tux-workflow-status:after {
- margin-left: 3px;
+.tux-workflow-status-triangle {
+ float: right;
+}
+
+.tux-workflow-status-triangle:after {
+ margin: 3px;
border-left: 3px solid transparent;
border-right: 3px solid transparent;
border-top: 3px solid #555;
- content: "";
+ content: '';
display: inline-block;
vertical-align: middle;
}
+ul.tux-workflow-status-selector {
+ min-width: 150px;
+ margin-top: -1px;
+}
+
.tux-workflow-status-selector li {
- color: #555555;
+ color: #54595d;
display: block;
font-size: 14px;
padding: 0 2px;
}
.tux-workflow-status-selector li.changeable:hover {
- cursor: pointer;
background-color: #f0f0f0;
- color: #252525;
+ color: #222;
+ cursor: pointer;
}
.tux-workflow-status-selector li.selected {
- background: url(../images/label-tick.png) right no-repeat;
- background-image: -webkit-linear-gradient(transparent, transparent), url(../images/label-tick.svg);
+ background: right no-repeat;
/* @embed */
- background-image: linear-gradient(transparent, transparent), url(../images/label-tick.svg);
- color: #252525;
+ background-image: linear-gradient( transparent, transparent ), url( ../images/label-tick.svg );
+ color: #222;
}
diff --git a/MLEB/Translate/resources/images/action-edit.png b/MLEB/Translate/resources/images/action-edit.png
deleted file mode 100644
index 5f2600f6..00000000
--- a/MLEB/Translate/resources/images/action-edit.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/action-edit.svg b/MLEB/Translate/resources/images/action-edit.svg
index 9e4213a4..a4c351c6 100644
--- a/MLEB/Translate/resources/images/action-edit.svg
+++ b/MLEB/Translate/resources/images/action-edit.svg
@@ -1,36 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="15"
- height="15"
- id="svg17805">
- <defs
- id="defs17807" />
- <metadata
- id="metadata17810">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- transform="translate(-159.64355,-100.30805)"
- id="layer1">
- <path
- d="m 169.46861,102.2832 -6.21818,8.8881 -0.0148,0 -0.18891,2.1633 1.97547,-0.9207 6.21818,-8.8881 -1.77168,-1.2443 z"
- id="rect8752-2-8-5-49-6-2-0-2-5-4-0-4-5-8-7-6-4-94-6-2-8-0-2-6-8-9"
- style="fill:#3366bb;fill-opacity:1;stroke:none" />
- </g>
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15">
+ <path d="M9.825 1.975l-6.218 8.888h-.015l-.19 2.164 1.977-.92 6.217-8.89-1.772-1.244z" fill="#36c"/>
</svg>
diff --git a/MLEB/Translate/resources/images/add.png b/MLEB/Translate/resources/images/add.png
deleted file mode 100644
index bcd6b8fa..00000000
--- a/MLEB/Translate/resources/images/add.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/add.svg b/MLEB/Translate/resources/images/add.svg
index 238ebd15..3cb491c0 100644
--- a/MLEB/Translate/resources/images/add.svg
+++ b/MLEB/Translate/resources/images/add.svg
@@ -1 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><defs><linearGradient id="c"><stop offset="0" stop-color="#8ccb81"/><stop offset="1" stop-color="#65ab55"/></linearGradient><linearGradient><stop offset="0" stop-color="#74b75b"/><stop offset="1" stop-color="#86c97a"/></linearGradient><linearGradient id="b"><stop offset="0" stop-color="#dcf1d8"/><stop offset="1" stop-color="#89be78"/></linearGradient><linearGradient id="a"><stop offset="0" stop-color="#34812c" stop-opacity=".957"/><stop offset="1" stop-color="#87b870" stop-opacity=".957"/></linearGradient><linearGradient x1="12.758" y1="13.001" x2="2.583" y2="2.521" xlink:href="#a" gradientUnits="userSpaceOnUse"/><linearGradient x1="2.583" y1="2.521" x2="12.758" y2="13.001" xlink:href="#b" gradientUnits="userSpaceOnUse"/><linearGradient x1="4.551" y1="4.433" x2="11.459" y2="11.341" xlink:href="#c" gradientUnits="userSpaceOnUse"/><linearGradient x1="4.551" y1="4.433" x2="11.459" y2="11.341" id="f" xlink:href="#c" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.002 0 0 1.002 -.038 0)"/><linearGradient x1="2.583" y1="2.521" x2="12.758" y2="13.001" id="d" xlink:href="#b" gradientUnits="userSpaceOnUse" gradientTransform="translate(.253 .127)"/><linearGradient x1="12.758" y1="13.001" x2="2.583" y2="2.521" id="e" xlink:href="#a" gradientUnits="userSpaceOnUse" gradientTransform="translate(.253 .127)"/></defs><path d="M14.9 7.95a6.85 6.85 0 1 1-13.7 0 6.85 6.85 0 1 1 13.7 0z" fill="url(#d)" fill-rule="evenodd" stroke="url(#e)"/><path d="M13 8A5 5 0 1 1 3 8a5 5 0 1 1 10 0z" fill="url(#f)"/><path d="M7.032 5v2.042H5v1.995h2.063V11h2V9.005H11V7.01H9.032V5.017z" fill="#fff" fill-opacity=".957"/></svg>
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <defs>
+ <linearGradient id="c">
+ <stop offset="0" stop-color="#8ccb81"/>
+ <stop offset="1" stop-color="#65ab55"/>
+ </linearGradient>
+ <linearGradient id="b">
+ <stop offset="0" stop-color="#dcf1d8"/>
+ <stop offset="1" stop-color="#89be78"/>
+ </linearGradient>
+ <linearGradient id="a">
+ <stop offset="0" stop-color="#34812c" stop-opacity=".957"/>
+ <stop offset="1" stop-color="#87b870" stop-opacity=".957"/>
+ </linearGradient>
+ <linearGradient id="f" x1="4.551" x2="11.459" y1="4.433" y2="11.341" xlink:href="#c" gradientUnits="userSpaceOnUse" gradientTransform="translate(-.038) scale(1.002)"/>
+ <linearGradient id="d" x1="2.583" x2="12.758" y1="2.521" y2="13.001" xlink:href="#b" gradientUnits="userSpaceOnUse" gradientTransform="translate(.253 .127)"/>
+ <linearGradient id="e" x1="12.758" x2="2.583" y1="13.001" y2="2.521" xlink:href="#a" gradientUnits="userSpaceOnUse" gradientTransform="translate(.253 .127)"/>
+ </defs>
+ <path fill="url(#d)" fill-rule="evenodd" stroke="url(#e)" d="M14.9 7.95a6.85 6.85 0 1 1-13.7 0 6.85 6.85 0 1 1 13.7 0z"/>
+ <path fill="url(#f)" d="M13 8A5 5 0 1 1 3 8a5 5 0 1 1 10 0z"/>
+ <path fill="#fff" fill-opacity=".957" d="M7.032 5v2.042H5v1.995h2.063V11h2V9.005H11V7.01H9.032V5.017z"/>
+</svg>
diff --git a/MLEB/Translate/resources/images/check-small.png b/MLEB/Translate/resources/images/check-small.png
deleted file mode 100644
index 128da5b1..00000000
--- a/MLEB/Translate/resources/images/check-small.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/check-small.svg b/MLEB/Translate/resources/images/check-small.svg
index 9d146493..9dd46c85 100644
--- a/MLEB/Translate/resources/images/check-small.svg
+++ b/MLEB/Translate/resources/images/check-small.svg
@@ -1,26 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="12"
- height="12"
- viewBox="0 0 12 12"
- id="Layer_1"
- xml:space="preserve"><metadata
- id="metadata17"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs15" />
-
-
-
-<path
- d="M 9.1873757,0 4.3406758,8.3503536 2.4427828,6.9489046 0.95379575,8.934306 3.990331,11.182457 5.0997526,12 5.8005534,10.802937 11.318717,1.226278 9.1873757,0 z"
- id="path12436-0-1-2-8-1-9-2-9"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#acacac;fill-opacity:1;stroke:none;stroke-width:2.6545198;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12">
+ <path fill="#a2a9b1" d="M9.187 0L4.34 8.35l-1.897-1.4-1.49 1.984 3.037 2.248L5.1 12l.7-1.197 5.52-9.577L9.186 0z" overflow="visible"/>
+</svg>
diff --git a/MLEB/Translate/resources/images/check-sprite-ltr.png b/MLEB/Translate/resources/images/check-sprite-ltr.png
deleted file mode 100644
index 2706967a..00000000
--- a/MLEB/Translate/resources/images/check-sprite-ltr.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/check-sprite-ltr.svg b/MLEB/Translate/resources/images/check-sprite-ltr.svg
index fead121b..aee115fc 100644
--- a/MLEB/Translate/resources/images/check-sprite-ltr.svg
+++ b/MLEB/Translate/resources/images/check-sprite-ltr.svg
@@ -1,89 +1,15 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="44"
- height="248"
- id="svg10555">
- <defs
- id="defs10557" />
- <metadata
- id="metadata10560">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- transform="translate(0,-804.36218)"
- id="layer1">
- <path
- d="m 44,866.36218 -34.02216,0 -9.80064,15.00002 9.80064,15 34.02216,0 z"
- id="rect12220"
- style="color:#000000;fill:#e5e5e5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <path
- d="m 34.7936,869.20616 -10.28928,17.72734 -4.02912,-2.9752 -3.16104,4.2149 6.4464,4.7727 2.35524,1.7356 1.48776,-2.5413 11.71476,-20.33072 -4.52472,-2.60332 z"
- id="path12436-0-1-2-8-1-9-2-9"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#3e3e3e;fill-opacity:1;stroke:none;stroke-width:2.6545198;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" />
- <path
- d="m 44,897.3622 -34.02216,0 -9.80064,15 9.80064,15 34.02216,0 z"
- id="rect12220-7"
- style="color:#000000;fill:#c8dbf3;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <path
- d="m 34.7936,900.2062 -10.28928,17.7273 -4.02912,-2.9752 -3.16104,4.2149 6.4464,4.7727 2.35524,1.7356 1.48776,-2.5413 11.71476,-20.3307 -4.52472,-2.6033 z"
- id="path12436-0-1-2-8-1-9-2-9-9"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#3366bb;fill-opacity:1;stroke:#3366bb;stroke-width:0.75;stroke-opacity:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" />
- <path
- d="m 44,804.36218 -34.02216,0 -9.80064,15 9.80064,15 34.02216,0 z"
- id="rect12220-0"
- style="color:#000000;fill:#e5e5e5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <path
- d="m 34.7936,807.20614 -10.28928,17.72736 -4.02912,-2.97522 -3.16104,4.21491 6.4464,4.77275 2.35524,1.73554 1.48776,-2.54133 11.71476,-20.33068 -4.52472,-2.60333 z"
- id="path12436-0-1-2-8-1-9-2-9-2"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#ffffff;fill-opacity:1;stroke:#aeaeae;stroke-width:0.75;stroke-opacity:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" />
- <path
- d="m 44,835.36218 -34.02216,0 -9.80064,15 9.80064,15 34.02216,0 z"
- id="rect12220-0-0"
- style="color:#000000;fill:#c8dbf3;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <path
- d="m 34.7936,838.20614 -10.28928,17.72736 -4.02912,-2.97522 -3.16104,4.21491 6.4464,4.77275 2.35524,1.73554 1.48776,-2.54133 11.71476,-20.33068 -4.52472,-2.60333 z"
- id="path12436-0-1-2-8-1-9-2-9-2-4"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#ffffff;fill-opacity:1;stroke:#9ebfea;stroke-width:0.75;stroke-opacity:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" />
- <polygon
- points="43.396,37.858 32.354,56.604 26.119,51.79 27.582,49.892 31.667,53.045 41.329,36.641 "
- transform="matrix(1.1261478,0,0,1.1592998,-11.17699,889.3127)"
- id="polygon3"
- style="fill:#d1d3d4" />
- <polygon
- points="41.329,76.048 43.396,77.265 32.354,96.011 26.12,91.197 27.583,89.299 31.668,92.453 "
- transform="matrix(1.1261478,0,0,1.1592998,-11.17699,874.6282)"
- id="polygon5"
- style="fill:#9dbfdf" />
- <path
- d="m 8.1875,166.5 0,3.4375 -3.34375,0 0,3.03125 3.34375,0 0,3.40625 2.9375,0 0,-3.40625 3.34375,0 0,-3.03125 -3.34375,0 0,-3.4375 -2.9375,0 z"
- transform="translate(0,804.36218)"
- id="rect9"
- style="fill:#9dbfdf" />
- <polygon
- points="26.119,51.79 27.582,49.892 31.667,53.045 41.329,36.641 43.396,37.858 32.354,56.604 "
- transform="matrix(1.1261478,0,0,1.1592998,-11.17699,951.31273)"
- id="polygon3018"
- style="fill:#5f5f5f;fill-opacity:1" />
- <polygon
- points="27.582,49.892 31.667,53.045 41.329,36.641 43.396,37.858 32.354,56.604 26.119,51.79 "
- transform="matrix(1.1261478,0,0,1.1592998,-11.17699,982.3127)"
- id="polygon3022"
- style="fill:#9dbfdf;fill-opacity:1" />
- </g>
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="44" height="248">
+ <path fill="#eaecf0" d="M44 62H9.978l-9.8 15 9.8 15H44z" overflow="visible"/>
+ <path fill="#3e3e3e" d="M34.794 64.844L24.504 82.57l-4.03-2.974-3.16 4.215 6.447 4.775 2.357 1.735 1.488-2.542 11.714-20.33-4.525-2.604z" overflow="visible"/>
+ <path fill="#c8dbf3" d="M44 93H9.978l-9.8 15 9.8 15H44z" overflow="visible"/>
+ <path fill="#36c" stroke="#36c" stroke-width=".75" d="M34.794 95.844l-10.29 17.727-4.03-2.973-3.16 4.215 6.447 4.774 2.357 1.735 1.488-2.54L39.32 98.45l-4.525-2.605z" overflow="visible"/>
+ <path fill="#eaecf0" d="M44 0H9.978l-9.8 15 9.8 15H44z" overflow="visible"/>
+ <path fill="#fff" stroke="#a2a9b1" stroke-width=".75" d="M34.794 2.844L24.504 20.57l-4.03-2.974-3.16 4.215 6.447 4.775 2.357 1.735 1.488-2.542L39.32 5.448l-4.525-2.604z" overflow="visible"/>
+ <path fill="#c8dbf3" d="M44 31H9.978l-9.8 15 9.8 15H44z" overflow="visible"/>
+ <path fill="#fff" stroke="#9ebfea" stroke-width=".75" d="M34.794 33.844L24.504 51.57l-4.03-2.974-3.16 4.215 6.447 4.775 2.357 1.735 1.488-2.542 11.714-20.33-4.525-2.604z" overflow="visible"/>
+ <path fill="#d1d3d4" d="M37.693 128.84l-12.435 21.73-7.02-5.58 1.646-2.202 4.6 3.656 10.882-19.018"/>
+ <path fill="#9dbfdf" d="M35.366 158.428l2.327 1.41-12.435 21.734-7.02-5.58 1.648-2.202 4.6 3.657M8.188 166.5v3.438H4.844v3.03h3.343v3.407h2.938v-3.406h3.344v-3.033h-3.346V166.5H8.187z"/>
+ <path fill="#54595d" d="M18.237 206.99l1.647-2.2 4.6 3.656 10.882-19.018 2.327 1.41-12.435 21.734"/>
+ <path fill="#9dbfdf" d="M19.884 235.79l4.6 3.656 10.882-19.018 2.327 1.41-12.435 21.734-7.02-5.58"/>
</svg>
diff --git a/MLEB/Translate/resources/images/check-sprite-rtl.png b/MLEB/Translate/resources/images/check-sprite-rtl.png
deleted file mode 100644
index 7da4006b..00000000
--- a/MLEB/Translate/resources/images/check-sprite-rtl.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/check-sprite-rtl.svg b/MLEB/Translate/resources/images/check-sprite-rtl.svg
index 7d55d676..5f15ad22 100644
--- a/MLEB/Translate/resources/images/check-sprite-rtl.svg
+++ b/MLEB/Translate/resources/images/check-sprite-rtl.svg
@@ -1,84 +1,15 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="44"
- height="248"
- id="svg10555">
- <defs
- id="defs10557" />
- <metadata
- id="metadata10560">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <path
- d="M 0.1772,62 34.19936,62 44,77.00002 l -9.80064,15 -34.02216,0 z"
- id="rect12220"
- style="color:#000000;fill:#e5e5e5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <path
- d="m 22.33832,64.84398 -10.28928,17.72734 -4.02912,-2.9752 -3.16104,4.2149 6.4464,4.7727 2.35524,1.7356 1.48776,-2.5413 11.71476,-20.33072 -4.52472,-2.60332 z"
- id="path12436-0-1-2-8-1-9-2-9"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#3e3e3e;fill-opacity:1;stroke:none;stroke-width:2.6545198;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" />
- <path
- d="m 0.1772,93.00002 34.02216,0 9.80064,15 -9.80064,15 -34.02216,0 z"
- id="rect12220-7"
- style="color:#000000;fill:#c8dbf3;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <path
- d="m 22.33832,95.84402 -10.28928,17.7273 -4.02912,-2.9752 -3.16104,4.2149 6.4464,4.7727 2.35524,1.7356 1.48776,-2.5413 11.71476,-20.3307 -4.52472,-2.6033 z"
- id="path12436-0-1-2-8-1-9-2-9-9"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#3366bb;fill-opacity:1;stroke:#3366bb;stroke-width:0.75;stroke-opacity:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" />
- <path
- d="M 0.1772,0 34.19936,0 44,15 34.19936,30 0.1772,30 z"
- id="rect12220-0"
- style="color:#000000;fill:#e5e5e5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <path
- d="M 22.33832,2.84396 12.04904,20.57132 8.01992,17.5961 l -3.16104,4.21491 6.4464,4.77275 2.35524,1.73554 1.48776,-2.54133 L 26.86304,5.44729 22.33832,2.84396 z"
- id="path12436-0-1-2-8-1-9-2-9-2"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#ffffff;fill-opacity:1;stroke:#aeaeae;stroke-width:0.75;stroke-opacity:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" />
- <path
- d="M 0.1772,31 34.19936,31 44,46 34.19936,61 0.1772,61 z"
- id="rect12220-0-0"
- style="color:#000000;fill:#c8dbf3;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <path
- d="M 22.33832,33.84396 12.04904,51.57132 8.01992,48.5961 l -3.16104,4.21491 6.4464,4.77275 2.35524,1.73554 1.48776,-2.54133 11.71476,-20.33068 -4.52472,-2.60333 z"
- id="path12436-0-1-2-8-1-9-2-9-2-4"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#ffffff;fill-opacity:1;stroke:#9ebfea;stroke-width:0.75;stroke-opacity:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" />
- <polygon
- points="41.329,36.641 43.396,37.858 32.354,56.604 26.119,51.79 27.582,49.892 31.667,53.045 "
- transform="matrix(1.1261478,0,0,1.1592998,-23.63227,84.95052)"
- id="polygon3"
- style="fill:#d1d3d4" />
- <polygon
- points="31.668,92.453 41.329,76.048 43.396,77.265 32.354,96.011 26.12,91.197 27.583,89.299 "
- transform="matrix(1.1261478,0,0,1.1592998,-23.63227,70.26602)"
- id="polygon5"
- style="fill:#9dbfdf" />
- <path
- d="m 35.9897,166.5 0,3.4375 3.34375,0 0,3.03125 -3.34375,0 0,3.40625 -2.9375,0 0,-3.40625 -3.34375,0 0,-3.03125 3.34375,0 0,-3.4375 2.9375,0 z"
- id="rect9"
- style="fill:#9dbfdf" />
- <polygon
- points="32.354,56.604 26.119,51.79 27.582,49.892 31.667,53.045 41.329,36.641 43.396,37.858 "
- transform="matrix(1.1261478,0,0,1.1592998,-23.63227,146.95055)"
- id="polygon3018"
- style="fill:#5f5f5f;fill-opacity:1" />
- <polygon
- points="26.119,51.79 27.582,49.892 31.667,53.045 41.329,36.641 43.396,37.858 32.354,56.604 "
- transform="matrix(1.1261478,0,0,1.1592998,-23.63227,177.95052)"
- id="polygon3022"
- style="fill:#9dbfdf;fill-opacity:1" />
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="44" height="248">
+ <path fill="#eaecf0" d="M.177 62H34.2L44 77l-9.8 15H.176z" overflow="visible"/>
+ <path fill="#3e3e3e" d="M22.338 64.844L12.048 82.57 8.02 79.597 4.86 83.81l6.445 4.774 2.356 1.735 1.488-2.542 11.715-20.33-4.525-2.604z" overflow="visible"/>
+ <path fill="#c8dbf3" d="M.177 93H34.2l9.8 15-9.8 15H.176z" overflow="visible"/>
+ <path fill="#36c" stroke="#36c" stroke-width=".75" d="M22.338 95.844l-10.29 17.727-4.028-2.974-3.16 4.215 6.445 4.774 2.356 1.735 1.488-2.542 11.715-20.33-4.525-2.604z" overflow="visible"/>
+ <path fill="#eaecf0" d="M.177 0H34.2L44 15l-9.8 15H.176z" overflow="visible"/>
+ <path fill="#fff" stroke="#aeaeae" stroke-width=".75" d="M22.338 2.844L12.048 20.57 8.02 17.597 4.86 21.81l6.445 4.774 2.356 1.735 1.488-2.542 11.715-20.33-4.525-2.604z" overflow="visible"/>
+ <path fill="#c8dbf3" d="M.177 31H34.2L44 46l-9.8 15H.176z" overflow="visible"/>
+ <path fill="#fff" stroke="#9ebfea" stroke-width=".75" d="M22.338 33.844L12.048 51.57 8.02 48.597 4.86 52.81l6.445 4.774 2.356 1.735 1.488-2.542 11.715-20.33-4.525-2.604z" overflow="visible"/>
+ <path fill="#d1d3d4" d="M22.91 127.428l2.328 1.41-12.435 21.734-7.02-5.58 1.646-2.202 4.6 3.656"/>
+ <path fill="#9dbfdf" d="M12.03 177.447l10.88-19.02 2.328 1.412-12.435 21.732-7.02-5.58 1.647-2.202M35.99 166.5v3.438h3.343v3.03H35.99v3.407h-2.938v-3.406h-3.344v-3.032h3.344V166.5h2.938z"/>
+ <path fill="#54595d" d="M12.803 212.572l-7.02-5.58 1.646-2.202 4.6 3.656 10.88-19.018 2.328 1.41"/>
+ <path fill="#9dbfdf" d="M5.782 237.99l1.647-2.2 4.6 3.656 10.88-19.018 2.328 1.41-12.435 21.734"/>
</svg>
diff --git a/MLEB/Translate/resources/images/close.png b/MLEB/Translate/resources/images/close.png
deleted file mode 100644
index 84631c3d..00000000
--- a/MLEB/Translate/resources/images/close.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/close.svg b/MLEB/Translate/resources/images/close.svg
index 375b4f5c..22619b95 100644
--- a/MLEB/Translate/resources/images/close.svg
+++ b/MLEB/Translate/resources/images/close.svg
@@ -1,40 +1,5 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="12"
- height="12"
- id="svg2">
- <defs
- id="defs4" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- transform="translate(-578.6585,-310.8933)"
- id="layer1">
- <path
- d="m 579.70127,311.93609 9.91446,9.91442"
- id="path6064-1-0-9"
- style="fill:none;stroke:#2e3436;stroke-width:2.085536;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
- <path
- d="m 589.6157,311.93609 -9.91441,9.91442"
- id="path6064-3-2-4-6"
- style="fill:none;stroke:#2e3436;stroke-width:2.085536;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
- </g>
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
+ <path d="M3.636 2.222l14.142 14.142-1.414 1.414L2.222 3.636z"/>
+ <path d="M17.778 3.636L3.636 17.778l-1.414-1.414L16.364 2.222z"/>
</svg>
diff --git a/MLEB/Translate/resources/images/contract-ltr.png b/MLEB/Translate/resources/images/contract-ltr.png
deleted file mode 100644
index a8d00dbc..00000000
--- a/MLEB/Translate/resources/images/contract-ltr.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/contract-ltr.svg b/MLEB/Translate/resources/images/contract-ltr.svg
index 0a00db1d..2b7d71b6 100644
--- a/MLEB/Translate/resources/images/contract-ltr.svg
+++ b/MLEB/Translate/resources/images/contract-ltr.svg
@@ -1,51 +1,6 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="16"
- height="12"
- id="svg17805">
- <defs
- id="defs17807" />
- <metadata
- id="metadata17810">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- transform="translate(-159.64355,-103.30805)"
- id="layer1">
- <rect
- width="4.2944264"
- height="9.2567539"
- x="170.16307"
- y="104.72025"
- id="rect8020-7-3-7-8"
- style="color:#000000;fill:#b9b9b9;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <rect
- width="14.63288"
- height="10.276761"
- x="160.32709"
- y="104.16966"
- id="rect6062-5-54-4-3"
- style="color:#000000;fill:none;stroke:#2e3436;stroke-width:1.36711919;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <path
- d="M 7.03125,2.21875 3.6875,5.53125 3.28125,5.96875 3.6875,6.375 6.9375,9.625 7.78125,8.78125 5.53125,6.5 l 5.78125,0 0,-1.1875 -5.71875,0 2.25,-2.25 -0.8125,-0.84375 z"
- transform="translate(159.64355,103.30805)"
- id="path8014-1-9-7-7"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.18803263;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" />
- </g>
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="12" viewBox="0 0 16 12">
+ <path fill="#a2a9b1" d="M10.52 1.412h4.293v9.257H10.52z" overflow="visible"/>
+ <path fill="none" stroke="#222" stroke-width="1.367" d="M.683.862h14.633V11.14H.683z" overflow="visible"/>
+ <path fill="#222" d="M7.03 2.22L3.688 5.53l-.406.44.408.405 3.25 3.25.843-.844L5.53 6.5h5.782V5.312H5.595l2.25-2.25-.813-.843z" overflow="visible"/>
</svg>
diff --git a/MLEB/Translate/resources/images/contract-rtl.png b/MLEB/Translate/resources/images/contract-rtl.png
deleted file mode 100644
index 2822bbaa..00000000
--- a/MLEB/Translate/resources/images/contract-rtl.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/contract-rtl.svg b/MLEB/Translate/resources/images/contract-rtl.svg
index 43a488dc..8a498500 100644
--- a/MLEB/Translate/resources/images/contract-rtl.svg
+++ b/MLEB/Translate/resources/images/contract-rtl.svg
@@ -1,53 +1,6 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="16"
- height="12"
- id="svg17805">
- <defs
- id="defs17807" />
- <metadata
- id="metadata17810">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- transform="translate(-159.64355,-103.30805)"
- id="layer1">
- <rect
- width="4.2944264"
- height="9.2567539"
- x="-165.12401"
- y="104.72025"
- transform="scale(-1,1)"
- id="rect8020-7-3-7-8"
- style="color:#000000;fill:#b9b9b9;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <rect
- width="14.63288"
- height="10.276761"
- x="-174.96001"
- y="104.16966"
- transform="scale(-1,1)"
- id="rect6062-5-54-4-3"
- style="color:#000000;fill:none;stroke:#2e3436;stroke-width:1.36711919;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <path
- d="M 8.96875,2.21875 8.125,3.0625 l 2.28125,2.25 -5.71875,0 0,1.1875 5.78125,0 -2.28125,2.28125 0.84375,0.84375 3.25,-3.25 0.40625,-0.40625 -0.40625,-0.4375 -3.3125,-3.3125 z"
- transform="translate(159.64355,103.30805)"
- id="path8014-1-9-7-7"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.18803263;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" />
- </g>
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="12" viewBox="0 0 16 12">
+ <path fill="#a2a9b1" d="M5.48 1.412H1.186v9.257H5.48z" overflow="visible"/>
+ <path fill="none" stroke="#222" stroke-width="1.367" d="M15.316.862H.683V11.14h14.633z" overflow="visible"/>
+ <path fill="#222" d="M8.97 2.22l-.845.842 2.28 2.25H4.69V6.5h5.78L8.19 8.78l.843.845 3.25-3.25.408-.406-.407-.44-3.31-3.31z" overflow="visible"/>
</svg>
diff --git a/MLEB/Translate/resources/images/edit-mark.png b/MLEB/Translate/resources/images/edit-mark.png
deleted file mode 100644
index af8c96f1..00000000
--- a/MLEB/Translate/resources/images/edit-mark.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/edit-mark.svg b/MLEB/Translate/resources/images/edit-mark.svg
index a1221fb0..80d09ecb 100644
--- a/MLEB/Translate/resources/images/edit-mark.svg
+++ b/MLEB/Translate/resources/images/edit-mark.svg
@@ -1,30 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="33.389"
- height="22.857"
- viewBox="0 0 33.389 22.857"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata9"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs7" />
-
-<g
- transform="translate(-2372.5715,-642.2193)"
- id="layer1">
-
- <path
- d="m 2393.896,645.134 -9.343,13.311 -0.022,0.003 -0.284,3.239 2.968,-1.379 9.344,-13.31 -2.663,-1.864 0,0 z"
- id="rect8752-2-8-5-49-6-2-0-2-5-4-0-4-5-8-7-6-4-9-9-0-3-2-1-1-3-7-4-8-3"
- style="fill:#c9c9c9" />
-</g>
-</svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="33.389" height="22.857" viewBox="0 0 33.389 22.857">
+ <path fill="#c8ccd1" d="M21.325 2.915l-9.343 13.31-.022.004-.284 3.238 2.968-1.38 9.344-13.31-2.663-1.863z"/>
+</svg>
diff --git a/MLEB/Translate/resources/images/expand-ltr.png b/MLEB/Translate/resources/images/expand-ltr.png
deleted file mode 100644
index 33278b14..00000000
--- a/MLEB/Translate/resources/images/expand-ltr.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/expand-ltr.svg b/MLEB/Translate/resources/images/expand-ltr.svg
index 87ea35f0..bffe869c 100644
--- a/MLEB/Translate/resources/images/expand-ltr.svg
+++ b/MLEB/Translate/resources/images/expand-ltr.svg
@@ -1,51 +1,6 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="16"
- height="12"
- id="svg17805">
- <defs
- id="defs17807" />
- <metadata
- id="metadata17810">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- transform="translate(-159.64355,-103.30805)"
- id="layer1">
- <rect
- width="4.2944264"
- height="9.2567539"
- x="170.16307"
- y="104.72025"
- id="rect8020-7-3-7"
- style="color:#000000;fill:#b9b9b9;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <rect
- width="14.63288"
- height="10.276761"
- x="160.32709"
- y="104.16966"
- id="rect6062-5-54-4"
- style="color:#000000;fill:none;stroke:#2e3436;stroke-width:1.36711919;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <path
- d="M 8.40625,2.21875 7.5625,3.0625 l 2.28125,2.25 -5.71875,0 0,1.1875 5.78125,0 L 7.625,8.78125 8.46875,9.625 l 3.25,-3.25 0.40625,-0.40625 -0.40625,-0.4375 -3.3125,-3.3125 z"
- transform="translate(159.64355,103.30805)"
- id="path8014-1-9-7"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.18803263;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" />
- </g>
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="12" viewBox="0 0 16 12">
+ <path fill="#a2a9b1" d="M10.52 1.412h4.293v9.257H10.52z" overflow="visible"/>
+ <path fill="none" stroke="#222" stroke-width="1.367" d="M.683.862h14.633V11.14H.683z" overflow="visible"/>
+ <path fill="#222" d="M8.406 2.22l-.844.842 2.282 2.25h-5.72V6.5h5.782l-2.28 2.28.843.845 3.25-3.25.405-.406-.406-.44-3.314-3.31z" overflow="visible"/>
</svg>
diff --git a/MLEB/Translate/resources/images/expand-rtl.png b/MLEB/Translate/resources/images/expand-rtl.png
deleted file mode 100644
index 7b45bbac..00000000
--- a/MLEB/Translate/resources/images/expand-rtl.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/expand-rtl.svg b/MLEB/Translate/resources/images/expand-rtl.svg
index 7f1ded58..d65d5660 100644
--- a/MLEB/Translate/resources/images/expand-rtl.svg
+++ b/MLEB/Translate/resources/images/expand-rtl.svg
@@ -1,53 +1,6 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="16"
- height="12"
- id="svg17805">
- <defs
- id="defs17807" />
- <metadata
- id="metadata17810">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- transform="translate(-159.64355,-103.30805)"
- id="layer1">
- <rect
- width="4.2944264"
- height="9.2567539"
- x="-165.12401"
- y="104.72025"
- transform="scale(-1,1)"
- id="rect8020-7-3-7"
- style="color:#000000;fill:#b9b9b9;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <rect
- width="14.63288"
- height="10.276761"
- x="-174.96001"
- y="104.16966"
- transform="scale(-1,1)"
- id="rect6062-5-54-4"
- style="color:#000000;fill:none;stroke:#2e3436;stroke-width:1.36711919;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <path
- d="M 7.5625,2.21875 4.25,5.53125 3.84375,5.96875 4.25,6.375 7.5,9.625 8.34375,8.78125 6.09375,6.5 l 5.75,0 0,-1.1875 -5.6875,0 2.25,-2.25 L 7.5625,2.21875 z"
- transform="translate(159.64355,103.30805)"
- id="path8014-1-9-7"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.18803263;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" />
- </g>
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="12" viewBox="0 0 16 12">
+ <path fill="#a2a9b1" d="M5.48 1.412H1.186v9.257H5.48z" overflow="visible"/>
+ <path fill="none" stroke="#222" stroke-width="1.367" d="M15.316.862H.683V11.14h14.633z" overflow="visible"/>
+ <path fill="#222" d="M7.563 2.22L4.25 5.53l-.406.44.406.405 3.25 3.25.844-.844-2.25-2.28h5.75V5.312H6.156l2.25-2.25-.844-.843z" overflow="visible"/>
</svg>
diff --git a/MLEB/Translate/resources/images/help.png b/MLEB/Translate/resources/images/help.png
deleted file mode 100644
index f1bc368d..00000000
--- a/MLEB/Translate/resources/images/help.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/help.svg b/MLEB/Translate/resources/images/help.svg
deleted file mode 100644
index 13b20271..00000000
--- a/MLEB/Translate/resources/images/help.svg
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><defs><linearGradient id="a"><stop offset="0" stop-color="#6bb8e8"/><stop offset="1" stop-color="#45a5e2"/></linearGradient><linearGradient x1="2.445" y1="2.365" x2="13.632" y2="13.552" id="b" xlink:href="#a" gradientUnits="userSpaceOnUse"/></defs><g><path d="M15.982 8.01a7.946 7.946 0 1 1-15.893 0 7.946 7.946 0 1 1 15.892 0z" transform="matrix(1.007 0 0 1.007 -.089 -.063)" fill="url(#b)" fill-rule="evenodd"/><path d="M8.604 9.393H6.64v-.267c0-.297.06-.56.18-.79.12-.23.37-.525.756-.88l.348-.316c.207-.188.357-.366.45-.533.1-.167.148-.334.148-.5 0-.254-.087-.452-.26-.593-.175-.146-.418-.218-.73-.218-.294 0-.61.062-.952.185-.34.12-.696.3-1.066.54V4.31c.438-.15.84-.264 1.202-.336.363-.073.713-.11 1.05-.11.885 0 1.56.182 2.024.545.464.358.696.884.696 1.577 0 .355-.07.675-.212.957-.14.28-.382.58-.723.904l-.348.31c-.246.225-.408.406-.484.544-.076.134-.114.283-.114.446v.245m-1.964.805h1.964v1.937H6.64v-1.937" style="-inkscape-font-specification:Sans Bold" font-size="11.143" font-weight="bold" letter-spacing="0" word-spacing="0" fill="#fff" font-family="Sans"/></g></svg>
diff --git a/MLEB/Translate/resources/images/label-clock.png b/MLEB/Translate/resources/images/label-clock.png
deleted file mode 100644
index d1ef6faa..00000000
--- a/MLEB/Translate/resources/images/label-clock.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/label-clock.svg b/MLEB/Translate/resources/images/label-clock.svg
index b5a2aa42..d1bd36d9 100644
--- a/MLEB/Translate/resources/images/label-clock.svg
+++ b/MLEB/Translate/resources/images/label-clock.svg
@@ -1,28 +1,5 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="15"
- height="15"
- viewBox="0 0 15 15"
- id="svg17805"
- xml:space="preserve"><metadata
- id="metadata9"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs7" />
-<path
- d="m 7.5,0.125 c -4.059,0 -7.375,3.316 -7.375,7.375 0,4.059 3.316,7.375 7.375,7.375 4.059,0 7.375,-3.316 7.375,-7.375 0,-4.059 -3.316,-7.375 -7.375,-7.375 z m 0,1.768 c 3.104,0 5.607,2.504 5.607,5.607 0,3.103 -2.504,5.607 -5.607,5.607 -3.103,0 -5.607,-2.503 -5.607,-5.607 0,-3.104 2.503,-5.607 5.607,-5.607 z"
- id="path4660-7-2-3-3"
- style="fill:#565656" />
-<path
- d="m 6.708,2.991 v 4.552 0.764 0.446 h 3.428 V 7.543 H 7.918 V 2.991 h -1.21 z"
- id="rect4662-1-2-3-46"
- style="fill:#565656" />
-</svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15">
+ <path fill="#54595d" d="M7.5.125C3.44.125.125 3.44.125 7.5c0 4.06 3.316 7.375 7.375 7.375 4.06 0 7.375-3.316 7.375-7.375C14.875 3.44 11.56.125 7.5.125zm0 1.768c3.104 0 5.607 2.504 5.607 5.607s-2.504 5.607-5.607 5.607S1.893 10.604 1.893 7.5 4.396 1.893 7.5 1.893z"/>
+ <path fill="#54595d" d="M6.708 2.99v5.763h3.428v-1.21H7.918V2.99h-1.21z"/>
+</svg>
diff --git a/MLEB/Translate/resources/images/label-flag.png b/MLEB/Translate/resources/images/label-flag.png
deleted file mode 100644
index e7744702..00000000
--- a/MLEB/Translate/resources/images/label-flag.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/label-flag.svg b/MLEB/Translate/resources/images/label-flag.svg
index e98ff32e..2ba48b7e 100644
--- a/MLEB/Translate/resources/images/label-flag.svg
+++ b/MLEB/Translate/resources/images/label-flag.svg
@@ -1,29 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="15"
- height="15"
- viewBox="0 0 15 15"
- id="svg17805"
- xml:space="preserve"><metadata
- id="metadata8"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs6" />
-
-<g
- transform="translate(-159.64355,-100.30805)"
- id="layer1">
- <path
- d="m 162.081,102.058 v 6.469 h 8.844 v 5.031 h 1.281 v -5.031 -6.062 -0.406 h -10.125 z"
- id="rect8962-1"
- style="fill:#565656" />
-</g>
-</svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15">
+ <path fill="#54595d" d="M2.437 1.75v6.47h8.844v5.03h1.282V1.75H2.437z"/>
+</svg>
diff --git a/MLEB/Translate/resources/images/label-page-tick.png b/MLEB/Translate/resources/images/label-page-tick.png
deleted file mode 100644
index da5cd0f2..00000000
--- a/MLEB/Translate/resources/images/label-page-tick.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/label-page-tick.svg b/MLEB/Translate/resources/images/label-page-tick.svg
deleted file mode 100644
index bdd25395..00000000
--- a/MLEB/Translate/resources/images/label-page-tick.svg
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="15"
- height="15"
- viewBox="0 0 15 15"
- id="svg17805"
- xml:space="preserve"><metadata
- id="metadata12"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs10" />
-<g
- transform="translate(-159.64355,-100.30805)"
- id="layer1">
- <g
- transform="translate(-279.58355,-315.7339)"
- id="g18113">
- <path
- d="m 440.281,419.25 v 0.562 9.656 0.532 h 0.531 9.657 0.531 v -0.531 -9.656 -0.562 h -0.531 -9.657 -0.531 z m 1.063,1.094 h 8.594 v 8.594 h -8.594 v -8.594 z"
- id="rect8974-9-6-80-1"
- style="fill:#565656" />
- <path
- d="m 447.443,421.423 -2.858,4.925 -1.12,-0.826 -0.878,1.171 1.791,1.326 0.655,0.482 0.413,-0.707 3.254,-5.648 -1.257,-0.723 z"
- id="path12436-0-1-2-8-1-9-2-0-5-7"
- style="fill:#565656" />
- <path
- d="m 442.438,417.094 v 0.531 2.156 0.531 h 0.562 6.938 v 6.969 0.531 h 0.562 2.156 0.531 v -0.531 -9.656 -0.531 H 452.656 443 442.438 z m 1.093,1.062 h 8.563 v 8.594 h -1.062 v -6.969 -0.531 h -0.531 -6.969 v -1.094 z"
- id="rect8974-5-0-4-9"
- style="fill:#565656" />
- </g>
-</g>
-</svg> \ No newline at end of file
diff --git a/MLEB/Translate/resources/images/label-page.png b/MLEB/Translate/resources/images/label-page.png
deleted file mode 100644
index ccead8ad..00000000
--- a/MLEB/Translate/resources/images/label-page.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/label-page.svg b/MLEB/Translate/resources/images/label-page.svg
deleted file mode 100644
index 6d95932e..00000000
--- a/MLEB/Translate/resources/images/label-page.svg
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="15"
- height="15"
- viewBox="0 0 15 15"
- id="svg17805"
- xml:space="preserve"><metadata
- id="metadata10"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs8" />
-
-<g
- transform="translate(-159.64355,-100.30805)"
- id="layer1">
- <g
- transform="translate(-279.14083,-255.12502)"
- id="g18109">
-
- <rect
- width="9.6630001"
- height="9.6630001"
- x="440.36801"
- y="359.19199"
- id="rect8974-9-6-80-1-7"
- style="fill:none;stroke:#565656;stroke-width:1.07369995;stroke-linecap:round" />
-
- <path
- d="m 442.544,357.012 v 2.156 h 7.5 v 7.5 h 2.156 v -9.656 h -9.656 z"
- id="rect8974-5-0-4-9-8"
- style="fill:none;stroke:#565656;stroke-width:1.07369995;stroke-linecap:round" />
- </g>
-</g>
-</svg> \ No newline at end of file
diff --git a/MLEB/Translate/resources/images/label-pen.png b/MLEB/Translate/resources/images/label-pen.png
deleted file mode 100644
index bda1d7e1..00000000
--- a/MLEB/Translate/resources/images/label-pen.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/label-pen.svg b/MLEB/Translate/resources/images/label-pen.svg
index 8e61dd86..715470d0 100644
--- a/MLEB/Translate/resources/images/label-pen.svg
+++ b/MLEB/Translate/resources/images/label-pen.svg
@@ -1,29 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="15"
- height="15"
- viewBox="0 0 15 15"
- id="svg17805"
- xml:space="preserve"><metadata
- id="metadata8"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs6" />
-
-<g
- transform="translate(-159.64355,-100.30805)"
- id="layer1">
- <path
- d="m 169.469,102.283 -6.218,8.888 h -0.015 l -0.189,2.163 1.975,-0.921 6.218,-8.888 -1.771,-1.244 v 0.002 z"
- id="rect8752-2-8-5-49-6-2-0-2-5-4-0-4-5-8-7-6-4-94-6-2-8-0-2-6-8-9"
- style="fill:#565656" />
-</g>
-</svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15">
+ <path fill="#54595d" d="M9.825 1.975l-6.218 8.888h-.015l-.19 2.163 1.976-.92 6.218-8.89-1.77-1.243v.002z"/>
+</svg>
diff --git a/MLEB/Translate/resources/images/label-tick.png b/MLEB/Translate/resources/images/label-tick.png
deleted file mode 100644
index a729fd4f..00000000
--- a/MLEB/Translate/resources/images/label-tick.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/label-tick.svg b/MLEB/Translate/resources/images/label-tick.svg
index 59de0e2a..44326a0c 100644
--- a/MLEB/Translate/resources/images/label-tick.svg
+++ b/MLEB/Translate/resources/images/label-tick.svg
@@ -1,29 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="15"
- height="15"
- viewBox="0 0 15 15"
- id="svg17805"
- xml:space="preserve"><metadata
- id="metadata8"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs6" />
-
-<g
- transform="translate(-159.64355,-100.30805)"
- id="layer1">
- <path
- d="m 170.409,101.386 -5.188,8.938 -2.031,-1.5 -1.594,2.125 3.25,2.406 1.188,0.875 0.75,-1.281 5.906,-10.25 -2.281,-1.313 z"
- id="path12436-0-1-2-8-1-9-2-0"
- style="fill:#565656" />
-</g>
-</svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15">
+ <path fill="#54595d" d="M10.765 1.078l-5.188 8.938-2.03-1.5L1.95 10.64l3.25 2.407 1.188.875.75-1.28 5.906-10.25-2.28-1.314z"/>
+</svg>
diff --git a/MLEB/Translate/resources/images/loading.svg b/MLEB/Translate/resources/images/loading.svg
index 92f84cde..7aa88cb4 100644
--- a/MLEB/Translate/resources/images/loading.svg
+++ b/MLEB/Translate/resources/images/loading.svg
@@ -1,39 +1,7 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="34"
- height="34.03125"
- id="svg9613">
- <defs
- id="defs9615" />
- <metadata
- id="metadata9618">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- id="g2987">
- <path
- d="m 16.977523,0.24095147 c -9.2629169,0 -16.73280045,7.51449143 -16.73280045,16.77740253 0,9.262912 7.46988355,16.777403 16.73280045,16.777403 9.262917,0 16.777413,-7.514491 16.777413,-16.777403 0,-9.2629111 -7.514496,-16.77740253 -16.777413,-16.77740253 z m 0,4.14972823 c 6.966927,0 12.627682,5.6607523 12.627682,12.6276743 0,6.966923 -5.660755,12.583053 -12.627682,12.583053 -6.966937,0 -12.5830596,-5.61613 -12.5830596,-12.583053 0,-6.966922 5.6161226,-12.6276743 12.5830596,-12.6276743 z"
- id="path15290-7-0-9-5-1-59-0-3-2"
- style="color:#000000;fill:#000000;fill-opacity:0.08333333;fill-rule:nonzero;stroke:#565656;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:0.19607843;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <path
- d="M 31.677259,17.003529 A 14.680208,14.680199 0 0 1 20.796571,31.183505"
- id="path15290-6-0-6-1-0-0-16-1-0-06"
- style="color:#000000;fill:none;stroke:#3366bb;stroke-width:2.2583456;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- </g>
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="34" height="34.031">
+ <g color="#000">
+ <path fill-opacity=".083" stroke="#54595d" stroke-opacity=".196" stroke-width=".5" d="M16.978.24C7.715.24.245 7.756.245 17.02c0 9.263 7.47 16.778 16.733 16.778 9.262 0 16.777-7.515 16.777-16.778C33.755 7.755 26.24.24 16.978.24zm0 4.15c6.966 0 12.627 5.66 12.627 12.628 0 6.967-5.66 12.583-12.627 12.583-6.967 0-12.584-5.615-12.584-12.582 0-6.967 5.617-12.627 12.584-12.627z" overflow="visible"/>
+ <path fill="none" stroke="#36c" stroke-width="2.258" d="M31.677 17.004a14.68 14.68 0 0 1-10.88 14.18" stroke-linecap="round" overflow="visible"/>
+ </g>
</svg>
diff --git a/MLEB/Translate/resources/images/outdated-ltr.png b/MLEB/Translate/resources/images/outdated-ltr.png
deleted file mode 100644
index debc4b24..00000000
--- a/MLEB/Translate/resources/images/outdated-ltr.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/outdated-ltr.svg b/MLEB/Translate/resources/images/outdated-ltr.svg
index c082fda4..cf0fe1dc 100644
--- a/MLEB/Translate/resources/images/outdated-ltr.svg
+++ b/MLEB/Translate/resources/images/outdated-ltr.svg
@@ -1,32 +1,6 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="33.389"
- height="22.857"
- viewBox="0 0 33.389 22.857"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata10"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs8" />
-<path
- d="m 0,0 h 25.922 l 7.467,11.429 -7.467,11.429 H 0 V 0 z"
- id="rect12220-2"
- style="fill:#fef4ba" />
-<path
- d="m 17.981,4.357 c -4.06,0 -7.375,3.316 -7.375,7.375 0,4.059 3.315,7.375 7.375,7.375 4.059,0 7.375,-3.316 7.375,-7.375 0,-4.059 -3.316,-7.375 -7.375,-7.375 z m 0,1.768 c 3.104,0 5.607,2.504 5.607,5.607 0,3.103 -2.504,5.607 -5.607,5.607 -3.103,0 -5.607,-2.504 -5.607,-5.607 0,-3.103 2.504,-5.607 5.607,-5.607 z"
- id="path4660-7-2-3-7-0-0"
- style="fill:#565656" />
-<path
- d="m 17.189,7.223 v 4.552 0.764 0.446 h 3.428 v -1.21 H 18.399 V 7.223 h -1.21 z"
- id="rect4662-1-2-3-7-4-3"
- style="fill:#565656" />
-</svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="33.389" height="22.857" viewBox="0 0 33.389 22.857">
+ <path fill="#fef4ba" d="M0 0h25.922l7.467 11.43-7.468 11.428H0V0z"/>
+ <path fill="#54595d" d="M17.98 4.357c-4.06 0-7.374 3.316-7.374 7.375 0 4.06 3.315 7.375 7.375 7.375 4.06 0 7.376-3.316 7.376-7.375 0-4.06-3.316-7.375-7.375-7.375zm0 1.768c3.105 0 5.608 2.504 5.608 5.607s-2.504 5.607-5.607 5.607c-3.102 0-5.606-2.505-5.606-5.608 0-3.103 2.504-5.607 5.607-5.607z"/>
+ <path fill="#54595d" d="M17.19 7.223v5.761h3.427v-1.21H18.4V7.223h-1.21z"/>
+</svg>
diff --git a/MLEB/Translate/resources/images/outdated-rtl.png b/MLEB/Translate/resources/images/outdated-rtl.png
deleted file mode 100644
index df66f7e5..00000000
--- a/MLEB/Translate/resources/images/outdated-rtl.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/outdated-rtl.svg b/MLEB/Translate/resources/images/outdated-rtl.svg
index 1eeeab78..13bcacd8 100644
--- a/MLEB/Translate/resources/images/outdated-rtl.svg
+++ b/MLEB/Translate/resources/images/outdated-rtl.svg
@@ -1,32 +1,6 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="33.389"
- height="22.857"
- viewBox="0 0 33.389 22.857"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata10"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs8" />
-<path
- d="M 33.389,0 H 7.467 L 0,11.429 7.467,22.858 H 33.389 V 0 z"
- id="rect12220-2"
- style="fill:#fef4ba" />
-<path
- d="m 15.408,4.357 c -4.06,0 -7.375,3.316 -7.375,7.375 0,4.059 3.315,7.375 7.375,7.375 4.059,0 7.375,-3.316 7.375,-7.375 0,-4.059 -3.316,-7.375 -7.375,-7.375 z m 0,1.768 c 3.104,0 5.607,2.504 5.607,5.607 0,3.103 -2.504,5.607 -5.607,5.607 -3.103,0 -5.607,-2.504 -5.607,-5.607 0,-3.103 2.504,-5.607 5.607,-5.607 z"
- id="path4660-7-2-3-7-0-0"
- style="fill:#565656" />
-<path
- d="m 14.616,7.223 v 4.552 0.764 0.446 h 3.428 v -1.21 H 15.826 V 7.223 h -1.21 z"
- id="rect4662-1-2-3-7-4-3"
- style="fill:#565656" />
-</svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="33.389" height="22.857" viewBox="0 0 33.389 22.857">
+ <path fill="#fef4ba" d="M33.39 0H7.466L0 11.43l7.467 11.428H33.39V0z"/>
+ <path fill="#54595d" d="M15.408 4.357c-4.06 0-7.375 3.316-7.375 7.375 0 4.06 3.315 7.375 7.375 7.375 4.06 0 7.375-3.316 7.375-7.375 0-4.06-3.316-7.375-7.375-7.375zm0 1.768c3.104 0 5.607 2.504 5.607 5.607s-2.504 5.607-5.607 5.607S9.8 14.834 9.8 11.73c0-3.103 2.505-5.607 5.608-5.607z"/>
+ <path fill="#54595d" d="M14.616 7.223v5.761h3.428v-1.21h-2.218V7.223h-1.21z"/>
+</svg>
diff --git a/MLEB/Translate/resources/images/paste.png b/MLEB/Translate/resources/images/paste.png
deleted file mode 100644
index bbade5d4..00000000
--- a/MLEB/Translate/resources/images/paste.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/paste.svg b/MLEB/Translate/resources/images/paste.svg
index 38373db2..932c4b22 100644
--- a/MLEB/Translate/resources/images/paste.svg
+++ b/MLEB/Translate/resources/images/paste.svg
@@ -1,17 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
- width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
-<g>
- <path fill="#6D6E71" d="M29.077,29.012c0,1.061-0.859,1.92-1.92,1.92H4.844c-1.061,0-1.921-0.859-1.921-1.92V4.043
- c0-1.061,0.86-1.92,1.921-1.92h22.313c1.061,0,1.92,0.859,1.92,1.92V29.012z"/>
-
- <rect x="5.368" y="4.054" fill="#F1F2F2" stroke="#58595B" stroke-width="0.5" stroke-miterlimit="10" width="21" height="24.349"/>
- <rect x="7.743" y="8.896" fill="#A7A9AC" width="15.625" height="2.872"/>
- <rect x="7.743" y="15.09" fill="#A7A9AC" width="15.625" height="2.875"/>
- <rect x="7.743" y="21.287" fill="#A7A9AC" width="6.125" height="2.873"/>
- <polygon fill="#414042" points="18.646,2.814 18.646,1.068 13.354,1.068 13.354,2.814 10.459,2.814 10.459,5.152 21.542,5.152
- 21.542,2.814 "/>
-</g>
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
+ <path fill="#54595d" d="M29.077 29.012c0 1.06-.86 1.92-1.92 1.92H4.844c-1.06 0-1.92-.86-1.92-1.92V4.042c0-1.06.86-1.92 1.92-1.92h22.313c1.06 0 1.92.86 1.92 1.92v24.97z"/>
+ <path fill="#f8f9fa" stroke="#54595d" stroke-width=".5" stroke-miterlimit="10" d="M5.368 4.054h21v24.35h-21z"/>
+ <path fill="#a2a9b1" d="M7.743 8.896h15.625v2.872H7.743zM7.743 15.09h15.625v2.875H7.743zM7.743 21.287h6.125v2.873H7.743z"/>
+ <path fill="#414042" d="M18.646 2.814V1.068h-5.292v1.746H10.46v2.338H21.54V2.814"/>
</svg>
diff --git a/MLEB/Translate/resources/images/plus_darkgray.png b/MLEB/Translate/resources/images/plus_darkgray.png
deleted file mode 100644
index 4780479e..00000000
--- a/MLEB/Translate/resources/images/plus_darkgray.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/plus_darkgray.svg b/MLEB/Translate/resources/images/plus_darkgray.svg
index abedfc22..5cf4e598 100644
--- a/MLEB/Translate/resources/images/plus_darkgray.svg
+++ b/MLEB/Translate/resources/images/plus_darkgray.svg
@@ -1 +1,4 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 768" enable-background="new 0 0 1024 768"><path fill="#555" d="M870.5 445.2v-122.4h-297.3v-297.3h-122.4v297.3h-297.3v122.4h297.3v297.3h122.4v-297.3z"/></svg>
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 768">
+ <path fill="#54595d" d="M870.5 445.2V322.8H573.2V25.5H450.8v297.3H153.5v122.4h297.3v297.3h122.4V445.2z"/>
+</svg>
diff --git a/MLEB/Translate/resources/images/prog-3.png b/MLEB/Translate/resources/images/prog-3.png
index f560c348..bfba1464 100644
--- a/MLEB/Translate/resources/images/prog-3.png
+++ b/MLEB/Translate/resources/images/prog-3.png
Binary files differ
diff --git a/MLEB/Translate/resources/images/prog-4.png b/MLEB/Translate/resources/images/prog-4.png
index d556b5b3..132ee756 100644
--- a/MLEB/Translate/resources/images/prog-4.png
+++ b/MLEB/Translate/resources/images/prog-4.png
Binary files differ
diff --git a/MLEB/Translate/resources/images/prog-5.png b/MLEB/Translate/resources/images/prog-5.png
index 8a12f3d7..8b86fbb4 100644
--- a/MLEB/Translate/resources/images/prog-5.png
+++ b/MLEB/Translate/resources/images/prog-5.png
Binary files differ
diff --git a/MLEB/Translate/resources/images/project.png b/MLEB/Translate/resources/images/project.png
deleted file mode 100644
index b8b9462c..00000000
--- a/MLEB/Translate/resources/images/project.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/project.svg b/MLEB/Translate/resources/images/project.svg
index 64ec16b2..0e7a128b 100644
--- a/MLEB/Translate/resources/images/project.svg
+++ b/MLEB/Translate/resources/images/project.svg
@@ -1,66 +1,13 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="32"
- height="32"
- viewBox="0 0 32 32"
- id="svg3945"
- xml:space="preserve"><metadata
- id="metadata18"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs16" />
-<g
- transform="translate(-355.875,-530.20145)"
- id="layer1">
- <g
- id="g3815">
-
- <rect
- width="13.336"
- height="6.4949999"
- x="373.173"
- y="532.79199"
- id="rect4026-0-8-9-6-6-2-1-4-7-7-2-4-7-6"
- style="fill:#ffffff;fill-opacity:0.675;stroke:#c9c9c9;stroke-width:0.2572;stroke-linecap:round" />
-
- <linearGradient
- x1="716.99408"
- y1="-394.2966"
- x2="716.99408"
- y2="-422.53201"
- id="rect3213-2-4-3-9-5-6-8-3-5-6_1_"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1.0287,0,0,-1.0287,-365.6989,126.7675)">
- <stop
- id="stop7"
- style="stop-color:#f4f4f4;stop-opacity:1"
- offset="0" />
- <stop
- id="stop9"
- style="stop-color:#dddddd;stop-opacity:1"
- offset="1" />
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" xml:space="preserve">
+ <g transform="translate(-355.875,-530.20145)">
+ <rect width="13.336" height="6.4949999" x="373.173" y="532.79199" style="fill:#fff;fill-opacity:0.675;stroke:#c9c9c9;stroke-width:0.2572;stroke-linecap:round"/>
+ <linearGradient id="a" x1="716.99408" y1="-394.2966" x2="716.99408" y2="-422.53201" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.0287,0,0,-1.0287,-365.6989,126.7675)">
+ <stop style="stop-color:#f4f4f4;stop-opacity:1" offset="0"/>
+ <stop style="stop-color:#dddddd;stop-opacity:1" offset="1"/>
</linearGradient>
-
- <path
- d="m 356.261,530.587 h 16.295 l 6.267,6.267 h 8.667 v 24.962 h -31.229 v -31.229 z"
- id="rect3213-2-4-3-9-5-6-8-3-5-6"
- style="fill:url(#rect3213-2-4-3-9-5-6-8-3-5-6_1_);stroke:#9d9d9d;stroke-width:0.77149999;stroke-linecap:square" />
- <path
- d="m 381.718,548.951 c 0.006,5.437 -4.396,9.848 -9.832,9.854 -5.436,0.006 -9.847,-4.396 -9.854,-9.831 0,-0.008 0,-0.016 0,-0.022 -0.006,-5.436 4.396,-9.847 9.832,-9.854 5.436,-0.006 9.847,4.396 9.854,9.832 0,0.006 0,0.014 0,0.021 z"
- id="path5753-1-5-3-9-8-2-7-5-8"
- style="fill:#f0f0f0;stroke:#6d6d6d;stroke-width:0.84439999;stroke-linecap:round" />
- <path
- d="m 372.031,541.108 c -0.825,0.023 -2.344,0.219 -2.344,0.219 0,0 0.25,0.477 0.25,0.688 0,0.211 -0.062,0.778 -0.062,1.031 0,0.253 0.925,0.053 1.094,-0.031 0.169,-0.084 1.281,-1.062 1.281,-1.062 0,0 0.408,-0.612 0.281,-0.781 -0.031,-0.044 -0.225,-0.072 -0.5,-0.064 l 0,0 z m -4.469,0.718 c 0.06,0.656 0.844,1.094 0.844,1.094 l 0.125,-0.438 c 0,10e-4 -0.67,-0.656 -0.969,-0.656 z m -0.781,0.438 c 0,0 -0.406,0.347 -1.062,0.406 -0.247,0.022 -0.745,-0.072 -1.281,-0.156 -1.188,1.37 -1.995,3.062 -2.281,4.938 l 0.219,-0.312 c 0,0 0.77,1.381 1.188,1.5 0.418,0.119 0.892,0.543 1.25,0.781 0.358,0.238 0.591,1.472 0.531,2.188 -0.06,0.716 0.483,0.804 0.781,1.281 0.298,0.477 0.949,3.326 1.188,3.625 0.239,0.299 0.475,-1.253 0.594,-1.969 0.119,-0.716 1.688,-2.034 1.688,-2.75 0,-0.716 -1.798,-1.736 -2.156,-2.094 -0.358,-0.358 -1.477,-0.531 -2.312,-0.531 -0.835,0 -0.847,-1.128 -1.562,-1.188 -0.715,-0.06 0.125,-1 0.125,-1 0,0 1.958,-0.312 2.375,-0.312 0.417,0 0.54,-1.182 0.719,-1.719 0.179,-0.537 1.506,-0.486 1.625,-0.844 0.119,-0.358 -0.542,-0.719 -0.781,-0.719 -0.239,0 -1.259,0.364 -1.438,0.125 -0.179,-0.239 1.031,-0.969 1.031,-0.969 l -0.441,-0.281 z m 9.063,0 c -0.197,0.016 -0.374,0.052 -0.438,0.094 -0.127,0.084 -0.467,0.216 -0.594,0.406 -0.127,0.19 -0.272,0.624 -0.125,0.75 0.147,0.126 0.26,0.157 0.344,0.094 0.084,-0.063 0.729,-0.616 0.812,-0.531 0.083,0.085 0.283,0.594 0.156,0.594 -0.127,0 -1.031,0.281 -1.031,0.281 0,0 -0.003,-0.171 -0.062,-0.156 -0.06,0.015 -0.003,0.235 -0.062,0.25 -0.06,0.015 -0.844,0.375 -0.844,0.375 0,0 -0.1,0.088 -0.219,0.188 l -0.25,0.25 c -0.006,0.007 -0.027,0.025 -0.031,0.031 -0.06,0.104 -0.39,0.599 -0.375,0.719 0.016,0.119 -0.07,0.375 0.094,0.375 0.164,0 1.27,-0.682 1.344,-0.562 0.074,0.119 0.188,0.125 0.188,0.125 0,0 -0.074,-0.156 0,-0.156 0.074,0 0.562,0.188 0.562,0.188 0,0 -0.073,-0.312 0.031,-0.281 0.104,0.03 0.583,0.594 0.688,0.594 0.105,0 0.358,-0.007 0.344,-0.156 -0.015,-0.149 -0.068,-0.335 0.125,-0.469 0.193,-0.134 0.787,-0.231 0.906,-0.156 0.119,0.074 0.304,0.16 0.125,0.25 -0.18,0.089 -0.396,-0.014 -0.5,0.031 -0.104,0.044 -0.392,0.333 -0.406,0.438 -0.015,0.104 0.561,0.565 0.531,0.625 -0.029,0.06 -0.326,0.344 -0.625,0.344 -0.299,0 -2.484,-0.546 -2.812,-0.531 -0.328,0.015 -0.615,0.099 -0.75,0.219 -0.135,0.119 -0.707,0.648 -0.781,0.812 -0.074,0.164 -0.398,0.957 -0.219,1.375 0.179,0.418 0.584,1.176 1.031,1.25 0.447,0.074 0.99,0.107 1.125,0.062 0.135,-0.045 0.859,0.76 0.875,1.312 0.015,0.552 -0.039,1.938 0.125,2.281 0.164,0.343 0.291,0.982 0.812,0.938 0.521,-0.044 0.945,-0.168 1.125,-0.406 0.179,-0.238 0.678,-1.455 0.812,-2.156 0.134,-0.701 0.754,-1.754 0.844,-2.156 0.09,-0.402 0.102,-0.631 -0.062,-0.75 -0.164,-0.119 -0.485,-0.116 -0.5,-0.25 -0.016,-0.135 0.209,-0.016 0.344,0 0.135,0.015 0.631,-0.022 0.75,-0.156 0.119,-0.135 0.324,-0.571 0.25,-0.75 -0.074,-0.18 -0.406,-0.562 -0.406,-0.562 0,0 1.338,0.161 1.875,0.594 0.312,0.251 0.564,0.577 0.75,0.844 -0.047,-2.462 -0.994,-4.705 -2.531,-6.406 -0.014,0.002 -0.054,0.031 -0.062,0.031 -0.232,0 -2.031,0.344 -2.031,0.344 0,0 -0.393,-0.447 -0.688,-0.469 -0.149,-0.016 -0.367,-0.021 -0.564,-0.005 l 0,0 z m -2.282,1.312 c 0,0 -0.212,0.865 0.094,0.844 0.306,-0.021 -0.094,-0.844 -0.094,-0.844 z m -0.406,0.375 c 0,0 -0.365,0.187 -0.281,0.281 0.084,0.094 0.26,0.147 0.312,0.062 0.052,-0.085 -0.031,-0.343 -0.031,-0.343 l 0,0 z m 5.719,8.094 c -0.121,0.026 -0.265,0.124 -0.344,0.219 -0.079,0.095 -0.198,0.43 -0.156,0.625 0.042,0.195 0.218,0.459 0.281,0.438 0.063,-0.021 0.229,-0.084 0.25,-0.438 0.021,-0.354 0.078,-0.671 0.031,-0.75 -0.047,-0.079 -0.062,-0.094 -0.062,-0.094 l 0,0 z"
- id="path6360-91-0-9-0"
- style="fill:#6d6d6d" />
+ <path d="m 356.261,530.587 h 16.295 l 6.267,6.267 h 8.667 v 24.962 h -31.229 v -31.229 z" style="fill:url(#a);stroke:#9d9d9d;stroke-width:0.77149999;stroke-linecap:square"/>
+ <path d="m 381.718,548.951 c 0.006,5.437 -4.396,9.848 -9.832,9.854 -5.436,0.006 -9.847,-4.396 -9.854,-9.831 0,-0.008 0,-0.016 0,-0.022 -0.006,-5.436 4.396,-9.847 9.832,-9.854 5.436,-0.006 9.847,4.396 9.854,9.832 0,0.006 0,0.014 0,0.021 z" style="fill:#f0f0f0;stroke:#6d6d6d;stroke-width:0.84439999;stroke-linecap:round"/>
+ <path d="m 372.031,541.108 c -0.825,0.023 -2.344,0.219 -2.344,0.219 0,0 0.25,0.477 0.25,0.688 0,0.211 -0.062,0.778 -0.062,1.031 0,0.253 0.925,0.053 1.094,-0.031 0.169,-0.084 1.281,-1.062 1.281,-1.062 0,0 0.408,-0.612 0.281,-0.781 -0.031,-0.044 -0.225,-0.072 -0.5,-0.064 l 0,0 z m -4.469,0.718 c 0.06,0.656 0.844,1.094 0.844,1.094 l 0.125,-0.438 c 0,10e-4 -0.67,-0.656 -0.969,-0.656 z m -0.781,0.438 c 0,0 -0.406,0.347 -1.062,0.406 -0.247,0.022 -0.745,-0.072 -1.281,-0.156 -1.188,1.37 -1.995,3.062 -2.281,4.938 l 0.219,-0.312 c 0,0 0.77,1.381 1.188,1.5 0.418,0.119 0.892,0.543 1.25,0.781 0.358,0.238 0.591,1.472 0.531,2.188 -0.06,0.716 0.483,0.804 0.781,1.281 0.298,0.477 0.949,3.326 1.188,3.625 0.239,0.299 0.475,-1.253 0.594,-1.969 0.119,-0.716 1.688,-2.034 1.688,-2.75 0,-0.716 -1.798,-1.736 -2.156,-2.094 -0.358,-0.358 -1.477,-0.531 -2.312,-0.531 -0.835,0 -0.847,-1.128 -1.562,-1.188 -0.715,-0.06 0.125,-1 0.125,-1 0,0 1.958,-0.312 2.375,-0.312 0.417,0 0.54,-1.182 0.719,-1.719 0.179,-0.537 1.506,-0.486 1.625,-0.844 0.119,-0.358 -0.542,-0.719 -0.781,-0.719 -0.239,0 -1.259,0.364 -1.438,0.125 -0.179,-0.239 1.031,-0.969 1.031,-0.969 l -0.441,-0.281 z m 9.063,0 c -0.197,0.016 -0.374,0.052 -0.438,0.094 -0.127,0.084 -0.467,0.216 -0.594,0.406 -0.127,0.19 -0.272,0.624 -0.125,0.75 0.147,0.126 0.26,0.157 0.344,0.094 0.084,-0.063 0.729,-0.616 0.812,-0.531 0.083,0.085 0.283,0.594 0.156,0.594 -0.127,0 -1.031,0.281 -1.031,0.281 0,0 -0.003,-0.171 -0.062,-0.156 -0.06,0.015 -0.003,0.235 -0.062,0.25 -0.06,0.015 -0.844,0.375 -0.844,0.375 0,0 -0.1,0.088 -0.219,0.188 l -0.25,0.25 c -0.006,0.007 -0.027,0.025 -0.031,0.031 -0.06,0.104 -0.39,0.599 -0.375,0.719 0.016,0.119 -0.07,0.375 0.094,0.375 0.164,0 1.27,-0.682 1.344,-0.562 0.074,0.119 0.188,0.125 0.188,0.125 0,0 -0.074,-0.156 0,-0.156 0.074,0 0.562,0.188 0.562,0.188 0,0 -0.073,-0.312 0.031,-0.281 0.104,0.03 0.583,0.594 0.688,0.594 0.105,0 0.358,-0.007 0.344,-0.156 -0.015,-0.149 -0.068,-0.335 0.125,-0.469 0.193,-0.134 0.787,-0.231 0.906,-0.156 0.119,0.074 0.304,0.16 0.125,0.25 -0.18,0.089 -0.396,-0.014 -0.5,0.031 -0.104,0.044 -0.392,0.333 -0.406,0.438 -0.015,0.104 0.561,0.565 0.531,0.625 -0.029,0.06 -0.326,0.344 -0.625,0.344 -0.299,0 -2.484,-0.546 -2.812,-0.531 -0.328,0.015 -0.615,0.099 -0.75,0.219 -0.135,0.119 -0.707,0.648 -0.781,0.812 -0.074,0.164 -0.398,0.957 -0.219,1.375 0.179,0.418 0.584,1.176 1.031,1.25 0.447,0.074 0.99,0.107 1.125,0.062 0.135,-0.045 0.859,0.76 0.875,1.312 0.015,0.552 -0.039,1.938 0.125,2.281 0.164,0.343 0.291,0.982 0.812,0.938 0.521,-0.044 0.945,-0.168 1.125,-0.406 0.179,-0.238 0.678,-1.455 0.812,-2.156 0.134,-0.701 0.754,-1.754 0.844,-2.156 0.09,-0.402 0.102,-0.631 -0.062,-0.75 -0.164,-0.119 -0.485,-0.116 -0.5,-0.25 -0.016,-0.135 0.209,-0.016 0.344,0 0.135,0.015 0.631,-0.022 0.75,-0.156 0.119,-0.135 0.324,-0.571 0.25,-0.75 -0.074,-0.18 -0.406,-0.562 -0.406,-0.562 0,0 1.338,0.161 1.875,0.594 0.312,0.251 0.564,0.577 0.75,0.844 -0.047,-2.462 -0.994,-4.705 -2.531,-6.406 -0.014,0.002 -0.054,0.031 -0.062,0.031 -0.232,0 -2.031,0.344 -2.031,0.344 0,0 -0.393,-0.447 -0.688,-0.469 -0.149,-0.016 -0.367,-0.021 -0.564,-0.005 l 0,0 z m -2.282,1.312 c 0,0 -0.212,0.865 0.094,0.844 0.306,-0.021 -0.094,-0.844 -0.094,-0.844 z m -0.406,0.375 c 0,0 -0.365,0.187 -0.281,0.281 0.084,0.094 0.26,0.147 0.312,0.062 0.052,-0.085 -0.031,-0.343 -0.031,-0.343 l 0,0 z m 5.719,8.094 c -0.121,0.026 -0.265,0.124 -0.344,0.219 -0.079,0.095 -0.198,0.43 -0.156,0.625 0.042,0.195 0.218,0.459 0.281,0.438 0.063,-0.021 0.229,-0.084 0.25,-0.438 0.021,-0.354 0.078,-0.671 0.031,-0.75 -0.047,-0.079 -0.062,-0.094 -0.062,-0.094 l 0,0 z" style="fill:#6d6d6d"/>
</g>
-</g>
-</svg> \ No newline at end of file
+</svg>
diff --git a/MLEB/Translate/resources/images/remove.png b/MLEB/Translate/resources/images/remove.png
deleted file mode 100644
index 9fcfda42..00000000
--- a/MLEB/Translate/resources/images/remove.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/remove.svg b/MLEB/Translate/resources/images/remove.svg
index bd01e96a..3cc0c703 100644
--- a/MLEB/Translate/resources/images/remove.svg
+++ b/MLEB/Translate/resources/images/remove.svg
@@ -1 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><defs><linearGradient id="c"><stop offset="0" stop-color="#fa9a87"/><stop offset="1" stop-color="#e9594d"/></linearGradient><linearGradient><stop offset="0" stop-color="#74b75b"/><stop offset="1" stop-color="#86c97a"/></linearGradient><linearGradient id="b"><stop offset="0" stop-color="#fddbd4"/><stop offset="1" stop-color="#e47871"/></linearGradient><linearGradient id="a"><stop offset="0" stop-color="#c14d33"/><stop offset="1" stop-color="#e0696a"/></linearGradient><linearGradient x1="12.758" y1="13.001" x2="2.583" y2="2.521" id="e" xlink:href="#a" gradientUnits="userSpaceOnUse"/><linearGradient x1="2.583" y1="2.521" x2="12.758" y2="13.001" id="d" xlink:href="#b" gradientUnits="userSpaceOnUse"/><linearGradient x1="4.551" y1="4.433" x2="11.459" y2="11.341" id="f" xlink:href="#c" gradientUnits="userSpaceOnUse"/></defs><g><path d="M14.647 7.824a6.85 6.85 0 1 1-13.7 0 6.85 6.85 0 1 1 13.7 0z" transform="translate(.253 .127)" fill="url(#d)" fill-rule="evenodd" stroke="url(#e)"/><path d="M13.006 7.982a4.988 4.988 0 1 1-9.976 0 4.988 4.988 0 1 1 9.976 0z" transform="matrix(1.002 0 0 1.002 -.038 -.001)" fill="url(#f)"/><path d="M5 9h6V7H5.004z" fill="#fff" fill-opacity=".957"/></g></svg>
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16">
+ <defs>
+ <linearGradient id="c">
+ <stop offset="0" stop-color="#fa9a87"/>
+ <stop offset="1" stop-color="#e9594d"/>
+ </linearGradient>
+ <linearGradient id="b">
+ <stop offset="0" stop-color="#fddbd4"/>
+ <stop offset="1" stop-color="#e47871"/>
+ </linearGradient>
+ <linearGradient id="a">
+ <stop offset="0" stop-color="#c14d33"/>
+ <stop offset="1" stop-color="#e0696a"/>
+ </linearGradient>
+ <linearGradient id="e" x1="12.758" x2="2.583" y1="13.001" y2="2.521" xlink:href="#a" gradientUnits="userSpaceOnUse"/>
+ <linearGradient id="d" x1="2.583" x2="12.758" y1="2.521" y2="13.001" xlink:href="#b" gradientUnits="userSpaceOnUse"/>
+ <linearGradient id="f" x1="4.551" x2="11.459" y1="4.433" y2="11.341" xlink:href="#c" gradientUnits="userSpaceOnUse"/>
+ </defs>
+ <path fill="url(#d)" fill-rule="evenodd" stroke="url(#e)" d="M14.647 7.824a6.85 6.85 0 1 1-13.7 0 6.85 6.85 0 1 1 13.7 0z" transform="translate(.253 .127)"/>
+ <path fill="url(#f)" d="M13.006 7.982a4.988 4.988 0 1 1-9.976 0 4.988 4.988 0 1 1 9.976 0z" transform="translate(-.038) scale(1.002)"/>
+ <path fill="#fff" fill-opacity=".957" d="M5 9h6V7H5.004z"/>
+</svg>
diff --git a/MLEB/Translate/resources/images/search.png b/MLEB/Translate/resources/images/search.png
deleted file mode 100644
index 9b58456a..00000000
--- a/MLEB/Translate/resources/images/search.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/search.svg b/MLEB/Translate/resources/images/search.svg
index 799cb17e..e9d42573 100644
--- a/MLEB/Translate/resources/images/search.svg
+++ b/MLEB/Translate/resources/images/search.svg
@@ -1,32 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="32"
- height="32.000031"
- id="svg2">
- <defs
- id="defs4" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <path
- d="m 3.37703,3.37704 c 4.50273,-4.50274 11.80568,-4.50272 16.3085,6e-5 4.07216,4.07223 4.41687,10.42533 1.12323,14.93559 L 32,29.50385 29.50385,32.00003 18.3126,20.80887 C 13.80244,24.1025 7.44932,23.75797 3.37711,19.68548 -1.1257,15.18284 -1.12568,7.8799 3.37703,3.37704 z m 2.12176,2.12187 c -3.34229,3.34214 -3.38386,8.76418 -0.0416,12.10657 3.34232,3.34223 8.80592,3.34224 12.1482,-2e-5 C 20.94762,14.26307 20.90595,8.84117 17.56369,5.49878 14.22149,2.15665 8.84106,2.15665 5.49878,5.49891 z"
- id="path3017-6-34-0"
- style="fill:#555555;fill-opacity:1;stroke:none" />
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
+ <path fill="#54595d" d="M3.377 3.377c4.503-4.503 11.806-4.503 16.31 0 4.07 4.072 4.415 10.425 1.122 14.936L32 29.503 29.504 32l-11.19-11.19C13.8 24.102 7.448 23.757 3.376 19.684c-4.503-4.502-4.503-11.805 0-16.308zM5.5 5.5c-3.344 3.34-3.385 8.763-.043 12.105 3.343 3.343 8.806 3.343 12.148 0 3.343-3.342 3.3-8.764-.04-12.106-3.344-3.343-8.724-3.343-12.066 0z"/>
</svg>
diff --git a/MLEB/Translate/resources/images/switch.png b/MLEB/Translate/resources/images/switch.png
deleted file mode 100644
index 6fb6dbf6..00000000
--- a/MLEB/Translate/resources/images/switch.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/switch.svg b/MLEB/Translate/resources/images/switch.svg
index 0bace40c..40967827 100644
--- a/MLEB/Translate/resources/images/switch.svg
+++ b/MLEB/Translate/resources/images/switch.svg
@@ -1 +1,5 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 768" enable-background="new 0 0 1024 768"><path d="M751.863 131.86l-186.744-1.106H349.325V27.837L128 233.67l221.326 188.127V318.88H565.12v215.793H462.2L650.33 756l204.726-221.327H752.14V318.88l-.278-187.02zm-90.467 90.745v4.427h-4.427v-4.427h4.426z" fill="#555"/><path d="M655.503 228.447c.062-1.788.05-3.578.046-5.367-.024-1.523-.09-3.04.26-4.532 1.39-4.26 2.03-2.45 9.012-5.744.175 1.704.095 3.43.094 5.144.004 1.708-.003 3.417.003 5.125.006 1.19.008 2.377.024 3.566.014.585.016 1.17.022 1.757-.028 4.033.477.91-8.24 5.074.058-1.59.057-3.18.078-4.77.085-3.247.003-6.496.118-9.742.105-2.014.248-4.026.37-6.04.145-3.94 2.308-3.068 8.245-5.887.213-.1.498.788.733 1.42.733 2.91 1.115 5.89 1.545 8.853.457 3.367.885 6.733 1.15 10.12.152 2.527.183 5.053.587 7.555.26 1.834.743 3.62 1.19 5.415.188.823.355 1.65.407 2.492.288 3.13.21 1.59-8.18 3.726-.477.123.093-.98.134-1.47.065-.776.133-1.55.184-2.327.175-2.656.19-3.618.294-6.34.115-4.458.13-8.92.043-13.378.06-1.338 0-2.536-.664-3.706-.49-.782-1.084-1.407-2.002-1.597-1.142-.125-2.296-.1-3.443-.105-.726-.003-1.08-.067-1.787.197-.342.128-1.292.682-.972.506 2.18-1.2 4.274-2.573 6.55-3.575.537-.236-.858.8-1.246 1.24-.412.468-.765.984-1.147 1.476-1.974 2.593-3.098 5.555-3.673 8.73-.33 2.2-.3 4.426-.313 6.644-.014 2.337.006 4.674.04 7.01-.027 1.143.127 2.262.595 3.304.156.294.303.586.43.893l-8.073 4.495c-.105-.298-.243-.578-.38-.863-.523-1.167-.75-2.414-.668-3.7.015-2.338.01-4.675-.036-7.013-.023-2.277.016-4.557.307-6.817.536-3.302 1.61-6.413 3.59-9.152.234-.33 1.82-2.655 2.22-2.923 3.898-2.61 7.296-5.858 11.956-5.82 1.226 0 2.49-.06 3.675.313 1.013.462 1.74 1.232 2.332 2.17.767 1.33.954 2.665.77 4.197-.172 4.53-.317 9.06-.425 13.59-.05 2.836-.087 5.67-.113 8.507-.005.453.346 1.087-.016 1.36-8.295 6.283-8.283 8.008-8.195 4.66-.02-.802-.1-1.598-.26-2.384-.376-1.835-.88-3.642-1.138-5.5-.442-2.542-.443-5.108-.54-7.68-.216-3.374-.638-6.722-1.096-10.07-.422-2.877-.792-5.777-1.63-8.568-1.09-2.503-1.21.16 7.562-5.02.378-.223-.205.062-.3.447-.038.153-.027.314-.04.472-.172 2.04-.458 4.072-.582 6.117-.173 3.214-.062 6.434-.03 9.652.02 1.564.02 3.13.077 4.692-9.543 5.167-8.17 7.38-8.24 3.323.006-.594.008-1.187.022-1.78.017-1.2.02-2.398.03-3.596.012-1.715.017-3.43.036-5.145.008-1.604.02-3.21-.087-4.81 8.643-4.672 9.406-6.928 7.386-2.63-.568 1.375-.443 2.85-.45 4.312-.003 1.773-.016 3.548.046 5.32l-8.203 4.18z" fill="#555"/></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 768">
+ <path fill="#54595d" d="M751.863 131.86l-186.744-1.106H349.324V27.837L128 233.67l221.326 188.127V318.88H565.12v215.793H462.2L650.33 756l204.726-221.327H752.14V318.88l-.278-187.02zm-90.467 90.745v4.427h-4.427v-4.427h4.425z"/>
+ <path fill="#54595d" d="M655.503 228.447c.062-1.788.05-3.578.046-5.367-.025-1.523-.09-3.04.26-4.532 1.39-4.26 2.03-2.45 9.01-5.744.176 1.704.096 3.43.095 5.144.004 1.708-.003 3.417.003 5.125.006 1.19.008 2.377.024 3.566.014.584.016 1.17.022 1.756-.028 4.033.477.91-8.24 5.074.058-1.59.057-3.18.078-4.77.085-3.247.003-6.496.118-9.742.105-2.014.248-4.026.37-6.04.145-3.94 2.308-3.068 8.245-5.887.213-.1.498.79.733 1.42.733 2.91 1.115 5.89 1.545 8.854.457 3.367.885 6.733 1.15 10.12.152 2.527.183 5.053.587 7.555.26 1.833.743 3.62 1.19 5.414.188.823.355 1.65.407 2.492.288 3.13.21 1.59-8.18 3.726-.477.123.093-.98.134-1.47.066-.776.134-1.55.185-2.327.175-2.656.19-3.618.294-6.34.114-4.458.13-8.92.042-13.378.06-1.338 0-2.536-.664-3.706-.49-.78-1.084-1.406-2.002-1.596-1.142-.125-2.296-.1-3.443-.105-.726-.004-1.08-.068-1.787.196-.342.128-1.292.682-.972.506 2.18-1.2 4.274-2.573 6.55-3.575.537-.236-.858.8-1.246 1.24-.412.468-.765.984-1.147 1.476-1.973 2.593-3.097 5.555-3.672 8.73-.33 2.2-.3 4.426-.313 6.644-.014 2.337.006 4.674.04 7.01-.027 1.143.127 2.262.595 3.304.156.295.303.587.43.894l-8.073 4.495c-.105-.3-.243-.58-.38-.864-.523-1.167-.75-2.414-.668-3.7.014-2.338.01-4.675-.037-7.013-.023-2.277.016-4.557.307-6.817.536-3.302 1.61-6.413 3.59-9.152.234-.33 1.82-2.655 2.22-2.923 3.898-2.61 7.296-5.857 11.956-5.82 1.226 0 2.49-.06 3.675.314 1.014.462 1.74 1.232 2.333 2.17.767 1.33.954 2.665.77 4.197-.172 4.53-.317 9.06-.425 13.59-.05 2.837-.087 5.67-.113 8.508-.005.453.346 1.087-.016 1.36-8.296 6.283-8.284 8.008-8.196 4.66-.02-.802-.1-1.598-.26-2.384-.376-1.835-.88-3.642-1.138-5.5-.442-2.542-.443-5.108-.54-7.68-.216-3.374-.638-6.722-1.096-10.07-.422-2.877-.792-5.777-1.63-8.568-1.09-2.503-1.21.16 7.562-5.02.378-.223-.205.062-.3.447-.038.153-.027.314-.04.472-.172 2.04-.458 4.072-.582 6.117-.173 3.214-.062 6.434-.03 9.652.02 1.564.02 3.13.077 4.692-9.543 5.167-8.17 7.38-8.24 3.323.006-.595.008-1.188.022-1.78.016-1.2.02-2.4.03-3.597.01-1.715.016-3.43.035-5.145.008-1.604.02-3.21-.087-4.81 8.643-4.672 9.406-6.928 7.386-2.63-.568 1.375-.443 2.85-.45 4.312-.003 1.773-.016 3.548.046 5.32l-8.203 4.18z"/>
+</svg>
diff --git a/MLEB/Translate/resources/images/translate-ltr.png b/MLEB/Translate/resources/images/translate-ltr.png
deleted file mode 100644
index 0182a537..00000000
--- a/MLEB/Translate/resources/images/translate-ltr.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/translate-ltr.svg b/MLEB/Translate/resources/images/translate-ltr.svg
index 24e56a34..7bfc8618 100644
--- a/MLEB/Translate/resources/images/translate-ltr.svg
+++ b/MLEB/Translate/resources/images/translate-ltr.svg
@@ -1,29 +1,5 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="33.389"
- height="22.857"
- viewBox="0 0 33.389 22.857"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata9"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs7" />
-
-<path
- d="m 0,0 h 25.922 l 7.467,11.429 -7.467,11.429 H 0 V 0 z"
- id="rect12220"
- style="fill:#729fcf" />
-<path
- d="m 21.324,2.915 -9.343,13.311 -0.022,0.003 -0.284,3.239 2.968,-1.379 9.344,-13.31 -2.663,-1.864 0,0 z"
- id="rect8752-2-8-5-49-6-2-0-2-5-4-0-4-5-8-7-6-4-9-9-0-3-2-1-1-3-7-4-8-3"
- style="fill:#ffffff" />
-</svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="33.389" height="22.857" viewBox="0 0 33.389 22.857">
+ <path fill="#729fcf" d="M0 0h25.922l7.467 11.43-7.468 11.428H0V0z"/>
+ <path fill="#fff" d="M21.324 2.915l-9.343 13.31-.02.004-.285 3.238 2.968-1.38 9.344-13.31-2.663-1.863z"/>
+</svg>
diff --git a/MLEB/Translate/resources/images/translate-rtl.png b/MLEB/Translate/resources/images/translate-rtl.png
deleted file mode 100644
index 90a845cb..00000000
--- a/MLEB/Translate/resources/images/translate-rtl.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/translate-rtl.svg b/MLEB/Translate/resources/images/translate-rtl.svg
index 5f30aea8..9e9857f8 100644
--- a/MLEB/Translate/resources/images/translate-rtl.svg
+++ b/MLEB/Translate/resources/images/translate-rtl.svg
@@ -1,29 +1,5 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="33.389"
- height="22.857"
- viewBox="0 0 33.389 22.857"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata9"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs7" />
-
-<path
- d="M 33.389,0 H 7.467 L 0,11.429 7.467,22.858 H 33.389 V 0 z"
- id="rect12220"
- style="fill:#729fcf" />
-<path
- d="m 21.051,2.915 -9.343,13.311 -0.022,0.003 -0.284,3.239 2.968,-1.379 9.344,-13.31 -2.663,-1.864 0,0 z"
- id="rect8752-2-8-5-49-6-2-0-2-5-4-0-4-5-8-7-6-4-9-9-0-3-2-1-1-3-7-4-8-3"
- style="fill:#ffffff" />
-</svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="33.389" height="22.857" viewBox="0 0 33.389 22.857">
+ <path fill="#729fcf" d="M33.39 0H7.466L0 11.43l7.467 11.428H33.39V0z"/>
+ <path fill="#fff" d="M21.05 2.915l-9.342 13.31-.022.004-.284 3.238 2.968-1.38 9.344-13.31-2.663-1.863z"/>
+</svg>
diff --git a/MLEB/Translate/resources/images/trash_darkgray.png b/MLEB/Translate/resources/images/trash_darkgray.png
deleted file mode 100644
index 81b2f0cb..00000000
--- a/MLEB/Translate/resources/images/trash_darkgray.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/trash_darkgray.svg b/MLEB/Translate/resources/images/trash_darkgray.svg
index 5ac2cf0a..3d1bef76 100644
--- a/MLEB/Translate/resources/images/trash_darkgray.svg
+++ b/MLEB/Translate/resources/images/trash_darkgray.svg
@@ -1 +1,4 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" enable-background="new 0 0 96 96"><g fill="#555"><path d="M13.5 28.2l8.1 63c.3 2.7 2.4 4.8 5.1 4.8h42.6c2.7 0 4.8-2.1 4.8-4.5l8.1-63h-68.7v-.3zM77.4 6.6c3.6 0 6.6 1.5 6.6 3.3v7.2c0 1.8-3 1.5-6.9 1.5h-58.5c-3.6 0-6.6.3-6.6-1.5v-7.2c0-1.8 3-3.3 6.9-3.3l13.5-1.2 4.8-5.4h21.3l5.1 5.7 13.8.9z"/></g></svg>
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 96 96">
+ <path fill="#54595d" d="M13.5 28.2l8.1 63c.3 2.7 2.4 4.8 5.1 4.8h42.6c2.7 0 4.8-2.1 4.8-4.5l8.1-63H13.5v-.3zM77.4 6.6C81 6.6 84 8.1 84 9.9v7.2c0 1.8-3 1.5-6.9 1.5H18.6c-3.6 0-6.6.3-6.6-1.5V9.9c0-1.8 3-3.3 6.9-3.3l13.5-1.2L37.2 0h21.3l5.1 5.7 13.8.9z"/>
+</svg>
diff --git a/MLEB/Translate/resources/images/user-small.png b/MLEB/Translate/resources/images/user-small.png
deleted file mode 100644
index 880b035e..00000000
--- a/MLEB/Translate/resources/images/user-small.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/user-small.svg b/MLEB/Translate/resources/images/user-small.svg
index 082d0470..af79fbf1 100644
--- a/MLEB/Translate/resources/images/user-small.svg
+++ b/MLEB/Translate/resources/images/user-small.svg
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="15px" height="15px" viewBox="0 0 15 15" enable-background="new 0 0 15 15" xml:space="preserve">
-<g>
- <path fill="#D1D3D4" d="M12.281,4.776c0,2.639-2.142,4.783-4.78,4.783c-2.64,0-4.779-2.144-4.779-4.783 C2.722,2.138,4.861,0,7.501,0C10.14,0,12.281,2.138,12.281,4.776z"/>
- <path fill="#D1D3D4" d="M13.36,8.609h-0.947c-1.031,1.625-2.844,2.707-4.912,2.707c-2.068,0-3.883-1.082-4.914-2.707H1.645 c-0.445,0-0.799,0.358-0.799,0.801v4.795C0.846,14.641,1.199,15,1.645,15H13.36c0.44,0,0.794-0.359,0.794-0.795V9.41 C14.154,8.968,13.801,8.609,13.36,8.609z"/>
-</g>
-</svg> \ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15">
+ <g fill="#c8ccd1">
+ <path d="M12.28 4.776c0 2.64-2.14 4.783-4.78 4.783S2.723 7.414 2.723 4.775C2.722 2.138 4.862 0 7.502 0c2.638 0 4.78 2.138 4.78 4.776z"/>
+ <path d="M13.36 8.61h-.947c-1.03 1.624-2.844 2.706-4.912 2.706-2.067 0-3.882-1.082-4.913-2.707h-.942c-.445 0-.8.357-.8.8v4.795c0 .436.354.795.8.795H13.36c.44 0 .794-.36.794-.795V9.41c0-.442-.353-.8-.794-.8z"/>
+ </g>
+</svg>
diff --git a/MLEB/Translate/resources/images/view-list-hi.png b/MLEB/Translate/resources/images/view-list-hi.png
deleted file mode 100644
index 6e7342d0..00000000
--- a/MLEB/Translate/resources/images/view-list-hi.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/view-list-hi.svg b/MLEB/Translate/resources/images/view-list-hi.svg
index a3ea47f2..e9798819 100644
--- a/MLEB/Translate/resources/images/view-list-hi.svg
+++ b/MLEB/Translate/resources/images/view-list-hi.svg
@@ -1,50 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="25"
- height="15"
- viewBox="0 0 25 15"
- id="svg17805"
- xml:space="preserve"><metadata
- id="metadata11"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs9" />
-
-<g
- transform="translate(-159.64355,-100.30805)"
- id="layer1">
- <g
- transform="matrix(0.65003318,0,0,0.65003318,105.65437,41.0619)"
- id="g3770">
- <rect
- width="20.139999"
- height="4.1040001"
- x="92.216003"
- y="93.653"
- id="rect2996"
- style="fill:#ffffff" />
- <rect
- width="20.139999"
- height="4.1040001"
- x="92.216003"
- y="100.629"
- id="rect3766"
- style="fill:#ffffff" />
- <rect
- width="20.139999"
- height="4.1040001"
- x="92.216003"
- y="107.606"
- id="rect3768"
- style="fill:#ffffff" />
- </g>
-</g>
-</svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="25" height="15" viewBox="0 0 25 15">
+ <path fill="#fff" d="M5.954 1.63h13.092V4.3H5.954zM5.954 6.166h13.092v2.668H5.954zM5.954 10.7h13.092v2.67H5.954z"/>
+</svg>
diff --git a/MLEB/Translate/resources/images/view-list.png b/MLEB/Translate/resources/images/view-list.png
deleted file mode 100644
index b7f3cf06..00000000
--- a/MLEB/Translate/resources/images/view-list.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/view-list.svg b/MLEB/Translate/resources/images/view-list.svg
index c0585828..49f03d57 100644
--- a/MLEB/Translate/resources/images/view-list.svg
+++ b/MLEB/Translate/resources/images/view-list.svg
@@ -1,53 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="25"
- height="15"
- id="svg17805">
- <defs
- id="defs17807" />
- <metadata
- id="metadata17810">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- transform="translate(-159.64355,-100.30805)"
- id="layer1">
- <rect
- width="13.091612"
- height="2.6675708"
- x="165.59773"
- y="101.93939"
- id="rect2996"
- style="fill:#252525;fill-opacity:1;stroke:none" />
- <rect
- width="13.091612"
- height="2.6675708"
- x="165.59775"
- y="106.47427"
- id="rect3766"
- style="fill:#252525;fill-opacity:1;stroke:none" />
- <rect
- width="13.091612"
- height="2.6675708"
- x="165.59775"
- y="111.00913"
- id="rect3768"
- style="fill:#252525;fill-opacity:1;stroke:none" />
- </g>
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="25" height="15" viewBox="0 0 25 15">
+ <path fill="#222" d="M5.954 1.63h13.092V4.3H5.954zM5.954 6.166h13.092v2.668H5.954zM5.954 10.7h13.092v2.67H5.954z"/>
</svg>
diff --git a/MLEB/Translate/resources/images/view-page-hi.png b/MLEB/Translate/resources/images/view-page-hi.png
deleted file mode 100644
index 05b3e28a..00000000
--- a/MLEB/Translate/resources/images/view-page-hi.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/view-page-hi.svg b/MLEB/Translate/resources/images/view-page-hi.svg
index a4143656..24ad3426 100644
--- a/MLEB/Translate/resources/images/view-page-hi.svg
+++ b/MLEB/Translate/resources/images/view-page-hi.svg
@@ -1,40 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="25"
- height="15"
- id="svg17805">
- <defs
- id="defs17807" />
- <metadata
- id="metadata17810">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <path
- d="m 5.96875,1.625 0,2.6875 5.65625,0 0,-2.6875 -5.65625,0 z m 7.40625,0 0,2.6875 5.65625,0 0,-2.6875 -5.65625,0 z"
- id="rect2996"
- style="fill:#ffffff;fill-opacity:1;stroke:none" />
- <path
- d="m 5.96875,6.15625 0,2.6875 5.65625,0 0,-2.6875 -5.65625,0 z m 7.40625,0 0,2.6875 5.65625,0 0,-2.6875 -5.65625,0 z"
- id="rect3766"
- style="fill:#ffffff;fill-opacity:1;stroke:none" />
- <path
- d="m 5.96875,10.6875 0,2.6875 5.65625,0 0,-2.6875 -5.65625,0 z m 7.40625,0 0,2.6875 5.65625,0 0,-2.6875 -5.65625,0 z"
- id="rect3768"
- style="fill:#ffffff;fill-opacity:1;stroke:none" />
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="25" height="15" viewBox="0 0 25 15">
+ <path fill="#fff" d="M5.97 1.625v2.688h5.655V1.624H5.97zm7.405 0v2.688h5.656V1.624h-5.655zM5.97 6.156v2.688h5.655V6.156H5.97zm7.405 0v2.688h5.656V6.156h-5.655zM5.97 10.688v2.687h5.655v-2.688H5.97zm7.405 0v2.687h5.656v-2.688h-5.655z"/>
</svg>
diff --git a/MLEB/Translate/resources/images/view-page.png b/MLEB/Translate/resources/images/view-page.png
deleted file mode 100644
index 9a14d86e..00000000
--- a/MLEB/Translate/resources/images/view-page.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/view-page.svg b/MLEB/Translate/resources/images/view-page.svg
index 8eb196b2..7e983678 100644
--- a/MLEB/Translate/resources/images/view-page.svg
+++ b/MLEB/Translate/resources/images/view-page.svg
@@ -1,47 +1,6 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="25"
- height="15"
- id="svg17805">
- <defs
- id="defs17807" />
- <metadata
- id="metadata17810">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- transform="translate(-159.64355,-100.30805)"
- id="layer1">
- <path
- d="m 5.96875,1.625 0,2.6875 5.65625,0 0,-2.6875 -5.65625,0 z m 7.40625,0 0,2.6875 5.65625,0 0,-2.6875 -5.65625,0 z"
- transform="translate(159.64355,100.30805)"
- id="rect2996"
- style="fill:#252525;fill-opacity:1;stroke:none" />
- <path
- d="m 5.96875,6.15625 0,2.6875 5.65625,0 0,-2.6875 -5.65625,0 z m 7.40625,0 0,2.6875 5.65625,0 0,-2.6875 -5.65625,0 z"
- transform="translate(159.64355,100.30805)"
- id="rect3766"
- style="fill:#252525;fill-opacity:1;stroke:none" />
- <path
- d="m 5.96875,10.6875 0,2.6875 5.65625,0 0,-2.6875 -5.65625,0 z m 7.40625,0 0,2.6875 5.65625,0 0,-2.6875 -5.65625,0 z"
- transform="translate(159.64355,100.30805)"
- id="rect3768"
- style="fill:#252525;fill-opacity:1;stroke:none" />
- </g>
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="25" height="15" viewBox="0 0 25 15">
+ <g fill="#222">
+ <path d="M5.97 1.625v2.688h5.655V1.624H5.97zm7.405 0v2.688h5.656V1.624h-5.655zM5.97 6.156v2.688h5.655V6.156H5.97zm7.405 0v2.688h5.656V6.156h-5.655zM5.97 10.688v2.687h5.655v-2.688H5.97zm7.405 0v2.687h5.656v-2.688h-5.655z"/>
+ </g>
</svg>
diff --git a/MLEB/Translate/resources/images/view-proofread-hi.png b/MLEB/Translate/resources/images/view-proofread-hi.png
deleted file mode 100644
index 8f385504..00000000
--- a/MLEB/Translate/resources/images/view-proofread-hi.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/view-proofread-hi.svg b/MLEB/Translate/resources/images/view-proofread-hi.svg
index 51b8f2a3..4d38ee33 100644
--- a/MLEB/Translate/resources/images/view-proofread-hi.svg
+++ b/MLEB/Translate/resources/images/view-proofread-hi.svg
@@ -1,36 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="25"
- height="15"
- id="svg17805">
- <defs
- id="defs17807" />
- <metadata
- id="metadata17810">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- transform="translate(-159.64355,-100.30805)"
- id="layer1">
- <path
- d="m 175.4092,101.38615 -5.1875,8.93751 -2.0313,-1.5 -1.5937,2.125 3.25,2.4063 1.1875,0.875 0.75,-1.2813 5.9062,-10.25001 -2.2812,-1.3125 z"
- id="path12436-0-1-2-8-1-9-2-0"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2.6545198;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" />
- </g>
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="25" height="15" viewBox="0 0 25 15">
+ <path fill="#fff" d="M15.766 1.078l-5.188 8.938-2.03-1.5-1.595 2.125 3.25 2.407 1.188.875.75-1.28 5.907-10.25-2.28-1.314z" overflow="visible"/>
</svg>
diff --git a/MLEB/Translate/resources/images/view-proofread.png b/MLEB/Translate/resources/images/view-proofread.png
deleted file mode 100644
index bdb61dcc..00000000
--- a/MLEB/Translate/resources/images/view-proofread.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/Translate/resources/images/view-proofread.svg b/MLEB/Translate/resources/images/view-proofread.svg
index 5809b3fe..1b3f287b 100644
--- a/MLEB/Translate/resources/images/view-proofread.svg
+++ b/MLEB/Translate/resources/images/view-proofread.svg
@@ -1,36 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="25"
- height="15"
- id="svg17805">
- <defs
- id="defs17807" />
- <metadata
- id="metadata17810">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- transform="translate(-159.64355,-100.30805)"
- id="layer1">
- <path
- d="m 175.4092,101.38615 -5.1875,8.93751 -2.0313,-1.5 -1.5937,2.125 3.25,2.4063 1.1875,0.875 0.75,-1.2813 5.9062,-10.25001 -2.2812,-1.3125 z"
- id="path12436-0-1-2-8-1-9-2-0"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#252525;fill-opacity:1;stroke:none;stroke-width:2.6545198;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" />
- </g>
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="25" height="15" viewBox="0 0 25 15">
+ <path fill="#222" d="M15.766 1.078l-5.188 8.938-2.03-1.5-1.595 2.125 3.25 2.407 1.188.875.75-1.28 5.907-10.25-2.28-1.314z" overflow="visible"/>
</svg>
diff --git a/MLEB/Translate/resources/js/ext.translate.base.js b/MLEB/Translate/resources/js/ext.translate.base.js
index 76c8e7d7..d11d47b1 100644
--- a/MLEB/Translate/resources/js/ext.translate.base.js
+++ b/MLEB/Translate/resources/js/ext.translate.base.js
@@ -12,11 +12,12 @@
/**
* Checks if the input placeholder attribute
* is supported on this element in this browser.
- * @param {jQuery} element
+ *
+ * @param {jQuery} $element
* @return {boolean}
*/
- isPlaceholderSupported: function ( element ) {
- return ( 'placeholder' in element[0] );
+ isPlaceholderSupported: function ( $element ) {
+ return ( 'placeholder' in $element[ 0 ] );
},
// Storage for language stats loader functions from API,
@@ -25,53 +26,53 @@
/**
* Get language stats for a language from the API.
+ *
* @param {string} language Language code.
* @return {deferred}
*/
loadLanguageStats: function ( language ) {
- if ( !mw.translate.languageStatsLoader[language] ) {
- mw.translate.languageStatsLoader[language] = new mw.Api().get( {
+ if ( !mw.translate.languageStatsLoader[ language ] ) {
+ mw.translate.languageStatsLoader[ language ] = new mw.Api().get( {
action: 'query',
- format: 'json',
meta: 'languagestats',
lslanguage: language
} );
}
- mw.translate.languageStatsLoader[language].done( function ( result ) {
- mw.translate.languagestats[language] = result.query.languagestats;
+ mw.translate.languageStatsLoader[ language ].done( function ( result ) {
+ mw.translate.languagestats[ language ] = result.query.languagestats;
} );
- return mw.translate.languageStatsLoader[language];
+ return mw.translate.languageStatsLoader[ language ];
},
/**
* Load message group information asynchronously.
*
* @param {string} id Message group id
- * @param {string|array} [props] List of properties to load
+ * @param {string|Array} [props] List of properties to load
* @return {jQuery.Promise} Object containing the requested properties on success.
*/
getMessageGroup: function ( id, props ) {
- var params;
+ var params, api;
- if ( $.isArray( props ) ) {
+ if ( Array.isArray( props ) ) {
props = props.join( '|' );
} else if ( props === undefined ) {
props = 'id|label|description|icon|priority|prioritylangs|priorityforce|workflowstates';
}
params = {
- action: 'query',
- format: 'json',
meta: 'messagegroups',
mgformat: 'flat',
mgprop: props,
mgroot: id
};
- return (new mw.Api()).get( params ).then( function ( result ) {
- return result.query.messagegroups[0];
+ api = new mw.Api();
+
+ return api.get( params ).then( function ( result ) {
+ return result.query.messagegroups[ 0 ];
} );
},
@@ -111,6 +112,7 @@
/**
* Check if the current user is allowed to translate on this wiki.
+ *
* @return {boolean}
*/
canTranslate: function () {
@@ -119,6 +121,7 @@
/**
* Check if the current user is allowed to proofread on this wiki.
+ *
* @return {boolean}
*/
canProofread: function () {
@@ -127,26 +130,36 @@
/**
* Check if the current user can delete translations on this wiki.
+ *
* @return {boolean}
*/
canDelete: function () {
return mw.config.get( 'DeleteRight' ) && mw.config.get( 'TranslateRight' );
},
- addDocumentationLanguage: function () {
- var docLanguageCode = mw.config.get( 'wgTranslateDocumentationLanguageCode' );
- if ( $.uls.data.languages[docLanguageCode] ) {
- return;
+ /**
+ * Adds missing languages to the language database so that they can be used in ULS.
+ *
+ * @param {Object} languages Language tags mapped to language names
+ * @param {Array} regions Which regions to add the languages.
+ */
+ addExtraLanguagesToLanguageData: function ( languages, regions ) {
+ var code;
+ for ( code in languages ) {
+ if ( code in $.uls.data.languages ) {
+ continue;
+ }
+
+ $.uls.data.addLanguage( code, {
+ script: 'Zyyy',
+ regions: regions,
+ autonym: languages[ code ]
+ } );
}
- $.uls.data.addLanguage( docLanguageCode, {
- script: $.uls.data.getScript( mw.config.get( 'wgContentLanguage' ) ),
- regions: ['SP'],
- autonym: mw.msg( 'translate-documentation-language' )
- } );
},
isDirty: function () {
- return $( '.mw-ajax-dialog:visible' ).length || // For old Translate
+ return $( '.mw-ajax-dialog:visible' ).length || // For old Translate
// For new Translate, something being typed in the current editor.
mw.translate.dirty ||
// For new translate, previous editors has some unsaved edits
@@ -172,7 +185,7 @@
$( window ).on( 'pageshow.translate', pageShowHandler );
}
- $( document ).ready( function () {
+ $( function () {
translateOnBeforeUnloadRegister();
} );
}( jQuery, mediaWiki ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.dropdownmenu.js b/MLEB/Translate/resources/js/ext.translate.dropdownmenu.js
index 0b1eb02d..34db251a 100644
--- a/MLEB/Translate/resources/js/ext.translate.dropdownmenu.js
+++ b/MLEB/Translate/resources/js/ext.translate.dropdownmenu.js
@@ -1,7 +1,7 @@
( function ( $ ) {
'use strict';
- $( document ).ready( function () {
+ $( function () {
// Hide the dropdown menu when clicking outside of it
$( 'html' ).on( 'click', function ( e ) {
if ( !e.isDefaultPrevented() ) {
@@ -9,4 +9,4 @@
}
} );
} );
-} )( jQuery );
+}( jQuery ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.editor.helpers.js b/MLEB/Translate/resources/js/ext.translate.editor.helpers.js
index f3184de2..0d507a16 100644
--- a/MLEB/Translate/resources/js/ext.translate.editor.helpers.js
+++ b/MLEB/Translate/resources/js/ext.translate.editor.helpers.js
@@ -1,4 +1,4 @@
-/*
+/*!
* Translate editor additional helper functionality
*/
( function ( $, mw ) {
@@ -21,10 +21,8 @@
$messageDescViewer.addClass( 'hide' );
- $messageDescEditor
- .removeClass( 'hide' )
- .find( '.tux-textarea-documentation' )
- .focus();
+ $messageDescEditor.removeClass( 'hide' );
+ $messageDescEditor.find( '.tux-textarea-documentation' ).focus();
// So that the link won't be followed
return false;
@@ -49,16 +47,18 @@
/**
* Save the documentation
+ *
+ * @return {jQuery.Promise}
*/
saveDocumentation: function () {
var translateEditor = this,
api = new mw.Api(),
newDocumentation = translateEditor.$editor.find( '.tux-textarea-documentation' ).val();
- return api.postWithToken( 'edit', {
+ return api.postWithToken( 'csrf', {
action: 'edit',
title: translateEditor.message.title
- .replace( /\/[a-z\-]+$/, '/' + mw.config.get( 'wgTranslateDocumentationLanguageCode' ) ),
+ .replace( /\/[a-z-]+$/, '/' + mw.config.get( 'wgTranslateDocumentationLanguageCode' ) ),
text: newDocumentation
} ).done( function ( response ) {
var $messageDesc = translateEditor.$editor.find( '.infocolumn-block .message-desc' );
@@ -88,7 +88,8 @@
/**
* Shows the message documentation.
- * @param {object} documentation A documentation object as returned by API.
+ *
+ * @param {Object} documentation A documentation object as returned by API.
*/
showMessageDocumentation: function ( documentation ) {
var $descEditLink,
@@ -97,6 +98,7 @@
$messageDescViewer,
$messageDoc,
readMore,
+ langAttr,
$readMore = null;
if ( !mw.config.get( 'wgTranslateDocumentationLanguageCode' ) ) {
@@ -120,24 +122,25 @@
// lang and dir attributes.
// The message documentation is assumed to be written
// in the content language of the wiki.
+ langAttr = {
+ lang: documentation.language,
+ dir: documentationDir
+ };
+
// Possible classes:
// * mw-content-ltr
// * mw-content-rtl
// (The direction classes are needed, because the documentation
// is likely to be MediaWiki-formatted text.)
$messageDoc
- .attr( {
- lang: documentation.language,
- dir: documentationDir
- } )
+ .attr( langAttr )
.addClass( 'mw-content-' + documentationDir )
.html( documentation.html );
+ $messageDoc.find( 'a[href]' ).prop( 'target', '_blank' );
+
this.$editor.find( '.tux-textarea-documentation' )
- .attr( {
- lang: documentation.language,
- dir: documentationDir
- } )
+ .attr( langAttr )
.val( documentation.value );
$descEditLink.text( mw.msg( 'tux-editor-edit-desc' ) );
@@ -180,6 +183,7 @@
/**
* Shows uneditable documentation.
+ *
* @param {Object} documentation A gettext object as returned by API.
*/
showUneditableDocumentation: function ( documentation ) {
@@ -203,37 +207,36 @@
/**
* Shows the translations from other languages
- * @param {array} translations An inotherlanguages array as returned by the translation helpers API.
+ *
+ * @param {Array} translations An inotherlanguages array as returned by the translation helpers API.
*/
showAssistantLanguages: function ( translations ) {
- var translateEditor = this,
- $translationTextarea;
+ var translateEditor = this;
- $translationTextarea = this.$editor.find( '.tux-textarea-translation' );
+ if ( translations.error ) {
+ // Do not proceed if errored/unsupported
+ return;
+ }
$.each( translations, function ( index ) {
- var $otherLanguage,
- translationDir,
- translation = translations[index];
+ var $otherLanguage, langAttr,
+ translation = translations[ index ];
- translationDir = $.uls.data.getDir( translation.language );
+ langAttr = {
+ lang: translation.language,
+ dir: $.uls.data.getDir( translation.language )
+ };
$otherLanguage = $( '<div>' )
.addClass( 'row in-other-language' )
.append(
$( '<div>' )
.addClass( 'nine columns suggestiontext' )
- .attr( {
- lang: translation.language,
- dir: translationDir
- } )
+ .attr( langAttr )
.text( translation.value ),
$( '<div>' )
.addClass( 'three columns language text-right' )
- .attr( {
- lang: translation.language,
- dir: translationDir
- } )
+ .attr( langAttr )
.text( $.uls.data.getAutonym( translation.language ) )
);
@@ -247,10 +250,11 @@
/**
* Shows the translation suggestions from Translation Memory
- * @param {array} suggestions A ttmserver array as returned by API.
+ *
+ * @param {Array} suggestions A ttmserver array as returned by API.
*/
showTranslationMemory: function ( suggestions ) {
- var $heading, $tmSuggestions,
+ var $heading, $tmSuggestions, $messageList, translationLang, translationDir,
translateEditor = this;
if ( !suggestions.length ) {
@@ -263,6 +267,10 @@
$heading = this.$editor.find( '.tm-suggestions-title' );
$heading.after( $tmSuggestions );
+ $messageList = $( '.tux-messagelist' );
+ translationLang = $messageList.data( 'targetlangcode' );
+ translationDir = $messageList.data( 'targetlangdir' );
+
$.each( suggestions, function ( index, translation ) {
var $translation,
alreadyOnTheList = false;
@@ -300,11 +308,15 @@
.append(
$( '<div>' )
.addClass( 'nine columns suggestiontext' )
+ .attr( {
+ lang: translationLang,
+ dir: translationDir
+ } )
.text( translation.target ),
$( '<div>' )
.addClass( 'three columns quality text-right' )
.text( mw.msg( 'tux-editor-tm-match',
- Math.floor( translation.quality * 100 ) ) ),
+ mw.language.convertNumber( Math.floor( translation.quality * 100 ) ) ) ),
$( '<div>' )
.addClass( 'row text-right' )
.append(
@@ -327,10 +339,11 @@
/**
* Shows the translation from machine translation systems
- * @param {array} suggestions
+ *
+ * @param {Array} suggestions
*/
showMachineTranslations: function ( suggestions ) {
- var $mtSuggestions,
+ var $mtSuggestions, $messageList, translationLang, translationDir,
translateEditor = this;
if ( !suggestions.length ) {
@@ -347,6 +360,10 @@
.removeClass( 'hide' )
.after( $mtSuggestions );
+ $messageList = $( '.tux-messagelist' );
+ translationLang = $messageList.data( 'targetlangcode' );
+ translationDir = $messageList.data( 'targetlangdir' );
+
$.each( suggestions, function ( index, translation ) {
var $translation;
@@ -355,6 +372,10 @@
.append(
$( '<div>' )
.addClass( 'nine columns suggestiontext' )
+ .attr( {
+ lang: translationLang,
+ dir: translationDir
+ } )
.text( translation.target ),
$( '<div>' )
.addClass( 'three columns text-right service' )
@@ -369,10 +390,10 @@
/**
* Makes the $source element clickable and clicking it will replace the
- * transltion textarea with the given suggestion.
+ * translation textarea with the given suggestion.
*
* @param {jQuery} $source
- * @param {String} suggestion Text to add
+ * @param {string} suggestion Text to add
*/
suggestionAdder: function ( $source, suggestion ) {
var inserter,
@@ -397,22 +418,21 @@
/**
* Shows the support options for the translator.
- * @param {object} support A support object as returned by API.
+ *
+ * @param {Object} support A support object as returned by API.
*/
showSupportOptions: function ( support ) {
// Support URL
if ( support.url ) {
- this.$editor.find( '.help' )
- .find( 'a' )
- .attr( 'href', support.url )
- .end()
- .removeClass( 'hide' );
+ this.$editor.find( '.help a' ).attr( 'href', support.url );
+ this.$editor.find( '.help' ).removeClass( 'hide' );
}
},
/**
* Adds buttons for quickly inserting insertables.
- * @param {object} insertables A insertables object as returned by API.
+ *
+ * @param {Object} insertables A insertables object as returned by API.
*/
addInsertables: function ( insertables ) {
var i,
@@ -430,23 +450,25 @@
// on the wrong end.
$( '<button>' )
.prop( {
- dir: $sourceMessage.prop( 'dir' ),
- lang: $sourceMessage.prop( 'lang' )
+ lang: $sourceMessage.prop( 'lang' ),
+ dir: $sourceMessage.prop( 'dir' )
} )
.addClass( 'insertable shortcut-activated' )
- .text( insertables[i].display )
+ .text( insertables[ i ].display )
.data( 'iid', i )
.appendTo( $buttonArea );
}
$buttonArea.on( 'click', '.insertable', function () {
- var data = insertables[$( this ).data( 'iid' )];
+ var data = insertables[ $( this ).data( 'iid' ) ];
$textarea.textSelection( 'encapsulateSelection', {
pre: data.pre,
post: data.post
} );
$textarea.focus().trigger( 'input' );
} );
+
+ this.resizeInsertables( $textarea );
},
/**
@@ -460,8 +482,7 @@
api.get( {
action: 'translationaids',
- title: this.message.title,
- format: 'json'
+ title: this.message.title
} ).done( function ( result ) {
translateEditor.$editor.find( '.infocolumn .loading' ).remove();
@@ -503,23 +524,19 @@
/**
* Get the documentation edit URL for a title
*
- * @param {String} title Message title with namespace
- * @return {String} URL for editing the documentation
+ * @param {string} title Message title with namespace
+ * @return {string} URL for editing the documentation
*/
getDocumentationEditURL: function ( title ) {
- var descUri = new mw.Uri( window.location.href );
-
- descUri.path = mw.config.get( 'wgScript' );
- descUri.query = {
- action: 'edit',
- title: title + '/' + mw.config.get( 'wgTranslateDocumentationLanguageCode' )
- };
-
- return descUri.toString();
+ return mw.util.getUrl(
+ title + '/' + mw.config.get( 'wgTranslateDocumentationLanguageCode' ),
+ { action: 'edit' }
+ );
}
} );
// Extend the translate editor
- $.extend( $.fn.translateeditor.Constructor.prototype, translateEditorHelpers );
+ mw.translate.editor = mw.translate.editor || {};
+ $.extend( mw.translate.editor, translateEditorHelpers );
}( jQuery, mediaWiki ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.editor.js b/MLEB/Translate/resources/js/ext.translate.editor.js
index 77a2b60b..6d7e56df 100644
--- a/MLEB/Translate/resources/js/ext.translate.editor.js
+++ b/MLEB/Translate/resources/js/ext.translate.editor.js
@@ -1,4 +1,6 @@
-( function ( $, mw ) {
+/* global autosize */
+
+( function ( $, mw, autosize ) {
'use strict';
/**
@@ -16,9 +18,10 @@
* internally contain the editor's generated UI. So it is going to have the same width
* and inherited properies of the container.
* The container can mark the message item with class 'message'. This is not
- * mandatory, but if found, when editor is opened the message item will be hidden
+ * mandatory, but if found, when the editor is opened, the message item will be hidden
* and the editor will appear as if the message is replaced by the editor.
- * See the UI of Translate messagetable for demo.
+ * See the UI of Translate messagetable for a demo.
+ *
* @param {HTMLElement} element
* @param {Object} options
* @param {Function} [options.beforeSave] Callback to call when translation is going to be saved.
@@ -42,7 +45,6 @@
this.storage = this.options.storage || new mw.translate.TranslationApiStorage();
this.canDelete = mw.translate.canDelete();
this.delayValidation = delayer();
- this.delayResize = delayer();
}
TranslateEditor.prototype = {
@@ -91,6 +93,7 @@
/**
* Mark the message as unsaved because of edits, can be resumed later
+ *
* @param {string} [highlightClass] Class for background highlighting
*/
markUnsaved: function ( highlightClass ) {
@@ -113,7 +116,6 @@
this.markUnsaved( 'tux-warning' );
},
-
/**
* Mark the message as no longer unsaved
*/
@@ -157,8 +159,8 @@
);
this.$messageItem
- .addClass( 'translated' )
- .removeClass( 'untranslated' );
+ .removeClass( 'untranslated translated fuzzy proofread' )
+ .addClass( 'translated' );
this.dirty = false;
@@ -167,6 +169,8 @@
'change',
[ 'translated', this.message.properties.status ]
);
+
+ this.message.properties.status = 'translated';
// TODO: Update any other statsbar for the same group in the page.
}
},
@@ -175,11 +179,13 @@
* Save the translation
*/
save: function () {
- var translation,
+ var translation, editSummary,
translateEditor = this;
mw.translateHooks.run( 'beforeSubmit', translateEditor.$editor );
translation = translateEditor.$editor.find( '.editcolumn textarea' ).val();
+ editSummary = translateEditor.$editor.find( '.tux-input-editsummary' ).val() || '';
+
translateEditor.saving = true;
// beforeSave callback
@@ -204,15 +210,33 @@
this.storage.save(
translateEditor.message.title,
- translation
- ).done( function () {
- // Update the translation
- translateEditor.message.translation = translation;
- translateEditor.onSaveSuccess();
+ translation,
+ editSummary
+ ).done( function ( response, xhr ) {
+ var editResp = response.edit;
+ if ( editResp.result === 'Success' ) {
+ translateEditor.message.translation = translation;
+ translateEditor.onSaveSuccess();
+ // Handle errors
+ } else if ( editResp.spamblacklist ) {
+ // @todo Show exactly which blacklisted URL triggered it
+ translateEditor.onSaveFail( mw.msg( 'spamprotectiontext' ) );
+ } else if ( editResp.info &&
+ editResp.info.indexOf( 'Hit AbuseFilter:' ) === 0 &&
+ editResp.warning
+ ) {
+ translateEditor.onSaveFail( editResp.warning );
+ } else {
+ translateEditor.onSaveFail( mw.msg( 'tux-save-unknown-error' ) );
+ mw.log( response, xhr );
+ }
} ).fail( function ( errorCode, response ) {
- translateEditor.onSaveFail( response.error && response.error.info || 'Unknown error' );
+ translateEditor.onSaveFail(
+ response.error && response.error.info || mw.msg( 'tux-save-unknown-error' )
+ );
if ( errorCode === 'assertuserfailed' ) {
- window.alert( mw.msg( 'tux-session-expired' ) );
+ // eslint-disable-next-line no-alert
+ alert( mw.msg( 'tux-session-expired' ) );
}
} );
},
@@ -231,10 +255,19 @@
this.removeWarning( 'fuzzy' );
this.removeWarning( 'validation' );
+ this.$editor.find( '.tux-warning' ).empty();
+ this.$editor.find( '.tux-more-warnings' )
+ .addClass( 'hide' )
+ .empty();
+
$( '.tux-editor-clear-translated' )
.removeClass( 'hide' )
.prop( 'disabled', false );
+ this.$editor.find( '.tux-input-editsummary' )
+ .val( '' )
+ .prop( 'disabled', true );
+
// Save callback
if ( this.options.onSave ) {
this.options.onSave( this.message.translation );
@@ -250,6 +283,7 @@
/**
* Marks that there was a problem saving a translation.
+ *
* @param {string} error Strings of warnings to display.
*/
onSaveFail: function ( error ) {
@@ -278,7 +312,9 @@
// Skip if the message is hidden. For example in a filter result.
if ( $next.length && $next.hasClass( 'hide' ) ) {
this.$editTrigger = $next;
- return this.next();
+ this.next();
+
+ return;
}
// If this is the last message, just hide it
@@ -332,7 +368,20 @@
* @return {jQuery} The new message tools menu element
*/
createMessageTools: function () {
- var $historyItem, $deleteItem, $translationsItem;
+ var $editItem, $historyItem, $deleteItem, $translationsItem, $linkToThisItem;
+
+ $editItem = this.createMessageToolsItem(
+ 'message-tools-edit',
+ {
+ title: this.message.title,
+ action: 'edit'
+ },
+ 'tux-editor-message-tools-show-editor'
+ );
+
+ if ( !mw.translate.canTranslate() ) {
+ $editItem.addClass( 'hide' );
+ }
$historyItem = this.createMessageToolsItem(
'message-tools-history',
@@ -372,9 +421,19 @@
'tux-editor-message-tools-translations'
);
+ $linkToThisItem = this.createMessageToolsItem(
+ 'message-tools-linktothis',
+ {
+ title: 'Special:Translate',
+ showMessage: this.message.key,
+ group: this.message.primaryGroup
+ },
+ 'tux-editor-message-tools-linktothis'
+ );
+
return $( '<ul>' )
.addClass( 'tux-dropdown-menu tux-message-tools-menu hide' )
- .append( $historyItem, $deleteItem, $translationsItem );
+ .append( $editItem, $historyItem, $deleteItem, $translationsItem, $linkToThisItem );
},
prepareEditorColumn: function () {
@@ -391,6 +450,8 @@
$controlButtonBlock,
$editingButtonBlock,
$pasteOriginalButton,
+ $editSummary,
+ $editSummaryBlock,
$discardChangesButton = $( [] ),
$saveButton,
$requestRight,
@@ -401,7 +462,7 @@
$layoutActions,
$infoToggleIcon,
$messageList,
- targetLangAttrib, targetLangDir, targetLangCode,
+ targetLangAttrib, targetLangDir, targetLangCode, prefix,
$messageTools = translateEditor.createMessageTools(),
canTranslate = mw.translate.canTranslate();
@@ -443,7 +504,7 @@
.append( $closeIcon, $infoToggleIcon );
$editorColumn.append( $( '<div>' )
- .addClass( 'row' )
+ .addClass( 'row tux-editor-titletools' )
.append( $messageKeyLabel, $layoutActions )
);
@@ -451,7 +512,7 @@
originalTranslation = this.message.translation;
sourceString = this.message.definition;
$sourceString = $( '<span>' )
- .addClass( 'eleven column sourcemessage' )
+ .addClass( 'twelve columns sourcemessage' )
.attr( {
lang: $messageList.data( 'sourcelangcode' ),
dir: $messageList.data( 'sourcelangdir' )
@@ -482,7 +543,7 @@
$moreWarnings = $warnings.children(),
lastWarningIndex = $moreWarnings.length - 1;
- // If the warning list is not open only one warning is shown
+ // If the warning list is not open, only one warning is shown
if ( $this.hasClass( 'open' ) ) {
$moreWarnings.each( function ( index, element ) {
// The first element must always be shown
@@ -529,11 +590,6 @@
$textarea.prop( 'placeholder', mw.msg( 'tux-editor-placeholder' ) );
}
- // The extra newlines is supposed to leave enough space for the
- // insertion buttons. Seems to work as long as all the buttons
- // are only in one line.
- $textarea.autosize( {append: '\n\n\n' } );
-
// Shortcuts for various insertable things
$textarea.on( 'keyup keydown', function ( e ) {
var index, info, direction;
@@ -566,7 +622,7 @@
e.stopPropagation();
translateEditor.$editor.find( '.shortcut-activated:visible' ).eq( index ).trigger( 'click' );
// Update numbers and locations after trigger should be completed
- window.setTimeout( function() { translateEditor.showShortcuts(); }, 100 );
+ window.setTimeout( function () { translateEditor.showShortcuts(); }, 100 );
}
if ( e.which === 18 && e.type === 'keyup' ) {
@@ -598,10 +654,11 @@
mw.translate.dirty = true;
}
- $saveButton.text( mw.msg( 'tux-editor-save-button-label' ) );
+ translateEditor.makeSaveButtonJustSave( $saveButton );
+
// When there is content in the editor enable the button.
// But do not enable when some saving is not finished yet.
- if ( $.trim( current ) && !translateEditor.saving ) {
+ if ( current.trim() && !translateEditor.saving ) {
$pasteSourceButton.addClass( 'hide' );
$saveButton.prop( 'disabled', false );
} else {
@@ -609,6 +666,8 @@
$pasteSourceButton.removeClass( 'hide' );
}
+ translateEditor.resizeInsertables( $textarea );
+
translateEditor.delayValidation( function () {
translateEditor.validateTranslation();
}, 500 );
@@ -621,7 +680,7 @@
$editAreaBlock = $( '<div>' )
.addClass( 'row tux-editor-editarea-block' )
.append( $( '<div>' )
- .addClass( 'editarea eleven columns' )
+ .addClass( 'editarea twelve columns' )
.append( $warningsBlock, $textarea )
);
@@ -640,6 +699,36 @@
$pasteOriginalButton.addClass( 'hide' );
} );
+ $editSummary = $( '<input>' )
+ .addClass( 'tux-input-editsummary' )
+ .attr( {
+ maxlength: 255,
+ disabled: true,
+ placeholder: mw.msg( 'tux-editor-editsummary-placeholder' )
+ } )
+ .val( '' );
+
+ // Enable edit summary if there was a change to translation area
+ // or disable if there is no text in translation area
+ $textarea.on( 'textchange', function () {
+ if ( $editSummary.prop( 'disabled' ) ) {
+ $editSummary.prop( 'disabled', false );
+ }
+ if ( $textarea.val().trim() === '' ) {
+ $editSummary.prop( 'disabled', true );
+ }
+ } ).on( 'keydown', function ( e ) {
+ if ( !e.ctrlKey || e.keyCode !== 13 ) {
+ return;
+ }
+
+ if ( !$saveButton.is( ':disabled' ) ) {
+ $saveButton.click();
+ return;
+ }
+ $skipButton.click();
+ } );
+
if ( originalTranslation !== null ) {
$discardChangesButton = $( '<button>' )
.addClass( 'tux-editor-discard-changes-button hide' ) // Initially hidden
@@ -653,10 +742,14 @@
// and go back to hiding.
$discardChangesButton.addClass( 'hide' );
- // There's nothing new to save
+ // There's nothing new to save...
+ $editSummary.val( '' ).prop( 'disabled', true );
$saveButton.prop( 'disabled', true );
+ // ...unless there is other action
+ translateEditor.makeSaveButtonContextSensitive( $saveButton );
translateEditor.markUnunsaved();
+ translateEditor.resizeInsertables( $textarea );
} );
}
@@ -665,48 +758,55 @@
}
$editingButtonBlock = $( '<div>' )
- .addClass( 'ten columns tux-editor-insert-buttons' )
+ .addClass( 'twelve columns tux-editor-insert-buttons' )
.append(
$pasteOriginalButton,
$discardChangesButton
);
+ $editSummaryBlock = $( '<div>' )
+ .addClass( 'row tux-editor-editsummary-block' )
+ .append(
+ $( '<div>' )
+ .addClass( 'twelve columns' )
+ .append( $editSummary )
+ );
+
$requestRight = $( [] );
$saveButton = $( '<button>' )
.prop( 'disabled', true )
- .addClass( 'blue button tux-editor-save-button' )
+ .addClass( 'tux-editor-save-button mw-ui-button mw-ui-progressive' )
.text( mw.msg( 'tux-editor-save-button-label' ) )
.on( 'click', function ( e ) {
translateEditor.save();
e.stopPropagation();
} );
- // When the user opens an outdated translation, the main button should be enabled
- // and display a "confirm translation" label.
- if ( this.$messageItem.hasClass( 'fuzzy' ) ) {
- $saveButton
- .prop( 'disabled', false )
- .text( mw.msg( 'tux-editor-confirm-button-label' ) );
- }
+ this.makeSaveButtonContextSensitive( $saveButton, this.$messageItem );
} else {
$editingButtonBlock = $( [] );
+ $editSummaryBlock = $( [] );
+
$requestRight = $( '<span>' )
.addClass( 'tux-editor-request-right' )
- .text( mw.msg( 'translate-edit-nopermission' ) )
- .append( $( '<a>' )
- .text( mw.msg( 'translate-edit-askpermission' ) )
- .addClass( 'tux-editor-ask-permission' )
- .attr( {
- href: mw.util.getUrl(
- mw.config.get( 'wgTranslateUseSandbox' )
- ? 'Special:TranslationStash'
- : mw.config.get( 'wgTranslatePermissionUrl' )
- )
- } )
- );
-
+ .text( mw.msg( 'translate-edit-nopermission' ) );
+ // Make sure wgTranslatePermissionUrl setting is not 'false'
+ if ( mw.config.get( 'wgTranslatePermissionUrl' ) !== false ) {
+ $requestRight
+ .append( $( '<a>' )
+ .text( mw.msg( 'translate-edit-askpermission' ) )
+ .addClass( 'tux-editor-ask-permission' )
+ .attr( {
+ href: mw.util.getUrl(
+ mw.config.get( 'wgTranslateUseSandbox' ) ?
+ 'Special:TranslationStash' :
+ mw.config.get( 'wgTranslatePermissionUrl' )
+ )
+ } )
+ );
+ }
// Disable the text area if user has no translation rights.
// Use readonly to allow copy-pasting (except for placeholders)
$textarea.prop( 'readonly', true );
@@ -715,7 +815,7 @@
}
$skipButton = $( '<button>' )
- .addClass( 'button tux-editor-skip-button' )
+ .addClass( 'tux-editor-skip-button mw-ui-button mw-ui-quiet' )
.text( mw.msg( 'tux-editor-skip-button-label' ) )
.on( 'click', function ( e ) {
translateEditor.skip();
@@ -730,7 +830,7 @@
// This appears instead of "Skip" on the last message on the page
$cancelButton = $( '<button>' )
- .addClass( 'button tux-editor-cancel-button' )
+ .addClass( 'tux-editor-cancel-button mw-ui-button mw-ui-quiet' )
.text( mw.msg( 'tux-editor-cancel-button-label' ) )
.on( 'click', function ( e ) {
translateEditor.skip();
@@ -745,17 +845,27 @@
$editorColumn.append( $( '<div>' )
.addClass( 'row tux-editor-actions-block' )
- .append( $editingButtonBlock, $controlButtonBlock )
+ .append( $editingButtonBlock )
+ );
+
+ $editorColumn.append( $editSummaryBlock );
+
+ $editorColumn.append( $( '<div>' )
+ .addClass( 'row tux-editor-actions-block' )
+ .append( $controlButtonBlock )
);
if ( canTranslate ) {
+ prefix = $.fn.updateTooltipAccessKeys.getAccessKeyPrefix();
$editorColumn.append( $( '<div>' )
.addClass( 'row shortcutinfo' )
- .text( mw.msg( 'tux-editor-shortcut-info',
- ( mw.util.tooltipAccessKeyPrefix + 's' ).toUpperCase(),
- ( mw.util.tooltipAccessKeyPrefix + 'd' ).toUpperCase(),
- 'ALT' )
- )
+ .text( mw.msg(
+ 'tux-editor-shortcut-info',
+ 'CTRL-ENTER',
+ ( prefix + 'd' ).toUpperCase(),
+ 'ALT',
+ ( prefix + 'b' ).toUpperCase()
+ ) )
);
}
@@ -763,27 +873,70 @@
},
/**
+ * Modifies the save button to provide suitable default action for *unchanged*
+ * message. It will revert back to normal save button if the text is changed.
+ *
+ * @param {jQuery} $button The save button.
+ */
+ makeSaveButtonContextSensitive: function ( $button ) {
+ var self = this;
+
+ if ( this.message.properties.status === 'fuzzy' ) {
+ $button.prop( 'disabled', false );
+ $button.text( mw.msg( 'tux-editor-confirm-button-label' ) );
+ $button.off( 'click' );
+ $button.on( 'click', function ( e ) {
+ self.save();
+ e.stopPropagation();
+ } );
+ } else if ( this.message.proofreadable ) {
+ $button.prop( 'disabled', false );
+ $button.text( mw.msg( 'tux-editor-proofread-button-label' ) );
+ $button.off( 'click' );
+ $button.on( 'click', function ( e ) {
+ $button.prop( 'disabled', true );
+ self.message.proofreadAction();
+ self.next();
+ e.stopPropagation();
+ } );
+ }
+ },
+
+ /**
+ * Modifies the save button to just save the translation as usual. Whether the
+ * button is enabled or not is controlled elsewhere.
+ *
+ * @param {jQuery} $button The save button.
+ */
+ makeSaveButtonJustSave: function ( $button ) {
+ var self = this;
+
+ $button.text( mw.msg( 'tux-editor-save-button-label' ) );
+ $button.off( 'click' );
+ $button.on( 'click', function ( e ) {
+ self.save();
+ e.stopPropagation();
+ } );
+ },
+
+ /**
* Validate the current translation using the API
* and show the warnings if necessary.
*/
validateTranslation: function () {
var translateEditor = this,
- url = new mw.Uri( mw.config.get( 'wgScript' ) ),
+ api,
$textarea = translateEditor.$editor.find( '.tux-textarea-translation' );
- // TODO: We need a better API for this
- url.extend( {
- title: 'Special:Translate/editpage',
- suggestions: 'checks',
- page: translateEditor.message.title,
- loadgroup: translateEditor.message.group
- } );
+ api = new mw.Api();
- $.post( url.toString(), {
+ api.post( {
+ action: 'translationcheck',
+ title: this.message.title,
translation: $textarea.val()
- }, function ( data ) {
+ } ).done( function ( data ) {
var warningIndex,
- warnings = JSON.parse( data );
+ warnings = data.warnings;
translateEditor.removeWarning( 'validation' );
if ( !warnings || !warnings.length ) {
@@ -802,14 +955,15 @@
}
for ( warningIndex = 0; warningIndex < warnings.length; warningIndex++ ) {
- translateEditor.addWarning( warnings[warningIndex], 'validation' );
+ translateEditor.addWarning( warnings[ warningIndex ], 'validation' );
}
} );
},
/**
* Remove all warning of given type
- * @param type
+ *
+ * @param {string} type
*/
removeWarning: function ( type ) {
var $tuxWarning = this.$editor.find( '.tux-warning' );
@@ -821,10 +975,13 @@
},
/**
- * Displays the supplied warning from the bottom up near the translation edit area.
+ * Displays the supplied warning above the translation edit area.
+ * Newer warnings are added to the top while older warnings are
+ * added to the bottom. This also means that older warnings will
+ * not be shown by default unless the user clicks "more warnings" tab.
*
- * @param {String} warning used as html for the warning display
- * @param {String} type used to group the warnings.eg: validation, diff, error
+ * @param {string} warning used as html for the warning display
+ * @param {string} type used to group the warnings.eg: validation, diff, error
* @return {jQuery} the new warning element
*/
addWarning: function ( warning, type ) {
@@ -832,21 +989,21 @@
$warnings = this.$editor.find( '.tux-warning' ),
$moreWarningsTab = this.$editor.find( '.tux-more-warnings' ),
$newWarning = $( '<div>' )
- .addClass( 'tux-warning-message hide ' + type )
+ .addClass( 'tux-warning-message ' + type )
.html( warning );
+ this.$editor.find( '.tux-warning-message' ).addClass( 'hide' );
+
$warnings
.removeClass( 'hide' )
- .append( $newWarning );
+ .prepend( $newWarning );
warningCount = $warnings.find( '.tux-warning-message' ).length;
- $warnings.find( '.tux-warning-message:first' ).removeClass( 'hide' );
-
if ( warningCount > 1 ) {
$moreWarningsTab
.text( mw.msg( 'tux-warnings-more', warningCount - 1 ) )
- .removeClass( 'hide' );
+ .removeClass( 'hide open' );
} else {
$moreWarningsTab.addClass( 'hide' );
}
@@ -868,7 +1025,7 @@
if ( mw.config.get( 'wgTranslateDocumentationLanguageCode' ) ) {
$messageDescSaveButton = $( '<button>' )
- .addClass( 'blue button tux-editor-savedoc-button' )
+ .addClass( 'tux-editor-savedoc-button mw-ui-button mw-ui-progressive' )
.prop( 'disabled', true )
.text( mw.msg( 'tux-editor-doc-editor-save' ) )
.on( 'click', function () {
@@ -880,7 +1037,7 @@
} );
$messageDescCancelButton = $( '<button>' )
- .addClass( 'button tux-editor-skipdoc-button' )
+ .addClass( 'tux-editor-skipdoc-button mw-ui-button mw-ui-quiet' )
.text( mw.msg( 'tux-editor-doc-editor-cancel' ) )
.on( 'click', function () {
translateEditor.hideDocumentationEditor();
@@ -918,12 +1075,12 @@
.append( $( '<a>' )
.attr( {
href: mw.translate.getDocumentationEditURL(
- this.message.title.replace( /\/[a-z\-]+$/, '' )
+ this.message.title.replace( /\/[a-z-]+$/, '' )
),
target: '_blank'
} )
.addClass( 'message-desc-edit' )
- .on( 'click', $.proxy( this.showDocumentationEditor, this ) )
+ .on( 'click', this.showDocumentationEditor.bind( this ) )
)
);
@@ -969,7 +1126,7 @@
return $( '<div>' )
.addClass( 'five columns infocolumn-block' )
.append(
- $( '<span>' ).addClass( 'caret' ),
+ $( '<span>' ).addClass( 'tux-message-editor__caret' ),
$infoColumn
);
},
@@ -991,19 +1148,15 @@
$( '.tux-editor-save-button, .tux-editor-save-button' ).removeAttr( 'accesskey' );
this.$editor.find( '.tux-editor-save-button' ).attr( 'accesskey', 's' );
this.$editor.find( '.tux-editor-skip-button' ).attr( 'accesskey', 'd' );
+ this.$editor.find( '.tux-input-editsummary' ).attr( 'accesskey', 'b' );
// @todo access key for the cancel button
this.$messageItem.addClass( 'hide' );
this.$editor.removeClass( 'hide' );
$textarea.focus();
- // Apparently there is still something going on that affects the
- // layout of the text area after this function. Use very small
- // delay to have it settle down and have correct results. Otherwise
- // there will be a size change once the first letter is typed.
- this.delayResize( function() {
- $textarea.trigger( 'autosize.resizeIncludeStyle' );
- }, 1 );
+ autosize( $textarea );
+ this.resizeInsertables( $textarea );
this.shown = true;
this.$editTrigger.addClass( 'open' );
@@ -1015,6 +1168,8 @@
$next.data( 'translateeditor' ).init();
}
+ mw.translateHooks.run( 'afterEditorShown', this.$editor );
+
return false;
},
@@ -1056,12 +1211,7 @@
.addClass( 'editor-expand' )
.attr( 'title', mw.msg( 'tux-editor-expand-tooltip' ) );
- this.$editor.find( '.infocolumn-block' )
- .removeClass( 'hide' );
- this.$editor.find( '.editcolumn' )
- .removeClass( 'twelve' )
- .addClass( 'seven' );
-
+ this.$editor.removeClass( 'tux-message-editor--expanded' );
this.expanded = false;
},
@@ -1072,18 +1222,14 @@
.addClass( 'editor-contract' )
.attr( 'title', mw.msg( 'tux-editor-collapse-tooltip' ) );
- this.$editor.find( '.infocolumn-block' )
- .addClass( 'hide' );
- this.$editor.find( '.editcolumn' )
- .removeClass( 'seven' )
- .addClass( 'twelve' );
-
+ this.$editor.addClass( 'tux-message-editor--expanded' );
this.expanded = true;
},
/**
* Adds the diff between old and current definitions to the view.
- * @param {object} definitiondiff A definitiondiff object as returned by API.
+ *
+ * @param {Object} definitiondiff A definitiondiff object as returned by API.
*/
addDefinitionDiff: function ( definitiondiff ) {
var $trigger;
@@ -1094,7 +1240,7 @@
}
// Load the diff styles
- mw.loader.load( 'mediawiki.action.history.diff', undefined, true );
+ mw.loader.load( 'mediawiki.diff.styles' );
$trigger = $( '<span>' )
.addClass( 'show-diff-link' )
@@ -1121,6 +1267,21 @@
return false;
} );
+ },
+
+ /**
+ * Makes the textare large enough for insertables and positions the insertables.
+ *
+ * @param {jQuery} $textarea Text area.
+ */
+ resizeInsertables: function ( $textarea ) {
+ var $buttonArea, buttonAreaHeight;
+
+ $buttonArea = this.$editor.find( '.tux-editor-insert-buttons' );
+ buttonAreaHeight = $buttonArea.height();
+ $textarea.css( 'padding-bottom', buttonAreaHeight + 5 );
+ $buttonArea.css( 'top', -buttonAreaHeight );
+ autosize.update( $textarea );
}
};
@@ -1140,21 +1301,22 @@
}
if ( typeof options === 'string' ) {
- data[options].call( $this );
+ data[ options ].call( $this );
}
} );
};
- $.fn.translateeditor.Constructor = TranslateEditor;
+ mw.translate.editor = mw.translate.editor || {};
+ mw.translate.editor = $.extend( TranslateEditor.prototype, mw.translate.editor );
function delayer() {
- return (function () {
+ return ( function () {
var timer = 0;
return function ( callback, milliseconds ) {
clearTimeout( timer );
timer = setTimeout( callback, milliseconds );
};
- } () );
+ }() );
}
-}( jQuery, mediaWiki ) );
+}( jQuery, mediaWiki, autosize ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.editor.shortcuts.js b/MLEB/Translate/resources/js/ext.translate.editor.shortcuts.js
index e68b6e3a..bb1a49b8 100644
--- a/MLEB/Translate/resources/js/ext.translate.editor.shortcuts.js
+++ b/MLEB/Translate/resources/js/ext.translate.editor.shortcuts.js
@@ -1,7 +1,7 @@
-/*
+/*!
* Translate editor shortcuts
*/
-( function ( $ ) {
+( function ( $, mw ) {
'use strict';
var translateEditorShortcuts = {
@@ -18,7 +18,7 @@
maxLeft = editorOffset.left;
if ( !rtl ) {
- maxLeft += this.$editor.outerWidth();
+ maxLeft += this.$editor.outerWidth();
}
this.hideShortcuts();
@@ -26,15 +26,15 @@
// For scrolling up and down
$( '<div>' )
.text( '↑' )
- .offset( { top: middle - 10, left: maxLeft } )
.addClass( 'shortcut-popup' )
- .appendTo( 'body' );
+ .appendTo( 'body' )
+ .offset( { top: middle - 10, left: maxLeft - 10 } );
$( '<div>' )
.text( '↓' )
- .offset( { top: middle + 10, left: maxLeft } )
.addClass( 'shortcut-popup' )
- .appendTo( 'body' );
+ .appendTo( 'body' )
+ .offset( { top: middle + 10, left: maxLeft - 10 } );
this.$editor.find( '.shortcut-activated:visible' ).each( function ( index ) {
var $this = $( this ),
@@ -51,9 +51,9 @@
$( '<div>' )
.text( index + 1 )
- .offset( offset )
.addClass( 'shortcut-popup' )
- .appendTo( 'body' );
+ .appendTo( 'body' )
+ .offset( { top: offset.top - 10, left: offset.left - 10 } );
} );
},
@@ -62,7 +62,7 @@
}
};
- // Extend the translate editor
- $.extend( $.fn.translateeditor.Constructor.prototype, translateEditorShortcuts );
+ mw.translate.editor = mw.translate.editor || {};
+ $.extend( mw.translate.editor, translateEditorShortcuts );
}( jQuery, mediaWiki ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.groupselector.js b/MLEB/Translate/resources/js/ext.translate.groupselector.js
index a10ee582..1bfd27b2 100644
--- a/MLEB/Translate/resources/js/ext.translate.groupselector.js
+++ b/MLEB/Translate/resources/js/ext.translate.groupselector.js
@@ -1,14 +1,25 @@
( function ( $, mw ) {
'use strict';
- var groupsLoader, recentGroupsLoader, delay;
+ var groupsLoader, delay;
/**
* options
* - position: accepts same values as jquery.ui.position
- * - onSelect: callback with message group id when selected
- * - language: language for statistics.
+ * - onSelect:
+ * - language:
+ * - preventSelector: boolean to load but not show the group selector.
+ * - recent: list of recent group ids
* groups: list of message group ids
+ *
+ * @param {Element} element
+ * @param {Object} options
+ * @param {Object} [options.position] Accepts same values as jquery.ui.position.
+ * @param {Function} [options.onSelect] Callback with message group id when selected.
+ * @param {string} options.language Language code for statistics.
+ * @param {boolean} [options.preventSelector] Whether not to show the group selector.
+ * @param {string[]} [options.recent] List of recent message group ids.
+ * @param {string[]} [groups] List of message group ids to show.
*/
function TranslateMessageGroupSelector( element, options, groups ) {
this.$trigger = $( element );
@@ -24,6 +35,7 @@
this.customOptions = options;
this.flatGroupList = null;
this.groups = groups;
+ this.firstShow = true;
this.init();
}
@@ -44,8 +56,7 @@
* Prepare the selector menu rendering
*/
prepareSelectorMenu: function () {
- var $groupTitle,
- $listFilters,
+ var $listFilters,
$listFiltersGroup,
$search,
$searchIcon,
@@ -55,15 +66,6 @@
.addClass( 'tux-groupselector' )
.addClass( 'grid' );
- $groupTitle = $( '<div>' )
- .addClass( 'row' )
- .append(
- $( '<h3>' )
- .addClass( 'tux-groupselector__title' )
- .addClass( 'ten columns' )
- .text( mw.msg( 'translate-msggroupselector-projects' ) )
- );
-
$searchIcon = $( '<div>' )
.addClass( 'two columns tux-groupselector__filter__search__icon' );
@@ -85,11 +87,16 @@
.append(
$( '<div>' )
.addClass( 'tux-grouptab tux-grouptab--all tux-grouptab--selected' )
- .text( mw.msg( 'translate-msggroupselector-search-all' ) ),
+ .text( mw.msg( 'translate-msggroupselector-search-all' ) )
+ );
+
+ if ( this.options.recent && this.options.recent.length ) {
+ $listFilters.append(
$( '<div>' )
.addClass( 'tux-grouptab tux-grouptab--recent' )
.text( mw.msg( 'translate-msggroupselector-search-recent' ) )
);
+ }
$searchGroup = $( '<div>' )
.addClass( 'tux-groupselector__filter__search' )
@@ -108,7 +115,7 @@
this.$loader = $( '<div>' )
.addClass( 'tux-loading-indicator tux-loading-indicator--centered' );
- this.$menu.append( $groupTitle, $listFiltersGroup, this.$loader, this.$list );
+ this.$menu.append( $listFiltersGroup, this.$loader, this.$list );
$( 'body' ).append( this.$menu );
},
@@ -117,25 +124,29 @@
* Show the selector
*/
show: function () {
- // Hide all other open menus
- $( '.tux-groupselector.open' )
- .removeClass( 'open' )
- .hide();
this.$menu.addClass( 'open' ).show();
this.position();
// Place the focus in the message group search box.
this.$search.focus();
// Start loading the groups, but assess the situation again after
// they are loaded, in case user has made further interactions.
- this.loadGroups().done( $.proxy( this.showList, this ) );
- // Hide the selector panel when clicking outside of it
- $( 'html' ).one( 'click', $.proxy( this.hide, this ) );
+ if ( this.firstShow ) {
+ this.loadGroups().done( this.showList.bind( this ) );
+ this.firstShow = false;
+ }
},
/**
* Hide the selector
+ *
+ * @param {jQuery.Event} e
*/
- hide: function () {
+ hide: function ( e ) {
+ // Do not hide if the trigger is clicked
+ if ( e && ( this.$trigger.is( e.target ) || this.$trigger.has( e.target ).length ) ) {
+ return;
+ }
+
this.$menu.hide().removeClass( 'open' );
},
@@ -157,11 +168,11 @@
var $tabs,
groupSelector = this;
- groupSelector.$trigger.on( 'click', function ( e ) {
- groupSelector.toggle();
+ // Hide the selector panel when clicking outside of it
+ $( 'html' ).on( 'click', this.hide.bind( this ) );
- e.preventDefault();
- e.stopPropagation();
+ groupSelector.$trigger.on( 'click', function () {
+ groupSelector.toggle();
} );
groupSelector.$menu.on( 'click', function ( e ) {
@@ -177,28 +188,26 @@
groupSelector.hide();
- groupSelector.$trigger
- .removeClass( 'tail' )
- .nextAll().remove();
-
- groupSelector.$trigger.addClass( 'expanded' );
- // FIXME In future, if we are going to have multiple groupselectors per page
- // this will fail.
- $( '.tux-breadcrumb .tail' ).remove();
-
- $newLink = $( '<span>' )
- .addClass( 'grouptitle grouplink tail' )
- .text( messageGroup.label );
- $( '.tux-breadcrumb .grouplink:last' ).after( $newLink );
- $newLink.data( 'msggroupid', messageGroup.id );
-
- if ( messageGroup.groups && messageGroup.groups.length > 0 ) {
- // Pass options for callbacks, language etc. but ignore the position
- // option unless explicitly given to allow automatic recalculation
- // of the position compared to the new trigger.
- $newLink.msggroupselector( groupSelector.customOptions );
- // Show the new menu immediately
- $newLink.data( 'msggroupselector' ).show();
+ groupSelector.$trigger.nextAll().remove();
+
+ if ( !groupSelector.options.preventSelector ) {
+ $newLink = $( '<span>' )
+ .addClass( 'grouptitle grouplink' )
+ .text( messageGroup.label )
+ .data( 'msggroupid', messageGroup.id );
+
+ groupSelector.$trigger.after( $newLink );
+
+ if ( messageGroup.groups && messageGroup.groups.length > 0 ) {
+ // Show the new menu immediately.
+ // Pass options for callbacks, language etc. but ignore the position
+ // option unless explicitly given to allow automatic recalculation
+ // of the position compared to the new trigger.
+ $newLink
+ .addClass( 'tux-breadcrumb__item--aggregate' )
+ .msggroupselector( groupSelector.customOptions )
+ .data( 'msggroupselector' ).show();
+ }
}
if ( groupSelector.options.onSelect ) {
@@ -226,12 +235,12 @@
groupSelector.showList();
} );
- this.$search.on( 'click', $.proxy( this.show, this ) )
- .on( 'keypress', $.proxy( this.keyup, this ) )
- .on( 'keyup', $.proxy( this.keyup, this ) );
+ this.$search.on( 'click', this.show.bind( this ) )
+ .on( 'keypress', this.keyup.bind( this ) )
+ .on( 'keyup', this.keyup.bind( this ) );
if ( this.eventSupported( 'keydown' ) ) {
- this.$search.on( 'keydown', $.proxy( this.keyup, this ) );
+ this.$search.on( 'keydown', this.keyup.bind( this ) );
}
},
@@ -239,7 +248,7 @@
* Handle the keypress/keyup events in the message group search box.
*/
keyup: function () {
- delay( $.proxy( this.showList, this ), 300 );
+ delay( this.showList.bind( this ), 300 );
},
/**
@@ -256,7 +265,7 @@
* Shows suitable list for current view, taking possible filter into account
*/
showList: function () {
- var query = $.trim( this.$search.val() ).toLowerCase();
+ var query = this.$search.val().trim().toLowerCase();
if ( query ) {
this.filter( query );
@@ -293,7 +302,7 @@
this.$loader.show();
- this.loadGroups().done( function( groups ) {
+ this.loadGroups().done( function ( groups ) {
var groupsToShow = mw.translate.findGroup( groupSelector.parentGroupId, groups );
// We do not want to display the group itself, only its subgroups
@@ -311,13 +320,15 @@
* Show recent message groups.
*/
showRecentGroups: function () {
- $.when( this.loadRecentGroups(), this.loadGroups() )
- .done( $.proxy( this.showSelectedGroups, this ) );
+ var recent = this.options.recent || [];
+
+ this.showSelectedGroups( recent );
},
/**
* Load message groups.
- * @param {Array} groups: List of the message group ids to show.
+ *
+ * @param {Array} groups List of the message group ids to show.
*/
showSelectedGroups: function ( groups ) {
var groupSelector = this;
@@ -333,17 +344,18 @@
} );
return rows;
} )
- .always( function() {
+ .always( function () {
groupSelector.$loader.hide();
groupSelector.$list.empty();
} )
- .done( function( rows ) {
+ .done( function ( rows ) {
groupSelector.$list.append( rows );
} );
},
/**
* Flattens a message group tree.
+ *
* @param {Array} messageGroups An array or data object.
* @param {Object} foundIDs The array in which the keys are IDs of message groups that were found already.
*/
@@ -356,14 +368,14 @@
for ( i = 0; i < messageGroups.length; i++ ) {
// Avoid duplicate groups, and add the parent before subgroups
- if ( !foundIDs[messageGroups[i].id] ) {
- this.flatGroupList.push( messageGroups[i] );
- foundIDs[messageGroups[i].id] = true;
+ if ( !foundIDs[ messageGroups[ i ].id ] ) {
+ this.flatGroupList.push( messageGroups[ i ] );
+ foundIDs[ messageGroups[ i ].id ] = true;
}
// In case there are subgroups, add them recursively
- if ( messageGroups[i].groups ) {
- this.flattenGroupList( messageGroups[i].groups, foundIDs );
+ if ( messageGroups[ i ].groups ) {
+ this.flattenGroupList( messageGroups[ i ].groups, foundIDs );
}
}
},
@@ -371,12 +383,13 @@
/**
* Search the message groups based on label or id.
* Label match is prefix match, while id match is exact match.
+ *
* @param {string} query
*/
filter: function ( query ) {
var self = this;
- this.loadGroups().done( function( groups ) {
+ this.loadGroups().done( function ( groups ) {
var currentGroup, index, matcher, foundGroups = [];
if ( !self.flatGroupList ) {
@@ -393,9 +406,9 @@
matcher = new RegExp( '\\b' + escapeRegex( query ), 'i' );
for ( index = 0; index < self.flatGroupList.length; index++ ) {
- if ( matcher.test( self.flatGroupList[index].label ) ||
- query === self.flatGroupList[index].id ) {
- foundGroups.push( self.flatGroupList[index] );
+ if ( matcher.test( self.flatGroupList[ index ].label ) ||
+ query === self.flatGroupList[ index ].id ) {
+ foundGroups.push( self.flatGroupList[ index ] );
}
}
@@ -411,13 +424,14 @@
* @return {jQuery.Promise}
*/
loadGroups: function () {
+ var params;
+
if ( groupsLoader !== undefined ) {
return groupsLoader;
}
- var params = {
+ params = {
action: 'query',
- format: 'json',
meta: 'messagegroups',
mgformat: 'tree',
mgprop: 'id|label|icon|priority|prioritylangs|priorityforce',
@@ -426,7 +440,7 @@
groupsLoader = new mw.Api()
.get( params )
- .then( function( result ) {
+ .then( function ( result ) {
return result.query.messagegroups;
} )
.promise();
@@ -435,31 +449,6 @@
},
/**
- * Returns list of recently used message groups by the user.
- *
- * @return {jQuery.Promise}
- */
- loadRecentGroups: function () {
- if ( recentGroupsLoader !== undefined ) {
- return recentGroupsLoader;
- }
-
- var params = {
- action: 'translateuser',
- format: 'json'
- };
-
- recentGroupsLoader = new mw.Api()
- .get( params )
- .then( function( result ) {
- return result.translateuser.recentgroups;
- } )
- .promise();
-
- return recentGroupsLoader;
- },
-
- /**
* Add rows with message groups to the selector.
*
* @param {Array} groups Array of message group objects to add.
@@ -482,7 +471,7 @@
if ( group.priority === 'discouraged' ||
( group.priorityforce &&
group.prioritylangs &&
- $.inArray( targetLanguage, group.prioritylangs ) === -1 )
+ group.prioritylangs.indexOf( targetLanguage ) === -1 )
) {
return;
}
@@ -505,10 +494,11 @@
/**
* Prepare a message group row in the selector.
+ *
* @param {Object} messagegroup object.
- * @returns {Object} a jQuery object with the groups selector row (<div>).
+ * @return {Object} a jQuery object with the groups selector row (<div>).
*/
- prepareMessageGroupRow: function( messagegroup ) {
+ prepareMessageGroupRow: function ( messagegroup ) {
var $row,
$icon,
$label,
@@ -535,7 +525,8 @@
.addClass( 'seven columns' )
.append(
$( '<span>' )
- .prop( { dir: 'auto' } )
+ // T130390: must be attr for IE/Edge.
+ .attr( { dir: 'auto' } )
.text( messagegroup.label ),
$statsbar
);
@@ -546,9 +537,7 @@
}
if ( messagegroup.icon && messagegroup.icon.vector ) {
- style +=
- 'background-image: -webkit-linear-gradient(transparent, transparent), url(--);' +
- 'background-image: linear-gradient(transparent, transparent), url(--);';
+ style += 'background-image: linear-gradient(transparent, transparent), url(--);';
style = style.replace( /--/g, messagegroup.icon.vector );
}
@@ -572,8 +561,8 @@
/**
* Check that a DOM event is supported by the $menu jQuery object.
*
- * @param eventName
- * @returns {boolean}
+ * @param {string} eventName
+ * @return {boolean}
*/
eventSupported: function ( eventName ) {
var $search = this.$menu.find( '.tux-groupselector__filter__search__input' ),
@@ -581,7 +570,7 @@
if ( !isSupported ) {
this.$element.setAttribute( eventName, 'return;' );
- isSupported = typeof this.$element[eventName] === 'function';
+ isSupported = typeof this.$element[ eventName ] === 'function';
}
return isSupported;
@@ -604,7 +593,7 @@
}
if ( typeof options === 'string' ) {
- data[options].call( $this );
+ data[ options ].call( $this );
}
} );
};
@@ -622,13 +611,15 @@
/*
* Private functions
*/
+
/**
* Escape the search query for regex match
+ *
* @param {string} value A search string to be escaped.
- * @returns {string} Escaped string that is safe to use for a search.
+ * @return {string} Escaped string that is safe to use for a search.
*/
function escapeRegex( value ) {
- return value.replace( /[\-\[\]{}()*+?.,\\\^$\|#\s]/g, '\\$&' );
+ return value.replace( /[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&' );
}
delay = ( function () {
@@ -638,5 +629,5 @@
clearTimeout( timer );
timer = setTimeout( callback, milliseconds );
};
- } () );
+ }() );
}( jQuery, mediaWiki ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.hooks.js b/MLEB/Translate/resources/js/ext.translate.hooks.js
index 1155aa9c..855e735c 100644
--- a/MLEB/Translate/resources/js/ext.translate.hooks.js
+++ b/MLEB/Translate/resources/js/ext.translate.hooks.js
@@ -1,9 +1,9 @@
-/**
+/*!
* JavaScript hook framework for Translate (since MediaWiki code doesn't
* yet have one. See hooks.txt in Translate directory for how to use hooks.
*
* @author Harry Burt
- * @license GPL-2.0+
+ * @license GPL-2.0-or-later
* @since 2012-08-22
*/
@@ -14,10 +14,10 @@
mw.translateHooks = {
add: function ( name, func ) {
- if ( !registry[name] ) {
- registry[name] = [];
+ if ( !registry[ name ] ) {
+ registry[ name ] = [];
}
- registry[name].push( func );
+ registry[ name ].push( func );
},
run: function ( /* infinite list of parameters */ ) {
@@ -26,11 +26,11 @@
args = Array.prototype.slice.call( arguments );
name = args.shift();
- if ( registry[name] ) {
- length = registry[name].length;
+ if ( registry[ name ] ) {
+ length = registry[ name ].length;
for ( i = 0; i < length; i++ ) {
- registry[name][i].apply( null, args );
+ registry[ name ][ i ].apply( null, args );
}
}
}
diff --git a/MLEB/Translate/resources/js/ext.translate.messagetable.js b/MLEB/Translate/resources/js/ext.translate.messagetable.js
index 335a5644..09b3824d 100644
--- a/MLEB/Translate/resources/js/ext.translate.messagetable.js
+++ b/MLEB/Translate/resources/js/ext.translate.messagetable.js
@@ -1,18 +1,7 @@
( function ( $, mw ) {
'use strict';
- var delay, itemsClass;
-
- delay = ( function () {
- var timer = 0;
-
- return function ( callback, milliseconds ) {
- clearTimeout( timer );
- timer = setTimeout( callback, milliseconds );
- };
- } () );
-
- itemsClass = {
+ var itemsClass = {
proofread: '.tux-message-proofread',
page: '.tux-message-pagemode',
translate: '.tux-message'
@@ -27,62 +16,22 @@
action: 'query',
list: 'messagecollection',
mcgroup: messageGroup,
- format: 'json',
mclanguage: language,
mcoffset: offset,
mclimit: limit,
mcfilter: filter,
mcprop: 'definition|translation|tags|properties',
- rawcontinue: 1
+ rawcontinue: 1,
+ errorformat: 'html'
} );
- },
-
- loadMessages: function ( changes ) {
- // FIXME: this should be member method
- var $container = $( '.tux-messagelist' ),
- $loader = $( '.tux-messagetable-loader' ),
- $statsbar = $( '.tux-message-list-statsbar' );
-
- changes = changes || {};
-
- // Clear current messages
- $container.trigger( 'clear' );
-
- // Change the properties that are provided
- if ( changes.filter !== undefined ) {
- $loader.data( 'filter', changes.filter );
- }
- if ( changes.group !== undefined ) {
- $loader.data( 'messagegroup', changes.group );
- }
-
- // Reset the number of messages remaining
- $loader.find( '.tux-messagetable-loader-count' ).text( '' );
-
- // Reset the statsbar
- $statsbar
- .empty()
- .removeData()
- .languagestatsbar( {
- language: $container.data( 'targetlangcode' ),
- group: $loader.data( 'messagegroup' )
- } );
-
- // Reset other info and make visible
- $loader
- .removeData( 'offset' )
- .removeAttr( 'data-offset' )
- .removeClass( 'hide' );
-
- // And start loading
- $loader.trigger( 'appear' );
}
} );
- function MessageTable( container, options ) {
+ function MessageTable( container, options, settings ) {
this.$container = $( container );
this.options = options;
this.options = $.extend( {}, $.fn.messagetable.defaults, options );
+ this.settings = settings;
// mode can be proofread, page or translate
this.mode = this.options.mode;
this.firstProofreadTipShown = false;
@@ -90,7 +39,11 @@
this.$header = this.$container.siblings( '.tux-messagetable-header' );
// Container is between these in the dom.
this.$loader = this.$container.siblings( '.tux-messagetable-loader' );
+ this.$loaderIcon = this.$loader.find( '.tux-loading-indicator' );
+ this.$loaderInfo = this.$loader.find( '.tux-messagetable-loader-info' );
this.$actionBar = this.$container.siblings( '.tux-action-bar' );
+ this.$statsBar = this.$actionBar.find( '.tux-message-list-statsbar' );
+ this.$proofreadOwnTranslations = this.$actionBar.find( '.tux-proofread-own-translations-button' );
this.messages = [];
this.loading = false;
this.init();
@@ -99,8 +52,7 @@
MessageTable.prototype = {
init: function () {
- this.switchMode( this.mode );
- this.initialized = true;
+ this.$actionBar.removeClass( 'hide' );
},
listen: function () {
@@ -108,32 +60,24 @@
$filterInput = this.$container.parent().find( '.tux-message-filter-box' );
// Vector has transitions of 250ms which affect layout. Let those finish.
- $( window ).on( 'scroll resize', function () {
- delay( function () {
- messageTable.scroll();
- }, 250 );
- } ).resize( function () {
+ $( window ).on( 'scroll', $.debounce( 250, function () {
+ messageTable.scroll();
+
+ if ( isLoaderVisible( messageTable.$loader ) ) {
+ messageTable.load();
+ }
+ } ) ).on( 'resize', $.throttle( 250, function () {
messageTable.resize();
- } );
+ messageTable.scroll();
+ } ) );
if ( mw.translate.isPlaceholderSupported( $filterInput ) ) {
$filterInput.prop( 'placeholder', mw.msg( 'tux-message-filter-placeholder' ) );
}
- $filterInput.on( 'textchange', function () {
- delay( function () {
- messageTable.search( $filterInput.val() );
- }, 300 );
- } );
-
- this.$container.on( 'clear', $.proxy( messageTable.clear, messageTable ) );
-
- this.$loader.appear( function () {
- messageTable.load();
- }, {
- // Appear callback need to be called more than once.
- one: false
- } );
+ $filterInput.on( 'textchange', $.debounce( 250, function () {
+ messageTable.search( $filterInput.val() );
+ } ) );
this.$actionBar.find( 'button.proofread-mode-button' ).on( 'click', function () {
messageTable.switchMode( 'proofread' );
@@ -146,6 +90,20 @@
this.$actionBar.find( 'button.page-mode-button' ).on( 'click', function () {
messageTable.switchMode( 'page' );
} );
+
+ this.$proofreadOwnTranslations.click( function () {
+ var $this = $( this ),
+ hideMessage = mw.msg( 'tux-editor-proofreading-hide-own-translations' ),
+ showMessage = mw.msg( 'tux-editor-proofreading-show-own-translations' );
+
+ if ( $this.hasClass( 'down' ) ) {
+ messageTable.setHideOwnInProofreading( false );
+ $this.removeClass( 'down' ).text( hideMessage );
+ } else {
+ messageTable.setHideOwnInProofreading( true );
+ $this.addClass( 'down' ).text( showMessage );
+ }
+ } );
},
/**
@@ -153,12 +111,17 @@
*/
clear: function () {
this.$container.empty();
- $( '.translate-tipsy' ).remove();
+ $( '.translate-tooltip' ).remove();
this.messages = [];
// Any ongoing loading process will notice this and will reject results.
this.loading = false;
},
+ /**
+ * Adds a new message using current mode.
+ *
+ * @param {Object} message
+ */
add: function ( message ) {
// Prepare the message for display
mw.translateHooks.run( 'formatMessageBeforeTable', message );
@@ -174,6 +137,8 @@
/**
* Add a message to the message table for translation.
+ *
+ * @param {Object} message
*/
addTranslate: function ( message ) {
var $message,
@@ -187,7 +152,7 @@
statusMsg = '';
if ( message.tags.length &&
- $.inArray( 'optional', message.tags ) >= 0 &&
+ message.tags.indexOf( 'optional' ) >= 0 &&
status === 'untranslated'
) {
status = 'optional';
@@ -241,7 +206,7 @@
dir: targetLangDir
} )
.text( message.translation || '' )
- ),
+ ),
$( '<div>' )
.addClass( 'two columns tux-list-status text-center' )
.append(
@@ -255,8 +220,7 @@
$( '<a>' )
.attr( {
title: mw.msg( 'translate-edit-title', message.key ),
- href: ( new mw.Uri( mw.util.getUrl( message.title ) ) )
- .extend( { action: 'edit' } )
+ href: mw.util.getUrl( message.title, { action: 'edit' } )
} )
.text( mw.msg( 'tux-edit' ) )
)
@@ -273,9 +237,11 @@
/**
* Add a message to the message table for proofreading.
+ *
+ * @param {Object} message
*/
addProofread: function ( message ) {
- var icon, $message;
+ var $message, $icon;
$message = $( '<div>' ).addClass( 'row tux-message-proofread' );
@@ -286,30 +252,53 @@
targetlangcode: this.$container.data( 'targetlangcode' )
} );
- // Add autotipsy to first available proofread action icon
- if ( this.firstProofreadTipShown ) {
+ $icon = $message.find( '.tux-proofread-action' );
+ if ( $icon.length === 0 ) {
return;
}
- icon = $message.find( '.tux-proofread-action' );
- if ( icon.length === 0 ) {
+ // Add autotooltip to first available proofread action icon
+ if ( this.firstProofreadTipShown ) {
return;
}
-
this.firstProofreadTipShown = true;
- icon.addClass( 'autotipsy' );
-
- // Selectors are not cached in case the element no longer exists
- setTimeout( function () {
- var icon = $( '.autotipsy' );
- if ( icon.length ) { icon.tipsy( 'show' ); }
- }, 1000 );
- setTimeout( function () {
- var icon = $( '.autotipsy' );
- if ( icon.length ) { icon.tipsy( 'hide' ); }
- }, 4000 );
+ $icon.addClass( 'autotooltip' );
+
+ mw.loader.using( 'oojs-ui-core' ).done( function () {
+ var tooltip = new OO.ui.PopupWidget( {
+ padded: true,
+ align: 'center',
+ width: 250,
+ classes: [ 'translate-tooltip' ],
+ $content: $( '<p>' ).text( $icon.prop( 'title' ) )
+ } );
+
+ setTimeout( function () {
+ var offset, $icon = $( '.autotooltip:visible' );
+ if ( !$icon.length ) {
+ return;
+ }
+
+ offset = $icon.offset();
+ tooltip.$element.appendTo( 'body' );
+ tooltip.toggle( true ).toggleClipping( false ).togglePositioning( false );
+ tooltip.$element.css( {
+ top: offset.top + $icon.outerHeight() + 5,
+ left: offset.left + $icon.outerWidth() - tooltip.$element.width() / 2 - 15
+ } );
+
+ setTimeout( function () {
+ tooltip.$element.remove();
+ }, 4000 );
+ }, 1000 );
+ } );
},
+ /**
+ * Add a message to the message table for wiki page mode.
+ *
+ * @param {Object} message
+ */
addPageModeMessage: function ( message ) {
var $message;
@@ -327,7 +316,7 @@
/**
* Search the message filter
*
- * @param {String} query
+ * @param {string} query
*/
search: function ( query ) {
var $note, $button, $result,
@@ -351,17 +340,14 @@
$result = this.$container.find( '.tux-message-filter-result' );
if ( !$result.length ) {
$note = $( '<div>' )
- .addClass( 'nine columns advanced-search' );
+ .addClass( 'advanced-search' );
- $button = $( '<div>' )
- .addClass( 'three columns' )
- .append( $( '<button>' )
- .addClass( 'button' )
- .text( mw.msg( 'tux-message-filter-advanced-button' ) )
- );
+ $button = $( '<button>' )
+ .addClass( 'mw-ui-button' )
+ .text( mw.msg( 'tux-message-filter-advanced-button' ) );
$result = $( '<div>' )
- .addClass( 'row highlight tux-message-filter-result' )
+ .addClass( 'tux-message-filter-result' )
.append( $note, $button );
this.$container.prepend( $result );
@@ -374,12 +360,10 @@
.find( '.advanced-search' )
.text( mw.msg( 'tux-message-filter-result', resultCount, query ) );
$result.find( 'button' ).on( 'click', function () {
- window.location.href = new mw.Uri( mw.util.getUrl( 'Special:SearchTranslations' ) )
- .extend( { query: query } );
+ window.location.href = mw.util.getUrl( 'Special:SearchTranslations', { query: query } );
} );
}
- this.$loader.trigger( 'appear' );
this.updateLastMessage();
// Trigger a scroll event for the window to make sure all floating toolbars
@@ -406,100 +390,161 @@
}
},
- load: function () {
+ /**
+ * Start loading messages again with new settings.
+ *
+ * @param {Object} changes
+ */
+ changeSettings: function ( changes ) {
+ // Clear current messages
+ this.clear();
+ this.settings = $.extend( this.settings, changes );
+
+ if ( this.initialized === false ) {
+ this.switchMode( this.mode );
+ }
+
+ // Reset the number of messages remaining
+ this.$loaderInfo.text(
+ mw.msg( 'tux-messagetable-loading-messages', this.$loader.data( 'pagesize' ) )
+ );
+
+ // Reset the statsbar
+ this.$statsBar
+ .empty()
+ .removeData()
+ .languagestatsbar( {
+ language: this.settings.language,
+ group: this.settings.group
+ } );
+
+ this.initialized = true;
+ // Reset other info and make visible
+ this.$loader
+ .removeData( 'offset' )
+ .removeAttr( 'data-offset' )
+ .removeClass( 'hide' );
+
+ if ( changes.offset ) {
+ this.$loader.data( 'offset', changes.offset );
+ }
+
+ this.$header.removeClass( 'hide' );
+ this.$actionBar.removeClass( 'hide' );
+
+ // Start loading messages
+ this.load( changes.limit );
+ },
+
+ /**
+ * @param {number} [limit] Only load this many messages and then stop even if there is more.
+ */
+ load: function ( limit ) {
var remaining,
query,
- messageTable = this,
- $messageList = $( '.tux-messagelist' ),
+ self = this,
offset = this.$loader.data( 'offset' ),
- filter = messageTable.$loader.data( 'filter' ),
- targetLangCode = $messageList.data( 'targetlangcode' ),
- messagegroup = messageTable.$loader.data( 'messagegroup' ),
- pageSize = messageTable.$loader.data( 'pagesize' );
+ pageSize = limit || this.$loader.data( 'pagesize' );
if ( offset === -1 ) {
return;
}
- if ( messageTable.loading ) {
+ if ( this.loading ) {
// Avoid duplicate loading - the offset will be wrong and it will result
// in duplicate messages shown in the page
return;
}
- messageTable.loading = true;
-
- mw.translate.getMessages( messagegroup, targetLangCode, offset, pageSize, filter )
- .done( function ( result ) {
- var messages = result.query.messagecollection,
- state;
+ this.loading = true;
+ this.$loaderIcon.removeClass( 'tux-loading-indicator--stopped' );
+
+ mw.translate.getMessages(
+ this.settings.group,
+ this.settings.language,
+ offset,
+ pageSize,
+ this.settings.filter
+ ).done( function ( result ) {
+ var messages = result.query.messagecollection,
+ state;
+
+ if ( !self.loading ) {
+ // reject. This was cancelled.
+ return;
+ }
- if ( !messageTable.loading ) {
- // reject. This was cancelled.
- return;
+ if ( messages.length === 0 ) {
+ // And this is the first load for the filter...
+ if ( self.$container.children().length === 0 ) {
+ self.displayEmptyListHelp();
}
+ }
- messageTable.loading = false;
+ $.each( messages, function ( index, message ) {
+ message.group = self.settings.group;
+ self.add( message );
+ self.messages.push( message );
- if ( messages.length === 0 ) {
- // And this is the first load for the filter...
- if ( messageTable.$container.children().length === 0 ) {
- messageTable.displayEmptyListHelp();
- }
+ if ( index === 0 && self.mode === 'translate' ) {
+ $( '.tux-message:first' ).data( 'translateeditor' ).init();
}
+ } );
- $.each( messages, function ( index, message ) {
- message.group = messagegroup;
- messageTable.add( message );
- messageTable.messages.push( message );
-
- if ( index === 0 && messageTable.mode === 'translate' ) {
- $( '.tux-message:first' ).data( 'translateeditor' ).init();
- }
- } );
+ state = result.query.metadata && result.query.metadata.state;
+ $( '.tux-workflow' ).workflowselector(
+ self.settings.group,
+ self.settings.language,
+ state
+ );
- state = result.query.metadata && result.query.metadata.state;
- $( '.tux-workflow' ).workflowselector( messagegroup, targetLangCode, state );
+ // Dynamically loaded messages should pass the search filter if present.
+ query = $( '.tux-message-filter-box' ).val();
- // Dynamically loaded messages should pass the search filter if present.
- query = $( '.tux-message-filter-box' ).val();
+ if ( query ) {
+ self.search( query );
+ }
- if ( query ) {
- messageTable.search( query );
- }
+ if ( result[ 'query-continue' ] === undefined || limit ) {
+ // End of messages
+ self.$loader.data( 'offset', -1 )
+ .addClass( 'hide' );
- if ( result['query-continue'] === undefined ) {
- // End of messages
- messageTable.$loader.data( 'offset', -1 )
- .addClass( 'hide' );
- } else {
- messageTable.$loader.data( 'offset', result['query-continue'].messagecollection.mcoffset );
+ // Helpfully open the first message in show mode
+ // TODO: Refactor to avoid direct DOM access
+ $( '.tux-message-item' ).first().click();
+ } else {
+ self.$loader.data( 'offset', result[ 'query-continue' ].messagecollection.mcoffset );
- remaining = result.query.metadata.remaining;
+ remaining = result.query.metadata.remaining;
- $( '.tux-messagetable-loader-count' ).text(
- mw.msg( 'tux-messagetable-more-messages', remaining )
- );
+ self.$loaderInfo.text(
+ mw.msg( 'tux-messagetable-more-messages', remaining )
+ );
- $( '.tux-messagetable-loader-more' ).text(
- mw.msg( 'tux-messagetable-loading-messages', Math.min( remaining, pageSize ) )
- );
+ // Make sure the floating toolbars are visible without the need for scroll
+ $( window ).trigger( 'scroll' );
+ }
- // Make sure the floating toolbars are visible without the need for scroll
- $( window ).trigger( 'scroll' );
- }
+ self.updateHideOwnInProofreadingToggleVisibility();
+ self.updateLastMessage();
+ } ).fail( function ( errorCode, response ) {
+ var $warningContainer = $( '.tux-editor-header .group-warning' );
- messageTable.updateLastMessage();
- } )
- .fail( function ( errorCode, response ) {
- if ( response.error && response.error.code === 'mctranslate-language-disabled' ) {
- $( '.tux-editor-header .group-warning' )
- .text( mw.msg( 'translate-language-disabled' ) )
- .show();
- }
- messageTable.$loader.data( 'offset', -1 ).addClass( 'hide' );
- messageTable.loading = false;
- } );
+ if ( response.errors ) {
+ $.map( response.errors, function ( error ) {
+ $warningContainer.append( error[ '*' ] );
+ } );
+ } else {
+ $warningContainer.text( mw.msg( 'api-error-unknownerror', errorCode ) );
+ }
+ self.$loader.data( 'offset', -1 ).addClass( 'hide' );
+ self.$actionBar.addClass( 'hide' );
+ self.$header.addClass( 'hide' );
+ } ).always( function () {
+ self.$loaderIcon.addClass( 'tux-loading-indicator--stopped' );
+ self.loading = false;
+ } );
},
updateLastMessage: function () {
@@ -518,18 +563,40 @@
/**
* Creates a uniformly styled button for different actions,
* shown when there are no messages to display.
- * @param {String} labelMsg A message key for the button label.
+ *
+ * @param {string} labelMsg A message key for the button label.
* @param {Function} callback A callback for clicking the button.
- * @returns {jQuery} A button element.
+ * @return {jQuery} A button element.
*/
otherActionButton: function ( labelMsg, callback ) {
return $( '<button>' )
- .addClass( 'green button' )
+ .addClass( 'mw-ui-button mw-ui-progressive mw-ui-big' )
.text( mw.msg( labelMsg ) )
.on( 'click', callback );
},
/**
+ * Enables own message hiding in proofread mode.
+ *
+ * @param {boolean} enabled
+ */
+ setHideOwnInProofreading: function ( enabled ) {
+ if ( enabled ) {
+ this.$container.addClass( 'tux-hide-own' );
+ } else {
+ this.$container.removeClass( 'tux-hide-own' );
+ }
+ },
+
+ updateHideOwnInProofreadingToggleVisibility: function () {
+ if ( this.$container.find( '.tux-message-proofread.own-translation' ).length ) {
+ this.$proofreadOwnTranslations.removeClass( 'hide' );
+ } else {
+ this.$proofreadOwnTranslations.addClass( 'hide' );
+ }
+ },
+
+ /**
* If the user selection doesn't show anything,
* give some pointers to other things to do.
*/
@@ -632,14 +699,13 @@
*/
switchMode: function ( mode ) {
var messageTable = this,
- filter = messageTable.$loader.data( 'filter' ),
+ filter = this.settings.filter,
userId = mw.config.get( 'wgUserId' ),
$tuxTabUntranslated,
$tuxTabUnproofread,
- $controlOwnButton,
$hideTranslatedButton;
- messageTable.$actionBar.find( '.down' ).removeClass( 'down' );
+ messageTable.$actionBar.find( '.tux-view-switcher .down' ).removeClass( 'down' );
if ( mode === 'translate' ) {
messageTable.$actionBar.find( '.translate-mode-button' ).addClass( 'down' );
}
@@ -657,11 +723,10 @@
// Emulate clear without clearing loaded messages
messageTable.$container.empty();
- $( '.translate-tipsy' ).remove();
+ $( '.translate-tooltip' ).remove();
$tuxTabUntranslated = $( '.tux-message-selector > .tux-tab-untranslated' );
$tuxTabUnproofread = $( '.tux-message-selector > .tux-tab-unproofread' );
- $controlOwnButton = messageTable.$actionBar.find( '.tux-proofread-own-translations-button' );
$hideTranslatedButton = messageTable.$actionBar.find( '.tux-editor-clear-translated' );
if ( messageTable.mode === 'proofread' ) {
@@ -676,16 +741,15 @@
mw.translate.changeFilter( 'translated|!reviewer:' + userId +
'|!last-translator:' + userId );
$tuxTabUnproofread.addClass( 'selected' );
+ // Own translations are not present in proofread + unreviewed mode
}
- $controlOwnButton.removeClass( 'hide' );
$hideTranslatedButton.addClass( 'hide' );
} else {
$tuxTabUntranslated.removeClass( 'hide' );
$tuxTabUnproofread.addClass( 'hide' );
- $controlOwnButton.addClass( 'hide' );
- if ( messageTable.$loader.data( 'filter' ).indexOf( '!translated' ) > -1 ) {
+ if ( filter.indexOf( '!translated' ) > -1 ) {
$hideTranslatedButton.removeClass( 'hide' );
}
@@ -705,6 +769,11 @@
messageTable.displayEmptyListHelp();
}
+ this.$loaderInfo.text(
+ mw.msg( 'tux-messagetable-loading-messages', this.$loader.data( 'pagesize' ) )
+ );
+
+ messageTable.updateHideOwnInProofreadingToggleVisibility();
messageTable.updateLastMessage();
},
@@ -773,7 +842,7 @@
}
if ( typeof options === 'string' ) {
- data[options].call( $this );
+ data[ options ].call( $this );
}
} );
};
@@ -784,47 +853,27 @@
mode: new mw.Uri().query.action || 'translate'
};
- $( 'document' ).ready( function () {
- // Currently used only in the pre-TUX editor
- $( '.mw-translate-messagereviewbutton' ).click( function () {
- var $b, successFunction, failFunction, params;
- $b = $( this );
-
- successFunction = function ( data ) {
- if ( data.error ) {
- // Give grep a chance to find the usages:
- // api-error-invalidrevision, api-error-unknownmessage,
- // api-error-fuzzymessage, api-error-owntranslation
- var reason = mw.msg( 'api-error-' + data.error.code );
- $b.val( mw.msg( 'translate-messagereview-failure', reason ) );
- } else {
- $b.val( mw.msg( 'translate-messagereview-done' ) );
- }
- };
-
- failFunction = function ( jqXHR ) {
- $b.val( mw.msg( 'translate-messagereview-failure', jqXHR.statusText ) );
- };
-
- params = {
- action: 'translationreview',
- token: $b.data( 'token' ),
- revision: $b.data( 'revision' ),
- format: 'json'
- };
- $b.val( mw.msg( 'translate-messagereview-progress' ) );
- $b.prop( 'disabled', true );
-
- $.post( mw.util.wikiScript( 'api' ), params, successFunction ).fail( failFunction );
- } );
- } );
-
/**
- * Escape the search query for regex match
+ * Escape the search query for regex match.
+ *
* @param {string} value A search string to be escaped.
- * @returns {string} Escaped string that is safe to use for a search.
+ * @return {string} Escaped string that is safe to use for a search.
*/
function escapeRegex( value ) {
- return value.replace( /[\-\[\]{}()*+?.,\\\^$\|#\s]/g, '\\$&' );
+ return value.replace( /[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&' );
+ }
+
+ function isLoaderVisible( $loader ) {
+ var viewportBottom, elementTop,
+ $window = $( window );
+
+ viewportBottom = ( window.innerHeight ? window.innerHeight : $window.height() ) +
+ $window.scrollTop();
+
+ elementTop = $loader.offset().top;
+
+ // Start already if user is reaching close to the bottom
+ return elementTop - viewportBottom < 200;
}
+
}( jQuery, mediaWiki ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.multiselectautocomplete.js b/MLEB/Translate/resources/js/ext.translate.multiselectautocomplete.js
index b83c866a..f77de7f9 100644
--- a/MLEB/Translate/resources/js/ext.translate.multiselectautocomplete.js
+++ b/MLEB/Translate/resources/js/ext.translate.multiselectautocomplete.js
@@ -1,14 +1,16 @@
-/*
+/*!
* @author Santhosh Thottingal
* jQuery autocomplete based multiple selector for input box.
* Autocompleted values will be available in input filed as comma separated values.
* The values for autocompletion is from the language selector in this case.
* The input field is created in PHP code.
- * Credits: http://jqueryui.com/demos/autocomplete/#multiple
+ * Credits: https://jqueryui.com/autocomplete/#multiple
*/
jQuery( function ( $ ) {
'use strict';
+ /* eslint-disable no-underscore-dangle */
+
$.widget( 'ui.multiselectautocomplete', {
options: {
inputbox: null // a jQuery selector for the input box where selections are written.
@@ -35,18 +37,22 @@ jQuery( function ( $ ) {
matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), 'i' );
response( select.children( 'option' ).map( function () {
- var text = $( this ).text(),
+ var text = $( this ).html(),
value = $( this ).val(),
term = split( request.term ).pop();
if ( this.value && ( !request.term || matcher.test( text ) ) ) {
- return {
- label: text.replace(
+ if ( term.trim() !== '' ) {
+ text = text.replace(
new RegExp(
'(?![^&;]+;)(?!<[^<>]*)(' +
$.ui.autocomplete.escapeRegex( term ) +
')(?![^<>]*>)(?![^&;]+;)', 'gi'
- ), '<strong>$1</strong>' ),
+ ), '<strong>$1</strong>' );
+ }
+
+ return {
+ label: text,
value: value,
option: this
};
@@ -54,11 +60,13 @@ jQuery( function ( $ ) {
} ) );
},
select: function ( event, ui ) {
+ var terms;
+
ui.item.option.selected = true;
self._trigger( 'selected', event, {
item: ui.item.option
} );
- var terms = split( $( this ).val() );
+ terms = split( $( this ).val() );
// remove the current input
terms.pop();
// add the selected item
diff --git a/MLEB/Translate/resources/js/ext.translate.navitoggle.js b/MLEB/Translate/resources/js/ext.translate.navitoggle.js
index 6f134560..0cf448ae 100644
--- a/MLEB/Translate/resources/js/ext.translate.navitoggle.js
+++ b/MLEB/Translate/resources/js/ext.translate.navitoggle.js
@@ -1,23 +1,19 @@
-/**
+/*!
* Introduces a toggle icon than can be used to hide navigation menu in vector
* @author Niklas Laxström
- * @license GPL-2.0+
+ * @license GPL-2.0-or-later
*/
-(function ( mw, $ ) {
+( function ( mw, $ ) {
'use strict';
- var delay = ( function () {
- var timer = 0;
+ var $body = $( 'body' );
- return function ( callback, milliseconds ) {
- clearTimeout( timer );
- timer = setTimeout( callback, milliseconds );
- };
- } () );
+ if ( $body.width() < 1000 || mw.storage.get( 'translate-navitoggle' ) === '1' ) {
+ $body.addClass( 'tux-navi-collapsed' );
+ }
- $( document ).ready( function () {
- var $miniLogo, $toggle, rtl, delim,
- $body = $( 'body' );
+ $( function () {
+ var $miniLogo, $toggle, rtl, delim;
rtl = $body.hasClass( 'rtl' );
delim = rtl ?
@@ -31,17 +27,15 @@
$toggle = $( '<div>' )
.addClass( 'tux-navitoggle' )
- .css( rtl ? 'right' : 'left' , delim )
+ .css( rtl ? 'right' : 'left', delim )
.click( function () {
$body.toggleClass( 'tux-navi-collapsed' );
- // Allow for animations etc to go
- delay( function () {
- $( window ).trigger( 'resize' );
- $( window ).trigger( 'scroll' );
- }, 250 );
+ mw.storage.set(
+ 'translate-navitoggle',
+ String( Number( $body.hasClass( 'tux-navi-collapsed' ) ) )
+ );
} );
- $( 'body' ).append( $miniLogo, $toggle );
-
+ $body.append( $miniLogo, $toggle );
} );
}( mediaWiki, jQuery ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.pagemode.js b/MLEB/Translate/resources/js/ext.translate.pagemode.js
index a091fc10..84f9799c 100644
--- a/MLEB/Translate/resources/js/ext.translate.pagemode.js
+++ b/MLEB/Translate/resources/js/ext.translate.pagemode.js
@@ -14,6 +14,12 @@
* sourcelangcode: 'en', // Mandatory source language code
* targetlangcode: 'hi' // Mandatory target language code
* } );
+ *
+ * @param {Element} element
+ * @param {Object} options
+ * @param {Object} options.message
+ * @param {string} options.sourcelangcode Language code.
+ * @param {string} options.targetlangcode Language code.
*/
function PageMode( element, options ) {
this.$message = $( element );
@@ -44,6 +50,10 @@
pagemode.$message.find( '.tux-pagemode-translation' )
.removeClass( 'highlight' );
pagemode.message.translation = translation;
+
+ pagemode.$message.find( '.tux-pagemode-status' )
+ .removeClass( 'translated fuzzy proofread untranslated' )
+ .addClass( pagemode.message.properties.status );
}
} );
@@ -65,7 +75,7 @@
this.$message.append(
$( '<div>' )
- .addClass( 'row tux-message-item-compact message' )
+ .addClass( 'row tux-message-item-compact message ' + this.message.properties.status )
.append(
$( '<div>' )
.addClass( 'one column tux-pagemode-status ' + this.message.properties.status ),
@@ -87,9 +97,7 @@
.attr( 'title', mw.msg( 'translate-edit-title', this.message.key ) )
.addClass( 'tux-pagemode-edit' )
)
- )
-
- .addClass( this.message.properties.status );
+ ).addClass( this.message.properties.status );
},
/**
diff --git a/MLEB/Translate/resources/js/ext.translate.pagetranslation.uls.js b/MLEB/Translate/resources/js/ext.translate.pagetranslation.uls.js
index 42504e70..993e6497 100644
--- a/MLEB/Translate/resources/js/ext.translate.pagetranslation.uls.js
+++ b/MLEB/Translate/resources/js/ext.translate.pagetranslation.uls.js
@@ -2,20 +2,14 @@
'use strict';
mw.uls.changeLanguage = function ( language ) {
- var page, uri;
+ var page;
page = 'Special:MyLanguage/' + mw.config.get( 'wgPageName' );
if ( mw.config.get( 'wgTranslatePageTranslation' ) === 'translation' ) {
- page = page.replace( /\/[^\/]+$/, '' );
+ page = page.replace( /\/[^/]+$/, '' );
}
- uri = new mw.Uri( mw.util.getUrl( page ) );
-
- uri.extend( {
- setlang: language
- } );
-
- location.href = uri.toString();
+ location.href = mw.util.getUrl( page, { setlang: language } );
};
-} ( mediaWiki ) );
+}( mediaWiki ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.parsers.js b/MLEB/Translate/resources/js/ext.translate.parsers.js
index 171e547e..2b135741 100644
--- a/MLEB/Translate/resources/js/ext.translate.parsers.js
+++ b/MLEB/Translate/resources/js/ext.translate.parsers.js
@@ -1,9 +1,9 @@
-/*
+/*!
* A set of simple tools for partial parsing and formatting of translatable
* messages.
*
- * @author Niklas Laxström, 2013
- * @license GPL-2.0+
+ * @author Niklas Laxström
+ * @license GPL-2.0-or-later
*/
( function ( $, mw ) {
@@ -12,10 +12,11 @@
mw.translate = mw.translate || {};
mw.translate = $.extend( mw.translate, {
/**
- * Formats some common wikitext elements
- * @param {String} text Message text
- * @param {String} [key] Message key
- * @return {String} Formatted text in html
+ * Formats some common wikitext elements.
+ *
+ * @param {string} text Message text
+ * @param {string} [key] Message key
+ * @return {string} Formatted text in html
*/
formatMessageGently: function ( text, key ) {
var externals,
@@ -58,7 +59,7 @@
return $( '<div>' ).append( link ).html();
} );
- externals = new RegExp( '\\[((' + protocols + ')[^ ]+) (.+?)\\]', 'g');
+ externals = new RegExp( '\\[((' + protocols + ')[^ ]+) (.+?)\\]', 'g' );
text = text.replace( externals, function ( match, p1, p2, p3 ) {
var link = $( '<a>' ).html( p3 ).prop( 'href', p1 );
return $( '<div>' ).append( link ).html();
@@ -77,4 +78,4 @@
}
} );
-} ( jQuery, mediaWiki ) );
+}( jQuery, mediaWiki ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.proofread.js b/MLEB/Translate/resources/js/ext.translate.proofread.js
index cac69e6d..9c5f00fc 100644
--- a/MLEB/Translate/resources/js/ext.translate.proofread.js
+++ b/MLEB/Translate/resources/js/ext.translate.proofread.js
@@ -1,4 +1,3 @@
-/*global alert: false*/
( function ( $, mw ) {
'use strict';
@@ -15,6 +14,12 @@
* sourcelangcode: 'en', // Mandatory source language code
* targetlangcode: 'hi' // Mandatory target language code
* } );
+ *
+ * @param {Element} element
+ * @param {Object} options
+ * @param {Object} options.message
+ * @param {string} options.sourcelangcode Language code.
+ * @param {string} options.targetlangcode Language code.
*/
function Proofread( element, options ) {
this.$message = $( element );
@@ -33,6 +38,7 @@
var proofread = this;
this.render();
+
// No review before translating.
if ( !this.message.translation ) {
this.disableProofread();
@@ -54,12 +60,10 @@
.text( translation );
proofread.message.translation = translation;
proofread.markSelfTranslation();
- // Update stats - to translated state from current state.
- $( '.tux-action-bar .tux-statsbar' )
- .trigger(
- 'change',
- [ 'translated', proofread.message.properties.status ]
- );
+
+ proofread.$message.find( '.tux-proofread-status' )
+ .removeClass( 'translated fuzzy proofread untranslated' )
+ .addClass( proofread.message.properties.status );
}
} );
@@ -72,15 +76,17 @@
translatedBySelf, proofreadBySelf;
// List of all reviewers
- reviewers = $( this.message.properties.reviewers );
+ reviewers = this.message.properties.reviewers || [];
// The id of the current user, converted to string as the are in reviewers
- userId = mw.config.get( 'wgUserId' ) + '';
+ userId = String( mw.config.get( 'wgUserId' ) );
// List of all reviewers excluding the current user.
- otherReviewers = reviewers.not( [userId] );
+ otherReviewers = reviewers.filter( function ( element ) {
+ return element !== userId;
+ } );
/* Whether the current user if the last translator of this message.
* Accepting own translations is prohibited. */
- translatedBySelf = ( this.message.properties['last-translator-text'] === mw.user.getName() );
- proofreadBySelf = $.inArray( userId, reviewers ) > -1;
+ translatedBySelf = ( this.message.properties[ 'last-translator-text' ] === mw.user.getName() );
+ proofreadBySelf = reviewers.indexOf( userId ) > -1;
sourceLangCode = this.options.sourcelangcode;
sourceLangDir = $.uls.data.getDir( sourceLangCode );
@@ -91,8 +97,7 @@
.attr( 'title', mw.msg( 'tux-proofread-action-tooltip' ) )
.addClass(
'tux-proofread-action ' + this.message.properties.status + ' ' + ( proofreadBySelf ? 'accepted' : '' )
- )
- .tipsy( { gravity: 's', delayIn: 1000, className: 'translate-tipsy' } );
+ );
$proofreadEdit = $( '<div>' )
.addClass( 'tux-proofread-edit' )
@@ -147,8 +152,13 @@
$proofreadEdit
)
)
- )
- .addClass( this.message.properties.status );
+ ).addClass( this.message.properties.status );
+
+ if ( !translatedBySelf && !proofreadBySelf ) {
+ // This will get removed later if any of various other reasons prevent it
+ this.message.proofreadable = true;
+ this.message.proofreadAction = this.proofread.bind( this );
+ }
if ( translatedBySelf ) {
this.markSelfTranslation();
@@ -162,6 +172,7 @@
},
disableProofread: function () {
+ this.message.proofreadable = false;
this.$message.find( '.tux-proofread-action' )
.remove();
},
@@ -178,7 +189,6 @@
.append( $( '<div>' )
.addClass( 'translated-by-self' )
.attr( 'title', mw.msg( 'tux-proofread-translated-by-self' ) )
- .tipsy( { gravity: 'e', className: 'translate-tipsy' } )
);
}
},
@@ -188,19 +198,22 @@
proofread: function () {
var reviews, counter, params,
message = this.message,
- $message = this.$message;
+ $message = this.$message,
+ api = new mw.Api();
params = {
action: 'translationreview',
- revision: this.message.properties.revision,
+ revision: this.message.properties.revision
};
if ( !mw.user.isAnon() ) {
params.assert = 'user';
}
- new mw.Api().postWithToken( 'translationreview', params ).done( function () {
- $message.find( '.tux-proofread-action' ).addClass( 'accepted' );
+ api.postWithToken( 'csrf', params ).done( function () {
+ $message.find( '.tux-proofread-action' )
+ .removeClass( 'tux-warning' ) // in case, it failed previously
+ .addClass( 'accepted' );
counter = $message.find( '.tux-proofread-count' );
reviews = counter.data( 'reviewCount' );
@@ -212,13 +225,15 @@
[ 'proofread', message.properties.status ]
);
+ message.properties.status = 'proofread';
+
if ( mw.track ) {
mw.track( 'ext.translate.event.proofread', message );
}
} ).fail( function ( errorCode ) {
$message.find( '.tux-proofread-action' ).addClass( 'tux-warning' );
- // In MW 1.24 alpha postWithToken returns token-missing instead of assertuserfailed
- if ( errorCode === 'assertuserfailed' || errorCode === 'token-missing' ) {
+ if ( errorCode === 'assertuserfailed' ) {
+ // eslint-disable-next-line no-alert
alert( mw.msg( 'tux-session-expired' ) );
}
} );
@@ -236,8 +251,8 @@
} );
this.$message.find( '.tux-proofread-edit' ).on( 'click', function () {
- // Make sure that the tipsy is hidden when going to the editor
- $( '.translate-tipsy' ).remove();
+ // Make sure that the tooltip is hidden when going to the editor
+ $( '.translate-tooltip' ).remove();
proofread.$message.data( 'translateeditor' ).show();
return false;
diff --git a/MLEB/Translate/resources/js/ext.translate.quickedit.js b/MLEB/Translate/resources/js/ext.translate.quickedit.js
deleted file mode 100644
index 6035ee53..00000000
--- a/MLEB/Translate/resources/js/ext.translate.quickedit.js
+++ /dev/null
@@ -1,394 +0,0 @@
-/**
- * JavaScript that implements the Ajax translation interface, which was at the
- * time of writing this probably the biggest usability problem in the extension.
- * Most importantly, it speeds up translating and keeps the list of translatable
- * messages open. It also allows multiple translation dialogs, for doing quick
- * updates to other messages or documentation, or translating multiple languages
- * simultaneously together with the "In other languages" display included in
- * translation helpers and implemented by utils/TranslationhHelpers.php.
- * The form itself is implemented by utils/TranslationEditPage.php, which is
- * called from Special:Translate/editpage?page=Namespace:pagename.
- *
- * TODO list:
- * * Instead of hc'd onscript, give them a class and use necessary triggers
- *
- * @author Niklas Laxström
- * @copyright Copyright © 2009-2012 Niklas Laxström
- * @license GPL-2.0+
- */
-
-(function ( $, mw, undefined ) {
- 'use strict';
- var dialogwidth = false,
- preloads = {};
-
- mw.translate = mw.translate || {};
- function MessageCheckUpdater( callback ) {
- this.act = function () {
- callback();
- delete this.timeoutID;
- };
-
- this.setup = function () {
- this.cancel();
- var self = this;
- this.timeoutID = window.setTimeout( self.act, 1000 );
- };
-
- this.cancel = function () {
- if ( typeof this.timeoutID === 'number' ) {
- window.clearTimeout( this.timeoutID );
- delete this.timeoutID;
- }
- };
- }
-
- /**
- * This is JS port same method of TranslateUtils.php
- */
- function convertWhiteSpaceToHTML( text ) {
- return mw.html.escape( text )
- .replace( /^ /gm, '&#160;' )
- .replace( / $/gm, '&#160;' )
- .replace( / {2}/g, '&#160; ' )
- .replace( /\n/g, '<br />' );
- }
-
- function addAccessKeys( dialog ) {
- var buttons = {
- a: '.mw-translate-save',
- s: '.mw-translate-next',
- d: '.mw-translate-skip',
- h: '.mw-translate-history'
- };
-
- $.each( buttons, function ( key, selector ) {
- $( selector )
- .val( function ( i, b ) {
- return b.replace( / \(.\)$/, '' );
- } )
- .removeAttr( 'accesskey' )
- .attr( 'title', '' );
-
- dialog.find( selector )
- .val( function ( i, b ) {
- return b + ' (_)'.replace( '_', key );
- } )
- .attr( 'accesskey', key )
- .attr( 'title', '[' + mw.util.tooltipAccessKeyPrefix + key + ']' );
- } );
- }
-
- function registerFeatures( callbacks, form, page, group ) {
- var $identical, textarea, checker;
-
- // Enable the collapsible element
- $identical = $( '.mw-identical-title' );
- if ( $.isFunction( $identical.makeCollapsible ) ) {
- $identical.makeCollapsible();
- }
-
- if ( mw.config.get( 'trlKeys' ) || $( '.tqe-inlineeditable' ).length ) {
- if ( callbacks.next === undefined ) {
- form.find( '.mw-translate-next, .mw-translate-skip' ).attr( 'disabled', 'disabled' );
- } else {
- form.find( '.mw-translate-next' ).click( function () {
- if ( callbacks.next ) {
- callbacks.next();
- }
- } );
- form.find( '.mw-translate-skip' ).click( function () {
- if ( callbacks.close ) {
- callbacks.close();
- }
- if ( callbacks.next ) {
- callbacks.next();
- }
- } );
- }
- } else {
- form.find( '.mw-translate-next, .mw-translate-skip' )
- .attr( 'disabled', 'disabled' )
- .css( 'display', 'none' );
- }
- form.find( '.mw-translate-close' ).click( function () {
- if ( callbacks.close ) {
- callbacks.close();
- }
- } );
-
- form.find( '.mw-translate-history' ).click( function () {
- window.open( mw.util.wikiScript( 'index' ) + '?action=history&title=' + form.find( 'input[name=title]' ).val() );
- return false;
- } );
-
- form.find( '.mw-translate-support, .mw-translate-askpermission' ).click( function () {
- // Can use .data() only with 1.4.3 or newer
- window.open( $( this ).attr( 'data-load-url' ) );
- return false;
- } );
-
- form.find( 'input, textarea' ).focus( function () {
- addAccessKeys( form );
- } );
-
- form.find( 'input#summary' ).focus( function () {
- $( this ).css( 'width', '85%' );
- } );
-
- textarea = form.find( '.mw-translate-edit-area' );
- textarea.css( 'display', 'block' );
- textarea.autosize();
- textarea[0].focus();
-
- if ( form.find( '.mw-translate-messagechecks' ) ) {
- checker = new MessageCheckUpdater( function () {
- var url = mw.config.get( 'wgScript' ) + '?title=Special:Translate/editpage&suggestions=checks&page=$1&loadgroup=$2';
- url = url.replace( '$1', encodeURIComponent( page ) ).replace( '$2', encodeURIComponent( group ) );
- $.post( url, { translation: textarea.val() }, function ( mydata ) {
- form.find( '.mw-translate-messagechecks' ).replaceWith( mydata );
- } );
- } );
-
- textarea.keyup( function () {
- checker.setup();
- } );
- }
-
- }
-
- mw.translate = $.extend( mw.translate, {
- init: function () {
- var $inlines, $first, title, group, prev;
-
- dialogwidth = $( window ).width() * 0.8;
- $inlines = $( '.tqe-inlineeditable' );
- $inlines.dblclick( mw.translate.inlineEditor );
-
- $first = $inlines.first();
- if ( $first.length ) {
- title = $first.data( 'title' );
- group = $first.data( 'group' );
- mw.translate.loadEditor( null, title, group, $.noop );
- }
-
- prev = null;
- $inlines.each( function () {
- if ( prev ) {
- prev.next = this;
- }
- prev = this;
- } );
- },
-
- openDialog: function ( page, group ) {
- var id, dialogElement, dialog, callbacks;
-
- id = 'jsedit' + page.replace( /[^a-zA-Z0-9_]/g, '_' );
- dialogElement = $( '#' + id );
-
- if ( dialogElement.size() > 0 ) {
- dialogElement.dialog( 'option', 'position', 'top' );
- dialogElement.dialog( 'open' );
- return false;
- }
-
- dialog = $( '<div>' ).attr( 'id', id ).appendTo( $( 'body' ) );
-
- callbacks = {};
- callbacks.close = function () {
- dialog.dialog( 'close' );
- };
- callbacks.next = function () {
- mw.translate.openNext( page, group );
- };
- callbacks.success = function ( text ) {
- var $td = $( '.tqe-inlineeditable' ).filter( function () {
- return $( this ).data( 'title' ) === page.replace( '_', ' ' );
- } );
- $td
- .html( convertWhiteSpaceToHTML( text ) )
- .attr( 'dir', 'auto' ) // (bug T31233) hacky, but better than nothing
- .removeClass( 'untranslated' )
- .addClass( 'justtranslated' );
- };
- mw.translate.openEditor( dialog, page, group, callbacks );
-
- dialog.dialog( {
- bgiframe: true,
- width: dialogwidth,
- title: page,
- position: 'top',
- resize: function () {
- $( '#' + id + ' textarea' ).width( '100%' );
- },
- resizeStop: function () {
- dialogwidth = $( '#' + id ).width();
- }
- } );
-
- return false;
- },
-
- loadEditor: function ( $target, page, group, callback ) {
- var id, preload, url, params;
-
- // Try if it has been cached
- id = 'preload-' + page.replace( /[^a-zA-Z0-9_]/g, '_' );
- preload = preloads[id];
-
- if ( preload !== undefined ) {
- if ( $target ) {
- $target.html( preloads[id] );
- delete preloads[id];
- }
- callback();
- return;
- }
-
- // Load the editor into provided target or cache it locally
- url = mw.util.wikiScript( 'index' );
- params = {
- title: 'Special:Translate/editpage',
- suggestions: 'sync',
- page: page,
- loadgroup: group
- };
- if ( $target ) {
- $target.load( url, params, callback );
- delete preloads[id];
- } else {
- $.get( url, params, function ( data ) {
- preloads[id] = data;
- } );
- }
-
- },
-
- openEditor: function ( element, page, group, callbacks ) {
- var $target = $( element ),
- spinner = $( '<div>' ).attr( 'class', 'mw-ajax-loader' );
-
- $target.html( $( '<div>' ).attr( 'class', 'mw-ajax-dialog' ).html( spinner ) );
-
- mw.translate.loadEditor( $target, page, group, function () {
- if ( callbacks.load ) {
- callbacks.load( $target );
- }
-
- var form = $target.find( 'form' );
- registerFeatures( callbacks, form, page, group );
- form.on( 'submit', function () {
- mw.translateHooks.run( 'beforeSubmit', form );
- $( this ).ajaxSubmit( {
- dataType: 'json',
- success: function ( json ) {
- mw.translateHooks.run( 'afterSubmit', form );
- if ( json.error ) {
- if ( json.error.code === 'emptypage' ) {
- window.alert( mw.msg( 'api-error-emptypage' ) );
- } else {
- window.alert( json.error.info + ' (' + json.error.code + ')' );
- }
- } else if ( json.edit.result === 'Failure' ) {
- window.alert( mw.msg( 'translate-js-save-failed' ) );
- } else if ( json.edit.result === 'Success' ) {
- if ( callbacks.close ) {
- callbacks.close();
- }
- if ( callbacks.success ) {
- callbacks.success( form.find( '.mw-translate-edit-area' ).val() );
- }
- } else {
- window.alert( mw.msg( 'translate-js-save-failed' ) );
- }
- }
- } );
- return false;
- } );
- } );
- },
-
- openNext: function ( title, group ) {
- var messages = mw.config.get( 'trlKeys' ),
- found = false, key, value;
-
- for ( key in messages ) {
- if ( !messages.hasOwnProperty( key ) ) {
- continue;
- }
-
- value = messages[key];
- if ( found ) {
- return mw.translate.openDialog( value, group );
- } else if ( value === title ) {
- found = true;
- }
- }
- window.alert( mw.msg( 'translate-js-nonext' ) );
- },
-
- inlineEditor: function () {
- var $this, current, page, group, next, callbacks, ntitle, ngroup, sel;
- $this = $( this );
-
- if ( $this.hasClass( 'tqe-editor-loaded' ) ) {
- // Editor is open, do not replace it
- return;
- }
-
- current = $this.html();
- $this.addClass( 'tqe-editor-loaded' );
-
- page = $this.data( 'title' );
- group = $this.data( 'group' );
- next = $( this.next );
- callbacks = {};
-
- callbacks.success = function ( text ) {
- // Update the cell value with the new translation
- $this
- .html( convertWhiteSpaceToHTML( text ) )
- .attr( 'dir', 'auto' ) // (bug T31233) hacky, but better than nothing
- .removeClass( 'untranslated' )
- .addClass( 'justtranslated' );
- };
- callbacks.close = function () {
- $this.html( current );
- $this.removeClass( 'tqe-editor-loaded' );
- };
- callbacks.load = function ( editor ) {
- var $header = $( '<div class="tqe-fakeheader"></div>' );
- $header.text( page );
- $header.append( '<input type=button class="mw-translate-close" value="X" />' );
-
- $( editor ).find( 'form' ).prepend( $header );
- };
- if ( next.length ) {
- callbacks.next = function () {
- next.dblclick();
- };
- // Preload the next item
- ntitle = next.data( 'title' );
- ngroup = next.data( 'group' );
-
- mw.translate.loadEditor( null, ntitle, ngroup, $.noop );
- }
- mw.translate.openEditor( $this, page, group, callbacks );
-
- // Remove any text selection caused by double clicking
- sel = window.getSelection ? window.getSelection() : document.selection;
-
- if ( sel ) {
- if ( sel.removeAllRanges ) {
- sel.removeAllRanges();
- }
- if ( sel.empty ) {
- sel.empty();
- }
- }
- }
- } );
-
- $( document ).ready( mw.translate.init );
-} )( jQuery, mediaWiki );
diff --git a/MLEB/Translate/resources/js/ext.translate.selecttoinput.js b/MLEB/Translate/resources/js/ext.translate.selecttoinput.js
index 9558ec9e..cb4a51bd 100644
--- a/MLEB/Translate/resources/js/ext.translate.selecttoinput.js
+++ b/MLEB/Translate/resources/js/ext.translate.selecttoinput.js
@@ -1,27 +1,27 @@
window.appendFromSelect = function ( selectid, targetid ) {
'use strict';
- var select, target, atxt;
-
- select = document.getElementById( selectid );
- target = document.getElementById( targetid );
+ var select = document.getElementById( selectid ),
+ target = document.getElementById( targetid ),
+ atxt;
if ( !target || !select ) {
return;
}
- atxt = select.options[select.selectedIndex].value;
+ atxt = select.options[ select.selectedIndex ].value;
if ( !atxt ) {
return;
}
- /* Ugly hack */
-
- target.value = target.value.replace( /default/, '' );
-
- if ( target.value.replace( /[\s\t\n]/ig, '' ) !== '' ) {
+ if ( target.value.replace( /\s+/g, '' ) !== '' ) {
atxt = ', ' + atxt;
}
- target.value += atxt;
+
+ atxt = target.value + atxt;
+
+ atxt = atxt.replace( /\bdefault\b[,\s]*/i, '' );
+
+ target.value = atxt;
};
diff --git a/MLEB/Translate/resources/js/ext.translate.special.aggregategroups.js b/MLEB/Translate/resources/js/ext.translate.special.aggregategroups.js
index 11cd05a4..547fe264 100644
--- a/MLEB/Translate/resources/js/ext.translate.special.aggregategroups.js
+++ b/MLEB/Translate/resources/js/ext.translate.special.aggregategroups.js
@@ -1,20 +1,17 @@
-/*global alert:false */
-
( function ( $, mw ) {
'use strict';
function getApiParams( $target ) {
return {
action: 'aggregategroups',
- token: $( '#token' ).val(),
- aggregategroup: $target.parents( '.mw-tpa-group' ).data( 'groupid' ),
- format: 'json'
+ aggregategroup: $target.parents( '.mw-tpa-group' ).data( 'groupid' )
};
}
function dissociate( event ) {
var params,
- $target = $( event.target );
+ $target = $( event.target ),
+ api = new mw.Api();
function successFunction() {
$target.parent( 'li' ).remove();
@@ -24,9 +21,13 @@
'do': 'dissociate',
group: $target.data( 'groupid' )
} );
- new mw.Api().post( params ).done( successFunction ).fail( function ( code, data ) {
- window.alert( data.error && data.error.info );
- } );
+
+ api.postWithToken( 'csrf', params )
+ .done( successFunction )
+ .fail( function ( code, data ) {
+ // eslint-disable-next-line no-alert
+ alert( data.error && data.error.info );
+ } );
}
function associate( event, resp ) {
@@ -34,7 +35,8 @@
$target = $( event.target ),
$parent = $target.parents( '.mw-tpa-group' ),
parentId = $parent.data( 'id' ),
- subgroupName = $parent.children( '.tp-group-input' ).val();
+ subgroupName = $parent.children( '.tp-group-input' ).val(),
+ api = new mw.Api();
successFunction = function () {
var aAttr, $a, spanAttr, $span, $ol;
@@ -61,7 +63,7 @@
// Get the label for the value and make API request if valid
subgroupId = '';
- $.each( resp, function( key, value ) {
+ $.each( resp, function ( key, value ) {
if ( subgroupName === value.label ) {
subgroupId = value.id;
}
@@ -72,16 +74,23 @@
'do': 'associate',
group: subgroupId
} );
- new mw.Api().post( params ).done( successFunction ).fail( function ( code, data ) {
- window.alert( data.error && data.error.info );
- } );
+
+ api.postWithToken( 'csrf', params )
+ .done( successFunction )
+ .fail( function ( code, data ) {
+ // eslint-disable-next-line no-alert
+ alert( data.error && data.error.info );
+ } );
} else {
+ // eslint-disable-next-line no-alert
alert( mw.msg( 'tpt-invalid-group' ) );
}
}
function removeGroup( event ) {
- var params, $target = $( event.target );
+ var params,
+ $target = $( event.target ),
+ api = new mw.Api();
function successFunction() {
$( event.target ).parents( '.mw-tpa-group' ).remove();
@@ -89,20 +98,25 @@
// XXX: 'confirm' is nonstandard.
if ( $.isFunction( window.confirm ) &&
+ // eslint-disable-next-line no-alert
window.confirm( mw.msg( 'tpt-aggregategroup-remove-confirm' ) ) ) {
params = $.extend( getApiParams( $target ), {
'do': 'remove'
} );
- new mw.Api().post( params ).done( successFunction ).fail( function ( code, data ) {
- window.alert( data.error && data.error.info );
- } );
+
+ api.postWithToken( 'csrf', params )
+ .done( successFunction )
+ .fail( function ( code, data ) {
+ // eslint-disable-next-line no-alert
+ alert( data.error && data.error.info );
+ } );
}
}
function editGroup( event ) {
var $target = $( event.target ),
$parent = $target.closest( '.mw-tpa-group' ),
- aggregateGroupId = $parent.data( 'groupid' ),
+ aggregateGroupId = $parent.data( 'groupid' ),
$displayGroup = $parent.children( '.tp-display-group' ),
$editGroup = $parent.children( '.tp-edit-group' ),
successFunction,
@@ -115,7 +129,7 @@
successFunction = function () {
// Replace the text by the new text without altering the other 2 span tags
- $displayGroup.children( '.tp-name' ).contents().filter( function() {
+ $displayGroup.children( '.tp-name' ).contents().filter( function () {
return this.nodeType === 3;
} ).replaceWith( aggregateGroupName );
$displayGroup.children( '.tp-desc' ).text( aggregateGroupDesc );
@@ -126,16 +140,17 @@
params = {
action: 'aggregategroups',
'do': 'update',
- token: $( '#token' ).val(),
groupname: aggregateGroupName,
groupdescription: aggregateGroupDesc,
- aggregategroup: aggregateGroupId,
- format: 'json'
+ aggregategroup: aggregateGroupId
};
- api.post( params ).done( successFunction ).fail( function ( code, data ) {
- window.alert( data.error.info );
- } );
+ api.postWithToken( 'csrf', params )
+ .done( successFunction )
+ .fail( function ( code, data ) {
+ // eslint-disable-next-line no-alert
+ alert( data.error.info );
+ } );
}
function cancelEditGroup( event ) {
@@ -145,25 +160,25 @@
$parent.children( '.tp-edit-group' ).addClass( 'hidden' );
}
- $( document ).ready( function () {
- var excludeFunction, autocompleteFunction,
+ $( function () {
+ var excludeFunction, autocompleteFunction, resp,
api = new mw.Api(),
- exclude = [], resp, groups=[],
+ exclude = [],
+ groups = [],
$input = $( '.tp-group-input' );
- excludeFunction = function( event ) {
+ excludeFunction = function ( event ) {
exclude = [];
if ( groups.length === 0 ) {
// Get list of subgroups using API
api.get( {
action: 'query',
- format: 'json',
meta: 'messagegroups',
mgformat: 'tree',
mgroot: 'all',
mgprop: 'label|id'
- } ).done( function( result ) {
+ } ).done( function ( result ) {
groups = result.query.messagegroups;
} );
}
@@ -174,18 +189,18 @@
// Need to trim to remove the trailing whitespace
// Can't use innerText not supported by Firefox
var groupName = $( data ).text();
- groupName = $.trim( groupName );
+ groupName = groupName.trim();
exclude.push( groupName );
}
);
};
- autocompleteFunction = function( request, response ) {
- resp = [];
-
+ autocompleteFunction = function ( request, response ) {
// Allow case insensitive search
var inp = new RegExp( request.term, 'i' );
+ resp = [];
+
$.each( groups, function ( key, value ) {
if ( value.label.match( inp ) && exclude.indexOf( value.label ) === -1 ) {
resp.push( value );
@@ -203,7 +218,7 @@
$( this ).autocomplete( 'search', $( this ).val() );
} );
- $( '.tp-aggregate-add-button' ).click( function( event ) {
+ $( '.tp-aggregate-add-button' ).click( function ( event ) {
associate( event, resp );
} );
$( '.tp-aggregate-remove-button' ).click( dissociate );
@@ -229,7 +244,8 @@
aggGroupNameInputName = $( 'input.tp-aggregategroup-add-name' ),
aggGroupNameInputDesc = $( 'input.tp-aggregategroup-add-description' ),
aggregateGroupName = aggGroupNameInputName.val(),
- aggregateGroupDesc = aggGroupNameInputDesc.val();
+ aggregateGroupDesc = aggGroupNameInputDesc.val(),
+ api = new mw.Api();
// Empty the fields. If they are not emptied, then when another group
// is added, the values will appear again.
@@ -253,20 +269,18 @@
.append( $displayHeader )
.append( $( '<p>' ).addClass( 'tp-desc' ).text( aggregateGroupDesc ) );
- $saveButton = ( $( '<input>' )
+ $saveButton = $( '<input>' )
.attr( {
- 'type': 'button',
+ type: 'button',
'class': 'tp-aggregategroup-update'
} )
- .val( mw.msg( 'tpt-aggregategroup-update' ) )
- );
- $cancelButton = ( $( '<input>' )
+ .val( mw.msg( 'tpt-aggregategroup-update' ) );
+ $cancelButton = $( '<input>' )
.attr( {
- 'type': 'button',
+ type: 'button',
'class': 'tp-aggregategroup-update-cancel'
} )
- .val( mw.msg( 'tpt-aggregategroup-update-cancel' ) )
- );
+ .val( mw.msg( 'tpt-aggregategroup-update-cancel' ) );
$divEdit = $( '<div>' )
.addClass( 'tp-edit-group hidden' )
.append( $( '<label>' )
@@ -274,7 +288,7 @@
.append( $( '<input>' )
.attr( {
'class': 'tp-aggregategroup-edit-name',
- 'id': 'tp-agg-name'
+ id: 'tp-agg-name'
} )
.val( aggregateGroupName )
)
@@ -283,7 +297,7 @@
.append( $( '<input>' )
.attr( {
'class': 'tp-aggregategroup-edit-description',
- 'id': 'tp-agg-desc'
+ id: 'tp-agg-desc'
} )
.val( aggregateGroupDesc )
)
@@ -296,9 +310,8 @@
$div.data( 'groupid', aggregateGroupId );
$div.data( 'id', aggregateGroupId );
-
$groupSelector = $( '<input>' ).attr( {
- 'type': 'text' ,
+ type: 'text',
'class': 'tp-group-input'
} );
$groupSelector.focus( excludeFunction );
@@ -311,13 +324,13 @@
} );
$addButton = $( '<input>' )
.attr( {
- 'type': 'button' ,
+ type: 'button',
'class': 'tp-aggregate-add-button',
- 'id': aggregateGroupId
+ id: aggregateGroupId
} )
.val( mw.msg( 'tpt-aggregategroup-add' ) );
$div.append( $groupSelector, $addButton );
- $addButton.click( function( event ) {
+ $addButton.click( function ( event ) {
associate( event, resp );
} );
$editSpan.on( 'click', function ( event ) {
@@ -336,14 +349,16 @@
params = {
action: 'aggregategroups',
'do': 'add',
- token: $( '#token' ).val(),
groupname: aggregateGroupName,
- groupdescription: aggregateGroupDesc,
- format: 'json'
+ groupdescription: aggregateGroupDesc
};
- new mw.Api().post( params ).done( successFunction ).fail( function ( code, data ) {
- window.alert( data.error && data.error.info );
- } );
+
+ api.postWithToken( 'csrf', params )
+ .done( successFunction )
+ .fail( function ( code, data ) {
+ // eslint-disable-next-line no-alert
+ alert( data.error && data.error.info );
+ } );
} );
} );
-} ( jQuery, mediaWiki ) );
+}( jQuery, mediaWiki ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.special.importtranslations.js b/MLEB/Translate/resources/js/ext.translate.special.importtranslations.js
index 99a34bad..2dc070f4 100644
--- a/MLEB/Translate/resources/js/ext.translate.special.importtranslations.js
+++ b/MLEB/Translate/resources/js/ext.translate.special.importtranslations.js
@@ -1,7 +1,7 @@
( function ( $ ) {
'use strict';
- function buttoner ( $input ) {
+ function buttoner( $input ) {
if ( $input.val ) {
$( 'input[type=submit]' ).prop( 'disabled', false );
} else {
@@ -9,7 +9,7 @@
}
}
- $( document ).ready( function ( ) {
+ $( function () {
var $input = $( '#mw-translate-up-local-input' );
$input.on( 'change', function () {
buttoner( $input );
@@ -17,4 +17,4 @@
buttoner( $input );
} );
-} ( jQuery ) );
+}( jQuery ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.special.languagestats.js b/MLEB/Translate/resources/js/ext.translate.special.languagestats.js
index 0ec2a975..73b37c77 100644
--- a/MLEB/Translate/resources/js/ext.translate.special.languagestats.js
+++ b/MLEB/Translate/resources/js/ext.translate.special.languagestats.js
@@ -1,137 +1,137 @@
-/**
+/*!
* Collapsing script for Special:LanguageStats in MediaWiki Extension:Translate
* @author Krinkle <krinklemail (at) gmail (dot) com>
- * @author Niklas Laxström, 2012
- * @created January 3, 2011
- * @license GPL-2.0+, CC-BY-SA-3.0
+ * @author Niklas Laxström
+ * @license GPL-2.0-or-later, CC-BY-SA-3.0
*/
-/*global mw:false*/
-jQuery( document ).ready( function ( $ ) {
- 'use strict';
-
- var $allChildRows, $allTogglesCache, $toggleAllButton,
- $translateTable = $( '.mw-sp-translate-table' ),
- $metaRows = $( 'tr.AggregateMessageGroup', $translateTable );
- // Quick return
- if ( !$metaRows.size() ) {
- return;
- }
+( function ( mw, $ ) {
+ 'use strict';
- $metaRows.each( function () {
- var $toggler,
- $parent = $( this ),
- thisGroupId = $parent.attr( 'data-groupid' ),
- $children = $( 'tr[data-parentgroup="' + thisGroupId + '"]', $translateTable );
+ $( function () {
+ var $allChildRows, $allTogglesCache, $toggleAllButton,
+ $translateTable = $( '.statstable' ),
+ $metaRows = $( 'tr.AggregateMessageGroup', $translateTable );
- // Only do the collapse stuff if this Meta-group actually has children on this page
- if ( !$children.size() ) {
+ // Quick return
+ if ( !$metaRows.length ) {
return;
}
- // Build toggle link
- $toggler = $( '<span class="groupexpander collapsed">[</span>' )
+ $metaRows.each( function () {
+ var $toggler,
+ $parent = $( this ),
+ thisGroupId = $parent.attr( 'data-groupid' ),
+ $children = $( 'tr[data-parentgroup="' + thisGroupId + '"]', $translateTable );
+
+ // Only do the collapse stuff if this Meta-group actually has children on this page
+ if ( !$children.length ) {
+ return;
+ }
+
+ // Build toggle link
+ $toggler = $( '<span class="groupexpander collapsed">[</span>' )
+ .append( $( '<a href="#"></a>' )
+ .text( mw.msg( 'translate-langstats-expand' ) ) )
+ .append( ']' )
+ .click( function ( e ) {
+ var $el = $( this );
+ // Switch the state and toggle the rows
+ if ( $el.hasClass( 'collapsed' ) ) {
+ $children.fadeIn().trigger( 'show' );
+ $el.removeClass( 'collapsed' ).addClass( 'expanded' );
+ $el.find( '> a' ).text( mw.msg( 'translate-langstats-collapse' ) );
+ } else {
+ $children.fadeOut().trigger( 'hide' );
+ $el.addClass( 'collapsed' ).removeClass( 'expanded' );
+ $el.find( '> a' ).text( mw.msg( 'translate-langstats-expand' ) );
+ }
+
+ e.preventDefault();
+ } );
+
+ // Add the toggle link to the first cell of the meta group table-row
+ $parent.find( ' > td:first' ).append( $toggler );
+
+ // Handle hide/show recursively, so that collapsing parent group
+ // hides all sub groups regardless of nesting level
+ $parent.on( 'hide show', function ( event ) {
+ // Reuse $toggle, $parent and $children from parent scope
+ if ( $toggler.hasClass( 'expanded' ) ) {
+ $children.trigger( event.type )[ event.type ]();
+ }
+ } );
+ } );
+
+ // Create, bind and append the toggle-all button
+ $allChildRows = $( 'tr[data-parentgroup]', $translateTable );
+ $allTogglesCache = null;
+ $toggleAllButton = $( '<span class="collapsed">[</span>' )
.append( $( '<a href="#"></a>' )
- .text( mw.msg( 'translate-langstats-expand' ) ) )
+ .text( mw.msg( 'translate-langstats-expandall' ) ) )
.append( ']' )
.click( function ( e ) {
- var $el = $( this );
+ var $el = $( this ),
+ $allToggles = $allTogglesCache || $( '.groupexpander', $translateTable );
+
// Switch the state and toggle the rows
+ // and update the local toggles too
if ( $el.hasClass( 'collapsed' ) ) {
- $children.fadeIn().trigger( 'show' );
- $el.removeClass( 'collapsed' ).addClass( 'expanded' );
- $el.find( '> a' ).text( mw.msg( 'translate-langstats-collapse' ) );
+ $allChildRows.show();
+ $el.add( $allToggles ).removeClass( 'collapsed' ).addClass( 'expanded' );
+ $el.find( '> a' ).text( mw.msg( 'translate-langstats-collapseall' ) );
+ $allToggles.find( '> a' ).text( mw.msg( 'translate-langstats-collapse' ) );
} else {
- $children.fadeOut().trigger( 'hide' );
- $el.addClass( 'collapsed' ).removeClass( 'expanded' );
- $el.find( '> a' ).text( mw.msg( 'translate-langstats-expand' ) );
+ $allChildRows.hide();
+ $el.add( $allToggles ).addClass( 'collapsed' ).removeClass( 'expanded' );
+ $el.find( '> a' ).text( mw.msg( 'translate-langstats-expandall' ) );
+ $allToggles.find( '> a' ).text( mw.msg( 'translate-langstats-expand' ) );
}
e.preventDefault();
} );
- // Add the toggle link to the first cell of the meta group table-row
- $parent.find( ' > td:first' ).append( $toggler );
+ // Initially hide them
+ $allChildRows.hide();
- // Handle hide/show recursively, so that collapsing parent group
- // hides all sub groups regardless of nesting level
- $parent.on( 'hide show', function ( event ) {
- // Reuse $toggle, $parent and $children from parent scope
- if ( $toggler.hasClass( 'expanded' ) ) {
- $children.trigger( event.type )[event.type]();
- }
- } );
+ // Add the toggle-all button above the table
+ $( '<p class="groupexpander-all"></p>' ).append( $toggleAllButton ).insertBefore( $translateTable );
} );
- // Create, bind and append the toggle-all button
- $allChildRows = $( 'tr[data-parentgroup]', $translateTable );
- $allTogglesCache = null;
- $toggleAllButton = $( '<span class="collapsed">[</span>' )
- .append( $( '<a href="#"></a>' )
- .text( mw.msg( 'translate-langstats-expandall' ) ) )
- .append( ']' )
- .click( function ( e ) {
- var $el = $( this ),
- $allToggles = !!$allTogglesCache ? $allTogglesCache : $( '.groupexpander', $translateTable );
-
- // Switch the state and toggle the rows
- // and update the local toggles too
- if ( $el.hasClass( 'collapsed' ) ) {
- $allChildRows.show();
- $el.add( $allToggles ).removeClass( 'collapsed' ).addClass( 'expanded' );
- $el.find( '> a' ).text( mw.msg( 'translate-langstats-collapseall' ) );
- $allToggles.find( '> a' ).text( mw.msg( 'translate-langstats-collapse' ) );
- } else {
- $allChildRows.hide();
- $el.add( $allToggles ).addClass( 'collapsed' ).removeClass( 'expanded' );
- $el.find( '> a' ).text( mw.msg( 'translate-langstats-expandall' ) );
- $allToggles.find( '> a' ).text( mw.msg( 'translate-langstats-expand' ) );
- }
-
- e.preventDefault();
- } );
-
- // Initially hide them
- $allChildRows.hide();
-
- // Add the toggle-all button above the table
- $( '<p class="groupexpander-all"></p>' ).append( $toggleAllButton ).insertBefore( $translateTable );
-} );
+ // When hovering a row, adjust brightness of the last two custom-colored cells as well
+ // See also translate.langstats.css for the highlighting for the other normal rows
+ mw.loader.using( 'jquery.colorUtil', function () {
+ $( function () {
+ // It is possible that the first event we get is hover-out, in
+ // which case the colors will get stuck wrong. Ignore it.
+ var eventHandlers, seenHoverIn = false;
+
+ eventHandlers = {
+ mouseenter: function () {
+ seenHoverIn = true;
+ $( this ).children( '.hover-color' )
+ // 30% more brightness
+ .css( 'background-color', function ( i, val ) {
+ return $.colorUtil.getColorBrightness( val, +0.3 );
+ } );
+ },
+ mouseleave: function () {
+ if ( !seenHoverIn ) {
+ return;
+ }
+ $( this ).children( '.hover-color' )
+ // 30% less brightness
+ .css( 'background-color', function ( i, val ) {
+ return $.colorUtil.getColorBrightness( val, -0.3 );
+ } );
+ }
+ };
-// When hovering a row, adjust brightness of the last two custom-colored cells as well
-// See also translate.langstats.css for the highlighting for the other normal rows
-mw.loader.using( 'jquery.colorUtil', function () {
- 'use strict';
- jQuery( document ).ready( function ( $ ) {
- // It is possible that the first event we get is hover-out, in
- // which case the colors will get stuck wrong. Ignore it.
- var seenHoverIn = false;
-
- $( '.mw-sp-translate-table.wikitable tr' ).hover( function () {
- seenHoverIn = true;
- $( '> td.hover-color', this )
- // 30% more brightness
- .css( 'background-color', function ( i, val ) {
- // @codingStandardsIgnoreStart Bug in CodeSniffer?
- return $.colorUtil.getColorBrightness( val, +0.3 );
- // codingStandardsIgnoreEnd
- } );
- }, function () {
- if ( !seenHoverIn ) {
- return;
- }
- $( '> td.hover-color', this )
- // 30% less brightness
- .css( 'background-color', function ( i, val ) {
- return $.colorUtil.getColorBrightness( val, -0.3 );
- } );
+ $( '.statstable' ).on( eventHandlers, 'tr' );
} );
} );
-} );
-(function ( mw, $ ) {
- 'use strict';
- $( document ).ready( function () {
+ $( function () {
var index,
sort = {},
re = /#sortable:(\d+)=(asc|desc)/,
@@ -139,16 +139,16 @@ mw.loader.using( 'jquery.colorUtil', function () {
$tables = $( '.statstable' );
if ( match ) {
- index = parseInt( match[1], 10 );
- sort[index] = match[2];
+ index = parseInt( match[ 1 ], 10 );
+ sort[ index ] = match[ 2 ];
}
- $tables.tablesorter( {sortList: [sort]} );
+ $tables.tablesorter( { sortList: [ sort ] } );
$tables.on( 'sortEnd.tablesorter', function () {
var $table = $( this );
$table.find( '.headerSortDown, .headerSortUp' ).each( function () {
var index = $table.find( 'th' ).index( $( this ) ),
- dir = $( this ).hasClass( 'headerSortUp' ) ? 'desc' : 'asc';
+ dir = $( this ).hasClass( 'headerSortUp' ) ? 'asc' : 'desc';
window.location.hash = 'sortable:' + index + '=' + dir;
} );
} );
diff --git a/MLEB/Translate/resources/js/ext.translate.special.managetranslatorsandbox.js b/MLEB/Translate/resources/js/ext.translate.special.managetranslatorsandbox.js
index 3607ea98..5aef9ac7 100644
--- a/MLEB/Translate/resources/js/ext.translate.special.managetranslatorsandbox.js
+++ b/MLEB/Translate/resources/js/ext.translate.special.managetranslatorsandbox.js
@@ -1,10 +1,10 @@
-/**
+/*!
* JS for special page.
* @author Niklas Laxström
* @author Sucheta Ghoshal
* @author Amir E. Aharoni
* @author Pau Giner
- * @license GPL-2.0+
+ * @license GPL-2.0-or-later
*/
( function ( $, mw ) {
@@ -13,9 +13,10 @@
var delay;
/**
- * A callback for sorting translations
- * @param {object} translationA Object loaded from translation stash
- * @param {object} translationB Object loaded from translation stash
+ * A callback for sorting translations.
+ *
+ * @param {Object} translationA Object loaded from translation stash
+ * @param {Object} translationB Object loaded from translation stash
* @return {number} String comparison of language codes
*/
function sortTranslationsByLanguage( translationA, translationB ) {
@@ -30,8 +31,7 @@
options = $.extend( {}, { action: 'translatesandbox' }, options );
- return api.postWithToken( 'translatesandbox', options )
- .promise();
+ return api.postWithToken( 'csrf', options ).promise();
}
function removeSelectedRequests() {
@@ -68,12 +68,10 @@
* @param {Object} request The request data set from backend on request items
*/
function displayRequestDetails( request ) {
- var storage, reminders,
+ var storage,
$reminderStatus = $( '<span>' ).addClass( 'reminder-status' ),
$detailsPane = $( '.details.pane' );
- reminders = request.reminders ? request.reminders.split( '|' ) : [];
-
if ( request.reminderscount ) {
$reminderStatus.text( mw.msg(
'tsb-reminder-sent',
@@ -119,9 +117,11 @@
.addClass( 'actions row' )
.append(
$( '<button>' )
- .addClass( 'accept primary green button' )
+ .addClass( 'accept mw-ui-button mw-ui-progressive' )
.text( mw.msg( 'tsb-accept-button-label' ) )
.on( 'click', function () {
+ mw.notify( mw.msg( 'tsb-accept-confirmation', 1 ) );
+
window.tsbUpdatingUsers = true;
doApiAction( {
@@ -134,9 +134,11 @@
} );
} ),
$( '<button>' )
- .addClass( 'reject destructive button' )
+ .addClass( 'reject mw-ui-button mw-ui-destructive' )
.text( mw.msg( 'tsb-reject-button-label' ) )
.on( 'click', function () {
+ mw.notify( mw.msg( 'tsb-reject-confirmation', 1 ) );
+
window.tsbUpdatingUsers = true;
doApiAction( {
@@ -216,10 +218,10 @@
.text( mw.msg( 'tsb-translations-current' ) )
.addClass( 'four columns' )
)
- );
+ );
translations.translationstash.translations.sort( sortTranslationsByLanguage );
- $.each( translations.translationstash.translations, function( index, translation ) {
+ $.each( translations.translationstash.translations, function ( index, translation ) {
showTranslation( translation );
} );
}
@@ -261,14 +263,14 @@
}
/**
- * Display when multiple requests are checked
+ * Display when multiple requests are checked.
*/
function displayOnMultipleSelection() {
var selectedUserIDs = $( '.request-selector:checked' ).map( function ( i, checkedBox ) {
return $( checkedBox ).parents( 'div.request' ).data( 'data' ).userid;
} );
- selectedUserIDs = selectedUserIDs.toArray().join( '|' );
+ selectedUserIDs = selectedUserIDs.toArray();
$( '.details.pane' ).empty().append(
$( '<div>' )
@@ -277,9 +279,11 @@
.addClass( 'actions row' )
.append(
$( '<button>' )
- .addClass( 'accept-all primary green button' )
+ .addClass( 'accept-all mw-ui-button mw-ui-progressive' )
.text( mw.msg( 'tsb-accept-all-button-label' ) )
.on( 'click', function () {
+ mw.notify( mw.msg( 'tsb-accept-confirmation', selectedUserIDs.length ) );
+
window.tsbUpdatingUsers = true;
doApiAction( {
@@ -292,9 +296,11 @@
} );
} ),
$( '<button>' )
- .addClass( 'reject-all destructive button' )
+ .addClass( 'reject-all mw-ui-button mw-ui-destructive' )
.text( mw.msg( 'tsb-reject-all-button-label' ) )
.on( 'click', function () {
+ mw.notify( mw.msg( 'tsb-reject-confirmation', selectedUserIDs.length ) );
+
window.tsbUpdatingUsers = true;
doApiAction( {
@@ -312,6 +318,7 @@
/**
* Updates the counter of the selected users.
+ *
* @param {number} count The number of selected users
*/
function updateSelectedIndicator( count ) {
@@ -325,6 +332,7 @@
/**
* Returns older requests with the same number of translations.
+ *
* @return {jQuery} Older requests
*/
function getOlderRequests() {
@@ -428,10 +436,11 @@
/**
* Handle click on request row
+ *
* @param {jQuery.Event} e
*/
function onSelectRequest( e ) {
- var $requestRow = $( e.target ).closest( '.request'),
+ var $requestRow = $( e.target ).closest( '.request' ),
$requestRows = $( '.requests .request' ),
$selectAll = $( '.request-selector-all' );
@@ -441,7 +450,7 @@
$requestRows.each( function ( i, row ) {
var $row = $( row );
- if ( row === $requestRow[0] ) {
+ if ( row === $requestRow[ 0 ] ) {
$row.addClass( 'selected' )
.find( '.request-selector' ).prop( {
checked: true,
@@ -463,7 +472,8 @@
}
/**
- * Event handler for request checkbox selection
+ * Event handler for request checkbox selection.
+ *
* @param {jQuery.Event} e
*/
function requestSelectHandler( e ) {
@@ -529,49 +539,20 @@
}
/**
- * Old request click handler
+ * Old request click handler.
+ *
* @param {jQuery.Event} e
*/
function oldRequestSelector( e ) {
e.preventDefault();
- getOlderRequests().each( function( index, request ) {
+ getOlderRequests().each( function ( index, request ) {
$( request ).find( '.request-selector' )
.prop( 'checked', true ) // Otherwise the state doesn't actually change
.change();
} );
}
- $( document ).ready( function () {
- var $requestCheckboxes = $( '.request-selector' ),
- $selectAll = $( '.request-selector-all' ),
- $requestRows = $( '.requests .request' );
-
- // Delay so we get the correct height on page load
- window.setTimeout( setPanesHeight, 0 );
- $( window ).on( 'resize', setPanesHeight );
-
- $( '.request-filter-box' ).translatorSearch();
- $( '.language-selector' ).languageFilter();
-
- // Handle clicks for the 'Select all' checkbox
- $selectAll.on( 'click', selectAllRequests );
-
- // Handle clicks on request checkboxes.
- $requestCheckboxes.on( 'click change', requestSelectHandler );
-
- // Handle clicks on request rows.
- $requestRows.on( 'click', onSelectRequest );
-
- $( '.older-requests-indicator' ).on( 'click', oldRequestSelector );
-
- if ( $requestRows.length ) {
- $requestRows.first().click();
- }
-
- updateRequestCount();
- } );
-
// ======================================
// LanguageFilter plugin
// ======================================
@@ -605,10 +586,11 @@
$clearButton.removeClass( 'hide' );
indicateOlderRequests();
},
+ ulsPurpose: 'translate-special-managetranslatorsandbox',
quickList: mw.uls.getFrequentLanguageList
} );
- $clearButton.on( 'click', function() {
+ $clearButton.on( 'click', function () {
var userLang = mw.config.get( 'wgUserLanguage' );
languageFilter.$selector
@@ -627,6 +609,7 @@
/**
* Filter the requests by language.
+ *
* @param {string} [language] Language code
*/
LanguageFilter.prototype.filter = function ( language ) {
@@ -653,7 +636,7 @@
$.fn.languageFilter = function () {
return this.each( function () {
- if ( !$.data( this, 'LanguageFilter' ) ) {
+ if ( !$.data( this, 'LanguageFilter' ) ) {
$.data( this, 'LanguageFilter', new LanguageFilter( this ) );
}
} );
@@ -668,21 +651,21 @@
}
TranslatorSearch.prototype.init = function () {
- this.$search.on( 'search keyup', $.proxy( this.keyup, this ) );
+ this.$search.on( 'search keyup', this.keyup.bind( this ) );
};
- TranslatorSearch.prototype.keyup = function() {
+ TranslatorSearch.prototype.keyup = function () {
var query,
translatorSearch = this;
// Respond to the keypress events after a small timeout to avoid freeze when typed fast
delay( function () {
- query = $.trim( translatorSearch.$search.val() ).toLowerCase().trim();
+ query = translatorSearch.$search.val().trim().toLowerCase();
translatorSearch.filter( query );
}, 300 );
};
- TranslatorSearch.prototype.filter = function( query ) {
+ TranslatorSearch.prototype.filter = function ( query ) {
var $requests = $( '.request' );
$requests.each( function ( index, request ) {
@@ -725,7 +708,7 @@
$.fn.translatorSearch = function () {
return this.each( function () {
- if ( !$.data( this, 'TranslatorSearch' ) ) {
+ if ( !$.data( this, 'TranslatorSearch' ) ) {
$.data( this, 'TranslatorSearch', new TranslatorSearch( this ) );
}
} );
@@ -738,5 +721,35 @@
clearTimeout( timer );
timer = setTimeout( callback, milliseconds );
};
- } () );
+ }() );
+
+ $( function () {
+ var $requestCheckboxes = $( '.request-selector' ),
+ $selectAll = $( '.request-selector-all' ),
+ $requestRows = $( '.requests .request' );
+
+ // Delay so we get the correct height on page load
+ window.setTimeout( setPanesHeight, 0 );
+ $( window ).on( 'resize', setPanesHeight );
+
+ $( '.request-filter-box' ).translatorSearch();
+ $( '.language-selector' ).languageFilter();
+
+ // Handle clicks for the 'Select all' checkbox
+ $selectAll.on( 'click', selectAllRequests );
+
+ // Handle clicks on request checkboxes.
+ $requestCheckboxes.on( 'click change', requestSelectHandler );
+
+ // Handle clicks on request rows.
+ $requestRows.on( 'click', onSelectRequest );
+
+ $( '.older-requests-indicator' ).on( 'click', oldRequestSelector );
+
+ if ( $requestRows.length ) {
+ $requestRows.first().click();
+ }
+
+ updateRequestCount();
+ } );
}( jQuery, mediaWiki ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.special.pagemigration.js b/MLEB/Translate/resources/js/ext.translate.special.pagemigration.js
index 3e9d2ce3..89735436 100644
--- a/MLEB/Translate/resources/js/ext.translate.special.pagemigration.js
+++ b/MLEB/Translate/resources/js/ext.translate.special.pagemigration.js
@@ -1,12 +1,17 @@
( function ( $, mw ) {
'use strict';
var noOfSourceUnits, noOfTranslationUnits,
- pageName, langCode, sourceUnits = [];
+ pageName = '',
+ langCode = '',
+ sourceUnits = [];
/**
* Create translation pages using content of right hand side blocks
* and identifiers from left hand side blocks. Create pages only if
* content is not empty.
+ *
+ * @param {number} i Array index to sourceUnits.
+ * @param {string} content
* @return {Function} Returns a function which returns a jQuery.Promise
*/
function createTranslationPage( i, content ) {
@@ -15,23 +20,23 @@
var identifier, title, summary,
api = new mw.Api();
- identifier = sourceUnits[i].identifier;
+ identifier = sourceUnits[ i ].identifier;
title = 'Translations:' + pageName + '/' + identifier + '/' + langCode;
summary = $( '#pm-summary' ).val();
- return api.postWithToken( 'edit', {
+ return api.postWithToken( 'csrf', {
action: 'edit',
- format: 'json',
watchlist: 'nochange',
title: title,
text: content,
- summary: summary,
+ summary: summary
} );
};
}
/**
* Get the old translations of a given page at given time.
+ *
* @param {string} fuzzyTimestamp Timestamp in MediaWiki format
* @param {string} pageTitle
* @return {jQuery.Promise}
@@ -44,7 +49,6 @@
return api.get( {
action: 'query',
prop: 'revisions',
- format: 'json',
rvprop: 'content',
rvstart: fuzzyTimestamp,
titles: pageTitle
@@ -52,7 +56,7 @@
var pageContent, oldTranslationUnits, obj, page,
errorBox = $( '.mw-tpm-sp-error__message' );
for ( page in data.query.pages ) {
- obj = data.query.pages[page];
+ obj = data.query.pages[ page ];
}
if ( typeof obj === undefined ) {
// obj was not initialized
@@ -64,14 +68,15 @@
errorBox.text( mw.msg( 'pm-old-translations-missing', pageTitle ) ).show( 'fast' );
return $.Deferred().reject();
}
- pageContent = obj.revisions[0]['*'];
+ pageContent = obj.revisions[ 0 ][ '*' ];
oldTranslationUnits = pageContent.split( '\n\n' );
return oldTranslationUnits;
} );
}
/**
- * Get the timestamp before FuzzyBot's first edit on page
+ * Get the timestamp before FuzzyBot's first edit on page.
+ *
* @param {string} pageTitle
* @return {jQuery.Promise}
* @return {Function} return.done
@@ -84,17 +89,16 @@
return api.get( {
action: 'query',
prop: 'revisions',
- format: 'json',
rvprop: 'timestamp',
rvuser: 'FuzzyBot',
rvdir: 'newer',
titles: pageTitle
- } ).then ( function ( data ) {
+ } ).then( function ( data ) {
var timestampFB, dateFB, timestampOld,
page, obj,
errorBox = $( '.mw-tpm-sp-error__message' );
for ( page in data.query.pages ) {
- obj = data.query.pages[page];
+ obj = data.query.pages[ page ];
}
// Page does not exist if missing field is present
if ( obj.missing === '' ) {
@@ -107,7 +111,7 @@
return $.Deferred().reject();
} else {
// FB over here refers to FuzzyBot
- timestampFB = obj.revisions[0].timestamp;
+ timestampFB = obj.revisions[ 0 ].timestamp;
dateFB = new Date( timestampFB );
dateFB.setSeconds( dateFB.getSeconds() - 1 );
timestampOld = dateFB.toISOString();
@@ -118,11 +122,12 @@
}
/**
- * Get the translation units created by Translate extension
+ * Get the translation units created by Translate extension.
+ *
* @param {string} pageName
- * return {jQuery.Promise}
- * return {Function} return.done
- * return {Object[]} return.done.data Array of sUnit Objects
+ * @return {jQuery.Promise}
+ * @return {Function} return.done
+ * @return {Object[]} return.done.data Array of sUnit Objects
*/
function getSourceUnits( pageName ) {
var api = new mw.Api();
@@ -130,19 +135,18 @@
return api.get( {
action: 'query',
list: 'messagecollection',
- format: 'json',
mcgroup: 'page-' + pageName,
mclanguage: 'en',
mcprop: 'definition'
- } ).then ( function ( data ) {
+ } ).then( function ( data ) {
var result, i, sUnit, key;
sourceUnits = [];
result = data.query.messagecollection;
for ( i = 1; i < result.length; i++ ) {
sUnit = {};
- key = result[i].key;
+ key = result[ i ].key;
sUnit.identifier = key.slice( key.lastIndexOf( '/' ) + 1 );
- sUnit.definition = result[i].definition;
+ sUnit.definition = result[ i ].definition;
sourceUnits.push( sUnit );
}
return sourceUnits;
@@ -151,10 +155,14 @@
/**
* Shift rows up by one unit. This is called after a unit is deleted.
+ *
* @param {jQuery} $start The starting node
*/
function shiftRowsUp( $start ) {
- var $current = $start, $next = $start.next(), nextVal;
+ var nextVal,
+ $current = $start,
+ $next = $start.next();
+
while ( $next.length ) {
nextVal = $next.find( '.mw-tpm-sp-unit__target' ).val();
$current.find( '.mw-tpm-sp-unit__target' ).val( nextVal );
@@ -171,6 +179,7 @@
/**
* Shift rows down by one unit. This is called after a new empty unit is
* added.
+ *
* @param {jQuery} $nextRow The next row to start with
* @param {string} text The text of the next row
* @return {string} text The text of the last row
@@ -188,7 +197,8 @@
}
/**
- * Create a new row of source text and target text with action icons
+ * Create a new row of source text and target text with action icons.
+ *
* @param {string} sourceText
* @param {string} targetText
* @return {jQuery} newUnit The new row unit object
@@ -199,22 +209,25 @@
newUnit = $( '<div>' ).addClass( 'mw-tpm-sp-unit row' );
sourceUnit = $( '<textarea>' ).addClass( 'mw-tpm-sp-unit__source five columns' )
- .prop( 'readonly', 'readonly' ).attr( 'tabindex', '-1' ).val( sourceText );
+ .prop( 'readonly', true ).attr( 'tabindex', '-1' ).val( sourceText );
targetUnit = $( '<textarea>' ).addClass( 'mw-tpm-sp-unit__target five columns' )
- .val( targetText );
+ .val( targetText ).prop( 'dir', $.uls.data.getDir( langCode ) );
actionUnit = $( '<div>' ).addClass( 'mw-tpm-sp-unit__actions two columns' );
- actionUnit.append( $( '<span>' ).addClass( 'mw-tpm-sp-action mw-tpm-sp-action--add' )
+ actionUnit.append(
+ $( '<span>' ).addClass( 'mw-tpm-sp-action mw-tpm-sp-action--add' )
.attr( 'title', mw.msg( 'pm-add-icon-hover-text' ) ),
$( '<span>' ).addClass( 'mw-tpm-sp-action mw-tpm-sp-action--swap' )
.attr( 'title', mw.msg( 'pm-swap-icon-hover-text' ) ),
$( '<span>' ).addClass( 'mw-tpm-sp-action mw-tpm-sp-action--delete' )
- .attr( 'title', mw.msg( 'pm-delete-icon-hover-text' ) ) );
+ .attr( 'title', mw.msg( 'pm-delete-icon-hover-text' ) )
+ );
newUnit.append( sourceUnit, targetUnit, actionUnit );
return newUnit;
}
/**
* Display the source and target units alongwith the action icons.
+ *
* @param {Array} sourceUnits
* @param {Array} translations
*/
@@ -229,39 +242,42 @@
unitListing.html( '' );
for ( i = 0; i < totalUnits; i++ ) {
sourceText = targetText = '';
- if ( sourceUnits[i] !== undefined ) {
- sourceText = sourceUnits[i].definition;
+ if ( sourceUnits[ i ] !== undefined ) {
+ sourceText = sourceUnits[ i ].definition;
}
- if ( translations[i] !== undefined ) {
- targetText = translations[i];
+ if ( translations[ i ] !== undefined ) {
+ targetText = translations[ i ];
}
newUnit = createNewUnit( sourceText, targetText );
unitListing.append( newUnit );
}
}
- /*
+ /**
* Split headers from remaining text in each translation unit if present.
+ *
* @param {Array} translations Array of initial units obtained on splitting
- * @return {string[]} translationUnits Array having the headers split into new unit
+ * @return {string[]} Array having the headers split into new unit
*/
function splitHeaders( translations ) {
return $.map( translations, function ( elem ) {
- // Check http://regex101.com/r/oT7fZ2 for details
+ // Check https://regex101.com/r/oT7fZ2 for details
return elem.match( /(^==.+$|(?:(?!^==).+\n?)+)/gm );
} );
}
/**
- * Get the index of next translation unit containing h2 header
- * @param {Integer} startIndex Index to start the scan from
- * @return {Integer} i Index of the next unit found, -1 if not
+ * Get the index of next translation unit containing h2 header.
+ *
+ * @param {number} startIndex Index to start the scan from
+ * @param {string[]} translationUnits Segmented units.
+ * @return {number} Index of the next unit found, -1 if not.
*/
function getHeaderUnit( startIndex, translationUnits ) {
var i, regex;
regex = new RegExp( /^==[^=]+==$/m );
for ( i = startIndex; i < translationUnits.length; i++ ) {
- if ( regex.test( translationUnits[i] ) ) {
+ if ( regex.test( translationUnits[ i ] ) ) {
return i;
}
}
@@ -272,6 +288,10 @@
* Align h2 headers in the order they appear.
* Assumption: The source headers and translation headers appear in
* the same order.
+ *
+ * @param {Object[]} sourceUnits
+ * @param {string[]} translationUnits
+ * @return {string[]}
*/
function alignHeaders( sourceUnits, translationUnits ) {
var i, regex, tIndex = 0,
@@ -279,7 +299,7 @@
regex = new RegExp( /^==[^=]+==$/m );
for ( i = 0; i < sourceUnits.length; i++ ) {
- if ( regex.test( sourceUnits[i].definition ) ) {
+ if ( regex.test( sourceUnits[ i ].definition ) ) {
tIndex = getHeaderUnit( tIndex, translationUnits );
mergeText = '';
// search is over
@@ -303,7 +323,7 @@
emptyCount += 1;
}
if ( i !== 0 ) {
- translationUnits[i - 1] += '\n' + mergeText;
+ translationUnits[ i - 1 ] += '\n' + mergeText;
} else {
matchText = mergeText + matchText;
}
@@ -320,7 +340,7 @@
* Handler for 'Save' button click event.
*/
function saveHandler() {
- var i, list = [], content;
+ var i, content, list = [];
$( '.mw-tpm-sp-error__message' ).hide( 'fast' );
if ( noOfSourceUnits < noOfTranslationUnits ) {
@@ -328,10 +348,11 @@
.show( 'fast' );
return;
} else {
- $( 'input' ).attr( 'disabled', 'disabled' );
+ $( 'input' ).prop( 'disabled', true );
+ $( '.mw-tpm-sp-instructions' ).hide( 'fast' );
for ( i = 0; i < noOfSourceUnits; i++ ) {
content = $( '.mw-tpm-sp-unit__target' ).eq( i ).val();
- content = $.trim( content );
+ content = content.trim();
if ( content !== '' ) {
list.push( createTranslationPage( i, content ) );
}
@@ -339,7 +360,11 @@
$.ajaxDispatcher( list, 1 ).done( function () {
$( '#action-import' ).removeClass( 'hide' );
- $( 'input' ).removeAttr( 'disabled' );
+ $( 'input' ).prop( 'disabled', false );
+ $( '.mw-tpm-sp-instructions' ).text( mw.msg( 'pm-on-save-message-text' ) ).show( 'fast' );
+ } ).fail( function ( errmsg ) {
+ $( 'input' ).prop( 'disabled', false );
+ $( '.mw-tpm-sp-error__message' ).text( mw.msg( errmsg ) ).show( 'fast' );
} );
}
}
@@ -349,6 +374,7 @@
*/
function cancelHandler() {
$( '.mw-tpm-sp-error__message' ).hide( 'fast' );
+ $( '.mw-tpm-sp-instructions' ).hide( 'fast' );
$( '#action-save, #action-cancel' ).addClass( 'hide' );
$( '#action-import' ).removeClass( 'hide' );
$( '.mw-tpm-sp-unit-listing' ).html( '' );
@@ -357,6 +383,8 @@
/**
* Handler for add new unit icon ('+') click event. Adds a translation unit
* below the current unit.
+ *
+ * @param {jQuery.Event} event
*/
function addHandler( event ) {
var nextRow, text, newUnit, targetUnit;
@@ -377,6 +405,8 @@
/**
* Handler for delete icon ('-') click event. Deletes the unit and shifts
* the units up by one.
+ *
+ * @param {jQuery.Event} event
*/
function deleteHandler( event ) {
var sourceText, rowUnit;
@@ -394,12 +424,14 @@
/**
* Handler for swap icon click event. Swaps the text in the current unit
* with the text in the unit below.
+ *
+ * @param {jQuery.Event} event
*/
function swapHandler( event ) {
var rowUnit, tempText, nextVal;
rowUnit = $( event.target ).closest( '.mw-tpm-sp-unit' );
tempText = rowUnit.find( '.mw-tpm-sp-unit__target' ).val();
- nextVal = rowUnit.next().find( '.mw-tpm-sp-unit__target').val();
+ nextVal = rowUnit.next().find( '.mw-tpm-sp-unit__target' ).val();
rowUnit.find( '.mw-tpm-sp-unit__target' ).val( nextVal );
rowUnit.next().find( '.mw-tpm-sp-unit__target' ).val( tempText );
}
@@ -407,39 +439,60 @@
/**
* Handler for 'Import' button click event. Imports source and translation
* units and displays them.
+ *
+ * @param {jQuery.Event} e
*/
- function importHandler() {
- var pageTitle, titleObj, errorBox = $( '.mw-tpm-sp-error__message' );
- pageName = $.trim( $( '#title' ).val() );
- langCode = $.trim( $( '#language' ).val() );
- pageTitle = pageName + '/' + langCode;
- errorBox.hide( 'fast' );
+ function importHandler( e ) {
+ var pageTitle, slashPos, titleObj,
+ errorBox = $( '.mw-tpm-sp-error__message' ),
+ messageBox = $( '.mw-tpm-sp-instructions' );
+
+ e.preventDefault();
+
+ pageTitle = $( '#title' ).val().trim();
+ if ( pageTitle === '' ) {
+ errorBox.text( mw.msg( 'pm-pagetitle-missing' ) ).show( 'fast' );
+ return;
+ }
+
titleObj = mw.Title.newFromText( pageTitle );
+ messageBox.hide( 'fast' );
if ( titleObj === null ) {
errorBox.text( mw.msg( 'pm-pagetitle-invalid' ) ).show( 'fast' );
return;
}
+
pageTitle = titleObj.getPrefixedDb();
- if ( pageName === '' ) {
- errorBox.text( mw.msg( 'pm-pagename-missing' ) ).show( 'fast' );
+ slashPos = pageTitle.lastIndexOf( '/' );
+
+ if ( slashPos === -1 ) {
+ errorBox.text( mw.msg( 'pm-langcode-missing' ) ).show( 'fast' );
return;
}
- if ( langCode === '' ) {
- errorBox.text( mw.msg( 'pm-langcode-missing' ) ).show( 'fast' );
+
+ pageName = pageTitle.substring( 0, slashPos );
+ langCode = pageTitle.substring( slashPos + 1 );
+
+ if ( pageName === '' ) {
+ errorBox.text( mw.msg( 'pm-pagetitle-invalid' ) ).show( 'fast' );
return;
}
+
+ errorBox.hide( 'fast' );
+
$.when( getSourceUnits( pageName ), getFuzzyTimestamp( pageTitle ) )
.then( function ( sourceUnits, fuzzyTimestamp ) {
- noOfSourceUnits = sourceUnits.length;
- splitTranslationPage( fuzzyTimestamp, pageTitle ).done( function ( translations ) {
- var translationUnits = splitHeaders( translations );
- translationUnits = alignHeaders( sourceUnits, translationUnits );
- noOfTranslationUnits = translationUnits.length;
- displayUnits( sourceUnits, translationUnits );
- $( '#action-save, #action-cancel').removeClass( 'hide' );
- $( '#action-import' ).addClass( 'hide' );
+ noOfSourceUnits = sourceUnits.length;
+ splitTranslationPage( fuzzyTimestamp, pageTitle ).done( function ( translations ) {
+ var translationUnits = splitHeaders( translations );
+ translationUnits = alignHeaders( sourceUnits, translationUnits );
+ noOfTranslationUnits = translationUnits.length;
+ displayUnits( sourceUnits, translationUnits );
+ $( '#action-save, #action-cancel' ).removeClass( 'hide' );
+ $( '#action-import' ).addClass( 'hide' );
+ messageBox.text( mw.msg( 'pm-on-import-message-text' ) ).show( 'fast' );
+ } );
} );
- } );
}
/**
@@ -447,6 +500,8 @@
*/
function listen() {
var $listing = $( '.mw-tpm-sp-unit-listing' );
+
+ $( '#mw-tpm-sp-primary-form' ).submit( importHandler );
$( '#action-import' ).click( importHandler );
$( '#action-save' ).click( saveHandler );
$( '#action-cancel' ).click( cancelHandler );
@@ -455,7 +510,7 @@
$listing.on( 'click', '.mw-tpm-sp-action--add', addHandler );
}
- $( document ).ready( listen );
+ $( listen );
mw.translate = mw.translate || {};
mw.translate = $.extend( mw.translate, {
@@ -465,4 +520,4 @@
alignHeaders: alignHeaders
} );
-} ( jQuery, mediaWiki ) );
+}( jQuery, mediaWiki ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.special.pagepreparation.js b/MLEB/Translate/resources/js/ext.translate.special.pagepreparation.js
index c3d02861..8ad8a9ec 100644
--- a/MLEB/Translate/resources/js/ext.translate.special.pagepreparation.js
+++ b/MLEB/Translate/resources/js/ext.translate.special.pagepreparation.js
@@ -3,6 +3,7 @@
/**
* Save the page with a given page name and given content to the wiki.
+ *
* @param {string} pageName Page title
* @param {string} pageContent Content of the page to be saved
* @return {jQuery.Promise}
@@ -10,17 +11,17 @@
function savePage( pageName, pageContent ) {
var api = new mw.Api();
- return api.postWithToken( 'edit', {
+ return api.postWithToken( 'csrf', {
action: 'edit',
- format: 'json',
title: pageName,
text: pageContent,
- summary: $( '#pp-summary' ).val(),
+ summary: $( '#pp-summary' ).val()
} ).promise();
}
/**
- * Get the diff between the current revision and the prepared page content
+ * Get the diff between the current revision and the prepared page content.
+ *
* @param {string} pageName Page title
* @param {string} pageContent Content of the page to be saved
* @return {jQuery.Promise}
@@ -31,19 +32,21 @@
var api = new mw.Api();
return api.post( {
- action:'query',
+ action: 'query',
prop: 'revisions',
- format: 'json',
rvprop: 'content',
rvlimit: '1',
titles: pageName,
rvdifftotext: pageContent
} ).then( function ( data ) {
- var obj, diff;
- for ( var page in data.query.pages ) {
- obj = data.query.pages[page];
+ var page, obj, diff;
+
+ for ( page in data.query.pages ) {
+ obj = data.query.pages[ page ];
}
- diff = obj.revisions[0].diff['*'];
+
+ diff = obj.revisions[ 0 ].diff[ '*' ];
+
return diff;
} );
}
@@ -51,6 +54,7 @@
/**
* Remove all the <translate> tags and {{translation}} templates before
* preparing the page. The tool will add them back wherever needed.
+ *
* @param {string} pageContent
* @return {string}
*/
@@ -61,7 +65,8 @@
/**
* Add the <languages/> bar at the top of the page, if not present.
- * Remove the old {{languages}} template, if present
+ * Remove the old {{languages}} template, if present.
+ *
* @param {string} pageContent
* @return {string}
*/
@@ -76,20 +81,21 @@
/**
* Add <translate> tags around Categories to make them a part of the page template
* and tag them with the {{translation}} template.
+ *
* @param {string} pageContent
* @return {jQuery.Promise}
*/
function doCategories( pageContent ) {
return getNamespaceAliases( 14 ).then( function ( aliases ) {
- var aliasList, categoryRegex;
+ var i, aliasList, categoryRegex;
aliases.push( 'category' );
- for ( var i = 0; i < aliases.length; i++ ) {
- aliases[i] = $.escapeRE( aliases[i] );
+ for ( i = 0; i < aliases.length; i++ ) {
+ aliases[ i ] = mw.RegExp.escape( aliases[ i ] );
}
aliasList = aliases.join( '|' );
- // Regex: http://regex101.com/r/sJ3gZ4/2
+ // Regex: https://regex101.com/r/sJ3gZ4/2
categoryRegex = new RegExp( '\\[\\[((' + aliasList + ')' +
':[^\\|]+)(\\|[^\\|]*?)?\\]\\]', 'gi' );
pageContent = pageContent.replace( categoryRegex, '\n</translate>\n' +
@@ -102,6 +108,7 @@
/**
* Add the <translate> and </translate> tags at the start and end of the page.
* The opening tag is added immediately after the <languages/> tag.
+ *
* @param {string} pageContent
* @return {string}
*/
@@ -114,6 +121,7 @@
/**
* Add newlines before and after section headers. Extra newlines resulting after
* this operation are cleaned up in postPreparationCleanup() function.
+ *
* @param {string} pageContent
* @return {string}
*/
@@ -123,36 +131,88 @@
}
/**
+ * Add an anchor to a section header with the given headerText
+ *
+ * @param {string} headerText
+ * @param {string} pageContent
+ * @return {string}
+ */
+ function addAnchor( headerText, pageContent ) {
+ var headerSearchRegex, anchorID, replaceAnchorRegex,
+ spanSearchRegex;
+
+ anchorID = headerText.replace( ' ', '-' ).toLowerCase();
+
+ headerText = mw.RegExp.escape( headerText );
+ // Search for the header having text as headerText
+ // Regex: https://regex101.com/r/fD6iL1
+ headerSearchRegex = new RegExp( '(==+[ ]*' + headerText + '[ ]*==+)', 'gi' );
+ // This is to ensure the tags and the anchor are added only once
+
+ if ( pageContent.indexOf( '<span id="' + mw.html.escape( anchorID ) + '"' ) === -1 ) {
+ pageContent = pageContent.replace( headerSearchRegex, '</translate>\n' +
+ '<span id="' + mw.html.escape( anchorID ) + '"></span>\n<translate>\n$1' );
+ }
+
+ // This is to add back the tags which were removed in cleanupTags()
+ if ( pageContent.indexOf( '</translate>\n<span id="' + anchorID + '"' ) === -1 ) {
+ spanSearchRegex = new RegExp( '(<span id="' + mw.RegExp.escape( anchorID ) + '"></span>)', 'gi' );
+ pageContent = pageContent.replace( spanSearchRegex, '\n</translate>\n$1\n</translate>\n' );
+ }
+
+ // Replace the link text with the anchorID defined above
+ // Regex: https://regex101.com/r/kB5bK3
+ replaceAnchorRegex = new RegExp( '(\\[\\[#)' + headerText + '(.*\\]\\])', 'gi' );
+ pageContent = pageContent.replace( replaceAnchorRegex, '$1' +
+ anchorID.replace( '$', '$$$' ) + '$2' );
+
+ return pageContent;
+ }
+
+ /**
* Convert all the links into two-party form and add the 'Special:MyLanguage/' prefix
* to links in valid namespaces for the wiki. For example, [[Example]] would be converted
* to [[Special:MyLanguage/Example|Example]].
+ *
* @param {string} pageContent
* @return {string}
*/
function fixInternalLinks( pageContent ) {
- var normalizeRegex, linkPrefixRegex,
- namespaces, nsString;
+
+ var normalizeRegex, linkPrefixRegex, sectionLinksRegex,
+ match, searchText, namespaces, nsString;
+ searchText = pageContent;
normalizeRegex = new RegExp( /\[\[(?!Category)([^|]*?)\]\]/gi );
// First convert all links into two-party form. If a link is not having a pipe,
// add a pipe and duplicate the link text
- // Regex : http://regex101.com/r/pO9nN2
+ // Regex: https://regex101.com/r/pO9nN2
pageContent = pageContent.replace( normalizeRegex, '[[$1|$1]]' );
namespaces = getNamespaces();
nsString = namespaces.join( '|' );
+ // Finds all the links to sections on the same page.
+ // Regex: https://regex101.com/r/cX6jT3
+ sectionLinksRegex = new RegExp( /\[\[#(.*?)(\|(.*?))?\]\]/gi );
+ match = sectionLinksRegex.exec( searchText );
+ while ( match !== null ) {
+ pageContent = addAnchor( match[ 1 ], pageContent );
+ match = sectionLinksRegex.exec( searchText );
+ }
+
linkPrefixRegex = new RegExp( '\\[\\[((?:(?:special(?!:MyLanguage\\b)|' + nsString +
'):)?[^:]*?)\\]\\]', 'gi' );
// Add the 'Special:MyLanguage/' prefix for all internal links of valid namespaces and
// mainspace.
- // Regex : http://regex101.com/r/zZ9jH9
+ // Regex: https://regex101.com/r/zZ9jH9
pageContent = pageContent.replace( linkPrefixRegex, '[[Special:MyLanguage/$1]]' );
return pageContent;
}
/**
* Fetch all the aliases for a given namespace on the wiki.
- * @param {integer} namespaceId
+ *
+ * @param {number} namespaceID
* @return {jQuery.Promise}
* @return {Function} return.done
* @return {Array} return.done.data
@@ -161,16 +221,18 @@
var api = new mw.Api();
return api.get( {
- action:'query',
+ action: 'query',
meta: 'siteinfo',
siprop: 'namespacealiases'
} ).then( function ( data ) {
- var aliases = [];
- for ( var alias in data.query.namespacealiases ) {
- if ( data.query.namespacealiases[alias].id === namespaceID ) {
- aliases.push( data.query.namespacealiases[alias]['*'] );
+ var alias, aliases = [];
+
+ for ( alias in data.query.namespacealiases ) {
+ if ( data.query.namespacealiases[ alias ].id === namespaceID ) {
+ aliases.push( data.query.namespacealiases[ alias ][ '*' ] );
}
}
+
return aliases;
} );
}
@@ -178,17 +240,18 @@
/**
* Add translate tags around only translatable content for files and keep everything else
* as a part of the page template.
+ *
* @param {string} pageContent
* @return {jQuery.Promise}
*/
function doFiles( pageContent ) {
return getNamespaceAliases( 6 ).then( function ( aliases ) {
- var aliasList, captionFilesRegex, fileRegex;
+ var i, aliasList, captionFilesRegex, fileRegex;
aliases.push( 'file' );
- for ( var i = 0; i < aliases.length; i++ ) {
- aliases[i] = $.escapeRE( aliases[i] );
+ for ( i = 0; i < aliases.length; i++ ) {
+ aliases[ i ] = mw.RegExp.escape( aliases[ i ] );
}
aliasList = aliases.join( '|' );
@@ -209,12 +272,13 @@
/**
* Keep templates outside <translate>....</translate> tags
* Does not deal with nested templates, needs manual changes.
+ *
* @param {string} pageContent
* @return {string} pageContent
*/
function doTemplates( pageContent ) {
var templateRegex;
- // Regex: http://regex101.com/r/wA3iX0
+ // Regex: https://regex101.com/r/wA3iX0
templateRegex = new RegExp( /^({{[\s\S]*?}})/gm );
pageContent = pageContent.replace( templateRegex, '</translate>\n$1\n<translate>' );
@@ -223,6 +287,7 @@
/**
* Cleanup done after the page is prepared for translation by the tool.
+ *
* @param {string} pageContent
* @return {string}
*/
@@ -231,62 +296,67 @@
pageContent = pageContent.replace( /\n\n+/gi, '\n\n' );
// Removes redundant <translate> tags
pageContent = pageContent.replace( /\n<translate>(\n*?)<\/translate>/gi, '' );
+ // Removes the Special:MyLanguage/ prefix for section links
+ pageContent = pageContent.replace( /Special:MyLanguage\/#/gi, '#' );
return pageContent;
}
/**
* Get the current revision for the given page.
+ *
* @param {string} pageName
* @return {jQuery.Promise}
* @return {Function} return.done
* @return {string} return.done.value The current revision
*/
function getPageContent( pageName ) {
- var api = new mw.Api(), obj;
+ var obj,
+ api = new mw.Api();
+
return api.get( {
- action:'query',
+ action: 'query',
prop: 'revisions',
- format: 'json',
rvprop: 'content',
rvlimit: '1',
titles: pageName
} ).then( function ( data ) {
+ var page;
- for ( var page in data.query.pages ) {
- obj = data.query.pages[page];
+ for ( page in data.query.pages ) {
+ obj = data.query.pages[ page ];
}
- return obj.revisions[0]['*'];
+
+ return obj.revisions[ 0 ][ '*' ];
} );
}
/**
* Get the list of valid namespaces for the wiki and remove unwanted
* ones from the list.
+ *
* @return {Array} Array of valid namespaces
*/
function getNamespaces() {
- var namespacesObject, namespaces = [], i;
+ var key, namespacesObject, i,
+ namespaces = [];
namespacesObject = mw.config.get( 'wgNamespaceIds' );
- for ( var key in namespacesObject ) {
+ for ( key in namespacesObject ) {
namespaces.push( key );
}
// Remove all what has been already handled somewhere else
- namespaces.splice( $.inArray( '', namespaces), 1 );
- namespaces.splice( $.inArray( 'category', namespaces), 1 );
- namespaces.splice( $.inArray( 'category_talk', namespaces), 1 );
- namespaces.splice( $.inArray( 'special', namespaces), 1 );
- namespaces.splice( $.inArray( 'file', namespaces), 1 );
- namespaces.splice( $.inArray( 'file_talk', namespaces), 1 );
+ [ '', 'category', 'category_talk', 'special', 'file', 'file_talk' ].forEach( function ( ns ) {
+ namespaces.splice( namespaces.indexOf( ns ), 1 );
+ } );
for ( i = 0; i < namespaces.length; i++ ) {
- namespaces[i] = $.escapeRE( namespaces[i] );
+ namespaces[ i ] = mw.RegExp.escape( namespaces[ i ] );
}
return namespaces;
}
- $( document ).ready( function () {
+ $( function () {
var pageContent,
$input = $( '#page' );
@@ -295,12 +365,16 @@
} );
$( '#action-save' ).click( function () {
- var serverName, pageUrl = '', pageName;
- pageName = $.trim( $input.val() );
- serverName = mw.config.get( 'wgServerName' );
+ var pageName,
+ pageUrl = '';
+
+ pageName = $input.val().trim();
savePage( pageName, pageContent ).done( function () {
pageUrl = mw.Title.newFromText( pageName ).getUrl( { action: 'edit' } );
- $( '.messageDiv' ).html( mw.message( 'pp-save-message', pageUrl ).parse() ).show();
+ $( '.messageDiv' )
+ .empty()
+ .append( mw.message( 'pp-save-message', pageUrl ).parseDom() )
+ .show();
$( '.divDiff' ).hide( 'fast' );
$( '#action-prepare' ).show();
$input.val( '' );
@@ -311,37 +385,37 @@
$( '#action-prepare' ).click( function () {
var pageName, messageDiv = $( '.messageDiv' );
- pageName = $.trim( $input.val() );
+
+ pageName = $input.val().trim();
messageDiv.hide();
if ( pageName === '' ) {
- window.alert( mw.msg( 'pp-pagename-missing' ) );
+ // eslint-disable-next-line no-alert
+ alert( mw.msg( 'pp-pagename-missing' ) );
return;
}
$.when( getPageContent( pageName ) ).done( function ( content ) {
pageContent = content;
- pageContent = $.trim( pageContent );
+ pageContent = pageContent.trim();
pageContent = cleanupTags( pageContent );
pageContent = addLanguageBar( pageContent );
pageContent = addTranslateTags( pageContent );
pageContent = addNewLines( pageContent );
pageContent = fixInternalLinks( pageContent );
pageContent = doTemplates( pageContent );
- doFiles( pageContent )
- .then( doCategories )
- .done( function( pageContent ) {
+ doFiles( pageContent ).then( doCategories ).done( function ( pageContent ) {
pageContent = postPreparationCleanup( pageContent );
- pageContent = $.trim( pageContent );
+ pageContent = pageContent.trim();
getDiff( pageName, pageContent ).done( function ( diff ) {
$( '.diff tbody' ).append( diff );
$( '.divDiff' ).show( 'fast' );
if ( diff !== '' ) {
- messageDiv.html( mw.msg( 'pp-prepare-message' ) ).show();
+ messageDiv.text( mw.msg( 'pp-prepare-message' ) ).show();
$( '#action-prepare' ).hide();
$( '#action-save' ).show();
$( '#action-cancel' ).show();
} else {
- messageDiv.html( mw.msg( 'pp-already-prepared-message' ) ).show();
+ messageDiv.text( mw.msg( 'pp-already-prepared-message' ) ).show();
}
} );
} );
@@ -349,4 +423,4 @@
} );
} );
-} ( jQuery, mediaWiki ) );
+}( jQuery, mediaWiki ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.special.pagetranslation.js b/MLEB/Translate/resources/js/ext.translate.special.pagetranslation.js
index f47de956..4897189f 100644
--- a/MLEB/Translate/resources/js/ext.translate.special.pagetranslation.js
+++ b/MLEB/Translate/resources/js/ext.translate.special.pagetranslation.js
@@ -1,8 +1,26 @@
-/*
+/*!
* @author Santhosh Thottingal
+ * @author Niklas Laxström
+ * @license GPL-2.0-or-later
*/
-jQuery( function ( $ ) {
+
+( function ( $, mw ) {
'use strict';
- $( '#wpUserLanguage' ).multiselectautocomplete( { inputbox: '#tpt-prioritylangs' } );
-} );
+ $( function () {
+ $( '#wpUserLanguage' ).multiselectautocomplete( { inputbox: '#tpt-prioritylangs' } );
+
+ $( '#mw-content-text' ).on( 'click', '.mw-translate-jspost', function ( e ) {
+ var params,
+ uri = new mw.Uri( e.target.href );
+
+ params = uri.query;
+ params.token = mw.user.tokens.get( 'csrfToken' );
+ $.post( uri.path, params ).done( function () {
+ location.reload();
+ } );
+
+ e.preventDefault();
+ } );
+ } );
+}( jQuery, mediaWiki ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.special.searchtranslations.js b/MLEB/Translate/resources/js/ext.translate.special.searchtranslations.js
index f2b86412..66bfa65c 100644
--- a/MLEB/Translate/resources/js/ext.translate.special.searchtranslations.js
+++ b/MLEB/Translate/resources/js/ext.translate.special.searchtranslations.js
@@ -3,33 +3,40 @@
var resultGroups;
- $( document ).ready( function () {
- var $messages = $( '.tux-message' );
-
+ $( function () {
resultGroups = $( '.facet.groups' ).data( 'facets' );
- // Make the whole rows clickable
- $( '.facet-item' ).click( function () {
- window.location = $( this ).find( 'a' ).attr( 'href' );
- } );
-
- $messages.each( function () {
- var $this = $( this );
-
- $this.translateeditor( {
- message: {
- title: $this.data( 'title' ),
- definition: $this.data( 'definition' ),
- translation: $this.data( 'translation' ),
- group: $this.data( 'group' )
+ $( '.tux-searchpage .button' ).click( function () {
+ var query = $( '.tux-searchpage .searchinputbox' ).val(),
+ result = lexOperators( query ),
+ $form = $( '.tux-searchpage form[name=searchform]' );
+
+ $.each( result, function ( index, value ) {
+ var $input = $( '<input>' ).prop( 'type', 'hidden' ),
+ $elem = $form.find( 'input[name=' + index + ']' );
+
+ if ( $elem.length ) {
+ $elem.val( value );
+ } else {
+ $form.append( $input
+ .prop( {
+ value: value,
+ name: index
+ } )
+ );
}
} );
} );
- $messages.last().addClass( 'last-message' );
-
+ buildSelectedBox();
showLanguages();
showMessageGroups();
+
+ // Make the whole rows clickable
+ $( '.tux-searchpage .row .facet-item' ).click( function ( event ) {
+ window.location = $( this ).find( 'a' ).attr( 'href' );
+ event.stopPropagation();
+ } );
} );
// ES5-compatible Chrome, IE 9+, FF 4+, or Safari 5+ has Object.keys.
@@ -57,12 +64,11 @@
result,
i,
selectedClasss = '',
- docLanguageCode,
languageCode,
quickLanguageList = [],
unique = [],
- regions,
- $ulsTrigger;
+ $ulsTrigger,
+ uri;
$languages = $( '.facet.languages' );
languages = $languages.data( 'facets' );
@@ -71,31 +77,29 @@
return;
}
- resultCount = Object.keys( languages ).length;
-
- // If a documentation pseudo-language is defined,
- // add it to the language selector
- docLanguageCode = mw.config.get( 'wgTranslateDocumentationLanguageCode' );
- if ( languages[docLanguageCode] ) {
- mw.translate.addDocumentationLanguage();
- mw.config.get( 'wgULSLanguages' )[docLanguageCode] = mw.msg( 'translate-documentation-language' );
- regions = ['WW', 'SP', 'AM', 'EU', 'ME', 'AF', 'AS', 'PA'];
+ if ( currentLanguage !== '' ) {
+ uri = new mw.Uri( location.href );
+ uri.extend( { language: '', filter: '' } );
+ addToSelectedBox( getLanguageLabel( currentLanguage ), uri.toString() );
}
+ resultCount = Object.keys( languages ).length;
quickLanguageList = quickLanguageList.concat( mw.uls.getFrequentLanguageList() )
.concat( Object.keys( languages ) );
// Remove duplicates from the language list
- $.each( quickLanguageList, function ( i, v ) {
- result = languages[v];
- if ( result && $.inArray( v, unique ) === -1 ) {
- unique.push( v );
+ quickLanguageList.forEach( function ( lang ) {
+ result = languages[ lang ];
+ if ( result && unique.indexOf( lang ) === -1 ) {
+ unique.push( lang );
}
} );
- if ( currentLanguage && $.inArray( currentLanguage, quickLanguageList ) >= 0 ) {
+ if ( currentLanguage && quickLanguageList.indexOf( currentLanguage ) >= 0 ) {
quickLanguageList = unique.splice( 0, 5 );
- quickLanguageList = quickLanguageList.concat( currentLanguage );
+ if ( quickLanguageList.indexOf( currentLanguage ) === -1 ) {
+ quickLanguageList = quickLanguageList.concat( currentLanguage );
+ }
} else {
quickLanguageList = unique.splice( 0, 6 );
}
@@ -103,8 +107,8 @@
quickLanguageList.sort( sortLanguages );
for ( i = 0; i <= quickLanguageList.length; i++ ) {
- languageCode = quickLanguageList[i];
- result = languages[languageCode];
+ languageCode = quickLanguageList[ i ];
+ result = languages[ languageCode ];
if ( !result ) {
continue;
}
@@ -115,25 +119,28 @@
selectedClasss = '';
}
- $languages.append( $( '<div>')
- .addClass( 'row facet-item ' + selectedClasss )
- .append( $( '<span>')
- .addClass('facet-name')
- .append( $('<a>')
- .attr( 'href', result.url )
- .text( mw.config.get( 'wgULSLanguages' )[languageCode] || languageCode )
- ),
- $( '<span>')
- .addClass('facet-count')
+ $languages.append( $( '<div>' )
+ .addClass( 'row facet-item' )
+ .append(
+ $( '<span>' )
+ .addClass( 'facet-name ' + selectedClasss )
+ .append( $( '<a>' )
+ .attr( 'href', result.url )
+ .text( getLanguageLabel( languageCode ) )
+ ),
+ $( '<span>' )
+ .addClass( 'facet-count' )
.text( result.count )
)
);
}
$.each( Object.keys( languages ), function ( index, languageCode ) {
- ulslanguages[languageCode] = mw.config.get( 'wgULSLanguages' )[languageCode];
+ ulslanguages[ languageCode ] = mw.config.get( 'wgTranslateLanguages' )[ languageCode ];
} );
+ mw.translate.addExtraLanguagesToLanguageData( ulslanguages, [ 'SP' ] );
+
if ( resultCount > 6 ) {
$ulsTrigger = $( '<a>' )
.text( '...' )
@@ -145,12 +152,13 @@
$ulsTrigger.uls( {
onSelect: function ( language ) {
- window.location = languages[language].url;
+ window.location = languages[ language ].url;
},
compact: true,
languages: ulslanguages,
+ ulsPurpose: 'translate-special-searchtranslations',
top: $languages.offset().top,
- showRegions: regions
+ showRegions: [ 'SP' ].concat( $.fn.lcd.defaults.showRegions )
} );
}
}
@@ -161,7 +169,6 @@
$groups;
$groups = $( '.facet.groups' );
- currentGroup = $groups.data( 'group' );
if ( !resultGroups ) {
// No search results
@@ -172,7 +179,7 @@
listGroups( groupList, currentGroup, $groups );
}
- function listGroups( groupList, parentGroup, $parent, level ) {
+ function listGroups( groupList, parentGrouppath, $parent, level ) {
var i,
$grouSelectorTrigger,
selectedClass = '',
@@ -185,57 +192,73 @@
resultCount = groupList.length,
position,
groups,
- options;
+ options,
+ grouppath;
level = level || 0;
- groupList = groupList.splice( 0, maxListSize );
- if ( currentGroup && resultGroups[currentGroup] &&
- $.inArray( currentGroup, groupList ) < 0
+ groupList.sort( sortGroups );
+ if ( level === 0 ) {
+ groupList = groupList.splice( 0, maxListSize );
+ }
+ grouppath = getParameterByName( 'grouppath' ).split( '|' )[ 0 ];
+ if ( currentGroup && resultGroups[ grouppath ] &&
+ groupList.indexOf( grouppath ) < 0 &&
+ level === 0
) {
// Make sure current selected group is displayed always.
- groupList = groupList.concat( currentGroup );
- groupList.sort( sortGroups );
+ groupList = groupList.concat( grouppath );
}
groupList.sort( sortGroups );
- for ( i = 0; i <= groupList.length; i++ ) {
- groupId = groupList[i];
+ for ( i = 0; i < groupList.length; i++ ) {
+ groupId = groupList[ i ];
group = mw.translate.findGroup( groupId, resultGroups );
if ( !group ) {
continue;
}
+
+ uri = new mw.Uri( location.href );
+ if ( parentGrouppath !== undefined ) {
+ grouppath = parentGrouppath + '|' + groupId;
+ } else {
+ grouppath = groupId;
+ }
+ uri.extend( { group: groupId, grouppath: grouppath } );
+
if ( currentGroup === groupId ) {
selectedClass = 'selected';
+ uri.extend( { group: '', grouppath: '' } );
+ addToSelectedBox( group.label, uri.toString() );
} else {
selectedClass = '';
+ uri.extend( { group: groupId, grouppath: grouppath } );
}
- uri = new mw.Uri( window.location.href );
- uri.extend( { 'group': groupId } );
-
$groupRow = $( '<div>' )
- .addClass( 'row facet-item ' + ' facet-level-' + level )
- .append( $( '<span>' )
- .addClass( 'facet-name ' + selectedClass)
- .append( $( '<a>' )
- .attr( 'href', uri.toString() )
- .text( group.label )
- ),
+ .addClass( 'row facet-item facet-level-' + level )
+ .append(
$( '<span>' )
- .addClass( 'facet-count ' + selectedClass )
- .text( group.count )
+ .addClass( 'facet-name ' + selectedClass )
+ .append( $( '<a>' )
+ .attr( 'href', uri.toString() )
+ .text( group.label )
+ ),
+ $( '<span>' )
+ .addClass( 'facet-count' )
+ .text( mw.language.convertNumber( group.count ) )
);
$parent.append( $groupRow );
if ( group.groups && level < 2 ) {
- listGroups( Object.keys( group.groups ), group, $groupRow, level + 1 );
+ listGroups( Object.keys( group.groups ), grouppath, $groupRow, level + 1 );
}
}
- if ( resultCount > maxListSize ) {
- $grouSelectorTrigger = $( '<div>')
+ if ( resultCount > maxListSize && resultCount - groupList.length > 0 && level === 0 ) {
+ $grouSelectorTrigger = $( '<div>' )
.addClass( 'rowfacet-item ' )
- .append( $( '<a>' )
- .text( '...' )
- .addClass( 'translate-search-more-groups' ),
+ .append(
+ $( '<a>' )
+ .text( '...' )
+ .addClass( 'translate-search-more-groups' ),
$( '<span>' )
.addClass( 'translate-search-more-groups-info' )
.text( mw.msg( 'translate-search-more-groups-info',
@@ -261,9 +284,10 @@
position: position,
onSelect: function ( group ) {
var uri = new mw.Uri( location.href );
- uri.extend( { 'group': group.id } );
+ uri.extend( { group: group.id, grouppath: group.id } );
location.href = uri.toString();
- }
+ },
+ preventSelector: true
};
groups = $.map( resultGroups, function ( value, index ) {
return index;
@@ -275,17 +299,99 @@
}
}
+ function lexOperators( str ) {
+ var string = str.split( ' ' ),
+ result = {},
+ query = '';
+
+ $.each( string, function ( index, value ) {
+ matchOperators( value, function ( obj ) {
+ if ( obj === false ) {
+ query = query + ' ' + value;
+ } else {
+ result[ obj.operator ] = obj.value;
+ }
+ } );
+ } );
+ result.query = query.trim();
+
+ return result;
+ }
+
+ function matchOperators( str, callback ) {
+ var matches,
+ counter = false,
+ // Add operators for different filters
+ operatorRegex = [ 'language', 'group', 'filter' ];
+
+ $.each( operatorRegex, function ( index, value ) {
+ var regex = new RegExp( value + ':(\\S+)', 'i' );
+ if ( ( matches = regex.exec( str ) ) !== null ) {
+ counter = true;
+ callback( {
+ operator: value,
+ value: matches[ 1 ]
+ } );
+ }
+ } );
+ if ( !counter ) {
+ callback( false );
+ }
+ }
+
function sortGroups( groupIdA, groupIdB ) {
- var groupAName = mw.translate.findGroup( groupIdA, resultGroups ).label,
- groupBName = mw.translate.findGroup( groupIdB, resultGroups ).label;
+ var groupAName = mw.translate.findGroup( groupIdA, resultGroups ).count,
+ groupBName = mw.translate.findGroup( groupIdB, resultGroups ).count;
- return groupAName.localeCompare( groupBName );
+ if ( groupAName > groupBName ) {
+ return -1;
+ } else if ( groupAName < groupBName ) {
+ return 1;
+ }
+
+ return 0;
}
function sortLanguages( languageA, languageB ) {
- var languageNameA = mw.config.get( 'wgULSLanguages' )[languageA] || languageA,
- languageNameB = mw.config.get( 'wgULSLanguages' )[languageB] || languageB;
+ var languageNameA = mw.config.get( 'wgULSLanguages' )[ languageA ] || languageA,
+ languageNameB = mw.config.get( 'wgULSLanguages' )[ languageB ] || languageB;
return languageNameA.localeCompare( languageNameB );
}
+
+ function getParameterByName( name ) {
+ var uri = new mw.Uri();
+ return uri.query[ name ] || '';
+ }
+
+ function getLanguageLabel( languageCode ) {
+ return mw.config.get( 'wgULSLanguages' )[ languageCode ] || languageCode;
+ }
+
+ // Build a selected box to show the selected items
+ function buildSelectedBox() {
+ $( '.tux-search-inputs' )
+ .removeClass( 'offset-by-three' )
+ .before(
+ $( '<div>' )
+ .addClass( 'three columns tux-selectedbox' )
+ );
+ }
+
+ function addToSelectedBox( label, url ) {
+ $( '.tux-searchpage .tux-selectedbox' ).append( $( '<div>' )
+ .addClass( 'row facet-item' )
+ .append(
+ $( '<span>' )
+ .addClass( 'facet-name selected' )
+ .append( $( '<a>' )
+ .attr( 'href', url )
+ .text( label )
+ ),
+ $( '<span>' )
+ .addClass( 'facet-count' )
+ .text( 'X' )
+ )
+ );
+ }
}( jQuery, mediaWiki ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.special.translate.js b/MLEB/Translate/resources/js/ext.translate.special.translate.js
index 870bd996..d5b43bc3 100644
--- a/MLEB/Translate/resources/js/ext.translate.special.translate.js
+++ b/MLEB/Translate/resources/js/ext.translate.special.translate.js
@@ -1,66 +1,11 @@
( function ( $, mw ) {
'use strict';
- /* Non-TUX Workflow selector code */
- function prepareWorkflowSelector() {
- var $submit, $select, submitFunction;
-
- $submit = $( '#mw-translate-workflowset' );
- $select = $( '#mw-sp-translate-workflow' ).find( 'select' );
-
- $select.find( 'option[value=]' ).prop( 'disabled', true );
-
- submitFunction = function ( event ) {
- var successFunction = function ( data ) {
- if ( data.error ) {
- $submit.val( mw.msg( 'translate-workflow-set-do' ) );
- $submit.prop( 'disabled', false );
- window.alert( data.error.info );
- } else {
- $submit.val( mw.msg( 'translate-workflow-set-done' ) );
- $select.find( 'option[selected]' ).prop( 'selected', false );
- $select.find( 'option[value=' + event.data.newstate + ']' ).prop( 'selected', true );
- }
- };
-
- $submit.prop( 'disabled', true );
- $submit.val( mw.msg( 'translate-workflow-set-doing' ) );
- changeWorkflowStatus( $submit.data( 'group' ),
- $submit.data( 'language' ),
- event.data.newstate,
- $submit.data( 'token' )
- ).done( successFunction );
- };
-
- $select.change( function ( event ) {
- var current = $( this ).find( 'option[selected]' ).val(),
- tobe = event.target.value;
-
- $submit.val( mw.msg( 'translate-workflow-set-do' ) );
- $submit.unbind( 'click' );
- if ( current !== tobe ) {
- $submit.css( 'visibility', 'visible' );
- $submit.prop( 'disabled', false );
- $submit.click( { newstate: tobe }, submitFunction );
- } else {
- $submit.prop( 'disabled', true );
- }
- } );
- }
-
- function changeWorkflowStatus ( group, language, state, token ) {
- var api = new mw.Api(),
- params = {
- action: 'groupreview',
- group: group,
- language: language,
- state: state,
- token: token,
- format: 'json'
- };
-
- return api.post( params );
- }
+ var state = {
+ group: null,
+ language: null,
+ messageList: null
+ };
mw.translate = mw.translate || {};
@@ -69,110 +14,73 @@
/**
* Change the group that is currently displayed
* in the TUX translation editor.
+ *
* @param {Object} group a message group object.
*/
changeGroup: function ( group ) {
- var changes,
- api = new mw.Api(),
- $description = $( '.tux-editor-header .description' );
+ var changes;
if ( !checkDirty() ) {
return;
}
+ state.group = group.id;
+
changes = {
- group: group.id
- };
+ group: group.id,
+ showMessage: null
- // Update the group description in the header
- api.parse(
- group.description
- ).done( function ( parsedDescription ) {
- // The parsed text is returned in a <p> tag,
- // so it's removed here.
- $description.html( $( parsedDescription ).html() );
- } ).fail( function () {
- $description.html( group.description );
- mw.log( 'Error parsing description for group ' + group.id );
- } );
+ };
mw.translate.changeUrl( changes );
mw.translate.updateTabLinks( changes );
- mw.translate.loadMessages( changes );
- updateGroupWarning();
+ $( '.tux-editor-header .group-warning' ).empty();
+ state.messageList.changeSettings( changes );
+ updateGroupInformation( state );
},
changeLanguage: function ( language ) {
- var changes, targetDir, targetLangAttrib,
- userLanguageCode = mw.config.get( 'wgUserLanguage' );
-
- if ( !checkDirty() ) {
- return;
- }
-
- changes = {
- language: language
+ var changes = {
+ language: language,
+ showMessage: null
};
- if ( language === mw.config.get( 'wgTranslateDocumentationLanguageCode' ) ) {
- targetLangAttrib = userLanguageCode;
- targetDir = $.uls.data.getDir( userLanguageCode );
- } else {
- targetLangAttrib = language;
- targetDir = $.uls.data.getDir( language );
- }
-
- // Changes to attributes must also be reflected
- // when the element is created on the server side
- $( '.ext-translate-language-selector > .uls' )
- .text( $.uls.data.getAutonym( language ) )
- .attr( {
- lang: targetLangAttrib,
- dir: targetDir
- } );
- $( '.tux-messagelist' ).data( {
- targetlangcode: language,
- targetlangdir: targetDir
- } );
-
mw.translate.changeUrl( changes );
mw.translate.updateTabLinks( changes );
- mw.translate.loadMessages();
- updateGroupWarning();
+ $( '.tux-editor-header .group-warning' ).empty();
+ state.messageList.changeSettings( changes );
+ updateGroupInformation( state );
+
},
changeFilter: function ( filter ) {
- var realFilters, uri;
-
if ( !checkDirty() ) {
return;
}
- realFilters = [ '!ignored' ];
- uri = new mw.Uri( window.location.href );
- if ( uri.query.optional !== '1' ) {
- realFilters.push( '!optional' );
- }
- if ( filter ) {
- realFilters.push( filter );
- }
-
- mw.translate.changeUrl( { filter: filter } );
- mw.translate.loadMessages( { filter: realFilters.join( '|' ) } );
+ mw.translate.changeUrl( { filter: filter, showMessage: null } );
+ state.messageList.changeSettings( { filter: getActualFilter( filter ) } );
},
- changeUrl: function ( params ) {
+ changeUrl: function ( params, forceChange ) {
var uri = new mw.Uri( window.location.href );
uri.extend( params );
+ // Support removing keys from the query
+ $.each( params, function ( key, val ) {
+ if ( val === null ) {
+ delete uri.query[ key ];
+ }
+ } );
+
if ( uri.toString() === window.location.href ) {
return;
}
- // Change the URL with this URI, but don't leave the page.
- if ( history.pushState && $( '.tux-messagelist' ).length ) {
- // IE<10 does not support pushState. Never mind.
+ // If supported by the browser and requested, change the URL with
+ // this URI but try not to leave the page.
+ if ( !forceChange && history.pushState && $( '.tux-messagelist' ).length ) {
history.pushState( uri, null, uri.toString() );
} else {
// For old browsers, just reload
@@ -182,6 +90,7 @@
/**
* Updates the navigation tabs.
+ *
* @param {Object} params Url parameters to update.
* @since 2013.05
*/
@@ -197,9 +106,25 @@
}
} );
+ function getActualFilter( filter ) {
+ var realFilters, uri;
+
+ realFilters = [ '!ignored' ];
+ uri = new mw.Uri( window.location.href );
+ if ( uri.query.optional !== '1' ) {
+ realFilters.push( '!optional' );
+ }
+ if ( filter ) {
+ realFilters.push( filter );
+ }
+
+ return realFilters.join( '|' );
+ }
+
function checkDirty() {
if ( mw.translate.isDirty() ) {
- return window.confirm( mw.msg( 'translate-js-support-unsaved-warning' ) );
+ // eslint-disable-next-line no-alert
+ return confirm( mw.msg( 'translate-js-support-unsaved-warning' ) );
}
return true;
}
@@ -213,67 +138,128 @@
.filter( '.translated, .proofread' );
}
- function updateGroupWarning() {
- var $groupWarning = $( '.tux-editor-header .group-warning' ),
- id = $( '.tux-messagetable-loader' ).data( 'messagegroup' ),
- props = 'priority|prioritylangs|priorityforce';
+ /**
+ * Updates all group specific stuff on the page.
+ *
+ * @param {Object} state Information about current group and language.
+ * @param {string} state.group Message group id.
+ * @param {string} state.language Language.
+ */
+ function updateGroupInformation( state ) {
+ var props = 'id|priority|prioritylangs|priorityforce|description';
+
+ mw.translate.recentGroups.append( state.group );
+
+ mw.translate.getMessageGroup( state.group, props ).done( function ( group ) {
+ updateDescription( group );
+ updateGroupWarning( group, state.language );
+ } );
+ }
- $groupWarning.empty();
+ function updateDescription( group ) {
+ var
+ api = new mw.Api(),
+ $description = $( '.tux-editor-header .description' );
- mw.translate.getMessageGroup( id, props ).done( function ( group ) {
- var preferredLanguages, headerMessage, languagesMessage,
- targetLanguage = $( '.tux-messagelist' ).data( 'targetlangcode' );
+ if ( group.description === null ) {
+ $description.empty();
+ return;
+ }
- // Check whether the group has priority languages
- if ( !group.prioritylangs ) {
- return;
- }
+ api.parse( group.description ).done( function ( parsedDescription ) {
+ // The parsed text is returned in a <p> tag,
+ // so it's removed here.
+ $description.html( parsedDescription );
+ } ).fail( function () {
+ $description.empty();
+ mw.log( 'Error parsing description for group ' + group.id );
+ } );
+ }
- // And if the current language is among them, we can return early
- if ( $.inArray( targetLanguage, group.prioritylangs ) !== -1 ) {
- return;
- }
+ function updateGroupWarning( group, language ) {
+ var preferredLanguages, headerMessage, languagesMessage,
+ $groupWarning = $( '.tux-editor-header .group-warning' );
- // Make a comma-separated list of preferred languages
- preferredLanguages = $.map( group.prioritylangs, function ( lang ) {
- // bidi isolation for language names
- return '<bdi>' + $.uls.data.getAutonym( lang ) + '</bdi>';
- } ).join( ', ' );
+ // Check whether the group has priority languages
+ if ( !group.prioritylangs ) {
+ return;
+ }
+
+ // And if the current language is among them, we can return early
+ if ( group.prioritylangs.indexOf( language ) !== -1 ) {
+ return;
+ }
- headerMessage = mw.message( group.priorityforce ?
+ // Make a comma-separated list of preferred languages
+ preferredLanguages = $.map( group.prioritylangs, function ( lang ) {
+ // bidi isolation for language names
+ return '<bdi>' + $.uls.data.getAutonym( lang ) + '</bdi>';
+ } ).join( ', ' );
+
+ headerMessage = mw.message(
+ group.priorityforce ?
'tpt-discouraged-language-force-header' :
'tpt-discouraged-language-header',
- $.uls.data.getAutonym( targetLanguage )
- ).parse();
+ $.uls.data.getAutonym( language )
+ ).parse();
- languagesMessage = mw.message( group.priorityforce ?
+ languagesMessage = mw.message(
+ group.priorityforce ?
'tpt-discouraged-language-force-content' :
'tpt-discouraged-language-content',
- preferredLanguages
- ).parse();
-
- $groupWarning.append(
- $( '<p>' ).append( $( '<strong>' ).text( headerMessage ) ),
- // html because of the <bdi> and because it's parsed
- $( '<p>' ).html( languagesMessage )
- );
- } );
+ preferredLanguages
+ ).parse();
+
+ $groupWarning.append(
+ $( '<p>' ).append( $( '<strong>' ).text( headerMessage ) ),
+ // html because of the <bdi> and because it's parsed
+ $( '<p>' ).html( languagesMessage )
+ );
}
- $( document ).ready( function () {
- var $translateContainer, $hideTranslatedButton, $controlOwnButton, $messageList,
- targetLanguage, docLanguageAutonym, docLanguageCode, ulsOptions, filter, uri, position;
+ function setupLanguageSelector( $element ) {
+ var ulsOptions = {
+ languages: mw.config.get( 'wgTranslateLanguages' ),
+ showRegions: [ 'SP' ].concat( $.fn.lcd.defaults.showRegions ),
+ onSelect: function ( language ) {
+ mw.translate.changeLanguage( language );
+ $element.text( $.uls.data.getAutonym( language ) );
+ },
+ ulsPurpose: 'translate-special-translate',
+ quickList: function () {
+ return mw.uls.getFrequentLanguageList();
+ }
+ };
+
+ mw.translate.addExtraLanguagesToLanguageData( ulsOptions.languages, [ 'SP' ] );
+ $element.uls( ulsOptions );
+ }
+
+ $( function () {
+ var $translateContainer, $hideTranslatedButton, $messageList,
+ filter, uri, position, offset, limit;
$messageList = $( '.tux-messagelist' );
+ state.group = $( '.tux-messagetable-loader' ).data( 'messagegroup' );
+ state.language = $messageList.data( 'targetlangcode' );
+
if ( $messageList.length ) {
+ $messageList.messagetable();
+ state.messageList = $messageList.data( 'messagetable' );
+
uri = new mw.Uri( window.location.href );
filter = uri.query.filter;
+ offset = uri.query.showMessage;
+ if ( offset ) {
+ limit = uri.query.limit || 1;
+ // Default to no filters
+ filter = filter || '';
+ }
if ( filter === undefined ) {
filter = '!translated';
}
- mw.translate.changeFilter( filter );
$( '.tux-message-selector li' ).each( function () {
var $this = $( this );
@@ -281,51 +267,47 @@
$this.addClass( 'selected' );
}
} );
- }
- targetLanguage = $messageList.data( 'targetlangcode' ) || // for tux=1
- mw.config.get( 'wgUserLanguage' ); // for tux=0
+ mw.translate.changeUrl( {
+ group: state.group,
+ language: state.language,
+ filter: filter,
+ showMessage: offset,
+ optional: offset ? 1 : undefined
+ } );
+
+ // Start loading messages
+ state.messageList.changeSettings( {
+ group: state.group,
+ language: state.language,
+ offset: offset,
+ limit: limit,
+ filter: getActualFilter( filter )
+ } );
+ }
- // This is the selector for non-TUX mode
- prepareWorkflowSelector();
if ( $( 'body' ).hasClass( 'rtl' ) ) {
position = {
my: 'right top',
at: 'right+80 bottom+5'
};
}
- $( '.tux-breadcrumb .grouplink' ).msggroupselector( {
+ $( '.tux-breadcrumb__item--aggregate' ).msggroupselector( {
onSelect: mw.translate.changeGroup,
- language: targetLanguage,
- position: position
+ language: state.language,
+ position: position,
+ recent: mw.translate.recentGroups.get()
} );
- updateGroupWarning();
+ updateGroupInformation( state );
- $( '.tux-messagelist' ).messagetable();
- // Use ULS for language selection if it's available
- ulsOptions = {
- onSelect: function ( language ) {
- mw.translate.changeLanguage( language );
- },
- languages: mw.config.get( 'wgULSLanguages' ),
- searchAPI: mw.util.wikiScript( 'api' ) + '?action=languagesearch',
- quickList: function () {
- return mw.uls.getFrequentLanguageList();
- }
- };
-
- // If a documentation pseudo-language is defined,
- // add it to the language selector
- docLanguageCode = mw.config.get( 'wgTranslateDocumentationLanguageCode' );
- if ( docLanguageCode ) {
- docLanguageAutonym = mw.msg( 'translate-documentation-language' );
- ulsOptions.languages[docLanguageCode] = docLanguageAutonym;
- mw.translate.addDocumentationLanguage();
- ulsOptions.showRegions = ['WW', 'SP', 'AM', 'EU', 'ME', 'AF', 'AS', 'PA'];
- }
-
- $( '.ext-translate-language-selector .uls' ).uls( ulsOptions );
+ $( '.ext-translate-language-selector .uls' ).one( 'click', function () {
+ var $target = $( this );
+ mw.loader.using( 'ext.uls.mediawiki' ).done( function () {
+ setupLanguageSelector( $target );
+ $target.click();
+ } );
+ } );
if ( $.fn.translateeditor ) {
// New translation editor
@@ -346,22 +328,6 @@
$( this ).prop( 'disabled', true );
} );
- $controlOwnButton = $translateContainer.find( '.tux-proofread-own-translations-button' );
- $controlOwnButton.click( function () {
- var $this = $( this ),
- ownTranslatedMessages = $translateContainer.find( '.own-translation' ),
- hideMessage = mw.msg( 'tux-editor-proofreading-hide-own-translations' ),
- showMessage = mw.msg( 'tux-editor-proofreading-show-own-translations' );
-
- if ( $this.hasClass( 'down' ) ) {
- ownTranslatedMessages.removeClass( 'hide' );
- $this.removeClass( 'down' ).text( hideMessage );
- } else {
- ownTranslatedMessages.addClass( 'hide' );
- $this.addClass( 'down' ).text( showMessage );
- }
- } );
-
// Message filter click handler
$translateContainer.find( '.row.tux-message-selector > li' ).on( 'click', function () {
var newFilter,
diff --git a/MLEB/Translate/resources/js/ext.translate.special.translationstash.js b/MLEB/Translate/resources/js/ext.translate.special.translationstash.js
index b0ca96e4..cfc7ef05 100644
--- a/MLEB/Translate/resources/js/ext.translate.special.translationstash.js
+++ b/MLEB/Translate/resources/js/ext.translate.special.translationstash.js
@@ -1,27 +1,27 @@
-/**
- * TranslationStash front-end logic
+/*!
+ * TranslationStash front-end logic.
+ *
* @author Santhosh Thottingal
- * @license GPL-2.0+
+ * @license GPL-2.0-or-later
* @since 2013.10
*/
( function ( $, mw ) {
'use strict';
+ var userTranslations = {},
+ translationStashStorage = new mw.translate.TranslationStashStorage();
+
mw.translate.canTranslate = function () {
// At this page, the new translator can translate
return true;
};
- var userTranslations = {},
- translationStashStorage = new mw.translate.TranslationStashStorage();
-
function getMessages( messageGroup, language, offset, limit ) {
var deferred = new mw.Api().get( {
action: 'query',
list: 'messagecollection',
mcgroup: messageGroup,
- format: 'json',
mclanguage: language,
mcoffset: offset,
mclimit: limit,
@@ -42,10 +42,10 @@
statusClass = 'tux-status-' + status,
statusMsg;
- if ( status === 'translated' ) {
- // tux-status-translated
- statusMsg = 'tux-status-' + status;
- }
+ if ( status === 'translated' ) {
+ // tux-status-translated
+ statusMsg = 'tux-status-' + status;
+ }
$messageWrapper = $( '<div>' )
.addClass( 'row tux-message' );
@@ -76,7 +76,7 @@
dir: targetLanguageDir
} )
.text( message.translation || '' )
- ),
+ ),
$( '<div>' )
.addClass( 'two columns tux-list-status text-center' )
.append(
@@ -151,8 +151,8 @@
// Show a message telling that the limit was reached
$( '.limit-reached' )
.empty()
- .append( $( '<h1>' ).text( mw.message( 'tsb-limit-reached-title' ) ) )
- .append( $( '<p>' ).text( mw.message( 'tsb-limit-reached-body' ) ) )
+ .append( $( '<h1>' ).text( mw.msg( 'tsb-limit-reached-title' ) ) )
+ .append( $( '<p>' ).text( mw.msg( 'tsb-limit-reached-body' ) ) )
.removeClass( 'hide' );
}
}
@@ -175,8 +175,8 @@
message.properties.status = 'untranslated';
message.group = messagegroup;
- if ( userTranslations[message.title] ) {
- message.translation = userTranslations[message.title].translation;
+ if ( userTranslations[ message.title ] ) {
+ message.translation = userTranslations[ message.title ].translation;
message.properties.status = 'translated';
}
@@ -200,7 +200,7 @@
} );
}
- $( 'document' ).ready( function () {
+ $( function () {
var $messageTable = $( '.tux-messagelist' ),
$ulsTrigger = $( '.ext-translate-language-selector > .uls' );
@@ -212,6 +212,7 @@
} );
$ulsTrigger.uls( {
+ ulsPurpose: 'translate-special-translationstash',
onSelect: function ( language ) {
var direction = $.uls.data.getDir( language ),
autonym = $.uls.data.getAutonym( language );
@@ -236,12 +237,12 @@
// Get the user translations if any(possibly from an early attempt)
// and new messages to try.
translationStashStorage.getUserTranslations()
- .done( function( translations ) {
+ .done( function ( translations ) {
if ( translations.translationstash.translations ) {
$.each( translations.translationstash.translations,
function ( index, translation ) {
- userTranslations[translation.title] = translation;
- } );
+ userTranslations[ translation.title ] = translation;
+ } );
}
loadMessages();
} );
diff --git a/MLEB/Translate/resources/js/ext.translate.special.translationstats.js b/MLEB/Translate/resources/js/ext.translate.special.translationstats.js
index 69870391..d935619b 100644
--- a/MLEB/Translate/resources/js/ext.translate.special.translationstats.js
+++ b/MLEB/Translate/resources/js/ext.translate.special.translationstats.js
@@ -1,36 +1,61 @@
-/**
+/*!
* JavaScript functions for embedding jQuery controls
* into translation notification form.
*
* @author Amir E. Aharoni
* @author Siebrand Mazeland
+ * @author Niklas Laxström
* @copyright Copyright © 2012-2013 Amir E. Aharoni, Siebrand Mazeland
- * @license GPL-2.0+
+ * @license GPL-2.0-or-later
*/
-jQuery( document ).ready( function ( $ ) {
+( function ( $, mw ) {
'use strict';
- // Based on UploadWizard, TranslationNotifications
- $( '#start' )
- .datepicker( {
- dateFormat: 'yymmdd',
- constrainInput: false,
- showOn: 'focus',
- changeMonth: true,
- changeYear: true,
- showAnim: false,
- showButtonPanel: true,
- maxDate: new Date(),
- onClose: function ( dateText, inst ) {
- // TranslationStats works with the yyyymmddhhmmss format,
- // so zeros that represents generic hh:mm:ss must be added.
- // The zeros are added only if a date was actually selected
- // and is not currently displayed.
- if ( dateText !== '' && inst.input.val().length < 14 ) {
- inst.input.val( dateText + '000000' );
+ $( function () {
+ var $input = $( '#start' ),
+ datepicker = mw.loader.getState( 'mediawiki.widgets.datetime' ) === null;
+
+ // Remove when MediaWiki 1.27 is no longer supported
+ if ( datepicker ) {
+ mw.loader.using( 'jquery.ui.datepicker' ).done( function () {
+ $input.datepicker( {
+ dateFormat: 'yy-mm-ddT00:00:00',
+ constrainInput: false,
+ showOn: 'focus',
+ changeMonth: true,
+ changeYear: true,
+ showAnim: false,
+ showButtonPanel: true,
+ maxDate: new Date()
+ } ).attr( 'autocomplete', 'off' );
+ } );
+ } else {
+ mw.loader.using( 'mediawiki.widgets.datetime' ).done( function () {
+ var widget, defaultValue, defaultDate;
+
+ defaultDate = new Date();
+ defaultDate.setDate( 1 );
+
+ if ( $input.val() ) {
+ defaultValue = new Date( $input.val() );
}
- }
- } )
- .attr( 'autocomplete', 'off' );
-} );
+
+ widget = new mw.widgets.datetime.DateTimeInputWidget( {
+ formatter: {
+ format: '${year|0}-${month|0}-${day|0}',
+ defaultDate: defaultDate
+ },
+ type: 'date',
+ value: defaultValue,
+ max: new Date()
+ } );
+
+ $input.after( widget.$element ).hide();
+ widget.on( 'change', function ( data ) {
+ $input.val( data + 'T00:00:00' );
+ } );
+ } );
+ }
+ } );
+}( jQuery, mediaWiki ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.statsbar.js b/MLEB/Translate/resources/js/ext.translate.statsbar.js
index 8f14c00a..ea193209 100644
--- a/MLEB/Translate/resources/js/ext.translate.statsbar.js
+++ b/MLEB/Translate/resources/js/ext.translate.statsbar.js
@@ -1,8 +1,9 @@
-/**
+/*!
* Translate language statistics bar - jQuery plugin.
+ *
* @author Niklas Laxström
* @author Santhosh Thottingal
- * @license GPL-2.0+
+ * @license GPL-2.0-or-later
* @since 2012-11-30
*/
@@ -17,24 +18,22 @@
( function ( mw, $ ) {
'use strict';
- // Use mw.translate namespace for storing the language statistics.
- mw.translate = mw.translate || {};
-
var LanguageStatsBar = function ( container, options ) {
this.$container = $( container );
this.group = options.group;
this.language = options.language;
this.$statsBar = null;
+ this.elements = null;
this.init();
};
LanguageStatsBar.prototype = {
init: function () {
- if ( mw.translate.languagestats[this.language] ) {
+ if ( mw.translate.languagestats[ this.language ] ) {
this.render();
} else {
mw.translate.loadLanguageStats( this.language )
- .done( $.proxy( this.render, this ) );
+ .done( this.render.bind( this ) );
}
},
@@ -44,29 +43,31 @@
listen: function () {
var i,
statsbar = this,
- languageStats = mw.translate.languagestats[this.language];
+ languageStats = mw.translate.languagestats[ this.language ];
statsbar.$statsBar.on( 'change', function ( event, to, from ) {
for ( i = 0; i < languageStats.length; i++ ) {
- if ( languageStats[i].group === statsbar.group ) {
- if ( to === 'translated' && from === 'untranslated' ) {
- languageStats[i].translated++;
+ if ( languageStats[ i ].group === statsbar.group ) {
+ // Changing a proofread message does not create a new translation
+ if ( to === 'translated' && from !== 'proofread' ) {
+ languageStats[ i ].translated++;
}
if ( to === 'proofread' ) {
- languageStats[i].proofread++;
+ languageStats[ i ].proofread++;
}
if ( to === 'fuzzy' ) {
- languageStats[i].fuzzy++;
+ languageStats[ i ].fuzzy++;
}
if ( from === 'fuzzy' ) {
- languageStats[i].fuzzy--;
+ languageStats[ i ].fuzzy--;
}
if ( from === 'proofread' ) {
- languageStats[i].proofread--;
+ languageStats[ i ].proofread--;
}
- if ( from === 'translated' ) {
- languageStats[i].translated--;
+ // Proofreading a message does not remove translation
+ if ( from === 'translated' && to !== 'proofread' ) {
+ languageStats[ i ].translated--;
}
break;
}
@@ -76,10 +77,13 @@
statsbar.update();
} );
- statsbar.$container.hover( function () {
- statsbar.$statsBar.find( '.tux-statsbar-info' ).removeClass( 'hide' );
- }, function () {
- statsbar.$statsBar.find( '.tux-statsbar-info' ).addClass( 'hide' );
+ statsbar.$container.on( {
+ mouseenter: function () {
+ statsbar.elements.$info.removeClass( 'hide' );
+ },
+ mouseleave: function () {
+ statsbar.elements.$info.addClass( 'hide' );
+ }
} );
},
@@ -88,26 +92,32 @@
.addClass( 'tux-statsbar' )
.data( 'group', this.group );
- this.$statsBar.append(
- $( '<span>' ).addClass( 'tux-proofread' ),
- $( '<span>' ).addClass( 'tux-translated' ),
- $( '<span>' ).addClass( 'tux-fuzzy' ),
- $( '<span>' ).addClass( 'tux-untranslated' ),
- $( '<div>' ).addClass( 'tux-statsbar-info hide' )
- );
+ this.elements = {
+ $proofread: $( '<span>' ).addClass( 'tux-proofread' ),
+ $translated: $( '<span>' ).addClass( 'tux-translated' ),
+ $fuzzy: $( '<span>' ).addClass( 'tux-fuzzy' ),
+ $untranslated: $( '<span>' ).addClass( 'tux-untranslated' ),
+ $info: $( '<div>' ).addClass( 'tux-statsbar-info hide' )
+ };
- this.$container.append( this.$statsBar );
this.update();
+ this.$statsBar.append( [
+ // Append needs an array instead of an object
+ this.elements.$proofread,
+ this.elements.$translated,
+ this.elements.$fuzzy,
+ this.elements.$untranslated,
+ this.elements.$info
+ ] );
+ this.$container.append( this.$statsBar );
this.listen();
},
update: function () {
- var proofread, translated, fuzzy, untranslated, untranslatedCount,
+ var proofread, translated, fuzzy, untranslated,
stats = this.getStatsForGroup( this.group );
- this.$statsBar.data( 'total', stats.total );
-
proofread = 100 * stats.proofread / stats.total;
// Proofread messages are also translated, so remove those for
// the bar showing only translated count.
@@ -115,32 +125,22 @@
translated = 100 * translated / stats.total;
fuzzy = 100 * stats.fuzzy / stats.total;
untranslated = 100 - proofread - translated - fuzzy;
- // Again, proofread counts are subset of translated counts
- untranslatedCount = stats.total - stats.translated - stats.fuzzy;
-
- this.$statsBar.find( '.tux-proofread' )
- .data( 'proofread', stats.proofread )
- .css( 'width', proofread + '%' );
- this.$statsBar.find( '.tux-translated' )
- .data( 'translated', stats.translated )
- .css( 'width', translated + '%' );
- this.$statsBar.find( '.tux-fuzzy' )
- .data( 'fuzzy', stats.fuzzy )
- .css( 'width', fuzzy + '%' );
- this.$statsBar.find( '.tux-untranslated' )
- .data( 'untranslated', untranslatedCount )
- .css( 'width', untranslated + '%' );
+
+ this.elements.$proofread[ 0 ].style.width = proofread + '%';
+ this.elements.$translated[ 0 ].style.width = translated + '%';
+ this.elements.$fuzzy[ 0 ].style.width = fuzzy + '%';
+ this.elements.$untranslated[ 0 ].style.width = untranslated + '%';
translated = !translated ? 0 : translated + proofread;
proofread = !proofread ? 0 : proofread;
if ( fuzzy ) {
- this.$statsBar.find( '.tux-statsbar-info' )
+ this.elements.$info
.text( mw.msg( 'translate-statsbar-tooltip-with-fuzzy',
translated.toFixed(), proofread.toFixed(),
fuzzy.toFixed() ) );
} else {
- this.$statsBar.find( '.tux-statsbar-info' )
+ this.elements.$info
.text( mw.msg( 'translate-statsbar-tooltip',
translated.toFixed(), proofread.toFixed() ) );
}
@@ -148,11 +148,11 @@
getStatsForGroup: function ( group ) {
var i,
- languageStats = mw.translate.languagestats[this.language];
+ languageStats = mw.translate.languagestats[ this.language ];
for ( i = 0; i < languageStats.length; i++ ) {
- if ( languageStats[i].group === group ) {
- return languageStats[i];
+ if ( languageStats[ i ].group === group ) {
+ return languageStats[ i ];
}
}
@@ -183,4 +183,5 @@
$.fn.languagestatsbar.Constructor = LanguageStatsBar;
mw.translate = mw.translate || {};
-} ( mediaWiki, jQuery ) );
+
+}( mediaWiki, jQuery ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.storage.js b/MLEB/Translate/resources/js/ext.translate.storage.js
index 698eb669..c17e8e26 100644
--- a/MLEB/Translate/resources/js/ext.translate.storage.js
+++ b/MLEB/Translate/resources/js/ext.translate.storage.js
@@ -1,11 +1,10 @@
( function ( mw ) {
'use strict';
- mw.translate = mw.translate || {};
-
/**
* This class can save a translation into MediaWiki pages using the
* MediaWiki edit WebApi.
+ *
* @since 2013.10
*/
var TranslationApiStorage = function () {
@@ -14,17 +13,22 @@
TranslationApiStorage.prototype = {
/**
- * Save the translation
+ * Save the translation.
+ *
* @param {string} title The title of the page including language code
* to store the translation.
* @param {string} translation The translation of the message
+ * @param {string} editSummary The edit summary
* @return {jQuery.Promise}
*/
- save: function ( title, translation ) {
- return (new mw.Api()).postWithToken( 'edit', {
+ save: function ( title, translation, editSummary ) {
+ var api = new mw.Api();
+
+ return api.postWithToken( 'csrf', {
action: 'edit',
title: title,
text: translation,
+ summary: editSummary,
// If the session expires, fail the saving instead of saving it
// as an anonymous user (if anonymous can save).
// When undefined, the parameter is not included in the request
@@ -33,5 +37,6 @@
}
};
+ mw.translate = mw.translate || {};
mw.translate.TranslationApiStorage = TranslationApiStorage;
}( mediaWiki ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.translationstashstorage.js b/MLEB/Translate/resources/js/ext.translate.translationstashstorage.js
index fb24b36d..39eb506f 100644
--- a/MLEB/Translate/resources/js/ext.translate.translationstashstorage.js
+++ b/MLEB/Translate/resources/js/ext.translate.translationstashstorage.js
@@ -1,10 +1,9 @@
( function ( $, mw ) {
'use strict';
- mw.translate = mw.translate || {};
-
/**
- * This class can save translation to translation stash
+ * This class can save translation to translation stash.
+ *
* @since 2013.10
*/
var TranslationStashStorage = function () {
@@ -13,39 +12,46 @@
TranslationStashStorage.prototype = {
/**
- * Save the translation
+ * Save the translation.
+ *
* @param {string} title The title of the page including language code
* to store the translation.
* @param {string} translation The translation of the message
* @return {jQuery.Promise}
*/
save: function ( title, translation ) {
- var deferred = new mw.Api().postWithToken( 'translationstash', {
+ var api = new mw.Api();
+
+ return api.postWithToken( 'csrf', {
action: 'translationstash',
subaction: 'add',
title: title,
translation: translation
+ } ).then( function () {
+ // Fake normal save API
+ return { edit: { result: 'Success' } };
} );
-
- return deferred.promise();
},
/**
- * Get the current users translations
+ * Get the current users translations.
+ *
+ * @param {string} user User name
* @return {jQuery.Promise}
*/
getUserTranslations: function ( user ) {
- var deferred = new mw.Api().postWithToken( 'translationstash', {
+ var api = new mw.Api();
+
+ return api.postWithToken( 'csrf', {
action: 'translationstash',
subaction: 'query',
username: user
- } );
-
- return deferred.promise();
+ } ).promise();
}
};
+ mw.translate = mw.translate || {};
mw.translate.TranslationStashStorage = TranslationStashStorage;
}( jQuery, mediaWiki ) );
diff --git a/MLEB/Translate/resources/js/ext.translate.workflowselector.js b/MLEB/Translate/resources/js/ext.translate.workflowselector.js
index 4ddd555c..0bb4621d 100644
--- a/MLEB/Translate/resources/js/ext.translate.workflowselector.js
+++ b/MLEB/Translate/resources/js/ext.translate.workflowselector.js
@@ -1,9 +1,9 @@
-/*
+/*!
* A jQuery plugin which handles the display and change of message group
* workflow sates.
*
* @author Niklas Laxström
- * @license GPL-2.0+
+ * @license GPL-2.0-or-later
*/
( function ( $, mw ) {
@@ -25,12 +25,14 @@
WorkflowSelector.prototype = {
/**
* Displays the current state and selector if relevant.
- * @param {String} groupId
- * @param {String} language
- * @param {String} state
+ *
+ * @param {string} groupId
+ * @param {string} language
+ * @param {string} state
*/
receiveState: function ( groupId, language, state ) {
var instance = this;
+
instance.currentState = state;
instance.language = language;
@@ -51,29 +53,29 @@
/**
* Calls the WebApi to change the state to a new value.
- * @param {String} state
+ *
+ * @param {string} state
* @return {jQuery.Promise}
*/
changeState: function ( state ) {
- var token, params,
+ var params,
api = new mw.Api();
params = {
action: 'groupreview',
group: this.groupId,
language: this.language,
- state: state,
- format: 'json'
+ state: state
};
- token = mw.config.get( 'wgTranslateSupportsCsrfToken' ) ? 'csrf' : 'groupreview';
- return api.postWithToken( token, params );
+ return api.postWithToken( 'csrf', params );
},
/**
* Get the text which says that the current state is X.
- * @param {String} stateName
- * @return {String} Text which should be escaped.
+ *
+ * @param {string} stateName
+ * @return {string} Text which should be escaped.
*/
getStateDisplay: function ( stateName ) {
return mw.msg( 'translate-workflowstatus', stateName );
@@ -110,16 +112,17 @@
$state = $( '<li>' )
.data( 'state', data )
- .text( data._name );
+ .text( data.name );
- if ( data._canchange && id !== instance.currentState ) {
+ if ( data.canchange && id !== instance.currentState ) {
$state.addClass( 'changeable' );
} else {
$state.addClass( 'unchangeable' );
}
if ( id === instance.currentState ) {
- $display.text( instance.getStateDisplay( data._name ) );
+ $display.text( instance.getStateDisplay( data.name ) );
+ $display.append( $( '<span>' ).addClass( 'tux-workflow-status-triangle' ) );
$state.addClass( 'selected' );
}
@@ -127,17 +130,20 @@
} );
$list.find( '.changeable' ).click( function () {
- var $this = $( this ), state;
+ var state,
+ $this = $( this );
state = $this.data( 'state' ).id;
$display.text( mw.msg( 'translate-workflow-set-doing' ) );
+ $display.append( $( '<span>' ).addClass( 'tux-workflow-status-triangle' ) );
instance.changeState( state )
.done( function () {
instance.receiveState( instance.groupId, instance.language, state );
} )
.fail( function () {
- window.alert( 'Change of state failed' );
+ // eslint-disable-next-line no-alert
+ alert( 'Change of state failed' );
} );
} );
instance.$container.append( $display, $list );
diff --git a/MLEB/Translate/resources/js/jquery.ajaxdispatcher.js b/MLEB/Translate/resources/js/jquery.ajaxdispatcher.js
index a49a1580..9f45697c 100644
--- a/MLEB/Translate/resources/js/jquery.ajaxdispatcher.js
+++ b/MLEB/Translate/resources/js/jquery.ajaxdispatcher.js
@@ -4,18 +4,22 @@
/**
* Call list of callbacks returning promises in serial order and returns a list of promises.
*
- * @author Niklas Laxström, 2014
+ * @author Niklas Laxström
*
* @param {callable[]} list List of callbacks returning promises.
+ * @param {number} maxRetries Maximum number of times a failed promise is retried.
* @return {jQuery.Promise}
*/
function ajaxDispatcher( list, maxRetries ) {
+ var deferred = $.Deferred();
+
maxRetries = maxRetries || 0;
- var deferred = $.Deferred();
return $.when( helper( list, maxRetries ) )
.then( function ( promises ) {
return deferred.resolve( promises );
+ } ).fail( function ( errmsg ) {
+ return deferred.reject( errmsg );
} );
}
@@ -28,12 +32,14 @@
return deferred;
}
- first = list.slice( 0, 1 )[0];
+ first = list.slice( 0, 1 )[ 0 ];
rest = list.slice( 1 );
retries = 0;
- retrier = function () {
- var promise = this;
+ retrier = function ( result, promise ) {
+ if ( !promise.state ) {
+ return;
+ }
if ( promise.state() === 'rejected' ) {
if ( retries < maxRetries ) {
@@ -49,7 +55,9 @@
}
};
- first.call().always( retrier );
+ first.call().always( retrier ).catch( function ( errmsg ) {
+ return deferred.reject( errmsg );
+ } );
return deferred;
}
diff --git a/MLEB/Translate/resources/js/jquery.autosize.js b/MLEB/Translate/resources/js/jquery.autosize.js
index b2264beb..62873057 100644
--- a/MLEB/Translate/resources/js/jquery.autosize.js
+++ b/MLEB/Translate/resources/js/jquery.autosize.js
@@ -1,243 +1,254 @@
/*!
- Autosize v1.17.2 - 2013-07-30
- Automatically adjust textarea height based on user input.
- (c) 2013 Jack Moore - http://www.jacklmoore.com/autosize
- license: http://www.opensource.org/licenses/mit-license.php
- https://raw.github.com/jackmoore/autosize/1.17.2/jquery.autosize.js
+ Autosize 3.0.15
+ license: MIT
+ http://www.jacklmoore.com/autosize
*/
-(function (factory) {
+(function (global, factory) {
if (typeof define === 'function' && define.amd) {
- // AMD. Register as an anonymous module.
- define(['jquery'], factory);
+ define(['exports', 'module'], factory);
+ } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {
+ factory(exports, module);
} else {
- // Browser globals: jQuery or jQuery-like library, such as Zepto
- factory(window.jQuery || window.$);
+ var mod = {
+ exports: {}
+ };
+ factory(mod.exports, mod);
+ global.autosize = mod.exports;
}
-}(function ($) {
- var
- defaults = {
- className: 'autosizejs',
- append: '',
- callback: false,
- resizeDelay: 10
- },
-
- // border:0 is unnecessary, but avoids a bug in FireFox on OSX
- copy = '<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none; -webkit-transition:none; -moz-transition:none;"/>',
-
- // line-height is conditionally included because IE7/IE8/old Opera do not return the correct value.
- typographyStyles = [
- 'fontFamily',
- 'fontSize',
- 'fontWeight',
- 'fontStyle',
- 'letterSpacing',
- 'textTransform',
- 'wordSpacing',
- 'textIndent'
- ],
-
- // to keep track which textarea is being mirrored when adjust() is called.
- mirrored,
-
- // the mirror element, which is used to calculate what size the mirrored element should be.
- mirror = $(copy).data('autosize', true)[0];
-
- // test that line-height can be accurately copied.
- mirror.style.lineHeight = '99px';
- if ($(mirror).css('lineHeight') === '99px') {
- typographyStyles.push('lineHeight');
+})(this, function (exports, module) {
+ 'use strict';
+
+ var set = typeof Set === 'function' ? new Set() : (function () {
+ var list = [];
+
+ return {
+ has: function has(key) {
+ return Boolean(list.indexOf(key) > -1);
+ },
+ add: function add(key) {
+ list.push(key);
+ },
+ 'delete': function _delete(key) {
+ list.splice(list.indexOf(key), 1);
+ } };
+ })();
+
+ var createEvent = function createEvent(name) {
+ return new Event(name);
+ };
+ try {
+ new Event('test');
+ } catch (e) {
+ // IE does not support `new Event()`
+ createEvent = function (name) {
+ var evt = document.createEvent('Event');
+ evt.initEvent(name, true, false);
+ return evt;
+ };
}
- mirror.style.lineHeight = '';
- $.fn.autosize = function (options) {
- options = $.extend({}, defaults, options || {});
+ function assign(ta) {
+ var _ref = arguments[1] === undefined ? {} : arguments[1];
- if (mirror.parentNode !== document.body) {
- $(document.body).append(mirror);
- }
+ var _ref$setOverflowX = _ref.setOverflowX;
+ var setOverflowX = _ref$setOverflowX === undefined ? true : _ref$setOverflowX;
+ var _ref$setOverflowY = _ref.setOverflowY;
+ var setOverflowY = _ref$setOverflowY === undefined ? true : _ref$setOverflowY;
- return this.each(function () {
- var
- ta = this,
- $ta = $(ta),
- maxHeight,
- minHeight,
- boxOffset = 0,
- callback = $.isFunction(options.callback),
- originalStyles = {
- height: ta.style.height,
- overflow: ta.style.overflow,
- overflowY: ta.style.overflowY,
- wordWrap: ta.style.wordWrap,
- resize: ta.style.resize
- },
- timeout,
- width = $ta.width();
-
- if ($ta.data('autosize')) {
- // exit if autosize has already been applied, or if the textarea is the mirror element.
- return;
- }
- $ta.data('autosize', true);
+ if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || set.has(ta)) return;
+
+ var heightOffset = null;
+ var overflowY = null;
+ var clientWidth = ta.clientWidth;
+
+ function init() {
+ var style = window.getComputedStyle(ta, null);
- if ($ta.css('box-sizing') === 'border-box' || $ta.css('-moz-box-sizing') === 'border-box' || $ta.css('-webkit-box-sizing') === 'border-box'){
- boxOffset = $ta.outerHeight() - $ta.height();
+ overflowY = style.overflowY;
+
+ if (style.resize === 'vertical') {
+ ta.style.resize = 'none';
+ } else if (style.resize === 'both') {
+ ta.style.resize = 'horizontal';
}
- // IE8 and lower return 'auto', which parses to NaN, if no min-height is set.
- minHeight = Math.max(parseInt($ta.css('minHeight'), 10) - boxOffset || 0, $ta.height());
+ if (style.boxSizing === 'content-box') {
+ heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));
+ } else {
+ heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);
+ }
+ // Fix when a textarea is not on document body and heightOffset is Not a Number
+ if (isNaN(heightOffset)) {
+ heightOffset = 0;
+ }
- $ta.css({
- overflow: 'hidden',
- overflowY: 'hidden',
- wordWrap: 'break-word', // horizontal overflow is hidden, so break-word is necessary for handling words longer than the textarea width
- resize: ($ta.css('resize') === 'none' || $ta.css('resize') === 'vertical') ? 'none' : 'horizontal'
- });
+ update();
+ }
- function initMirror() {
- var styles = {}, ignore;
+ function changeOverflow(value) {
+ {
+ // Chrome/Safari-specific fix:
+ // When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space
+ // made available by removing the scrollbar. The following forces the necessary text reflow.
+ var width = ta.style.width;
+ ta.style.width = '0px';
+ // Force reflow:
+ /* jshint ignore:start */
+ ta.offsetWidth;
+ /* jshint ignore:end */
+ ta.style.width = width;
+ }
- mirrored = ta;
- mirror.className = options.className;
- maxHeight = parseInt($ta.css('maxHeight'), 10);
+ overflowY = value;
- // mirror is a duplicate textarea located off-screen that
- // is automatically updated to contain the same text as the
- // original textarea. mirror always has a height of 0.
- // This gives a cross-browser supported way getting the actual
- // height of the text, through the scrollTop property.
- $.each(typographyStyles, function(i,val){
- styles[val] = $ta.css(val);
- });
- $(mirror).css(styles);
-
- // The textarea overflow is probably now hidden, but Chrome doesn't reflow the text to account for the
- // new space made available by removing the scrollbars. This workaround causes Chrome to reflow the text.
- if ('oninput' in ta) {
- var width = ta.style.width;
- ta.style.width = '0px';
- ignore = ta.offsetWidth; // This value isn't used, but getting it triggers the necessary reflow
- ta.style.width = width;
- }
+ if (setOverflowY) {
+ ta.style.overflowY = value;
}
- // Using mainly bare JS in this function because it is going
- // to fire very often while typing, and needs to very efficient.
- function adjust() {
- var height, original, width, style;
+ resize();
+ }
- if (mirrored !== ta) {
- initMirror();
- }
+ function resize() {
+ var htmlTop = window.pageYOffset;
+ var bodyTop = document.body.scrollTop;
+ var originalHeight = ta.style.height;
- mirror.value = ta.value + options.append;
- mirror.style.overflowY = ta.style.overflowY;
- original = parseInt(ta.style.height,10);
+ ta.style.height = 'auto';
- // window.getComputedStyle, getBoundingClientRect returning a width are unsupported in IE8 and lower.
- // The mirror width must exactly match the textarea width, so using getBoundingClientRect because it doesn't round the sub-pixel value.
- if ('getComputedStyle' in window) {
- style = window.getComputedStyle(ta);
- width = ta.getBoundingClientRect().width;
+ var endHeight = ta.scrollHeight + heightOffset;
- $.each(['paddingLeft', 'paddingRight', 'borderLeftWidth', 'borderRightWidth'], function(i,val){
- width -= parseInt(style[val],10);
- });
+ if (ta.scrollHeight === 0) {
+ // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM.
+ ta.style.height = originalHeight;
+ return;
+ }
- mirror.style.width = width + 'px';
- }
- else {
- mirror.style.width = Math.max($ta.width(), 0) + 'px';
- }
+ ta.style.height = endHeight + 'px';
- // Needed for IE8 and lower to reliably return the correct scrollTop
- mirror.scrollTop = 0;
+ // used to check if an update is actually necessary on window.resize
+ clientWidth = ta.clientWidth;
- mirror.scrollTop = 9e4;
+ // prevents scroll-position jumping
+ document.documentElement.scrollTop = htmlTop;
+ document.body.scrollTop = bodyTop;
+ }
- // Using scrollTop rather than scrollHeight because scrollHeight is non-standard and includes padding.
- height = mirror.scrollTop;
+ function update() {
+ var startHeight = ta.style.height;
- if (maxHeight && height > maxHeight) {
- ta.style.overflowY = 'scroll';
- height = maxHeight;
- } else {
- ta.style.overflowY = 'hidden';
- if (height < minHeight) {
- height = minHeight;
- }
- }
+ resize();
- height += boxOffset;
+ var style = window.getComputedStyle(ta, null);
- if (original !== height) {
- ta.style.height = height + 'px';
- if (callback) {
- options.callback.call(ta,ta);
- }
+ if (style.height !== ta.style.height) {
+ if (overflowY !== 'visible') {
+ changeOverflow('visible');
+ }
+ } else {
+ if (overflowY !== 'hidden') {
+ changeOverflow('hidden');
}
}
- function resize () {
- clearTimeout(timeout);
- timeout = setTimeout(function(){
- if ($ta.width() !== width) {
- adjust();
- }
- }, parseInt(options.resizeDelay,10));
+ if (startHeight !== ta.style.height) {
+ var evt = createEvent('autosize:resized');
+ ta.dispatchEvent(evt);
}
+ }
- if ('onpropertychange' in ta) {
- if ('oninput' in ta) {
- // Detects IE9. IE9 does not fire onpropertychange or oninput for deletions,
- // so binding to onkeyup to catch most of those occasions. There is no way that I
- // know of to detect something like 'cut' in IE9.
- $ta.on('input.autosize keyup.autosize', adjust);
- } else {
- // IE7 / IE8
- $ta.on('propertychange.autosize', function(){
- if(event.propertyName === 'value'){
- adjust();
- }
- });
- }
- } else {
- // Modern Browsers
- $ta.on('input.autosize', adjust);
+ var pageResize = function pageResize() {
+ if (ta.clientWidth !== clientWidth) {
+ update();
}
+ };
+
+ var destroy = (function (style) {
+ window.removeEventListener('resize', pageResize, false);
+ ta.removeEventListener('input', update, false);
+ ta.removeEventListener('keyup', update, false);
+ ta.removeEventListener('autosize:destroy', destroy, false);
+ ta.removeEventListener('autosize:update', update, false);
+ set['delete'](ta);
+
+ Object.keys(style).forEach(function (key) {
+ ta.style[key] = style[key];
+ });
+ }).bind(ta, {
+ height: ta.style.height,
+ resize: ta.style.resize,
+ overflowY: ta.style.overflowY,
+ overflowX: ta.style.overflowX,
+ wordWrap: ta.style.wordWrap });
+
+ ta.addEventListener('autosize:destroy', destroy, false);
+
+ // IE9 does not fire onpropertychange or oninput for deletions,
+ // so binding to onkeyup to catch most of those events.
+ // There is no way that I know of to detect something like 'cut' in IE9.
+ if ('onpropertychange' in ta && 'oninput' in ta) {
+ ta.addEventListener('keyup', update, false);
+ }
- // Set options.resizeDelay to false if using fixed-width textarea elements.
- // Uses a timeout and width check to reduce the amount of times adjust needs to be called after window resize.
+ window.addEventListener('resize', pageResize, false);
+ ta.addEventListener('input', update, false);
+ ta.addEventListener('autosize:update', update, false);
+ set.add(ta);
- if (options.resizeDelay !== false) {
- $(window).on('resize.autosize', resize);
- }
+ if (setOverflowX) {
+ ta.style.overflowX = 'hidden';
+ ta.style.wordWrap = 'break-word';
+ }
- // Event for manual triggering if needed.
- // Should only be needed when the value of the textarea is changed through JavaScript rather than user input.
- $ta.on('autosize.resize', adjust);
+ init();
+ }
- // Event for manual triggering that also forces the styles to update as well.
- // Should only be needed if one of typography styles of the textarea change, and the textarea is already the target of the adjust method.
- $ta.on('autosize.resizeIncludeStyle', function() {
- mirrored = null;
- adjust();
- });
+ function destroy(ta) {
+ if (!(ta && ta.nodeName && ta.nodeName === 'TEXTAREA')) return;
+ var evt = createEvent('autosize:destroy');
+ ta.dispatchEvent(evt);
+ }
- $ta.on('autosize.destroy', function(){
- mirrored = null;
- clearTimeout(timeout);
- $(window).off('resize', resize);
- $ta
- .off('autosize')
- .off('.autosize')
- .css(originalStyles)
- .removeData('autosize');
- });
+ function update(ta) {
+ if (!(ta && ta.nodeName && ta.nodeName === 'TEXTAREA')) return;
+ var evt = createEvent('autosize:update');
+ ta.dispatchEvent(evt);
+ }
- // Call adjust in case the textarea already contains text.
- adjust();
- });
- };
-}));
+ var autosize = null;
+
+ // Do nothing in Node.js environment and IE8 (or lower)
+ if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {
+ autosize = function (el) {
+ return el;
+ };
+ autosize.destroy = function (el) {
+ return el;
+ };
+ autosize.update = function (el) {
+ return el;
+ };
+ } else {
+ autosize = function (el, options) {
+ if (el) {
+ Array.prototype.forEach.call(el.length ? el : [el], function (x) {
+ return assign(x, options);
+ });
+ }
+ return el;
+ };
+ autosize.destroy = function (el) {
+ if (el) {
+ Array.prototype.forEach.call(el.length ? el : [el], destroy);
+ }
+ return el;
+ };
+ autosize.update = function (el) {
+ if (el) {
+ Array.prototype.forEach.call(el.length ? el : [el], update);
+ }
+ return el;
+ };
+ }
+
+ module.exports = autosize;
+});
diff --git a/MLEB/Translate/resources/js/jquery.textchange.js b/MLEB/Translate/resources/js/jquery.textchange.js
index 6fdeec87..5f145f02 100644
--- a/MLEB/Translate/resources/js/jquery.textchange.js
+++ b/MLEB/Translate/resources/js/jquery.textchange.js
@@ -1,6 +1,7 @@
-/*
+/*!
* Trigger a textchange event on text change in input fields.
- * And make it cross browser compatible
+ * And make it cross browser compatible.
+ *
* @author Santhosh Thottingal, 2013
* @see https://gist.github.com/mkelly12/424774
*/
@@ -17,7 +18,7 @@
},
teardown: function () {
- $( this ).unbind( '.textchange' );
+ $( this ).off( '.textchange' );
},
handler: function () {
@@ -40,4 +41,4 @@
}
};
-} )( jQuery );
+}( jQuery ) );
diff --git a/MLEB/Translate/resources/js/jquery.ui.position.js b/MLEB/Translate/resources/js/jquery.ui.position.js
deleted file mode 100644
index 1a88c353..00000000
--- a/MLEB/Translate/resources/js/jquery.ui.position.js
+++ /dev/null
@@ -1,498 +0,0 @@
-/*!
- * jQuery UI Position 1.10.3
- * http://jqueryui.com
- *
- * Copyright 2013 jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- *
- * http://api.jqueryui.com/position/
- * @codingStandardsIgnoreFile External lib.
- */
-(function( $, undefined ) {
-
-$.ui = $.ui || {};
-
-var cachedScrollbarWidth,
- max = Math.max,
- abs = Math.abs,
- round = Math.round,
- rhorizontal = /left|center|right/,
- rvertical = /top|center|bottom/,
- roffset = /[\+\-]\d+(\.[\d]+)?%?/,
- rposition = /^\w+/,
- rpercent = /%$/,
- _position = $.fn.position;
-
-function getOffsets( offsets, width, height ) {
- return [
- parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
- parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
- ];
-}
-
-function parseCss( element, property ) {
- return parseInt( $.css( element, property ), 10 ) || 0;
-}
-
-function getDimensions( elem ) {
- var raw = elem[0];
- if ( raw.nodeType === 9 ) {
- return {
- width: elem.width(),
- height: elem.height(),
- offset: { top: 0, left: 0 }
- };
- }
- if ( $.isWindow( raw ) ) {
- return {
- width: elem.width(),
- height: elem.height(),
- offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
- };
- }
- if ( raw.preventDefault ) {
- return {
- width: 0,
- height: 0,
- offset: { top: raw.pageY, left: raw.pageX }
- };
- }
- return {
- width: elem.outerWidth(),
- height: elem.outerHeight(),
- offset: elem.offset()
- };
-}
-
-$.position = {
- scrollbarWidth: function() {
- if ( cachedScrollbarWidth !== undefined ) {
- return cachedScrollbarWidth;
- }
- var w1, w2,
- div = $( "<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
- innerDiv = div.children()[0];
-
- $( "body" ).append( div );
- w1 = innerDiv.offsetWidth;
- div.css( "overflow", "scroll" );
-
- w2 = innerDiv.offsetWidth;
-
- if ( w1 === w2 ) {
- w2 = div[0].clientWidth;
- }
-
- div.remove();
-
- return (cachedScrollbarWidth = w1 - w2);
- },
- getScrollInfo: function( within ) {
- var overflowX = within.isWindow ? "" : within.element.css( "overflow-x" ),
- overflowY = within.isWindow ? "" : within.element.css( "overflow-y" ),
- hasOverflowX = overflowX === "scroll" ||
- ( overflowX === "auto" && within.width < within.element[0].scrollWidth ),
- hasOverflowY = overflowY === "scroll" ||
- ( overflowY === "auto" && within.height < within.element[0].scrollHeight );
- return {
- width: hasOverflowY ? $.position.scrollbarWidth() : 0,
- height: hasOverflowX ? $.position.scrollbarWidth() : 0
- };
- },
- getWithinInfo: function( element ) {
- var withinElement = $( element || window ),
- isWindow = $.isWindow( withinElement[0] );
- return {
- element: withinElement,
- isWindow: isWindow,
- offset: withinElement.offset() || { left: 0, top: 0 },
- scrollLeft: withinElement.scrollLeft(),
- scrollTop: withinElement.scrollTop(),
- width: isWindow ? withinElement.width() : withinElement.outerWidth(),
- height: isWindow ? withinElement.height() : withinElement.outerHeight()
- };
- }
-};
-
-$.fn.position = function( options ) {
- if ( !options || !options.of ) {
- return _position.apply( this, arguments );
- }
-
- // make a copy, we don't want to modify arguments
- options = $.extend( {}, options );
-
- var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
- target = $( options.of ),
- within = $.position.getWithinInfo( options.within ),
- scrollInfo = $.position.getScrollInfo( within ),
- collision = ( options.collision || "flip" ).split( " " ),
- offsets = {};
-
- dimensions = getDimensions( target );
- if ( target[0].preventDefault ) {
- // force left top to allow flipping
- options.at = "left top";
- }
- targetWidth = dimensions.width;
- targetHeight = dimensions.height;
- targetOffset = dimensions.offset;
- // clone to reuse original targetOffset later
- basePosition = $.extend( {}, targetOffset );
-
- // force my and at to have valid horizontal and vertical positions
- // if a value is missing or invalid, it will be converted to center
- $.each( [ "my", "at" ], function() {
- var pos = ( options[ this ] || "" ).split( " " ),
- horizontalOffset,
- verticalOffset;
-
- if ( pos.length === 1) {
- pos = rhorizontal.test( pos[ 0 ] ) ?
- pos.concat( [ "center" ] ) :
- rvertical.test( pos[ 0 ] ) ?
- [ "center" ].concat( pos ) :
- [ "center", "center" ];
- }
- pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
- pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
-
- // calculate offsets
- horizontalOffset = roffset.exec( pos[ 0 ] );
- verticalOffset = roffset.exec( pos[ 1 ] );
- offsets[ this ] = [
- horizontalOffset ? horizontalOffset[ 0 ] : 0,
- verticalOffset ? verticalOffset[ 0 ] : 0
- ];
-
- // reduce to just the positions without the offsets
- options[ this ] = [
- rposition.exec( pos[ 0 ] )[ 0 ],
- rposition.exec( pos[ 1 ] )[ 0 ]
- ];
- });
-
- // normalize collision option
- if ( collision.length === 1 ) {
- collision[ 1 ] = collision[ 0 ];
- }
-
- if ( options.at[ 0 ] === "right" ) {
- basePosition.left += targetWidth;
- } else if ( options.at[ 0 ] === "center" ) {
- basePosition.left += targetWidth / 2;
- }
-
- if ( options.at[ 1 ] === "bottom" ) {
- basePosition.top += targetHeight;
- } else if ( options.at[ 1 ] === "center" ) {
- basePosition.top += targetHeight / 2;
- }
-
- atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
- basePosition.left += atOffset[ 0 ];
- basePosition.top += atOffset[ 1 ];
-
- return this.each(function() {
- var collisionPosition, using,
- elem = $( this ),
- elemWidth = elem.outerWidth(),
- elemHeight = elem.outerHeight(),
- marginLeft = parseCss( this, "marginLeft" ),
- marginTop = parseCss( this, "marginTop" ),
- collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,
- collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,
- position = $.extend( {}, basePosition ),
- myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
-
- if ( options.my[ 0 ] === "right" ) {
- position.left -= elemWidth;
- } else if ( options.my[ 0 ] === "center" ) {
- position.left -= elemWidth / 2;
- }
-
- if ( options.my[ 1 ] === "bottom" ) {
- position.top -= elemHeight;
- } else if ( options.my[ 1 ] === "center" ) {
- position.top -= elemHeight / 2;
- }
-
- position.left += myOffset[ 0 ];
- position.top += myOffset[ 1 ];
-
- // if the browser doesn't support fractions, then round for consistent results
- if ( !$.support.offsetFractions ) {
- position.left = round( position.left );
- position.top = round( position.top );
- }
-
- collisionPosition = {
- marginLeft: marginLeft,
- marginTop: marginTop
- };
-
- $.each( [ "left", "top" ], function( i, dir ) {
- if ( $.ui.position[ collision[ i ] ] ) {
- $.ui.position[ collision[ i ] ][ dir ]( position, {
- targetWidth: targetWidth,
- targetHeight: targetHeight,
- elemWidth: elemWidth,
- elemHeight: elemHeight,
- collisionPosition: collisionPosition,
- collisionWidth: collisionWidth,
- collisionHeight: collisionHeight,
- offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
- my: options.my,
- at: options.at,
- within: within,
- elem : elem
- });
- }
- });
-
- if ( options.using ) {
- // adds feedback as second argument to using callback, if present
- using = function( props ) {
- var left = targetOffset.left - position.left,
- right = left + targetWidth - elemWidth,
- top = targetOffset.top - position.top,
- bottom = top + targetHeight - elemHeight,
- feedback = {
- target: {
- element: target,
- left: targetOffset.left,
- top: targetOffset.top,
- width: targetWidth,
- height: targetHeight
- },
- element: {
- element: elem,
- left: position.left,
- top: position.top,
- width: elemWidth,
- height: elemHeight
- },
- horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
- vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
- };
- if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
- feedback.horizontal = "center";
- }
- if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
- feedback.vertical = "middle";
- }
- if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
- feedback.important = "horizontal";
- } else {
- feedback.important = "vertical";
- }
- options.using.call( this, props, feedback );
- };
- }
-
- elem.offset( $.extend( position, { using: using } ) );
- });
-};
-
-$.ui.position = {
- fit: {
- left: function( position, data ) {
- var within = data.within,
- withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
- outerWidth = within.width,
- collisionPosLeft = position.left - data.collisionPosition.marginLeft,
- overLeft = withinOffset - collisionPosLeft,
- overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
- newOverRight;
-
- // element is wider than within
- if ( data.collisionWidth > outerWidth ) {
- // element is initially over the left side of within
- if ( overLeft > 0 && overRight <= 0 ) {
- newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
- position.left += overLeft - newOverRight;
- // element is initially over right side of within
- } else if ( overRight > 0 && overLeft <= 0 ) {
- position.left = withinOffset;
- // element is initially over both left and right sides of within
- } else {
- if ( overLeft > overRight ) {
- position.left = withinOffset + outerWidth - data.collisionWidth;
- } else {
- position.left = withinOffset;
- }
- }
- // too far left -> align with left edge
- } else if ( overLeft > 0 ) {
- position.left += overLeft;
- // too far right -> align with right edge
- } else if ( overRight > 0 ) {
- position.left -= overRight;
- // adjust based on position and margin
- } else {
- position.left = max( position.left - collisionPosLeft, position.left );
- }
- },
- top: function( position, data ) {
- var within = data.within,
- withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
- outerHeight = data.within.height,
- collisionPosTop = position.top - data.collisionPosition.marginTop,
- overTop = withinOffset - collisionPosTop,
- overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
- newOverBottom;
-
- // element is taller than within
- if ( data.collisionHeight > outerHeight ) {
- // element is initially over the top of within
- if ( overTop > 0 && overBottom <= 0 ) {
- newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
- position.top += overTop - newOverBottom;
- // element is initially over bottom of within
- } else if ( overBottom > 0 && overTop <= 0 ) {
- position.top = withinOffset;
- // element is initially over both top and bottom of within
- } else {
- if ( overTop > overBottom ) {
- position.top = withinOffset + outerHeight - data.collisionHeight;
- } else {
- position.top = withinOffset;
- }
- }
- // too far up -> align with top
- } else if ( overTop > 0 ) {
- position.top += overTop;
- // too far down -> align with bottom edge
- } else if ( overBottom > 0 ) {
- position.top -= overBottom;
- // adjust based on position and margin
- } else {
- position.top = max( position.top - collisionPosTop, position.top );
- }
- }
- },
- flip: {
- left: function( position, data ) {
- var within = data.within,
- withinOffset = within.offset.left + within.scrollLeft,
- outerWidth = within.width,
- offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
- collisionPosLeft = position.left - data.collisionPosition.marginLeft,
- overLeft = collisionPosLeft - offsetLeft,
- overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
- myOffset = data.my[ 0 ] === "left" ?
- -data.elemWidth :
- data.my[ 0 ] === "right" ?
- data.elemWidth :
- 0,
- atOffset = data.at[ 0 ] === "left" ?
- data.targetWidth :
- data.at[ 0 ] === "right" ?
- -data.targetWidth :
- 0,
- offset = -2 * data.offset[ 0 ],
- newOverRight,
- newOverLeft;
-
- if ( overLeft < 0 ) {
- newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
- if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
- position.left += myOffset + atOffset + offset;
- }
- }
- else if ( overRight > 0 ) {
- newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
- if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
- position.left += myOffset + atOffset + offset;
- }
- }
- },
- top: function( position, data ) {
- var within = data.within,
- withinOffset = within.offset.top + within.scrollTop,
- outerHeight = within.height,
- offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
- collisionPosTop = position.top - data.collisionPosition.marginTop,
- overTop = collisionPosTop - offsetTop,
- overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
- top = data.my[ 1 ] === "top",
- myOffset = top ?
- -data.elemHeight :
- data.my[ 1 ] === "bottom" ?
- data.elemHeight :
- 0,
- atOffset = data.at[ 1 ] === "top" ?
- data.targetHeight :
- data.at[ 1 ] === "bottom" ?
- -data.targetHeight :
- 0,
- offset = -2 * data.offset[ 1 ],
- newOverTop,
- newOverBottom;
- if ( overTop < 0 ) {
- newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
- if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) ) {
- position.top += myOffset + atOffset + offset;
- }
- }
- else if ( overBottom > 0 ) {
- newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
- if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) {
- position.top += myOffset + atOffset + offset;
- }
- }
- }
- },
- flipfit: {
- left: function() {
- $.ui.position.flip.left.apply( this, arguments );
- $.ui.position.fit.left.apply( this, arguments );
- },
- top: function() {
- $.ui.position.flip.top.apply( this, arguments );
- $.ui.position.fit.top.apply( this, arguments );
- }
- }
-};
-
-// fraction support test
-(function () {
- var testElement, testElementParent, testElementStyle, offsetLeft, i,
- body = document.getElementsByTagName( "body" )[ 0 ],
- div = document.createElement( "div" );
-
- //Create a "fake body" for testing based on method used in jQuery.support
- testElement = document.createElement( body ? "div" : "body" );
- testElementStyle = {
- visibility: "hidden",
- width: 0,
- height: 0,
- border: 0,
- margin: 0,
- background: "none"
- };
- if ( body ) {
- $.extend( testElementStyle, {
- position: "absolute",
- left: "-1000px",
- top: "-1000px"
- });
- }
- for ( i in testElementStyle ) {
- testElement.style[ i ] = testElementStyle[ i ];
- }
- testElement.appendChild( div );
- testElementParent = body || document.documentElement;
- testElementParent.insertBefore( testElement, testElementParent.firstChild );
-
- div.style.cssText = "position: absolute; left: 10.7432222px;";
-
- offsetLeft = $( div ).offset().left;
- $.support.offsetFractions = offsetLeft > 10 && offsetLeft < 11;
-
- testElement.innerHTML = "";
- testElementParent.removeChild( testElement );
-})();
-
-}( jQuery ) );