Index: branches/wmf/1.18wmf1/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.', |
— | — | @@ -302,6 +305,9 @@ |
303 | 306 | 'articlefeedbackv5-cta2-confirmation-title' => 'The title of the learn more CTA', |
304 | 307 | 'articlefeedbackv5-cta2-confirmation-call' => 'The explanatory text of the learn more CTA', |
305 | 308 | 'articlefeedbackv5-cta2-button-text' => 'The text for the button on the learn more CTA', |
| 309 | + 'articlefeedbackv5-cta3-confirmation-title' => 'The title of the survey CTA', |
| 310 | + 'articlefeedbackv5-cta3-confirmation-call' => 'The explanatory text of the survey CTA', |
| 311 | + 'articlefeedbackv5-cta3-button-text' => 'The text for the button on the survey CTA', |
306 | 312 | 'articlefeedbackv5-error' => 'This error message will be displayed in a grey box replacing the form if there was an unrecoverable error.', |
307 | 313 | 'articlefeedbackv5-error-nofeedback' => 'This error message will be displayed above the form (but below the title) if the user has attempted to submit a blank form.', |
308 | 314 | 'articlefeedbackv5-special-filter-all' => '{{Identical|All}}', |
Index: branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.css |
— | — | @@ -1013,6 +1013,11 @@ |
1014 | 1014 | margin-top: 50px !important; |
1015 | 1015 | } |
1016 | 1016 | |
| 1017 | +.articleFeedbackv5-ui.articleFeedbackv5-cta-3 .articleFeedbackv5-cta-button { |
| 1018 | + margin-top: 50px !important; |
| 1019 | +} |
| 1020 | + |
| 1021 | + |
1017 | 1022 | /* Skin-specific styles */ |
1018 | 1023 | body.skin-vector .articleFeedbackv5-dialog.ui-dialog .ui-dialog-content a, |
1019 | 1024 | body.skin-monobook .articleFeedbackv5-dialog.ui-dialog .ui-dialog-content a { |
Index: branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js |
— | — | @@ -1992,10 +1992,147 @@ |
1993 | 1993 | |
1994 | 1994 | // }}} |
1995 | 1995 | |
1996 | | - } |
| 1996 | + }, |
1997 | 1997 | |
1998 | 1998 | // }}} |
| 1999 | + // {{{ CTA 3: Take a survey |
1999 | 2000 | |
| 2001 | + '3': { |
| 2002 | + |
| 2003 | + // {{{ templates |
| 2004 | + |
| 2005 | + /** |
| 2006 | + * Pull out the markup so it's easy to find |
| 2007 | + */ |
| 2008 | + templates: { |
| 2009 | + |
| 2010 | + /** |
| 2011 | + * The template for the whole block |
| 2012 | + */ |
| 2013 | + block: '\ |
| 2014 | + <div class="clear"></div>\ |
| 2015 | + <div class="articleFeedbackv5-confirmation-panel">\ |
| 2016 | + <div class="articleFeedbackv5-panel-leftContent">\ |
| 2017 | + <h3 class="articleFeedbackv5-confirmation-title"><html:msg key="cta3-confirmation-title" /></h3>\ |
| 2018 | + <p class="articleFeedbackv5-confirmation-call"><html:msg key="cta3-confirmation-call" /></p>\ |
| 2019 | + </div>\ |
| 2020 | + <a href="#" class="articleFeedbackv5-cta-button" target="_blank"><span class="ui-button-text"><html:msg key="cta3-button-text" /></span></a>\ |
| 2021 | + <div class="clear"></div>\ |
| 2022 | + </div>\ |
| 2023 | + ' |
| 2024 | + |
| 2025 | + }, |
| 2026 | + |
| 2027 | + // }}} |
| 2028 | + // {{{ verify |
| 2029 | + |
| 2030 | + /** |
| 2031 | + * Verifies that this CTA can be displayed |
| 2032 | + * |
| 2033 | + * @return bool whether the CTA can be displayed |
| 2034 | + */ |
| 2035 | + verify: function () { |
| 2036 | + return $.articleFeedbackv5.ctas['3'].getSurveyUrl() !== false; |
| 2037 | + }, |
| 2038 | + |
| 2039 | + // }}} |
| 2040 | + // {{{ build |
| 2041 | + |
| 2042 | + /** |
| 2043 | + * Builds the CTA |
| 2044 | + * |
| 2045 | + * @return Element the form |
| 2046 | + */ |
| 2047 | + build: function () { |
| 2048 | + |
| 2049 | + // Start up the block to return |
| 2050 | + var $block = $( $.articleFeedbackv5.currentCTA().templates.block ); |
| 2051 | + |
| 2052 | + // Fill in the go-to-survey link |
| 2053 | + var survey_url = $.articleFeedbackv5.currentCTA().getSurveyUrl(); |
| 2054 | + if ( survey_url ) { |
| 2055 | + var survey_track_id = $.articleFeedbackv5.bucketName() + '-' + |
| 2056 | + $.articleFeedbackv5.ctaName() + '-button_click-' + |
| 2057 | + ( $.articleFeedbackv5.inDialog ? 'overlay': 'bottom' ); |
| 2058 | + $block.find( '.articleFeedbackv5-cta-button' ) |
| 2059 | + .attr( 'href', $.articleFeedbackv5.trackingUrl( |
| 2060 | + survey_url + '?c=' + $.articleFeedbackv5.feedbackId, |
| 2061 | + survey_track_id |
| 2062 | + ) ); |
| 2063 | + } |
| 2064 | + |
| 2065 | + return $block; |
| 2066 | + }, |
| 2067 | + |
| 2068 | + // }}} |
| 2069 | + // {{{ getSurveyUrl |
| 2070 | + |
| 2071 | + /** |
| 2072 | + * Gets the appropriate survey url, or returns false if none was |
| 2073 | + * found |
| 2074 | + * |
| 2075 | + * @return mixed the url, if one is availabe, or false if not |
| 2076 | + */ |
| 2077 | + getSurveyUrl: function () { |
| 2078 | + var base = mw.config.get( 'wgArticleFeedbackv5SurveyUrls' ); |
| 2079 | + aft5_debug( base ); |
| 2080 | + aft5_debug( $.articleFeedbackv5.bucketId ); |
| 2081 | + if ( typeof base != 'object' || !( $.articleFeedbackv5.bucketId in base ) ) { |
| 2082 | + return false; |
| 2083 | + } |
| 2084 | + return base[$.articleFeedbackv5.bucketId]; |
| 2085 | + }, |
| 2086 | + |
| 2087 | + // }}} |
| 2088 | + // {{{ bindEvents |
| 2089 | + |
| 2090 | + /** |
| 2091 | + * Binds any events |
| 2092 | + * |
| 2093 | + * @param $block element the form block |
| 2094 | + */ |
| 2095 | + bindEvents: function ( $block ) { |
| 2096 | + |
| 2097 | + // Make the link work as a popup |
| 2098 | + $block.find( '.articleFeedbackv5-cta-button' ) |
| 2099 | + .click( function ( e ) { |
| 2100 | + e.preventDefault(); |
| 2101 | + var link = $( this ).attr( 'href' ); |
| 2102 | + var params = 'status=0,\ |
| 2103 | + toolbar=0,\ |
| 2104 | + location=0,\ |
| 2105 | + menubar=0,\ |
| 2106 | + directories=0,\ |
| 2107 | + resizable=1,\ |
| 2108 | + scrollbars=1,\ |
| 2109 | + height=800,\ |
| 2110 | + width=600'; |
| 2111 | + var survey = window.open( link, 'survey', params ); |
| 2112 | + if ( $.articleFeedbackv5.inDialog ) { |
| 2113 | + $.articleFeedbackv5.closeAsModal(); |
| 2114 | + } else { |
| 2115 | + $.articleFeedbackv5.clear(); |
| 2116 | + } |
| 2117 | + } ); |
| 2118 | + |
| 2119 | + }, |
| 2120 | + |
| 2121 | + // }}} |
| 2122 | + // {{{ afterBuild |
| 2123 | + |
| 2124 | + /** |
| 2125 | + * Perform adjustments after build |
| 2126 | + */ |
| 2127 | + afterBuild: function() { |
| 2128 | + $( '.articleFeedbackv5-tooltip-trigger' ).remove(); |
| 2129 | + } |
| 2130 | + |
| 2131 | + // }}} |
| 2132 | + |
| 2133 | + }, |
| 2134 | + |
| 2135 | + // }}} |
| 2136 | + |
2000 | 2137 | }; |
2001 | 2138 | |
2002 | 2139 | // }}} |
— | — | @@ -2260,6 +2397,8 @@ |
2261 | 2398 | return 'cta_edit'; |
2262 | 2399 | } else if ( '2' == $.articleFeedbackv5.ctaId ) { |
2263 | 2400 | return 'cta_learn_more'; |
| 2401 | + } else if ( '3' == $.articleFeedbackv5.ctaId ) { |
| 2402 | + return 'cta_survey'; |
2264 | 2403 | } else { |
2265 | 2404 | return 'cta_unknown'; |
2266 | 2405 | } |
Index: branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5/ArticleFeedbackv5.php |
— | — | @@ -10,9 +10,6 @@ |
11 | 11 | * @version 0.1.0 |
12 | 12 | */ |
13 | 13 | |
14 | | -/* XXX: Survey setup */ |
15 | | -require_once( dirname( dirname( __FILE__ ) ) . '/SimpleSurvey/SimpleSurvey.php' ); |
16 | | - |
17 | 14 | /* Configuration */ |
18 | 15 | |
19 | 16 | // How long text-based feedback is allowed to be before returning an error. |
— | — | @@ -173,40 +170,16 @@ |
174 | 171 | */ |
175 | 172 | $wgArticleFeedbackv5LearnToEdit = "//en.wikipedia.org/wiki/Wikipedia:Tutorial"; |
176 | 173 | |
177 | | -// Would ordinarily call this articlefeedback but survey names are 16 chars max |
178 | | -$wgPrefSwitchSurveys['articlerating'] = array( |
179 | | - 'updatable' => false, |
180 | | - 'submit-msg' => 'articlefeedbackv5-survey-submit', |
181 | | - 'questions' => array( |
182 | | - 'origin' => array( |
183 | | - 'visibility' => 'hidden', |
184 | | - 'question' => 'articlefeedbackv5-survey-question-origin', |
185 | | - 'type' => 'text', |
186 | | - ), |
187 | | - 'whyrated' => array( |
188 | | - 'question' => 'articlefeedbackv5-survey-question-whyrated', |
189 | | - 'type' => 'checks', |
190 | | - 'answers' => array( |
191 | | - 'contribute-rating' => 'articlefeedbackv5-survey-answer-whyrated-contribute-rating', |
192 | | - 'development' => 'articlefeedbackv5-survey-answer-whyrated-development', |
193 | | - 'contribute-wiki' => 'articlefeedbackv5-survey-answer-whyrated-contribute-wiki', |
194 | | - 'sharing-opinion' => 'articlefeedbackv5-survey-answer-whyrated-sharing-opinion', |
195 | | - 'didntrate' => 'articlefeedbackv5-survey-answer-whyrated-didntrate', |
196 | | - ), |
197 | | - 'other' => 'articlefeedbackv5-survey-answer-whyrated-other', |
198 | | - ), |
199 | | - 'useful' => array( |
200 | | - 'question' => 'articlefeedbackv5-survey-question-useful', |
201 | | - 'type' => 'boolean', |
202 | | - 'iffalse' => 'articlefeedbackv5-survey-question-useful-iffalse', |
203 | | - ), |
204 | | - 'comments' => array( |
205 | | - 'question' => 'articlefeedbackv5-survey-question-comments', |
206 | | - 'type' => 'text', |
207 | | - ), |
208 | | - ), |
| 174 | +/** |
| 175 | + * The full URL for the survey link |
| 176 | + * |
| 177 | + * @var string |
| 178 | + */ |
| 179 | +$wgArticleFeedbackv5SurveyUrls = array( |
| 180 | + '1' => 'https://www.surveymonkey.com/s/aft5-1', |
| 181 | + '2' => 'https://www.surveymonkey.com/s/aft5-2', |
| 182 | + '3' => 'https://www.surveymonkey.com/s/aft5-3', |
209 | 183 | ); |
210 | | -$wgValidSurveys[] = 'articlerating'; |
211 | 184 | |
212 | 185 | // Replace default emailcapture message |
213 | 186 | $wgEmailCaptureAutoResponse['body-msg'] = 'articlefeedbackv5-emailcapture-response-body'; |
Index: branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php |
— | — | @@ -615,7 +615,7 @@ |
616 | 616 | * @return int the cta id |
617 | 617 | */ |
618 | 618 | public function getCTAId( $answers, $bucket ) { |
619 | | - return 1; # Hard-code this for now. |
| 619 | + return 3; # Hard-code this for now. |
620 | 620 | } |
621 | 621 | |
622 | 622 | /** |
Property changes on: branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
623 | 623 | Merged /trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php:r109875,109933,109943 |
Index: branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php |
— | — | @@ -71,6 +71,9 @@ |
72 | 72 | 'articlefeedbackv5-cta2-confirmation-title', |
73 | 73 | 'articlefeedbackv5-cta2-confirmation-call', |
74 | 74 | 'articlefeedbackv5-cta2-button-text', |
| 75 | + 'articlefeedbackv5-cta3-confirmation-title', |
| 76 | + 'articlefeedbackv5-cta3-confirmation-call', |
| 77 | + 'articlefeedbackv5-cta3-button-text', |
75 | 78 | 'articlefeedbackv5-bucket1-title', |
76 | 79 | 'articlefeedbackv5-bucket1-question-toggle', |
77 | 80 | 'articlefeedbackv5-bucket1-toggle-found-yes', |
— | — | @@ -255,7 +258,8 @@ |
256 | 259 | $wgArticleFeedbackv5Options, |
257 | 260 | $wgArticleFeedbackv5LinkBuckets, |
258 | 261 | $wgArticleFeedbackv5Namespaces, |
259 | | - $wgArticleFeedbackv5LearnToEdit; |
| 262 | + $wgArticleFeedbackv5LearnToEdit, |
| 263 | + $wgArticleFeedbackv5SurveyUrls; |
260 | 264 | $vars['wgArticleFeedbackv5SMaxage'] = $wgArticleFeedbackv5SMaxage; |
261 | 265 | $vars['wgArticleFeedbackv5Categories'] = $wgArticleFeedbackv5Categories; |
262 | 266 | $vars['wgArticleFeedbackv5BlacklistCategories'] = $wgArticleFeedbackv5BlacklistCategories; |
— | — | @@ -271,6 +275,7 @@ |
272 | 276 | $vars['wgArticleFeedbackv5LearnToEdit'] = $wgArticleFeedbackv5LearnToEdit; |
273 | 277 | $vars['wgArticleFeedbackv5WhatsThisPage'] = wfMsgForContent( 'articlefeedbackv5-bucket5-form-panel-explanation-link' ); |
274 | 278 | $vars['wgArticleFeedbackv5TermsPage'] = wfMsgForContent( 'articlefeedbackv5-transparency-terms-url' ); |
| 279 | + $vars['wgArticleFeedbackv5SurveyUrls'] = $wgArticleFeedbackv5SurveyUrls; |
275 | 280 | return true; |
276 | 281 | } |
277 | 282 | |
Property changes on: branches/wmf/1.18wmf1/extensions/ArticleFeedbackv5 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
278 | 283 | Merged /trunk/extensions/ArticleFeedbackv5:r109875,109933,109943 |