Commit Graph

42 Commits

Author SHA1 Message Date
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
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
Siebrand Mazeland
658914a984 Update code formatting 2013-10-08 23:59:40 +02:00
Santhosh Thottingal
33ec9285e3 Use events instead of callbacks for success or no results
Allows extension users to bind for this event, also reduces callbacks

Change-Id: I14cc6d51ad23432956e3ea3275c72db26d71a8c8
2013-08-15 12:16:12 +05:30
Santhosh Thottingal
5f2b646c42 Do not propagate enter event to parent page elements from ULS search box
Change-Id: I18b8b746ed8bff2b0e06a8b05a2c6e69c7899293
2013-06-10 14:34:08 +05:30
Santhosh Thottingal
05e34d5dfa Fix two js error possibilities
Change-Id: I92ed487e7b5c70ef7851575eec676276e1ea905b
2013-06-10 14:33:17 +05:30
Amir E. Aharoni
851e2e84bc Remove an extra var statement 2013-04-23 17:56:59 +03:00
Amir E. Aharoni
62cab27eb2 Leave only one var statement per scope 2013-04-22 14:40:12 +03:00
Amir E. Aharoni
d410338c93 Don't ignore backspace in the search box 2013-04-10 18:57:20 +03:00
Amir E. Aharoni
9147af93d7 JSHint, whitespace, quotes 2013-01-13 23:24:47 +02:00
Siebrand Mazeland
d2d287fbc4 Update docs 2012-12-27 21:58:54 +01:00
Siebrand Mazeland
f9111d5e39 Simplify if statement 2012-12-27 21:45:35 +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
Santhosh Thottingal
04edfa90c8 Ignore control characters in typeahead
Fix https://bugzilla.wikimedia.org/show_bug.cgi?id=40171
2012-11-19 12:12:25 +05:30
Santhosh Thottingal
5626a4cf92 Some minor changes for code readability 2012-11-19 11:15:44 +05:30
Amir E. Aharoni
ba6a1e5eec Spelling of event name 2012-11-16 14:09:45 +02:00
Santhosh Thottingal
8c3b61b1a1 Fix issue #32 - Clicking a region on map sets focus in search bar; onscreen keyboard covers list
Change-Id: I15703614b5fdb2201f7dcbfd47a5095e033032f3
2012-11-13 14:22:10 +05:30
Santhosh Thottingal
642dd3c8cc Remove deprecated $.browser
Fixes issue #33

Change-Id: Idda5d77293baedf8d93b70a146a545ff6986aaa5
2012-11-10 17:09:57 +05:30
Amir E. Aharoni
faeac72491 .languagesByScript* -> .getLanguagesByScript* 2012-10-08 08:13:34 +02:00
Amir E. Aharoni
5e16abf26d .autonym -> .getAutonym 2012-10-08 08:13:34 +02:00
Amir E. Aharoni
17f525f510 Replace .script with .getScript 2012-10-08 08:13:34 +02:00
Santhosh Thottingal
442af47190 (bug 39833) Make language code search case insensitive
Change-Id: I67b98f058f969cd2fe9fa22085f8f781b29dce3f
2012-09-06 09:59:35 +00:00
Santhosh Thottingal
298c91a68f Misc jshint fixes
* Move the invocation into the parens that contain the function.
* unescaped regex
* Do not wrap function literals in parens unless they are to be
  immediately invoked.

Change-Id: Ib3360f88fb7674af0e857d8a84a91fdac1fd8487
2012-09-04 16:02:28 +05:30
Santhosh Thottingal
5e86782803 Fix Bug 39829 - Language Selection does not work while using Language Code
This happens when you type language code and hit enter very fast, without
a pause. A matched language is not available when enter is hit, so it goes
noop.

Handled this special case by checking whether the input is a valid language
code and calling onselect on it.

Change-Id: Icaf809f8db8162264d990247a164449b02b2f418
2012-09-03 18:18:53 +05:30
Santhosh Thottingal
035cfb08c4 Lazy loading of regions
Also adds landing page feature. But candidate list is hardcoded
for now. Example html file updated.

show method of lcd renamed to render.

Introduced a trigger searchclear
Introduced mw.uls.changeLanguage, setPreviousLanguages
getPreviousLanguages and getBrowserLanguage methods

Region groups re-numbered - from [4, 1, 2, 3] to [1, 2, 3, 4].

Change-Id: Iac1edf628708e6f40e41578df70d40c42f15289a
2012-08-30 14:26:57 +03:00
Santhosh Thottingal
d72e97a065 Move regionfilter to a seperate javascript file
To lib/jquery.uls/src/jquery.uls.regionfilter.js

Change-Id: I5f4e424ff68d7a7ed6407f48ddf84cdadfe90a52
2012-08-21 16:20:03 +05:30
Santhosh Thottingal
9da90921c4 jQuery.uls bug fixes and keep template with the plugin
* The jQuery selectors should be referring to the menu for the current
  ULS instance rather than querying on the page. This allows multiple
  instances of ULS present in the page
* Keep the HTML template with the plugin. No more HTML added from hooks.
* Updated the example based on above change.
* Updated the hooks code.
* Some more documentation.

Change-Id: I48e2e167bc2c09b8653a142c50317c22e8ba1362
2012-08-19 18:29:37 +03:00
Amir E. Aharoni
c7192c5ec2 Remove double space
Change-Id: I01098eb637bbfe6170901dae68d5ea0fe1570aa6
2012-08-16 18:39:02 +03:00
Niklas Laxström
550e9644fa (bug 39230) Autocompletion does not get cleared on region change
* Introduced deactivate (clear without showing all languages)
* Renamed noresult in region filter to noresults to match the
  callback in languagefilter
* Some comments to help understand the code

Change-Id: I544a29b860a6d3f4a5aa770f84cc8a72ae4a4b9d
2012-08-16 09:33:39 +00:00
Santhosh Thottingal
169cf7b070 Merge "Visual prefix" 2012-08-15 06:10:20 +00:00
Santhosh Thottingal
aa798d9ca1 Fix Bug 38666 - When searching no specific region should be highlighted in the map
Clicking again on a region deselect it
When searching, remove selection from regions.

Change-Id: Ife70639a864f9d13d02406d1229316782a32ed3c
2012-08-14 22:46:48 +03:00
Santhosh Thottingal
fc41f15651 Visual prefix
Make sure that suggestion is not only prefix but also visually prefix.
Checks the ending character is pre-base vowel.
There might be characters with this property in non-indic languages, but
I am not aware of now.

Change-Id: I91abd4dee6c4349e901777ebd6972731808daf45
2012-08-14 19:28:53 +00:00
Santhosh Thottingal
b9f8ae6581 Fix bug 38847 Clear suggested text when input no longer matches
Change-Id: I6651f38830fcb54bf6b4290eeeedcf48841a8314
2012-08-09 10:23:22 +00:00
Nikerabbit
c8da071045 Merge "Handling enter key in language filter" 2012-08-08 13:54:27 +00:00
Santhosh Thottingal
e0e4c9e1b8 Always use autonyms for search results
Change-Id: Iacbaa78c9f66b0c754ac9faf9bb2752f95b35693
2012-08-07 19:24:46 +05:30
Santhosh Thottingal
6201e91071 Handling enter key in language filter
* if the search string is language code, select it
* else if the autocompletion available select it
* else select the first language matching the query

Change-Id: If66f5c547a471026b7b2aebcde3c3b056e1c2917
2012-08-07 18:13:27 +05:30
Amire80
279fc73826 Merge "Implement visual language grouping in ULS" 2012-08-07 10:59:15 +00:00
Santhosh Thottingal
926136c8b5 Fix issue: search strings like 't', 'a' are not giving results
There are languges starting with those letters, but without autonyms
Add a null check for undefined autonyms to prevent js error

Change-Id: I88a1d79b3bb23beac7238c1e8817cd6eac614613
2012-08-07 16:22:38 +05:30
Santhosh Thottingal
063805538b Implement visual language grouping in ULS
Added a utility callback function to sort languages by autonym.
Added CSS fix for group separatos.

Change-Id: I73c7c6518a85e4ea7999be3ef92a121e877610e8
2012-08-07 13:42:20 +05:30
Santhosh Thottingal
8630ed98f3 Misc. performance tweaks
* Do not hit search API if there are results to show from front end
* Avoid the lcd exists check
* slightly reduce the timeout of search term typing
* show autofill for search api results too.
* correct the tooltip text of results.

Change-Id: Id102fbf3bc09eb926d9e36f125ed6291943007f9
2012-08-04 11:30:37 +05:30
Santhosh Thottingal
0a681a85fe Rearranging Files
* Seperating standalone jQuery ULS plugin and extension related code
* lib/jquery.uls can be submodule, but not now.

Change-Id: I7d9cb47daa88dd1a27ceda602a08cab0073caf33
2012-08-03 12:24:04 +05:30