summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Evans <grknight@gentoo.org>2020-10-02 15:24:06 -0400
committerBrian Evans <grknight@gentoo.org>2020-10-02 15:24:06 -0400
commit60dd5fd95847643eab04ce173f0774c9c584e795 (patch)
tree52299ac4e3c5c69df75997bfd7d62b71ef9e0089 /MLEB/UniversalLanguageSelector/resources
parentUpdate Widgets to 1.35 (diff)
downloadextensions-60dd5fd95847643eab04ce173f0774c9c584e795.tar.gz
extensions-60dd5fd95847643eab04ce173f0774c9c584e795.tar.bz2
extensions-60dd5fd95847643eab04ce173f0774c9c584e795.zip
Update MLEB to 2020.07
Signed-off-by: Brian Evans <grknight@gentoo.org>
Diffstat (limited to 'MLEB/UniversalLanguageSelector/resources')
-rw-r--r--MLEB/UniversalLanguageSelector/resources/css/ext.uls-vector.less17
-rw-r--r--MLEB/UniversalLanguageSelector/resources/css/ext.uls.compactlinks.less2
-rw-r--r--MLEB/UniversalLanguageSelector/resources/css/ext.uls.dialog.less40
-rw-r--r--MLEB/UniversalLanguageSelector/resources/css/ext.uls.displaysettings.less2
-rw-r--r--MLEB/UniversalLanguageSelector/resources/css/ext.uls.inputsettings.less11
-rw-r--r--MLEB/UniversalLanguageSelector/resources/css/ext.uls.interface.less6
-rw-r--r--MLEB/UniversalLanguageSelector/resources/css/ext.uls.interlanguage.less3
-rw-r--r--MLEB/UniversalLanguageSelector/resources/css/ext.uls.languagesettings.less22
-rw-r--r--MLEB/UniversalLanguageSelector/resources/css/ext.uls.less6
-rw-r--r--MLEB/UniversalLanguageSelector/resources/css/ext.uls.pt-monobook.less4
-rw-r--r--MLEB/UniversalLanguageSelector/resources/css/ext.uls.pt.less43
-rw-r--r--MLEB/UniversalLanguageSelector/resources/css/ext.uls.setlang.less24
-rw-r--r--MLEB/UniversalLanguageSelector/resources/images/back-grey-ltr.pngbin629 -> 0 bytes
-rw-r--r--MLEB/UniversalLanguageSelector/resources/images/back-grey-rtl.pngbin405 -> 0 bytes
-rw-r--r--MLEB/UniversalLanguageSelector/resources/images/close.pngbin168 -> 0 bytes
-rw-r--r--MLEB/UniversalLanguageSelector/resources/images/cog-sprite.pngbin475 -> 0 bytes
-rw-r--r--MLEB/UniversalLanguageSelector/resources/images/cog.pngbin297 -> 0 bytes
-rw-r--r--MLEB/UniversalLanguageSelector/resources/images/compact-links-trigger.pngbin673 -> 0 bytes
-rw-r--r--MLEB/UniversalLanguageSelector/resources/images/display.pngbin348 -> 0 bytes
-rw-r--r--MLEB/UniversalLanguageSelector/resources/images/display.svg2
-rw-r--r--MLEB/UniversalLanguageSelector/resources/images/help.pngbin379 -> 0 bytes
-rw-r--r--MLEB/UniversalLanguageSelector/resources/images/help.svg2
-rw-r--r--MLEB/UniversalLanguageSelector/resources/images/input.pngbin562 -> 0 bytes
-rw-r--r--MLEB/UniversalLanguageSelector/resources/images/input.svg2
-rw-r--r--MLEB/UniversalLanguageSelector/resources/images/remove-input.pngbin373 -> 0 bytes
-rw-r--r--MLEB/UniversalLanguageSelector/resources/images/remove-input.svg4
-rw-r--r--MLEB/UniversalLanguageSelector/resources/js/ext.uls.common.js2
-rw-r--r--MLEB/UniversalLanguageSelector/resources/js/ext.uls.compactlinks.js3
-rw-r--r--MLEB/UniversalLanguageSelector/resources/js/ext.uls.dialog.js205
-rw-r--r--MLEB/UniversalLanguageSelector/resources/js/ext.uls.displaysettings.js31
-rw-r--r--MLEB/UniversalLanguageSelector/resources/js/ext.uls.eventlogger.js407
-rw-r--r--MLEB/UniversalLanguageSelector/resources/js/ext.uls.ime.js12
-rw-r--r--MLEB/UniversalLanguageSelector/resources/js/ext.uls.inputsettings.js23
-rw-r--r--MLEB/UniversalLanguageSelector/resources/js/ext.uls.interface.js32
-rw-r--r--MLEB/UniversalLanguageSelector/resources/js/ext.uls.languagesettings.js14
-rw-r--r--MLEB/UniversalLanguageSelector/resources/js/ext.uls.preferences.js8
-rw-r--r--MLEB/UniversalLanguageSelector/resources/js/ext.uls.setlang.js149
-rw-r--r--MLEB/UniversalLanguageSelector/resources/js/ext.uls.webfonts.js4
-rw-r--r--MLEB/UniversalLanguageSelector/resources/js/ext.uls.webfonts.mobile.js4
-rw-r--r--MLEB/UniversalLanguageSelector/resources/js/ext.uls.webfonts.repository.js73
40 files changed, 831 insertions, 326 deletions
diff --git a/MLEB/UniversalLanguageSelector/resources/css/ext.uls-vector.less b/MLEB/UniversalLanguageSelector/resources/css/ext.uls-vector.less
index f9e129d5..6dca27d3 100644
--- a/MLEB/UniversalLanguageSelector/resources/css/ext.uls-vector.less
+++ b/MLEB/UniversalLanguageSelector/resources/css/ext.uls-vector.less
@@ -1,17 +1,28 @@
@import 'mediawiki.mixins';
+// All but `font-size` are WikimediaUI theme values and overwrite jquery.uls library.
-// We need higher specificity due to loading order of LESS files and jQuery.ULS
+// We need higher specificity due to loading order of LESS files and jquery.uls.
.skin-vector {
.uls-menu {
border-color: #c8ccd1;
- .box-shadow( 0 2px 2px 0 rgba( 0, 0, 0, 0.25 ) ); // Overwrite lib/jquery.uls
- font-size: 0.875em; // not inherited from `.mw-body-content`, as we insert at `body`
+ .box-shadow( 0 2px 2px 0 rgba( 0, 0, 0, 0.25 ) );
+ // Not inherited from `.mw-body-content`, as we insert at `body`.
+ font-size: 0.875em;
}
.uls-search {
border-bottom-color: #c8ccd1;
}
+ .uls-search-label {
+ opacity: 0.51;
+ .transition( opacity 250ms );
+ }
+
+ .uls-search-wrapper:hover .uls-search-label {
+ opacity: 0.87;
+ }
+
.uls-filtersuggestion {
color: #72777d;
}
diff --git a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.compactlinks.less b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.compactlinks.less
index 7266b90f..342922f1 100644
--- a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.compactlinks.less
+++ b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.compactlinks.less
@@ -15,7 +15,7 @@
padding: 4px 6px 4px 25px;
font-size: 13px;
font-weight: normal;
- .background-image-svg( '../images/compact-links-trigger.svg', '../images/compact-links-trigger.png' );
+ background-image: url( ../images/compact-links-trigger.svg );
background-size: 18px;
background-repeat: no-repeat;
background-position: left 4px center;
diff --git a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.dialog.less b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.dialog.less
new file mode 100644
index 00000000..de183b3a
--- /dev/null
+++ b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.dialog.less
@@ -0,0 +1,40 @@
+@uls-dialog-width: 480px;
+
+.uls-dialog {
+ position: fixed;
+ z-index: 500;
+ display: none;
+ background-color: #fff;
+ border: 1px solid #ccc;
+ border-color: rgba( 0, 0, 0, 0.2 );
+ box-shadow: 0 5px 10px rgba( 0, 0, 0, 0.2 );
+ background-clip: padding-box;
+ width: @uls-dialog-width;
+ top: 30%;
+ left: 50%;
+ margin-left: -( @uls-dialog-width / 2 );
+ margin-top: -40px;
+ padding: 16px;
+
+ @media screen and ( max-width: 599px ) {
+ width: 100%;
+ left: 0;
+ margin-left: 0;
+ box-sizing: border-box;
+ }
+}
+
+.uls-overlay {
+ height: 100vh;
+ width: 100vw;
+ background-color: #54595d;
+ opacity: 0.87;
+ display: none;
+ z-index: 300;
+ position: fixed;
+ top: 0;
+}
+
+.uls-no-overflow {
+ overflow: hidden;
+}
diff --git a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.displaysettings.less b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.displaysettings.less
index a15c31ef..368553c9 100644
--- a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.displaysettings.less
+++ b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.displaysettings.less
@@ -48,7 +48,7 @@
}
.uls-font-label strong {
- color: #222;
+ color: #202122;
}
.uls-display-settings-anon-label {
diff --git a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.inputsettings.less b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.inputsettings.less
index ab2f09dd..9b58f143 100644
--- a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.inputsettings.less
+++ b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.inputsettings.less
@@ -17,7 +17,7 @@
.uls-ime-menu-settings-item {
background-color: #f8f9fa;
- color: #222;
+ color: #202122;
border-top: 1px solid #c8ccd1;
border-radius: 0 0 2px 2px;
margin-top: 6px;
@@ -26,8 +26,7 @@
}
.uls-ime-disable-link {
- background: transparent no-repeat left top;
- .background-image-svg( '../images/remove-input.svg', '../images/remove-input.png' );
+ background: transparent url( ../images/remove-input.svg ) no-repeat left top;
background-size: auto 16px;
padding-left: 22px;
padding-right: 26px;
@@ -36,8 +35,7 @@
}
.uls-ime-more-settings-link {
- background: transparent no-repeat center top;
- .background-image-svg( '../images/cog.svg', '../images/cog.png' );
+ background: transparent url( ../images/cog.svg ) no-repeat center top;
background-size: auto 14px;
border-left: 1px solid #c8ccd1;
width: 22px;
@@ -124,8 +122,7 @@
right: 4px;
opacity: 0.81;
padding: 0;
- background: transparent no-repeat right center;
- .background-image-svg( '../images/help.svg', '../images/help.png' );
+ background: transparent url( ../images/help.svg ) no-repeat right center;
background-size: 16px 16px;
}
diff --git a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.interface.less b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.interface.less
index d8003ad3..533f6110 100644
--- a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.interface.less
+++ b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.interface.less
@@ -23,15 +23,15 @@
cursor: pointer;
&:hover {
- color: #222;
+ color: #202122;
}
&.display-settings-block {
- .background-image-svg( '../images/display.svg', '../images/display.png' );
+ background-image: url( ../images/display.svg );
}
&.input-settings-block {
- .background-image-svg( '../images/input.svg', '../images/input.png' );
+ background-image: url( ../images/input.svg );
}
}
}
diff --git a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.interlanguage.less b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.interlanguage.less
index 5829292b..47f8b478 100644
--- a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.interlanguage.less
+++ b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.interlanguage.less
@@ -2,8 +2,7 @@
@import 'mediawiki.mixins';
#p-lang .uls-settings-trigger {
- background: transparent no-repeat center top;
- .background-image-svg( '../images/cog-sprite.svg', '../images/cog-sprite.png' );
+ background: transparent url( ../images/cog-sprite.svg ) no-repeat center top;
border: 0;
min-height: 16px;
min-width: 16px;
diff --git a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.languagesettings.less b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.languagesettings.less
index 485f5069..f3ac8c19 100644
--- a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.languagesettings.less
+++ b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.languagesettings.less
@@ -33,7 +33,7 @@
width: 100%;
/* Using border instead of outline for focus (outline doesn't have enough space) */
outline: 0;
- color: #222;
+ color: #202122;
padding: 5px 0 5px 42px;
border: 1px solid transparent;
background: left 15px top 6px transparent no-repeat;
@@ -74,27 +74,27 @@
}
&:hover .settings-text {
- color: #222;
+ color: #202122;
}
&.display-settings-block {
- .background-image-svg( '../images/display.svg', '../images/display.png' );
+ background-image: url( ../images/display.svg );
}
&.input-settings-block {
- .background-image-svg( '../images/input.svg', '../images/input.png' );
+ background-image: url( ../images/input.svg );
}
}
}
#languagesettings-settings-panel {
padding: 0 15px;
- color: #222;
+ color: #202122;
background: #fff;
}
#languagesettings-settings-panel h3 {
- color: #222;
+ color: #202122;
padding-top: 15px;
margin-top: 1pt;
line-height: 20pt;
@@ -102,7 +102,7 @@
}
#languagesettings-settings-panel h4 {
- color: #222;
+ color: #202122;
font-size: 12pt;
}
@@ -146,7 +146,7 @@
}
.checkbox strong {
- color: #222;
+ color: #202122;
}
label.checkbox input[ type='checkbox' ] {
@@ -158,9 +158,9 @@ label.checkbox input[ type='checkbox' ] {
}
.uls-icon-close {
- background: transparent no-repeat center center;
- .background-image-svg( '../images/close.svg', '../images/close.png' );
- background-size: 16px 16px; // Support: Android Browser <= 4.3, doesn't accept it as part of `background` shorthand
+ background: transparent url( ../images/close.svg ) no-repeat center center;
+ // Support: Android Browser <= 4.3, doesn't accept `background-size` as part of `background` shorthand.
+ background-size: 16px 16px;
float: right;
padding: 16px;
cursor: pointer;
diff --git a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.less b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.less
index 4aece6ee..36aa83ae 100644
--- a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.less
+++ b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.less
@@ -36,12 +36,8 @@
}
.uls-icon-back {
- background: transparent url( ../images/back-grey-ltr.png ) no-repeat scroll center center;
- background-image: -webkit-linear-gradient( transparent, transparent ), url( ../images/back-grey-ltr.svg );
- /* @embed */
- background-image: linear-gradient( transparent, transparent ), url( ../images/back-grey-ltr.svg );
+ background: transparent url( ../images/back-grey-ltr.svg ) no-repeat scroll center center;
background-size: 28px;
- background-position: center center;
height: 32px;
width: 40px;
display: block;
diff --git a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.pt-monobook.less b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.pt-monobook.less
index eaf2070f..1be0a86a 100644
--- a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.pt-monobook.less
+++ b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.pt-monobook.less
@@ -1,6 +1,4 @@
-/* stylelint-disable selector-max-id */
-
-#pt-uls a.uls-trigger {
+#pt-uls .uls-trigger { // stylelint-disable-line selector-max-id
// Use same padding-left as #pt-userpage
padding-left: 20px;
}
diff --git a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.pt.less b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.pt.less
index f5b1dbe6..d8e85aec 100644
--- a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.pt.less
+++ b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.pt.less
@@ -1,6 +1,14 @@
+/* stylelint-disable indentation, selector-max-id */
@import 'mediawiki.mixins';
-/* stylelint-disable selector-max-id */
+// Similar to from Vector's 'personalMenu.less' file.
+@font-size-browser: 16; // Assumed browser default of `16px`
+// ULS personal tool menu
+@background-position-menu-uls-icon: left ( 1 / @font-size-browser / @font-size-menu-uls );
+@background-size-menu-uls-icon: 16 / @font-size-browser / @font-size-menu-uls;
+@padding-top-menu-uls-icon: 4 / @font-size-browser / @font-size-menu-uls;
+@padding-left-menu-uls-icon: 20 / @font-size-browser / @font-size-menu-uls;
+@font-size-menu-uls: 0.75em;
/*
* The trigger can be placed in the personal toolbar near the username
@@ -12,19 +20,38 @@
* Copied from jquery.uls.css with the path changed.
*/
.uls-trigger {
- background: transparent no-repeat scroll left center;
+ background: no-repeat left center;
.background-image-svg( '../../lib/jquery.uls/images/language.svg', '../../lib/jquery.uls/images/language.png' );
// Let the SVG image fit without cropping or stretch
background-size: contain;
padding-left: 24px;
}
-#pt-uls a.uls-trigger {
- padding-left: 18px;
- // Let the SVG image fit without cropping or stretch
- background-size: contain;
- /* Fix alignment in vector: https://phabricator.wikimedia.org/T61239 */
- line-height: 1;
+#pt-uls {
+ padding-top: 0 !important; // stylelint-disable-line declaration-no-important
+
+ .uls-trigger {
+ background-image: none;
+ // Same values as Vector's `#p-personal li`.
+ display: inline-block;
+ padding-top: 0.5em !important; // stylelint-disable-line declaration-no-important
+ padding-left: 0;
+
+ // Putting the icon in before in order to apply `opacity`.
+ &:before {
+ content: '';
+ .background-image-svg( '../../lib/jquery.uls/images/language.svg', '../../lib/jquery.uls/images/language.png' );
+ // Same values as Vector's `#pt-userpage a`.
+ background-position: @background-position-menu-uls-icon;
+ // Support Edge: Can't be `contain`, see T207075.
+ background-repeat: no-repeat;
+ background-size: @background-size-menu-uls-icon @background-size-menu-uls-icon;
+ padding-top: @padding-top-menu-uls-icon;
+ padding-left: @padding-left-menu-uls-icon;
+ // Equals `#555`, closest to `#54595d` on background-color `#fff`.
+ opacity: 0.67;
+ }
+ }
}
/* Opera for some inexplicable reason confuses right and left padding with */
diff --git a/MLEB/UniversalLanguageSelector/resources/css/ext.uls.setlang.less b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.setlang.less
new file mode 100644
index 00000000..8e3a775e
--- /dev/null
+++ b/MLEB/UniversalLanguageSelector/resources/css/ext.uls.setlang.less
@@ -0,0 +1,24 @@
+.uls-setlang-dialog {
+ h4 {
+ margin-bottom: 1em;
+ margin-top: 0;
+ text-align: center;
+ }
+
+ p {
+ line-height: 1.6;
+ }
+
+ .language-setlang-buttons {
+ text-align: right;
+ margin-top: 20px;
+
+ @media screen and ( max-width: 599px ) {
+ text-align: center;
+ }
+ }
+
+ .language-setlang-buttons button {
+ margin-left: 16px;
+ }
+}
diff --git a/MLEB/UniversalLanguageSelector/resources/images/back-grey-ltr.png b/MLEB/UniversalLanguageSelector/resources/images/back-grey-ltr.png
deleted file mode 100644
index 32edbda5..00000000
--- a/MLEB/UniversalLanguageSelector/resources/images/back-grey-ltr.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/UniversalLanguageSelector/resources/images/back-grey-rtl.png b/MLEB/UniversalLanguageSelector/resources/images/back-grey-rtl.png
deleted file mode 100644
index b711ee27..00000000
--- a/MLEB/UniversalLanguageSelector/resources/images/back-grey-rtl.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/UniversalLanguageSelector/resources/images/close.png b/MLEB/UniversalLanguageSelector/resources/images/close.png
deleted file mode 100644
index 80dde951..00000000
--- a/MLEB/UniversalLanguageSelector/resources/images/close.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/UniversalLanguageSelector/resources/images/cog-sprite.png b/MLEB/UniversalLanguageSelector/resources/images/cog-sprite.png
deleted file mode 100644
index fbc97fef..00000000
--- a/MLEB/UniversalLanguageSelector/resources/images/cog-sprite.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/UniversalLanguageSelector/resources/images/cog.png b/MLEB/UniversalLanguageSelector/resources/images/cog.png
deleted file mode 100644
index 177a7f67..00000000
--- a/MLEB/UniversalLanguageSelector/resources/images/cog.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/UniversalLanguageSelector/resources/images/compact-links-trigger.png b/MLEB/UniversalLanguageSelector/resources/images/compact-links-trigger.png
deleted file mode 100644
index b378cf9d..00000000
--- a/MLEB/UniversalLanguageSelector/resources/images/compact-links-trigger.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/UniversalLanguageSelector/resources/images/display.png b/MLEB/UniversalLanguageSelector/resources/images/display.png
deleted file mode 100644
index 7b97f152..00000000
--- a/MLEB/UniversalLanguageSelector/resources/images/display.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/UniversalLanguageSelector/resources/images/display.svg b/MLEB/UniversalLanguageSelector/resources/images/display.svg
index 098503cb..e9016adb 100644
--- a/MLEB/UniversalLanguageSelector/resources/images/display.svg
+++ b/MLEB/UniversalLanguageSelector/resources/images/display.svg
@@ -1,4 +1,4 @@
<?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 fill="#222" d="M.002 2.275V15.22h8.405c.535 1.624-.975 1.786-1.902 2.505 0 0 2.293-.024 3.439-.024 1.144 0 3.432.024 3.432.024-.905-.688-2.355-.868-1.902-2.505h8.527V2.275h-20zm6.81 1.84h.797l3.313 8.466H9.879L8.836 9.943H5.462l-1.043 2.638h-.982zm.368 1.104c-.084.369-.211.785-.368 1.227L5.83 9.023h2.699l-.982-2.577c-.128-.33-.234-.747-.368-1.227zm7.117.982c.753 0 1.295.157 1.656.491.365.334.552.858.552 1.595v4.294h-.675l-.184-.859h-.062c-.315.396-.605.655-.92.798-.311.138-.758.184-1.227.184-.626 0-1.115-.168-1.472-.491-.353-.323-.491-.754-.491-1.35 0-1.275 1.028-1.963 3.068-2.025h1.043v-.429c0-.495-.091-.87-.307-1.104-.211-.238-.574-.307-1.043-.307-.526 0-1.115.107-1.779.429l-.307-.675a4.748 4.748 0 0 1 1.043-.429 4.334 4.334 0 0 1 1.104-.123zm.307 3.313c-.761.027-1.318.157-1.656.368-.334.207-.491.54-.491.982 0 .346.1.617.307.798.211.181.544.245.92.245.595 0 1.012-.164 1.35-.491.342-.326.552-.762.552-1.35v-.552z"/>
+ <path fill="#202122" d="M.002 2.275V15.22h8.405c.535 1.624-.975 1.786-1.902 2.505 0 0 2.293-.024 3.439-.024 1.144 0 3.432.024 3.432.024-.905-.688-2.355-.868-1.902-2.505h8.527V2.275h-20zm6.81 1.84h.797l3.313 8.466H9.879L8.836 9.943H5.462l-1.043 2.638h-.982zm.368 1.104c-.084.369-.211.785-.368 1.227L5.83 9.023h2.699l-.982-2.577c-.128-.33-.234-.747-.368-1.227zm7.117.982c.753 0 1.295.157 1.656.491.365.334.552.858.552 1.595v4.294h-.675l-.184-.859h-.062c-.315.396-.605.655-.92.798-.311.138-.758.184-1.227.184-.626 0-1.115-.168-1.472-.491-.353-.323-.491-.754-.491-1.35 0-1.275 1.028-1.963 3.068-2.025h1.043v-.429c0-.495-.091-.87-.307-1.104-.211-.238-.574-.307-1.043-.307-.526 0-1.115.107-1.779.429l-.307-.675a4.748 4.748 0 0 1 1.043-.429 4.334 4.334 0 0 1 1.104-.123zm.307 3.313c-.761.027-1.318.157-1.656.368-.334.207-.491.54-.491.982 0 .346.1.617.307.798.211.181.544.245.92.245.595 0 1.012-.164 1.35-.491.342-.326.552-.762.552-1.35v-.552z"/>
</svg>
diff --git a/MLEB/UniversalLanguageSelector/resources/images/help.png b/MLEB/UniversalLanguageSelector/resources/images/help.png
deleted file mode 100644
index 3adb1229..00000000
--- a/MLEB/UniversalLanguageSelector/resources/images/help.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/UniversalLanguageSelector/resources/images/help.svg b/MLEB/UniversalLanguageSelector/resources/images/help.svg
index e23e3a8c..1d786f05 100644
--- a/MLEB/UniversalLanguageSelector/resources/images/help.svg
+++ b/MLEB/UniversalLanguageSelector/resources/images/help.svg
@@ -1,4 +1,4 @@
<?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 fill="#222" d="M10 0a10 10 0 1 0 10 10A10 10 0 0 0 10 0zm1 16H9v-2h2zm2.71-7.6a2.63 2.63 0 0 1-.34.74 3.06 3.06 0 0 1-.48.55l-.54.48c-.21.18-.41.35-.59.52a3 3 0 0 0-.47.56A2.49 2.49 0 0 0 11 12a4.12 4.12 0 0 0-.11 1H9.08a8.68 8.68 0 0 1 .08-1.25 3.54 3.54 0 0 1 .24-.9 2.81 2.81 0 0 1 .41-.68 4.63 4.63 0 0 1 .58-.58l.51-.44a3 3 0 0 0 .44-.45 1.92 1.92 0 0 0 .3-.54 2.13 2.13 0 0 0 .11-.72 1.94 1.94 0 0 0-.18-.86 1.79 1.79 0 0 0-.43-.58 1.69 1.69 0 0 0-.54-.32 1.55 1.55 0 0 0-.5-.1 1.77 1.77 0 0 0-1.53.68 3 3 0 0 0-.49 1.82H6.16a4.84 4.84 0 0 1 .28-1.68 3.57 3.57 0 0 1 .8-1.29 3.62 3.62 0 0 1 1.27-.83A4.52 4.52 0 0 1 10.18 4a4.42 4.42 0 0 1 1.43.23 3.48 3.48 0 0 1 1.16.65 3 3 0 0 1 .78 1.06 3.49 3.49 0 0 1 .28 1.44 3.63 3.63 0 0 1-.12 1.02z"/>
+ <path fill="#202122" d="M10 0a10 10 0 1 0 10 10A10 10 0 0 0 10 0zm1 16H9v-2h2zm2.71-7.6a2.63 2.63 0 0 1-.34.74 3.06 3.06 0 0 1-.48.55l-.54.48c-.21.18-.41.35-.59.52a3 3 0 0 0-.47.56A2.49 2.49 0 0 0 11 12a4.12 4.12 0 0 0-.11 1H9.08a8.68 8.68 0 0 1 .08-1.25 3.54 3.54 0 0 1 .24-.9 2.81 2.81 0 0 1 .41-.68 4.63 4.63 0 0 1 .58-.58l.51-.44a3 3 0 0 0 .44-.45 1.92 1.92 0 0 0 .3-.54 2.13 2.13 0 0 0 .11-.72 1.94 1.94 0 0 0-.18-.86 1.79 1.79 0 0 0-.43-.58 1.69 1.69 0 0 0-.54-.32 1.55 1.55 0 0 0-.5-.1 1.77 1.77 0 0 0-1.53.68 3 3 0 0 0-.49 1.82H6.16a4.84 4.84 0 0 1 .28-1.68 3.57 3.57 0 0 1 .8-1.29 3.62 3.62 0 0 1 1.27-.83A4.52 4.52 0 0 1 10.18 4a4.42 4.42 0 0 1 1.43.23 3.48 3.48 0 0 1 1.16.65 3 3 0 0 1 .78 1.06 3.49 3.49 0 0 1 .28 1.44 3.63 3.63 0 0 1-.12 1.02z"/>
</svg>
diff --git a/MLEB/UniversalLanguageSelector/resources/images/input.png b/MLEB/UniversalLanguageSelector/resources/images/input.png
deleted file mode 100644
index 13c72709..00000000
--- a/MLEB/UniversalLanguageSelector/resources/images/input.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/UniversalLanguageSelector/resources/images/input.svg b/MLEB/UniversalLanguageSelector/resources/images/input.svg
index b0dac628..c34ae53a 100644
--- a/MLEB/UniversalLanguageSelector/resources/images/input.svg
+++ b/MLEB/UniversalLanguageSelector/resources/images/input.svg
@@ -1,4 +1,4 @@
<?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 fill="#222" d="M9 1.281c-.124.259-.185.599-.5.688-.55.081-1.133.018-1.688 0-.866-.032-1.733-.148-2.594 0-.588.157-.953.727-1.188 1.25-.178.416-.271.836-.344 1.281H-.002V16h20V4.5H3.654c.109-.52.203-1.057.563-1.469.222-.231.587-.17.875-.188 1.212.003 2.415.179 3.625.063.463-.058.812-.455.969-.875l.188-.438-.875-.313zM1.875 7.125h1.563c.094 0 .188.093.188.188v1.531a.201.201 0 0 1-.188.188H1.875c-.094 0-.156-.093-.156-.188V7.313c0-.094.062-.188.156-.188zm2.844 0h1.563c.094 0 .156.093.156.188v1.531c0 .094-.062.188-.156.188H4.719c-.094 0-.156-.093-.156-.188V7.313c0-.094.062-.188.156-.188zm2.844 0h1.563c.094 0 .156.093.156.188v1.531c0 .094-.062.188-.156.188H7.563a.201.201 0 0 1-.188-.188V7.313c0-.094.093-.188.188-.188zm2.813 0h1.563c.094 0 .188.093.188.188v1.531a.201.201 0 0 1-.188.188h-1.563c-.094 0-.156-.093-.156-.188V7.313c0-.094.062-.188.156-.188zm2.844 0h1.563c.094 0 .156.093.156.188v1.531c0 .094-.062.188-.156.188H13.22c-.094 0-.156-.093-.156-.188V7.313c0-.094.062-.188.156-.188zm2.844 0h1.531c.094 0 .188.093.188.188v1.531a.201.201 0 0 1-.188.188h-1.531a.201.201 0 0 1-.188-.188V7.313c0-.094.093-.188.188-.188zm-12.844 3h1.563c.094 0 .156.093.156.188v1.563c0 .094-.062.156-.156.156H3.22c-.094 0-.156-.062-.156-.156v-1.563c0-.094.062-.188.156-.188zm2.906 0h1.563c.094 0 .188.093.188.188v1.563c0 .094-.093.156-.188.156H6.126c-.094 0-.156-.062-.156-.156v-1.563c0-.094.062-.188.156-.188zm2.938 0h1.531c.094 0 .188.093.188.188v1.563c0 .094-.093.156-.188.156H9.064c-.094 0-.188-.062-.188-.156v-1.563c0-.094.093-.188.188-.188zm2.906 0h1.563c.094 0 .156.093.156.188v1.563c0 .094-.062.156-.156.156H11.97c-.094 0-.188-.062-.188-.156v-1.563c0-.094.093-.188.188-.188zm2.906 0h1.563c.094 0 .156.093.156.188v1.563c0 .094-.062.156-.156.156h-1.563c-.094 0-.156-.062-.156-.156v-1.563c0-.094.062-.188.156-.188zM4.001 13.688h12c.088 0 .156.068.156.156v.844a.154.154 0 0 1-.156.156h-12a.154.154 0 0 1-.156-.156v-.844c0-.088.068-.156.156-.156z"/>
+ <path fill="#202122" d="M9 1.281c-.124.259-.185.599-.5.688-.55.081-1.133.018-1.688 0-.866-.032-1.733-.148-2.594 0-.588.157-.953.727-1.188 1.25-.178.416-.271.836-.344 1.281H-.002V16h20V4.5H3.654c.109-.52.203-1.057.563-1.469.222-.231.587-.17.875-.188 1.212.003 2.415.179 3.625.063.463-.058.812-.455.969-.875l.188-.438-.875-.313zM1.875 7.125h1.563c.094 0 .188.093.188.188v1.531a.201.201 0 0 1-.188.188H1.875c-.094 0-.156-.093-.156-.188V7.313c0-.094.062-.188.156-.188zm2.844 0h1.563c.094 0 .156.093.156.188v1.531c0 .094-.062.188-.156.188H4.719c-.094 0-.156-.093-.156-.188V7.313c0-.094.062-.188.156-.188zm2.844 0h1.563c.094 0 .156.093.156.188v1.531c0 .094-.062.188-.156.188H7.563a.201.201 0 0 1-.188-.188V7.313c0-.094.093-.188.188-.188zm2.813 0h1.563c.094 0 .188.093.188.188v1.531a.201.201 0 0 1-.188.188h-1.563c-.094 0-.156-.093-.156-.188V7.313c0-.094.062-.188.156-.188zm2.844 0h1.563c.094 0 .156.093.156.188v1.531c0 .094-.062.188-.156.188H13.22c-.094 0-.156-.093-.156-.188V7.313c0-.094.062-.188.156-.188zm2.844 0h1.531c.094 0 .188.093.188.188v1.531a.201.201 0 0 1-.188.188h-1.531a.201.201 0 0 1-.188-.188V7.313c0-.094.093-.188.188-.188zm-12.844 3h1.563c.094 0 .156.093.156.188v1.563c0 .094-.062.156-.156.156H3.22c-.094 0-.156-.062-.156-.156v-1.563c0-.094.062-.188.156-.188zm2.906 0h1.563c.094 0 .188.093.188.188v1.563c0 .094-.093.156-.188.156H6.126c-.094 0-.156-.062-.156-.156v-1.563c0-.094.062-.188.156-.188zm2.938 0h1.531c.094 0 .188.093.188.188v1.563c0 .094-.093.156-.188.156H9.064c-.094 0-.188-.062-.188-.156v-1.563c0-.094.093-.188.188-.188zm2.906 0h1.563c.094 0 .156.093.156.188v1.563c0 .094-.062.156-.156.156H11.97c-.094 0-.188-.062-.188-.156v-1.563c0-.094.093-.188.188-.188zm2.906 0h1.563c.094 0 .156.093.156.188v1.563c0 .094-.062.156-.156.156h-1.563c-.094 0-.156-.062-.156-.156v-1.563c0-.094.062-.188.156-.188zM4.001 13.688h12c.088 0 .156.068.156.156v.844a.154.154 0 0 1-.156.156h-12a.154.154 0 0 1-.156-.156v-.844c0-.088.068-.156.156-.156z"/>
</svg>
diff --git a/MLEB/UniversalLanguageSelector/resources/images/remove-input.png b/MLEB/UniversalLanguageSelector/resources/images/remove-input.png
deleted file mode 100644
index d3b73985..00000000
--- a/MLEB/UniversalLanguageSelector/resources/images/remove-input.png
+++ /dev/null
Binary files differ
diff --git a/MLEB/UniversalLanguageSelector/resources/images/remove-input.svg b/MLEB/UniversalLanguageSelector/resources/images/remove-input.svg
index a192a26b..09b98974 100644
--- a/MLEB/UniversalLanguageSelector/resources/images/remove-input.svg
+++ b/MLEB/UniversalLanguageSelector/resources/images/remove-input.svg
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="16" viewBox="0 0 20 16">
- <path fill="#222" d="M9.2.825c-.1.207-.148.479-.4.55-.44.065-.906.015-1.35 0-.693-.025-1.387-.118-2.076 0-.47.126-.762.582-.95 1A4.323 4.323 0 0 0 4.149 3.4h-2.15v9.2h16V3.4H4.922c.087-.416.163-.846.45-1.175.178-.185.47-.136.7-.15.97.002 1.933.143 2.9.05.371-.047.65-.364.776-.7l.15-.35-.7-.251zM3.5 5.5h1.25a.16.16 0 0 1 .15.15v1.225a.16.16 0 0 1-.15.15H3.5c-.075 0-.125-.074-.125-.15V5.65c0-.075.05-.15.125-.15zm2.275 0h1.25c.076 0 .125.074.125.15v1.225c0 .075-.05.15-.124.15h-1.25c-.076 0-.126-.074-.126-.15V5.65c0-.075.05-.15.125-.15zm2.275 0H9.3c.076 0 .126.074.126.15v1.225c0 .075-.05.15-.125.15H8.05a.161.161 0 0 1-.151-.15V5.65a.16.16 0 0 1 .15-.15zm2.25 0h1.251a.16.16 0 0 1 .15.15v1.225a.16.16 0 0 1-.15.15h-1.25c-.075 0-.125-.074-.125-.15V5.65c0-.075.05-.15.125-.15zm2.276 0h1.25c.076 0 .125.074.125.15v1.225c0 .075-.05.15-.125.15h-1.25c-.075 0-.125-.074-.125-.15V5.65c0-.075.05-.15.125-.15zm2.275 0h1.225a.16.16 0 0 1 .15.15v1.225a.16.16 0 0 1-.15.15h-1.225a.161.161 0 0 1-.15-.15V5.65a.16.16 0 0 1 .15-.15zM4.576 7.9h1.25c.076 0 .125.074.125.15V9.3c0 .076-.05.126-.125.126h-1.25c-.075 0-.125-.05-.125-.125V8.05c0-.076.05-.151.125-.151zm2.325 0h1.25a.16.16 0 0 1 .15.15V9.3c0 .076-.074.126-.15.126h-1.25c-.075 0-.125-.05-.125-.125V8.05c0-.076.05-.151.125-.151zm2.35 0h1.225a.16.16 0 0 1 .15.15V9.3c0 .076-.074.126-.15.126H9.251c-.075 0-.15-.05-.15-.125V8.05c0-.076.074-.151.15-.151zm2.325 0h1.25c.076 0 .125.074.125.15V9.3c0 .076-.05.126-.125.126h-1.25c-.075 0-.15-.05-.15-.125V8.05c0-.076.074-.151.15-.151zm2.325 0h1.25c.075 0 .125.074.125.15V9.3c0 .076-.05.126-.125.126h-1.25c-.075 0-.125-.05-.125-.125V8.05c0-.076.05-.151.125-.151zm-8.7 2.85h9.6c.07 0 .125.055.125.125v.675c0 .07-.055.125-.125.125H5.2a.123.123 0 0 1-.125-.125v-.675c0-.07.054-.125.125-.125z"/>
- <path stroke="#222" stroke-width="1.2" d="M2.719 15.279L17.28.72"/>
+ <path fill="#202122" d="M9.2.825c-.1.207-.148.479-.4.55-.44.065-.906.015-1.35 0-.693-.025-1.387-.118-2.076 0-.47.126-.762.582-.95 1A4.323 4.323 0 0 0 4.149 3.4h-2.15v9.2h16V3.4H4.922c.087-.416.163-.846.45-1.175.178-.185.47-.136.7-.15.97.002 1.933.143 2.9.05.371-.047.65-.364.776-.7l.15-.35-.7-.251zM3.5 5.5h1.25a.16.16 0 0 1 .15.15v1.225a.16.16 0 0 1-.15.15H3.5c-.075 0-.125-.074-.125-.15V5.65c0-.075.05-.15.125-.15zm2.275 0h1.25c.076 0 .125.074.125.15v1.225c0 .075-.05.15-.124.15h-1.25c-.076 0-.126-.074-.126-.15V5.65c0-.075.05-.15.125-.15zm2.275 0H9.3c.076 0 .126.074.126.15v1.225c0 .075-.05.15-.125.15H8.05a.161.161 0 0 1-.151-.15V5.65a.16.16 0 0 1 .15-.15zm2.25 0h1.251a.16.16 0 0 1 .15.15v1.225a.16.16 0 0 1-.15.15h-1.25c-.075 0-.125-.074-.125-.15V5.65c0-.075.05-.15.125-.15zm2.276 0h1.25c.076 0 .125.074.125.15v1.225c0 .075-.05.15-.125.15h-1.25c-.075 0-.125-.074-.125-.15V5.65c0-.075.05-.15.125-.15zm2.275 0h1.225a.16.16 0 0 1 .15.15v1.225a.16.16 0 0 1-.15.15h-1.225a.161.161 0 0 1-.15-.15V5.65a.16.16 0 0 1 .15-.15zM4.576 7.9h1.25c.076 0 .125.074.125.15V9.3c0 .076-.05.126-.125.126h-1.25c-.075 0-.125-.05-.125-.125V8.05c0-.076.05-.151.125-.151zm2.325 0h1.25a.16.16 0 0 1 .15.15V9.3c0 .076-.074.126-.15.126h-1.25c-.075 0-.125-.05-.125-.125V8.05c0-.076.05-.151.125-.151zm2.35 0h1.225a.16.16 0 0 1 .15.15V9.3c0 .076-.074.126-.15.126H9.251c-.075 0-.15-.05-.15-.125V8.05c0-.076.074-.151.15-.151zm2.325 0h1.25c.076 0 .125.074.125.15V9.3c0 .076-.05.126-.125.126h-1.25c-.075 0-.15-.05-.15-.125V8.05c0-.076.074-.151.15-.151zm2.325 0h1.25c.075 0 .125.074.125.15V9.3c0 .076-.05.126-.125.126h-1.25c-.075 0-.125-.05-.125-.125V8.05c0-.076.05-.151.125-.151zm-8.7 2.85h9.6c.07 0 .125.055.125.125v.675c0 .07-.055.125-.125.125H5.2a.123.123 0 0 1-.125-.125v-.675c0-.07.054-.125.125-.125z"/>
+ <path stroke="#202122" stroke-width="1.2" d="M2.719 15.279L17.28.72"/>
</svg>
diff --git a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.common.js b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.common.js
index 3b1a6e37..1a22a35a 100644
--- a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.common.js
+++ b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.common.js
@@ -98,7 +98,7 @@
mw.hook( 'mw.uls.interface.language.change' ).fire( language, deferred );
// Delay is zero if event logging is not enabled
- window.setTimeout( function () {
+ setTimeout( function () {
deferred.resolve();
}, mw.config.get( 'wgULSEventLogging' ) * 500 );
diff --git a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.compactlinks.js b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.compactlinks.js
index c2ecfb82..61d763ff 100644
--- a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.compactlinks.js
+++ b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.compactlinks.js
@@ -287,6 +287,7 @@
.text( element.textContent );
// This code is to support badges used in Wikimedia
+ // eslint-disable-next-line mediawiki/class-doc
$languageLink.parent().addClass( element.parentNode.className );
},
onCancel: function () {
@@ -317,7 +318,7 @@
// Load the ULS now.
mw.loader.using( 'ext.uls.mediawiki' ).then( function () {
self.createSelector( self.$trigger );
- self.$trigger.click();
+ self.$trigger.trigger( 'click' );
} );
} );
};
diff --git a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.dialog.js b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.dialog.js
new file mode 100644
index 00000000..737f6522
--- /dev/null
+++ b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.dialog.js
@@ -0,0 +1,205 @@
+/*!
+ * A simple dialog to be used inside ULS.
+ *
+ * @private
+ * @since 2020.01
+ *
+ * Copyright (C) 2019-2020 Alolita Sharma, Amir Aharoni, Arun Ganesh, Brandon Harris,
+ * Niklas Laxström, Pau Giner, Santhosh Thottingal, Siebrand Mazeland and other
+ * contributors. See CREDITS for a list.
+ *
+ * UniversalLanguageSelector is dual licensed GPLv2 or later and MIT. You don't
+ * have to do anything special to choose one license or the other and you don't
+ * have to notify anyone which license you are using. You are free to use
+ * UniversalLanguageSelector in commercial projects as long as the copyright
+ * header is left intact. See files GPL-LICENSE and MIT-LICENSE for details.
+ *
+ * @file
+ * @ingroup Extensions
+ * @licence GNU General Public Licence 2.0 or later
+ * @licence MIT License
+ */
+
+( function () {
+ 'use strict';
+
+ var ULSDialog = function ( options ) {
+ var $dialog = options.container,
+ hasOverlay = options.hasOverlay,
+ $overlay,
+ // Source: https://github.com/ghosh/Micromodal/blob/master/lib/src/index.js#L4
+ FOCUSABLE_NODES = [
+ 'a[href]',
+ 'area[href]',
+ 'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',
+ 'select:not([disabled]):not([aria-hidden])',
+ 'textarea:not([disabled]):not([aria-hidden])',
+ 'button:not([disabled]):not([aria-hidden])',
+ 'iframe',
+ 'object',
+ 'embed',
+ '[contenteditable]',
+ '[tabindex]:not([tabindex^="-"])'
+ ],
+ afterOpen = options.afterOpen,
+ afterClose = options.afterClose;
+
+ function getFocusableNodes() {
+ return $dialog.find( FOCUSABLE_NODES.join( ', ' ) );
+ }
+
+ function isElementInDialog( targetElement ) {
+ return $dialog.get( 0 ).contains( targetElement );
+ }
+
+ function focusOverlay() {
+ if ( $overlay ) {
+ $overlay.get( 0 ).focus();
+ }
+ }
+
+ function focusFirstNodeOrOverlay( $focusableNodes ) {
+ if ( $focusableNodes === undefined ) {
+ $focusableNodes = getFocusableNodes();
+ }
+
+ if ( $focusableNodes.length ) {
+ $focusableNodes.get( 0 ).focus();
+ } else {
+ focusOverlay();
+ }
+ }
+
+ function maintainFocus( event ) {
+ var $focusableNodes = getFocusableNodes(),
+ focusedItemIndex;
+
+ if ( !hasOverlay ) {
+ // overlay is not present, so let tabbing flow as normal.
+ return;
+ }
+
+ if ( !$focusableNodes.length ) {
+ // no focusable node in the dialog, focus on the overlay.
+ focusOverlay();
+ return;
+ }
+
+ if ( !isElementInDialog( document.activeElement ) ) {
+ focusFirstNodeOrOverlay( $focusableNodes );
+ } else {
+ focusedItemIndex = $focusableNodes.index( document.activeElement );
+
+ if ( event.shiftKey && focusedItemIndex === 0 ) {
+ $focusableNodes.get( -1 ).focus();
+ event.preventDefault();
+ } else if ( !event.shiftKey && focusedItemIndex === $focusableNodes.length - 1 ) {
+ focusFirstNodeOrOverlay( $focusableNodes );
+ event.preventDefault();
+ }
+ }
+ }
+
+ function handleFirstFocus( event ) {
+ if ( !hasOverlay ) {
+ // Overlay is not present, so let tabbing flow as normal.
+ return;
+ }
+
+ if ( isElementInDialog( event.target ) ) {
+ return;
+ }
+
+ focusFirstNodeOrOverlay();
+ }
+
+ function onKeydown( event ) {
+ switch ( event.key ) {
+ case 'Esc':
+ case 'Escape':
+ // eslint-disable-next-line no-use-before-define
+ close();
+ event.preventDefault();
+ break;
+ case 'Tab':
+ maintainFocus( event );
+ break;
+ }
+ }
+
+ function addEvents() {
+ $( document )
+ .on( 'keydown', onKeydown )
+ .on( 'focusin', handleFirstFocus );
+ }
+
+ function removeEvents() {
+ $( document )
+ .off( 'keydown', onKeydown )
+ .off( 'focusin', handleFirstFocus );
+ }
+
+ function showOverlay() {
+ if ( $overlay ) {
+ $overlay.show();
+ $( document.body ).addClass( 'uls-no-overflow' );
+ }
+ }
+
+ function hideOverlay() {
+ if ( $overlay ) {
+ $overlay.hide();
+ $( document.body ).removeClass( 'uls-no-overflow' );
+ }
+ }
+
+ function open() {
+ $dialog.show();
+ addEvents();
+ showOverlay();
+ focusFirstNodeOrOverlay();
+ if ( afterOpen ) {
+ afterOpen();
+ }
+ }
+
+ function close() {
+ $dialog.hide();
+ removeEvents();
+ hideOverlay();
+ if ( afterClose ) {
+ afterClose();
+ }
+ }
+
+ function elem() {
+ return $dialog;
+ }
+
+ function addOverlay() {
+ // Check if overlay is already there.
+ if ( !$overlay ) {
+ $overlay = $( '<div>' )
+ .addClass( 'uls-overlay' )
+ .prop( 'tabindex', '-1' )
+ .on( 'click', close )
+ .appendTo( document.body );
+ }
+ }
+
+ $dialog.addClass( 'uls-dialog' );
+
+ if ( hasOverlay ) {
+ addOverlay();
+ }
+
+ return {
+ open: open,
+ close: close,
+ elem: elem
+ };
+ };
+
+ mw.uls = mw.uls || {};
+ mw.uls.Dialog = ULSDialog;
+}() );
diff --git a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.displaysettings.js b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.displaysettings.js
index 7b28c7d7..9a1feab8 100644
--- a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.displaysettings.js
+++ b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.displaysettings.js
@@ -121,7 +121,7 @@
*/
render: function () {
this.$parent.$settingsPanel.empty();
- this.$webfonts = $( 'body' ).data( 'webfonts' );
+ this.$webfonts = $( document.body ).data( 'webfonts' );
this.$parent.$settingsPanel.append( this.$template );
this.prepareLanguages();
this.prepareUIFonts();
@@ -185,7 +185,7 @@
var deferred = new $.Deferred();
$loginCta.html( parsedCta ); // The parsed CTA is HTML
- $loginCta.find( 'a' ).click( function ( event ) {
+ $loginCta.find( 'a' ).on( 'click', function ( event ) {
event.preventDefault();
// Because browsers navigate away when clicking a link,
// we are overriding the normal click behavior to allow
@@ -197,13 +197,13 @@
// if event logging is enabled, in can resole the promise
// immediately to avoid extra delays.
deferred.done( function () {
- window.location.href = event.target.href;
+ location.href = event.target.href;
} );
mw.hook( 'mw.uls.login.click' ).fire( deferred );
// Delay is zero if event logging is not enabled
- window.setTimeout( function () {
+ setTimeout( function () {
deferred.resolve();
}, mw.config.get( 'wgULSEventLogging' ) * 500 );
} );
@@ -301,7 +301,7 @@
$back = $( '<div>' )
.addClass( 'uls-icon-back' );
- $back.click( function () {
+ $back.on( 'click', function () {
uls.hide();
displaySettings.$parent.show();
} );
@@ -312,11 +312,11 @@
uls.$menu.find( '.uls-search-wrapper' ).wrap( $wrap );
uls.$menu.find( '.uls-search-wrapper-wrapper' ).prepend( $back );
- if ( $( '.uls-settings-trigger' ).offset().left > $( window ).width() / 2 ) {
- uls.$menu.removeClass( 'selector-left' ).addClass( 'selector-right' );
- } else {
- uls.$menu.removeClass( 'selector-right' ).addClass( 'selector-left' );
- }
+ // Copy callout related classes from parent
+ // eslint-disable-next-line no-jquery/no-class-state
+ uls.$menu.toggleClass( 'selector-left', displaySettings.$parent.$window.hasClass( 'selector-left' ) );
+ // eslint-disable-next-line no-jquery/no-class-state
+ uls.$menu.toggleClass( 'selector-right', displaySettings.$parent.$window.hasClass( 'selector-right' ) );
},
onVisible: function () {
var $parent;
@@ -324,6 +324,7 @@
this.$menu.find( '.uls-languagefilter' )
.prop( 'placeholder', $.i18n( 'ext-uls-display-settings-ui-language' ) );
+ // eslint-disable-next-line no-jquery/no-class-state
if ( !displaySettings.$parent.$window.hasClass( 'callout' ) ) {
// Callout menus will have position rules.
// Others use the default position.
@@ -341,6 +342,7 @@
}
// If the ULS is shown in the sidebar,
// add a caret pointing to the icon
+ // eslint-disable-next-line no-jquery/no-class-state
if ( displaySettings.$parent.$window.hasClass( 'callout' ) ) {
this.$menu.addClass( 'callout callout--languageselection' );
} else {
@@ -549,7 +551,7 @@
// Allow the webfonts library to finish loading
setTimeout( function () {
- displaySettings.$webfonts = $( 'body' ).data( 'webfonts' );
+ displaySettings.$webfonts = $( document.body ).data( 'webfonts' );
mw.webfonts.preferences.enable();
@@ -557,6 +559,7 @@
displaySettings.prepareUIFonts();
displaySettings.i18n();
+ // eslint-disable-next-line no-jquery/no-sizzle
displaySettings.$webfonts.apply( $uiFontSelector.find( 'option:selected' ) );
displaySettings.$webfonts.refresh();
@@ -577,7 +580,7 @@
$uiFontSelector.on( 'change', function () {
displaySettings.markDirty();
mw.webfonts.preferences.setFont( displaySettings.uiLanguage,
- $( this ).find( 'option:selected' ).val()
+ $( this ).val()
);
displaySettings.$webfonts.refresh();
} );
@@ -585,7 +588,7 @@
$contentFontSelector.on( 'change', function () {
displaySettings.markDirty();
mw.webfonts.preferences.setFont( displaySettings.contentLanguage,
- $( this ).find( 'option:selected' ).val()
+ $( this ).val()
);
displaySettings.$webfonts.refresh();
} );
@@ -593,6 +596,7 @@
$tabButtons.on( 'click', function () {
var $button = $( this );
+ // eslint-disable-next-line no-jquery/no-class-state
if ( $button.hasClass( 'mw-ui-pressed' ) ) {
return;
}
@@ -600,6 +604,7 @@
displaySettings.$template.find( '.ext-uls-sub-panel' ).each( function () {
var $subPanel = $( this );
+ // eslint-disable-next-line no-jquery/no-class-state
if ( $subPanel.hasClass( $button.attr( 'id' ) ) ) {
$subPanel.removeClass( 'hide' );
} else {
diff --git a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.eventlogger.js b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.eventlogger.js
index 1c94f60c..a5f4a0be 100644
--- a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.eventlogger.js
+++ b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.eventlogger.js
@@ -1,6 +1,11 @@
/*!
* ULS Event logger
*
+ * See https://meta.wikimedia.org/wiki/Schema:UniversalLanguageSelector
+ *
+ * @private
+ * @since 2013.08
+ *
* Copyright (C) 2012-2013 Alolita Sharma, Amir Aharoni, Arun Ganesh, Brandon Harris,
* Niklas Laxström, Pau Giner, Santhosh Thottingal, Siebrand Mazeland and other
* contributors. See CREDITS for a list.
@@ -21,229 +26,203 @@
'use strict';
/**
- * ULS Event logger
- * See https://meta.wikimedia.org/wiki/Schema:UniversalLanguageSelector
+ * Try to emit an EventLogging event with schema 'UniversalLanguageSelector'.
+ *
+ * If EventLogging is not installed, this simply does nothing.
*
- * @since 2013.08
+ * @param {Object} event Event action and optional fields
*/
- function ULSEventLogger() {
- this.eventDefault = {
+ function log( event ) {
+ event = $.extend( {
version: 1,
token: mw.user.id(),
contentLanguage: mw.config.get( 'wgContentLanguage' ),
interfaceLanguage: mw.config.get( 'wgUserLanguage' )
+ }, event );
+
+ mw.track( 'event.UniversalLanguageSelector', event );
+ }
+
+ /**
+ * Log language settings open
+ *
+ * @param {string} context Where it was opened from
+ */
+ function ulsSettingsOpen( context ) {
+ log( {
+ action: 'settings-open',
+ context: context
+ } );
+ }
+
+ /**
+ * Log language revert
+ *
+ * @param {jQuery.Deferred} deferred
+ */
+ function ulsLanguageRevert( deferred ) {
+ log( { action: 'ui-lang-revert' } );
+ deferred.resolve();
+ }
+
+ /**
+ * Log IME disabling
+ *
+ * @param {string} context Where the setting was changed.
+ */
+ function disableIME( context ) {
+ log( { action: 'ime-disable', context: context } );
+ }
+
+ /**
+ * Log IME enabling
+ *
+ * @param {string} context Where the setting was changed.
+ */
+ function enableIME( context ) {
+ log( { action: 'ime-enable', context: context } );
+ }
+
+ /**
+ * Log IME change
+ *
+ * @param {string} inputMethod
+ */
+ function changeIME( inputMethod ) {
+ log( {
+ action: 'ime-change',
+ inputMethod: inputMethod
+ } );
+ }
+
+ /**
+ * Log login link click in display settings.
+ *
+ * @param {jQuery.Deferred} deferred
+ */
+ function loginClick( deferred ) {
+ log( { action: 'login-click' } );
+ deferred.resolve();
+ }
+
+ /**
+ * Log when "More languages" item in IME menu is clicked.
+ */
+ function imeMoreLanguages() {
+ log( {
+ action: 'more-languages-access',
+ context: 'ime'
+ } );
+ }
+
+ /**
+ * Log interface language change
+ *
+ * @param {string} language language code
+ * @param {jQuery.Deferred} deferred
+ */
+ function interfaceLanguageChange( language, deferred ) {
+ var logParams = {
+ action: 'language-change',
+ context: 'interface',
+ interfaceLanguage: language
};
- this.schemaDefault = 'UniversalLanguageSelector';
- this.listen();
+
+ log( logParams );
+ deferred.resolve();
}
- ULSEventLogger.prototype = {
- /**
- * Local wrapper for 'mw.eventLog.logEvent'
- *
- * @param {Object} event Event action and optional fields
- * @param {string} schema The schema; 'UniversalLanguageSelector' is the default
- * @return {jQuery.Promise} jQuery Promise object for the logging call
- */
- log: function ( event, schema ) {
- // FIXME: We need to create our own deferred for two reasons:
- // - logEvent might not be executed immediately
- // - we cannot reject a promise returned by it
- // So we proxy the original promises status updates.
- var deferred = $.Deferred();
-
- schema = schema || this.schemaDefault;
-
- if ( schema === this.schemaDefault ) {
- event = $.extend( {}, this.eventBase, event );
- }
-
- mw.eventLog.logEvent( schema, event )
- .done( deferred.resolve )
- .fail( deferred.reject );
-
- return deferred.promise();
- },
-
- /**
- * Listen for event logging
- */
- listen: function () {
- // Register handlers for event logging triggers
- mw.hook( 'mw.uls.settings.open' ).add( this.ulsSettingsOpen.bind( this ) );
- mw.hook( 'mw.uls.language.revert' ).add( this.ulsLanguageRevert.bind( this ) );
- mw.hook( 'mw.uls.ime.enable' ).add( this.enableIME.bind( this ) );
- mw.hook( 'mw.uls.ime.disable' ).add( this.disableIME.bind( this ) );
- mw.hook( 'mw.uls.ime.change' ).add( this.changeIME.bind( this ) );
- mw.hook( 'mw.uls.login.click' ).add( this.loginClick.bind( this ) );
- mw.hook( 'mw.uls.ime.morelanguages' ).add( this.imeMoreLanguages.bind( this ) );
- mw.hook( 'mw.uls.interface.morelanguages' ).add( this.interfaceMoreLanguages.bind( this ) );
- mw.hook( 'mw.uls.interface.language.change' ).add( this.interfaceLanguageChange.bind( this ) );
- mw.hook( 'mw.uls.font.change' ).add( this.fontChange.bind( this ) );
- mw.hook( 'mw.uls.webfonts.enable' ).add( this.enableWebfonts.bind( this ) );
- mw.hook( 'mw.uls.webfonts.disable' ).add( this.disableWebfonts.bind( this ) );
-
- $( 'body' ).on( 'noresults.uls', '.uls-menu .uls-languagefilter',
- this.noSearchResults.bind( this )
- );
- },
-
- /**
- * Log language settings open
- *
- * @param {string} context Where it was opened from
- */
- ulsSettingsOpen: function ( context ) {
- this.log( {
- action: 'settings-open',
- context: context
- } );
- },
-
- /**
- * Log language revert
- *
- * @param {jQuery.Deferred} deferred
- */
- ulsLanguageRevert: function ( deferred ) {
- this.log( { action: 'ui-lang-revert' } ).always( deferred.resolve() );
- },
-
- /**
- * Log IME disabling
- *
- * @param {string} context Where the setting was changed.
- */
- disableIME: function ( context ) {
- this.log( { action: 'ime-disable', context: context } );
- },
-
- /**
- * Log IME enabling
- *
- * @param {string} context Where the setting was changed.
- */
- enableIME: function ( context ) {
- this.log( { action: 'ime-enable', context: context } );
- },
-
- /**
- * Log IME change
- *
- * @param {string} inputMethod
- */
- changeIME: function ( inputMethod ) {
- this.log( {
- action: 'ime-change',
- inputMethod: inputMethod
- } );
- },
-
- /**
- * Log login link click in display settings.
- *
- * @param {jQuery.Deferred} deferred
- */
- loginClick: function ( deferred ) {
- this.log( { action: 'login-click' } ).always( deferred.resolve );
- },
-
- /**
- * More languages item in IME menu is clicked
- */
- imeMoreLanguages: function () {
- this.log( {
- action: 'more-languages-access',
- context: 'ime'
- } );
- },
-
- /**
- * Log interface language change
- *
- * @param {string} language language code
- * @param {jQuery.Deferred} deferred
- */
- interfaceLanguageChange: function ( language, deferred ) {
- var logParams = {
- action: 'language-change',
- context: 'interface',
- interfaceLanguage: language
- };
-
- this.log( logParams ).always( deferred.resolve );
- },
-
- /**
- * More languages in display settings is clicked
- */
- interfaceMoreLanguages: function () {
- this.log( {
- action: 'more-languages-access',
- context: 'interface'
- } );
- },
-
- /**
- * Log font preference changes
- *
- * @param {string} context Either 'interface' or 'content'
- * @param {string} language
- * @param {string} font
- */
- fontChange: function ( context, language, font ) {
- var logParams = {
- action: 'font-change',
- context: context
- };
-
- if ( context === 'interface' ) {
- $.extend( logParams, {
- interfaceFont: font,
- // Override in case the user changed the ui language but hasn't applied it yet
- interfaceLanguage: language
- } );
- } else {
- logParams.contentFont = font;
- }
-
- this.log( logParams );
- },
-
- /**
- * Log webfonts disabling
- *
- * @param {string} context Where the setting was changed.
- */
- disableWebfonts: function ( context ) {
- this.log( { action: 'webfonts-disable', context: context } );
- },
-
- /**
- * Log webfonts enabling
- *
- * @param {string} context Where the setting was changed.
- */
- enableWebfonts: function ( context ) {
- this.log( { action: 'webfonts-enable', context: context } );
- },
-
- /**
- * Log search strings which produce no search results.
- *
- * @param {jQuery.event} event The original event
- * @param {Object} data Information about the failed search
- */
- noSearchResults: function ( event, data ) {
- this.log( {
- action: 'no-search-results',
- context: data.query,
- ulsPurpose: data.ulsPurpose,
- title: mw.config.get( 'wgPageName' )
- } );
+ /**
+ * More languages in display settings is clicked
+ */
+ function interfaceMoreLanguages() {
+ log( {
+ action: 'more-languages-access',
+ context: 'interface'
+ } );
+ }
+
+ /**
+ * Log font preference changes
+ *
+ * @param {string} context Either 'interface' or 'content'
+ * @param {string} language
+ * @param {string} font
+ */
+ function fontChange( context, language, font ) {
+ var logParams = {
+ action: 'font-change',
+ context: context
+ };
+
+ if ( context === 'interface' ) {
+ logParams.interfaceFont = font;
+ // Override in case the user changed the ui language but hasn't applied it yet
+ logParams.interfaceLanguage = language;
+ } else {
+ logParams.contentFont = font;
}
- };
- mw.uls = mw.uls || {};
- mw.uls.eventlogger = new ULSEventLogger();
+ log( logParams );
+ }
+
+ /**
+ * Log webfonts disabling
+ *
+ * @param {string} context Where the setting was changed.
+ */
+ function disableWebfonts( context ) {
+ log( { action: 'webfonts-disable', context: context } );
+ }
+
+ /**
+ * Log webfonts enabling
+ *
+ * @param {string} context Where the setting was changed.
+ */
+ function enableWebfonts( context ) {
+ log( { action: 'webfonts-enable', context: context } );
+ }
+
+ /**
+ * Log search strings which produce no search results.
+ *
+ * @param {jQuery.event} event The original event
+ * @param {Object} data Information about the failed search
+ */
+ function noSearchResults( event, data ) {
+ log( {
+ action: 'no-search-results',
+ context: data.query,
+ ulsPurpose: data.ulsPurpose,
+ title: mw.config.get( 'wgPageName' )
+ } );
+ }
+
+ /**
+ * Start listening for event logging
+ */
+ function listen() {
+ // Register handlers for event logging triggers
+ mw.hook( 'mw.uls.settings.open' ).add( ulsSettingsOpen );
+ mw.hook( 'mw.uls.language.revert' ).add( ulsLanguageRevert );
+ mw.hook( 'mw.uls.ime.enable' ).add( enableIME );
+ mw.hook( 'mw.uls.ime.disable' ).add( disableIME );
+ mw.hook( 'mw.uls.ime.change' ).add( changeIME );
+ mw.hook( 'mw.uls.login.click' ).add( loginClick );
+ mw.hook( 'mw.uls.ime.morelanguages' ).add( imeMoreLanguages );
+ mw.hook( 'mw.uls.interface.morelanguages' ).add( interfaceMoreLanguages );
+ mw.hook( 'mw.uls.interface.language.change' ).add( interfaceLanguageChange );
+ mw.hook( 'mw.uls.font.change' ).add( fontChange );
+ mw.hook( 'mw.uls.webfonts.enable' ).add( enableWebfonts );
+ mw.hook( 'mw.uls.webfonts.disable' ).add( disableWebfonts );
+
+ $( document.body ).on(
+ 'noresults.uls',
+ '.uls-menu .uls-languagefilter',
+ noSearchResults
+ );
+ }
+
+ listen();
}() );
diff --git a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.ime.js b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.ime.js
index 117777c7..e0f50283 100644
--- a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.ime.js
+++ b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.ime.js
@@ -150,7 +150,7 @@
defaultModule: 'input',
onClose: function () {
// on close of input settings, keep focus in input area.
- imeselector.$element.focus();
+ imeselector.$element.trigger( 'focus' );
},
top: imeselector.$element.offset().top
} );
@@ -226,7 +226,7 @@
var imeSelectors = mw.config.get( 'wgULSImeSelectors' ).join( ', ' );
mw.ime.init();
- $( 'body' ).on( 'focus.ime', imeSelectors, function () {
+ $( document.body ).on( 'focus.ime', imeSelectors, function () {
mw.ime.handleFocus( $( this ) );
} );
};
@@ -235,7 +235,7 @@
* Loads necessary dependencies, checks input for validity and
* adds the ime menu for elements that should have it.
*
- * @param {jquery.Element} $input
+ * @param {jQuery} $input
* @since 2013.11
*/
mw.ime.handleFocus = function ( $input ) {
@@ -272,7 +272,7 @@
/**
* Just adds ime menu to any input element.
*
- * @param {jquery.Element} $input
+ * @param {jQuery} $input
* @since 2013.11
*/
mw.ime.addIme = function ( $input ) {
@@ -291,7 +291,7 @@
$ulsTrigger.uls( {
onSelect: function ( language ) {
$input.data( 'imeselector' ).selectLanguage( language );
- $input.focus();
+ $input.trigger( 'focus' );
},
languages: mw.ime.getLanguagesWithIME(),
ulsPurpose: 'ime-selector',
@@ -308,7 +308,7 @@
title: $.i18n( 'ext-uls-ime-help' )
} )
.addClass( 'ime-perime-help' )
- .click( function ( event ) {
+ .on( 'click', function ( event ) {
event.stopPropagation();
} );
}
diff --git a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.inputsettings.js b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.inputsettings.js
index f3d47733..099e2a1a 100644
--- a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.inputsettings.js
+++ b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.inputsettings.js
@@ -80,11 +80,11 @@
*/
render: function () {
var $enabledOnly,
- webfonts = $( 'body' ).data( 'webfonts' );
+ webfonts = $( document.body ).data( 'webfonts' );
this.dirty = false;
this.$parent.$settingsPanel.empty();
- this.$imes = $( 'body' ).data( 'ime' );
+ this.$imes = $( document.body ).data( 'ime' );
this.$parent.$settingsPanel.append( this.$template );
$enabledOnly = this.$template.find( '.enabled-only' );
if ( $.ime.preferences.isEnabled() ) {
@@ -173,7 +173,8 @@
$imeLabel = $( '<label>' ).attr( 'for', imeId );
- $inputMethodItem = $( '<input type="radio">' ).attr( {
+ $inputMethodItem = $( '<input>' ).attr( {
+ type: 'radio',
name: 'ime',
id: imeId,
value: imeId
@@ -306,7 +307,7 @@
$button.on( 'click', buttonHandler( $button ) );
if ( language === selectedImeLanguage ) {
- $button.click();
+ $button.trigger( 'click' );
}
}
@@ -339,7 +340,7 @@
.i18n()
.text( ' ' );
- $back.click( function () {
+ $back.on( 'click', function () {
uls.hide();
inputSettings.$parent.show();
} );
@@ -350,11 +351,11 @@
uls.$menu.find( '.uls-search-wrapper' ).wrap( $wrap );
uls.$menu.find( '.uls-search-wrapper-wrapper' ).prepend( $back );
- if ( $( '.uls-settings-trigger' ).offset().left > $( window ).width() / 2 ) {
- uls.$menu.removeClass( 'selector-left' ).addClass( 'selector-right' );
- } else {
- uls.$menu.removeClass( 'selector-right' ).addClass( 'selector-left' );
- }
+ // Copy callout related classes from parent
+ // eslint-disable-next-line no-jquery/no-class-state
+ uls.$menu.toggleClass( 'selector-left', inputSettings.$parent.$window.hasClass( 'selector-left' ) );
+ // eslint-disable-next-line no-jquery/no-class-state
+ uls.$menu.toggleClass( 'selector-right', inputSettings.$parent.$window.hasClass( 'selector-right' ) );
},
onVisible: function () {
var $parent;
@@ -362,6 +363,7 @@
this.$menu.find( '.uls-languagefilter' )
.prop( 'placeholder', $.i18n( 'ext-uls-input-settings-ui-language' ) );
+ // eslint-disable-next-line no-jquery/no-class-state
if ( !inputSettings.$parent.$window.hasClass( 'callout' ) ) {
// callout menus will have position rules. others use
// default position
@@ -378,6 +380,7 @@
this.$menu.css( 'top', $parent.css( 'top' ) );
}
+ // eslint-disable-next-line no-jquery/no-class-state
if ( inputSettings.$parent.$window.hasClass( 'callout' ) ) {
this.$menu.addClass( 'callout callout--languageselection' );
} else {
diff --git a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.interface.js b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.interface.js
index f6043623..9004b4d5 100644
--- a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.interface.js
+++ b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.interface.js
@@ -79,7 +79,7 @@
};
}
$.extend( displaySettingsOptions, uls.position() );
- $displaySettings.languagesettings( displaySettingsOptions ).click();
+ $displaySettings.languagesettings( displaySettingsOptions ).trigger( 'click' );
} );
}
@@ -104,7 +104,7 @@
},
top: position.top,
left: position.left
- } ).click();
+ } ).trigger( 'click' );
} );
}
@@ -140,15 +140,15 @@
// if the mouse is over the tooltip, do not hide
$( '.uls-tipsy' ).on( 'mouseover', function () {
- window.clearTimeout( tipsyTimer );
+ clearTimeout( tipsyTimer );
} ).on( 'mouseout', function () {
- tipsyTimer = window.setTimeout( hideTipsy, timeout );
+ tipsyTimer = setTimeout( hideTipsy, timeout );
} );
// hide the tooltip when clicked on it
$( '.uls-tipsy' ).on( 'click', hideTipsy );
- tipsyTimer = window.setTimeout( hideTipsy, timeout );
+ tipsyTimer = setTimeout( hideTipsy, timeout );
}
// remove any existing popups
@@ -162,7 +162,7 @@
ulsPopupPosition = 'after';
}
// Reverse for RTL
- if ( $( 'html' ).prop( 'dir' ) === 'rtl' ) {
+ if ( $( document.documentElement ).prop( 'dir' ) === 'rtl' ) {
ulsPopupPosition = ( ulsPopupPosition === 'after' ) ? 'before' : 'after';
}
} else {
@@ -182,7 +182,7 @@
.text( previousAutonym )
.prop( {
href: '',
- 'class': 'uls-prevlang-link',
+ class: 'uls-prevlang-link',
lang: previousLang,
// We could get dir from uls.data,
// but we are trying to avoid loading it
@@ -201,7 +201,7 @@
mw.hook( 'mw.uls.language.revert' ).fire( deferred );
// Delay is zero if event logging is not enabled
- window.setTimeout( function () {
+ setTimeout( function () {
deferred.resolve();
}, mw.config.get( 'wgULSEventLogging' ) * 500 );
} );
@@ -212,14 +212,16 @@
messageKey = 'ext-uls-undo-language-tooltip-text';
}
+ // Message keys listed above
+ // eslint-disable-next-line mediawiki/msg-doc
return $( '<p>' ).append( mw.message( messageKey, $link ).parseDom() );
}() )
} );
- ulsPopup.$element.appendTo( 'body' );
+ ulsPopup.$element.appendTo( document.body );
// The interlanguage position needs some time to settle down
- window.setTimeout( function () {
+ setTimeout( function () {
// Show the tipsy tooltip on page load.
showTipsy( 6000 );
}, 700 );
@@ -227,6 +229,7 @@
// manually show the tooltip
$ulsTrigger.on( 'mouseover', function () {
// show only if the ULS panel is not shown
+ // eslint-disable-next-line no-jquery/no-sizzle
if ( !$( '.uls-menu:visible' ).length ) {
showTipsy( 3000 );
}
@@ -293,7 +296,6 @@
if ( ulsTriggerOffset.left > $( window ).width() / 2 ) {
this.left = ulsTriggerOffset.left - this.$window.width() - caretRadius;
this.$window.removeClass( 'selector-left' ).addClass( 'selector-right' );
-
} else {
this.left = ulsTriggerOffset.left + ulsTriggerWidth + caretRadius;
this.$window.removeClass( 'selector-right' ).addClass( 'selector-left' );
@@ -311,7 +313,7 @@
};
mw.loader.using( mw.uls.languageSettingsModules, function () {
- $ulsTrigger.languagesettings( languageSettingsOptions ).click();
+ $ulsTrigger.languagesettings( languageSettingsOptions ).trigger( 'click' );
} );
e.stopPropagation();
@@ -372,7 +374,7 @@
// Allow styles to apply first and position to work by
// delaying the activation after them.
- window.setTimeout( function () {
+ setTimeout( function () {
$ulsTrigger.trigger( 'click', eventParams );
}, 0 );
} );
@@ -432,9 +434,9 @@
function initIme() {
var imeSelector = mw.config.get( 'wgULSImeSelectors' ).join( ', ' );
- $( 'body' ).on( 'focus.imeinit', imeSelector, function () {
+ $( document.body ).on( 'focus.imeinit', imeSelector, function () {
var $input = $( this );
- $( 'body' ).off( '.imeinit' );
+ $( document.body ).off( '.imeinit' );
mw.loader.using( 'ext.uls.ime', function () {
mw.ime.setup();
mw.ime.handleFocus( $input );
diff --git a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.languagesettings.js b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.languagesettings.js
index 177a40e3..467f361b 100644
--- a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.languagesettings.js
+++ b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.languagesettings.js
@@ -68,7 +68,7 @@
constructor: LanguageSettings,
init: function () {
- $( 'body' ).append( this.$window );
+ $( document.body ).append( this.$window );
this.hide();
},
@@ -81,7 +81,7 @@
this.$window.find( 'button.uls-settings-apply' )
.on( 'click', mw.hook( 'mw.uls.settings.apply' ).fire.bind( this ) );
// Hide the window when clicked outside
- $( 'html' ).click( this.hide.bind( this ) );
+ $( document.documentElement ).on( 'click', this.hide.bind( this ) );
// ... but when clicked on window do not hide.
this.$window.on( 'click', function ( event ) {
@@ -136,6 +136,9 @@
.addClass( 'settings-text' )
.attr( 'data-i18n', module.descriptionI18n );
$settingsLink = $( '<button>' )
+ // The following classes are used here:
+ // * display-settings-block
+ // * input-settings-block
.addClass( moduleName + '-settings-block menu-section' )
.prop( 'id', moduleName + '-panel-trigger' )
.data( 'module', module )
@@ -154,6 +157,7 @@
var $this = $( this );
$this.data( 'module' ).render();
+ // eslint-disable-next-line no-jquery/no-sizzle
if ( languageSettings.$window.is( ':visible' ) ) {
languageSettings.$window.scrollIntoView();
}
@@ -189,18 +193,18 @@
this.initialized = true;
}
// Close other modal windows which listen to click events outside them
- $( 'html' ).click();
+ $( document.documentElement ).trigger( 'click' );
this.i18n();
// Every time we show this window, make sure the current
// settings panels is up-to-date. So just click on active menu item.
- this.$window.find( '.settings-menu-items > .active' ).click();
+ this.$window.find( '.settings-menu-items > .active' ).trigger( 'click' );
this.shown = true;
this.$window.show();
this.visible();
this.$window.scrollIntoView();
// For keyboard navigation, put the focus on an element inside the dialog
- this.$window.find( '.menu-section.active' ).focus();
+ this.$window.find( '.menu-section.active' ).trigger( 'focus' );
},
/**
diff --git a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.preferences.js b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.preferences.js
index 0569fab4..0afc40b2 100644
--- a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.preferences.js
+++ b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.preferences.js
@@ -102,7 +102,7 @@
* Set the preference
*
* @param {string} key
- * @param {mixed} value
+ * @param {Mixed} value
*/
set: function ( key, value ) {
this.preferences[ key ] = value;
@@ -126,7 +126,7 @@
save: function ( callback ) {
var ulsPreferences = this;
- callback = callback || $.noop;
+ callback = callback || function () {};
if ( this.isAnon ) {
// Anonymous user. Save preferences in local storage
preferenceStore().set( this.preferenceName, this.preferences );
@@ -147,10 +147,10 @@
mw.uls = mw.uls || {};
mw.uls.preferences = function () {
- var data = $( 'body' ).data( 'preferences' );
+ var data = $( document.body ).data( 'preferences' );
if ( !data ) {
- $( 'body' ).data( 'preferences', ( data = new ULSPreferences() ) );
+ $( document.body ).data( 'preferences', ( data = new ULSPreferences() ) );
}
return data;
};
diff --git a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.setlang.js b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.setlang.js
new file mode 100644
index 00000000..c26a01ee
--- /dev/null
+++ b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.setlang.js
@@ -0,0 +1,149 @@
+/*!
+ * Loaded when setlang query paramter is set on the page.
+ *
+ * @private
+ * @since 2020.01
+ *
+ * Copyright (C) 2019-2020 Alolita Sharma, Amir Aharoni, Arun Ganesh, Brandon Harris,
+ * Niklas Laxström, Pau Giner, Santhosh Thottingal, Siebrand Mazeland and other
+ * contributors. See CREDITS for a list.
+ *
+ * UniversalLanguageSelector is dual licensed GPLv2 or later and MIT. You don't
+ * have to do anything special to choose one license or the other and you don't
+ * have to notify anyone which license you are using. You are free to use
+ * UniversalLanguageSelector in commercial projects as long as the copyright
+ * header is left intact. See files GPL-LICENSE and MIT-LICENSE for details.
+ *
+ * @file
+ * @ingroup Extensions
+ * @licence GNU General Public Licence 2.0 or later
+ * @licence MIT License
+ */
+
+( function () {
+ 'use strict';
+ var $cancelBtn, $acceptBtn;
+
+ function getHeading( languageName ) {
+ return $( '<h4>' ).text(
+ mw.msg( 'ext-uls-setlang-heading', languageName )
+ );
+ }
+
+ function getMessage( languageName, languageCode ) {
+ return $( '<p>' ).html(
+ mw.message(
+ 'ext-uls-setlang-message',
+ languageName,
+ languageCode
+ ).parse()
+ );
+ }
+
+ function getButtons() {
+ $cancelBtn = $( '<button>' )
+ .addClass( 'mw-ui-button uls-setlang-cancel' )
+ .text( mw.msg( 'ext-uls-setlang-cancel' ) );
+
+ $acceptBtn = $( '<button>' )
+ .addClass( 'mw-ui-button mw-ui-progressive active uls-setlang-apply' )
+ .text( mw.msg( 'ext-uls-setlang-accept' ) );
+
+ return $( '<div>' )
+ .addClass( 'language-setlang-buttons' )
+ .append(
+ $cancelBtn,
+ $acceptBtn
+ );
+ }
+
+ function toggleLoading( $btnSubmit, isLoading ) {
+ $btnSubmit
+ .text( mw.msg( isLoading ? 'ext-uls-setlang-loading' : 'ext-uls-setlang-accept' ) )
+ .prop( 'disabled', isLoading );
+ }
+
+ /**
+ * @return {string}
+ */
+ function currentUrlWithoutSetLang() {
+ var uri = new mw.Uri();
+ delete uri.query.setlang;
+ return uri.toString();
+ }
+
+ function removeSetLangFromHistory() {
+ if ( 'setlang' in mw.Uri().query ) {
+ history.replaceState( null, 'no-setlang-url', currentUrlWithoutSetLang() );
+ }
+ }
+
+ function updateLanguage( langCode ) {
+ var api = new mw.Api();
+ return api.postWithToken( 'csrf', {
+ action: 'ulssetlang',
+ languagecode: langCode,
+ formatversion: 2
+ } ).done( function () {
+ location.replace( currentUrlWithoutSetLang() );
+ } ).fail( function ( code, result ) {
+ var apiErrorInfo = result.error && result.error.info ||
+ mw.msg( 'ext-uls-setlang-unknown-error' );
+ mw.notify(
+ mw.msg( 'ext-uls-setlang-error', apiErrorInfo ),
+ {
+ type: 'error',
+ tag: 'uls-setlang-error'
+ }
+ );
+ } );
+ }
+
+ function createSetLangDialog( languageName, languageCode ) {
+ return $( '<div>' )
+ .addClass( 'uls-setlang-dialog' )
+ .append(
+ getHeading( languageName ),
+ getMessage( languageName, languageCode ),
+ getButtons()
+ ).appendTo( document.body );
+ }
+
+ function addSetLangDialogEvents( ulsDialog ) {
+ $acceptBtn.on( 'click', function () {
+ toggleLoading( $acceptBtn, true );
+ updateLanguage( mw.config.get( 'wgULSSetLangCode' ) ).fail( function () {
+ toggleLoading( $acceptBtn, false );
+ } );
+ } );
+
+ $cancelBtn.on( 'click', function () {
+ ulsDialog.close();
+ } );
+ }
+
+ $( function () {
+ var setLangCode = mw.config.get( 'wgULSSetLangCode' ),
+ setLangName = mw.config.get( 'wgULSSetLangName' ),
+ currentLangCode = mw.config.get( 'wgULSCurrentLangCode' ),
+ $ulsDialog, ulsSetLangDialog;
+
+ if ( currentLangCode === setLangCode ) {
+ removeSetLangFromHistory();
+ return;
+ }
+
+ // Setup and show the dialog
+ $ulsDialog = createSetLangDialog( setLangName, setLangCode );
+ ulsSetLangDialog = new mw.uls.Dialog( {
+ container: $ulsDialog,
+ hasOverlay: true,
+ afterClose: removeSetLangFromHistory
+ } );
+
+ addSetLangDialogEvents( ulsSetLangDialog );
+
+ setTimeout( ulsSetLangDialog.open );
+ } );
+
+}() );
diff --git a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.webfonts.js b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.webfonts.js
index 1a303568..cf942772 100644
--- a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.webfonts.js
+++ b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.webfonts.js
@@ -72,7 +72,7 @@
// MediaWiki specific overrides for jquery.webfonts
$.extend( $.fn.webfonts.defaults, {
repository: mediawikiFontRepository,
- fontStack: $( 'body' ).css( 'font-family' ).split( /, /g ),
+ fontStack: $( document.body ).css( 'font-family' ).split( /, /g ),
/**
* Returns a suitable font from font repository based
* on the given language and html classes and user preference.
@@ -127,7 +127,7 @@
// This is important because webfonts behavior depends on the font-family
// property values set by stylesheets.
setTimeout( function () {
- $( 'body' ).webfonts();
+ $( document.body ).webfonts();
}, 0 );
};
diff --git a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.webfonts.mobile.js b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.webfonts.mobile.js
index bf3bb800..aeb3e838 100644
--- a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.webfonts.mobile.js
+++ b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.webfonts.mobile.js
@@ -32,7 +32,7 @@
// MediaWiki specific overrides for jquery.webfonts
$.extend( $.fn.webfonts.defaults, {
repository: mediawikiFontRepository,
- fontStack: $( 'body' ).css( 'font-family' ).split( /, /g ),
+ fontStack: $( document.body ).css( 'font-family' ).split( /, /g ),
fontSelector: function ( repository, language ) {
var font = repository.defaultFont( language );
@@ -45,7 +45,7 @@
}
} );
- $( 'body' ).webfonts();
+ $( document.body ).webfonts();
} );
}() );
diff --git a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.webfonts.repository.js b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.webfonts.repository.js
index a6b50377..a3bab6ed 100644
--- a/MLEB/UniversalLanguageSelector/resources/js/ext.uls.webfonts.repository.js
+++ b/MLEB/UniversalLanguageSelector/resources/js/ext.uls.webfonts.repository.js
@@ -34,6 +34,11 @@
"East Syriac Adiabene",
"SertoUrhoy"
],
+ "ban-bali": [
+ "Vimala",
+ "Kadiri",
+ "Pustaka Bali"
+ ],
"bbc": [
"system",
"Pangururan"
@@ -71,13 +76,20 @@
],
"ckb": [
"system",
+ "Amiri",
"Lateef",
- "Scheherazade",
- "Amiri"
+ "Scheherazade"
],
"cr": [
"OskiEast"
],
+ "cu": [
+ "system",
+ "Fedorovsk",
+ "Menaion",
+ "Monomakh",
+ "Ponomar"
+ ],
"cy": [
"system",
"ComicNeue",
@@ -185,6 +197,11 @@
"ComicNeue",
"OpenDyslexic"
],
+ "id-bali": [
+ "Vimala",
+ "Kadiri",
+ "Pustaka Bali"
+ ],
"ii": [
"Nuosu SIL"
],
@@ -207,6 +224,11 @@
"jv-java": [
"Tuladha Jejeg"
],
+ "kaw-bali": [
+ "Vimala",
+ "Kadiri",
+ "Pustaka Bali"
+ ],
"kbg": [
"Jomolhari"
],
@@ -261,6 +283,11 @@
"ComicNeue",
"OpenDyslexic"
],
+ "ms-bali": [
+ "Vimala",
+ "Kadiri",
+ "Pustaka Bali"
+ ],
"muk": [
"Jomolhari"
],
@@ -307,6 +334,16 @@
"system",
"OpenDyslexic"
],
+ "sa-bali": [
+ "Vimala",
+ "Kadiri",
+ "Pustaka Bali"
+ ],
+ "sas-bali": [
+ "Vimala",
+ "Kadiri",
+ "Pustaka Bali"
+ ],
"saz": [
"Pagul"
],
@@ -467,6 +504,10 @@
"woff": "EstrangeloEdessa/SyrCOMEdessa.woff?c4484",
"woff2": "EstrangeloEdessa/SyrCOMEdessa.woff2?3e525"
},
+ "Fedorovsk": {
+ "woff": "Fedorovsk/FedorovskUnicode.woff?1659d",
+ "woff2": "Fedorovsk/FedorovskUnicode.woff2?245e3"
+ },
"FreeFont-Thaana": {
"woff": "FreeFontThana/FreeFont-Thaana.woff?0f06e",
"woff2": "FreeFontThana/FreeFont-Thaana.woff2?ad021",
@@ -552,6 +593,10 @@
"woff": "Junicode/Junicode-Italic.woff?c458b",
"woff2": "Junicode/Junicode-Italic.woff2?3fe39"
},
+ "Kadiri": {
+ "woff": "Kadiri/Kadiri.woff?1b711",
+ "woff2": "Kadiri/Kadiri.woff2?a266a"
+ },
"KhmerOS": {
"woff": "KhmerOS/KhmerOS.woff?2ef9e",
"woff2": "KhmerOS/KhmerOS.woff2?34973"
@@ -589,10 +634,18 @@
"woff": "LinuxLibertine/LinLibertine_RIah.woff?1c058",
"woff2": "LinuxLibertine/LinLibertine_RIah.woff2?4e887"
},
+ "Menaion": {
+ "woff": "Menaion/MenaionUnicode.woff?50cc6",
+ "woff2": "Menaion/MenaionUnicode.woff2?da37b"
+ },
"Miriam CLM": {
"woff": "MiriamCLM/MiriamCLM-Book.woff?28216",
"woff2": "MiriamCLM/MiriamCLM-Book.woff2?f3942"
},
+ "Monomakh": {
+ "woff": "Monomakh/MonomakhUnicode.woff?0a8b3",
+ "woff2": "Monomakh/MonomakhUnicode.woff2?ee286"
+ },
"Myanmar3": {
"woff": "Myanmar3/Myanmar3.woff?60817",
"woff2": "Myanmar3/Myanmar3.woff2?2b586"
@@ -684,8 +737,8 @@
"woff2": "OskiEast/oskieitalic.woff2?2745f"
},
"Padauk": {
- "woff": "Padauk/Padauk-Regular.woff?544be",
- "woff2": "Padauk/Padauk-Regular.woff2?97419"
+ "woff": "Padauk/Padauk-Regular.woff?e67df",
+ "woff2": "Padauk/Padauk-Regular.woff2?a9b3f"
},
"Pagul": {
"woff": "Pagul/Pagul.woff?4d3bf",
@@ -707,6 +760,14 @@
"woff": "Phetsarath/Phetsarath-Bold.woff?8c43d",
"woff2": "Phetsarath/Phetsarath-Bold.woff2?2d5a1"
},
+ "Ponomar": {
+ "woff": "Ponomar/PonomarUnicode.woff?05ed0",
+ "woff2": "Ponomar/PonomarUnicode.woff2?ea5c5"
+ },
+ "Pustaka Bali": {
+ "woff": "PustakaBali/PustakaBali.woff?cb41e",
+ "woff2": "PustakaBali/PustakaBali.woff2?743c0"
+ },
"RailwaySans": {
"woff": "RailwaySans/RailwaySans.woff?fda9a",
"woff2": "RailwaySans/RailwaySans.woff2?a6c17"
@@ -755,6 +816,10 @@
"woff": "UnifrakturMaguntia/UnifrakturMaguntia.woff?6ad8f",
"woff2": "UnifrakturMaguntia/UnifrakturMaguntia.woff2?23272"
},
+ "Vimala": {
+ "woff": "Vimala/Vimala.woff?e387b",
+ "woff2": "Vimala/Vimala.woff2?70690"
+ },
"lklug": {
"woff": "lklug/lklug.woff?57de7",
"woff2": "lklug/lklug.woff2?7d2c4"