Commit graph

107 commits

Author SHA1 Message Date
Roan Kattouw
573d3dafc1 (bug 24298) Make dropdown menus in Vector more accessible by expanding and collapsing them when the hidden link behind the dropdown arrow receives a click event (triggered by an enter or space bar key press in the typical use case) and changing the appearance of the arrow when the hidden link behind it is focused. Patch by Jan Paul Posma
--This line, and those behind, will be ignored--

M    phase3/skins/Vector.php
M    phase3/skins/vector/images/arrow-down-icon.png
M    phase3/skins/vector/screen.css
AM   phase3/skins/vector/vector.js
M    phase3/resources/Resources.php
2011-04-25 14:08:01 +00:00
Roan Kattouw
7611624a1a (bug 16921) Add JavaScript-based enforcing of byte limits on move and protection forms. Patch by Jan Paul Posma 2011-04-25 11:39:30 +00:00
Roan Kattouw
233a49e612 (bug 28650) Refactor dynamic byte-based maxlength of edit summary into a jQuery plugin. Patch by Jan Paul Posma 2011-04-22 10:58:58 +00:00
Trevor Parscal
774804fb64 Added jquery.json library to core. 2011-04-21 19:33:53 +00:00
Leo Koppelkamm
92d5213ece Move edit.js stuff to mediawiki.action.edit.js, and remove wikibits dependency. Wrap publicly accessible functions inside mw.toolbar & provide legacy shortcuts to those. Make the traditional toolbar use $.fn.textSelection, to reduce code duplication. This fixes Bug 27116, Bug 15705, Bug 11011 2011-04-21 08:19:24 +00:00
Leo Koppelkamm
bf99353feb Move timezone preference functions to mediawiki.special.preferences.js & remove their wikibits dependencies 2011-04-16 14:03:07 +00:00
Leo Koppelkamm
1e13a6c94f Free metadata toggle script from wikibits.js dependencies; rename to mediawiki.action.view.metadata.js 2011-04-16 11:54:43 +00:00
Chad Horohoe
a147c57165 Merge r81445 from 1.17: revert r70520 (js password complexity checker) 2011-04-15 23:38:34 +00:00
Leo Koppelkamm
7d6ddfe836 Completely rewritten table sorting script.
Fixes Bug 8028, Bug 8115, Bug 15406, Bug 17141, Bug 8732

1. Sites can specify custom collations.
The script accepts an object "tableSorterCollation" which contains a lookup
table, how specific characters should be treated.
For example, after setting "tableSorterCollation={'ä':'ae', 'ß':'ss'};" in the
site's common.js any string containing an ä or Ä will be sorted as if it were a
'ae'.

2. Table rows can be forced to use a specific data type.
By setting class="sort-{Parsername}", the row will be parsed with the specified
algorithm. class="sort-date" would force date sorting etc.
The following parsers are available: text, IPAddress, number, url, currency,
date, isoDate, usLongDate, time

3. Execution time is reduced by half or more.

Sorting a 935 row * 8 columns table:

Browser     Before      After
--------    ------      -----
Chrome 10   90ms        42ms
Safari 5    115ms       48ms
Firefox 4   412ms       87ms
IE8         720ms       115ms

4. Based on the content language and the mdy vs dmy preference, the parser can
understand dates such as "17. März '11". wgMonthNames=[] and
wgMonthNamesShort=[] 
in the content language and the mdy vs dmy preference are exported to js; A
table containing the following dates would be sorted correctly:
17. Jan. 01
23 Feb 1992
9.02.05
13 November 2001
14 Oktober '76

Was tested in ie6-8, chrome, safari 5, ff3 & ff4
2011-04-14 21:47:00 +00:00
Leo Koppelkamm
5c89f16552 Followup to r86047: Rewrite the radio-button updater & move everything to action.history. Also move to fixCompare version by Helder, since HTMLdiff is scrapped 2011-04-14 16:06:02 +00:00
Leo Koppelkamm
12ce9a40dc Followup to r86047: Declare dependency to JUI button more cleanly 2011-04-14 13:52:08 +00:00
Roan Kattouw
82bf4764ea For bug 27488: move the startup script, jquery+mediawiki and the mw.config.set() call for configuration variables back to the <head> . Let modules control whether they're loaded in the <head> ('top') or at the bottom of the <body> ('bottom') through the position parameter/property
Also rearranges the loading order a little bit such that only=messages comes before only=scripts, and config comes before everything except startup and jquery+mediawiki
2011-04-07 12:07:25 +00:00
Happy-melon
b9be69ce3d Spin out all the CSS used on special pages into their own mediawiki.special module. This comprises about a third of /skins/common/shared.css, so it's definitely worthwhile not loading it for the 99.9% of pageviews which aren't special pages. 2011-03-12 22:42:58 +00:00
Happy-melon
968340d310 Follow-up r83280; looks like I accidentally deprecated a piece of legacy JS :D 2011-03-05 17:06:42 +00:00
Happy-melon
0ebda6b3e4 Include MediaWiki:Noscript.css in <noscript></noscript> tags in the header, to allow wikis to load styles for users with JS disabled. 2011-03-05 16:01:25 +00:00
Happy-melon
1c866270b3 Follow-up r83183, r83202:
* Update SpecialCheckUser.php to new location of IP functions
* Spin out the 'hide-other-field-if-select-box-not-on-other' function as one which should apply to all such fields, especially those created via HTMLForm.  SpecialBlockip and SpecialGlobalBlock should ultimately be converted to use HTMLForm anyway.
2011-03-05 12:48:32 +00:00
Bryan Tong Minh
9fb510f31d (bug 26995) File size is now checked before uploading in HTML5 browsers
* Exposed $wgMaxUploadSize to JS
* Exposed message largefileserver to JS
2011-03-04 15:38:37 +00:00
Krinkle
730eeb8e26 Moving IP-check to mw.util & some enhancements to and applying code conventions to mw.special.block.js
* This commit addresses the @TODOs that were in mediawiki.legacy.block before it was migrated to /resources in r83183 ("@TODO: find some better JS file for [is IP functions]")
* JSHint warning fixed: Using ==== when comparing to '' (safer and faster than ==)
* Instead of checking the initial onload state by faking a onkeyup/onchange event, seperate the two functions and use those
** --> This fixes issue where it falsely triggers other bindings on-load that are globally bound to input elements via $('input').live() or $('[type="text"]').delegate() because of the .keyup()/.change() call )
* Caching selectors (var $wpBlockExpiry = $(..) etc.) instead of re-creating a dozen jQuery objects again and getting the document element by id – on *every* onkeyup/onchange
** --> Notable speed improvement in Safari 3 and IE6 with the caching, these had a little bit of a lag when typing fast, mw.legacy.block.js had the lag as well. Fixed now.
* Adding instantToggle-argument to switch between fade or hiding/showing right away. When setting the initial state they're called with instant=true so that there's no fading, the page loads and stuff hides that shouldn't be visible. Any later interaction will still have the fade.
** Calling a function like foo(true) sucks, adding a local DO_INSTANT = true.
* Making behaviour the same as the legacy.block was (if isEmpty, do bring the element back to view ( show() / fadeIn) instead of doing nothing)
2011-03-04 01:48:24 +00:00
Krinkle
4cefcab14b PHP Warning: filemtime() [function.filemtime]: stat failed for /www/w/skins/common/block.js in /w/includes/resourceloader/ResourceLoaderFileModule.php on line 365 ; FIXED (r83183) 2011-03-04 00:20:10 +00:00
Happy-melon
630cc8a1eb Convert Special:BlockIP JS to jQuery/ResourceLoader. Change the order of the checkboxes on the block form so that options which appear/disappear when the type of user is changed are grouped together. 2011-03-03 23:54:39 +00:00
Happy-melon
eb9cf4b00c Create a user.groups module in ResourceLoader, which bundles a CSS and JS page for each usergroup the user is a member of (MediaWiki:Sysop.js, MediaWiki:Autoconfirmed.css, etc). Groups '*' and 'user' are not included. 2011-02-16 19:54:02 +00:00
Happy-melon
ef6041d750 revert r82283, loads of unrelated changes 2011-02-16 19:51:25 +00:00
Happy-melon
d64cd26a7c Create a user.groups module in ResourceLoader, which bundles a CSS and JS page for each usergroup the user is a member of (MediaWiki:Sysop.js, MediaWiki:Autoconfirmed.css, etc). Groups '*' and 'user' are not included. 2011-02-16 19:49:37 +00:00
Trevor Parscal
a8b81f9a8d Grouped diff and history modules together to help reduce cache invalidation. Loaded diff styles statically. This should help with bug #27418, but I suspect there are more cases where we need to do this sort of thing before the bug is truly resolved. 2011-02-15 22:14:03 +00:00
Roan Kattouw
50def0df0c Fix double commas from r81721. This time I actually ran it through php -l before committing *shame* 2011-02-08 12:14:35 +00:00
Roan Kattouw
24714d9c76 Fix r81719: trailing commas 2011-02-08 12:13:31 +00:00
Roan Kattouw
59cd7e327b Quick fix to make debug mode work with non-standard $wgStylePath. This strips the leading skins/ from each file path and sets $wgStylePath as the remote base path. $IP/skins is needed as a local base path to make stuff work, but I guess that could be changed $wgSkinDirectory 2011-02-08 12:06:32 +00:00
Krinkle
0146f3e4f3 Renaming new jQuery.jsMessage plugin to jQuery.mesageBox(). Name was too generic and could be confusing with localization messages.
. Next commit will deal with the contents of the messageBox .js/css files
2011-02-08 00:20:41 +00:00
Krinkle
1102826153 Making a start with $.jsMessage. A more flexible way for messages. Supports grouping them and making the replacing of previous messages into option (the current jsMsg() function always replaces older messages. Time has shown that there is need for the ability to show older messages as well and grouping to avoid different scripts from erasing or clearing eachother's output (current Commons and a few other wikis have created similar functions to enable keeping previous messages)
* See also bug 26888. Not resolving the bug yet, this plugins needs a little more testing and should then be called from within mw.util.jsMessage with some wiki specific things.

Examples:

// Show a simple message in the default group
$.jsMessage( {
message: 'Hello',
target: 'mw-js-message'
} );

// Add a new message this time stating the defaults
$.jsMessage( {
message: 'World',
group: 'default',
replace: false,
target: 'mw-js-message'
} );

// Post a new message, replacing the previous ones
$.jsMessage( {
message: 'New',
group: 'default',
replace: true,
target: 'mw-js-message'
} );

// Add a messages in a new group (groups separated by a line)
$.jsMessage( {
message: 'A new group',
group: 'something',
target: 'mw-js-message'
} );

// Clear the default group
// See code comments for more info
$.jsMessage( {
message: '',
replace: true,
target: 'mw-js-message'
} );

// Clear the 'something'-group
// Since this leaves no visible groups, the main box will hide (slideUp) right after
$.jsMessage( {
message: '',
group: 'something',
replace: true,
target: 'mw-js-message'
} );

If testing goes well, mw.util.jsMsg(message, className, replace) will call
$.jsMessage( { message: message, group: className, replace: replace, target: $.jsMessage(ge' );
So it's more a backend plugin, not used directly by core modules.
But this way extensions or third party sites can easily re-use this plugin and/or create multiple message boxes
on one page, by calling $.jsMessageNew and giving an id and location for it on the page.
2011-02-04 02:17:14 +00:00
Derk-Jan Hartman
e5bb119085 Port the remaining Skin.php skins standard(classic), Cologneblue and Nostalgia
* Converted Nostalgia's use of inline table alignment to CSS
* common_rtl.css is not in use now

Refs bug 26649
2011-01-23 01:41:13 +00:00
Krinkle
91dc45329e Removing commented wgHandheldStyle in Resources.php + wrapping lines at 80 (one-line to multi-line arrays)
* wgHandheldStyle: Is now done from Monobook.php (r75548)
* Some lines were getting over 100 characters in length due to the dependancies array. Spit' a few up to a multiline array
2011-01-22 23:17:29 +00:00
Derk-Jan Hartman
3de65b1f2c Port Modern to resourceloader
Refs bug 26649
2011-01-22 22:46:33 +00:00
Bryan Tong Minh
de79cb9cde Follow-up r79867: Read out EXIF orientation in JavaScript and rotate accordingly. Added JsJpegMeta library by Ben Leslie under the MIT license.
* Added JS variabele wgFileCanRotate. If anybody knows a way to make certain variables only available to certain modules, please tell me, could not find it.
* Added JsJpegMeta as mediawiki.util.jpegmeta
* Made BitmapHandler::getScaler and BitmapHandker::canRotate static
* Bumped style version
2011-01-22 22:34:36 +00:00
Derk-Jan Hartman
fee2a5a3ea Port Chick to Resourceloader. Bug 26649 2011-01-22 21:29:39 +00:00
Derk-Jan Hartman
27680a2d84 Finish porting the Simple skin to resourceloader.
* quickbar CSS removed, since simple doesn't even have #quickbar.
* default of line-trough removed, since this is already present in the skin CSS.
Fixes part of bug 26649
2011-01-22 21:16:34 +00:00
Brian Wolff
0c0dad3cd3 (follow-up r66913) Per CR, make the editsummary length checker use jQuery/RL fanciness.
The js was tested in firefox 3.0.6, IE6, some oldish version of Opera, Konqourer, and Chrome.
(Of course in IE6, the rest of mediawiki fell on its face, but the js added here worked).
2011-01-19 03:59:11 +00:00
Andrew Garrett
6dfa145c88 Add jquery.form.js, from http://jquery.malsup.com/form/#download 2011-01-18 18:25:42 +00:00
Krinkle
0d23acbadc Adding comma's at end of arrays where this hasn't been done already for consistency 2011-01-10 05:02:05 +00:00
Krinkle
bc229aa653 * Consistent single quotes
* The problem with onKeyUp was that is shows errors even when initially typing a (possibly valid) address. onBlur has the downside of not giving feedback while correcting the mistake + since e-mail is the last input element at the moment, it doesn't blur on submit and required a seperate event handler.
** Solution: Bind onBlur once, and then listen for onKeyUp.
* Adding missing semicolon(s)
* Compare with strict (===) to empty string / null
* Moved non-global wfFunction to mw.util
** The "FIXME:" note was kept
* Comment "apostrophe" fixed to "at". Comments don't run :)
* Caching selector in wfUpdateMailValidityLabel
* Renaming "wfUpdateMailValidityLabel" to "updateMailValidityLabel"
( Ping r79910, r75670, r75627  )
2011-01-10 04:40:57 +00:00
Antoine Musso
f44391e2af js email validation fixed + i18n support
The Javascript email validation in User:Preference got broken by an id change,
this patch fix the issue.

A long standing issue was a lack of proper i18n support, message helper
was hard coded in the js file.  It now use the resourceloader to get the
i18nized message.

Follow up r75670
2011-01-09 17:09:16 +00:00
Krinkle
83a7822df7 Wrote jquery.colorUtil plugin.
* Introduces rgbToHsl and hslToRgb functions
* Introdoces a simple way to get a brigher or darker color
* Moved getRGB() function and colors-array from jquery.color to it so they are publically available.
* Applied fixed from JSLint to all of this
* Made jquery.color use these instead to avoid duplication and added dependency for it
2011-01-05 23:24:07 +00:00
Aryeh Gregor
26d8fd0e8b Update dependencies for r79363 per Roan's advice 2010-12-31 19:53:54 +00:00
Happy-melon
ca15303c81 Refactoring in RecentChanges/Watchlist:
* Use new jQuery/RL collapsible implementation, remove legacy JS.
* Refactor ChangesList::flag() and ChangesList::recentChangesFlags(), the latter to now take an array rather than a growing list of out-of-order parameters.
* Resolve the FIXME requested in r44421 (just passed its second birthday :D) by replacing extract() calls with direct references.
2010-12-27 19:07:28 +00:00
Brion Vibber
a039f291ac Thumbnail previews for PNG, JPEG, GIF, and SVG files on Special:Upload in browsers supporting HTML 5 FileAPI
Known good:
* Firefox 3.6+
* Chrome 7.something+
2010-12-26 22:01:26 +00:00
Krinkle
c2da6eade9 adding hoverIntent plugin 2010-12-26 20:41:08 +00:00
Krinkle
a987ea008e Reverting r78889 and r78865. Breaks changeslist on translatewiki (unpatrolled-flag exclamation mark popping up on page histories and and diff-views where they shouldn't instead of an 'm' for minor)
-  = ChangesList::flag( 'minor' );
- The jquery effects plugin and collapsible implementation, also in those commits, are redundant now.
- If/when skins.commons is needed again, we can simply add that part back in.
- (r78891 is not reverted because the file it altered was deleted while r78865 was -merged)
2010-12-25 00:29:41 +00:00
Krinkle
532c5c33b4 Porting tocToggle to ResourceLoader
* Path is now set to sitewide rather than current path so that it doesn't apply to just the current article but to the entire domain (fixes bug 26324)
* To avoid cookievalue being overriden by an older cookie from the legacy code (which had a more specific path and thus overrides it), using a different cookiename now ("mw_hidetoc" instead of "hidetoc")
2010-12-24 00:55:20 +00:00
Krinkle
1a827a0984 Improving jquery.makeCollapsible:
* Setting toggle function in a variable to easier reuse it through the plugin
* Replace "-hide" and "-show" classes with "expanded" and "collapsed" respectively
* For more flexibility, if there's a toggle-element already, bind the function to it and use it instead. Otherwise, just create one as usual. See [[betawiki:User:Krinkle/CollapsingTestpageKr#footer|CollapsingTestpageKr#Combination example]]
** It's more likely that the source has a custom position of the togglelink waiting for it to be bound, then it to be already bound.
* Some comments improved
* Message key "hide" to "collapsible-collapse" (Follow-up r78915 CR)
* Message key "show" to "collapsible-expand"
* Changed toggle-link content filling from html() to text() (message errors like <keyname> caused an HTML-element to be created)
2010-12-23 23:34:32 +00:00
Krinkle
eb18151c7a adding jQuery.makeCollapsible plugin 2010-12-23 19:25:16 +00:00
Roan Kattouw
018485f4ce Fix r78897: remove dependency on makeCollapsible as well 2010-12-23 18:38:24 +00:00