https://www.mediawiki.org/wiki/Special:Code/MediaWiki/111989
Revision: 111989
Author: tstarling
Date: 2012-02-21 04:03:00 +0000 (Tue, 21 Feb 2012)
Log Message:
-----------
* (bug 34538) Fixed compatibility with
$wgResourceLoaderExperimentalAsyncLoading in some extensions.
* Tested AbuseFilter.
* Did not test ArticleCreationWorkflow, Configure, ContributionTracking,
FlaggedRevs, FundraiserPortal, InlineCategorizer, MarkAsHelpful, Math/Mathjax.
* Fixed a typo in a comment in LiveTranslate.
* Did not review extensions alphabetically after MoodBar.
Modified Paths:
--------------
trunk/extensions/AbuseFilter/modules/ext.abuseFilter.edit.js
trunk/extensions/AbuseFilter/modules/ext.abuseFilter.examine.js
trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.init/ext.articleCreation.init.js
trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.searchResult/ext.articleCreation.searchResult.js
trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.user/ext.articleCreation.user.js
trunk/extensions/Configure/Configure.js
trunk/extensions/ContributionTracking/modules/jquery.contributionTracking.js
trunk/extensions/FlaggedRevs/frontend/modules/ext.flaggedRevs.advanced.js
trunk/extensions/FlaggedRevs/frontend/modules/ext.flaggedRevs.review.js
trunk/extensions/FundraiserPortal/Templates/donateScripts.js
trunk/extensions/InlineCategorizer/modules/ext.inlineCategorizer.core.js
trunk/extensions/InlineCategorizer/modules/ext.inlineCategorizer.init.js
trunk/extensions/LiveTranslate/includes/ext.livetranslate.js
trunk/extensions/MarkAsHelpful/modules/ext.markAsHelpful/ext.markAsHelpful.js
trunk/extensions/Math/modules/ext.math.mathjax.enabler.js
Modified: trunk/extensions/AbuseFilter/modules/ext.abuseFilter.edit.js
===================================================================
--- trunk/extensions/AbuseFilter/modules/ext.abuseFilter.edit.js
2012-02-21 02:48:03 UTC (rev 111988)
+++ trunk/extensions/AbuseFilter/modules/ext.abuseFilter.edit.js
2012-02-21 04:03:00 UTC (rev 111989)
@@ -7,7 +7,7 @@
*
* @var {jQuery}
*/
- var $filterBox = $( '#' + mw.config.get( 'abuseFilterBoxName' ) );
+ var $filterBox = [];
/**
* Reference to this
@@ -178,6 +178,7 @@
* On ready initialization
*/
$( function( $ ) {
+ $filterBox = $( '#' + mw.config.get( 'abuseFilterBoxName' ) );
// Hide the syntax ok message when the text changes
$filterBox.keyup( function() {
var $el = $( '#mw-abusefilter-syntaxresult' );
Modified: trunk/extensions/AbuseFilter/modules/ext.abuseFilter.examine.js
===================================================================
--- trunk/extensions/AbuseFilter/modules/ext.abuseFilter.examine.js
2012-02-21 02:48:03 UTC (rev 111988)
+++ trunk/extensions/AbuseFilter/modules/ext.abuseFilter.examine.js
2012-02-21 04:03:00 UTC (rev 111989)
@@ -12,7 +12,7 @@
*
* @type {jQuery}
*/
- var $syntaxResult = $( '#mw-abusefilter-syntaxresult' );
+ var $syntaxResult = [];
/**
* Tests the filter against an rc event or abuse log entry
@@ -84,6 +84,7 @@
};
$( function( $ ) {
+ $syntaxResult = $( '#mw-abusefilter-syntaxresult' );
$( '#mw-abusefilter-examine-test' ).click(
that.examinerTestFilter );
} );
-} )( jQuery, mediaWiki );
\ No newline at end of file
+} )( jQuery, mediaWiki );
Modified:
trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.init/ext.articleCreation.init.js
===================================================================
---
trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.init/ext.articleCreation.init.js
2012-02-21 02:48:03 UTC (rev 111988)
+++
trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.init/ext.articleCreation.init.js
2012-02-21 04:03:00 UTC (rev 111989)
@@ -1,9 +1,9 @@
-(function($,mw) {
+jQuery( document ).ready( function() {
var newTitle = 'Special:ArticleCreationLanding' + '/' +
encodeURIComponent(wgPageName);
var landingURL = mw.config.get('wgArticlePath').replace( '$1', newTitle
);
// change the link to point to the new special page
- $("div.noarticletext")
+ jQuery("div.noarticletext")
.find('a[href*="action=edit"]')
.attr( 'href', landingURL );
-})( jQuery, window.mediaWiki );
+} );
Modified:
trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.searchResult/ext.articleCreation.searchResult.js
===================================================================
---
trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.searchResult/ext.articleCreation.searchResult.js
2012-02-21 02:48:03 UTC (rev 111988)
+++
trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.searchResult/ext.articleCreation.searchResult.js
2012-02-21 04:03:00 UTC (rev 111989)
@@ -1,9 +1,9 @@
-(function($,mw) {
+jQuery( document ).ready( function() {
var newTitle = 'Special:ArticleCreationLanding' + '/' +
encodeURIComponent(mw.config.get('acSearch'));
var landingURL = mw.config.get('wgArticlePath').replace( '$1', newTitle
);
// change the link to point to the new special page
- $("div.searchresults")
+ jQuery("div.searchresults")
.find('a[href*="action=edit"]')
.attr( 'href', landingURL );
-})( jQuery, window.mediaWiki );
+} );
Modified:
trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.user/ext.articleCreation.user.js
===================================================================
---
trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.user/ext.articleCreation.user.js
2012-02-21 02:48:03 UTC (rev 111988)
+++
trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.user/ext.articleCreation.user.js
2012-02-21 04:03:00 UTC (rev 111989)
@@ -251,6 +251,8 @@
});
- ac.init();
+ $(document).ready( function() {
+ ac.init();
+ } );
})( jQuery, window.mw );
Modified: trunk/extensions/Configure/Configure.js
===================================================================
--- trunk/extensions/Configure/Configure.js 2012-02-21 02:48:03 UTC (rev
111988)
+++ trunk/extensions/Configure/Configure.js 2012-02-21 04:03:00 UTC (rev
111989)
@@ -3,547 +3,548 @@
* create JavaScript buttons to allow to modify the form to have more
* flexibility
*/
+jQuery( document ).ready( function ( $ ) {
+ // Tabs and TOC
+ // ------------
-// Tabs and TOC
-// ------------
+ $( '#configure' )
+ .addClass( 'jsprefs' )
+ .wrap( '<table><tbody><tr><td
class="config-col-form"></td></tr></tbody></table>' )
+ .parent()
+ .before( '<td class="config-col-toc"><ul class="configtoc"
id="configtoc"></ul></td>' );
-$( '#configure' )
- .addClass( 'jsprefs' )
- .wrap( '<table><tbody><tr><td
class="config-col-form"></td></tr></tbody></table>' )
- .parent()
- .before( '<td class="config-col-toc"><ul class="configtoc"
id="configtoc"></ul></td>' );
+ $( '#configure' )
+ .children( 'fieldset' )
+ .addClass( 'configsection' )
+ .hide()
+ .children( 'legend' )
+ .each( function( i ) {
+ $( this ).parent().attr( 'id', 'config-section-' + i );
+ if ( i === 0 ) {
+ $( this ).parent().show();
+ }
-$( '#configure' )
- .children( 'fieldset' )
- .addClass( 'configsection' )
- .hide()
- .children( 'legend' )
- .each( function( i ) {
- $( this ).parent().attr( 'id', 'config-section-' + i );
- if ( i === 0 ) {
- $( this ).parent().show();
- }
+ var item = $( '<li></li>' )
+ .addClass( i === 0 ? 'selected' : null )
+ .append(
+ $( '<a></a>' )
+ .text( $( this ).text() )
+ .attr( 'href',
'#config-section-' + i )
+ .mousedown( function( e ) {
+ $( this
).parent().parent().find( 'li' ).removeClass( 'selected' );
+ $( this
).parent().addClass( 'selected' );
+ e.preventDefault();
+ return false;
+ } )
+ .click( function( e ) {
+ $( '#configure >
fieldset' ).hide();
+ $( '#config-section-' +
i ).show();
+ $( '#config-section-' +
i + ' h2' ).show();
+ $( '#config-section-' +
i + ' .configure-table' ).show();
+ e.preventDefault();
+ return false;
+ } )
+ );
- var item = $( '<li></li>' )
- .addClass( i === 0 ? 'selected' : null )
- .append(
- $( '<a></a>' )
- .text( $( this ).text() )
- .attr( 'href', '#config-section-' + i )
+ $( this ).parent().find( 'table.configure-table'
).each( function( j ) {
+ $( this ).attr( 'id', 'config-table-' + i + '-'
+ j );
+ } );
+
+ var heads = $( this ).parent().find( 'h2' )
+ if ( heads.length > 1 ) {
+ var sub = $( '<ul></ul>' ).hide();
+
+ heads.each( function( j ) {
+ $( this ).attr( 'id', 'config-head-' +
i + '-' + j );
+ sub.append(
+ $( '<li></li>' )
+ .addClass( i === 0 ?
'selected' : null )
+ .append(
+ $( '<a></a>' )
+ .text(
$( this ).text() )
+ .attr(
'href', '#config-table-' + i + '-' + j )
+
.mousedown( function( e ) {
+
$( this ).parent().parent().find( 'li' ).removeClass( 'selected' );
+
$( this ).parent().addClass( 'selected' );
+
$( this ).parent().parent().parent().parent().find( 'li' ).removeClass(
'selected' );
+
$( this ).parent().parent().parent().addClass( 'selected' );
+
e.preventDefault();
+
return false;
+ } )
+ .click(
function( e ) {
+
$( '#configure > fieldset' ).hide();
+
$( '#config-section-' + i ).show();
+
$( '#config-section-' + i + ' h2' ).hide();
+
$( '#config-section-' + i + ' .configure-table' ).hide();
+
$( '#config-head-' + i + '-' + j ).show();
+
$( '#config-table-' + i + '-' + j ).show();
+
e.preventDefault();
+
return false;
+ } )
+ ) );
+ } );
+
+ item.append( sub );
+ item.prepend( $( '<a></a>' )
+ .text( '[+]' )
+ .attr( 'href', 'javascript:' )
.mousedown( function( e ) {
- $( this
).parent().parent().find( 'li' ).removeClass( 'selected' );
- $( this ).parent().addClass(
'selected' );
e.preventDefault();
return false;
} )
.click( function( e ) {
- $( '#configure > fieldset'
).hide();
- $( '#config-section-' + i
).show();
- $( '#config-section-' + i + '
h2' ).show();
- $( '#config-section-' + i + '
.configure-table' ).show();
- e.preventDefault();
- return false;
- } )
- );
+ if ( sub.css( 'display' ) ==
'none' ) {
+ sub.show();
+ $(this).text( '[-]' );
+ } else {
+ sub.hide();
+ $(this).text( '[+]' );
+ }
+ } ) );
+ }
- $( this ).parent().find( 'table.configure-table' ).each(
function( j ) {
- $( this ).attr( 'id', 'config-table-' + i + '-' + j );
+ $( '#configtoc' ).append( item );
} );
- var heads = $( this ).parent().find( 'h2' )
- if ( heads.length > 1 ) {
- var sub = $( '<ul></ul>' ).hide();
+ $( '.config-col-toc' ).append(
+ $( '<a></a>' )
+ .css( 'align', 'right' )
+ .attr( 'href', 'javascript:;' )
+ .append( $( '<img />' )
+ .attr( 'src', stylepath +
'/common/images/Arr_l.png' )
+ )
+ .mousedown( function( e ) {
+ e.preventDefault();
+ return false;
+ } )
+ .click( function( e ) {
+ if ( $( '#configtoc' ).css( 'display' ) ==
'none' ) {
+ $( '#configtoc' ).show();
+ $( this ).children( 'img' ).remove();
+ $( this ).append( $( '<img />' )
+ .attr( 'src', stylepath +
'/common/images/Arr_l.png' )
+ );
+ } else {
+ $( '#configtoc' ).hide();
+ $( this ).children( 'img' ).remove();
+ $( this ).append( $( '<img />' )
+ .attr( 'src', stylepath +
'/common/images/Arr_r.png' )
+ );
+ }
+ e.preventDefault();
+ return false;
+ }
+ )
+ );
- heads.each( function( j ) {
- $( this ).attr( 'id', 'config-head-' + i + '-'
+ j );
- sub.append(
- $( '<li></li>' )
- .addClass( i === 0 ? 'selected'
: null )
- .append(
- $( '<a></a>' )
- .text( $( this
).text() )
- .attr( 'href',
'#config-table-' + i + '-' + j )
- .mousedown(
function( e ) {
- $( this
).parent().parent().find( 'li' ).removeClass( 'selected' );
- $( this
).parent().addClass( 'selected' );
- $( this
).parent().parent().parent().parent().find( 'li' ).removeClass( 'selected' );
- $( this
).parent().parent().parent().addClass( 'selected' );
-
e.preventDefault();
- return
false;
- } )
- .click(
function( e ) {
- $(
'#configure > fieldset' ).hide();
- $(
'#config-section-' + i ).show();
- $(
'#config-section-' + i + ' h2' ).hide();
- $(
'#config-section-' + i + ' .configure-table' ).hide();
- $(
'#config-head-' + i + '-' + j ).show();
- $(
'#config-table-' + i + '-' + j ).show();
-
e.preventDefault();
- return
false;
- } )
- ) );
- } );
+ // Associative tables
+ // ------------------
- item.append( sub );
- item.prepend( $( '<a></a>' )
- .text( '[+]' )
- .attr( 'href', 'javascript:' )
- .mousedown( function( e ) {
- e.preventDefault();
- return false;
- } )
- .click( function( e ) {
- if ( sub.css( 'display' ) == 'none' ) {
- sub.show();
- $(this).text( '[-]' );
- } else {
- sub.hide();
- $(this).text( '[+]' );
- }
- } ) );
- }
-
- $( '#configtoc' ).append( item );
- } );
-
-$( '.config-col-toc' ).append(
- $( '<a></a>' )
- .css( 'align', 'right' )
- .attr( 'href', 'javascript:;' )
- .append( $( '<img />' )
- .attr( 'src', stylepath + '/common/images/Arr_l.png' )
- )
- .mousedown( function( e ) {
- e.preventDefault();
- return false;
- } )
- .click( function( e ) {
- if ( $( '#configtoc' ).css( 'display' ) == 'none' ) {
- $( '#configtoc' ).show();
- $( this ).children( 'img' ).remove();
- $( this ).append( $( '<img />' )
- .attr( 'src', stylepath +
'/common/images/Arr_l.png' )
- );
- } else {
- $( '#configtoc' ).hide();
- $( this ).children( 'img' ).remove();
- $( this ).append( $( '<img />' )
- .attr( 'src', stylepath +
'/common/images/Arr_r.png' )
- );
+ /**
+ * Fix an associative table
+ */
+ window.fixAssocTable = function( table ){
+ var startName = 'wp' + table.attr( 'id' );
+ table.chidren( 'tr' ).each( function( i ) {
+ if ( i == 0 ) {
+ return;
}
- e.preventDefault();
- return false;
- }
- )
-);
+ var inputs = $( this ).chidren( 'input' );
+ inputs[0].attr( 'name', startName + '-key-' + (i - 1) );
+ inputs[1].attr( 'name', startName + '-val-' + (i - 1) );
+ } );
+ }
-// Associative tables
-// ------------------
+ $( '#configure table.assoc' ).each( function() {
+ var table = $( this );
-/**
- * Fix an associative table
- */
-window.fixAssocTable = function( table ){
- var startName = 'wp' + table.attr( 'id' );
- table.chidren( 'tr' ).each( function( i ) {
- if ( i == 0 ) {
+ if ( table.hasClass( 'disabled' ) ) {
return;
}
- var inputs = $( this ).chidren( 'input' );
- inputs[0].attr( 'name', startName + '-key-' + (i - 1) );
- inputs[1].attr( 'name', startName + '-val-' + (i - 1) );
- } );
-}
-
-$( '#configure table.assoc' ).each( function() {
- var table = $( this );
-
- if ( table.hasClass( 'disabled' ) ) {
- return;
- }
- table.children( 'tr' ).each( function( i ) {
- if ( i == 0 ) {
- $( this ).append( $( '<th></th>' ).text( mediaWiki.msg(
'configure-js-remove-row' ) ) );
- } else {
- $( this ).append(
- $( '<td></td>' )
- .addClass( 'button' )
- .append(
- $( '<input></input>' )
- .attr( 'type', 'button'
)
- .attr( 'value',
mediaWiki.msg( 'configure-js-remove-row' ) )
- .click( function() {
- $( this
).parent().parent().remove();
- fixAssocTable(
table );
- } )
- )
- );
- }
- } );
- table.parent().append(
- $( '<input></input>' )
- .attr( 'type', 'button' )
- .attr( 'value', mediaWiki.msg( 'configure-js-add' ) )
- .addClass( 'button' )
- .click( function() {
- table.append(
- $( '<tr></tr>' )
+ table.children( 'tr' ).each( function( i ) {
+ if ( i == 0 ) {
+ $( this ).append( $( '<th></th>' ).text(
mediaWiki.msg( 'configure-js-remove-row' ) ) );
+ } else {
+ $( this ).append(
+ $( '<td></td>' )
+ .addClass( 'button' )
.append(
- $( '<td></td>' )
- .append(
- $(
'<input></input>' )
-
.attr( 'type', 'text' )
- )
+ $( '<input></input>' )
+ .attr( 'type',
'button' )
+ .attr( 'value',
mediaWiki.msg( 'configure-js-remove-row' ) )
+ .click(
function() {
+ $( this
).parent().parent().remove();
+
fixAssocTable( table );
+ } )
)
- .append(
- $( '<td></td>' )
- .append(
- $(
'<input></input>' )
-
.attr( 'type', 'text' )
- )
- )
- .append(
- $( '<td></td>' )
- .append(
- $(
'<input></input>' )
-
.attr( 'type', 'button' )
-
.attr( 'value', mediaWiki.msg( 'configure-js-remove-row' ) )
-
.click( function() {
-
$( this ).parent().parent().remove();
-
fixAssocTable( table );
-
} )
- )
- )
);
- fixAssocTable( table );
- } )
- );
-} );
+ }
+ } );
+ table.parent().append(
+ $( '<input></input>' )
+ .attr( 'type', 'button' )
+ .attr( 'value', mediaWiki.msg(
'configure-js-add' ) )
+ .addClass( 'button' )
+ .click( function() {
+ table.append(
+ $( '<tr></tr>' )
+ .append(
+ $( '<td></td>' )
+ .append(
+
$( '<input></input>' )
+
.attr( 'type', 'text' )
+ )
+ )
+ .append(
+ $( '<td></td>' )
+ .append(
+
$( '<input></input>' )
+
.attr( 'type', 'text' )
+ )
+ )
+ .append(
+ $( '<td></td>' )
+ .append(
+
$( '<input></input>' )
+
.attr( 'type', 'button' )
+
.attr( 'value', mediaWiki.msg( 'configure-js-remove-row' ) )
+
.click( function() {
+
$( this ).parent().parent().remove();
+
fixAssocTable( table );
+
} )
+ )
+ )
+ );
+ fixAssocTable( table );
+ } )
+ );
+ } );
-// Images
-// ------
+ // Images
+ // ------
-$( '.image-selector' ).blur( function() {
- var data = {
- 'action': 'query',
- 'titles': $( this ).attr( 'value' ),
- 'prop': 'imageinfo',
- 'iiprop': 'url',
- 'format': 'json'
- };
- var input = $( this );
- $.getJSON(
- mw.config.get( 'wgScriptPath' ) + '/api' + mw.config.get(
'wgScriptExtension' ),
- data,
- function( obj ) {
- var found = false;
- for ( var i in obj.query.pages ) {
- if( obj.query.pages[i].imageinfo &&
obj.query.pages[i].imageinfo[0].url ) {
- $( '#image-url-preview-' + input.attr(
'id' ).substr( 18 ) ).attr( 'src', obj.query.pages[i].imageinfo[0].url );
- found = true;
+ $( '.image-selector' ).blur( function() {
+ var data = {
+ 'action': 'query',
+ 'titles': $( this ).attr( 'value' ),
+ 'prop': 'imageinfo',
+ 'iiprop': 'url',
+ 'format': 'json'
+ };
+ var input = $( this );
+ $.getJSON(
+ mw.config.get( 'wgScriptPath' ) + '/api' +
mw.config.get( 'wgScriptExtension' ),
+ data,
+ function( obj ) {
+ var found = false;
+ for ( var i in obj.query.pages ) {
+ if( obj.query.pages[i].imageinfo &&
obj.query.pages[i].imageinfo[0].url ) {
+ $( '#image-url-preview-' +
input.attr( 'id' ).substr( 18 ) ).attr( 'src',
obj.query.pages[i].imageinfo[0].url );
+ found = true;
+ }
}
+ if ( !found ) {
+ $( '#image-url-preview-' + input.attr(
'id' ).substr( 18 ) ).attr( 'src', input.attr( 'value' ) );
+ }
}
- if ( !found ) {
- $( '#image-url-preview-' + input.attr( 'id'
).substr( 18 ) ).attr( 'src', input.attr( 'value' ) );
- }
- }
- );
-} );
-
-// $wgGroupPermissions and $wgAutopromote stuff, only if ajax is enabled
-// ---------------------------------------------------------------------
-
-$( '.ajax-group' ).each( function() {
- var table = $( this );
- // Button "remove this row"
- table.children( 'tr' ).each( function( i ) {
- if ( i == 0 ) {
- $( this ).append( $( '<th></th>' ).text( mediaWiki.msg(
'configure-js-remove' ) ) );
- } else {
- $( this ).append(
- $( '<td></td>' )
- .addClass( 'button' )
- .append(
- $( '<input></input>' )
- .attr( 'type', 'button'
)
- .attr( 'value',
mediaWiki.msg( 'configure-js-remove-row' ) )
- .click( function() {
- $( this
).parent().parent().remove();
- } )
- )
- );
- }
+ );
} );
- // Button "add a new row"
- table.parent().append(
- $( '<input></input>' )
- .addClass( 'button-add' )
- .attr( 'type', 'button' )
- .attr( 'value', mediaWiki.msg( 'configure-js-add' ) )
- .click( function() {
- var groupname = prompt( mediaWiki.msg(
'configure-js-prompt-group' ) );
- if( groupname == null )
- return;
- var data = {
- 'action': 'configure',
- 'prop': 'ajax',
- 'format': 'json',
- 'ajaxgroup': groupname,
- 'ajaxsetting': table.attr( 'id' )
- };
+ // $wgGroupPermissions and $wgAutopromote stuff, only if ajax is enabled
+ // ---------------------------------------------------------------------
- $.getJSON(
- mw.config.get( 'wgScriptPath' ) +
'/api' + mw.config.get( 'wgScriptExtension' ),
- data,
- function( obj ) {
- if ( obj.configure.ajax ) {
- var resp =
obj.configure.ajax;
- error = false;
- table.append(
- $( '<tr></tr>' )
-
.addClass( 'configure-maintable-row' )
- .attr(
'id', 'wp' + table.attr( 'id' ) + groupname )
-
.append( $( '<td></td>' ).text( groupname ) )
-
.append( $( '<td></td>' ).html( resp ) )
- .append(
-
$( '<td></td>' )
-
.append(
-
$( '<input></input>' )
-
.attr( 'type', 'button' )
-
.attr( 'value', mediaWiki.msg(
'configure-js-remove-row' ) )
-
.click( function() {
-
$( this ).parent().parent().remove();
-
} )
-
)
- )
- );
- } else {
- alert( mediaWiki.msg(
'configure-js-group-exists' ) );
- }
- }
- );
- } )
- );
-} );
-
-$( '#configure-form' ).submit( function(){
$( '.ajax-group' ).each( function() {
var table = $( this );
- var cont = '';
- table.children( 'tr.configure-maintable-row' ).each( function()
{
- if( cont != '' ) cont += "\n";
- cont += $( this ).attr( 'id' );
+ // Button "remove this row"
+ table.children( 'tr' ).each( function( i ) {
+ if ( i == 0 ) {
+ $( this ).append( $( '<th></th>' ).text(
mediaWiki.msg( 'configure-js-remove' ) ) );
+ } else {
+ $( this ).append(
+ $( '<td></td>' )
+ .addClass( 'button' )
+ .append(
+ $( '<input></input>' )
+ .attr( 'type',
'button' )
+ .attr( 'value',
mediaWiki.msg( 'configure-js-remove-row' ) )
+ .click(
function() {
+ $( this
).parent().parent().remove();
+ } )
+ )
+ );
+ }
} );
+ // Button "add a new row"
table.parent().append(
$( '<input></input>' )
- .attr( 'type', 'hidden' )
- .attr( 'name', 'wp' + table.attr( 'id' ) +
'-vals' )
- .attr( 'value', cont )
+ .addClass( 'button-add' )
+ .attr( 'type', 'button' )
+ .attr( 'value', mediaWiki.msg(
'configure-js-add' ) )
+ .click( function() {
+ var groupname = prompt( mediaWiki.msg(
'configure-js-prompt-group' ) );
+ if( groupname == null )
+ return;
+
+ var data = {
+ 'action': 'configure',
+ 'prop': 'ajax',
+ 'format': 'json',
+ 'ajaxgroup': groupname,
+ 'ajaxsetting': table.attr( 'id'
)
+ };
+
+ $.getJSON(
+ mw.config.get( 'wgScriptPath' )
+ '/api' + mw.config.get( 'wgScriptExtension' ),
+ data,
+ function( obj ) {
+ if ( obj.configure.ajax
) {
+ var resp =
obj.configure.ajax;
+ error = false;
+ table.append(
+ $(
'<tr></tr>' )
+
.addClass( 'configure-maintable-row' )
+
.attr( 'id', 'wp' + table.attr( 'id' ) + groupname )
+
.append( $( '<td></td>' ).text( groupname ) )
+
.append( $( '<td></td>' ).html( resp ) )
+
.append(
+
$( '<td></td>' )
+
.append(
+
$( '<input></input>' )
+
.attr( 'type', 'button' )
+
.attr( 'value', mediaWiki.msg(
'configure-js-remove-row' ) )
+
.click( function() {
+
$( this ).parent().parent().remove();
+
} )
+
)
+
)
+ );
+ } else {
+ alert(
mediaWiki.msg( 'configure-js-group-exists' ) );
+ }
+ }
+ );
+ } )
);
} );
-} );
-// Big lists
-// ---------
-
-// Summarise the setting contained in 'div' to the summary field 'summary'.
-window.summariseSetting = function( div ) {
-
- if ( div.hasClass( 'assoc' ) ) {
- // If it's too big to display as an associative array, it's too
big to display as a summary.
- return '';
- } else if ( div.hasClass( 'ns-bool' ) || div.hasClass( 'ns-simple' ) ||
div.hasClass( 'group-bool-element' ) || div.hasClass( 'group-array-element' ) )
{
- var matches = [];
- div.find( 'label' ).each( function() {
- if ( $( '#' + $( this ).attr( 'for' ) ).attr( 'checked'
) ) {
- matches.push( $( this ).text() );
- }
+ $( '#configure-form' ).submit( function(){
+ $( '.ajax-group' ).each( function() {
+ var table = $( this );
+ var cont = '';
+ table.children( 'tr.configure-maintable-row' ).each(
function() {
+ if( cont != '' ) cont += "\n";
+ cont += $( this ).attr( 'id' );
+ } );
+ table.parent().append(
+ $( '<input></input>' )
+ .attr( 'type', 'hidden' )
+ .attr( 'name', 'wp' + table.attr( 'id'
) + '-vals' )
+ .attr( 'value', cont )
+ );
} );
- return matches.join( ', ' );
- } else if ( div.hasClass( 'ns-array' ) || div.hasClass( 'ns-text' ) ||
div.hasClass( 'configure-rate-limits-action' ) ) {
- // Basic strategy: find all labels, and list the values of
their corresponding inputs, if those inputs have a value
+ } );
- var body = $( '<tbody></tbody>' )
- .append( $( '<tr></tr>' )
- .append( $( '<th></th>' ).text( div.find(
'th:first' ).text() ) )
- .append( $( '<th></th>' ).text( div.find(
'th:last' ).text() ) )
- );
+ // Big lists
+ // ---------
- var rows = false;
+ // Summarise the setting contained in 'div' to the summary field
'summary'.
+ window.summariseSetting = function( div ) {
- if ( div.hasClass( 'configure-rate-limits-action' ) ) {
- div.find( 'tr' ).each( function( i ) {
- if ( i == 0 ) {
- return;
+ if ( div.hasClass( 'assoc' ) ) {
+ // If it's too big to display as an associative array,
it's too big to display as a summary.
+ return '';
+ } else if ( div.hasClass( 'ns-bool' ) || div.hasClass(
'ns-simple' ) || div.hasClass( 'group-bool-element' ) || div.hasClass(
'group-array-element' ) ) {
+ var matches = [];
+ div.find( 'label' ).each( function() {
+ if ( $( '#' + $( this ).attr( 'for' ) ).attr(
'checked' ) ) {
+ matches.push( $( this ).text() );
}
- var typeDesc = $( this ).find( 'td:first'
).text();
- var periodField = $( '#' + $( this ).attr( 'id'
) + '-period' );
- var countField = $( '#' + $( this ).attr( 'id'
) + '-count' );
+ } );
+ return matches.join( ', ' );
+ } else if ( div.hasClass( 'ns-array' ) || div.hasClass(
'ns-text' ) || div.hasClass( 'configure-rate-limits-action' ) ) {
+ // Basic strategy: find all labels, and list the values
of their corresponding inputs, if those inputs have a value
- if ( periodField.attr( 'value' ) > 0 ) {
- rows = true;
+ var body = $( '<tbody></tbody>' )
+ .append( $( '<tr></tr>' )
+ .append( $( '<th></th>' ).text(
div.find( 'th:first' ).text() ) )
+ .append( $( '<th></th>' ).text(
div.find( 'th:last' ).text() ) )
+ );
- body.append( $( '<tr></tr>' )
- .append( $( '<td></td>' ).text(
typeDesc ) )
- .append( $( '<td></td>' ).text(
mediaWiki.msg(
-
'configure-throttle-summary', countField.attr( 'value' ), periodField.attr(
'value' ) ) ) )
- );
- }
- } );
- } else {
- div.find( 'label' ).each( function( i ) {
- if ( i == 0 ) {
- return;
- }
- var arrayfield = $( '#' + $( this ).attr( 'for'
) );
- if ( arrayfield.attr( 'value' ) > 0 ) {
- rows = true;
+ var rows = false;
- body.append( $( '<tr></tr>' )
- .append( $( '<td></td>' ).text(
$( this ).text() ) )
- .append( $( '<td></td>' ).text(
arrayfield.attr( 'value' ) ) )
- );
- }
- } );
- }
+ if ( div.hasClass( 'configure-rate-limits-action' ) ) {
+ div.find( 'tr' ).each( function( i ) {
+ if ( i == 0 ) {
+ return;
+ }
+ var typeDesc = $( this ).find(
'td:first' ).text();
+ var periodField = $( '#' + $( this
).attr( 'id' ) + '-period' );
+ var countField = $( '#' + $( this
).attr( 'id' ) + '-count' );
- if ( !rows ) {
- body.append( $( '<tr></tr>' )
- .append( $( '<th></th>' )
- .attr( 'colspan', 2 )
- .text( mediaWiki.msg(
'configure-js-summary-none' ) )
- )
- );
- }
+ if ( periodField.attr( 'value' ) > 0 ) {
+ rows = true;
- return $( '<table></table>' ).addClass( 'assoc' ).append( body
).html();
- } else if ( div.hasClass( 'promotion-conds-element' ) || div.hasClass(
'configure-rate-limits-action' ) ) {
- return '';
- } else {
- return 'Useless type';
- }
-}
+ body.append( $( '<tr></tr>' )
+ .append( $( '<td></td>'
).text( typeDesc ) )
+ .append( $( '<td></td>'
).text( mediaWiki.msg(
+
'configure-throttle-summary', countField.attr( 'value' ), periodField.attr(
'value' ) ) ) )
+ );
+ }
+ } );
+ } else {
+ div.find( 'label' ).each( function( i ) {
+ if ( i == 0 ) {
+ return;
+ }
+ var arrayfield = $( '#' + $( this
).attr( 'for' ) );
+ if ( arrayfield.attr( 'value' ) > 0 ) {
+ rows = true;
-$( '.configure-biglist' ).each( function( l ) {
- var list = $( this );
- var summary = $( '<div></div>' )
- .addClass( 'configure-biglist-summary' )
- .html( summariseSetting( list ) );
- var header = $( '<span></span>' ).text( mediaWiki.msg(
'configure-js-biglist-hidden' ) );
- var toogle = $( '<a></a>' )
- .addClass( 'configure-biglist-toggle-link' )
- .attr( 'href', 'javascript:' )
- .text( mediaWiki.msg( 'configure-js-biglist-show' ) )
- .click( function() {
- if ( list.css( 'display' ) == 'none' ) {
- toogle.text( mediaWiki.msg(
'configure-js-biglist-hide' ) );
- header.text( mediaWiki.msg(
'configure-js-biglist-shown' ) );
- list.show();
- summary.hide();
- } else {
- toogle.text( mediaWiki.msg(
'configure-js-biglist-show' ) );
- header.text( mediaWiki.msg(
'configure-js-biglist-hidden' ) );
- list.hide();
- summary.html( summariseSetting( list ) ).show();
+ body.append( $( '<tr></tr>' )
+ .append( $( '<td></td>'
).text( $( this ).text() ) )
+ .append( $( '<td></td>'
).text( arrayfield.attr( 'value' ) ) )
+ );
+ }
+ } );
}
- } );
- list.hide();
- list.before(
- $( '<div></div>' )
- .addClass( 'configure-biglist-placeholder' )
- .append( toogle )
- .append( header )
- );
- list.before(
- summary
- );
-} );
+ if ( !rows ) {
+ body.append( $( '<tr></tr>' )
+ .append( $( '<th></th>' )
+ .attr( 'colspan', 2 )
+ .text( mediaWiki.msg(
'configure-js-summary-none' ) )
+ )
+ );
+ }
-// Search
-// ------
+ return $( '<table></table>' ).addClass( 'assoc'
).append( body ).html();
+ } else if ( div.hasClass( 'promotion-conds-element' ) ||
div.hasClass( 'configure-rate-limits-action' ) ) {
+ return '';
+ } else {
+ return 'Useless type';
+ }
+ }
-window.allSettings = undefined;
+ $( '.configure-biglist' ).each( function( l ) {
+ var list = $( this );
+ var summary = $( '<div></div>' )
+ .addClass( 'configure-biglist-summary' )
+ .html( summariseSetting( list ) );
+ var header = $( '<span></span>' ).text( mediaWiki.msg(
'configure-js-biglist-hidden' ) );
+ var toogle = $( '<a></a>' )
+ .addClass( 'configure-biglist-toggle-link' )
+ .attr( 'href', 'javascript:' )
+ .text( mediaWiki.msg( 'configure-js-biglist-show' ) )
+ .click( function() {
+ if ( list.css( 'display' ) == 'none' ) {
+ toogle.text( mediaWiki.msg(
'configure-js-biglist-hide' ) );
+ header.text( mediaWiki.msg(
'configure-js-biglist-shown' ) );
+ list.show();
+ summary.hide();
+ } else {
+ toogle.text( mediaWiki.msg(
'configure-js-biglist-show' ) );
+ header.text( mediaWiki.msg(
'configure-js-biglist-hidden' ) );
+ list.hide();
+ summary.html( summariseSetting( list )
).show();
+ }
+ } );
-( function() {
- allSettings = [];
+ list.hide();
+ list.before(
+ $( '<div></div>' )
+ .addClass( 'configure-biglist-placeholder' )
+ .append( toogle )
+ .append( header )
+ );
+ list.before(
+ summary
+ );
+ } );
- // For each section...
- var rootElement = document.getElementById( 'configure' );
- var fieldsets = rootElement.getElementsByTagName( 'fieldset' );
- for( var fid=0; fid<fieldsets.length; ++fid ) {
- // For each subsection...
- var fieldset = fieldsets[fid];
- var fieldset_title = window.getInnerText(
fieldset.getElementsByTagName( 'legend' )[0] );
- var subsections = getElementsByClassName( fieldset, 'table',
'configure-table' );
- for( var sid=0; sid<subsections.length; ++sid ) {
- var subsection;
- if (subsections[sid].getElementsByTagName( 'tbody'
).length > 0) {
- subsection =
subsections[sid].getElementsByTagName( 'tbody' )[0];
- } else {
- subsection = subsections[sid];
- }
- var heading = document.getElementById(
subsection.parentNode.id.replace( 'config-table', 'config-head' ) );
+ // Search
+ // ------
- // For each setting...
- for( var i=0; i<subsection.childNodes.length;++i ) {
- var row = subsection.childNodes[i];
- if( typeof row.ELEMENT_NODE == "undefined" ){
- var wantedType = 1; // ELEMENT_NODE
+ window.allSettings = undefined;
+
+ ( function() {
+ allSettings = [];
+
+ // For each section...
+ var rootElement = document.getElementById( 'configure' );
+ var fieldsets = rootElement.getElementsByTagName( 'fieldset' );
+ for( var fid=0; fid<fieldsets.length; ++fid ) {
+ // For each subsection...
+ var fieldset = fieldsets[fid];
+ var fieldset_title = window.getInnerText(
fieldset.getElementsByTagName( 'legend' )[0] );
+ var subsections = getElementsByClassName( fieldset,
'table', 'configure-table' );
+ for( var sid=0; sid<subsections.length; ++sid ) {
+ var subsection;
+ if (subsections[sid].getElementsByTagName(
'tbody' ).length > 0) {
+ subsection =
subsections[sid].getElementsByTagName( 'tbody' )[0];
} else {
- var wantedType = row.ELEMENT_NODE;
+ subsection = subsections[sid];
}
- if ( row.nodeType != wantedType || (
row.tagName != 'tr' && row.tagName != 'TR' ) ) {
- continue;
- }
+ var heading = document.getElementById(
subsection.parentNode.id.replace( 'config-table', 'config-head' ) );
- var desc_cell = getElementsByClassName( row,
'td', 'configure-left-column' )[0];
- if( typeof desc_cell == "undefined" ){
- continue;
- }
+ // For each setting...
+ for( var i=0;
i<subsection.childNodes.length;++i ) {
+ var row = subsection.childNodes[i];
+ if( typeof row.ELEMENT_NODE ==
"undefined" ){
+ var wantedType = 1; //
ELEMENT_NODE
+ } else {
+ var wantedType =
row.ELEMENT_NODE;
+ }
+ if ( row.nodeType != wantedType || (
row.tagName != 'tr' && row.tagName != 'TR' ) ) {
+ continue;
+ }
- var description;
+ var desc_cell = getElementsByClassName(
row, 'td', 'configure-left-column' )[0];
+ if( typeof desc_cell == "undefined" ){
+ continue;
+ }
- if ( desc_cell.getElementsByTagName( 'p'
).length ) { // Ward off comments like "This setting has been customised"
- description = window.getInnerText(
desc_cell.getElementsByTagName( 'p' )[0] );
- } else {
- description = window.getInnerText(
desc_cell );
+ var description;
+
+ if ( desc_cell.getElementsByTagName(
'p' ).length ) { // Ward off comments like "This setting has been customised"
+ description =
window.getInnerText( desc_cell.getElementsByTagName( 'p' )[0] );
+ } else {
+ description =
window.getInnerText( desc_cell );
+ }
+
+ allSettings.push( { 'description':
description.toLowerCase(), 'fid':fid+1, 'sid':sid, 'displayDescription':
description } );
}
-
- allSettings.push( { 'description':
description.toLowerCase(), 'fid':fid+1, 'sid':sid, 'displayDescription':
description } );
}
}
- }
-} )();
+ } )();
-$( '#configure-search-form' ).show();
-$( '#configure-search-input' ).keyup( function() {
- var query = $( '#configure-search-input' ).attr( 'value'
).toLowerCase();
+ $( '#configure-search-form' ).show();
+ $( '#configure-search-input' ).keyup( function() {
+ var query = $( '#configure-search-input' ).attr( 'value'
).toLowerCase();
- $( '#configure-search-results' ).children( 'li' ).remove();
+ $( '#configure-search-results' ).children( 'li' ).remove();
- if ( query == '' ) {
- return;
- }
+ if ( query == '' ) {
+ return;
+ }
- var isMatch = function( element ) { return element.description.indexOf(
query ) !== -1; }
- for( var i=0; i<allSettings.length; ++i ) {
- var data = allSettings[i];
- if ( isMatch( data ) ) {
- $( '#configure-search-results' ).append(
- $( '<li></li>' ).append(
- $( '<a></a>' )
- .attr( 'href',
'#config-head-'+data.fid+'-'+data.sid )
- .text( data.displayDescription )
- .click( function() {
- $( '#configure >
fieldset' ).hide();
- $( '#config-section-' +
data.fid ).show();
- $( '#config-section-' +
data.fid + ' h2' ).show();
- $( '#config-section-' +
data.fid + ' .configure-table' ).show();
- } )
- )
- );
+ var isMatch = function( element ) { return
element.description.indexOf( query ) !== -1; }
+ for( var i=0; i<allSettings.length; ++i ) {
+ var data = allSettings[i];
+ if ( isMatch( data ) ) {
+ $( '#configure-search-results' ).append(
+ $( '<li></li>' ).append(
+ $( '<a></a>' )
+ .attr( 'href',
'#config-head-'+data.fid+'-'+data.sid )
+ .text(
data.displayDescription )
+ .click( function() {
+ $( '#configure
> fieldset' ).hide();
+ $(
'#config-section-' + data.fid ).show();
+ $(
'#config-section-' + data.fid + ' h2' ).show();
+ $(
'#config-section-' + data.fid + ' .configure-table' ).show();
+ } )
+ )
+ );
+ }
}
- }
+ } );
} );
Modified:
trunk/extensions/ContributionTracking/modules/jquery.contributionTracking.js
===================================================================
---
trunk/extensions/ContributionTracking/modules/jquery.contributionTracking.js
2012-02-21 02:48:03 UTC (rev 111988)
+++
trunk/extensions/ContributionTracking/modules/jquery.contributionTracking.js
2012-02-21 04:03:00 UTC (rev 111989)
@@ -112,4 +112,6 @@
} )( jQuery );
-$.bindAjaxControls();
\ No newline at end of file
+jQuery(document).ready( function() {
+ $.bindAjaxControls();
+} );
Modified:
trunk/extensions/FlaggedRevs/frontend/modules/ext.flaggedRevs.advanced.js
===================================================================
--- trunk/extensions/FlaggedRevs/frontend/modules/ext.flaggedRevs.advanced.js
2012-02-21 02:48:03 UTC (rev 111988)
+++ trunk/extensions/FlaggedRevs/frontend/modules/ext.flaggedRevs.advanced.js
2012-02-21 04:03:00 UTC (rev 111989)
@@ -203,7 +203,9 @@
}
};
-// Perform some onload (which is when this script is included) events:
-fr.init();
+// Perform some onload events:
+$(document).ready( function() {
+ fr.init();
+} );
})( jQuery );
Modified:
trunk/extensions/FlaggedRevs/frontend/modules/ext.flaggedRevs.review.js
===================================================================
--- trunk/extensions/FlaggedRevs/frontend/modules/ext.flaggedRevs.review.js
2012-02-21 02:48:03 UTC (rev 111988)
+++ trunk/extensions/FlaggedRevs/frontend/modules/ext.flaggedRevs.review.js
2012-02-21 04:03:00 UTC (rev 111989)
@@ -412,7 +412,9 @@
}
};
-// Perform some onload (which is when this script is included) events:
-fr.init();
+// Perform some onload events:
+$(document).ready( function() {
+ fr.init();
+} );
})( jQuery );
Modified: trunk/extensions/FundraiserPortal/Templates/donateScripts.js
===================================================================
--- trunk/extensions/FundraiserPortal/Templates/donateScripts.js
2012-02-21 02:48:03 UTC (rev 111988)
+++ trunk/extensions/FundraiserPortal/Templates/donateScripts.js
2012-02-21 04:03:00 UTC (rev 111989)
@@ -38,9 +38,11 @@
}
}
-var wgDonateButton = getDonateButton();
+jQuery( document ).ready( function() {
+ var wgDonateButton = getDonateButton();
-if ( ! wgDonateButton ) {
- var wgDonateButton = pickDonateButton();
- setDonateButton( wgDonateButton );
-}
+ if ( ! wgDonateButton ) {
+ var wgDonateButton = pickDonateButton();
+ setDonateButton( wgDonateButton );
+ }
+} );
Modified:
trunk/extensions/InlineCategorizer/modules/ext.inlineCategorizer.core.js
===================================================================
--- trunk/extensions/InlineCategorizer/modules/ext.inlineCategorizer.core.js
2012-02-21 02:48:03 UTC (rev 111988)
+++ trunk/extensions/InlineCategorizer/modules/ext.inlineCategorizer.core.js
2012-02-21 04:03:00 UTC (rev 111989)
@@ -8,20 +8,23 @@
* Relies on: mw.config (wgFormattedNamespaces, wgNamespaceIds,
* wgCaseSensitiveNamespaces, wgUserGroups), mw.util.wikiGetlink
*/
-( function( $ ) {
+( function ($) {
/* Local scope */
var catNsId = mw.config.get( 'wgNamespaceIds' ).category,
- defaultOptions = {
+ isCatNsSensitive = $.inArray( 14, mw.config.get(
'wgCaseSensitiveNamespaces' ) ) !== -1;
+
+ function getDefaultOptions() {
+ return {
catLinkWrapper: '<li>',
$container: $( '.catlinks' ),
$containerNormal: $( '#mw-normal-catlinks' ),
categoryLinkSelector: 'li a:not(.icon)',
multiEdit: $.inArray( 'user', mw.config.get(
'wgUserGroups' ) ) !== -1,
resolveRedirects: true
- },
- isCatNsSensitive = $.inArray( 14, mw.config.get(
'wgCaseSensitiveNamespaces' ) ) !== -1;
+ };
+ }
/**
* @return {String}
@@ -195,7 +198,7 @@
*/
mw.InlineCategorizer = function( options ) {
- this.options = options = $.extend( defaultOptions, options );
+ this.options = options = $.extend( getDefaultOptions(), options );
// Save scope in shortcut
var ajaxcat = this;
@@ -1149,4 +1152,4 @@
}
};
-} )( jQuery );
+})(jQuery);
Modified:
trunk/extensions/InlineCategorizer/modules/ext.inlineCategorizer.init.js
===================================================================
--- trunk/extensions/InlineCategorizer/modules/ext.inlineCategorizer.init.js
2012-02-21 02:48:03 UTC (rev 111988)
+++ trunk/extensions/InlineCategorizer/modules/ext.inlineCategorizer.init.js
2012-02-21 04:03:00 UTC (rev 111989)
@@ -1,8 +1,8 @@
-/**
- * Initialize an instance of InlineCategorizer into mw.page
- */
-mw.page.inlineCategorizer = new mw.InlineCategorizer();
jQuery( document ).ready( function(){
+ /**
+ * Initialize an instance of InlineCategorizer into mw.page
+ */
+ mw.page.inlineCategorizer = new mw.InlineCategorizer();
// Separate function for call to prevent jQuery
// from executing it in the document context.
mw.page.inlineCategorizer.setup();
Modified: trunk/extensions/LiveTranslate/includes/ext.livetranslate.js
===================================================================
--- trunk/extensions/LiveTranslate/includes/ext.livetranslate.js
2012-02-21 02:48:03 UTC (rev 111988)
+++ trunk/extensions/LiveTranslate/includes/ext.livetranslate.js
2012-02-21 04:03:00 UTC (rev 111989)
@@ -1,5 +1,5 @@
/**
- * JavasSript for the Live Translate extension.
+ * JavaScript for the Live Translate extension.
* @see https://www.mediawiki.org/wiki/Extension:Live_Translate
*
* @licence GNU GPL v3 or later
@@ -40,4 +40,4 @@
window.liveTranslate = lt;
-}() );
\ No newline at end of file
+}() );
Modified:
trunk/extensions/MarkAsHelpful/modules/ext.markAsHelpful/ext.markAsHelpful.js
===================================================================
---
trunk/extensions/MarkAsHelpful/modules/ext.markAsHelpful/ext.markAsHelpful.js
2012-02-21 02:48:03 UTC (rev 111988)
+++
trunk/extensions/MarkAsHelpful/modules/ext.markAsHelpful/ext.markAsHelpful.js
2012-02-21 04:03:00 UTC (rev 111989)
@@ -105,20 +105,22 @@
// Some live events for the different modes
- /*
- * Click Event for marking an item as helpful.
- */
- $( '.markashelpful-mark' ).live( 'click', function() {
- mah.markItem( $(this), 'mark' );
- } );
+ $(document).ready( function() {
+ /*
+ * Click Event for marking an item as helpful.
+ */
+ $( '.markashelpful-mark' ).live( 'click', function() {
+ mah.markItem( $(this), 'mark' );
+ } );
- /*
- * Click Event for removing helpful status from an item.
- */
- $( '.markashelpful-undo' ).live( 'click', function() {
- mah.markItem( $(this), 'unmark' );
+ /*
+ * Click Event for removing helpful status from an item.
+ */
+ $( '.markashelpful-undo' ).live( 'click', function() {
+ mah.markItem( $(this), 'unmark' );
+ } );
+
+ // Initialize MarkAsHelpful
+ mah.init();
} );
-
- // Initialize MarkAsHelpful
- $( mah.init );
-} ) ( jQuery );
\ No newline at end of file
+} ) ( jQuery );
Modified: trunk/extensions/Math/modules/ext.math.mathjax.enabler.js
===================================================================
--- trunk/extensions/Math/modules/ext.math.mathjax.enabler.js 2012-02-21
02:48:03 UTC (rev 111988)
+++ trunk/extensions/Math/modules/ext.math.mathjax.enabler.js 2012-02-21
04:03:00 UTC (rev 111989)
@@ -83,4 +83,6 @@
}
}
-mathJax.Init();
+jQuery( document ).ready( function() {
+ mathJax.Init();
+} );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs