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

View File

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

View File

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

View File

@@ -1,7 +1,8 @@
{ {
"@metadata": { "@metadata": {
"authors": [ "authors": [
"Sagan" "Sagan",
"Ләйсән"
] ]
}, },
"uls-region-WW": "Бөтә донъя", "uls-region-WW": "Бөтә донъя",
@@ -12,9 +13,10 @@
"uls-region-AS": "Азия", "uls-region-AS": "Азия",
"uls-region-ME": "Яҡын Көнсығыш", "uls-region-ME": "Яҡын Көнсығыш",
"uls-region-PA": "Океания", "uls-region-PA": "Океания",
"uls-region-all": "Бөтә телдәр",
"uls-no-results-found": "Бер нимә лә табылманы", "uls-no-results-found": "Бер нимә лә табылманы",
"uls-common-languages": "Уртаҡ телдәр", "uls-common-languages": "Тәҡдим ителгән телдәр",
"uls-no-results-suggestion-title": "Бәлки, ошо телдәрҙе һайларһығыҙ:", "uls-no-results-suggestion-title": "Бәлки, ошо телдәрҙе һайларһығыҙ:",
"uls-search-help": "Телдең исеме, яҙмаһы, ISO коды йәки регионы буйынса эҙләй алаһығыҙ.", "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-common-languages": "Sugestataj lingvoj",
"uls-no-results-suggestion-title": "Vi eble interesiĝas pri:", "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-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": { "@metadata": {
"authors": [ "authors": [
"Santhosh.thottingal", "Santhosh.thottingal",
"Siddhartha Ghai" "Siddhartha Ghai",
"Sfic"
] ]
}, },
"uls-region-WW": "वैश्विक", "uls-region-WW": "वैश्विक",
@@ -13,9 +14,10 @@
"uls-region-AS": "एशिया", "uls-region-AS": "एशिया",
"uls-region-ME": "मध्य पूर्व", "uls-region-ME": "मध्य पूर्व",
"uls-region-PA": "प्रशांत", "uls-region-PA": "प्रशांत",
"uls-region-all": "सभी भाषाएँ",
"uls-no-results-found": "कोई परिणाम नहीं मिले", "uls-no-results-found": "कोई परिणाम नहीं मिले",
"uls-common-languages": "आम भाषाएँ", "uls-common-languages": "सुझावित भाषा",
"uls-no-results-suggestion-title": "आपके लिये संभवतः उपयोगी:", "uls-no-results-suggestion-title": "आपके लिये संभवतः उपयोगी:",
"uls-search-help": "आप भाषा के नाम, लिपि के नाम एवं भाषा के ISO कोड से खोज कर सकते हैं, और क्षेत्र अनुसार ब्राउज़ भी कर सकते हैं:", "uls-search-help": "आप भाषा के नाम, लिपि के नाम एवं भाषा के ISO कोड से खोज कर सकते हैं, और क्षेत्र अनुसार ब्राउज़ भी कर सकते हैं",
"uls-search-placeholder": "भाषा खोज" "uls-search-placeholder": "भाषा के लिए खोजें"
} }

View File

@@ -3,20 +3,23 @@
"authors": [ "authors": [
"Amazigh84", "Amazigh84",
"Mmistmurt", "Mmistmurt",
"Mezgoug" "Mezgoug",
"Belkacem77",
"SlimaneAmiri"
] ]
}, },
"uls-region-WW": "Deg umaḍal ummid", "uls-region-WW": "Deg umaḍal meṛṛa",
"uls-region-SP": "Uslig", "uls-region-SP": "Uzzig",
"uls-region-AM": "Tamrikt", "uls-region-AM": "Tamrikt",
"uls-region-AF": "Tafriqt", "uls-region-AF": "Tafriqt",
"uls-region-EU": "Turuft", "uls-region-EU": "Turuft",
"uls-region-AS": "Asya", "uls-region-AS": "Asya",
"uls-region-ME": "Asamar Alemmas", "uls-region-ME": "Asamar Alemmas",
"uls-region-PA": "Amelwi", "uls-region-PA": "Amelwi",
"uls-region-all": "Akk tutlayin",
"uls-no-results-found": "Ulac d acu i d-yufa.", "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-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-help": "Tzemreḍ ad tnadiḍ s yisem n tutlayt, s uskript, s tengalt ISO n tutlayt neγ inig s tmnaḍt.",
"uls-search-placeholder": "Anadi n tutlayt" "uls-search-placeholder": "Anadi γef tutlayt"
} }

View File

@@ -4,7 +4,8 @@
"George Animal", "George Animal",
"Bikarhêner", "Bikarhêner",
"Ghybu", "Ghybu",
"Velg" "Velg",
"Cûndûllah el-Kurdî"
] ]
}, },
"uls-region-WW": "Li hemû cîhanê", "uls-region-WW": "Li hemû cîhanê",
@@ -16,7 +17,7 @@
"uls-region-ME": "Rojhilata Navîn", "uls-region-ME": "Rojhilata Navîn",
"uls-region-PA": "Pasîfîk", "uls-region-PA": "Pasîfîk",
"uls-region-all": "Hemû ziman", "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-common-languages": "Zimanên pêşniyarkirî",
"uls-no-results-suggestion-title": "Pêwendîya we dikara bikişîne:", "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.", "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": [ "authors": [
"Robin0van0der0vliet", "Robin0van0der0vliet",
"Robin van der Vliet", "Robin van der Vliet",
"Pahles" "Pahles",
"Ooswesthoesbes"
] ]
}, },
"uls-region-WW": "Waereldwied", "uls-region-WW": "Waereldwied",
@@ -14,5 +15,10 @@
"uls-region-AS": "Azië", "uls-region-AS": "Azië",
"uls-region-ME": "Midde-Ooste", "uls-region-ME": "Midde-Ooste",
"uls-region-PA": "Pacifisch gebied", "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" "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": { "@metadata": {
"authors": [ "authors": [
"Tel'et" "Tel'et",
"Uzdil"
] ]
}, },
"uls-region-WW": "دۇنيادا", "uls-region-WW": "دۇنيادا",
@@ -12,9 +13,10 @@
"uls-region-AS": "ئاسىيا", "uls-region-AS": "ئاسىيا",
"uls-region-ME": "ئوتتۇرا شەرق", "uls-region-ME": "ئوتتۇرا شەرق",
"uls-region-PA": "ئاتلانتىك", "uls-region-PA": "ئاتلانتىك",
"uls-region-all": "بارلىق تىللار",
"uls-no-results-found": "نەتىجە تېپىلمىدى", "uls-no-results-found": "نەتىجە تېپىلمىدى",
"uls-common-languages": "ئورتاق تىللار", "uls-common-languages": "تەۋسىيە تىللار",
"uls-no-results-suggestion-title": "سىزنى بەلكىم قىزىقتۇرۇشى مۇمكىن:", "uls-no-results-suggestion-title": "سىزنى بەلكىم قىزىقتۇرۇشى مۇمكىن:",
"uls-search-help": "سىز تىل نامى بويىچە، يېزىق شەكلى نامى بويىچە، تىلنىڭ ISO كودى بويىچە ئىزدىيەلەيسىز ياكى رايون بويىچە كۆرەلەيسىز:", "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 () { success: function () {
this.$resultsView.show(); this.$resultsView.show();

View File

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