r105061 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105060‎ | r105061 | r105062 >
Date:05:00, 3 December 2011
Author:rsterbin
Status:deferred
Tags:
Comment:
Custom tooltip text for option 4; rearranged a little to avoid the if statement
for bucket 5:
- ArticleFeedbackv5.i18n.php:
- New message "articlefeedbackv5-bucket4-help-tooltip-info"
- ArticleFeedbackv5.hooks.php:
- Added "articlefeedbackv5-bucket4-help-tooltip-info" to the module
message list
- modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js:
- Added a class to the p tag around the tooltip info text
- Added afterBuild() to bucket 4 to replace the tooltip info text
- Added afterBuild() to bucket 5 to hide the tooltip trigger
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php
@@ -91,6 +91,7 @@
9292 'articlefeedbackv5-bucket4-teaser-line2' => 'Go ahead, give it a try. Be bold!',
9393 'articlefeedbackv5-bucket4-learn-to-edit' => 'Learn how to edit',
9494 'articlefeedbackv5-bucket4-form-submit' => 'Edit this page',
 95+ 'articlefeedbackv5-bucket4-help-tooltip-info' => 'Wikipedia wants to know what you think. Help improve this page by becoming an editor.',
9596 /* Option 5 (just like AFTv4, but ported to work with v5) */
9697 'articlefeedbackv5-bucket5-form-switch-label' => 'Rate this page',
9798 'articlefeedbackv5-bucket5-form-panel-title' => 'Rate this page',
@@ -158,7 +159,6 @@
159160 'articlefeedbackv5-titlebar-linktext' => 'Feedback',
160161 'articlefeedbackv5-toolbox-linktext' => 'Rate this page',
161162
162 -
163163 /* --- copied from AFTv4 and possibly not used --- */
164164 /* ArticleFeedback survey */
165165 'articlefeedbackv5-survey-question-origin' => 'What page were you on when you started this survey?',
@@ -294,6 +294,7 @@
295295 'articlefeedbackv5-bucket4-teaser-line2' => 'The second line of the teaser text for option 4; should be a playful call to give editing a try.',
296296 'articlefeedbackv5-bucket4-learn-to-edit' => 'The text for the "Learn how to edit" link',
297297 'articlefeedbackv5-bucket4-form-submit' => 'The text for the big edit button',
 298+ 'articlefeedbackv5-bucket4-help-tooltip-info' => 'Overrides "articlefeedbackv5-help-tooltip-info" for option 4; DO NOT TRANSLATE: English text is not finalized.',
298299 /* Option 5 (just like AFTv4, but ported to work with v5) */
299300 'articlefeedbackv5-bucket5-form-panel-explanation' => '{{Identical|What is this}}',
300301 'articlefeedbackv5-bucket5-form-panel-explanation-link' => 'Do not translate "Project:". Also translate the "ArticleFeedback" special page name at [[Special:AdvancedTranslate]].',
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js
@@ -175,7 +175,7 @@
176176 <div class="tooltip-repeat">\
177177 <h3><html:msg key="help-tooltip-title" /></h3><span class="articleFeedbackv5-tooltip-close">X</span>\
178178 <div class="clear"></div>\
179 - <p><html:msg key="help-tooltip-info" /></p>\
 179+ <p class="articleFeedbackv5-tooltip-info"><html:msg key="help-tooltip-info" /></p>\
180180 <p><a target="_blank" class="articleFeedbackv5-tooltip-link"><html:msg key="help-tooltip-linktext" />&nbsp;&gt;&gt;</a></p>\
181181 </div>\
182182 <div class="tooltip-bottom"></div>\
@@ -1113,6 +1113,21 @@
11141114 .addClass( 'ui-button-blue' )
11151115
11161116 return $block;
 1117+ },
 1118+
 1119+ // }}}
 1120+ // {{{ afterBuild
 1121+
 1122+ /**
 1123+ * Handles any setup that has to be done once the markup is in the
 1124+ * holder
 1125+ */
 1126+ afterBuild: function () {
 1127+ // Set a custom message
 1128+ $.articleFeedbackv5.$holder
 1129+ .add( $.articleFeedbackv5.$dialog)
 1130+ .find( '.articleFeedbackv5-tooltip-info' )
 1131+ .text( mw.msg( 'articlefeedbackv5-bucket4-help-tooltip-info' ) );
11171132 }
11181133
11191134 // }}}
@@ -1490,6 +1505,20 @@
14911506 },
14921507
14931508 // }}}
 1509+ // {{{ afterBuild
 1510+
 1511+ /**
 1512+ * Handles any setup that has to be done once the markup is in the
 1513+ * holder
 1514+ */
 1515+ afterBuild: function () {
 1516+ // Drop the tooltip and trigger
 1517+ $.articleFeedbackv5.$holder
 1518+ .add( $.articleFeedbackv5.$dialog)
 1519+ .find( '.articleFeedbackv5-tooltip-trigger' ).hide();
 1520+ },
 1521+
 1522+ // }}}
14941523 // {{{ updateRating
14951524
14961525 /**
@@ -2056,15 +2085,10 @@
20572086 $wrapper.find( '.articleFeedbackv5-tooltip-link' )
20582087 .attr( 'href', mw.msg( 'articlefeedbackv5-help-tooltip-linkurl' ) );
20592088 $wrapper.find( '.articleFeedbackv5-tooltip' ).hide();
 2089+ $wrapper.find( '.articleFeedbackv5-tooltip-trigger' ).click( function () {
 2090+ $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-tooltip' ).toggle();
 2091+ } );
20602092
2061 - if ( $.articleFeedbackv5.bucketId == 5 ) {
2062 - $wrapper.find( '.articleFeedbackv5-tooltip-trigger' ).hide();
2063 - } else {
2064 - $wrapper.find( '.articleFeedbackv5-tooltip-trigger' ).click( function () {
2065 - $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-tooltip' ).toggle();
2066 - } );
2067 - }
2068 -
20692093 $wrapper.find( '.articleFeedbackv5-tooltip-close' ).click( function () {
20702094 $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-tooltip' ).toggle();
20712095 } );
Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php
@@ -83,6 +83,7 @@
8484 'articlefeedbackv5-bucket4-teaser-line2',
8585 'articlefeedbackv5-bucket4-learn-to-edit',
8686 'articlefeedbackv5-bucket4-form-submit',
 87+ 'articlefeedbackv5-bucket4-help-tooltip-info',
8788 'articlefeedbackv5-bucket5-form-switch-label',
8889 'articlefeedbackv5-bucket5-form-panel-title',
8990 'articlefeedbackv5-bucket5-form-panel-explanation',

Status & tagging log