https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114165
Revision: 114165 Author: rsterbin Date: 2012-03-19 18:41:29 +0000 (Mon, 19 Mar 2012) Log Message: ----------- Name the no-link option X rather than -, and keep track of the link ID optionally added to the page (floatingLinkId) Modified Paths: -------------- trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js Modified: trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php =================================================================== --- trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php 2012-03-19 18:40:54 UTC (rev 114164) +++ trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php 2012-03-19 18:41:29 UTC (rev 114165) @@ -597,7 +597,7 @@ $revId = $title->getLatestRevID(); } - // Find the link ID using the order of the link buckets ('-' = 0, 'A' = 1, + // Find the link ID using the order of the link buckets ('X' = 0, 'A' = 1, // 'B' = 2, etc.) $links = array_flip( array_keys( $wgArticleFeedbackv5LinkBuckets['buckets'] ) ); $linkId = isset( $links[$linkName] ) ? $links[$linkName] : 0; Modified: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js =================================================================== --- trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js 2012-03-19 18:40:54 UTC (rev 114164) +++ trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js 2012-03-19 18:41:29 UTC (rev 114165) @@ -131,15 +131,24 @@ $.articleFeedbackv5.selectedLinks = []; /** - * The link ID indicates where the user clicked (or not) to get to the - * feedback form. Options are "-" or A-H + * The floating link ID indicates the trigger link chosen to be added to the + * page, in addition to the toolbox link. Options are "X" or A-H. * * @see $wgArticleFeedbackv5LinkBuckets * @see http://www.mediawiki.org/wiki/Article_feedback/Version_5/Feature_Requirements#Feedback_links_on_article_pages */ - $.articleFeedbackv5.linkId = '-'; + $.articleFeedbackv5.floatingLinkId = 'X'; /** + * The submitted link ID indicates where the user clicked (or not) to get to + * the feedback form. Options are "X" or A-H + * + * @see $wgArticleFeedbackv5LinkBuckets + * @see http://www.mediawiki.org/wiki/Article_feedback/Version_5/Feature_Requirements#Feedback_links_on_article_pages + */ + $.articleFeedbackv5.submittedLinkId = 'X'; + + /** * Use the mediawiki util resource's config method to find the correct url to * call for all ajax requests. */ @@ -2823,13 +2832,13 @@ // 1. Display buckets 0 or 5? Always no link. // 2. Requested in query string (debug only) // 3. Random bucketing - var bucketedLink = '-'; + var bucketedLink = 'X'; if ( '5' != $.articleFeedbackv5.bucketId && '0' != $.articleFeedbackv5.bucketId ) { var cfg = mw.config.get( 'wgArticleFeedbackv5LinkBuckets' ); if ( 'buckets' in cfg ) { var knownBuckets = cfg.buckets; var requested = mw.util.getParamValue( 'aftv5_link' ); - if ( $.articleFeedbackv5.inDebug() && requested in knownBuckets ) { + if ( $.articleFeedbackv5.inDebug() && ( requested in knownBuckets || requested == 'X' ) ) { bucketedLink = requested; } else { bucketedLink = mw.user.bucket( 'ext.articleFeedbackv5-links', cfg ); @@ -2839,7 +2848,8 @@ if ( $.articleFeedbackv5.inDebug() ) { aft5_debug( 'Using link option ' + bucketedLink ); } - if ('-' != bucketedLink) { + $.articleFeedbackv5.floatingLinkId = bucketedLink; + if ('X' != bucketedLink) { $.articleFeedbackv5.selectedLinks.push(bucketedLink); } // Always add the toolbox link @@ -3056,7 +3066,7 @@ params.articleFeedbackv5_ct_token = $.cookie( 'clicktracking-session' ); params.articleFeedbackv5_bucket_id = $.articleFeedbackv5.bucketId; params.articleFeedbackv5_cta_id = $.articleFeedbackv5.ctaId; - params.articleFeedbackv5_link_id = $.articleFeedbackv5.linkId; + params.articleFeedbackv5_link_id = $.articleFeedbackv5.submittedLinkId; params.articleFeedbackv5_location = $.articleFeedbackv5.inDialog ? 'overlay' : 'bottom'; } var url = mw.config.get( 'wgScript' ) + '?' + $.param( params ); @@ -3276,7 +3286,7 @@ 'pageid': $.articleFeedbackv5.pageId, 'revid': $.articleFeedbackv5.revisionId, 'bucket': $.articleFeedbackv5.bucketId, - 'link': $.articleFeedbackv5.linkId + 'link': $.articleFeedbackv5.submittedLinkId } ); // Send off the ajax request _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs