From fd7b9ec652a89d65de8d4b5f0e8bb2cd74b96249 Mon Sep 17 00:00:00 2001 From: Santhosh Thottingal Date: Mon, 15 Jan 2018 09:47:15 +0530 Subject: [PATCH] Update jquery.uls to d122f37 * Do not group search results by region * Replace ULS trigger icon with monochromatic one * Custom no-results message support * Upgrade jquery in the example to 3.2.1 * Use .siblings to locate the suggestions, clear elements for efficiency * Removing assigned ids to elements that are not guaranteed to be unique * Use eslint and stylelint, fix all errors Update the language icon in ext.uls.pt module with new monochromatic one Also use custom style for monobook skin. Bug: T182539 Bug: T175769 Change-Id: I7341064cd0de367d933048c4800f951568747d11 --- extension.json | 3 + lib/jquery.uls/css/jquery.uls.css | 24 +- lib/jquery.uls/css/jquery.uls.grid.css | 40 ++- lib/jquery.uls/css/jquery.uls.lcd.css | 37 ++- lib/jquery.uls/css/jquery.uls.mobile.css | 19 +- lib/jquery.uls/i18n/cop.json | 5 +- lib/jquery.uls/i18n/mwl.json | 7 +- lib/jquery.uls/images/icon-language.png | Bin 802 -> 0 bytes lib/jquery.uls/images/icon-language.svg | 1 - lib/jquery.uls/images/language.png | Bin 0 -> 402 bytes lib/jquery.uls/images/language.svg | 1 + lib/jquery.uls/src/jquery.uls.core.js | 109 ++++---- lib/jquery.uls/src/jquery.uls.data.utils.js | 117 ++++----- .../src/jquery.uls.languagefilter.js | 147 +++++------ lib/jquery.uls/src/jquery.uls.lcd.js | 244 +++++++++++------- resources/css/ext.uls.pt-monobook.less | 6 + resources/css/ext.uls.pt.less | 10 +- 17 files changed, 421 insertions(+), 349 deletions(-) delete mode 100644 lib/jquery.uls/images/icon-language.png delete mode 100644 lib/jquery.uls/images/icon-language.svg create mode 100644 lib/jquery.uls/images/language.png create mode 100644 lib/jquery.uls/images/language.svg create mode 100644 resources/css/ext.uls.pt-monobook.less diff --git a/extension.json b/extension.json index 4bdae52b..2a1579fe 100644 --- a/extension.json +++ b/extension.json @@ -353,6 +353,9 @@ "ext.uls.pt": { "styles": "css/ext.uls.pt.less", "localBasePath": "resources", + "skinStyles": { + "monobook": "css/ext.uls.pt-monobook.less" + }, "remoteExtPath": "UniversalLanguageSelector/resources" }, "ext.uls.interlanguage": { diff --git a/lib/jquery.uls/css/jquery.uls.css b/lib/jquery.uls/css/jquery.uls.css index 6af44a57..90a224c3 100644 --- a/lib/jquery.uls/css/jquery.uls.css +++ b/lib/jquery.uls/css/jquery.uls.css @@ -1,8 +1,8 @@ .uls-trigger { - background: url('../images/icon-language.png') no-repeat left center; + background: url( ../images/language.png ) no-repeat left center; /* @embed */ - background-image: linear-gradient(transparent, transparent), url('../images/icon-language.svg'); - padding-left: 30px; + background-image: linear-gradient( transparent, transparent ), url( ../images/language.svg ); + padding-left: 24px; } .uls-menu { @@ -12,10 +12,10 @@ margin-top: 1px; background-color: #fff; border: 1px solid #ccc; - border-color: rgba(0, 0, 0, 0.2); - -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); + border-color: rgba( 0, 0, 0, 0.2 ); + -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; @@ -65,9 +65,9 @@ } .uls-search-label { - background: url('../images/search.png') no-repeat center center; + background: url( ../images/search.png ) no-repeat center center; /* @embed */ - background-image: linear-gradient(transparent, transparent), url('../images/search.svg'); + background-image: linear-gradient( transparent, transparent ), url( ../images/search.svg ); background-size: 20px; height: 32px; width: 44px; @@ -88,7 +88,7 @@ width: 100%; /* For the custom clear (X) icon */ padding: 6px 25px 6px 0; - outline: none; + outline: 0; border: 0; display: block; position: absolute; @@ -110,9 +110,9 @@ } .uls-languagefilter-clear { - background: url('../images/clear.png') no-repeat left center; + background: url( ../images/clear.png ) no-repeat left center; /* @embed */ - background-image: linear-gradient(transparent, transparent), url('../images/clear.svg'); + background-image: linear-gradient( transparent, transparent ), url( ../images/clear.svg ); background-size: 15px; cursor: pointer; height: 15px; diff --git a/lib/jquery.uls/css/jquery.uls.grid.css b/lib/jquery.uls/css/jquery.uls.grid.css index 9caf088c..f068a86d 100644 --- a/lib/jquery.uls/css/jquery.uls.grid.css +++ b/lib/jquery.uls/css/jquery.uls.grid.css @@ -32,15 +32,18 @@ } .grid .highlight { - background: #ffff99; + background: #ff9; } /* The Grid ---------------------- */ + .grid .row { width: 100%; max-width: none; min-width: 600px; margin: 0 auto; + /* Nicolas Gallagher's micro clearfix */ + *zoom: 1; } .grid .row .row { @@ -50,30 +53,25 @@ margin: 0 -5px; } +.grid .column, +.grid .columns { + float: left; + min-height: 1px; + padding: 0 5px; + position: relative; +} + .grid .row.collapse .column, .grid .row.collapse .columns { padding: 0; } -.grid .row .row { - width: auto; - max-width: none; - min-width: 0; - margin: 0 -5px; -} - .grid .row .row.collapse { margin: 0; } -.grid .column, .grid .columns { - float: left; - min-height: 1px; - padding: 0 5px; - position: relative; -} - -.grid .column.centered, .grid .columns.centered { +.grid .column.centered, +.grid .columns.centered { float: none; margin: 0 auto; } @@ -238,13 +236,9 @@ right: 83.333%; } -/* Nicolas Gallagher's micro clearfix */ -.grid .row { - *zoom: 1; -} - -.grid .row:before, .grid .row:after { - content: ""; +.grid .row:before, +.grid .row:after { + content: ''; display: table; } diff --git a/lib/jquery.uls/css/jquery.uls.lcd.css b/lib/jquery.uls/css/jquery.uls.lcd.css index 2e836b66..4d18a578 100644 --- a/lib/jquery.uls/css/jquery.uls.lcd.css +++ b/lib/jquery.uls/css/jquery.uls.lcd.css @@ -17,6 +17,10 @@ padding: 0 16px; } +.uls-lcd--no-quicklist [data-region="all"] .uls-lcd-region-title { + display: none; +} + .uls-lcd-region-section { margin-top: 10px; } @@ -36,6 +40,16 @@ margin: 0; } +.uls-language-block > ul { + /* + * We don't want any visible bullets in this list. Not by default anyway. + * Using very unspecific selector here to allow other classes to override. + * Bug because overflow: hidden is incompatible with bullets, also render + * the bullets inside the list in case there should be any. + */ + list-style: none none; +} + /* * Each block should have 16px padding on both sides. But because we already gave * 16px for the whole menu, we need to remove it for first and last items the blocks. @@ -53,17 +67,6 @@ padding-right: 0; } - -.uls-language-block > ul { - /* - * We don't want any visible bullets in this list. Not by default anyway. - * Using very unspecific selector here to allow other classes to override. - * Bug because overflow: hidden is incompatible with bullets, also render - * the bullets inside the list in case there should be any. - */ - list-style: none none; -} - .uls-language-block > ul > li { cursor: pointer; margin-left: 20px; @@ -103,6 +106,18 @@ vertical-align: middle; } +.uls-no-results-view { + display: none; +} + +.uls-lcd.uls-no-results > .uls-lcd-region-section { + display: none; +} + +.uls-lcd.uls-no-results > .uls-no-results-view { + display: block; +} + .uls-no-results-found-title { font-size: 16px; padding: 0 16px 0 28px; diff --git a/lib/jquery.uls/css/jquery.uls.mobile.css b/lib/jquery.uls/css/jquery.uls.mobile.css index f7dc7b66..f6ba97bc 100644 --- a/lib/jquery.uls/css/jquery.uls.mobile.css +++ b/lib/jquery.uls/css/jquery.uls.mobile.css @@ -1,4 +1,4 @@ -@media only screen and (max-width: 767px) { +@media only screen and ( max-width: 767px ) { .uls-mobile.uls-menu { width: 95%; @@ -40,7 +40,7 @@ float: none; } - .uls-mobile [class*="column"] + [class*="column"]:last-child { + .uls-mobile [ class*='column' ] + [ class*='column' ]:last-child { float: none; } @@ -48,7 +48,7 @@ .uls-mobile .uls-mobile .columns:before, .uls-mobile .column:after, .columns:after { - content: ""; + content: ''; display: table; } @@ -197,11 +197,12 @@ } /* Very large display targeting */ -@media only screen and (min-width: 1441px) { +@media only screen and ( min-width: 1441px ) { .uls-mobile .hide-for-small, .uls-mobile .hide-for-medium, .uls-mobile .hide-for-medium-down, - .hide-for-large, .show-for-large-up, + .hide-for-large, + .show-for-large-up, .show-for-xlarge { display: block !important; } @@ -217,7 +218,7 @@ } /* Medium display targeting */ -@media only screen and (max-width: 1279px) and (min-width: 768px) { +@media only screen and ( max-width: 1279px ) and ( min-width: 768px ) { .uls-mobile .hide-for-small, .uls-mobile .show-for-medium, .uls-mobile .show-for-medium-down, @@ -238,7 +239,7 @@ } /* Small display targeting */ -@media only screen and (max-width: 767px) { +@media only screen and ( max-width: 767px ) { .uls-mobile .show-for-small, .uls-mobile .hide-for-medium, .uls-mobile .show-for-medium-down, @@ -268,7 +269,7 @@ display: none !important; } -@media screen and (orientation: landscape) { +@media screen and ( orientation: landscape ) { .uls-mobile .show-for-landscape, .uls-mobile .hide-for-portrait { display: block !important; @@ -279,7 +280,7 @@ } } -@media screen and (orientation: portrait) { +@media screen and ( orientation: portrait ) { .uls-mobile .show-for-portrait, .uls-mobile .hide-for-landscape { display: block !important; diff --git a/lib/jquery.uls/i18n/cop.json b/lib/jquery.uls/i18n/cop.json index 6680102d..a6b8361a 100644 --- a/lib/jquery.uls/i18n/cop.json +++ b/lib/jquery.uls/i18n/cop.json @@ -7,7 +7,7 @@ }, "uls-region-WW": "ⲧⲏⲣⲙⲁⲓ", "uls-region-AM": "ⲁⲙⲉⲣⲓⲕⲏ", - "uls-region-AF": "ⲁϥⲣⲓⲕⲏ", + "uls-region-AF": "ⲁⲫⲣⲓⲕⲏ", "uls-region-EU": "ⲉⲩⲣⲱⲡⲏ", "uls-region-AS": "ⲁⲥⲓⲁ", "uls-region-ME": "ⲡⲓⲉⲃⲧ `ⲛⲑⲙⲏϯ", @@ -15,5 +15,6 @@ "uls-region-all": "ⲁⲥⲡⲓ ⲛⲓⲃⲉⲛ", "uls-no-results-found": "ⲁⲩϫⲓⲙⲓ ⲁⲛ ⲛⲓⲁⲡⲟⲧⲉⲗⲉⲥⲙⲁ", "uls-common-languages": "ⲛⲓⲁⲥⲡⲓ ⲁⲩϯⲙⲉⲩⲓ", - "uls-search-help": "ⲧⲉⲧⲉⲛϫⲉⲙϫⲟⲙ ϫⲉⲙⲣⲁⲧ ϩⲉⲛ `ⲫⲣⲁⲛ ⲛⲧⲉ ⲁⲥⲡⲓ, `ⲫⲣⲁⲛ ⲛⲧⲉ ⲓⲟⲡⲓⲥϧⲁⲓ , ISO ⲕⲱⲇⲓⲕⲟⲥ ⲛⲧⲉ ⲁⲥⲡⲓ ⲓⲉ ⲧⲉⲧⲉⲛϫⲉⲙϫⲟⲙ ⲥⲓⲛⲓ ϧⲁⲧⲉⲛⲙⲁⲛⲧⲉϭⲁ." + "uls-search-help": "ⲧⲉⲧⲉⲛϫⲉⲙϫⲟⲙ ϫⲉⲙⲣⲁⲧ ϩⲉⲛ `ⲫⲣⲁⲛ ⲛⲧⲉ ⲁⲥⲡⲓ, `ⲫⲣⲁⲛ ⲛⲧⲉ ⲓⲟⲡⲓⲥϧⲁⲓ , ISO ⲕⲱⲇⲓⲕⲟⲥ ⲛⲧⲉ ⲁⲥⲡⲓ ⲓⲉ ⲧⲉⲧⲉⲛϫⲉⲙϫⲟⲙ ⲥⲓⲛⲓ ϧⲁⲧⲉⲛⲙⲁⲛⲧⲉϭⲁ.", + "uls-search-placeholder": "ϫⲉⲙⲣⲁⲧⲕ `ⲛⲟⲩⲁⲥⲡⲓ" } diff --git a/lib/jquery.uls/i18n/mwl.json b/lib/jquery.uls/i18n/mwl.json index 53de32c4..a8f5c79e 100644 --- a/lib/jquery.uls/i18n/mwl.json +++ b/lib/jquery.uls/i18n/mwl.json @@ -1,7 +1,8 @@ { "@metadata": { "authors": [ - "MokaAkashiyaPT" + "MokaAkashiyaPT", + "Athena in Wonderland" ] }, "uls-region-WW": "Global", @@ -12,6 +13,10 @@ "uls-region-AS": "Ásia", "uls-region-ME": "Médio Ouriente", "uls-region-PA": "Pacífico", + "uls-region-all": "Todas las lhénguas", + "uls-no-results-found": "Nó fúrun ancontrados resultados", "uls-common-languages": "Lhénguas sugeridas", + "uls-no-results-suggestion-title": "Puode star antressado an:", + "uls-search-help": "Puode percurar pul nome de la lhéngua, pul tipo de abc, código ISO de la lhéngua, ó puode nabegar por region.", "uls-search-placeholder": "Percurar por lhéngua" } diff --git a/lib/jquery.uls/images/icon-language.png b/lib/jquery.uls/images/icon-language.png deleted file mode 100644 index d1f13178e874ff18bd0a4c64ad52822176101eb7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 802 zcmV+-1Ks?IP)|>FMd|>FMa`=;`U{=jZ3&-{0!$>gnm}>FMd|>FMg~>gnm}|NsB$>gwz3 z>#4u$)YR0;$;r{t(Ha^W>FMdylozlF+fSv0YtVX=!P*!OuucQ0VCB zT3T9cY;0|9ZGnoEnWV4R*VlG-c6@}5zrVjvPfuWGZGwV=$jHdU(cz@9y-7_`%-icJ zD=a4{DI6Rez|P&s*XJ=aHgR!rWMpKoudh~HV7$D%g^rkNad?ZBpB)|^AR!{!+S<_H z@Z8+o+1c59dwZgyq8}e1LPknGKtti-;b353#>U2IXlRd*kIT!;k(;Kv$k!Vi8ZzTW#02g#pPE!B~5FqUR%ZWA!U!vxiJl+9=Ck)@UFr0PncK`qZ5J^Nq zRCr!>&{JajvmfzS^)KXGfrki4@tTMRg$r8xw;LYRtfKOq~Heai)O=<5yOeE_9Q8yX( z^!D`+Xo!PG#3aUtVPw?l9G?Ia+2j=3?+|gujhM{%96a%bMZN^fWGky{>t0l3>lUV@ zGQMlxKR7%(J~5w?otV=Ms*I=2nry5dt gZLqBWP0nWQ2je$L^H_+fYXATM07*qoM6N<$g74R=^8f$< diff --git a/lib/jquery.uls/images/icon-language.svg b/lib/jquery.uls/images/icon-language.svg deleted file mode 100644 index 9f439beb..00000000 --- a/lib/jquery.uls/images/icon-language.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/lib/jquery.uls/images/language.png b/lib/jquery.uls/images/language.png new file mode 100644 index 0000000000000000000000000000000000000000..c8fcbc66c78a6bf0a37ad4329f71028628790a13 GIT binary patch literal 402 zcmV;D0d4+?P)ioz3Z}7Do>*XIyS zw}language \ No newline at end of file diff --git a/lib/jquery.uls/src/jquery.uls.core.js b/lib/jquery.uls/src/jquery.uls.core.js index a4071e32..986c8ab1 100644 --- a/lib/jquery.uls/src/jquery.uls.core.js +++ b/lib/jquery.uls/src/jquery.uls.core.js @@ -24,17 +24,17 @@ var template, ULS; // Region numbers in id attributes also appear in the langdb. - /*jshint multistr:true */ + // eslint-disable-next-line no-multi-str template = '
\