Commit graph

24 commits

Author SHA1 Message Date
Krinkle
80ceef39e4 [jquery.client] clean up
* Move translate() out of the if-block, no need to re-define
* `else` after return in `if`
* update js coding style
* remove bogus '=' in comment
* line-wrapping of long arrays
2012-03-15 06:44:25 +00:00
Trevor Parscal
eb8e7b2527 Added "Rekonq" to list of known browsers, which prevents it from being considered to be Safari. Whoever chose to make the user agent of this browser look like Safari 2.0 is an idiot. This should sort out bug #34924 2012-03-05 23:14:58 +00:00
Krinkle
0e82a6cfd0 Applying whitespace conventions in core JS files.
* Mostly whitespace in callers: $('foo').bar(baz,quux) => $( 'foo' ).bar( baz, quux )
* Also several occurrences of mixes spaces and tabs in the indention in front of a line, converted to tabs.
* And double spaces -> single spaces at random.
2011-08-12 21:48:10 +00:00
Krinkle
b4f0c3ea62 jquery.client unit testing
- More elaborate caching in the plugin in order for the code to be testable
- Added support for passing custom user agents (although the default behavior remains unchanged)
- Added support for passing custom profile-objects to $.client.test
- Added test case for all supported browsers according to http://www.mediawiki.org/wiki/Compatibility#Browser
- Replaced userAgent.toLowerCase() with userAgent since this string was already converted to lower case a few lines up

This will likely prevent bugs like bug 27652 and bug 29446.
2011-07-04 19:11:08 +00:00
Derk-Jan Hartman
ed7d6a6509 Patch to replace for-in with for(;;)
This breaks when strange things are added to Array.prototype (and you never know what users do in their user scripts), so use for (var i = 0; i < ...length; i++ ) instead.

Fixes 29676. Patch courtesy of Micheal M.
2011-07-02 08:32:19 +00:00
Krinkle
95173d11f1 New mediawiki.page modules
First step towards cleaning up mw.util.init and removing bugus dependancies on mediawiki.util which are just added there in order to load them on every page and do something on-load.

Introducing mediawiki.page.startup (in the head) and mediawiki.page.ready (on the bottom)

Moved the following to them:
* document.ready from jquery.cient
 -- Shouldn't have been in the plugin itself in the first place
* jquery.placeholder
* jquery.makeCollapsible
* mediawiki.action.view.tablesorting
* jquery.checkboxShiftClick

(This also solves part of bug 26799)
2011-06-22 21:27:12 +00:00
Krinkle
181d9b93de jquery.client.js JSPERF+Unit test suite
- Using one closure function instead of two
- Comparing to undefined instead it's type (faster, [[mw:JSPERF]])
- Adding basic test suite
2011-06-06 20:51:27 +00:00
Krinkle
a832f9f450 Fixed (bug 27652) [jQuery.client] versionBase is wrong for versions higher with two or more digits
* A userAgent like the following:
> "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; nl-nl) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4"
Will now have a versionBase of "10" instead of "1".
* A few JSHint warnings fixed (missing semicolon)
2011-03-06 14:34:10 +00:00
Krinkle
892de3450c Applying conventions and some JSLint good practices in core modules. 2011-01-31 22:02:58 +00:00
Krinkle
bc0f9cac32 Wrapping core modules (FIXME from r79929)
(Touch: r74088, r73046)
2011-01-31 19:33:16 +00:00
Trevor Parscal
534f6abd6b Fixed logic error - all tests were passing... :( 2011-01-11 23:15:26 +00:00
Trevor Parscal
9d999a61fc Fixed logic error that caused the test to always pass. 2011-01-11 21:55:45 +00:00
Trevor Parscal
dfabce85cf Included client in the initial payload. Restored functionality that used to exist in this plug-in that adds classes to the document's HTML element for browser and platform information. This will help reduce CSS hacks to only be used for non-JS rendered items. 2011-01-11 20:56:15 +00:00
Krinkle
85d5e617d7 Removing unneeded wraps and using $ and mw instead of jQuery or mediaWiki since r79246 enabled the private scope by default. No need for two wraps.
(the wraps had an extra indention, hence the diff will probably look huge)
2011-01-10 05:33:03 +00:00
Roan Kattouw
674e917ce2 Indentation fix 2010-11-01 14:25:47 +00:00
Krinkle
4074b58c3c white-space cleanup throughout $.client and mw.util and mw.util.test (r75593) 2010-10-29 15:30:54 +00:00
Krinkle
77424c1f50 adding layoutversion to $.client and isLayoutVersion to mw.util. Follow-up of r75593 2010-10-29 15:27:53 +00:00
Trevor Parscal
4f166d4fe8 Improves on r73032 by making more consistent use of escape sequences. 2010-10-01 19:20:27 +00:00
Trevor Parscal
659c86a019 Changed profile property names - this should be the stable API from now on. 2010-09-20 19:20:55 +00:00
Trevor Parscal
b16d2d0beb fixed comment 2010-09-20 19:12:28 +00:00
Trevor Parscal
7c97cae851 Swtiched to using a more robust object to properly store a cached profile 2010-09-15 02:34:31 +00:00
Trevor Parscal
92d8037bb9 Added collapsible tabs plugin, reworked tabIndex functions, and fixed some syntax errors. 2010-09-15 02:03:24 +00:00
Trevor Parscal
6554e106a0 Removed remnant of this being a mediaWiki module. 2010-09-15 01:48:55 +00:00
Trevor Parscal
3bb421904a Moved client library to a jQuery extension - which makes it more useful to non-mediawiki people. 2010-09-15 00:58:59 +00:00