r105898 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105897‎ | r105898 | r105899 >
Date:16:18, 12 December 2011
Author:rsterbin
Status:ok
Tags:
Comment:
Added Learn More CTA:
- ArticleFeedbackv5.i18n.php:
- Changed 'articlefeedbackv5-cta1-thanks' to
'articlefeedbackv5-cta-thanks'
- Changed 'articlefeedbackv5-cta1-confirmation-followup' to
'articlefeedbackv5-cta-confirmation-followup'
- Added 'articlefeedbackv5-cta2-confirmation-title',
'articlefeedbackv5-cta2-confirmation-call', and
'articlefeedbackv5-cta2-button-text'
- Added CTA messages to documentation
- modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.css:
- Changed class name of edit-cta-link to cta-button
- Updated specialized positioning for cta titles so that it applies to
CTAs 0 and 2 as well
- Adjusted position of button for CTA 2
- modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js:
- Added "Learn More" CTA as #2
- Renamed class articleFeedbackv5-edit-cta-link to
articleFeedbackv5-cta-button
- Renamed classes and messages for the confirmation message so that
they're not just CTA 1 only
- Updated selectCTA() to choose CTA 2 if CTA 1 was requested but
invalid
- ArticleFeedbackv5.hooks.php
- Updated messages sent to modules
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.css (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php
@@ -9,13 +9,16 @@
1010 */
1111 $messages['en'] = array(
1212 // CTA translations
13 - 'articlefeedbackv5-cta1-thanks' => 'Thanks!',
14 - 'articlefeedbackv5-cta1-confirmation-followup' => 'Your feedback has been saved.',
 13+ 'articlefeedbackv5-cta-thanks' => 'Thanks!',
 14+ 'articlefeedbackv5-cta-confirmation-followup' => 'Your feedback has been saved.',
1515 'articlefeedbackv5-cta1-confirmation-title' => 'Did you know that you can edit this page?',
1616 'articlefeedbackv5-cta1-confirmation-call' => 'Wikipedia works because anyone can edit its articles. Go ahead, give it a try. Be bold!',
1717 'articlefeedbackv5-cta1-learn-how' => 'Learn how to edit',
1818 'articlefeedbackv5-cta1-learn-how-url' => 'http://en.wikipedia.org/wiki/Wikipedia:Tutorial',
1919 'articlefeedbackv5-cta1-edit-linktext' => 'Edit this page',
 20+ 'articlefeedbackv5-cta2-confirmation-title' => 'Help improve Wikipedia',
 21+ 'articlefeedbackv5-cta2-confirmation-call' => 'This encyclopedia is created by people like you. Can you give us a hand?',
 22+ 'articlefeedbackv5-cta2-button-text' => 'Learn more',
2023
2124 // error messages
2225 'articlefeedbackv5-error' => 'An error has occured. Please try again later.',
@@ -270,6 +273,18 @@
271274 Please visit http://prototype.wikimedia.org/articleassess/Main_Page for a prototype installation.',
272275 'articlefeedbackv5-desc' => '{{desc}}',
273276
 277+ /* CTAs */
 278+ 'articlefeedbackv5-cta-thanks' => 'The bolded part of the message that appears at the top of every CTA',
 279+ 'articlefeedbackv5-cta-confirmation-followup' => 'The non-bolded part of the message that appears at the top of every CTA',
 280+ 'articlefeedbackv5-cta1-confirmation-title' => 'The title of the edit CTA',
 281+ 'articlefeedbackv5-cta1-confirmation-call' => 'The text of the edit CTA',
 282+ 'articlefeedbackv5-cta1-learn-how' => 'The link below the text on the edit CTA, pointing to the edit tutorial',
 283+ 'articlefeedbackv5-cta1-learn-how-url' => 'The link to the edit tutorial',
 284+ 'articlefeedbackv5-cta1-edit-linktext' => 'The explanatory text for the button on the edit CTA',
 285+ 'articlefeedbackv5-cta2-confirmation-title' => 'The title of the learn more CTA',
 286+ 'articlefeedbackv5-cta2-confirmation-call' => 'The explanatory text of the learn more CTA',
 287+ 'articlefeedbackv5-cta2-button-text' => 'The text for the button on the learn more CTA',
 288+
274289 /* Feedback forms */
275290 /* Option 1 ("Did you find what you were looking for?") */
276291 'articlefeedbackv5-bucket1-title' => 'This is the title of the feedback form for option 1 ("Did you find what you were looking for?" with yes/no buttons, plus a comment box)',
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.css
@@ -650,7 +650,7 @@
651651 box-shadow: -2px 2px 1px #999;
652652 }
653653
654 -.articleFeedbackv5-ui .articleFeedbackv5-edit-cta-link {
 654+.articleFeedbackv5-ui .articleFeedbackv5-cta-button {
655655 float: right;
656656 position: relative;
657657 bottom: 10px;
@@ -871,7 +871,7 @@
872872 .articleFeedbackv5-confirmation-panel .articleFeedbackv5-panel-leftContent .articleFeedbackv5-confirmation-learnHow {
873873 font-weight: bold;
874874 }
875 -.articleFeedbackv5-ui .articleFeedbackv5-edit-cta-link {
 875+.articleFeedbackv5-ui .articleFeedbackv5-cta-button {
876876 float: left;
877877 height: 35px !important;
878878 width: auto;
@@ -890,14 +890,14 @@
891891 box-shadow: -2px 2px 1px #999;
892892 }
893893 /*.articleFeedbackv5-option-4 .articleFeedbackv5-submit,*/
894 -.articleFeedbackv5-ui .articleFeedbackv5-edit-cta-link {
 894+.articleFeedbackv5-ui .articleFeedbackv5-cta-button {
895895 float: right;
896896 position: relative;
897897 bottom: 10px;
898898 margin: 105px 0 0 !important;
899899 }
900900
901 -.articleFeedbackv5-ui .articleFeedbackv5-edit-cta-link span{
 901+.articleFeedbackv5-ui .articleFeedbackv5-cta-button span {
902902 font-size: 14px;
903903 font-weight: bold;
904904 display: inline-block;
@@ -967,12 +967,19 @@
968968 text-decoration: none;
969969 }
970970
971 -.articleFeedbackv5-cta-1 .articleFeedbackv5-tooltip {
 971+.articleFeedbackv5-cta-0 .articleFeedbackv5-tooltip,
 972+.articleFeedbackv5-cta-1 .articleFeedbackv5-tooltip,
 973+.articleFeedbackv5-cta-2 .articleFeedbackv5-tooltip {
972974 top: -405px;
973975 right: -68px;
974976 }
975977
976 -.articleFeedbackv5-panel .articleFeedbackv5-cta-1 h2.articleFeedbackv5-title {
 978+.articleFeedbackv5-panel .articleFeedbackv5-cta-0 h2.articleFeedbackv5-title,
 979+.articleFeedbackv5-panel .articleFeedbackv5-cta-1 h2.articleFeedbackv5-title,
 980+.articleFeedbackv5-panel .articleFeedbackv5-cta-2 h2.articleFeedbackv5-title {
977981 font-weight: normal;
978982 }
979983
 984+.articleFeedbackv5-panel .articleFeedbackv5-cta-2 .articleFeedbackv5-cta-button {
 985+ margin-top: 50px !important;
 986+}
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js
@@ -193,8 +193,8 @@
194194
195195 ctaTitleConfirm: '\
196196 <div class="articleFeedbackv5-confirmation-text">\
197 - <span class="articleFeedbackv5-confirmation-thanks"><html:msg key="cta1-thanks" /></span>\
198 - <span class="articleFeedbackv5-confirmation-follow-up"><html:msg key="cta1-confirmation-followup" /></span>\
 197+ <span class="articleFeedbackv5-confirmation-thanks"><html:msg key="cta-thanks" /></span>\
 198+ <span class="articleFeedbackv5-confirmation-follow-up"><html:msg key="cta-confirmation-followup" /></span>\
199199 </div>\
200200 ',
201201
@@ -1851,7 +1851,7 @@
18521852 <p class="articleFeedbackv5-confirmation-wikipediaWorks"><html:msg key="cta1-confirmation-call" /></p>\
18531853 <p class="articleFeedbackv5-confirmation-learnHow"><a target="_blank" href="#"><html:msg key="cta1-learn-how" /> &raquo;</a></p>\
18541854 </div>\
1855 - <a href="&amp;action=edit" class="articleFeedbackv5-edit-cta-link"><span class="ui-button-text"><html:msg key="cta1-edit-linktext" /></span></a>\
 1855+ <a href="&amp;action=edit" class="articleFeedbackv5-cta-button"><span class="ui-button-text"><html:msg key="cta1-edit-linktext" /></span></a>\
18561856 <div class="clear"></div>\
18571857 </div>\
18581858 '
@@ -1916,6 +1916,59 @@
19171917
19181918 // }}}
19191919
 1920+ },
 1921+
 1922+ // }}}
 1923+ // {{{ CTA 2: Learn more
 1924+
 1925+ '2': {
 1926+
 1927+ // {{{ templates
 1928+
 1929+ /**
 1930+ * Pull out the markup so it's easy to find
 1931+ */
 1932+ templates: {
 1933+
 1934+ /**
 1935+ * The template for the whole block
 1936+ */
 1937+ block: '\
 1938+ <div class="clear"></div>\
 1939+ <div class="articleFeedbackv5-confirmation-panel">\
 1940+ <div class="articleFeedbackv5-panel-leftContent">\
 1941+ <h3 class="articleFeedbackv5-confirmation-title"><html:msg key="cta2-confirmation-title" /></h3>\
 1942+ <p class="articleFeedbackv5-confirmation-wikipediaWorks"><html:msg key="cta2-confirmation-call" /></p>\
 1943+ </div>\
 1944+ <a href="&amp;action=edit" class="articleFeedbackv5-cta-button"><span class="ui-button-text"><html:msg key="cta2-button-text" /></span></a>\
 1945+ <div class="clear"></div>\
 1946+ </div>\
 1947+ '
 1948+
 1949+ },
 1950+
 1951+ // }}}
 1952+ // {{{ build
 1953+
 1954+ /**
 1955+ * Builds the CTA
 1956+ *
 1957+ * @return Element the form
 1958+ */
 1959+ build: function () {
 1960+
 1961+ // Start up the block to return
 1962+ var $block = $( $.articleFeedbackv5.currentCTA().templates.block );
 1963+
 1964+ // Fill in the button link
 1965+ $block.find( '.articleFeedbackv5-cta-button' )
 1966+ .attr( 'href', mw.msg( 'articlefeedbackv5-cta1-learn-how-url' ) );
 1967+
 1968+ return $block;
 1969+ }
 1970+
 1971+ // }}}
 1972+
19201973 }
19211974
19221975 // }}}
@@ -2349,7 +2402,6 @@
23502403 && 'cta_id' in data.articlefeedbackv5 ) {
23512404 $.articleFeedbackv5.feedbackId = data.articlefeedbackv5.feedback_id;
23522405 $.articleFeedbackv5.selectCTA( data.articlefeedbackv5.cta_id );
2353 - $.articleFeedbackv5.ctaId = data.articlefeedbackv5.cta_id;
23542406 $.articleFeedbackv5.unlockForm();
23552407 $.articleFeedbackv5.showCTA();
23562408 // Drop a cookie for a successful submit
@@ -2400,7 +2452,7 @@
24012453 temp = $.articleFeedbackv5.ctas[requested];
24022454 if ( 'verify' in temp ) {
24032455 if ( !temp.verify() ) {
2404 - requested = '0';
 2456+ requested = requested == '1' ? '2' : '0';
24052457 }
24062458 }
24072459 $.articleFeedbackv5.ctaId = requested;
Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php
@@ -54,13 +54,16 @@
5555 'articlefeedbackv5-error-nofeedback',
5656 'articlefeedbackv5-error-unknown',
5757 'articlefeedbackv5-error-submit',
58 - 'articlefeedbackv5-cta1-thanks',
59 - 'articlefeedbackv5-cta1-confirmation-followup',
 58+ 'articlefeedbackv5-cta-thanks',
 59+ 'articlefeedbackv5-cta-confirmation-followup',
6060 'articlefeedbackv5-cta1-confirmation-title',
6161 'articlefeedbackv5-cta1-confirmation-call',
6262 'articlefeedbackv5-cta1-learn-how',
6363 'articlefeedbackv5-cta1-learn-how-url',
6464 'articlefeedbackv5-cta1-edit-linktext',
 65+ 'articlefeedbackv5-cta2-confirmation-title',
 66+ 'articlefeedbackv5-cta2-confirmation-call',
 67+ 'articlefeedbackv5-cta2-button-text',
6568 'articlefeedbackv5-bucket1-title',
6669 'articlefeedbackv5-bucket1-question-toggle',
6770 'articlefeedbackv5-bucket1-toggle-found-yes',

Status & tagging log