r78549 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78548‎ | r78549 | r78550 >
Date:20:28, 17 December 2010
Author:tparscal
Status:deferred
Tags:
Comment:
Finished setting up pitches - an icon option may be added later but for now this is enough for things to function.
Modified paths:
  • /trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/ArticleFeedback.i18n.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.js (modified) (history)
  • /trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.css (modified) (history)
  • /trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php
@@ -22,14 +22,15 @@
2323 'articlefeedback-field-wellwritten-label',
2424 'articlefeedback-field-wellwritten-tip',
2525 'articlefeedback-pitch-takesurvey-title',
 26+ 'articlefeedback-pitch-reject',
2627 'articlefeedback-pitch-takesurvey-message',
27 - 'articlefeedback-pitch-takesurvey-action',
 28+ 'articlefeedback-pitch-takesurvey-accept',
2829 'articlefeedback-pitch-createaccount-title',
2930 'articlefeedback-pitch-createaccount-message',
30 - 'articlefeedback-pitch-createaccount-action',
 31+ 'articlefeedback-pitch-createaccount-accept',
3132 'articlefeedback-pitch-makefirstedit-title',
3233 'articlefeedback-pitch-makefirstedit-message',
33 - 'articlefeedback-pitch-makefirstedit-action',
 34+ 'articlefeedback-pitch-makefirstedit-accept',
3435 ),
3536 'dependencies' => array(
3637 'jquery.articleFeedback',
Index: trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js
@@ -42,7 +42,8 @@
4343 <div class="articleFeedback-buffer">\
4444 <div class="articleFeedback-title"></div>\
4545 <div class="articleFeedback-message"></div>\
46 - <button class="articleFeedback-action"></button>\
 46+ <button class="articleFeedback-accept"></button>\
 47+ <button class="articleFeedback-reject"></button>\
4748 </div>\
4849 </div>\
4950 '
@@ -71,7 +72,7 @@
7273 'submit': function() {
7374 var context = this;
7475 // Lock the submit button -- TODO: lock the star inputs too
75 - context.$ui.find( 'button[type=submit]' ).button( { 'disabled': true } );
 76+ context.$ui.find( '.articleFeedback-submit' ).button( { 'disabled': true } );
7677
7778 // Build data from form values
7879 var data = {};
@@ -215,9 +216,20 @@
216217 .find( '.articleFeedback-message' )
217218 .text( mw.msg( context.options.pitches[key].message ) )
218219 .end()
219 - .find( '.articleFeedback-action' )
220 - .text( mw.msg( context.options.pitches[key].action ) )
 220+ .find( '.articleFeedback-accept' )
 221+ .text( mw.msg( context.options.pitches[key].accept ) )
 222+ .click( function() {
 223+ context.options.pitches[key].action();
 224+ $(this).closest( '.articleFeedback-pitch' ).fadeOut();
 225+ } )
 226+ .button()
221227 .end()
 228+ .find( '.articleFeedback-reject' )
 229+ .text( mw.msg( context.options.pitches[key].reject ) )
 230+ .click( function() {
 231+ $(this).closest( '.articleFeedback-pitch' ).fadeOut();
 232+ } )
 233+ .end()
222234 .appendTo( $(this) );
223235 }
224236 } )
@@ -237,6 +249,14 @@
238250 .button()
239251 .click( function() {
240252 $.articleFeedback.fn.submit.call( context );
 253+ for ( key in context.options.pitches ) {
 254+ if ( context.options.pitches[key].condition() ) {
 255+ context.$ui
 256+ .find( '.articleFeedback-pitch[rel="' + key + '"]' )
 257+ .show();
 258+ break;
 259+ }
 260+ }
241261 } )
242262 .end()
243263 // Hide report elements initially
Index: trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.css
@@ -18,11 +18,25 @@
1919 position: absolute;
2020 top: 0;
2121 left: 0;
 22+ bottom: 0;
 23+ right: 0;
2224 background-color: #f9f9f9;
2325 border: 1px solid #cccccc;
2426 padding-bottom: 1px;
2527 }
2628
 29+.articleFeedback-reject {
 30+ border: none;
 31+ background-color: #f9f9f9;
 32+ cursor: pointer;
 33+ color: #0645AD;
 34+ line-height: 1.4em;
 35+}
 36+
 37+.articleFeedback-reject:hover {
 38+ text-decoration: underline;
 39+}
 40+
2741 .articleFeedback-pitch .articleFeedback-buffer {
2842 padding: 0.75em 1em;
2943 }
Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.js
@@ -33,9 +33,13 @@
3434 // If already taken survey, return false
3535 return true;
3636 },
 37+ 'action': function() {
 38+ // Do something
 39+ },
3740 'title': 'articlefeedback-pitch-takesurvey-title',
3841 'message': 'articlefeedback-pitch-takesurvey-message',
39 - 'action': 'articlefeedback-pitch-takesurvey-action'
 42+ 'accept': 'articlefeedback-pitch-takesurvey-accept',
 43+ 'reject': 'articlefeedback-pitch-reject'
4044 },
4145 'createaccount': {
4246 'condition': function() {
@@ -45,9 +49,13 @@
4650 }
4751 return true;
4852 },
 53+ 'action': function() {
 54+ // Do something
 55+ },
4956 'title': 'articlefeedback-pitch-createaccount-title',
5057 'message': 'articlefeedback-pitch-createaccount-message',
51 - 'action': 'articlefeedback-pitch-createaccount-action'
 58+ 'accept': 'articlefeedback-pitch-createaccount-accept',
 59+ 'reject': 'articlefeedback-pitch-reject'
5260 },
5361 'makefirstedit': {
5462 'condition': function() {
@@ -57,9 +65,13 @@
5866 }
5967 return true;
6068 },
 69+ 'action': function() {
 70+ // Do something
 71+ },
6172 'title': 'articlefeedback-pitch-makefirstedit-title',
6273 'message': 'articlefeedback-pitch-makefirstedit-message',
63 - 'action': 'articlefeedback-pitch-makefirstedit-action'
 74+ 'accept': 'articlefeedback-pitch-makefirstedit-accept',
 75+ 'reject': 'articlefeedback-pitch-reject'
6476 },
6577 }
6678 };
Index: trunk/extensions/ArticleFeedback/ArticleFeedback.i18n.php
@@ -44,15 +44,16 @@
4545 'articlefeedback-field-unbiased-tip' => 'Do you feel that this page shows a fair representation of all perspectives on the issue?',
4646 'articlefeedback-field-wellwritten-label' => 'Well-written',
4747 'articlefeedback-field-wellwritten-tip' => 'Do you feel that this page is well-organized and well-written?',
 48+ 'articlefeedback-pitch-reject' => 'No thanks',
4849 'articlefeedback-pitch-takesurvey-title' => 'Would you like to take a survey?',
4950 'articlefeedback-pitch-takesurvey-message' => '-- message --',
50 - 'articlefeedback-pitch-takesurvey-action' => 'Start survey',
 51+ 'articlefeedback-pitch-takesurvey-accept' => 'Start survey',
5152 'articlefeedback-pitch-createaccount-title' => 'Would you like to create an account?',
5253 'articlefeedback-pitch-createaccount-message' => '-- message --',
53 - 'articlefeedback-pitch-createaccount-action' => 'Create account',
 54+ 'articlefeedback-pitch-createaccount-accept' => 'Create account',
5455 'articlefeedback-pitch-makefirstedit-title' => 'Would you like to edit this article?',
5556 'articlefeedback-pitch-makefirstedit-message' => '-- message --',
56 - 'articlefeedback-pitch-makefirstedit-action' => 'Start editing',
 57+ 'articlefeedback-pitch-makefirstedit-accept' => 'Start editing',
5758 );
5859
5960 /** Message documentation (Message documentation)

Status & tagging log