Commit graph

270 commits

Author SHA1 Message Date
Roan Kattouw
a9c21dbfdd Fix spacing in r111809 2012-02-22 23:34:08 +00:00
Andrew Garrett
a5f83ab290 Add missing dependency of mediawiki.user to mediawiki.api.watch. May resolve some of bug 34450 2012-02-18 00:42:41 +00:00
Krinkle
05e1140cf7 [mw.debug] Clean up
* Instead of inline global variable and lazy-loading, using ResourceLoader (using mw.config and mw.loader)
* Can't use OutputPage::addJsConfigVars / OutputPage::addModules because debug is called after those are handled, using ResourceLoader::makeConfigSetScript instead
2012-02-13 15:25:08 +00:00
Roan Kattouw
4b18bbb2f5 Make mediawiki.legacy.ajax top-loading too, apparently some people are still using sajax on the live site. Eventually the legacy.ajax module should die entirely 2012-02-09 14:14:45 +00:00
Roan Kattouw
57310ab838 (bug 34289) user.options CSS loaded twice. Fixed by splitting off the CSS part of user.options into a separate module (user.cssprefs), as per the fixme comment added in r93363. No RELEASE-NOTEs because this is a regression fix that I'm gonna tag for backporting to 1.19 2012-02-09 11:04:24 +00:00
Sam Reed
31827c47b1 Ping r110759, remove erroneous extra subdir 2012-02-06 17:06:10 +00:00
Sam Reed
82ad85f2e2 Move mediawiki.api to own folder 2012-02-06 16:58:10 +00:00
Krinkle
be06bd4560 Enqueue mw.util.init in document-ready even handler earlier
* Previously $(document).ready(mw.util.init) was in module 'mediawiki.page.ready' (position: bottom). I've now moved this to 'mediawiki.page.startup' so that it'll be enqueued sooner.
* This making it more likely that if someone also enqueues in document-ready that mw.util.init ran before than and thus mw.util.$content populated
* Fixes bug 33711

* All this is still depends on the order in which the event handler queue is executed, which is risky. Bug 30713 will bring the solid "watertight" solution
2012-02-02 00:47:53 +00:00
Krinkle
3c72b527ed Add support for loading mediawiki.util from the top by default
* Introduces $wgPreloadJavaScriptMwUtil
* Instead of loading mediawiki.util as base module from the bottom, now loading it from queue position "top" if $wgPreloadJavaScriptMwUtil is true. And if false it'll remain in the bottom in practice as implied by other modules loading it as a dependency (i.e. mediawiki.page.ready depends on it)
* Fixes bug 33746
2012-01-29 19:40:11 +00:00
Sam Reed
e6ee87eb66 Redoing r108960 with history
If it was a 3rd party library, there probably wouldn't have been any use doing this
2012-01-23 17:02:51 +00:00
Sam Reed
0464ee0045 Revert r108987 to copy properly 2012-01-23 16:59:32 +00:00
Krinkle
5db054ba0b [Core JS] mediawiki.legacy.protect should be loaded from the top
* The global object created by this legacy module is references from inline on-event attributes as well as from inline <script>'s by ProtectionForm.php
* Needs to be loaded before any of that happens
* Fixes bug 33660
2012-01-22 02:51:06 +00:00
Krinkle
dc7815689f [Resources] Add missing or implied dependencies
* mediawiki.action.watch.ajax:
-- Depends on mediawiki.api.watch>mediawiki.api>mediawiki.util
-- But also uses mw.util itself, so adding it here as well. mw.Api might one day not use mw.util
* mediawiki.special.block: Uses mw.util.isIPv4Address / mw.util.isIPv6Address
* mediawiki.special.changeemail: Uses mw.util.validateEmail
* mediawiki.legacy.upload: Uses mw.util.wikiScript
* Uses mw.util.wikiUrlencode

Commit is inspired by and a superset of the patch provided by Rainer@Rillke.eu at bug 33760.
2012-01-21 13:31:51 +00:00
John Du Hart
4537f5fe4e Adding jquery.arrowSteps to core, from UploadWizard 2012-01-15 06:07:24 +00:00
Rob Moen
b41d2608c9 remove concurrency resource per revert. follow up r108600 2012-01-11 18:00:49 +00:00
Rob Moen
6d01700a7e add js resource for concurrency api, check method for resource checkin & checkout 2012-01-11 00:17:17 +00:00
Roan Kattouw
f816325410 Set position => 'top' for wikibits, required to support legacy gadgets. Spotted by Niklas on TranslateWiki. Ping r107327. 2012-01-06 12:03:06 +00:00
Roan Kattouw
901ce4e4a2 Remove unneeded dependency from wikibits, and move the showtoc and hidetoc messages to mw.util where they're used 2012-01-06 11:44:41 +00:00
Krinkle
2bed75d951 [jquery.footHovzer] new plugin for mw-log-console and mw-debug-toolbar
* Previously mw.log and mw.Debug both were in a fixed container on the bottom, overlapping each other. mw.log did increase the body's padding-bottom to account for the height so that all content is still visible, but it was still a problem when mw.Debug came along.
* This plugin adds a single fixed position element to bottom of the body, to which other stuff like mw.log and mw.Debug can append a non-fixed position container. That will take care of it.
* Method update() will re-check the padding and scroll position and fix where needed
* Reduces code a little bit
2012-01-04 01:28:01 +00:00
Antoine Musso
c447423593 merge JSTesting branch into trunk
Changed written by Timo and reviewed by Hashar. This should be harmless.

To enable the feature:
  $wgEnableJavaScriptTest = true;

Then head to:
  [[Special:JavaScriptTest/qunit]]
2012-01-03 18:33:26 +00:00
Krinkle
be12ebf1ab [Core JS] More fixing of global config variable usage
* mw.config is the new way, and global config variable lookups are deprecated

* Based on two phase3-wide quick searches:
-- of " wg": http://toolserver.org/~krinkle/wikimedia-svn-search/view.php?id=321&hash=81700bf7486e4fee3b7bc1f83eb9eba6
-- of "!wg": http://toolserver.org/~krinkle/wikimedia-svn-search/view.php?id=327&hash=47c9d54a7a1d5d58a724dd834585f40d

Related changes:
* Changed some php comments mentioning "wg" variables to include the dollar sign, and a typo when the wf function prefix was meant.
* Removed TODO comment in wikibits.js and made it use the JS equivalent of wfUrlencode, which we have now, mw.util.wikiUrlencode 
* SpecialUpload.php: use OutputPage::addJsConfigVars instead of creating a new script tag through OutputPage::addScript(Skin::makeVariablesScript(..))
* Renamed wgUploadSetup in upload.js and made it local. Not used anywhere in ./trunk/phase3 and ./trunk/extensions
* Fix OutputPage::addJsConfigVars so that it can actually be called with an array instead of two arguments for key/value
* Some minor whitespace/convention stuff around the same line
2011-12-31 21:25:00 +00:00
Santhosh Thottingal
18d4be5f55 Revert r107556 based on the discussion. 2011-12-29 14:06:12 +00:00
Santhosh Thottingal
d9670f61a9 Use jqueryMsg wikitext parser to parse interface messages at client side. Support for PLURAL in javascript. 2011-12-29 09:29:07 +00:00
Sam Reed
2c83ec33e4 Reverting r107496, r107497
Seems there is reasonable reason for it to be in core, and it will be becoming more used in the near future
2011-12-28 15:42:06 +00:00
Sam Reed
b8bc80498c Move mediawiki.feedback.js to "Feedback" extension 2011-12-28 14:49:32 +00:00
Krinkle
f8f0a71beb [mediawiki.api] write mediawiki.api.watch module
* add mediawiki.api.watch module
* mediawiki.api.parse.js: remove 'data && ' check to match the other modules. If data is not good, then the internal error handler will have already handled it and never call the ok-callback in the first place.
* mw.Api.errors: adding error codes by ApiWatch.php
2011-12-27 00:44:49 +00:00
Krinkle
2b3733ecab [Core JS] wikibits.js / IEFixes clean up
* fix on-the-loose fixalpha() call
-- Calls should not be dangling loose like that
-- Removed local calls from skins and installer
-- instead calling from the IEFixes script (which is loaded raw by wikibits which is loaded from the bottom, as are all legacy scripts)
* Removing usage of 'skinpath' and 'skin' globals in wikibits.js, those aren't globals per se since introduction of mw.config and $wgLegacyJavaScriptGlobals
* Wrapping wikibits.js in closure to avoid leakage of "local" variables. This shouldn't break anything as it is loaded through resource loader which, in production mode, wraps it in a closure anyway.
* adding explicit posision=>bottom for wikibits. 'bottom' is default but repeating here since it must not change for legacy reasons.
2011-12-26 16:12:07 +00:00
Sam Reed
a34657b4e4 Followup r107011 per Krinkle - "mediawiki.api needs to declare the mediawiki.util dependency." 2011-12-24 23:09:45 +00:00
Robin Pepermans
59e9daf6e7 Follow-up r92924: move the CSS/JS for e-mail validation to Special:ChangeEmail.
Also merge the different LTR/RTL styles, it is flipped anyway.
2011-12-17 18:31:25 +00:00
Neil Kandalgaonkar
7047be59eb put bugzilla link and description into one string (description of form closer to the form itself). Fix misplaced comma. 2011-12-15 02:06:47 +00:00
Neil Kandalgaonkar
c3b3e088a7 add bug reports to feedback 2011-12-14 01:26:28 +00:00
Neil Kandalgaonkar
76c591e854 add jquery messages to core, config mediawiki.feedback to use it correctly 2011-12-13 02:44:34 +00:00
Neil Kandalgaonkar
aa83fbf7a7 feedback - move messages, etc from uploadwizard to core 2011-12-12 23:15:42 +00:00
Neil Kandalgaonkar
cb0cf72eba add JS api, feedback libs from UW into core. 2011-12-09 04:48:39 +00:00
Sam Reed
25d29a7b04 Update jquery.effects 2011-12-08 23:54:06 +00:00
Sam Reed
04b0f02225 Update jQuery.ui from 1.8.16 to 1.8.17 2011-12-08 19:17:59 +00:00
John Du Hart
0de3082ca4 Adding new debugging toolbar
Needs a UI cleanup still, but for the most part is working.
2011-12-04 18:29:57 +00:00
Krinkle
e5e0a81ef0 [Resources.php] Must. Have. Order. 2011-11-11 00:17:38 +00:00
Krinkle
b150282e84 [JSTesting] Fix dependencies. Of course jquery.qunit.completenessTest needs jquery.qunit 2011-10-20 22:34:05 +00:00
Mark A. Hershberger
3364af3887 Revert r79363, r79364, and r79369 to disable datalists support entirely based
on Bug 31602, Bug 31697, Bug 31654, Bug 31658, and even Aryeh Gregor's
comments in
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-December/029593.html
2011-10-20 14:46:29 +00:00
Roan Kattouw
d28639c1ce Followup r99923: add missing dependency 2011-10-15 23:16:26 +00:00
Roan Kattouw
c78b4fb6e4 Move jquery.validate plugin from branches/salvatoreingala to core 2011-10-15 23:13:26 +00:00
Roan Kattouw
4d8c7e96ed Add jquery.farbtastic module to core, copied from branches/salvatoreingala 2011-10-15 22:41:45 +00:00
Sam Reed
6948c03824 Followup r98808, pressing save is sehr-useful 2011-10-03 22:41:27 +00:00
Derk-Jan Hartman
3277c2bc29 Add the class jquery-tablesorter to all tables that are made sortable.
Use this classname to raise the specificity of the sortHeader, so that it is more difficult to accidently override with local css. Followup to r98069

Move the css into a seperate file and move the images for it to the jquery directory.
2011-10-02 11:08:12 +00:00
Santhosh Thottingal
8692ee675f Add mediawiki.language/languages/nl.js and mediawiki.language/languages/pt.js 2011-09-26 06:08:46 +00:00
Daniel Friesen
db1a37382c Improve the accessibility of our jump-to functionality
- Stop hiding with display: none;, this hides our jump links from modern screen readers and users with motor disabilities (ie: nowadays, pratically everyone they are intended to help).
- Instead hide with an overflow that will make the links viable <tab> targets. This alone is enough to help screen reader users.
- Add in a script that will show the jump-links area on-focus for motor-impared users who can still see who have js enabled (this can't be done with css unfortunately)
2011-09-25 00:49:39 +00:00
Krinkle
de72c4ed14 [RL] pass 'media' property to <link> tags as well (in already did it for the <style> tags). Fixes debug-mode bug where print stylesheet were loaded in e.g. 'skins.modern'.
*  (Follows-up r88053 c22683 CR)
* Whitespace fix in Resources.php
2011-09-17 02:32:36 +00:00
Krinkle
d0677222a5 Split ajaxCategories away from core for now, into an extension:
* Move js/css/images from core into extension dir (kept svn history in tact)

* Removed from core:
** Messages
** Resource definition
** Default settings

* Recreated in extension: 
** Messages with 'inlinecategorizer' prefix (instead of generic 'ajax' prefix).
** wgResourceModule definition
** Hooks for adding module to the page
** Setting wgAJAXCategoriesNamespaces kept (renamed to $wgInlineCategorizerNamespaces)

* Made minor adjustments to the messages:
** Fixed references to other messages (in /qqq) with the new message key

* Made minor adjustments to the javascript:
** Usage of mw.msg fixed to the new message keys
** Removed "@since 1.19"
** Removed "Relies on mw.user.getId" (because it didn't', and still doesn't)
** Object 'mw.ajaxCategories' -> 'mw.InlineCategorizer' (capitalized, since it's a constructor, per our conventions)
** Removed 'disableAJAXCategories' config, not needed.


Summary of justification for move out of core (again):
* Too many issues with the parsing logic (many cases still don't work yet)
* Almost untested and untestable because of mixing UI with logic code. Needs separation.
* See http://www.mediawiki.org/wiki/User:Krinkle/Extension_review/InlineCategorizer#Prequel

One day we might move it in, or if the "new parser" is ready and the "visual editor" we might not need it all together and it'd simply be a 10-20 line module in the visual editor (that, or it'd be part of the visual editor by default).

Anyway, I'm not against this module. if we can get this to an acceptable state soonish before any of the new parser / visual editor is ready, then I see no problem in bundling it with core and/or merging it into core.
2011-09-04 19:35:22 +00:00
Krinkle
17cecf2647 Separate execution from definition (mediawiki.util.init)
* bug 30710

Also makes it easier to do unit testing, this way the module can be included and the test can initialize it if and when it wants to.
2011-09-02 21:17:54 +00:00
Daniel Friesen
0a9b4c6dc2 Remove the basic styles that vector coppied from monobook from both monobook and vector and relocate them to a series of css stylesheets which 3rd party skins can include.
Havent touched Modern yet. External link icons are too complex to deal with this round due to vector and monobook using different icons.
2011-08-31 06:59:15 +00:00
Krinkle
366262ecbd Make file names match module names.
* See [[Coding conventions#File naming]]
* This pretty much undos r94325.
2011-08-29 23:36:48 +00:00
John Du Hart
3b4e0b46e9 (bug 30499) Create jQuery replacements for injectSpinner and removeSpinner 2011-08-24 21:08:39 +00:00
Sam Reed
907ef110dc Revert r91728
Hence reverting r93382, t93383, r94236
2011-08-24 18:22:53 +00:00
Roan Kattouw
c26e52d255 Fix some indentation and comments in mediawiki.Title, and make it depend on mediawiki.util 2011-08-16 15:32:08 +00:00
Krinkle
7d569319c7 more ajaxCategories fixes based on review in r93351 CR
* Html-escaping unescaped message in summaryHolder 
* Check for errors in the API response
* Pass true for existence of redirect origin and value of 'exists' for target (instead of backwards)
* Comment fixes
2011-08-12 11:35:50 +00:00
Krinkle
b7ac406fd9 Apply lowerCamelCase to files for constructors as well.
(Follows-up r94230)
2011-08-12 06:41:55 +00:00
Krinkle
b3e3e305f4 Add module definition for jquery.qunit.completenessTest and set position to top for jquery.qunit (right now it's manually loaded with a <script> tag, but once it's loaded dynamically it should be loaded from top because of the styling and the hooks that it makes available). 2011-08-11 14:28:16 +00:00
Krinkle
a944177202 Rename mw.uri to mw.Uri + minor fixes:
* Renaming mw.uri to mw.Uri (since it's a constructor)
* Leaked global variable 'g' in _parse() fixed
* Removing unused local variable '_this' in getQueryString()
* Fix documentation (jQuery 'setAttr' should be 'attar')
* Making non-private variables with '@private' comment, private (or "local"). 
* Using strict undefined comparison (shorter and faster, [[JSPERF]])
* Moving Resources definition from MediaWiki Page section to MediaWiki main section (to reflect directory structure)
* Coding style conventions (mixed spaces and tabs, line wrapping, double/single quotes)
* Remove passing mediaWiki to mw argument (mw is a global alias)
* Passes JSHint

* Removing 404 errors from UploadWizard/test/jasmine/SpecRunner.html

(Follows-up r93781 's move)
2011-08-11 04:09:34 +00:00
Krinkle
d9cdc43b0e Renaming jquery.mwPrototypes to jquery.mwExtension
* Originally they were a few prototypes on the native String object, however they were converted to be (static) members extending the jQuery object. Calling them prototypes is confusing. A grep search on /trunk/ didn't reveal any direct uses of this module (it's loaded by default through mediawiki.util's dependencies)
2011-08-11 03:12:12 +00:00
Ian Baker
59a4e49976 Adding new jquery plugins to Resources.php so they'll be available through ResourceLoader, followup to r93908 2011-08-04 20:52:40 +00:00
Neil Kandalgaonkar
6d6cb9298b moving URI library to main resources 2011-08-02 20:33:27 +00:00
Krinkle
f84bd99142 Port 'editondblclick' js to ResourceLoader.
- Fixes (bug 27894) Move 'editondblclick' event listener down from body to
  div#bodyContent
- Patch by Nik <niknyby@gmail.com>
- Changes since patch:
  * Moved from OutputPage->headElement (where the bodyAttr-hack used to be) to addDefaultModules where other additions live
  * Added dependency on 'mediawiki.util', it must be initialized before mw.util.$content can be used
  * Whitespace conventions
2011-08-01 22:13:32 +00:00
Krinkle
d9434a0caf Reorder some modules in Resources.php to match directory tree and alphabetical sorting. 2011-08-01 21:46:54 +00:00
Leo Koppelkamm
d2fc14068d * Ignore any <nowiki> or comment sections
* More natural messages
* Respect wgCaseSensitiveNamespaces
* Regex: Add possible whitespace between "[[Category:" and the category name. ( [[Category: Foo]] )
* Make nearly all functions publicly accessible
* Add "cancel all" button
* Submit on enter keypress
* Check for redirects
* Color links correctly based on existance of category page
* Add a summary of the changes done into the edit summary ('+Category:foo, -Category:Bar: Foo is not correct...')
* Add more error handlers
* Add more hooks ( afterChange/Delete/add ).
* Pass category names to the hooks
* Allow hooks to abort by returning false
* Handle sortkey correctly in all operations
* Move addCategory form below categories.
* Fix any known IE6 and IE7 bugs.
* Add more documentation
2011-07-25 19:03:26 +00:00
Krinkle
cb6029734f ajaxCategories fixes:
* Partial revert of r92264. mw.ajaxCategories has nothing to do with mediawiki.util.init, moved into separate initiation module, only loaded when ajax categories is enabled.
* Removing instantiation from the script. mw.ajaxCategories is now a public accessible constructor
* Fix Uncaught ReferenceError: wgUserGroups is not defined
($wgLegacyJavaScriptGlobals = false;)
* Renamimng stripIllegals() to clean(), adding '#' to the regex as those are not allowed either.
* Combining var statements by separating them with comma's ( var foo, bar, baz; ) instead of "var foo; var bar; var baz;"svn up
* Using dot.notation for objects instead of array-like['string'] keys
* Whitespace conventions
* Using inArray utility instead of indexOf (cross-browser support, mostly IE6)
** $.inArray uses Array.prototype.indexOf if available, otherwise fallback to a loop. mw.util.inArray is a wrapper around $.inArray to return a boolean value (since inArray/indexOf may return 0)
* Don't use $( '#bodyContent' ) (skin specific) but mw.util.$content
* Using mw.Title
* Re-using helper functions from the outer-closure instead of re-declaring them privately for every instance again (performance!)

Follows-up: r92112, r92151, r92264
2011-07-15 19:25:16 +00:00
Leo Koppelkamm
cd97c09138 r92253 : readd useful changes 2011-07-15 18:19:10 +00:00
Brion Vibber
cf627bc707 Revert r92238: partial addition of broken test cases to qunit test suite; loading of modules with uninitialized data triggers errors in console and marks the entire revision black in TestSwarm. 2011-07-15 17:29:17 +00:00
Leo Koppelkamm
560d6f08d2 AjaxCategories: move self init to mw.util.init; start with qunit 2011-07-15 11:12:07 +00:00
Leo Koppelkamm
5e919c6e10 AjaxCategories: More interface polish 2011-07-14 20:48:01 +00:00
Leo Koppelkamm
3a839236b5 Fix expandableField.js dependencies 2011-07-14 17:26:32 +00:00
Leo Koppelkamm
bfb5b65879 AjaxCategories:
* Lay foundation for MultiEdit mode 
* Add releasenotes 
* Fix typo in function name 
* Change error msg per CR
Ping r92062
2011-07-14 15:00:33 +00:00
Krinkle
9b1de35c3e New jquery.getAttrs module
- A cross-browser compatible way of getting a direct key/value object of attributes
- Will help making comparisons such as in r92113 easier and work cross-browser
2011-07-13 22:46:17 +00:00
Leo Koppelkamm
de96e92368 Rewrite ajaxCategories for ResourceLoader. Add some missing functionality (edit categories and more). Move styles from shared.css into own stylesheet. Fix regex bugs 2011-07-13 22:36:03 +00:00
Krinkle
79e045e139 Selfrevert r91759. Messed up working-copy 2011-07-08 21:28:54 +00:00
Krinkle
9d3237c9df Reverting r91756 per CR and bug 26470 2011-07-08 21:27:44 +00:00
Leo Koppelkamm
27ec208d55 redoing r91673 . Second step: Actually moving the files 2011-07-08 20:17:46 +00:00
Leo Koppelkamm
09164bed4a r86603 : Updatin last call to mediawiki.legacy.edit and removing the module 2011-07-08 19:01:13 +00:00
Leo Koppelkamm
455661a73c Moving skins/common/diff.css to mediawiki.action.history.diff.css and updating some old comments in the process. Also moved one vendor-prefixed attribute in fron of the standard one. Extension follow in a second 2011-07-08 17:59:42 +00:00
Leo Koppelkamm
07e8d349c0 r91734: Do the same for search.css and remove module from resources.php 2011-07-08 17:20:56 +00:00
Leo Koppelkamm
5c1da6ba27 Rewrite mwsuggest.js using j.ui.autocomplete. This gets rid of a lot of the little kinks of the previously implemenation: The suggestion list now contains regular anchors which can be openened in new indows or separate tabs. The carret doesn't jump around anymore when using the arrow keys to select an item. This should make it much easier to eventually merge Vectors simple search & mwsuggest. 2011-07-08 14:59:20 +00:00
Leo Koppelkamm
5e3294f664 Revert botched commit r91721 2011-07-08 13:27:40 +00:00
Leo Koppelkamm
346e0f1c5e Backport jQuery UI CSS fix for weird Webkit reflow bug. See a090faa833/ 2011-07-08 13:24:05 +00:00
Antoine Musso
b02f0e48e2 revert r91673 : lost of history 2011-07-08 06:52:05 +00:00
Leo Koppelkamm
3de47dc343 Moving cologneblue.css and nostalgia.css into their own folder 2011-07-07 19:59:06 +00:00
Krinkle
f5ef49a84b byteLimit/byteLength improvements:
* Split the byte length logic into a seperate method to allow it to be called directly on a string (easier to test and easier re-use)
* Added basic unit tests for it.
2011-06-30 01:06:47 +00:00
Chad Horohoe
b7c7bd3c95 (bug 29277) MediaWiki:Filepage.css not loaded on foreignwiki itself. Fixup to r68904. Yay Roan finally taught me how to use the resourceloader :D 2011-06-29 00:08:25 +00:00
Krinkle
ab52899b1d mw.special.recentchanges fixes:
- Partial self-revert of r90982 (binding and triggering must not be chained, as the calling function refers to the variable we're setting)
- The Qunit tests pass now :)



Follows up: r90943 r90960 r90968 r90980 r90982
2011-06-28 17:56:56 +00:00
Roan Kattouw
536e396a5e Fix r90943: redefined mediawiki.special module that had already been added in r83789 (!), broke loading of special page-specific CSS by addModuleStyles( 'mediawiki.special' ) . Bug originally reported by Nikerabbit as lack of CSS on Special:Search on TranslateWiki 2011-06-28 14:28:11 +00:00
Antoine Musso
d4abcb5268 Disable ns selector checkboxes when 'all' namespace is selected
* based on an idea by Aaron on r90866
* comes with QUnit test
* expect the special 'all' namespace to be the first in the list
* function build on mediawiki.special form r90941
2011-06-28 06:40:49 +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
Matěj Grabovský
6c0b32fcec (bug 29443) Special:Undelete should invert checkboxes without reloading
Committed patch with code originally by [[b:User:Darklama]]
2011-06-18 19:57:17 +00:00
Krinkle
3c4a5e21fe Implement mw.Title in core
* Based on UploadWizard/resources/mw.Title.js

* Refactored to use local scope and prototypes instead of re-declaring them per-instance in the private scope through 'this' (re-use by reference, faster instantiation and performance)

* Fix potential ReferenceError in the check for wgArticlePath (inline if statements will fail for undeclared variables, needs typeof undefined check). Using mw.config instead to avoid this problem.

* The following two methods were not ported from UploadWizard because they were or became redundant and/or merged with another method:
-- setNameText (redundant with the improved setName)
-- setPrefix (redundant wit the improved setNamespace)

* Ported all jasmine tests to QUnit. Left them exactly the same to make sure it's compatible with UploadWizard. Perhaps I'll expand or adjust the suite later to be less file-specific, but for now make letting this revision go through TestSwarm to be sure it's compatible and behaves exactly the same.

* Added getName() method instead, replacing direct access to '_name' This in order to check for wgCaseSensitiveNamespaces (bug 29441; r90234)
-- Prevents breakages on wiktionary and other wikis with case sensitivity. ie. on a Wiktionary:
new mw.Title('apple').toString()
> "Apple"
-- This fix will make it return 'apple' instead of 'Apple' (that is, if 0 is in wgCaseSensitiveNamespaces).

* There used to be a strip-bug in scenarios where a namespace-like string appears inside of a title. Imagine pagename: "Category:Wikipedia:Foo bar" (exist on several wikis; NS_CATEGORY= 14)

new mw.Title( 'Wikipedia:Foo bar', 14 ).toString()
> "Category:Foo_bar" // Stripped "Wikipedia:" !!

In order to fix this:
-- Removed assumption that every title has a namespace prefix. UploadWizard/mw.Title has one initialization RegExp (which was ported as-is to "setAll"). In addition there is now a "setNameAndExtension" method (which doesn't extract or set the namespace). Now the above case:

new mw.Title( 'Wikipedia:Foo bar', 14 ).toString()
> "Category:Wikipedia_Foo_bar" // Better, but now the colon is gone..

-- In order to fix that, "\x3a" was removed from the clean() function. Colons are valid in MediaWiki titles, no need to escape.

new mw.Title( 'Wikipedia:Foo bar', 14 ).toString()
> "Category:Wikipedia:Foo_bar" // Yay!

* Last but not least, another little bug fixed due to the previous point. It also fixed a thrown exception in case a colon is part of the title in the main namespace (not rare for movies and books):

new mw.Title( 'The Wiki: Awesomeness')
> Error: mw.Title> Unrecognized canonical namespace: the_wiki

This exception is thrown from setNamespace(). That exception would make sense if setNamespace() was called by the user direcly, but when called from setAll() it should gracefully fallback by putting the prefix in the name instead and assuming NS_MAIN (just like the server side does). To achieve this I added a try/catch around setAll() and fallback to the new setNameAndExtension().

* Passes JSHint.

* Additional feature: exists(). Return true/false if known, otherwise null. Extensions can populate this for titles they are interested in and the front-end can construct url's and UI elements with correct redlink-status. Gadgets can populate it as well but that would require an API-request to get the information. A bit of a stub for later use, although I think it works fine.

* Bugfix in jquery.qunit.completenessTest.js (first triggered by the introduction of mw.Title). Don't traverse the 'constructor' property (recursive loop, ouch!)

---

(bug 29397) Implement mw.Title module in core
2011-06-18 09:17:09 +00:00
Krinkle
1a1cfb9c65 Remove redundant mediawiki.util directory 2011-06-14 17:44:02 +00:00
Krinkle
ca2ef68538 (bug 25124) Resource loader should respect $wgStyleDirectory
* Yay, one down, one resourceloader 1.0 blocker to go
2011-06-06 22:08:52 +00:00
Roan Kattouw
274346d691 (bug 29121) jquery.suggestions uses jquery.autoEllipsis but didn't have it in its dependency list, causing JS errors in non-Vector skins 2011-06-03 09:51:48 +00:00
Krinkle
7d345f1836 Introducing mw.libs, moving JpegMeta into it.
* Reverts/re-do's r88794 and r88796.
** mediawiki.util.js no longer extends itself but is defined once.
** mediawiki.util.jpegmeta no longer extends mw.util but is installed as an object property of mw.libs
* Empty placeholder defined in mediawiki.js
* Removed the redundant 'mw' argument from the IIFE around mediawiki.libs.jpegmeta.js


* Fixed all usages in /mediawiki/trunk/*
** http://toolserver.org/~krinkle/wikimedia-svn-search/view.php?id=205&hash=ddc0908eef111558816c9fe1c775f7c1
2011-05-29 03:13:54 +00:00
Krinkle
634a758924 Adding user.tokens module and loading by default. (ResourceLoaderUserTokensModule Class) 2011-05-21 22:52:32 +00:00
Krinkle
9e3d204293 Fixing mediawiki.action.watch.ajax
* Adding error capturing in case there is an error (either in the API or with the request itself). Right now if it fails it just keeps reading "Watching..." and no error is displayed.
This lack became visible when r88522 changed ApiWatch to require a token and POST.
* Added message 'watcherrortext'.
* Moved messages-array in Resources.php form legacy.ajax to action.watch.ajax (looks like this was forgotten in r78147)
* Switched it to make a POST request in preparation of making it work with the changed API backend as of r88522.
2011-05-21 18:33:48 +00:00
Krinkle
238ed13911 * Moving jQuery extend into its own module (jquery.mwPrototypes) (bug 27149; Introduced in r) 2011-05-17 17:19:12 +00:00