Commit Graph

457 Commits

Author SHA1 Message Date
Pl217 54a466ee52 Merge pull request #283 from santhoshtr/keydown-simplify
Simplify key press event handlers
2018-02-06 11:19:45 +01:00
Santhosh Thottingal 3161b34b2b language-data update: Add Western Armenian to known languages 2018-02-02 11:55:54 +05:30
Niklas Laxström bb8b48aa38 Stop rendering languages twice on initial display
The resultHandler is responsible for updating the `LanguageCategoryDisplay`, so we should not call `render` separately in `search` when there is no search query.

https://phabricator.wikimedia.org/T185086
2018-01-31 16:52:23 +05:30
Santhosh Thottingal 081310b45e Style adjustments for no-results
* 20px spacing above and below the "No results found" message.
* 12px spacing above and below the search indications ("You can search by...")
* Adjusting the text color to use Base20 (#54595D)
* Adjust the background to use the same background color as the area above it (#FCFCFC).
* Add a top border in Base80 (#EAECF0) to separate both areas.

See https://phabricator.wikimedia.org/T175235
2018-01-30 12:52:47 +05:30
Niklas Laxström d349937772 Do not group search results by region
* Documentation updates
* Do not group search results by region
* Disable grouping by script when region grouping is disabled
* Add docs, clarify names per code review
* Fix bool -> boolean for consistency
2018-01-16 17:04:29 +05:30
Santhosh Thottingal 2aa43148bb Custom no-results message support (#286)
* Custom no-results message support
* Refactoring and clean up for LanguageCategoryDisplay class
* Document the options for LanguageCategoryDisplay class
* Reduce the spreading of no results handler code
* Add an option to accept no results template
* Remove unwanted, unused constructor too
* Use CSS to hide or show the no-results view
* Remove the unwanted noresults method in jquery.uls.core, directly
  call the same method of lcd.
* Add an example
* Support a function returning jquery element as the no-result handler
2018-01-12 16:05:11 +02:00
Santhosh Thottingal 37c9d66a2b Use .siblings to locate the suggestions, clear elements for efficiency (#285) 2018-01-10 09:13:56 +02:00
Santhosh Thottingal bccf103900 Removing assigned ids to elements that are not guaranteed to be unique (#284)
It is a bad practice to assign id attributes when there is no guarantee
about the uniqueness of element. ULS should function even if there are
more than one instance of it is present in a page.
2018-01-09 09:47:47 +02:00
Santhosh Thottingal f46aad0a01 Use .on('event', handler) pattern instead of .event(handler) 2018-01-08 12:22:02 +05:30
Santhosh Thottingal e67e1e42ee Simplify key press event handlers
Remove eventSupported checks and just rely on jquery.keydown
2018-01-05 15:00:31 +05:30
Santhosh Thottingal 2a77df6c41 Use eslint and stylelint, fix all errors (#282)
* Use eslint and stylelint, fix all errors

* Remove jshint, jsbeautify
* Use Object.keys directly since that is available in all major browsers
* Fixes for eslint, stylelint errors
* stylelint is not included in grunt test yet because jquery.uls.mobile.css
  has so many !important and need to figure out whether they are really needed
2018-01-04 15:58:35 +02:00
Santhosh Thottingal 63e1b06514 Update language data
* Make Spanish available under the Oceania region
* Add the Kumyk language
2017-12-07 16:05:33 +05:30
Niklas Laxström 7119bdff5c Ensure autofillLabel is undefined if searchApi fails 2017-11-29 10:31:55 +02:00
Niklas Laxström 82eee93dbd Improve search code
* Always use searchAPI if provided
* Clean up code flow to be easier to follow

https://phabricator.wikimedia.org/T73891
2017-11-27 14:22:01 +01:00
Niklas Laxström 1dcb533b42 Fix "srpski" not finding results in Wikipedia compact links
See also https://phabricator.wikimedia.org/T178996
2017-10-27 12:12:49 +03:00
Niklas Laxström 2fd96dd684 Merge pull request #271 from santhoshtr/language-data-node-module
Use wikimedia/language-data node module for data
2017-10-12 14:48:27 +03:00
Niklas Laxström ca550e22cd Improve how "no search results" is handled
* Drop the ugly height: 100% hack and do it properly and remove TODO
* after( $suggestions.show() ) seems to not work as expected in recent
  jQuery versions. Changed it to manipulate the presence of 'hide'
  class properly.
* Consistency fix in a comment
* Fixed a bug where creating multiple ULS instances would break the
  "no search results" functionality. This is because we were appending
  a jQuery element wrapped in a $(). This is obviously a no-op and a
  regression when the template actually was a string and not jQuery.
  Fixed by using clone() on it.

https://phabricator.wikimedia.org/T175233
2017-09-07 11:22:26 +02:00
Santhosh Thottingal 6d6a1326b5 Use wikimedia/language-data node module for data
Now that we have this node module, let us use that as upstream
for data
2017-08-28 17:46:09 +05:30
Amire80 c6c08537f7 Redirect skr to skr-arab in langdb
This language is being added to MediaWiki, so we need to make
sure it will be identified.
2017-07-22 10:46:13 +03:00
Amire80 308ca1bea7 Add the Coptic language to langdb 2017-07-21 15:40:54 +03:00
Amire80 9cd578cec6 Change ckb autonym to just "کوردی"
This was requested by the Wikipedia community,
and it is the practice on other websites, too.

More details at
https://phabricator.wikimedia.org/T116761
2017-07-09 18:16:42 +03:00
Amire80 f3469f25c8 Add the Ho language (hoc) and the Warang Citi script (Wara) to langdb 2017-07-05 15:34:53 +03:00
Amire80 777d71e0d2 Make all autonyms unique and add a test for this
In a list of languages to select autonyms must be unique so that
every user would know what to select.

* Batak Toba language in the Batak writing variant (bbc-batk) has
  an autonum in the right script now. This is taken from the Indonesian
  Wikipedia article "Surat Batak".
* Similarly to the practice with pa -> pa-guru:
  * iu for Inuktitut in the Canadian script redirects to ike-cans.
  * ks for Kashmiri in the Arabic writing redirects to ks-arab.
  * tg for Tajik in the Cyrillic script redirects to tg-cyrl.
* zgh has an updated autonym, taken from Ethologue.
* zh-classical redirects to lzh, similarly to zh-yue -> yue.
2017-06-09 20:45:43 +03:00
Amire80 5f67e82192 Fix the autonym for tkr
Source: Русско-цахурский разговорник под редакцией А.Г. Гюльмагомедова, Махачкала 2004
2017-06-07 11:14:19 +03:00
Amire80 01520ea6bb Add the Xibe language (sjo) 2017-06-02 16:35:58 +03:00
Amire80 791a924981 Add languages byn, dag, doi, gaa, tig to langdb
These languages are already used in jquery.ime,
but if they are not in ULS, they cannot be selected
in translatewiki.
2017-06-01 11:56:20 +03:00
Federico Leva f1b02c4035 Add Hakka variants (hak-hans, hak-hant)
https://gerrit.wikimedia.org/r/#/c/354691/1
2017-05-20 15:50:21 +02:00
Federico Leva ae3072ddbb Add four language codes for newly supported translatewiki.net languages
* es-ni: https://gerrit.wikimedia.org/r/#/c/354689/
* nod: https://gerrit.wikimedia.org/r/#/c/354681/
* ovd: https://gerrit.wikimedia.org/r/#/c/354672/
* skr-arab: https://gerrit.wikimedia.org/r/#/c/354675/
2017-05-20 15:36:54 +02:00
Amire80 7d24e6766a Add the Rangi language (lag)
Requested at
https://translatewiki.net/wiki/Thread:Support/add_Rangi_(lag)
2017-05-03 19:49:30 +03:00
Amire80 691c11f990 Add five languages of Taiwan
ais, ami, tay, trv, xsy

For reference, see
https://translatewiki.net/wiki/Thread:Support/Request_4_languages_of_Indigenous_Taiwanese
2017-05-02 23:25:05 +03:00
Amire80 4d7795eea2 Add the Nyungar language (nys) 2017-03-31 20:12:10 +02:00
Amire80 0da43bab16 Add the Guambiano language
Requested at
https://translatewiki.net/wiki/Thread:Support/Add_new_language_to_translate

Follow up to
https://gerrit.wikimedia.org/r/#/c/344984/
2017-03-28 10:56:43 +03:00
Amir E. Aharoni 1604bbc1e7 Merge branch 'master' into patch-1 2017-03-27 22:25:02 +03:00
Kartik Mistry b39bdaf9cb Update jquery.uls.data.js for #249
This updates pulls new CLDR data.
2017-02-20 13:36:47 +05:30
Kartik Mistry eae315df67 Update data for gom
Follow-up: https://github.com/wikimedia/jquery.uls/pull/247
2017-01-30 19:33:15 +05:30
Kartik Mistry eca1f94cce Merge pull request #246 from amire80/span
Move the message attribute to the correct element
2016-12-06 06:06:52 -08:00
hhm0 2367547a7f B"H add js file 2016-12-05 20:55:47 -05:00
Amire80 cafe908d07 Move the message attribute to the correct element
Follow up to https://github.com/wikimedia/jquery.uls/pull/243 ,
addressing a comment by @Nikerabbit.
2016-12-04 11:40:45 +02:00
Amire80 1ce349475e Remove the left-to-right mark from the lki autonym
This character produces a JSHint warning,
and it's definitely unnecessary.
It was possibly added as a copy-paste error in 6650db2.
2016-12-03 21:10:43 +02:00
Amire80 7d9d2b7947 Using the message uls-search-help in the code
The translatable message uls-search-help was available in
the i18n files, but it was not actually used in the code,
so it was always shown in English.

This patch adds it to the JS code.
2016-11-28 15:53:55 +02:00
Amire80 0441c1eedb Add Siberian Tatar (sty) to langdb 2016-11-27 16:55:43 +02:00
Niklas Laxström 701b16d9ac Update language name for code 'olo'
https://phabricator.wikimedia.org/T146744#2706813
2016-10-12 09:04:13 +02:00
Amire80 d191a1f6e6 Change "Language search" to "Search for a language"
Suggested at https://phabricator.wikimedia.org/T138235 .
This brings ULS closer to the mobile language search interface
in MediaWiki.
2016-09-13 10:46:41 +03:00
Marius Hoch 6ebd1b413c Use an empty array for quickList everywhere, not false/null
Also fix one type quicklist -> quickList, per @edg2s.

Follows cb85cda10e.

https://phabricator.wikimedia.org/T144871
2016-09-07 02:46:32 +02:00
Niklas Laxström cb85cda10e Avoid showing suggested languages header if the list is empty 2016-09-02 15:45:14 +02:00
Niklas Laxström 0e253cb312 In narrow mode, print "All languages" heading if suggested languages are given
Also changed one instance of "Common languages" to "Suggested languages" in
the no-i18n fallback code.
2016-08-30 15:12:46 +02:00
Niklas Laxström 7a0b336010 Go back to 100 for threshold for wide
Also fixed one whitespace issue in previous commit.
2016-08-29 10:58:16 +02:00
Niklas Laxström f5ff66eb63 Increase breakpoints for different number of columns
https://phabricator.wikimedia.org/T138235#2560677

Also, update the default position to be centered on the page. The
original 25% was pretty close to this for the wide option, but now
that shorter lists are more common, it is no longer sufficient and
replaced with a better code.
2016-08-17 16:29:08 +02:00
Niklas Laxström 8a8f502de7 Style changes to lcd
This change is larger than it should because I came across lots of
unused CSS which I removed or simplified.

https://phabricator.wikimedia.org/T138235
2016-08-17 16:29:08 +02:00
Niklas Laxström 8b52247b22 Remove incorrect comment 2016-07-26 16:19:40 +03:00