Index: trunk/phase3/resources/jquery/jquery.messageBox.js |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | /** |
3 | | - * jQuery jsMessage |
| 3 | + * jQuery messageBox |
4 | 4 | * |
5 | 5 | * Function to inform the user of something. Use sparingly (since there's mw.log for |
6 | 6 | * messages aimed at developers / debuggers). Based on the function in MediaWiki's |
— | — | @@ -13,24 +13,24 @@ |
14 | 14 | */ |
15 | 15 | ( function( $, mw ) { |
16 | 16 | // @return jQuery object of the message box |
17 | | -$.jsMessageNew = function( options ) { |
| 17 | +$.messageBoxNew = function( options ) { |
18 | 18 | options = $.extend( { |
19 | | - 'id': 'js-message', // unique identifier for this message box |
| 19 | + 'id': 'js-messagebox', // unique identifier for this message box |
20 | 20 | 'parent': 'body', // jQuery/CSS selector |
21 | 21 | 'insert': 'prepend' // 'prepend' or 'append' |
22 | 22 | }, options ); |
23 | 23 | var $curBox = $( '#'+ options.id ); |
24 | 24 | // Only create a new box if it doesn't exist already |
25 | 25 | if ( $curBox.size() > 0 ) { |
26 | | - if ( $curBox.hasClass( 'js-message-box' ) ) { |
| 26 | + if ( $curBox.hasClass( 'js-messagebox' ) ) { |
27 | 27 | return $curBox; |
28 | 28 | } else { |
29 | | - return $curBox.addClass( 'js-message-box' ); |
| 29 | + return $curBox.addClass( 'js-messagebox' ); |
30 | 30 | } |
31 | 31 | } else { |
32 | 32 | var $newBox = $( '<div/>', { |
33 | 33 | 'id': options.id, |
34 | | - 'class': 'js-message-box', |
| 34 | + 'class': 'js-messagebox', |
35 | 35 | 'css': { |
36 | 36 | 'display': 'none' |
37 | 37 | } |
— | — | @@ -49,21 +49,21 @@ |
50 | 50 | // If there are no visible groups the main message box is hidden automatically, |
51 | 51 | // and shown again once there are messages |
52 | 52 | // @return jQuery object of message group |
53 | | -$.jsMessage = function( options ) { |
| 53 | +$.messageBox = function( options ) { |
54 | 54 | options = $.extend( { |
55 | 55 | 'message': '', |
56 | 56 | 'group': 'default', |
57 | 57 | 'replace': false, // if true replaces any previous message in this group |
58 | | - 'target': 'js-message' |
| 58 | + 'target': 'js-messagebox' |
59 | 59 | }, options ); |
60 | | - var $target = $.jsMessageNew( { id: options.target } ); |
| 60 | + var $target = $.messageBoxNew( { id: options.target } ); |
61 | 61 | var groupID = options.target + '-' + options.group; |
62 | 62 | var $group = $( '#' + groupID ); |
63 | 63 | // Create group container if not existant |
64 | 64 | if ( $group.size() < 1 ) { |
65 | 65 | $group = $( '<div/>', { |
66 | 66 | 'id': groupID, |
67 | | - 'class': 'js-message-group' |
| 67 | + 'class': 'js-messagebox-group' |
68 | 68 | }); |
69 | 69 | $target.prepend( $group ); |
70 | 70 | } |
— | — | @@ -77,7 +77,7 @@ |
78 | 78 | } else { |
79 | 79 | // Actual message addition |
80 | 80 | $group.prepend( $( '<p/>' ).append( options.message ) ).show(); |
81 | | - $target.slideDown() |
| 81 | + $target.slideDown(); |
82 | 82 | } |
83 | 83 | // If the last visible group was just hidden, slide the entire box up |
84 | 84 | // Othere wise slideDown (if already visible nothing will happen) |
Index: trunk/phase3/resources/jquery/jquery.messageBox.css |
— | — | @@ -1,15 +1,15 @@ |
2 | | -.js-message-box { |
| 2 | +.js-messagebox { |
3 | 3 | margin: 1em 5%; |
4 | 4 | padding: 0.5em 2.5%; |
5 | 5 | border: 1px solid #ccc; |
6 | 6 | background-color: #fcfcfc; |
7 | 7 | font-size: 0.8em; |
8 | 8 | } |
9 | | -.js-message-box .js-message-group { |
| 9 | +.js-messagebox .js-messagebox-group { |
10 | 10 | margin: 1px; |
11 | 11 | padding: 0.5em 2.5%; |
12 | 12 | border-bottom: 1px solid #ddd; |
13 | 13 | } |
14 | | -.js-message-box .js-message-group:last-child { |
| 14 | +.js-messagebox .js-messagebox-group:last-child { |
15 | 15 | border-bottom: thin none transparent; |
16 | 16 | } |
\ No newline at end of file |