Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js |
— | — | @@ -131,15 +131,24 @@ |
132 | 132 | $.articleFeedbackv5.selectedLinks = []; |
133 | 133 | |
134 | 134 | /** |
135 | | - * The link ID indicates where the user clicked (or not) to get to the |
136 | | - * feedback form. Options are "-" or A-H |
| 135 | + * The floating link ID indicates the trigger link chosen to be added to the |
| 136 | + * page, in addition to the toolbox link. Options are "X" or A-H. |
137 | 137 | * |
138 | 138 | * @see $wgArticleFeedbackv5LinkBuckets |
139 | 139 | * @see http://www.mediawiki.org/wiki/Article_feedback/Version_5/Feature_Requirements#Feedback_links_on_article_pages |
140 | 140 | */ |
141 | | - $.articleFeedbackv5.linkId = '-'; |
| 141 | + $.articleFeedbackv5.floatingLinkId = 'X'; |
142 | 142 | |
143 | 143 | /** |
| 144 | + * The submitted link ID indicates where the user clicked (or not) to get to |
| 145 | + * the feedback form. Options are "X" or A-H |
| 146 | + * |
| 147 | + * @see $wgArticleFeedbackv5LinkBuckets |
| 148 | + * @see http://www.mediawiki.org/wiki/Article_feedback/Version_5/Feature_Requirements#Feedback_links_on_article_pages |
| 149 | + */ |
| 150 | + $.articleFeedbackv5.submittedLinkId = 'X'; |
| 151 | + |
| 152 | + /** |
144 | 153 | * Use the mediawiki util resource's config method to find the correct url to |
145 | 154 | * call for all ajax requests. |
146 | 155 | */ |
— | — | @@ -2823,13 +2832,13 @@ |
2824 | 2833 | // 1. Display buckets 0 or 5? Always no link. |
2825 | 2834 | // 2. Requested in query string (debug only) |
2826 | 2835 | // 3. Random bucketing |
2827 | | - var bucketedLink = '-'; |
| 2836 | + var bucketedLink = 'X'; |
2828 | 2837 | if ( '5' != $.articleFeedbackv5.bucketId && '0' != $.articleFeedbackv5.bucketId ) { |
2829 | 2838 | var cfg = mw.config.get( 'wgArticleFeedbackv5LinkBuckets' ); |
2830 | 2839 | if ( 'buckets' in cfg ) { |
2831 | 2840 | var knownBuckets = cfg.buckets; |
2832 | 2841 | var requested = mw.util.getParamValue( 'aftv5_link' ); |
2833 | | - if ( $.articleFeedbackv5.inDebug() && requested in knownBuckets ) { |
| 2842 | + if ( $.articleFeedbackv5.inDebug() && ( requested in knownBuckets || requested == 'X' ) ) { |
2834 | 2843 | bucketedLink = requested; |
2835 | 2844 | } else { |
2836 | 2845 | bucketedLink = mw.user.bucket( 'ext.articleFeedbackv5-links', cfg ); |
— | — | @@ -2839,7 +2848,8 @@ |
2840 | 2849 | if ( $.articleFeedbackv5.inDebug() ) { |
2841 | 2850 | aft5_debug( 'Using link option ' + bucketedLink ); |
2842 | 2851 | } |
2843 | | - if ('-' != bucketedLink) { |
| 2852 | + $.articleFeedbackv5.floatingLinkId = bucketedLink; |
| 2853 | + if ('X' != bucketedLink) { |
2844 | 2854 | $.articleFeedbackv5.selectedLinks.push(bucketedLink); |
2845 | 2855 | } |
2846 | 2856 | // Always add the toolbox link |
— | — | @@ -3056,7 +3066,7 @@ |
3057 | 3067 | params.articleFeedbackv5_ct_token = $.cookie( 'clicktracking-session' ); |
3058 | 3068 | params.articleFeedbackv5_bucket_id = $.articleFeedbackv5.bucketId; |
3059 | 3069 | params.articleFeedbackv5_cta_id = $.articleFeedbackv5.ctaId; |
3060 | | - params.articleFeedbackv5_link_id = $.articleFeedbackv5.linkId; |
| 3070 | + params.articleFeedbackv5_link_id = $.articleFeedbackv5.submittedLinkId; |
3061 | 3071 | params.articleFeedbackv5_location = $.articleFeedbackv5.inDialog ? 'overlay' : 'bottom'; |
3062 | 3072 | } |
3063 | 3073 | var url = mw.config.get( 'wgScript' ) + '?' + $.param( params ); |
— | — | @@ -3276,7 +3286,7 @@ |
3277 | 3287 | 'pageid': $.articleFeedbackv5.pageId, |
3278 | 3288 | 'revid': $.articleFeedbackv5.revisionId, |
3279 | 3289 | 'bucket': $.articleFeedbackv5.bucketId, |
3280 | | - 'link': $.articleFeedbackv5.linkId |
| 3290 | + 'link': $.articleFeedbackv5.submittedLinkId |
3281 | 3291 | } ); |
3282 | 3292 | |
3283 | 3293 | // Send off the ajax request |
Index: trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php |
— | — | @@ -597,7 +597,7 @@ |
598 | 598 | $revId = $title->getLatestRevID(); |
599 | 599 | } |
600 | 600 | |
601 | | - // Find the link ID using the order of the link buckets ('-' = 0, 'A' = 1, |
| 601 | + // Find the link ID using the order of the link buckets ('X' = 0, 'A' = 1, |
602 | 602 | // 'B' = 2, etc.) |
603 | 603 | $links = array_flip( array_keys( $wgArticleFeedbackv5LinkBuckets['buckets'] ) ); |
604 | 604 | $linkId = isset( $links[$linkName] ) ? $links[$linkName] : 0; |