From: Krinkle Date: Tue, 8 Feb 2011 00:22:03 +0000 (+0000) Subject: Follow-up r81660. X-Git-Tag: 1.31.0-rc.0~32131 X-Git-Url: http://git.cyclocoop.org/data/%24self?a=commitdiff_plain;h=8fa69452fa4548a424c878ded63eb12e8c60beef;p=lhc%2Fweb%2Fwiklou.git Follow-up r81660. (Renaming new jQuery.jsMessage plugin to jQuery.mesageBox() ) --- diff --git a/resources/jquery/jquery.messageBox.css b/resources/jquery/jquery.messageBox.css index 58e794a2d4..96332aa588 100644 --- a/resources/jquery/jquery.messageBox.css +++ b/resources/jquery/jquery.messageBox.css @@ -1,15 +1,15 @@ -.js-message-box { +.js-messagebox { margin: 1em 5%; padding: 0.5em 2.5%; border: 1px solid #ccc; background-color: #fcfcfc; font-size: 0.8em; } -.js-message-box .js-message-group { +.js-messagebox .js-messagebox-group { margin: 1px; padding: 0.5em 2.5%; border-bottom: 1px solid #ddd; } -.js-message-box .js-message-group:last-child { +.js-messagebox .js-messagebox-group:last-child { border-bottom: thin none transparent; } \ No newline at end of file diff --git a/resources/jquery/jquery.messageBox.js b/resources/jquery/jquery.messageBox.js index db64f1ac28..067ecfa39b 100644 --- a/resources/jquery/jquery.messageBox.js +++ b/resources/jquery/jquery.messageBox.js @@ -1,5 +1,5 @@ /** - * jQuery jsMessage + * jQuery messageBox * * Function to inform the user of something. Use sparingly (since there's mw.log for * messages aimed at developers / debuggers). Based on the function in MediaWiki's @@ -13,24 +13,24 @@ */ ( function( $, mw ) { // @return jQuery object of the message box -$.jsMessageNew = function( options ) { +$.messageBoxNew = function( options ) { options = $.extend( { - 'id': 'js-message', // unique identifier for this message box + 'id': 'js-messagebox', // unique identifier for this message box 'parent': 'body', // jQuery/CSS selector 'insert': 'prepend' // 'prepend' or 'append' }, options ); var $curBox = $( '#'+ options.id ); // Only create a new box if it doesn't exist already if ( $curBox.size() > 0 ) { - if ( $curBox.hasClass( 'js-message-box' ) ) { + if ( $curBox.hasClass( 'js-messagebox' ) ) { return $curBox; } else { - return $curBox.addClass( 'js-message-box' ); + return $curBox.addClass( 'js-messagebox' ); } } else { var $newBox = $( '
', { 'id': options.id, - 'class': 'js-message-box', + 'class': 'js-messagebox', 'css': { 'display': 'none' } @@ -49,21 +49,21 @@ $.jsMessageNew = function( options ) { // If there are no visible groups the main message box is hidden automatically, // and shown again once there are messages // @return jQuery object of message group -$.jsMessage = function( options ) { +$.messageBox = function( options ) { options = $.extend( { 'message': '', 'group': 'default', 'replace': false, // if true replaces any previous message in this group - 'target': 'js-message' + 'target': 'js-messagebox' }, options ); - var $target = $.jsMessageNew( { id: options.target } ); + 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 = $( '
', { 'id': groupID, - 'class': 'js-message-group' + 'class': 'js-messagebox-group' }); $target.prepend( $group ); } @@ -77,7 +77,7 @@ $.jsMessage = function( options ) { } else { // Actual message addition $group.prepend( $( '

' ).append( options.message ) ).show(); - $target.slideDown() + $target.slideDown(); } // If the last visible group was just hidden, slide the entire box up // Othere wise slideDown (if already visible nothing will happen)