From d417de70fcf39e0a7a15ba780b597914d16ca0f7 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 12 Mar 2014 18:12:23 +0100 Subject: Update to MediaWiki 1.22.4 --- .../modules/jquery.wikiEditor.dialogs.js | 34 ++++++++++------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js') diff --git a/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js b/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js index 6d92966f..f6d86d78 100644 --- a/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js +++ b/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js @@ -42,8 +42,8 @@ $.wikiEditor.modules.dialogs = { }, openDialog: function ( context, module ) { if ( module in $.wikiEditor.modules.dialogs.modules ) { - var mod = $.wikiEditor.modules.dialogs.modules[module], - $dialog = $( '#' + mod.id ); + var mod = $.wikiEditor.modules.dialogs.modules[module]; + var $dialog = $( '#' + mod.id ); if ( $dialog.length === 0 ) { $.wikiEditor.modules.dialogs.fn.reallyCreate( context, mod, module ); $dialog = $( '#' + mod.id ); @@ -82,7 +82,7 @@ $.wikiEditor.modules.dialogs = { module = config[mod]; // Only create the dialog if it's supported, isn't filtered and doesn't exist yet filtered = false; - if ( typeof module.filters !== 'undefined' ) { + if ( typeof module.filters != 'undefined' ) { for ( i = 0; i < module.filters.length; i++ ) { if ( $( module.filters[i] ).length === 0 ) { filtered = true; @@ -92,7 +92,7 @@ $.wikiEditor.modules.dialogs = { } // If the dialog already exists, but for another textarea, simply remove it $existingDialog = $( '#' + module.id ); - if ( $existingDialog.length > 0 && $existingDialog.data( 'context' ).$textarea !== context.$textarea ) { + if ( $existingDialog.length > 0 && $existingDialog.data( 'context' ).$textarea != context.$textarea ) { $existingDialog.remove(); } // Re-select from the DOM, we might have removed the dialog just now @@ -119,13 +119,13 @@ $.wikiEditor.modules.dialogs = { * @param {String} name Dialog name (key in $.wikiEditor.modules.dialogs.modules) */ reallyCreate: function ( context, module, name ) { - var msg, dialogDiv, + var msg, configuration = module.dialog; // Add some stuff to configuration configuration.bgiframe = true; configuration.autoOpen = false; // By default our dialogs are modal, unless explicitely defined in their specific configuration. - if( typeof configuration.modal === 'undefined' ) { + if( typeof configuration.modal == "undefined" ) { configuration.modal = true; } configuration.title = $.wikiEditor.autoMsg( module, 'title' ); @@ -138,7 +138,7 @@ $.wikiEditor.modules.dialogs = { } configuration.buttons = configuration.newButtons; // Create the dialog
- dialogDiv = $( '
' ) + var dialogDiv = $( '
' ) .attr( 'id', module.id ) .html( module.html ) .data( 'context', context ) @@ -171,28 +171,26 @@ $.wikiEditor.modules.dialogs = { * NOTE: This function assumes $.ui.dialog has already been loaded */ resize: function () { - var oldWS, thisWidth, wrapperWidth, - wrapper = $(this).closest( '.ui-dialog' ), - oldWidth = wrapper.width(), - // Make sure elements don't wrapped so we get an accurate idea of whether they really fit. Also temporarily show - // hidden elements. Work around jQuery bug where
inside a dialog is both - // :visible and :hidden - oldHidden = $(this).find( '*' ).not( ':visible' ); - + var wrapper = $(this).closest( '.ui-dialog' ); + var oldWidth = wrapper.width(); + // Make sure elements don't wrapped so we get an accurate idea of whether they really fit. Also temporarily show + // hidden elements. Work around jQuery bug where
inside a dialog is both + // :visible and :hidden + var oldHidden = $(this).find( '*' ).not( ':visible' ); // Save the style attributes of the hidden elements to restore them later. Calling hide() after show() messes up // for elements hidden with a class oldHidden.each( function () { $(this).data( 'oldstyle', $(this).attr( 'style' ) ); }); oldHidden.show(); - oldWS = $(this).css( 'white-space' ); + var oldWS = $(this).css( 'white-space' ); $(this).css( 'white-space', 'nowrap' ); if ( wrapper.width() <= $(this).get(0).scrollWidth ) { - thisWidth = $(this).data( 'thisWidth' ) ? $(this).data( 'thisWidth' ) : 0; + var thisWidth = $(this).data( 'thisWidth' ) ? $(this).data( 'thisWidth' ) : 0; thisWidth = Math.max( $(this).get(0).width, thisWidth ); $(this).width( thisWidth ); $(this).data( 'thisWidth', thisWidth ); - wrapperWidth = $(this).data( 'wrapperWidth' ) ? $(this).data( 'wrapperWidth' ) : 0; + var wrapperWidth = $(this).data( 'wrapperWidth' ) ? $(this).data( 'wrapperWidth' ) : 0; wrapperWidth = Math.max( wrapper.get(0).scrollWidth, wrapperWidth ); wrapper.width( wrapperWidth ); $(this).data( 'wrapperWidth', wrapperWidth ); -- cgit v1.2.3-54-g00ecf