Commit Graph

157 Commits

Author SHA1 Message Date
Siebrand Mazeland
264652b1fd Reduce use of globals
Or reduce the scope where they are available.

Change-Id: Idce74bda8f64cc6be62b58b2624629408ca18d4b
2013-05-26 11:46:12 +02:00
Siebrand Mazeland
17c1ce60e5 Update formatting
Break or shrink long lines.

Change-Id: I729dffe3f0d9e1132d9232779dc60647a1dc5a97
2013-05-26 11:23:17 +02:00
Niklas Laxström
15b57bc315 Fix some incorrect hook annotations
Change-Id: I2594b50c07eafbee68df29152066c81a79035a9e
2013-05-25 08:43:27 +00:00
Amir E. Aharoni
4221b97ab2 Hide the ULS trigger for users who disabled JS
Bug: 42500
Change-Id: I297a8d3bb9d9031e21dd6842f5d27dd54f469c29
2013-05-22 16:04:20 +03:00
Santhosh Thottingal
2174740bb6 Revert "Add a MediaWiki preference for enabling ULS IME"
This reverts commit 6ae0fe3e44.
The commit was duplicating the preferences in 2 places
making the syncing hard.
As per discussion with Pau, we will try alternate approach.

Bug: 48642
Change-Id: I5c97838ed875364dc35b66a3d6c33d9975b5107e
2013-05-22 07:46:05 +00:00
Amir E. Aharoni
6ae0fe3e44 Add a MediaWiki preference for enabling ULS IME
Bug: 47240
Change-Id: I957d9f409b0c29f956bcf8a49187cdf27c4f42f8
2013-05-13 15:48:00 +03:00
Amir E. Aharoni
c9a5ec7f19 Add backward compatibility for fetchLanguageNames
Bug: 46737
Change-Id: Ife7c2834c2b2c4f2619b4a5d8e0b0aa1db595984
2013-04-30 16:01:47 +03:00
Niklas Laxström
4554c79d51 Load ULS language list from a resource loader module
Having them in the page source of every page view is wasteful.

Bug: 41210
Change-Id: If15e297a4781cc49ded06fbc906529f57a22aafe
2013-04-28 11:26:40 +00:00
Niklas Laxström
60242e2c53 Use wmf geoip by default
Unlike freegeoip it also works with https

Also moved the getCountryCode function to init, as it should be
available regardless of whether we load the optional geoclient
module.

Bug: 40965
Change-Id: Ia18130890d09f86a93b5b61f7da7c48fcfa480c7
2013-04-28 14:25:26 +03:00
Niklas Laxström
6b143320ad Introduced $wgULSAnonCanChangeLanguage
This allows us to enable web fonts and input methods for all
users by disabling just the interface language selection.

Updated the documentation of the variables to make it clearer
what each does. Summary:
* Enabling: $wgULSEnable and $wgULSEnableAnon
* Workarounds: $wgULSAnonCanChangeLanguage and $wgULSLanguageDetection

Cleaned up hooks, in particular rewritten getLanguage to separate
the logged in vs. logged out steps for easier understanding.

A followup commit is needed to disable language selection UI for
anon if $wgULSAnonCanChangeLanguage is false.

Change-Id: Ia8d21c394ff5efac0ce94664710c97dc3b74ec18
2013-04-26 12:21:23 +00:00
Amir E. Aharoni
f4f332a459 Add the sidebar ULS cog icon and $wgULSPosition variable
Change-Id: I6acf1e21316a41ab8fcb4fd65e065be68693430f
2013-04-23 14:53:58 +02:00
Santhosh Thottingal
453912fdf2 Provide a base ULS RL module and seperate UI language selection
ULS is disabled for anonymous users on WMF projects. But to provide
rest of the features - apis, language database, language selection for
many use cases, we need to provide a minimal ULS. RL module
ext.uls.init does that job now.

For using ULS as interface language selection tool, new RL module
ext.uls.interface is introduced. That will add UI language selection,
webfonts, ime features, if enabled.

Change-Id: I796a7c9cce0de42bf8aa06b26e383e0075dbe1dd
2013-03-26 07:20:01 +00:00
Niklas Laxström
dfcade7f69 Update to match core changes in Idc11b547
Change-Id: I5481df33c7056cf2c661527f6ed3cf2374b6a0bf
2013-01-18 08:25:40 +00:00
Niklas Laxström
9b72969b07 (bug 44010) Try to avoid messing wrong request contexts
Also takes use of $request parameter if given, but does
not depend on Idc11b547

Change-Id: I870281f26cbc87c43d9b2a763f78c5756cb2327f
2013-01-16 09:55:48 +00:00
Amir E. Aharoni
027776c85f (bug 41763) Add a hook for support uls-preferences
Change-Id: I8fdc1a0527c9a99b6e5eb95c183955a162233b1d
2013-01-09 16:12:20 +02:00
Tim Starling
86e6bc9654 Allow ULS toolbar to be disabled for anons only
Per Daniel's request on bug 42157

Change-Id: I5df826f0466bf20729c7969cb7b549e41016c194
2012-11-16 10:43:26 +11:00
Tim Starling
6abb1b3d4a Allow the main functionality of ULS to be disabled
Allow the cache-breaking toolbar and cookie-based user language
selection features to be disabled, while still allowing Wikibase to have
its language autocompletion drop-downs on special pages.

Change-Id: Iba18f666fdcf5b87b7068ab6b1537c868c8fe861
2012-11-15 16:33:13 +11:00
Siebrand Mazeland
e1f7ebb462 Update docs
Change-Id: I68c0751bf044aa1e35b8db0f85ac2b54270860e9
2012-11-12 07:53:23 +01:00
Niklas Laxström
3c9e7249a8 Geoclient fixes for https and WMF
* Don't call freegeoip on https, it wont work
* Use Geo instead of GEO like WMF

Change-Id: I9ebdd9f3518e15e70122a9c8c8d64240d5e44c5b
2012-11-10 07:15:07 +00:00
Santhosh Thottingal
a388d7cb95 Fix a syntax error
$wgULSIMEEnabled was not defined properly

Change-Id: I642c0b84e809e26ff0c98a471c5d092f6f6b6205
2012-10-31 15:43:26 +05:30
Santhosh Thottingal
fc29a7e587 Option for disabling the IME system
* It can be a user preference using the ULS Input method settings
* It can be a mediaWiki configuration $wgULSIMEEnabled

Change-Id: Ic5fb4932d62ab18db5d3b10ca81c0f6bfe9fd29e
2012-10-31 12:57:14 +05:30
Santhosh Thottingal
427c94dbbf Avoid 404s in non-localized locales
* Update jquery.i18n - if messageLocationResolver returns false for
  a locale, no server hit will be attempted
* Refactor i18n preparation code to a new method
* Use the ULS RL hooks to find out to which locales it is localized,
  pass that list to js to avoid hitting server.
* Also avoid directory scanning in each request by putting
  the locale list in cache

Fixes Bug 41454

Change-Id: I0c923b35db01b884e2dd55873dd5fb7384434645
2012-10-30 13:53:47 +00:00
Siebrand Mazeland
b2ff1cb8ce Small tweaks.
* Assign $languageToSave earlier; more efficient.
* Double quotes to single quotes.
* Whitespace update.

Change-Id: I7028ac3ce5cbbe3611f33290331d0a014a073bf5
2012-09-29 00:59:53 -07:00
Siebrand Mazeland
126bf95079 Add profiling.
Change-Id: I965ae08f801dfd24cd7fd5cc69087da7949f8a51
2012-09-29 00:57:44 -07:00
Siebrand Mazeland
e1a4f7f0cb After training the PHPStorm code formatter.
See https://github.com/siebrand/MediaWiki-PHPStorm

Issue remains with anonymous functions in JavaScript.

Change-Id: I2b520f8df127452acf02deb659277a6465e6ca59
2012-09-17 17:10:59 -07:00
Santhosh Thottingal
c3201d95a7 Fix Bug 39733 - Setlang should clear uselang
When setlang and uselang given, setlang take precedence

Change-Id: I749647985932fe52c3c0d417678d98cd017f1f4d
2012-09-03 11:49:29 +05:30
Niklas Laxström
dc163127e3 Language detection was overriding language for logged in users
Change-Id: I491e429b6ea352c67bdc3b63acf191e187059fde
2012-09-01 19:09:40 +00:00
Niklas Laxström
b1fad2c1bb I18n#1473: Use preferred language for anonymous users
Change-Id: I25833bb4c35453bbb055b4782d996604c93ef7db
2012-08-31 10:31:11 +00:00
Santhosh Thottingal
47e852f2e5 Fix Bug 39800 Tooltip of ULS search results should be in current UI language
Change-Id: If930c2035b2bd01764d109fcb9ad8e3838fd9cb5
2012-08-31 10:22:29 +05:30
Niklas Laxström
64c26ad137 Initial version of geolocation support
Change-Id: Ia1a18ac336131520bbc67f52194f4aa9c547ea67
2012-08-30 15:36:51 +03:00
Niklas Laxström
36e82a41ca Trying to fix language selection once more
Anon users were getting fatal errors if they did
not possess the language cookie.

Change-Id: I00f71ca6462ebcaa800ef8569efeea794ba16a7c
2012-08-28 13:58:44 +00:00
Niklas Laxström
0f2f7f8b62 Fix bug: language stuck in English
Change-Id: Ice51d517f5381197f9c0f72844961e74b021e3dc
2012-08-28 12:12:15 +00:00
Amir E. Aharoni
610cc362ac Get a list of the current user's Accept-Language codes
Change-Id: I2c8742f56e34aed8a368bb5add2cff30fa89ad33
2012-08-28 08:36:50 +00:00
Niklas Laxström
7cbaf20937 Fix Icfa371d2: some workaround to avoid unstub exception and typofix
Exception from line 124 of /www/w/includes/StubObject.php: Unstub loop detected on call of $wgLang->getCode
from Message::inLanguage

[28-Aug-2012 07:45:20] PHP Notice:  Undefined variable: validLanguages in /www/w/extensions/UniversalLanguageSelector/UniversalLanguageSelector.hooks.php on line 80
[28-Aug-2012 07:45:20] PHP Warning:  array_key_exists() expects parameter 2 to be array, null given in /www/w/extensions/UniversalLanguageSelector/UniversalLanguageSelector.hooks.php on line 80

Change-Id: I6ab332ce344c753a8ea5894fd9c45721a5835909
2012-08-28 08:11:35 +00:00
Santhosh Thottingal
7a5f3dd91d Do not accept invalid codes for setlang
Related to bug 37459, but this is not about uselang.

Change-Id: Icfa371d25697ee01c6bc262de968cfd2a1543154
2012-08-28 11:53:16 +05:30
Santhosh Thottingal
a74aa852a9 unnecessary module additions in addModule
* ext.uls.init is enough since it take care of all other dependecies

Change-Id: I8588006ea690391c417ced30cad1413e16406198
2012-08-21 15:28:12 +05:30
Santhosh Thottingal
f3ffe8bead 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
Reedy
0f0732f865 Fixup a few minor documentation issues
Added some newlines

Left a FIXME in LanguageNameIndexer.php

Losslessly compressed display.png

Change-Id: I884b423d3812ddb964a6a70f75a6331a73371165
2012-08-19 01:19:46 +01:00
Siebrand Mazeland
72d2519c4d Fix some issues pointed out by IDE.
* Update .gitignore to ignore .idea.
* Removed unused local variables.
* use local context and Message class instead of deprecated wfMsg* methods.
* Remove redundant px in CSS where possible.
* Combine CSS statements where possible.
* Replace b by strong.

Change-Id: I9d5ed7b7ce585a1c101044254bcbdfc33d42afc1
2012-08-15 17:32:49 +02:00
Amire80
103269694f Merge "WebFonts integration with ULS display settings." 2012-08-15 06:01:13 +00:00
Santhosh Thottingal
8f7382b242 Introduce languages options to ULS
Default value of this option will be $.uls.data.autonyms().
It can be set to limit language selection to a set of languages.

Updated examples, used a config variable wgULSLanguages to set this.

Change-Id: Ia322cbdcdb14f08619d2e4df5b23e2702841d147
2012-08-15 08:52:46 +03:00
Santhosh Thottingal
e62b50c9d8 WebFonts integration with ULS display settings.
This does not add much functionality. That will come in
future commits.

This commit has many cleanup, refactoring on the display settings,
language settings code.

Change-Id: I7fbc3ebb9b67c1afd80f159c2d82cd2a1c6bea74
2012-08-14 18:01:25 +03:00
Amir E. Aharoni
a3ab65906a Add Language settings dialog
Change-Id: Ie3455f32ac6ceff3c52d79643a6f7f82106ab7f1
2012-08-14 10:42:13 +05:30
Santhosh Thottingal
8959f2a9b0 Language Stickiness
* use setlang parameter to change language preference
* language preference will be persistant for all users
* for anonymous users, cookie 'language' will be used
* for logged in users, preference 'language' will be used
* uselang parameter can be used for temporary switching
* language codes will be sanitized.

Change-Id: I2472aee9a7dcd824b622edd38e83f20212f09945
2012-07-31 22:45:25 +05:30
Santhosh Thottingal
5703f0f1ad Fix Bug 38665 - Show clean 'x' icon on the search box only when useful
Change-Id: I3fc295728f25cce7a326101467146f8ee3415116
2012-07-30 22:44:28 +05:30
pginer
d8038afad9 (bug 38686) Autocompletion support
Provide atocopletion capabilities to the search box: showing the remaining
 part of the matching element and allow user selection with keyboard.

Change-Id: Ic591c3c87632fb56af16b9b15ecedbf9558d674a
2012-07-30 15:40:03 +05:30
pginer
5b055bdf5b (bug 38670) Provide a no results found view
Provide a view showing:
- A feedback message where the current search term is displayed.
- Suggested options: based on likely languages and languages with one
additional level of editing distance than the used in the search algorithm.
- Instructions for search and browse including links to all the sub-regions
available.

* Introduced success, noresults callbacks for language and region filters
* Region filter can be a link for a region alone.

Change-Id: I713b62911bb32e1b1427320ced767b144180c5c4
2012-07-30 14:47:21 +05:30
Santhosh Thottingal
b1b7c2feb3 Use grid based css design (made css resets local)
Introduced foundation based grid css
Related changes in example, template html

Change-Id: I8b1c1bae1c733ea0ed997d8317b9954592cf6eca
2012-07-23 16:49:00 +05:30
Niklas Laxström
966416872e Replace Foo Americas with just America
Change-Id: Id11dc72c6f7e93ad88076441e5fff5ed69f7b069
2012-07-19 10:22:40 +00:00
Amir E. Aharoni
7f3b3b1210 Save source files as UTF-8
Non-ASCII characters broke the functionality.
Saving as UTF-8 fixes this.

Also removed an unneded <?php statement from a JS file and replaced
non-ASCII pretty apostrophes with straight ASCCI.

Change-Id: Ic6719fe0863bc5d8ae19abbf01cfbb7b2b714f12
2012-07-18 15:29:17 +03:00