Update jquery.uls to 34df56f

* Translation updates, including new languages
* Improved styling to match WikimediaUI style guide
* Improved handling of "no search results"

Change-Id: Ic74025dad4b81f0377af217ed6ba2f88264dca2f
This commit is contained in:
Niklas Laxström
2017-09-12 08:23:29 +02:00
parent 140486973a
commit 546d0cd3d9
15 changed files with 119 additions and 71 deletions

View File

@@ -1,6 +1,6 @@
.uls-trigger {
/* @embed */
background: transparent url('../images/icon-language.png') no-repeat scroll left center;
background: url('../images/icon-language.png') no-repeat left center;
/* @embed */
background-image: -webkit-linear-gradient(transparent, transparent), url('../images/icon-language.svg');
/* @embed */
@@ -13,10 +13,9 @@
z-index: 1000;
display: none;
margin-top: 1px;
/* Styling */
background-color: #ffffff;
background-color: #fff;
border: 1px solid #ccc;
border: 1px solid 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);
@@ -51,11 +50,9 @@
}
.uls-search {
background-color: white;
background-color: #fff;
padding: 5px 16px;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #DDD;
border-bottom: 1px solid #ddd;
}
.grid .uls-search {
@@ -71,12 +68,11 @@
}
.uls-search-label {
background: transparent url('../images/search.png') no-repeat scroll right center;
background: url('../images/search.png') no-repeat center center;
background-image: -webkit-linear-gradient(transparent, transparent), url('../images/search.svg');
/* @embed */
background-image: linear-gradient(transparent, transparent), url('../images/search.svg');
background-size: 20px;
background-position: center center;
height: 32px;
width: 44px;
display: block;
@@ -96,10 +92,8 @@
width: 100%;
/* For the custom clear (X) icon */
padding: 6px 25px 6px 0;
outline: none;
border: none;
border: 0;
display: block;
position: absolute;
top: 0;
@@ -109,18 +103,18 @@
/* This is the actual input */
.uls-languagefilter {
background-color: transparent;
border: none;
color: #333;
border: 0;
color: #222;
}
/* This is the shadow input box showing completion suggestions */
.uls-filtersuggestion {
background-color: white;
color: #888;
background-color: #fff;
color: #777;
}
.uls-languagefilter-clear {
background: transparent url('../images/clear.png') no-repeat scroll left center;
background: url('../images/clear.png') no-repeat left center;
background-image: -webkit-linear-gradient(transparent, transparent), url('../images/clear.svg');
/* @embed */
background-image: linear-gradient(transparent, transparent), url('../images/clear.svg');

View File

@@ -7,13 +7,13 @@
*/
.uls-lcd {
background-color: #fcfcfc;
height: 20em;
/* Work around Chrome bug where it places scrollbar on the left in
* in RTL mode but actually reserves the place on the right side */
overflow-x: hidden;
overflow-y: auto;
width: auto;
background: #FCFCFC;
padding: 0 16px;
}
@@ -61,8 +61,7 @@
* Bug because overflow: hidden is incompatible with bullets, also render
* the bullets inside the list in case there should be any.
*/
list-style-image: none;
list-style-type: none;
list-style: none none;
}
.uls-language-block > ul > li {
@@ -88,7 +87,7 @@
.uls-language-block a {
cursor: pointer;
text-decoration: none;
color: #3366bb;
color: #36c;
font-size: 14px;
display: inline-block;
width: 100%;
@@ -104,24 +103,17 @@
vertical-align: middle;
}
/* TODO: ugly hack that forces last matching search results to shift down.
* They should be hidden properly.
*/
.uls-no-results-view {
height: 100%;
}
.uls-no-results-found-title {
font-size: 16px;
padding: 0 16px 0 28px;
border-bottom: none;
border-bottom: 0;
color: #555;
}
.uls-no-found-more {
background: #f8f8f8;
padding: 0 16px 0 44px;
font-size: 0.9em;
background: #F8F8F8;
width: 100%;
margin-top: 1.6em;
line-height: 1.6em;

View File

@@ -198,7 +198,6 @@
/* Very large display targeting */
@media only screen and (min-width: 1441px) {
.uls-mobile .hide-for-small,
.uls-mobile .hide-for-medium,
.uls-mobile .hide-for-medium-down,
@@ -216,9 +215,9 @@
display: none !important;
}
}
/* Medium display targeting */
@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,
@@ -237,9 +236,9 @@
display: none !important;
}
}
/* Small display targeting */
@media only screen and (max-width: 767px) {
.uls-mobile .show-for-small,
.uls-mobile .hide-for-medium,
.uls-mobile .show-for-medium-down,
@@ -292,18 +291,12 @@
}
/* Touch-enabled device targeting */
.uls-mobile .show-for-touch {
display: none !important;
}
.uls-mobile .hide-for-touch {
display: block !important;
}
.uls-mobile .touch .show-for-touch {
display: block !important;
}
.uls-mobile .show-for-touch,
.uls-mobile .touch .hide-for-touch {
display: none !important;
}
.uls-mobile .hide-for-touch,
.uls-mobile .touch .show-for-touch {
display: block !important;
}

View File

@@ -1,7 +1,8 @@
{
"@metadata": {
"authors": [
"Sagan"
"Sagan",
"Ләйсән"
]
},
"uls-region-WW": "Бөтә донъя",
@@ -12,9 +13,10 @@
"uls-region-AS": "Азия",
"uls-region-ME": "Яҡын Көнсығыш",
"uls-region-PA": "Океания",
"uls-region-all": "Бөтә телдәр",
"uls-no-results-found": "Бер нимә лә табылманы",
"uls-common-languages": "Уртаҡ телдәр",
"uls-common-languages": "Тәҡдим ителгән телдәр",
"uls-no-results-suggestion-title": "Бәлки, ошо телдәрҙе һайларһығыҙ:",
"uls-search-help": "Телдең исеме, яҙмаһы, ISO коды йәки регионы буйынса эҙләй алаһығыҙ.",
"uls-search-placeholder": "Эҙләү теле"
"uls-search-placeholder": "Тел буйынса эҙләү"
}

View File

@@ -0,0 +1,12 @@
{
"@metadata": {
"authors": [
"ⲁϩⲙⲉⲧ"
]
},
"uls-region-AM": "ⲁⲙⲉⲣⲓⲕⲏ",
"uls-region-AF": "ⲁϥⲣⲓⲕⲏ",
"uls-region-EU": "ⲉⲩⲣⲱⲡⲏ",
"uls-region-AS": "ⲁⲥⲓⲁ",
"uls-region-all": "ⲁⲥⲡⲓ ⲛⲓⲃⲉⲛ"
}

View File

@@ -20,5 +20,5 @@
"uls-common-languages": "Sugestataj lingvoj",
"uls-no-results-suggestion-title": "Vi eble interesiĝas pri:",
"uls-search-help": "Vi povas serĉi laŭ la lingvonomo, la skriptnomo aŭ la lingva ISO-kodo, aŭ vi povas foliumi laŭ regiono.",
"uls-search-placeholder": "Lingvoserĉo"
"uls-search-placeholder": "Serĉi lingvon"
}

View File

@@ -2,7 +2,8 @@
"@metadata": {
"authors": [
"Santhosh.thottingal",
"Siddhartha Ghai"
"Siddhartha Ghai",
"Sfic"
]
},
"uls-region-WW": "वैश्विक",
@@ -13,9 +14,10 @@
"uls-region-AS": "एशिया",
"uls-region-ME": "मध्य पूर्व",
"uls-region-PA": "प्रशांत",
"uls-region-all": "सभी भाषाएँ",
"uls-no-results-found": "कोई परिणाम नहीं मिले",
"uls-common-languages": "आम भाषाएँ",
"uls-common-languages": "सुझावित भाषा",
"uls-no-results-suggestion-title": "आपके लिये संभवतः उपयोगी:",
"uls-search-help": "आप भाषा के नाम, लिपि के नाम एवं भाषा के ISO कोड से खोज कर सकते हैं, और क्षेत्र अनुसार ब्राउज़ भी कर सकते हैं:",
"uls-search-placeholder": "भाषा खोज"
"uls-search-help": "आप भाषा के नाम, लिपि के नाम एवं भाषा के ISO कोड से खोज कर सकते हैं, और क्षेत्र अनुसार ब्राउज़ भी कर सकते हैं",
"uls-search-placeholder": "भाषा के लिए खोजें"
}

View File

@@ -3,20 +3,23 @@
"authors": [
"Amazigh84",
"Mmistmurt",
"Mezgoug"
"Mezgoug",
"Belkacem77",
"SlimaneAmiri"
]
},
"uls-region-WW": "Deg umaḍal ummid",
"uls-region-SP": "Uslig",
"uls-region-WW": "Deg umaḍal meṛṛa",
"uls-region-SP": "Uzzig",
"uls-region-AM": "Tamrikt",
"uls-region-AF": "Tafriqt",
"uls-region-EU": "Turuft",
"uls-region-AS": "Asya",
"uls-region-ME": "Asamar Alemmas",
"uls-region-PA": "Amelwi",
"uls-region-all": "Akk tutlayin",
"uls-no-results-found": "Ulac d acu i d-yufa.",
"uls-common-languages": "Tutlayin tinmilitin",
"uls-common-languages": "Tutlayin yettusumren",
"uls-no-results-suggestion-title": "Ma tebɣiḍ ad tisineḍ ayen nniḍen ɣef :",
"uls-search-help": "Tzemreḍ ad tḥffeḍ s tutlayt, s uskript, s tangalt ISO n tutlayt naγ inig s tama.",
"uls-search-placeholder": "Anadi n tutlayt"
"uls-search-help": "Tzemreḍ ad tnadiḍ s yisem n tutlayt, s uskript, s tengalt ISO n tutlayt neγ inig s tmnaḍt.",
"uls-search-placeholder": "Anadi γef tutlayt"
}

View File

@@ -4,7 +4,8 @@
"George Animal",
"Bikarhêner",
"Ghybu",
"Velg"
"Velg",
"Cûndûllah el-Kurdî"
]
},
"uls-region-WW": "Li hemû cîhanê",
@@ -16,7 +17,7 @@
"uls-region-ME": "Rojhilata Navîn",
"uls-region-PA": "Pasîfîk",
"uls-region-all": "Hemû ziman",
"uls-no-results-found": "Ti encam nehatin dîtin",
"uls-no-results-found": "Tu encam nehatin dîtin",
"uls-common-languages": "Zimanên pêşniyarkirî",
"uls-no-results-suggestion-title": "Pêwendîya we dikara bikişîne:",
"uls-search-help": "Hûn lêgerîna xwe li gor nava zimanê, koda ISOyê an jî li gor herêmê dikarin bikin.",

View File

@@ -3,7 +3,8 @@
"authors": [
"Robin0van0der0vliet",
"Robin van der Vliet",
"Pahles"
"Pahles",
"Ooswesthoesbes"
]
},
"uls-region-WW": "Waereldwied",
@@ -14,5 +15,10 @@
"uls-region-AS": "Azië",
"uls-region-ME": "Midde-Ooste",
"uls-region-PA": "Pacifisch gebied",
"uls-region-all": "Al spraoke",
"uls-no-results-found": "Gein rizzeltaote gevónje",
"uls-common-languages": "Spraoksuggesties",
"uls-no-results-suggestion-title": "Doe bös mesjiens geïnterseerdj in:",
"uls-search-help": "Doe kans zeuken op spraoknaam, sjrifnaam, ISO-code vanne spraok of doe kans blajere de regio.",
"uls-search-placeholder": "Sjpraok zeuke"
}

View File

@@ -0,0 +1,17 @@
{
"@metadata": {
"authors": [
"MokaAkashiyaPT"
]
},
"uls-region-WW": "Global",
"uls-region-SP": "Special",
"uls-region-AM": "América",
"uls-region-AF": "África",
"uls-region-EU": "Ouropa",
"uls-region-AS": "Ásia",
"uls-region-ME": "Médio Ouriente",
"uls-region-PA": "Pacífico",
"uls-common-languages": "Lhénguas sugeridas",
"uls-search-placeholder": "Percurar por lhéngua"
}

View File

@@ -0,0 +1,21 @@
{
"@metadata": {
"authors": [
"Saraiki"
]
},
"uls-region-WW": "پوری دنیا وچ",
"uls-region-SP": "خاص",
"uls-region-AM": "امریکہ",
"uls-region-AF": "افریقہ",
"uls-region-EU": "یورپ",
"uls-region-AS": "ایشیاء",
"uls-region-ME": "مشرق وسطی",
"uls-region-PA": "بحر الکاہل",
"uls-region-all": "ساریاں زباناں",
"uls-no-results-found": "کوئی نتیجہ نی لبھا",
"uls-common-languages": "تجویز کردہ زباناں",
"uls-no-results-suggestion-title": "تہاکوں ایندے وچ وی دلچسپی ہوسی",
"uls-search-help": "تساں زبان دے ناں، رسم الخط، زبان دے آئی ایس او کوڈ دے نال وی ڳول سڳدے ہو یا وت علاقے نال وی ڳول سڳدے ہو",
"uls-search-placeholder": "زبان دی ڳول"
}

View File

@@ -1,7 +1,8 @@
{
"@metadata": {
"authors": [
"Tel'et"
"Tel'et",
"Uzdil"
]
},
"uls-region-WW": "دۇنيادا",
@@ -12,9 +13,10 @@
"uls-region-AS": "ئاسىيا",
"uls-region-ME": "ئوتتۇرا شەرق",
"uls-region-PA": "ئاتلانتىك",
"uls-region-all": "بارلىق تىللار",
"uls-no-results-found": "نەتىجە تېپىلمىدى",
"uls-common-languages": "ئورتاق تىللار",
"uls-common-languages": "تەۋسىيە تىللار",
"uls-no-results-suggestion-title": "سىزنى بەلكىم قىزىقتۇرۇشى مۇمكىن:",
"uls-search-help": "سىز تىل نامى بويىچە، يېزىق شەكلى نامى بويىچە، تىلنىڭ ISO كودى بويىچە ئىزدىيەلەيسىز ياكى رايون بويىچە كۆرەلەيسىز:",
"uls-search-placeholder": "تىل ئىزدە"
"uls-search-placeholder": "تىل ئىزدەش"
}

View File

@@ -221,7 +221,7 @@
},
/**
* callback for results found context.
* Callback for results found context.
*/
success: function () {
this.$resultsView.show();

View File

@@ -31,7 +31,6 @@
.addClass( 'uls-no-results-found-title' )
.text( 'No results found' ),
$( '<div>' )
.attr( 'id', 'uls-no-found-more' )
.addClass( 'uls-no-found-more' )
.append(
$( '<div>' )
@@ -54,7 +53,7 @@
this.renderTimeout = null;
this.cachedQuicklist = null;
this.$element.append( $( noResultsTemplate ) );
this.$element.append( noResultsTemplate.clone() );
this.$noResults = this.$element.children( '.uls-no-results-view' );
this.render();
@@ -175,7 +174,7 @@
lcd = this;
this.$noResults.addClass( 'hide' );
this.$element.find( '.uls-lcd-region-section' ).each( function () {
this.$element.children( '.uls-lcd-region-section' ).each( function () {
var $region = $( this ),
regionCode = $region.attr( 'id' );
@@ -367,16 +366,20 @@
noResults: function () {
this.$noResults.removeClass( 'hide' );
this.$noResults.siblings( '.uls-lcd-region-section' ).addClass( 'hide' );
// Only build the data once
if ( this.$noResults.find( '.uls-lcd-region-title' ).length ) {
return;
}
var $suggestions = this.buildQuicklist().clone();
$suggestions.removeClass( 'hide' ).removeAttr( 'id' );
$suggestions.find( 'h3' )
.data( 'i18n', 'uls-no-results-suggestion-title' )
.text( 'You may be interested in:' )
.i18n();
this.$noResults.find( 'h2' ).after( $suggestions.show() );
this.$noResults.find( 'h2' ).after( $suggestions );
},
listen: function () {