Commit Graph

28 Commits

Author SHA1 Message Date
Siebrand Mazeland
6a2b2e0bba Update test files
- Updated versions and order of checkers.
- Some consistency updates in Gruntfile.js.
- Updates to make jscs pass.

Change-Id: I7ed93596ff383dc713bd17af2da0472be934d59d
2016-02-18 18:51:37 +00:00
Fomafix
cd58ac2f18 Use mw.Api.plugin.options to set user options
This requires MediaWiki version 1.25+.

Change-Id: I3a76b0b4ec403b3acdc29e64b0c750a3b57e252a
2016-02-15 14:13:13 +00:00
Fomafix
c329f1473d Use spaces inside of brackets in JavaScript
* For consistency
* For MediaWiki coding conventions

Change-Id: I625a8ce0119b1490073f048e1b8ad4e90762d6e2
2016-02-15 13:31:45 +00:00
eranroz
301520f3fd Avoid (safe) exception by using empty options
Using try-catch block to handle common case of empty options isn't nice.
Avoid it be replacing options to valid JSON

Change-Id: I5b64f7f9a76a94d9c07face8059beab59d4aef93
2015-07-16 13:16:45 +03:00
Niklas Laxström
d25f7f3307 Fix ULS QUnit tests
Tests were failing for two reasons: wrong modules as dependencies of the
test module and test timing out due to incorrect usage of QUnit.asyncTest
and QUnit.start() and QUnit.Stop.

While at it, did some small cleanups and converted the number of
assertions to use non-deprecated QUnit.expect() instead.

Options are saved using postWithToken of mw.API. This also rises minimum
MediaWiki version to 1.22. This allowed removing hundred lines of code.
MLEB is already 1.22 and above.

Change-Id: I46a1674e4ede48a0e331c8d201d1d847db51d9dd
2014-09-18 11:40:39 +00:00
Amir E. Aharoni
7627358fb4 Prevent JSON parsing errors
Bug: 61137
Change-Id: I2df6b6108bb7834b927205d3b6afa69354cecaf7
2014-02-10 15:25:37 +02:00
Santhosh Thottingal
1c3a935ef0 Try to restore the old preferences, if any, if possible
Preferences were saved using jStorage. The browsers which ULS supports now
have wide native support for local storage, so we removed jquery.jStorage
in I09b2bd52972.

The old local storage key was 'jStorage' as put by jquery.jStorage. We now
check if that key is present. If so we migrate the preferences and remove
the old key to save space. We are not aware of anything else using this
module.

Change-Id: I995a32c4cb7a3bc818fe255f92dbc972211cb112
2014-02-10 17:52:04 +05:30
Santhosh Thottingal
e21c221e2b Use localStorage, fallback to cookie, remove jquery.jStorage RL dependency
As per comments in I22613d9f6846db5456beb532cec47396fccda8ae

Change-Id: I09b2bd52972d9aef20dd469c556631e0299bc407
2014-02-10 12:11:13 +00:00
Timo Tijhof
c6d71015ff Various clean up
Files:
* Consistently have one (1) new line at EOF
  (.gitignore, *.css, *.sh)

JSHint:
* Separate the common (general Wikimedia code conventions) from
  the local more stricter rules (nice work!).

Maintenance:
* Use simplified $IP definition where getenv is only called once.
  Based on http://git.io/ve-mw-36fc3b59-makeStaticLoader

JavaScript:
* Use the same closure in all files:
  - No need for "undefined".
  - One linebreak between license header and start of closure
    (sometimes there were 1 or 2 empty lines).
  - ext.uls.ime.js: No need for "document" (redundant in general,
    but especially as it wasn't used anywhere in this file).
  - Use "$, mw" for all ext.* modules (one of them used "mw, $").

Change-Id: Iba5dab14bbc3fbfc9f8fe96dd2d95529587a69aa
2014-02-08 00:11:50 -08:00
Nikerabbit
2bc77f2c18 Revert "Do not load jquery.jStorage for logged in users"
This reverts commit 5884337c9f.

Change-Id: Icfdfd89059a417a6aaea30d12164e7174dd5f58b
2013-11-12 12:47:56 +00:00
Niklas Laxström
5884337c9f Do not load jquery.jStorage for logged in users
Change-Id: Ibe77962cecd6aa8504aa60d5d2b8d17a56e1319f
2013-11-12 10:40:59 +00: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
Santhosh Thottingal
bf270812f5 Fix all jshint errors
Change-Id: Ib8fb350132bb34c1e063eb644af5aeff833f95e8
2013-05-20 15:07:42 +05:30
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
Santhosh Thottingal
77383aa26a Simplify variables and clean up comments
Not supposed to have any functional changes

Change-Id: Ibb16af9144f183d85b985bcb3133a4244e310cda
2013-03-07 17:49:52 +02:00
Santhosh Thottingal
3cce3dd599 Cache the options token for preferences system
Change-Id: I2e9a4326119db390aba36cc5bc6da20c5c16eed1
2013-03-07 14:49:39 +05:30
Amir E. Aharoni
027776c85f (bug 41763) Add a hook for support uls-preferences
Change-Id: I8fdc1a0527c9a99b6e5eb95c183955a162233b1d
2013-01-09 16:12:20 +02:00
Siebrand Mazeland
9ff4a4c343 Remove empty @returns comment
Change-Id: I83625c21a0de492004a1f20337a8288de0e49fd3
2012-11-12 07:46:38 +01:00
Santhosh Thottingal
fc4ca9f823 Callback for preference save action is optional
$.noop() was wrong. Changed it to $.noop as callback

Change-Id: Iff935e1a9c1b364efd947ce1bff785dacb81570e
2012-10-29 10:34:43 +05:30
Santhosh Thottingal
4b09afb2ba Simplify the preference system
* Just use key,value system and drop the concept of groups
* Abstract the preferences for each type of systems(display, input)
  to have meaningful APIs

Change-Id: I25423667adf6ca181a4027cdfc4ed378f36a94ba
2012-10-23 09:59:26 +05:30
Santhosh Thottingal
b8b6cc7be7 More jshint fixes
Change-Id: I132133b183be28165067f2c023304c00a4cb8f76
2012-10-16 17:10:08 +05:30
Santhosh Thottingal
5b3f7cc269 Whitespace cleanup, remove deprecated methods
* Fixed many white space issues- mainly whitespace missing before
  function start paranthesis eg: function()
* Removed the deprecated live methods and replaced with on
* Added file documentation for ext.uls.geoclient

Change-Id: Ib2c8cfed1a6ff3859495e707680d5c19882a33e8
2012-09-07 16:47:03 +05:30
Santhosh Thottingal
b845045070 Use jquery.jStorage for saving preferences of anonymous users
Change-Id: I36f9f13a3468a11e05d1e1bb59b1841aa3464a24
2012-08-30 08:23:21 +00:00
Amir E. Aharoni
567cb54a9a Fix font preferences saving.
Change-Id: I31ea1092bd5258c4af3973ae8237337133fd5d94
2012-08-22 08:36:53 +03:00
Santhosh Thottingal
5c6567adbc Whitespace, typo, jshint fixes
Change-Id: Ib22d9c4a75d1f9ce77a7db2a820dc6de9c680b09
2012-08-21 12:12:15 +03:00
Santhosh Thottingal
a07dc90ddf Make the preferences singleton
Renamed $.fn.uls.preferences to mw.uls.preferences since this is not a jquery
function, but a singleton object per page.

Change-Id: Ie6c37fb321685e927fa5197fa8a53f41bff656ef
2012-08-21 10:09:25 +05:30
Amir E. Aharoni
5bb5ca0118 Add webfonts reset functionality to the checkbox
Change-Id: I983d261fa018416c36ad2123b94850986beeca70
2012-08-17 11:57:02 +03:00
Santhosh Thottingal
1bc80d58ba ULS persistent preference system.
Change-Id: Ieb22e09f226e770c9935b875f4226a75ffd8c46d
2012-08-16 17:20:21 +03:00