Index: trunk/extensions/MoodBar/MoodBar.i18n.php |
— | — | @@ -71,8 +71,7 @@ |
72 | 72 | 'moodbar-email-resend-confirmation' => 'Resend confirmation', |
73 | 73 | 'moodbar-email-optout' => 'No thanks', |
74 | 74 | // MoodBar Tooltip |
75 | | - 'moodbar-tooltip-title' => 'Let us know about your experience editing Wikipedia.', |
76 | | - 'moodbar-tooltip-subtitle' => 'Your feedback about editing Wikipedia helps us make the site better.', |
| 75 | + 'moodbar-tooltip-title' => 'Let us know about your experience editing {{SITENAME}}.', |
77 | 76 | // Special:MoodBar |
78 | 77 | 'right-moodbar-view' => 'View and export MoodBar feedback', |
79 | 78 | 'right-moodbar-admin' => 'Alter visibility on the feedback dashboard', |
— | — | @@ -260,7 +259,6 @@ |
261 | 260 | 'moodbar-email-resend-confirmation' => "Button text for resending confirmation email. This message is used in {{msg-mw|Moodbar-email-confirm-desc}}, so if you're updating this message, update that one, too.", |
262 | 261 | 'moodbar-email-optout' => 'Button text for email opt-out', |
263 | 262 | 'moodbar-tooltip-title' => 'Text for title of moodbar tooltip', |
264 | | - 'moodbar-tooltip-subtitle' => 'Text for subtitle of moodbar tooltip', |
265 | 263 | 'right-moodbar-view' => '{{doc-right|moodbar-view}}', |
266 | 264 | 'right-moodbar-admin' => '{{doc-right|moodbar-admin}}', |
267 | 265 | 'moodbar-header-timestamp' => '{{Identical|Timestamp}}', |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.init.js |
— | — | @@ -58,14 +58,14 @@ |
59 | 59 | .appendTo( ui.pMoodbar ); |
60 | 60 | |
61 | 61 | // Inject portlet into document, when document is ready |
62 | | - $( mb.inject ); |
| 62 | + // Send mb.getUserInfo as a callback to be ran after MoodBar injection |
| 63 | + $( mb.inject( mb.getUserInfo ) ); |
63 | 64 | |
64 | | - // Assign user props to mb.userData object. |
65 | | - mb.getUserInfo(); |
66 | 65 | }, |
67 | 66 | |
68 | | - inject: function() { |
| 67 | + inject: function(getUserInfo) { |
69 | 68 | $( '#mw-head' ).append( mb.ui.pMoodbar ); |
| 69 | + getUserInfo(); //run the callback |
70 | 70 | }, |
71 | 71 | |
72 | 72 | getUserInfo: function() { |
— | — | @@ -75,21 +75,17 @@ |
76 | 76 | uiprop: 'email', |
77 | 77 | format: 'json' |
78 | 78 | }; |
79 | | - $(document).ready( function() { |
80 | | - $.ajax( { |
81 | | - 'type': 'POST', |
82 | | - 'url': mw.util.wikiScript( 'api' ), |
83 | | - 'data': query, |
84 | | - 'success': function (data) { |
85 | | - mb.userData = data.query.userinfo; |
86 | | - }, |
87 | | - 'error': function( jqXHR, textStatus, errorThrown ) { |
88 | | - mb.userData = null; |
89 | | - }, |
90 | | - 'dataType': 'json' |
91 | | - } ); |
92 | | - }); |
93 | | - |
| 79 | + $.ajax( { |
| 80 | + 'url': mw.util.wikiScript( 'api' ), |
| 81 | + 'data': query, |
| 82 | + 'success': function (data) { |
| 83 | + mb.userData = data.query.userinfo; |
| 84 | + }, |
| 85 | + 'error': function( jqXHR, textStatus, errorThrown ) { |
| 86 | + mb.userData = null; |
| 87 | + }, |
| 88 | + 'dataType': 'json' |
| 89 | + } ); |
94 | 90 | } |
95 | 91 | |
96 | 92 | }; |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.tooltip.css |
— | — | @@ -27,7 +27,6 @@ |
28 | 28 | #moodbar-tooltip-overlay #moodbar-tooltip-title { |
29 | 29 | font-weight: bold; |
30 | 30 | font-size: 0.75em; |
31 | | - margin-bottom: 10px; |
32 | 31 | } |
33 | 32 | |
34 | 33 | #moodbar-tooltip-overlay #moodbar-tooltip-subtitle { |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.core.js |
— | — | @@ -138,7 +138,7 @@ |
139 | 139 | emailOptOut = ($.cookie( mb.cookiePrefix() + 'emailOptOut' ) == '1'); |
140 | 140 | |
141 | 141 | if( emailOptOut === false) { |
142 | | - if(userData.email !== "") { //check for email address |
| 142 | + if('email' in userData && userData.email !== "") { //check for email address |
143 | 143 | if('emailauthenticated' in userData) { //they have confirmed |
144 | 144 | mb.showSuccess(); |
145 | 145 | } else { //show email confirmation form |
— | — | @@ -483,18 +483,18 @@ |
484 | 484 | validateFeedback: function() { |
485 | 485 | var comment = $( '#mw-moodBar-feedbackInput' ).val(); |
486 | 486 | if( $.trim( comment ).length > 0 && comment.length <= 140 && $( '.mw-moodBar-selected').length ) { |
487 | | - mb.ui.overlay.find( '.mw-moodBar-formSubmit').removeAttr('disabled'); |
| 487 | + mb.ui.overlay.find( '.mw-moodBar-formSubmit').prop('disabled', false); |
488 | 488 | } else { |
489 | | - mb.ui.overlay.find( '.mw-moodBar-formSubmit').attr({'disabled':'true'}); |
| 489 | + mb.ui.overlay.find( '.mw-moodBar-formSubmit').prop('disabled', true); |
490 | 490 | } |
491 | 491 | }, |
492 | 492 | |
493 | 493 | validateEmail: function() { |
494 | 494 | var email = $( '#mw-moodBar-emailInput' ).val(); |
495 | 495 | if( $.trim( email ).length > 0) { //find validate email method |
496 | | - mb.ui.overlay.find( '.mw-moodBar-emailSubmit').removeAttr('disabled'); |
| 496 | + mb.ui.overlay.find( '.mw-moodBar-emailSubmit').prop('disabled', false); |
497 | 497 | } else { |
498 | | - mb.ui.overlay.find( '.mw-moodBar-emailSubmit').attr({'disabled':'true'}); |
| 498 | + mb.ui.overlay.find( '.mw-moodBar-emailSubmit').prop('disabled', true); |
499 | 499 | } |
500 | 500 | } |
501 | 501 | |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.tooltip.js |
— | — | @@ -39,9 +39,10 @@ |
40 | 40 | .append( |
41 | 41 | $('<div>').attr('id', 'moodbar-tooltip-pointy') |
42 | 42 | ).append( |
43 | | - $('<div>').attr('id', 'moodbar-tooltip-title').text( mw.msg( 'moodbar-tooltip-title' ) ) |
44 | | - ).append( |
45 | | - $('<div>').attr('id', 'moodbar-tooltip-subtitle').text( mw.msg( 'moodbar-tooltip-subtitle' ) ) |
| 43 | + $('<div>').attr('id', 'moodbar-tooltip-title') |
| 44 | + .text( mw.msg( 'moodbar-tooltip-title' ) |
| 45 | + .replace( new RegExp( $.escapeRE('{{SITENAME}}'), 'g' ), mw.config.get( 'wgSiteName' ) ) |
| 46 | + ) |
46 | 47 | ) |
47 | 48 | ); |
48 | 49 | |
Index: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.js |
— | — | @@ -33,9 +33,7 @@ |
34 | 34 | * Select all comment type filters. |
35 | 35 | */ |
36 | 36 | function selectAllTypes() { |
37 | | - $( '#fbd-filters-type-praise, #fbd-filters-type-confusion, #fbd-filters-type-issues' ).each( function() { |
38 | | - $(this).prop( 'checked', true); |
39 | | - }); |
| 37 | + $( '#fbd-filters-type-praise, #fbd-filters-type-confusion, #fbd-filters-type-issues' ).prop( 'checked', true); |
40 | 38 | } |
41 | 39 | /** |
42 | 40 | * Set the moodbar-feedback-types and moodbar-feedback-username cookies based on formState. |
— | — | @@ -546,9 +544,9 @@ |
547 | 545 | function validateResponse($item) { |
548 | 546 | var response = $.trim( $item.find('.fbd-response-text').val() ); |
549 | 547 | if( response.length > 0 && response.length <= 5000 ) { |
550 | | - $item.find( '.fbd-response-submit, .fbd-response-preview').removeAttr('disabled'); |
| 548 | + $item.find( '.fbd-response-submit, .fbd-response-preview').prop('disabled', false); |
551 | 549 | } else { |
552 | | - $item.find( '.fbd-response-submit, .fbd-response-preview').attr({'disabled':'true'}); |
| 550 | + $item.find( '.fbd-response-submit, .fbd-response-preview').prop('disabled', true); |
553 | 551 | } |
554 | 552 | } |
555 | 553 | |
Index: trunk/extensions/MoodBar/MoodBar.php |
— | — | @@ -89,10 +89,11 @@ |
90 | 90 | 'tooltip-p-moodbar-trigger-share', |
91 | 91 | 'tooltip-p-moodbar-trigger-editing', |
92 | 92 | ), |
93 | | - 'position' => 'top', |
| 93 | + 'position' => 'bottom', |
94 | 94 | 'dependencies' => array( |
95 | 95 | 'jquery.cookie', |
96 | 96 | 'jquery.client', |
| 97 | + 'mediawiki.util' |
97 | 98 | ), |
98 | 99 | ); |
99 | 100 | |
— | — | @@ -101,12 +102,10 @@ |
102 | 103 | 'scripts' => 'ext.moodBar/ext.moodBar.tooltip.js', |
103 | 104 | 'messages' => array( |
104 | 105 | 'moodbar-tooltip-title', |
105 | | - 'moodbar-tooltip-subtitle', |
106 | 106 | ), |
107 | | - 'position' => 'top', |
| 107 | + 'position' => 'bottom', |
108 | 108 | 'dependencies' => array( |
109 | 109 | 'jquery.cookie', |
110 | | - 'jquery.client', |
111 | 110 | 'ext.moodBar.init', |
112 | 111 | ), |
113 | 112 | ); |