Commit Graph

66 Commits

Author SHA1 Message Date
Amir E. Aharoni
8205e294d7 Allow disabling of IME by a jQuery selector
Add the variable $wgULSNoImeSelectors to allow custom
disabling of IME in specific elements.

Add captcha input field id to the exclusion list.

Bug: 41675
Change-Id: Ib03a20c50a4f473e6a58638b85da16659268eb09
2013-07-05 13:37:31 +00:00
jenkins-bot
7b9f4c863c Merge "Prepare ULS for EventLogging" 2013-07-03 10:42:43 +00:00
Niklas Laxström
4543d43dda Prepare ULS for EventLogging
This change introduces a new configuration variable, $wgULSEventLogging. When
set to true, ULS will register an EventLogging schema module for
<http://meta.wikimedia.org/wiki/Schema:UniversalLanguageSelector>,
making it possible to log events using `mw.uls.logEvent`. When false, the
schema module is not loaded, and `mw.uls.logEvent` is a no-op.

Change-Id: I7139e67cc2f830a6b4b3c8ff1fc72dfcdec9a699
2013-07-02 12:47:22 +00:00
Santhosh Thottingal
2776a28d58 ULS i18n performance fixes
* Since there is an API to load the i18n json files, avoid sending
  list of localizations to client. Previously this list was used to
  avoid 404s for json files. Now API takes care of it. Remove the
  caching for this list too.

* Preload the i18n files on document ready. This avoids delay in
  initializing IME or ULS window after fetch i18n from server.

* ApiULSLocalization can serve messages for all namespaces known if
  namespace parameter is not set

Bug: 50391
Change-Id: I6b848da35f57353790bf460983cdf19a11bb238a
2013-06-30 18:08:19 +05:30
Siebrand Mazeland
4a1035dcbf Remove last bits of MediaWiki 1.19 compatibility
Compatibility with MediaWiki 1.19 had already been dropped and this hadn't
been removed yet.

Change-Id: I63788ef1d4a6eb87e4280ea2625579a7874eaff8
2013-06-17 16:44:00 +02:00
Siebrand Mazeland
1aa4940de7 Update docs and type hints
Change-Id: I6c513265d7e3136c43c160b86a83a921defaa3ec
2013-06-17 16:33:52 +02:00
Siebrand Mazeland
d8434da23f Initialise possibly undefined variables
Change-Id: I095395e3b3e3514dc4e6fd5d905112da122a7418
2013-06-17 16:28:34 +02:00
Santhosh Thottingal
8b46d34004 Allow ULS language settings accessed from user preference screen.
Adds a link in 'personal/i18n' section of user preferences

Bug: 47240
Change-Id: I04d1ea7d36db45f9a0af04e11dade9ae0b524e8e
2013-05-27 16:33:40 +03:00
jenkins-bot
c57cab0403 Merge "Reduce use of globals" 2013-05-26 11:07:01 +00:00
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