Update jquery.uls from upstream
Like Iecec180ca01a40f0333e5b75914dcdb0c390f6b8
but includes also the unbreak fix by Hoo man
( https://github.com/wikimedia/jquery.uls/pull/238 ).
Updating to
d77da03dbf
Bug: T144871
Bug: T138235
Bug: T137870
Change-Id: I0bafd39385148fd09e7793805f698a43a237e204
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
.uls-trigger {
|
.uls-trigger {
|
||||||
/* @embed */
|
/* @embed */
|
||||||
background: transparent url('../images/icon-language.png') no-repeat scroll left center;
|
background: transparent url('../images/icon-language.png') no-repeat scroll left center;
|
||||||
@@ -51,64 +50,9 @@
|
|||||||
min-width: 150px;
|
min-width: 150px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uls-title-region a {
|
|
||||||
padding-left: 15px;
|
|
||||||
}
|
|
||||||
.uls-menu .uls-title {
|
|
||||||
font-weight: normal;
|
|
||||||
border: none;
|
|
||||||
padding-left: 15px;
|
|
||||||
font-size: 18pt;
|
|
||||||
line-height: 1.25em;
|
|
||||||
color: #555;
|
|
||||||
}
|
|
||||||
.uls-menu .uls-no-results-found-title {
|
|
||||||
font-size: 16pt;
|
|
||||||
font-weight: bold;
|
|
||||||
line-height: 1.5em;
|
|
||||||
padding-left: 6px;
|
|
||||||
padding-top: 10px;
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
border-bottom: none;
|
|
||||||
color: #555;
|
|
||||||
}
|
|
||||||
.uls-menu .uls-lcd-region-section .uls-lcd-region-title {
|
|
||||||
color: #777;
|
|
||||||
font-size: 14pt;
|
|
||||||
font-weight: lighter;
|
|
||||||
line-height: 1.5em;
|
|
||||||
padding-left: 0;
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
div.uls-region {
|
|
||||||
cursor: pointer;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
height: 120px;
|
|
||||||
border-bottom-color: transparent;
|
|
||||||
border-bottom-style: solid;
|
|
||||||
border-bottom-width: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uls-region a {
|
|
||||||
bottom: 2px;
|
|
||||||
left: 2px;
|
|
||||||
padding: 0;
|
|
||||||
position: absolute;
|
|
||||||
font-size: 13px;
|
|
||||||
line-height: 1.2em;
|
|
||||||
text-decoration: none;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
width: 99%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uls-search {
|
.uls-search {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
padding: 5px;
|
padding: 5px 16px;
|
||||||
border-bottom-width: 1px;
|
border-bottom-width: 1px;
|
||||||
border-bottom-style: solid;
|
border-bottom-style: solid;
|
||||||
border-bottom-color: #DDD;
|
border-bottom-color: #DDD;
|
||||||
@@ -121,7 +65,7 @@ div.uls-region {
|
|||||||
/* Make space for magnifying class on the front */
|
/* Make space for magnifying class on the front */
|
||||||
.uls-search-wrapper {
|
.uls-search-wrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-left: 40px;
|
padding-left: 44px;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
}
|
}
|
||||||
@@ -131,10 +75,10 @@ div.uls-region {
|
|||||||
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: 28px;
|
background-size: 20px;
|
||||||
background-position: center center;
|
background-position: center center;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
width: 40px;
|
width: 44px;
|
||||||
display: block;
|
display: block;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
@@ -147,7 +91,7 @@ div.uls-region {
|
|||||||
|
|
||||||
/* There are two input boxes. This class applies to both of them */
|
/* There are two input boxes. This class applies to both of them */
|
||||||
.uls-filterinput {
|
.uls-filterinput {
|
||||||
font-size: 18px;
|
font-size: 16px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
/* For the custom clear (X) icon */
|
/* For the custom clear (X) icon */
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
.uls-lcd-region-section ul li:hover {
|
/*
|
||||||
background-color: #eaeff7;
|
* Language Category Display (LCD) consists of multiple sections:
|
||||||
}
|
* - one to display when there are no search results (which might display suggested languages)
|
||||||
|
* - one for each region of the world, plus regions for world languages and suggested languages
|
||||||
|
* The regions consist of one or more rows (blocks) which consist of one-to-four columns. Each
|
||||||
|
* column is an ul element, and contains up to 8 li elements, each containing a link.
|
||||||
|
*/
|
||||||
|
|
||||||
.uls-lcd-region-section {
|
.uls-lcd {
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Language list */
|
|
||||||
.uls-language-list {
|
|
||||||
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 */
|
||||||
@@ -15,13 +14,47 @@
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
width: auto;
|
width: auto;
|
||||||
background: #FCFCFC;
|
background: #FCFCFC;
|
||||||
|
padding: 0 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uls-language-block ul {
|
.uls-lcd-region-section {
|
||||||
margin: 0 0 1.5em;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uls-language-list ul {
|
.uls-lcd-region-title {
|
||||||
|
color: #777;
|
||||||
|
font-size: 14px;
|
||||||
|
padding-left: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We need to have this as a grid row to push rest of the content below it, but resetting
|
||||||
|
* padding and margin so that calculating them for children is easier.
|
||||||
|
*/
|
||||||
|
.grid .uls-language-block.row {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
.grid .uls-language-block > ul {
|
||||||
|
margin: 0 0 20px 0;
|
||||||
|
padding: 0 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid .uls-language-block > ul:first-child {
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid .uls-language-block > ul:last-child {
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.uls-language-block > ul {
|
||||||
/*
|
/*
|
||||||
* We don't want any visible bullets in this list. Not by default anyway.
|
* 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.
|
* Using very unspecific selector here to allow other classes to override.
|
||||||
@@ -32,8 +65,10 @@
|
|||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uls-language-list li {
|
.uls-language-block > ul > li {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
margin-left: 20px;
|
||||||
|
padding: 8px;
|
||||||
/*
|
/*
|
||||||
* The directionality (ltr/rtl) for each list item is set dynamically
|
* The directionality (ltr/rtl) for each list item is set dynamically
|
||||||
* as HTML attributes in JavaScript. Setting directionality also applies
|
* as HTML attributes in JavaScript. Setting directionality also applies
|
||||||
@@ -46,17 +81,15 @@
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: looks unused */
|
.uls-language-block > ul > li:hover {
|
||||||
.uls-language-list strong {
|
background-color: #eaeff7;
|
||||||
text-decoration: underline;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.uls-language-list a {
|
.uls-language-block a {
|
||||||
font-weight: normal;
|
cursor: pointer;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: #3366bb;
|
color: #3366bb;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 1.6em;
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -71,16 +104,22 @@
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uls-language-block {
|
/* TODO: ugly hack that forces last matching search results to shift down.
|
||||||
width: 100%;
|
* They should be hidden properly.
|
||||||
}
|
*/
|
||||||
|
|
||||||
.uls-no-results-view {
|
.uls-no-results-view {
|
||||||
color: #555;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.uls-no-results-found-title {
|
||||||
|
font-size: 16px;
|
||||||
|
padding: 0 16px 0 28px;
|
||||||
|
border-bottom: none;
|
||||||
|
color: #555;
|
||||||
|
}
|
||||||
|
|
||||||
.uls-no-found-more {
|
.uls-no-found-more {
|
||||||
|
padding: 0 16px 0 44px;
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
background: #F8F8F8;
|
background: #F8F8F8;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -90,7 +129,3 @@
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uls-no-found-more a {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -22,11 +22,6 @@
|
|||||||
line-height: 1.7em;
|
line-height: 1.7em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uls-mobile div.uls-region {
|
|
||||||
width: 33% !important;
|
|
||||||
float: left !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uls-mobile .row {
|
.uls-mobile .row {
|
||||||
width: auto;
|
width: auto;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
"uls-region-ME": "الشرق الأوسط",
|
"uls-region-ME": "الشرق الأوسط",
|
||||||
"uls-region-PA": "المحيط الهادئ",
|
"uls-region-PA": "المحيط الهادئ",
|
||||||
"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": "يمكنك البحث بواسطة اسم اللغة, اسم السكريبت, رمز اللغة القياسي أو يمكنك تصفح حسب المنطقة:",
|
"uls-search-help": "يمكنك البحث بواسطة اسم اللغة, اسم السكريبت, رمز اللغة القياسي أو يمكنك التصفح حسب المنطقة.",
|
||||||
"uls-search-placeholder": "بحث عن لغة"
|
"uls-search-placeholder": "بحث عن لغة"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"@metadata": {
|
"@metadata": {
|
||||||
"authors": [
|
"authors": [
|
||||||
"रमेश सिंह बोहरा"
|
"रमेश सिंह बोहरा",
|
||||||
|
"Nirajan pant"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"uls-region-WW": "विश्वभर",
|
"uls-region-WW": "विश्वभर",
|
||||||
@@ -13,7 +14,8 @@
|
|||||||
"uls-region-ME": "मध्य पूर्व",
|
"uls-region-ME": "मध्य पूर्व",
|
||||||
"uls-region-PA": "प्रशान्त",
|
"uls-region-PA": "प्रशान्त",
|
||||||
"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-placeholder": "भाषा खोज अर"
|
"uls-search-placeholder": "भाषा खोज अर"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
"uls-region-AS": "Asia",
|
"uls-region-AS": "Asia",
|
||||||
"uls-region-ME": "Middle East",
|
"uls-region-ME": "Middle East",
|
||||||
"uls-region-PA": "Pacific",
|
"uls-region-PA": "Pacific",
|
||||||
|
"uls-region-all": "All languages",
|
||||||
"uls-no-results-found": "No results found",
|
"uls-no-results-found": "No results found",
|
||||||
"uls-common-languages": "Suggested languages",
|
"uls-common-languages": "Suggested languages",
|
||||||
"uls-no-results-suggestion-title": "You may be interested in:",
|
"uls-no-results-suggestion-title": "You may be interested in:",
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"uls-region-AS": "آسيا",
|
"uls-region-AS": "آسيا",
|
||||||
"uls-region-ME": "مئني خۊرتؤ",
|
"uls-region-ME": "مئني خۊرتؤ",
|
||||||
"uls-region-PA": "اۊقيانۊسˇ آرؤم",
|
"uls-region-PA": "اۊقيانۊسˇ آرؤم",
|
||||||
"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": "شۊمۊ تؤنين زوانˇ نؤمˇ أمرأ، رسم الخط، زوانˇ ايزؤ کؤد ىا شيمي سامؤنˇ أمرأ وامجين.",
|
"uls-search-help": "شۊمۊ تؤنين زوانˇ نؤمˇ أمرأ، رسم الخط، زوانˇ ايزؤ کؤد ىا شيمي سامؤنˇ أمرأ وامجين.",
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
"uls-region-ME": "Orient Mejan",
|
"uls-region-ME": "Orient Mejan",
|
||||||
"uls-region-PA": "Pacific",
|
"uls-region-PA": "Pacific",
|
||||||
"uls-no-results-found": "Cap de resultat pas trobat",
|
"uls-no-results-found": "Cap de resultat pas trobat",
|
||||||
"uls-common-languages": "Lengas comunas",
|
"uls-common-languages": "Lengas suggeridas",
|
||||||
"uls-no-results-suggestion-title": "Podètz èsser interessat per :",
|
"uls-no-results-suggestion-title": "Podètz èsser interessat per :",
|
||||||
"uls-search-help": "Podètz recercar per nom de lenga, per nom de l'escript, per còdi ISO de la lenga, o podètz navigar per region.",
|
"uls-search-help": "Podètz recercar per nom de lenga, per nom de l'escript, per còdi ISO de la lenga, o podètz navigar per region.",
|
||||||
"uls-search-placeholder": "Recèrca de lenga"
|
"uls-search-placeholder": "Recèrca de lenga"
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
"uls-region-AS": "Label for Asia",
|
"uls-region-AS": "Label for Asia",
|
||||||
"uls-region-ME": "Label for Middle East",
|
"uls-region-ME": "Label for Middle East",
|
||||||
"uls-region-PA": "Label for Pacific",
|
"uls-region-PA": "Label for Pacific",
|
||||||
|
"uls-region-all": "Label for all languages in narrow mode, where languages are not split by region.",
|
||||||
"uls-no-results-found": "Title text for 'No results found' section",
|
"uls-no-results-found": "Title text for 'No results found' section",
|
||||||
"uls-common-languages": "The ULS tries to guess the langugages that the user is most likely to pick. They are taken from geolocation (languages of the current country according to the IP address), previously selected languages, and the browser's accept-language. The list of these languages appears at the top of the ULS languages list, above the geographical regions. This is the title of that list.\n\nSee also {{msg-mw|Mobile-frontend-languages-structured-overlay-suggested-languages-header}}",
|
"uls-common-languages": "The ULS tries to guess the langugages that the user is most likely to pick. They are taken from geolocation (languages of the current country according to the IP address), previously selected languages, and the browser's accept-language. The list of these languages appears at the top of the ULS languages list, above the geographical regions. This is the title of that list.\n\nSee also {{msg-mw|Mobile-frontend-languages-structured-overlay-suggested-languages-header}}",
|
||||||
"uls-no-results-suggestion-title": "Title for language suggestion in 'no results found' screen",
|
"uls-no-results-suggestion-title": "Title for language suggestion in 'no results found' screen",
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
"uls-region-ME": "मध्यभूभागे",
|
"uls-region-ME": "मध्यभूभागे",
|
||||||
"uls-region-PA": "पॅसिफिक्",
|
"uls-region-PA": "पॅसिफिक्",
|
||||||
"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": "भाषा अन्विष्यताम्"
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
"uls-region-ME": "Oriènte de mesu.",
|
"uls-region-ME": "Oriènte de mesu.",
|
||||||
"uls-region-PA": "Patzìficu",
|
"uls-region-PA": "Patzìficu",
|
||||||
"uls-no-results-found": "Mancu unu resurtu agatau",
|
"uls-no-results-found": "Mancu unu resurtu agatau",
|
||||||
"uls-common-languages": "Limbas prus isseberas.",
|
"uls-common-languages": "Limbas impositadas.",
|
||||||
"uls-no-results-suggestion-title": "Podes essere interessadu in:",
|
"uls-no-results-suggestion-title": "Podes essere interessadu in:",
|
||||||
"uls-search-help": "Podes chircare tràmite nùmene de sa limba, nùmene de su script, còdighe ISO de sa limba o navigare tràmite regione:",
|
"uls-search-help": "Podes chircare pro mèdiu de su nùmene de sa limba, su nùmene de su script, su còdighe ISO de sa limba o navigare pro mèdiu de sa regione:",
|
||||||
"uls-search-placeholder": "Chirca de sa limba:"
|
"uls-search-placeholder": "Chirca de sa limba:"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
"@metadata": {
|
"@metadata": {
|
||||||
"authors": [
|
"authors": [
|
||||||
"Octahedron80"
|
"Octahedron80",
|
||||||
|
"Pon44695"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"uls-region-WW": "ทั่วโลก",
|
"uls-region-WW": "ทั่วโลก",
|
||||||
@@ -13,8 +14,8 @@
|
|||||||
"uls-region-ME": "ตะวันออกกลาง",
|
"uls-region-ME": "ตะวันออกกลาง",
|
||||||
"uls-region-PA": "แปซิฟิก",
|
"uls-region-PA": "แปซิฟิก",
|
||||||
"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": "ค้นหาภาษา"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
"uls-region-ME": "Trung Đông",
|
"uls-region-ME": "Trung Đông",
|
||||||
"uls-region-PA": "Châu Đại Dương",
|
"uls-region-PA": "Châu Đại Dương",
|
||||||
"uls-no-results-found": "Không tìm thấy kết quả",
|
"uls-no-results-found": "Không tìm thấy kết quả",
|
||||||
"uls-common-languages": "Ngôn ngữ thông dụng",
|
"uls-common-languages": "Ngôn ngữ gợi ý",
|
||||||
"uls-no-results-suggestion-title": "Bạn có thể quan tâm:",
|
"uls-no-results-suggestion-title": "Bạn có thể quan tâm:",
|
||||||
"uls-search-help": "Bạn có thể tìm kiếm theo tên ngôn ngữ, tên hệ thống chữ viết, hay mã ISO của ngôn ngữ hoặc duyệt theo khu vực.",
|
"uls-search-help": "Bạn có thể tìm kiếm theo tên ngôn ngữ, tên hệ thống chữ viết, hay mã ISO của ngôn ngữ hoặc duyệt theo khu vực.",
|
||||||
"uls-search-placeholder": "Tìm kiếm ngôn ngữ"
|
"uls-search-placeholder": "Tìm kiếm ngôn ngữ"
|
||||||
|
|||||||
@@ -91,7 +91,7 @@
|
|||||||
this.initialized = false;
|
this.initialized = false;
|
||||||
|
|
||||||
this.$languageFilter = this.$menu.find( '#uls-languagefilter' );
|
this.$languageFilter = this.$menu.find( '#uls-languagefilter' );
|
||||||
this.$resultsView = this.$menu.find( 'div.uls-language-list' );
|
this.$resultsView = this.$menu.find( '.uls-language-list' );
|
||||||
|
|
||||||
this.render();
|
this.render();
|
||||||
this.listen();
|
this.listen();
|
||||||
@@ -134,15 +134,25 @@
|
|||||||
* @returns {Object}
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
position: function () {
|
position: function () {
|
||||||
var pos;
|
var pos,
|
||||||
|
top = this.top,
|
||||||
|
left = this.left;
|
||||||
|
|
||||||
|
if ( top === undefined ) {
|
||||||
|
pos = $.extend( {}, this.$element.offset(), {
|
||||||
|
height: this.$element[ 0 ].offsetHeight
|
||||||
|
} );
|
||||||
|
top = pos.top + pos.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( left === undefined ) {
|
||||||
|
left = $( window ).width() / 2 - this.$menu.outerWidth() / 2;
|
||||||
|
}
|
||||||
|
|
||||||
pos = $.extend( {}, this.$element.offset(), {
|
|
||||||
height: this.$element[ 0 ].offsetHeight
|
|
||||||
} );
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
top: this.top !== undefined ? this.top : pos.top + pos.height,
|
top: top,
|
||||||
left: this.left !== undefined ? this.left : '25%'
|
left: left
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -157,7 +167,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.$menu.addClass( widthClasses[this.getMenuWidth()] );
|
this.$menu.addClass( widthClasses[this.getMenuWidth()] );
|
||||||
this.$menu.css( this.position() );
|
|
||||||
|
|
||||||
if ( !this.initialized ) {
|
if ( !this.initialized ) {
|
||||||
$( 'body' ).prepend( this.$menu );
|
$( 'body' ).prepend( this.$menu );
|
||||||
@@ -165,6 +174,7 @@
|
|||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.$menu.css( this.position() );
|
||||||
this.$menu.show();
|
this.$menu.show();
|
||||||
this.$menu.scrollIntoView();
|
this.$menu.scrollIntoView();
|
||||||
this.shown = true;
|
this.shown = true;
|
||||||
@@ -250,7 +260,7 @@
|
|||||||
languages: this.languages,
|
languages: this.languages,
|
||||||
columns: columnsOptions[ this.getMenuWidth() ],
|
columns: columnsOptions[ this.getMenuWidth() ],
|
||||||
|
|
||||||
quickList: languagesCount > 12 ? this.options.quickList : false,
|
quickList: languagesCount > 12 ? this.options.quickList : [],
|
||||||
clickhandler: $.proxy( this.select, this ),
|
clickhandler: $.proxy( this.select, this ),
|
||||||
source: this.$languageFilter,
|
source: this.$languageFilter,
|
||||||
showRegions: this.options.showRegions,
|
showRegions: this.options.showRegions,
|
||||||
@@ -348,7 +358,7 @@
|
|||||||
|
|
||||||
languagesCount = objectLength( this.options.languages );
|
languagesCount = objectLength( this.options.languages );
|
||||||
|
|
||||||
if ( languagesCount < 12 ) {
|
if ( languagesCount < 25 ) {
|
||||||
return 'narrow';
|
return 'narrow';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,7 +397,7 @@
|
|||||||
onSelect: null, // Callback function to be called when a language is selected
|
onSelect: null, // Callback function to be called when a language is selected
|
||||||
searchAPI: null, // Language search API
|
searchAPI: null, // Language search API
|
||||||
languages: $.uls.data.getAutonyms(), // Languages to be used for ULS, default is all languages
|
languages: $.uls.data.getAutonyms(), // Languages to be used for ULS, default is all languages
|
||||||
quickList: null, // Array of language codes or function that returns such
|
quickList: [], // Array of language codes or function that returns such
|
||||||
// The options are wide (4 columns), medium (2 columns), and narrow (1 column).
|
// The options are wide (4 columns), medium (2 columns), and narrow (1 column).
|
||||||
// If not specified, it will be set automatically.
|
// If not specified, it will be set automatically.
|
||||||
menuWidth: null,
|
menuWidth: null,
|
||||||
|
|||||||
@@ -24,18 +24,18 @@
|
|||||||
|
|
||||||
var noResultsTemplate, LanguageCategoryDisplay;
|
var noResultsTemplate, LanguageCategoryDisplay;
|
||||||
|
|
||||||
noResultsTemplate = $( '<div>' ).addClass( 'twelve columns uls-no-results-view hide' );
|
noResultsTemplate = $( '<div>' ).addClass( 'uls-no-results-view hide' );
|
||||||
noResultsTemplate.append(
|
noResultsTemplate.append(
|
||||||
$( '<h2>' )
|
$( '<h2>' )
|
||||||
.attr( 'data-i18n', 'uls-no-results-found' )
|
.attr( 'data-i18n', 'uls-no-results-found' )
|
||||||
.addClass( 'eleven columns offset-by-one 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' )
|
.attr( 'id', 'uls-no-found-more' )
|
||||||
.addClass( 'uls-no-found-more' )
|
.addClass( 'uls-no-found-more' )
|
||||||
.append(
|
.append(
|
||||||
$( '<div>' )
|
$( '<div>' )
|
||||||
.addClass( 'ten columns offset-by-one' )
|
.addClass( '' )
|
||||||
.append(
|
.append(
|
||||||
$( '<p>' ).append(
|
$( '<p>' ).append(
|
||||||
$( '<span>' ).text( 'You can search by language name, script name, ISO code of language or you can browse by region.' )
|
$( '<span>' ).text( 'You can search by language name, script name, ISO code of language or you can browse by region.' )
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
LanguageCategoryDisplay = function ( element, options ) {
|
LanguageCategoryDisplay = function ( element, options ) {
|
||||||
this.$element = $( element );
|
this.$element = $( element );
|
||||||
this.options = $.extend( {}, $.fn.lcd.defaults, options );
|
this.options = $.extend( {}, $.fn.lcd.defaults, options );
|
||||||
this.$element.addClass( 'lcd' );
|
this.$element.addClass( 'uls-lcd' );
|
||||||
this.regionLanguages = {};
|
this.regionLanguages = {};
|
||||||
this.renderTimeout = null;
|
this.renderTimeout = null;
|
||||||
this.cachedQuicklist = null;
|
this.cachedQuicklist = null;
|
||||||
@@ -109,8 +109,9 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
render: function () {
|
render: function () {
|
||||||
var $section,
|
var $section, $quicklist,
|
||||||
lcd = this,
|
lcd = this,
|
||||||
|
narrowMode = this.options.columns === 1,
|
||||||
regions = [],
|
regions = [],
|
||||||
regionNames = {
|
regionNames = {
|
||||||
// These are fallback text when i18n library not present
|
// These are fallback text when i18n library not present
|
||||||
@@ -124,7 +125,16 @@
|
|||||||
PA: 'Pacific'
|
PA: 'Pacific'
|
||||||
};
|
};
|
||||||
|
|
||||||
regions.push( this.buildQuicklist() );
|
$quicklist = this.buildQuicklist();
|
||||||
|
regions.push( $quicklist );
|
||||||
|
|
||||||
|
if ( narrowMode && $quicklist.length ) {
|
||||||
|
regions.push( $( '<h3>' )
|
||||||
|
.attr( 'data-i18n', 'uls-region-all' )
|
||||||
|
.addClass( 'uls-lcd-region-title' )
|
||||||
|
.text( 'All languages' )
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$.each( $.uls.data.regiongroups, function ( regionCode ) {
|
$.each( $.uls.data.regiongroups, function ( regionCode ) {
|
||||||
lcd.regionLanguages[ regionCode ] = [];
|
lcd.regionLanguages[ regionCode ] = [];
|
||||||
@@ -135,14 +145,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$section = $( '<div>' )
|
$section = $( '<div>' )
|
||||||
.addClass( 'eleven columns offset-by-one uls-lcd-region-section hide' )
|
.addClass( 'uls-lcd-region-section hide' )
|
||||||
.attr( 'id', regionCode );
|
.attr( 'id', regionCode );
|
||||||
|
|
||||||
// Show a region heading, unless we are using a narrow ULS
|
// Show a region heading, unless we are using a narrow ULS
|
||||||
if ( lcd.options.columns !== 1 ) {
|
if ( !narrowMode ) {
|
||||||
$section.append( $( '<h3>' )
|
$section.append( $( '<h3>' )
|
||||||
.attr( 'data-i18n', 'uls-region-' + regionCode )
|
.attr( 'data-i18n', 'uls-region-' + regionCode )
|
||||||
.addClass( 'eleven columns uls-lcd-region-title' )
|
.addClass( 'uls-lcd-region-title' )
|
||||||
.text( regionNames[ regionCode ] )
|
.text( regionNames[ regionCode ] )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -306,7 +316,7 @@
|
|||||||
this.options.quickList = this.options.quickList();
|
this.options.quickList = this.options.quickList();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !this.options.quickList ) {
|
if ( !this.options.quickList.length ) {
|
||||||
this.cachedQuicklist = $( [] );
|
this.cachedQuicklist = $( [] );
|
||||||
return this.cachedQuicklist;
|
return this.cachedQuicklist;
|
||||||
}
|
}
|
||||||
@@ -317,13 +327,13 @@
|
|||||||
quickList.sort( $.uls.data.sortByAutonym );
|
quickList.sort( $.uls.data.sortByAutonym );
|
||||||
|
|
||||||
$quickListSection = $( '<div>' )
|
$quickListSection = $( '<div>' )
|
||||||
.addClass( 'eleven columns offset-by-one uls-lcd-region-section' )
|
.addClass( 'uls-lcd-region-section' )
|
||||||
.attr( 'id', 'uls-lcd-quicklist' );
|
.attr( 'id', 'uls-lcd-quicklist' );
|
||||||
|
|
||||||
$quickListSectionTitle = $( '<h3>' )
|
$quickListSectionTitle = $( '<h3>' )
|
||||||
.attr( 'data-i18n', 'uls-common-languages' )
|
.attr( 'data-i18n', 'uls-common-languages' )
|
||||||
.addClass( 'eleven columns uls-lcd-region-title' )
|
.addClass( 'uls-lcd-region-title' )
|
||||||
.text( 'Common languages' ); // This is placeholder text if jquery.i18n not present
|
.text( 'Suggested languages' ); // This is placeholder text if jquery.i18n not present
|
||||||
$quickListSection.append( $quickListSectionTitle );
|
$quickListSection.append( $quickListSectionTitle );
|
||||||
|
|
||||||
this.renderRegion(
|
this.renderRegion(
|
||||||
@@ -401,7 +411,8 @@
|
|||||||
// Other supported values are 1 and 2.
|
// Other supported values are 1 and 2.
|
||||||
// Other values will have rendering issues.
|
// Other values will have rendering issues.
|
||||||
columns: 4,
|
columns: 4,
|
||||||
languageDecorator: null
|
languageDecorator: null,
|
||||||
|
quickList: []
|
||||||
};
|
};
|
||||||
|
|
||||||
$.fn.lcd.Constructor = LanguageCategoryDisplay;
|
$.fn.lcd.Constructor = LanguageCategoryDisplay;
|
||||||
|
|||||||
Reference in New Issue
Block a user