r110993 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110992‎ | r110993 | r110994 >
Date:00:27, 9 February 2012
Author:raindrift
Status:ok (Comments)
Tags:
Comment:
bucketing code changes the create link on the 404 page for 1% of users
Modified paths:
  • /trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.init/ext.articleCreation.init.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.init/ext.articleCreation.init.js
@@ -1,3 +1,17 @@
2 -(function($,mw) {
3 -
4 -})( jQuery, window.mediaWiki );
\ No newline at end of file
 2+(function($,mw) {
 3+ var bucket = mw.user.bucket( 'ACWInterstitialTest', {
 4+ 'buckets': { 'control': 99, 'test': 1 },
 5+ 'version': 1,
 6+ } );
 7+
 8+ if( bucket === 'test' ) {
 9+ // extract the path, article title, and query string as separate components.
 10+ var locationParts = location.href.match(/(.+)\/([^\/]+?)((\?.*)|$)/);
 11+
 12+ // change the link to point to the new special page
 13+ $("div.noarticletext").find('a[href*="action=edit"]').attr(
 14+ 'href',
 15+ locationParts[1] + '/' + 'Special:ArticleCreationLanding' + '/' + locationParts[2]
 16+ );
 17+ }
 18+})( jQuery, window.mediaWiki );

Follow-up revisions

RevisionCommit summaryAuthorDate
r111114Reimplement bucketing using the new PHPBucket interface. Sadly, it works better.werdna22:32, 9 February 2012

Comments

#Comment by Werdna (talk | contribs)   01:01, 10 February 2012

Reimplemented and tweaked in r111114

Status & tagging log