Index: trunk/extensions/MoodBar/MoodBar.i18n.php |
— | — | @@ -30,6 +30,9 @@ |
31 | 31 | 'tooltip-moodbar-what' => 'Learn more about this feature', |
32 | 32 | 'moodbar-what-target' => 'http://www.mediawiki.org/wiki/MoodBar', |
33 | 33 | 'moodbar-what-label' => 'What is this?', |
| 34 | + 'moodbar-what-expanded' => '▼', // Ignore, do not translate |
| 35 | + 'moodbar-what-collapsed' => '▶', // Ignore, do not translate |
| 36 | + 'moodbar-what-content' => '--- @todo ---', |
34 | 37 | // Special:MoodBar |
35 | 38 | 'right-moodbar-view' => 'View and export MoodBar feedback', |
36 | 39 | 'moodbar-admin-title' => 'MoodBar feedback', |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.core.css |
— | — | @@ -42,6 +42,10 @@ |
43 | 43 | font-size: 12px; |
44 | 44 | } |
45 | 45 | |
| 46 | +.mw-moodBar-overlayWhatContent { |
| 47 | + display: none; |
| 48 | +} |
| 49 | + |
46 | 50 | /** |
47 | 51 | * Types |
48 | 52 | */ |
— | — | @@ -50,14 +54,14 @@ |
51 | 55 | .mw-moodBar-types .mw-moodBar-type-happy { |
52 | 56 | background-image: url(images/type-happy-normal.png); |
53 | 57 | } |
54 | | -.mw-moodBar-types:hover .mw-moodBar-type-happy { |
55 | | - background-image: url(images/type-happy-hover.png); |
| 58 | +.mw-moodBar-types-hover .mw-moodBar-type-happy { |
| 59 | + background-image: url(images/type-happy-hoverside.png); |
56 | 60 | } |
57 | | -.mw-moodBar-types:hover .mw-moodBar-type-happy:hover { |
| 61 | +.mw-moodBar-types-hover .mw-moodBar-type-happy:hover { |
58 | 62 | background-image: url(images/type-happy-hovered.png); |
59 | 63 | } |
60 | | -.mw-moodBar-types-select .mw-moodBar-type-happy { |
61 | | - background-image: url(images/type-happy-select.png); |
| 64 | +.mw-moodBar-types-select .mw-moodBar-type-happy { |
| 65 | + background-image: url(images/type-happy-dull.png); |
62 | 66 | } |
63 | 67 | .mw-moodBar-types-select .mw-moodBar-type-happy.mw-moodBar-selected { |
64 | 68 | background-image: url(images/type-happy-selected.png); |
— | — | @@ -67,14 +71,14 @@ |
68 | 72 | .mw-moodBar-types .mw-moodBar-type-sad { |
69 | 73 | background-image: url(images/type-sad-normal.png); |
70 | 74 | } |
71 | | -.mw-moodBar-types:hover .mw-moodBar-type-sad { |
72 | | - background-image: url(images/type-sad-hover.png); |
| 75 | +.mw-moodBar-types-hover .mw-moodBar-type-sad { |
| 76 | + background-image: url(images/type-sad-hoverside.png); |
73 | 77 | } |
74 | | -.mw-moodBar-types:hover .mw-moodBar-type-sad:hover { |
| 78 | +.mw-moodBar-types-hover .mw-moodBar-type-sad:hover { |
75 | 79 | background-image: url(images/type-sad-hovered.png); |
76 | 80 | } |
77 | 81 | .mw-moodBar-types-select .mw-moodBar-type-sad { |
78 | | - background-image: url(images/type-sad-select.png); |
| 82 | + background-image: url(images/type-sad-dull.png); |
79 | 83 | } |
80 | 84 | .mw-moodBar-types-select .mw-moodBar-type-sad.mw-moodBar-selected { |
81 | 85 | background-image: url(images/type-sad-selected.png); |
— | — | @@ -84,14 +88,14 @@ |
85 | 89 | .mw-moodBar-types .mw-moodBar-type-confused { |
86 | 90 | background-image: url(images/type-confused-normal.png); |
87 | 91 | } |
88 | | -.mw-moodBar-types:hover .mw-moodBar-type-confused { |
89 | | - background-image: url(images/type-confused-hover.png); |
| 92 | +.mw-moodBar-types-hover .mw-moodBar-type-confused { |
| 93 | + background-image: url(images/type-confused-hoverside.png); |
90 | 94 | } |
91 | | -.mw-moodBar-types:hover .mw-moodBar-type-confused:hover { |
| 95 | +.mw-moodBar-types-hover .mw-moodBar-type-confused:hover { |
92 | 96 | background-image: url(images/type-confused-hovered.png); |
93 | 97 | } |
94 | 98 | .mw-moodBar-types-select .mw-moodBar-type-confused { |
95 | | - background-image: url(images/type-confused-select.png); |
| 99 | + background-image: url(images/type-confused-dull.png); |
96 | 100 | } |
97 | 101 | .mw-moodBar-types-select .mw-moodBar-type-confused.mw-moodBar-selected { |
98 | 102 | background-image: url(images/type-confused-selected.png); |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.core.js |
— | — | @@ -14,7 +14,13 @@ |
15 | 15 | <span class="mw-moodBar-overlayClose"><a href="#"><html:msg key="moodbar-close" /></a></span>\ |
16 | 16 | <div class="mw-moodBar-overlayTitle"><html:msg key="moodbar-intro-using" /></div>\ |
17 | 17 | <div class="mw-moodBar-types"></div>\ |
18 | | - <span class="mw-moodBar-overlayWhat"><a title-msg="tooltip-moodbar-what"><html:msg key="moodbar-what-label" /></a></span>\ |
| 18 | + <span class="mw-moodBar-overlayWhat">\ |
| 19 | + <a title-msg="tooltip-moodbar-what">\ |
| 20 | + <span class="mw-moodBar-overlayWhatTrigger"></span>\ |
| 21 | + <span class="mw-moodBar-overlayWhatLabel"><html:msg key="moodbar-what-label" /></span>\ |
| 22 | + </a>\ |
| 23 | + <div class="mw-moodBar-overlayWhatContent"><html:msg key="moodbar-what-content" /></div>\ |
| 24 | + </span>\ |
19 | 25 | </div>', |
20 | 26 | type: '\ |
21 | 27 | <div class="mw-moodBar-type mw-moodBar-type-$1" rel="$1">\ |
— | — | @@ -36,7 +42,14 @@ |
37 | 43 | feedbackItem: { |
38 | 44 | comment: '', |
39 | 45 | bucket: mb.conf.bucketKey, |
40 | | - type: 'unknown' |
| 46 | + type: 'unknown', |
| 47 | + callback: function( data ) { |
| 48 | + if ( data && data.moodbar && data.moodbar.result === 'success' ) { |
| 49 | + alert(1); |
| 50 | + } else { |
| 51 | + alert(0); |
| 52 | + } |
| 53 | + } |
41 | 54 | }, |
42 | 55 | |
43 | 56 | core: function() { |
— | — | @@ -61,27 +74,47 @@ |
62 | 75 | $( mb.tpl.type.replace( /\$1/g, type ) ) |
63 | 76 | .localize() |
64 | 77 | .click( function( e ) { |
| 78 | + var $el = $( this ); |
65 | 79 | $mwMoodBarTypes.addClass( 'mw-moodBar-types-select' ); |
66 | | - mb.feedbackItem.type = $(this).attr( 'rel' ); |
| 80 | + mb.feedbackItem.type = $el.attr( 'rel' ); |
| 81 | + $el.addClass( 'mw-moodBar-selected' ); |
| 82 | + $el.parent() |
| 83 | + .find( '.mw-moodBar-selected' ) |
| 84 | + .not( $el ) |
| 85 | + .removeClass( 'mw-moodBar-selected' ); |
67 | 86 | } ) |
68 | 87 | .get( 0 ) |
69 | 88 | ); |
70 | 89 | } ); |
71 | | - return elems; |
| 90 | + return elems;ß |
72 | 91 | } ) |
| 92 | + .hover( function() { |
| 93 | + $( this ).addClass( 'mw-moodBar-types-hover' ); |
| 94 | + }, function() { |
| 95 | + $( this ).removeClass( 'mw-moodBar-types-hover' ); |
| 96 | + } ) |
73 | 97 | .end() |
74 | 98 | // Link what-button |
| 99 | + .find( '.mw-moodBar-overlayWhatTrigger' ) |
| 100 | + .html( mw.msg( 'moodbar-what-collapsed' ) ) |
| 101 | + .end() |
75 | 102 | .find( '.mw-moodBar-overlayWhat > a' ) |
76 | | - .attr( 'href', function() { |
77 | | - var target = mw.msg( 'moodbar-what-target' ), |
78 | | - r = new RegExp( '^(' + mw.config.get( 'wgUrlProtocols' ) + ')', 'i' ); |
79 | | - if ( r.exec( target ) ) { |
80 | | - return target; |
81 | | - } else { |
82 | | - return mw.util.wikiGetlink( target ); |
83 | | - } |
| 103 | + .click( function() { |
| 104 | + mb.ui.overlay |
| 105 | + .find( '.mw-moodBar-overlayWhatContent' ) |
| 106 | + .each( function() { |
| 107 | + var $el = $( this ), |
| 108 | + $trigger = mb.ui.overlay.find( '.mw-moodBar-overlayWhatTrigger' ); |
| 109 | + if ( $el.is( ':visible' ) ) { |
| 110 | + $el.slideUp(); |
| 111 | + $trigger.html( mw.msg( 'moodbar-what-collapsed' ) ); |
| 112 | + } else { |
| 113 | + $el.slideDown(); |
| 114 | + $trigger.html( mw.msg( 'moodbar-what-expanded' ) ); |
| 115 | + } |
| 116 | + } ) |
84 | 117 | } ) |
85 | | - .end(); |
| 118 | + .end(); |
86 | 119 | |
87 | 120 | // Inject overlay |
88 | 121 | mb.ui.overlay.appendTo( 'body' ); |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-dull.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-dull.png |
___________________________________________________________________ |
Added: svn:mime-type |
89 | 122 | + image/png |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-hoverside.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-hoverside.png |
___________________________________________________________________ |
Added: svn:mime-type |
90 | 123 | + image/png |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-normal.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-selected.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-selected.png |
___________________________________________________________________ |
Added: svn:mime-type |
91 | 124 | + image/png |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-selected.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-selected.png |
___________________________________________________________________ |
Added: svn:mime-type |
92 | 125 | + image/png |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-hoverside.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-hoverside.png |
___________________________________________________________________ |
Added: svn:mime-type |
93 | 126 | + image/png |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-normal.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-hovered.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-hovered.png |
___________________________________________________________________ |
Added: svn:mime-type |
94 | 127 | + image/png |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-hovered.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-hovered.png |
___________________________________________________________________ |
Added: svn:mime-type |
95 | 128 | + image/png |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-dull.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-confused-dull.png |
___________________________________________________________________ |
Added: svn:mime-type |
96 | 129 | + image/png |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-dull.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-sad-dull.png |
___________________________________________________________________ |
Added: svn:mime-type |
97 | 130 | + image/png |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-hoverside.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-hoverside.png |
___________________________________________________________________ |
Added: svn:mime-type |
98 | 131 | + image/png |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-normal.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-selected.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-selected.png |
___________________________________________________________________ |
Added: svn:mime-type |
99 | 132 | + image/png |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-hovered.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/MoodBar/modules/ext.moodBar/images/type-happy-hovered.png |
___________________________________________________________________ |
Added: svn:mime-type |
100 | 133 | + image/png |
Index: trunk/extensions/MoodBar/MoodBar.php |
— | — | @@ -74,6 +74,9 @@ |
75 | 75 | 'tooltip-moodbar-what', |
76 | 76 | 'moodbar-what-target', |
77 | 77 | 'moodbar-what-label', |
| 78 | + 'moodbar-what-expanded', |
| 79 | + 'moodbar-what-collapsed', |
| 80 | + 'moodbar-what-content', |
78 | 81 | ), |
79 | 82 | 'dependencies' => array( |
80 | 83 | 'mediawiki.util', |