r81264 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81263‎ | r81264 | r81265 >
Date:19:33, 31 January 2011
Author:krinkle
Status:resolved (Comments)
Tags:
Comment:
Wrapping core modules (FIXME from r79929)
(Touch: r74088, r73046)
Modified paths:
  • /trunk/phase3/resources/jquery/jquery.autoEllipsis.js (modified) (history)
  • /trunk/phase3/resources/jquery/jquery.checkboxShiftClick.js (modified) (history)
  • /trunk/phase3/resources/jquery/jquery.client.js (modified) (history)
  • /trunk/phase3/resources/jquery/jquery.color.js (modified) (history)
  • /trunk/phase3/resources/jquery/jquery.colorUtil.js (modified) (history)
  • /trunk/phase3/resources/jquery/jquery.delayedBind.js (modified) (history)
  • /trunk/phase3/resources/jquery/jquery.form.js (modified) (history)
  • /trunk/phase3/resources/jquery/jquery.localize.js (modified) (history)
  • /trunk/phase3/resources/jquery/jquery.makeCollapsible.js (modified) (history)
  • /trunk/phase3/resources/jquery/jquery.placeholder.js (modified) (history)
  • /trunk/phase3/resources/jquery/jquery.suggestions.js (modified) (history)
  • /trunk/phase3/resources/jquery/jquery.tabIndex.js (modified) (history)
  • /trunk/phase3/resources/jquery/jquery.textSelection.js (modified) (history)
  • /trunk/phase3/resources/mediawiki.language/mediawiki.language.js (modified) (history)
  • /trunk/phase3/resources/mediawiki.special/mediawiki.special.preferences.js (modified) (history)
  • /trunk/phase3/resources/mediawiki.special/mediawiki.special.search.js (modified) (history)
  • /trunk/phase3/resources/mediawiki.util/mediawiki.util.jpegmeta.js (modified) (history)
  • /trunk/phase3/resources/mediawiki.util/mediawiki.util.js (modified) (history)
  • /trunk/phase3/resources/mediawiki.util/mediawiki.util.test.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/jquery/jquery.makeCollapsible.js
@@ -14,6 +14,7 @@
1515 * @license CC-BY 3.0 <http://creativecommons.org/licenses/by/3.0>
1616 * @license GPL2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
1717 */
 18+( function( $, mw ) {
1819
1920 $.fn.makeCollapsible = function() {
2021
@@ -293,4 +294,5 @@
294295 $toggleLink.click();
295296 }
296297 } );
297 -};
\ No newline at end of file
 298+};
 299+} )( jQuery, mediaWiki );
\ No newline at end of file
Index: trunk/phase3/resources/jquery/jquery.textSelection.js
@@ -1,6 +1,7 @@
22 /**
33 * These plugins provide extra functionality for interaction with textareas.
44 */
 5+( function( $ ) {
56 $.fn.textSelection = function( command, options ) {
67 var fn = {
78 /**
@@ -399,3 +400,4 @@
400401 }
401402 return retval;
402403 };
 404+} )( jQuery );
\ No newline at end of file
Index: trunk/phase3/resources/jquery/jquery.checkboxShiftClick.js
@@ -6,7 +6,7 @@
77 * @author Krinkle <krinklemail@gmail.com>
88 * @license GPL v2
99 */
10 -
 10+( function( $ ) {
1111 $.fn.checkboxShiftClick = function( text ) {
1212 var prevCheckbox = null;
1313 var $box = this;
@@ -24,4 +24,5 @@
2525 prevCheckbox = e.target;
2626 } );
2727 return $box;
28 -};
\ No newline at end of file
 28+};
 29+} )( jQuery );
\ No newline at end of file
Index: trunk/phase3/resources/jquery/jquery.tabIndex.js
@@ -1,4 +1,8 @@
22 /**
 3+ * jQuery tabIndex
 4+ */
 5+( function( $ ) {
 6+/**
37 * Finds the lowerst tabindex in use within a selection
48 *
59 * @return number Lowest tabindex on the page
@@ -28,4 +32,5 @@
2933 }
3034 } );
3135 return maxTabIndex;
32 -};
\ No newline at end of file
 36+};
 37+} )( jQuery );
\ No newline at end of file
Index: trunk/phase3/resources/jquery/jquery.localize.js
@@ -21,6 +21,7 @@
2222 * <img src="something.jpg" title="My Title Message" alt="My Alt Message" />
2323 * </p>
2424 */
 25+( function( $ ) {
2526 /**
2627 * Localizes a DOM selection by replacing <msg /> elements with localized text and adding
2728 * localized title and alt attributes to elements with title-msg and alt-msg attributes
@@ -58,3 +59,4 @@
5960
6061 // Let IE know about the msg tag before it's used...
6162 document.createElement( 'msg' );
 63+} )( jQuery );
Index: trunk/phase3/resources/jquery/jquery.form.js
@@ -8,7 +8,7 @@
99 * http://www.opensource.org/licenses/mit-license.php
1010 * http://www.gnu.org/licenses/gpl.html
1111 */
12 -;(function($) {
 12+(function($) {
1313
1414 /*
1515 Usage Note:
Index: trunk/phase3/resources/jquery/jquery.delayedBind.js
@@ -65,4 +65,4 @@
6666 } );
6767 }
6868 } );
69 -} )( jQuery );
 69+} )( jQuery );
\ No newline at end of file
Index: trunk/phase3/resources/jquery/jquery.suggestions.js
@@ -41,6 +41,7 @@
4242 * highlightInput: Whether to hightlight matched portions of the input or not
4343 * Type: Boolean, Default: false
4444 */
 45+( function( $ ) {
4546
4647 $.suggestions = {
4748 /**
@@ -515,4 +516,5 @@
516517 $(this).data( 'suggestions-context', context );
517518 } );
518519 return returnValue !== null ? returnValue : $(this);
519 -};
\ No newline at end of file
 520+};
 521+} )( jQuery );
\ No newline at end of file
Index: trunk/phase3/resources/jquery/jquery.colorUtil.js
@@ -5,6 +5,7 @@
66 * Mostly based on other plugins and functions (taken through JSLint and optimized a little).
77 * Sources cited locally.
88 */
 9+( function( $ ) {
910 $.colorUtil = {
1011
1112 // Color Conversion function from highlightFade
@@ -45,7 +46,7 @@
4647 }
4748
4849 // Otherwise, we're most likely dealing with a named color
49 - return $.colorUtil.colors[jQuery.trim(color).toLowerCase()];
 50+ return $.colorUtil.colors[$.trim(color).toLowerCase()];
5051 },
5152
5253 // Some named colors to work with
@@ -188,4 +189,5 @@
189190 ')';
190191 }
191192
192 -};
\ No newline at end of file
 193+};
 194+} )( jQuery );
\ No newline at end of file
Index: trunk/phase3/resources/jquery/jquery.autoEllipsis.js
@@ -128,4 +128,4 @@
129129 } );
130130 };
131131
132 -} )( jQuery );
 132+} )( jQuery );
\ No newline at end of file
Index: trunk/phase3/resources/jquery/jquery.color.js
@@ -3,7 +3,7 @@
44 * Copyright 2007 John Resig
55 * Released under the MIT and GPL licenses.
66 *
7 - * - 2011-01-05: Modified by Krinkle to use the jQuery.colorUtil plugin (has to be loaded first)
 7+ * - 2011-01-05: Modified by Krinkle to use the jQuery.colorUtil plugin (which has to be loaded first!)
88 */
99 (function( $ ) {
1010
Index: trunk/phase3/resources/jquery/jquery.client.js
@@ -1,6 +1,8 @@
22 /**
33 * User-agent detection
44 */
 5+ */
 6+( function( $ ) {
57 $.client = new ( function() {
68
79 /* Private Members */
@@ -201,3 +203,5 @@
202204 .addClass( 'client-' + profile.layout )
203205 .addClass( 'client-' + profile.platform );
204206 } );
 207+
 208+} )( jQuery );
\ No newline at end of file
Index: trunk/phase3/resources/jquery/jquery.placeholder.js
@@ -8,6 +8,7 @@
99 * @version 0.2.0
1010 * @license GPL v2
1111 */
 12+( function( $ ) {
1213
1314 $.fn.placeholder = function() {
1415
@@ -59,3 +60,4 @@
6061
6162 });
6263 };
 64+} )( jQuery );
\ No newline at end of file
Index: trunk/phase3/resources/mediawiki.util/mediawiki.util.jpegmeta.js
@@ -735,4 +735,4 @@
736736 return new JpegMeta.JpegFile( fileReaderResult, fileName );
737737 };
738738
739 -} )( jQuery, mediaWiki );
 739+} )( jQuery, mediaWiki );
\ No newline at end of file
Index: trunk/phase3/resources/mediawiki.util/mediawiki.util.test.js
@@ -8,7 +8,7 @@
99
1010 ( function( $, mw ) {
1111
12 - mediaWiki.test = {
 12+ mw.test = {
1313
1414 /* Variables */
1515 '$table' : null,
@@ -403,6 +403,6 @@
404404 }
405405 };
406406
407 - mediaWiki.test.init();
 407+ mw.test.init();
408408
409 -} )(jQuery, mediaWiki);
 409+} )(jQuery, mediaWiki);
\ No newline at end of file
Index: trunk/phase3/resources/mediawiki.util/mediawiki.util.js
@@ -1,9 +1,8 @@
22 /**
33 * Utilities
44 */
 5+( function( $, mw ) {
56
6 -(function($, mw) {
7 -
87 mw.util = {
98
109 /* Initialisation */
@@ -13,7 +12,7 @@
1413 this.initialised = true;
1514
1615 // Any initialisation after the DOM is ready
17 - $(function() {
 16+ $( function() {
1817
1918 // Shortcut to client profile return
2019 var profile = $.client.profile();
@@ -516,4 +515,4 @@
517516
518517 mw.util.init();
519518
520 -})(jQuery, mediaWiki);
 519+} )( jQuery, mediaWiki );
\ No newline at end of file
Index: trunk/phase3/resources/mediawiki.special/mediawiki.special.search.js
@@ -1,8 +1,11 @@
22 /*
33 * JavaScript for Specical:Search
44 */
 5+( function( $, mw ) {
56
67 // Emulate HTML5 autofocus behavior in non HTML5 compliant browsers
78 if ( !( 'autofocus' in document.createElement( 'input' ) ) ) {
8 - $( 'input[autofocus]' ).focus();
 9+ $( 'input[autofocus]:first' ).focus();
910 }
 11+
 12+} )( jQuery, mediaWiki );
\ No newline at end of file
Index: trunk/phase3/resources/mediawiki.special/mediawiki.special.preferences.js
@@ -1,6 +1,7 @@
22 /*
33 * JavaScript for Special:Preferences
44 */
 5+( function( $, mw ) {
56
67 $( '#prefsubmit' ).attr( 'id', 'prefcontrol' );
78 $( '#preferences' )
@@ -73,3 +74,4 @@
7475 updateMailValidityLabel( $(this).val() );
7576 } );
7677 } );
 78+} )( jQuery, mediaWiki );
\ No newline at end of file
Index: trunk/phase3/resources/mediawiki.language/mediawiki.language.js
@@ -5,8 +5,9 @@
66 * Language.php in MediaWiki. This object contains methods for loading and
77 * transforming message text.
88 */
 9+( function( $, mw ) {
910
10 -mediaWiki.language = {
 11+mw.language = {
1112 /**
1213 * Process the PLURAL template substitution
1314 *
@@ -19,15 +20,15 @@
2021 * @example {{Template:title|params}}
2122 */
2223 'procPLURAL': function( template ) {
23 - if ( template.title && template.parameters && mediaWiki.language.convertPlural ) {
 24+ if ( template.title && template.parameters && mw.language.convertPlural ) {
2425 // Check if we have forms to replace
2526 if ( template.parameters.length == 0 ) {
2627 return '';
2728 }
2829 // Restore the count into a Number ( if it got converted earlier )
29 - var count = mediaWiki.language.convertNumber( template.title, true );
 30+ var count = mw.language.convertNumber( template.title, true );
3031 // Do convertPlural call
31 - return mediaWiki.language.convertPlural( parseInt( count ), template.parameters );
 32+ return mw.language.convertPlural( parseInt( count ), template.parameters );
3233 }
3334 // Could not process plural return first form or nothing
3435 if ( template.parameters[0] ) {
@@ -68,11 +69,11 @@
6970 * @param {boolean} integer Convert the return value to an integer
7071 */
7172 'convertNumber': function( number, integer ) {
72 - if ( !mediaWiki.language.digitTransformTable ) {
 73+ if ( !mw.language.digitTransformTable ) {
7374 return number;
7475 }
7576 // Set the target Transform table:
76 - var transformTable = mediaWiki.language.digitTransformTable;
 77+ var transformTable = mw.language.digitTransformTable;
7778 // Check if the "restore" to Latin number flag is set:
7879 if ( integer ) {
7980 if ( parseInt( number ) == number ) {
@@ -98,3 +99,4 @@
99100 // Digit Transform Table, populated by language classes where applicable
100101 'digitTransformTable': null
101102 };
 103+} )( jQuery, mediaWiki );
\ No newline at end of file

Follow-up revisions

RevisionCommit summaryAuthorDate
r814111.17: MFT r81186, r81187, r81197, r81209, r81210, r81211, r81215, r81238, r81...catrope20:23, 2 February 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r73046Added collapsible tabs plugin, reworked tabIndex functions, and fixed some sy...tparscal02:03, 15 September 2010
r74088Improved on r73046 by removing asumption of $ === jQuery.tparscal19:22, 1 October 2010
r79929Removing unneeded wraps and using $ and mw instead of jQuery or mediaWiki sin...krinkle05:33, 10 January 2011

Comments

#Comment by Catrope (talk | contribs)   14:34, 2 February 2011
 /**
  * User-agent detection
  */
+ */

Introduces syntax error. Fixed in r81276.

Status & tagging log