Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php |
— | — | @@ -28,6 +28,9 @@ |
29 | 29 | 'articlefeedbackv5-cta2-confirmation-title' => 'Help improve Wikipedia', |
30 | 30 | 'articlefeedbackv5-cta2-confirmation-call' => 'This website is created by people like you. Can you give us a hand?', |
31 | 31 | 'articlefeedbackv5-cta2-button-text' => 'Learn more', |
| 32 | + 'articlefeedbackv5-cta3-confirmation-title' => 'Please take a quick survey', |
| 33 | + 'articlefeedbackv5-cta3-confirmation-call' => 'It only takes a minute and will help improve Wikipedia.', |
| 34 | + 'articlefeedbackv5-cta3-button-text' => 'Start the survey', |
32 | 35 | |
33 | 36 | // error messages |
34 | 37 | 'articlefeedbackv5-error' => 'An error has occured. Please try again later.', |
— | — | @@ -323,6 +326,9 @@ |
324 | 327 | 'articlefeedbackv5-cta2-confirmation-title' => 'The title of the learn more CTA', |
325 | 328 | 'articlefeedbackv5-cta2-confirmation-call' => 'The explanatory text of the learn more CTA', |
326 | 329 | 'articlefeedbackv5-cta2-button-text' => 'The text for the button on the learn more CTA', |
| 330 | + 'articlefeedbackv5-cta3-confirmation-title' => 'The title of the survey CTA', |
| 331 | + 'articlefeedbackv5-cta3-confirmation-call' => 'The explanatory text of the survey CTA', |
| 332 | + 'articlefeedbackv5-cta3-button-text' => 'The text for the button on the survey CTA', |
327 | 333 | 'articlefeedbackv5-error' => 'This error message will be displayed in a grey box replacing the form if there was an unrecoverable error.', |
328 | 334 | 'articlefeedbackv5-error-blocked' => 'This error message will be displayed on the form if the user is blocked from submitting feedback.', |
329 | 335 | 'articlefeedbackv5-error-abuse' => 'This error message will be displayed above the form if the comment matched the spam or abuse filters. $1 is the link to the abuse policy.', |
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.css |
— | — | @@ -1018,6 +1018,11 @@ |
1019 | 1019 | margin-top: 50px !important; |
1020 | 1020 | } |
1021 | 1021 | |
| 1022 | +.articleFeedbackv5-ui.articleFeedbackv5-cta-3 .articleFeedbackv5-cta-button { |
| 1023 | + margin-top: 50px !important; |
| 1024 | +} |
| 1025 | + |
| 1026 | + |
1022 | 1027 | /* Skin-specific styles */ |
1023 | 1028 | body.skin-vector .articleFeedbackv5-dialog.ui-dialog .ui-dialog-content a, |
1024 | 1029 | body.skin-monobook .articleFeedbackv5-dialog.ui-dialog .ui-dialog-content a { |
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js |
— | — | @@ -1993,10 +1993,110 @@ |
1994 | 1994 | |
1995 | 1995 | // }}} |
1996 | 1996 | |
1997 | | - } |
| 1997 | + }, |
1998 | 1998 | |
1999 | 1999 | // }}} |
| 2000 | + // {{{ CTA 3: Take a survey |
2000 | 2001 | |
| 2002 | + '3': { |
| 2003 | + |
| 2004 | + // {{{ templates |
| 2005 | + |
| 2006 | + /** |
| 2007 | + * Pull out the markup so it's easy to find |
| 2008 | + */ |
| 2009 | + templates: { |
| 2010 | + |
| 2011 | + /** |
| 2012 | + * The template for the whole block |
| 2013 | + */ |
| 2014 | + block: '\ |
| 2015 | + <div class="clear"></div>\ |
| 2016 | + <div class="articleFeedbackv5-confirmation-panel">\ |
| 2017 | + <div class="articleFeedbackv5-panel-leftContent">\ |
| 2018 | + <h3 class="articleFeedbackv5-confirmation-title"><html:msg key="cta3-confirmation-title" /></h3>\ |
| 2019 | + <p class="articleFeedbackv5-confirmation-call"><html:msg key="cta3-confirmation-call" /></p>\ |
| 2020 | + </div>\ |
| 2021 | + <a href="#" class="articleFeedbackv5-cta-button" target="_blank"><span class="ui-button-text"><html:msg key="cta3-button-text" /></span></a>\ |
| 2022 | + <div class="clear"></div>\ |
| 2023 | + </div>\ |
| 2024 | + ' |
| 2025 | + |
| 2026 | + }, |
| 2027 | + |
| 2028 | + // }}} |
| 2029 | + // {{{ build |
| 2030 | + |
| 2031 | + /** |
| 2032 | + * Builds the CTA |
| 2033 | + * |
| 2034 | + * @return Element the form |
| 2035 | + */ |
| 2036 | + build: function () { |
| 2037 | + |
| 2038 | + // Start up the block to return |
| 2039 | + var $block = $( $.articleFeedbackv5.currentCTA().templates.block ); |
| 2040 | + |
| 2041 | + // Fill in the go-to-survey link |
| 2042 | + var survey_track_id = $.articleFeedbackv5.bucketName() + '-' + |
| 2043 | + $.articleFeedbackv5.ctaName() + '-button_click-' + |
| 2044 | + ( $.articleFeedbackv5.inDialog ? 'overlay': 'bottom' ); |
| 2045 | + $block.find( '.articleFeedbackv5-cta-button' ) |
| 2046 | + .attr( 'href', $.articleFeedbackv5.trackingUrl( |
| 2047 | + mw.config.get( 'wgArticleFeedbackv5SurveyUrl' ) + |
| 2048 | + '?c=' + $.articleFeedbackv5.bucketId + |
| 2049 | + '&f=' + $.articleFeedbackv5.feedbackId, |
| 2050 | + survey_track_id |
| 2051 | + ) ); |
| 2052 | + |
| 2053 | + return $block; |
| 2054 | + }, |
| 2055 | + |
| 2056 | + // }}} |
| 2057 | + // {{{ bindEvents |
| 2058 | + |
| 2059 | + /** |
| 2060 | + * Binds any events |
| 2061 | + * |
| 2062 | + * @param $block element the form block |
| 2063 | + */ |
| 2064 | + bindEvents: function ( $block ) { |
| 2065 | + |
| 2066 | + // Make the link work as a popup |
| 2067 | + $block.find( '.articleFeedbackv5-cta-button' ) |
| 2068 | + .click( function ( e ) { |
| 2069 | + e.preventDefault(); |
| 2070 | + var link = $( this ).attr( 'href' ); |
| 2071 | + var params = 'status=0,\ |
| 2072 | + toolbar=0,\ |
| 2073 | + location=0,\ |
| 2074 | + menubar=0,\ |
| 2075 | + directories=0,\ |
| 2076 | + resizable=1,\ |
| 2077 | + scrollbars=1,\ |
| 2078 | + height=600,\ |
| 2079 | + width=800'; |
| 2080 | + var survey = window.open( link, 'survey', params ); |
| 2081 | + } ); |
| 2082 | + |
| 2083 | + }, |
| 2084 | + |
| 2085 | + // }}} |
| 2086 | + // {{{ afterBuild |
| 2087 | + |
| 2088 | + /** |
| 2089 | + * Perform adjustments after build |
| 2090 | + */ |
| 2091 | + afterBuild: function() { |
| 2092 | + $( '.articleFeedbackv5-tooltip-trigger' ).remove(); |
| 2093 | + } |
| 2094 | + |
| 2095 | + // }}} |
| 2096 | + |
| 2097 | + }, |
| 2098 | + |
| 2099 | + // }}} |
| 2100 | + |
2001 | 2101 | }; |
2002 | 2102 | |
2003 | 2103 | // }}} |
— | — | @@ -2282,6 +2382,8 @@ |
2283 | 2383 | return 'cta_edit'; |
2284 | 2384 | } else if ( '2' == $.articleFeedbackv5.ctaId ) { |
2285 | 2385 | return 'cta_learn_more'; |
| 2386 | + } else if ( '3' == $.articleFeedbackv5.ctaId ) { |
| 2387 | + return 'cta_survey'; |
2286 | 2388 | } else { |
2287 | 2389 | return 'cta_unknown'; |
2288 | 2390 | } |
Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.php |
— | — | @@ -185,6 +185,13 @@ |
186 | 186 | */ |
187 | 187 | $wgArticleFeedbackv5LearnToEdit = "//en.wikipedia.org/wiki/Wikipedia:Tutorial"; |
188 | 188 | |
| 189 | +/** |
| 190 | + * The full URL for the survey link |
| 191 | + * |
| 192 | + * @var string |
| 193 | + */ |
| 194 | +$wgArticleFeedbackv5SurveyUrl = "https://www.surveymonkey.com/s/aft5"; |
| 195 | + |
189 | 196 | // Would ordinarily call this articlefeedback but survey names are 16 chars max |
190 | 197 | $wgPrefSwitchSurveys['articlerating'] = array( |
191 | 198 | 'updatable' => false, |
Index: trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php |
— | — | @@ -682,7 +682,7 @@ |
683 | 683 | * @return int the cta id |
684 | 684 | */ |
685 | 685 | public function getCTAId( $answers, $bucket ) { |
686 | | - return 1; # Hard-code this for now. |
| 686 | + return 3; # Hard-code this for now. |
687 | 687 | } |
688 | 688 | |
689 | 689 | /** |
Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php |
— | — | @@ -75,6 +75,9 @@ |
76 | 76 | 'articlefeedbackv5-cta2-confirmation-title', |
77 | 77 | 'articlefeedbackv5-cta2-confirmation-call', |
78 | 78 | 'articlefeedbackv5-cta2-button-text', |
| 79 | + 'articlefeedbackv5-cta3-confirmation-title', |
| 80 | + 'articlefeedbackv5-cta3-confirmation-call', |
| 81 | + 'articlefeedbackv5-cta3-button-text', |
79 | 82 | 'articlefeedbackv5-bucket1-title', |
80 | 83 | 'articlefeedbackv5-bucket1-question-toggle', |
81 | 84 | 'articlefeedbackv5-bucket1-toggle-found-yes', |
— | — | @@ -265,7 +268,8 @@ |
266 | 269 | $wgArticleFeedbackv5Options, |
267 | 270 | $wgArticleFeedbackv5LinkBuckets, |
268 | 271 | $wgArticleFeedbackv5Namespaces, |
269 | | - $wgArticleFeedbackv5LearnToEdit; |
| 272 | + $wgArticleFeedbackv5LearnToEdit, |
| 273 | + $wgArticleFeedbackv5SurveyUrl; |
270 | 274 | $vars['wgArticleFeedbackv5SMaxage'] = $wgArticleFeedbackv5SMaxage; |
271 | 275 | $vars['wgArticleFeedbackv5Categories'] = $wgArticleFeedbackv5Categories; |
272 | 276 | $vars['wgArticleFeedbackv5BlacklistCategories'] = $wgArticleFeedbackv5BlacklistCategories; |
— | — | @@ -281,6 +285,7 @@ |
282 | 286 | $vars['wgArticleFeedbackv5LearnToEdit'] = $wgArticleFeedbackv5LearnToEdit; |
283 | 287 | $vars['wgArticleFeedbackv5WhatsThisPage'] = wfMsgForContent( 'articlefeedbackv5-bucket5-form-panel-explanation-link' ); |
284 | 288 | $vars['wgArticleFeedbackv5TermsPage'] = wfMsgForContent( 'articlefeedbackv5-transparency-terms-url' ); |
| 289 | + $vars['wgArticleFeedbackv5SurveyUrl'] = $wgArticleFeedbackv5SurveyUrl; |
285 | 290 | return true; |
286 | 291 | } |
287 | 292 | |