Commit Graph

85 Commits

Author SHA1 Message Date
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
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
Santhosh Thottingal
bb4d96c33a List the languages in Worldwide in their respective regions too
Fix for https://phabricator.wikimedia.org/T137868
This was a wrong solution for https://phabricator.wikimedia.org/T41921

Change-Id: Ib920e75fca71716d14aecd25c163f0c1e8e63270
2016-07-20 09:55:24 +05:30
Niklas Laxström
25775dd147 Adjust styles and code to support custom list bullets
Tweak specificty of the rule that hides bullets so that it is easy
to override.

Move dir and lang attributes from <li> to <a> so that the bullets
appear on the correct side for reverse directionality scripts.

Change-Id: Ic0d0c5220b0b374c2a3a19023c40d81f3e20007c
2016-06-09 15:08:15 +05:30
Santhosh Thottingal
e9c0f3e4db Show "You may be interested in" section when no results found
This was broken long time back

Change-Id: I15f715067d82fb61959763824183a6813536e94e
2016-05-09 17:09:06 +05:30
Santhosh Thottingal
8b3d77dae1 Support language codes that are redirects
Addressing issue #207

Such language codes were not listed in ULS language list.

Root cause was $.uls.data.getLanguagesByScriptGroup was returning
a map of script groups, which contained only resolved language codes.
And later in append method of jquery.uls.lcd.js, there is a check if
that language code is part of languages list passed as option to uls()
call. This test fails and the language code does not get added to display.

Change-Id: Iec914a9694a46eef5750ef3af7346d66e052ab77
2016-04-05 09:17:09 +05:30
Prateek Saxena
0973ddf299 Construct DOM using jQuery instead of an HTML String 2015-01-26 09:26:57 -08:00
Santhosh Thottingal
f417707d67 Remove the unused code to sync region highlight on scroll
Change-Id: Id779c25237584f90ab9132fe24f6cbade1b58da7
2014-12-22 16:38:03 +05:30
Santhosh Thottingal
499c30d0ea Merge branch 'uls-remove-map' of https://github.com/santhoshtr/jquery.uls into santhoshtr-uls-remove-map
Change-Id: Ie59e2a59225873b5cf432df526cbfc135e539d32
2014-12-22 14:51:46 +05:30
Amir E. Aharoni
f44302106b For narrow ULS show one column without separators 2014-12-22 11:09:48 +05:30
Amir E. Aharoni
6d72638d6f A more explicit support for valid columns number
Only 1, 2 or 4.
2014-12-15 11:27:44 +02:00
Amir E. Aharoni
dd59d4d0c8 CSS tweaks for narrow ULS 2014-12-04 00:39:57 +02:00
Amir E. Aharoni
b55bc61dc7 Grid-compatible adjustable columns 2014-12-02 22:16:09 +02:00
Amir E. Aharoni
752a295ee2 Allow sending the number of lcd columns as a parameter
This is needed for https://phabricator.wikimedia.org/T76196
and may also nbe useful for many other features.
2014-12-02 13:23:22 +02:00
Santhosh Thottingal
022efabf38 Minor formatting changes
Change-Id: I3ffd7029165ff614c13000b333ed30d3874fba28
2014-09-23 16:16:44 +05:30
Santhosh Thottingal
7346469e20 Add decorator option for language links
Callback function to be called when a language link is prepared
Can be used for custom decoration.
Arguments:
(a) the $language - the language link jQuery object
(b) languageCode

The function can do any styling, changing properites etc on the passed link.
See examples/decorator.html for example usage.

Change-Id: I5a67654440a07cf7dfac683e22dcb5000ded0bfe
2014-09-22 12:32:05 +05:30
Santhosh Thottingal
c2b68e8cbc Remove the region selector feature
* Maps removed from UI
* From no-results UI, removed the links to navigate by clicking region names
* Removed the $.fn.regionSelctor plugin, Retained the RegionSelector class
* Removed all related css for the removed UI parts
* Reduced the padding for main ULS title so that the top header takes less height
* And a dozen of related changes

Change-Id: I8ac89ebe380047ca267e5c7720c2eaa3da080e9d
2014-07-27 20:29:01 +05:30
Santhosh Thottingal
9599ed7d26 Fix the jQuery migration warnings
Remove the spaces in the beginning of html template strings.
$( html ) require html to start with  '<'

See https://bugzilla.wikimedia.org/show_bug.cgi?id=65400

Change-Id: I93eaf41390ab72fcae1b8d4015585bc4f82e6f8a
2014-05-18 10:20:07 +05:30
Niklas Laxström
78e9b83c6b Make ULS language selector appear faster after clicking trigger
* Removed unused class end.
* Class uls-lcd-region-section was used in two different elements,
  retained it on the outer one.
* Build a list of languages per region, once done render the regions at once.
* Use direct dom manipulation in hot spots.
* Use shorter selectors like children instead of find and dropping the tag name.
* Fixed mismatch when there were no results and when the message was shown.
* Less flickering by not hiding or showing regions unnecessary
* Cache the common languages "quicklist"
* Added itemsPerColumn as an option

Reduces time used to show language selector after clicking the trigger on my
machine from about 1.8s to about 380 ms (JS execution times, actual times are
about the same but little bigger. The actual rendering is now less than 100ms,
the rest is other setup overheard and $.fn.scrollIntoView which can take many
hundreds of milliseconds.
2013-12-20 10:31:04 +00:00
Niklas Laxström
9d77cfb76f Fix typo 2013-11-19 11:16:14 +00:00
Santhosh Thottingal
623cdb605a Validate whether the language from API is known while trying to display
See https://bugzilla.wikimedia.org/show_bug.cgi?id=54725

Change-Id: Ie77f7cd02d37338a6b65db653c2ba3b35906dac0
2013-11-15 15:15:00 +05:30
Santhosh Thottingal
49497d7078 Avoid overriding grid css for language list
Change-Id: I7606c5af716f2094bc1766a95123a68413634c91
2013-11-05 19:49:38 +05:30
Santhosh Thottingal
5444e17727 Avoid 'recalculate style' by conditionally change classes while scrolling
Change-Id: I71b42f9f974a1367700283ad55013e9e6a036827
2013-11-01 11:08:15 +05:30
Santhosh Thottingal
a985d33d4b Use attr and prop consistently
Change-Id: If650d07686cafb6fceba60186843b5599404846c
2013-11-01 10:47:16 +05:30
Santhosh Thottingal
9ae403b671 Remove unnecessary object instance
Change-Id: I078a3a107d154bbcba7e1d49cbd6470b026ff869
2013-11-01 10:45:46 +05:30
Santhosh Thottingal
522b14fb23 Use text() instead of html() to set language names
Change-Id: I1374ac3ed9273302ea268596918a72c6b7a48579
2013-11-01 10:33:36 +05:30
Santhosh Thottingal
c5b11eabc9 Merge pull request #106 from siebrand/3
Update code formatting
2013-10-23 06:38:37 -07:00
Santhosh Thottingal
e83494cab1 Formatting fixes
Change-Id: I75173f09527f84419d1b807e9e33ff673e0f5d1c
2013-10-17 14:50:09 +05:30
Santhosh Thottingal
e54d85a124 Use Autonym font for autonyms
Change-Id: I5224cd020a6c6ba4f52f2be3a318216111b39394
2013-09-15 14:48:36 -07:00
Siebrand Mazeland
078448a659 Update code formatting
Changes suggested by CodeSniffer.
2013-08-02 15:38:12 +02:00
MatmaRex
8a1e3eb18e Remove lazyload functionality entirely
It was merely a stopgap solution to the problem of the dialog taking
forever to load. With that problem solved all of this awful code is no
longer needed.
2013-06-27 16:31:50 +05:30
MatmaRex
8341bb8e21 Disable lazyload for language list
The loading should be fast enough now after Id9397631 is merged,
taking no more than a second or two to render entirely. We could
consider showing a spinner while it's loading, but it doesn't seem
necessary.

This makes bug 39923 invalid.
2013-06-27 16:30:17 +05:30
Santhosh Thottingal
7c47112ae6 Fix: IE 8 not displaying the section titles for language lists
Changed the way those elements were constructed using jQuery

Change-Id: Ib2b7f454dd0cc1ff38342cf7cc2c6c73a4796c6c
2013-06-12 10:55:32 +05:30
Santhosh Thottingal
05e34d5dfa Fix two js error possibilities
Change-Id: I92ed487e7b5c70ef7851575eec676276e1ea905b
2013-06-10 14:33:17 +05:30
Amir E. Aharoni
62cab27eb2 Leave only one var statement per scope 2013-04-22 14:40:12 +03:00
Amir E. Aharoni
31cd276019 JSHint cleanup 2013-01-13 23:20:05 +02:00
Santhosh Thottingal
ca18edd0dd Merge pull request #63 from amire80/bug_43568
Render every region only once
2013-01-07 06:44:04 -08:00
Santhosh Thottingal
0e61876af5 Merge branch 'extra_languages' of git://github.com/amire80/jquery.uls into amire80-extra_languages
Conflicts:
	src/jquery.uls.data.js
	src/jquery.uls.data.utils.js

Change-Id: I9c321891707b0d68328f4e4c8be1bd451794072d
2013-01-07 15:45:48 +05:30
Amir E. Aharoni
13473c9f7a Render every region only once
Fixes bug
https://bugzilla.wikimedia.org/show_bug.cgi?id=43568
2013-01-04 08:31:20 +02:00
Amir E. Aharoni
1f91a4c40c Whitespace 2013-01-02 18:28:14 +02:00
Amir E. Aharoni
829c827483 Adding a special region
This is supposed to allow adding special languages.

This region's section is hidden by default and can be enabled by
passing different options to the lcd object.
2013-01-02 12:58:29 +02:00
Siebrand Mazeland
d2d287fbc4 Update docs 2012-12-27 21:58:54 +01:00
Santhosh Thottingal
8c54381e58 Change double quotes to single quotes
Change-Id: I4684a4bc4ac26fffba7310891106d254e893dd63
2012-12-24 16:29:14 +05:30
Amir E. Aharoni
7a04c3c6e0 Rename "that = this" to meaningful names 2012-11-29 10:40:24 +02:00
pginer
6fa03963f1 Fixes CSSLint issues for jquery.uls.lcd.css
CSS adjustments and JS modifications (adding classes to HTML elements)
to solve issues reported by CSS Lint when validating jquery.uls.lcd.css

Change-Id: Ic604984b1a677f0e18796d6ce131736d6b9d6c3a
2012-11-19 20:13:12 +05:30
Santhosh Thottingal
641218f624 Remove href attributes
People like to middle click -
https://bugzilla.wikimedia.org/show_bug.cgi?id=41988
2012-11-14 20:11:24 +05:30
Santhosh Thottingal
0be1e38d14 Fix issue #24 - Search results replaced with full list when scrolling
Change-Id: Iba3a798c9b4980943aded1ed145081fecc0367e3
2012-11-08 15:43:36 +05:30
Santhosh Thottingal
5e66a8a163 Fixed issue #27 - Clicking on language links goes to "#"
Change-Id: I8f675a00dc697540df4e011cdb58e1b423b9f191
2012-11-08 12:14:57 +05:30