summaryrefslogtreecommitdiff
path: root/resources/jquery/jquery.messageBox.js
diff options
context:
space:
mode:
Diffstat (limited to 'resources/jquery/jquery.messageBox.js')
-rw-r--r--resources/jquery/jquery.messageBox.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/resources/jquery/jquery.messageBox.js b/resources/jquery/jquery.messageBox.js
index a69fca59..690fedd2 100644
--- a/resources/jquery/jquery.messageBox.js
+++ b/resources/jquery/jquery.messageBox.js
@@ -11,7 +11,7 @@
* @license CC-BY 3.0 <http://creativecommons.org/licenses/by/3.0>
* @license GPL2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
*/
-( function( $, mw ) {
+( function( $ ) {
// @return jQuery object of the message box
$.messageBoxNew = function( options ) {
options = $.extend( {
@@ -19,16 +19,16 @@ $.messageBoxNew = function( options ) {
'parent': 'body', // jQuery/CSS selector
'insert': 'prepend' // 'prepend' or 'append'
}, options );
- var $curBox = $( '#'+ options.id );
+ var $curBox = $( '#' + options.id );
// Only create a new box if it doesn't exist already
- if ( $curBox.size() > 0 ) {
+ if ( $curBox.length > 0 ) {
if ( $curBox.hasClass( 'js-messagebox' ) ) {
return $curBox;
} else {
return $curBox.addClass( 'js-messagebox' );
}
} else {
- var $newBox = $( '<div/>', {
+ var $newBox = $( '<div>', {
'id': options.id,
'class': 'js-messagebox',
'css': {
@@ -58,13 +58,13 @@ $.messageBox = function( options ) {
'group': 'default',
'replace': false, // if true replaces any previous message in this group
'target': 'js-messagebox'
- }, options );
+ }, options );
var $target = $.messageBoxNew( { id: options.target } );
var groupID = options.target + '-' + options.group;
var $group = $( '#' + groupID );
// Create group container if not existant
- if ( $group.size() < 1 ) {
- $group = $( '<div/>', {
+ if ( $group.length < 1 ) {
+ $group = $( '<div>', {
'id': groupID,
'class': 'js-messagebox-group'
});
@@ -79,12 +79,12 @@ $.messageBox = function( options ) {
$group.hide();
} else {
// Actual message addition
- $group.prepend( $( '<p/>' ).append( options.message ) ).show();
+ $group.prepend( $( '<p>' ).append( options.message ) ).show();
$target.slideDown();
}
// If the last visible group was just hidden, slide the entire box up
// Othere wise slideDown (if already visible nothing will happen)
- if ( $target.find( '> *:visible' ).size() === 0 ) {
+ if ( $target.find( '> *:visible' ).length === 0 ) {
// to avoid a sudden dissapearance of the last group followed by
// a slide up of only the outline, show it for a second
$group.show();
@@ -95,4 +95,4 @@ $.messageBox = function( options ) {
}
return $group;
};
-} )( jQuery, mediaWiki ); \ No newline at end of file
+} )( jQuery );