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 ); |