summaryrefslogtreecommitdiff
path: root/extensions/Vector/modules/ext.vector.sectionEditLinks.js
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/Vector/modules/ext.vector.sectionEditLinks.js')
-rw-r--r--extensions/Vector/modules/ext.vector.sectionEditLinks.js66
1 files changed, 0 insertions, 66 deletions
diff --git a/extensions/Vector/modules/ext.vector.sectionEditLinks.js b/extensions/Vector/modules/ext.vector.sectionEditLinks.js
deleted file mode 100644
index 62bde9e6..00000000
--- a/extensions/Vector/modules/ext.vector.sectionEditLinks.js
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Section Edit Links for Vector
- */
-( function ( $, mw ) {
-
-var eventBase = 'ext.vector.sectionEditLinks-bucket:';
-var cookieBase = 'ext.vector.sectionEditLinks-';
-var bucket = null;
-
-if ( mw.config.get( 'wgVectorSectionEditLinksBucketTest', false ) ) {
- // If the version in the client's cookie doesn't match wgVectorSectionEditLinksExperiment, then
- // we need to disregard the bucket they may already be in to ensure accurate redistribution
- var currentExperiment = $.cookie( cookieBase + 'experiment' );
- var experiment = Number( mw.config.get( 'wgVectorSectionEditLinksExperiment', 0 ) );
- if ( currentExperiment === null || Number( currentExperiment ) != experiment ) {
- $.cookie( cookieBase + 'experiment', experiment );
- } else {
- bucket = $.cookie( cookieBase + 'bucket' );
- }
- if ( bucket === null ) {
- // Percentage chance of being tracked
- var odds = Math.min( 100, Math.max( 0,
- Number( mw.config.get( 'wgVectorSectionEditLinksLotteryOdds', 0 ) )
- ) );
- // 0 = not tracked, 1 = tracked with old version, 2 = tracked with new version
- bucket = ( Math.random() * 100 ) < odds ? Number( Math.random() < 0.5 ) + 1 : 0;
- $.cookie( cookieBase + 'bucket', bucket, { 'path': '/', 'expires': 30 } );
- // If we are going to track this person from now on, let's also track which bucket we put
- // them into and when
- if ( bucket > 0 && 'trackAction' in $ ) {
- $.trackAction( eventBase + bucket + '@' + experiment );
- }
- }
-}
-
-if ( bucket <= 0 ) {
- return;
-}
-
-$(document).ready( function () {
- if ( bucket == 2 ) {
- // Move the link over to be next to the heading text and style it with an icon
- $( 'span.mw-headline' ).each( function () {
- $(this)
- .after(
- $( '<span class="editsection vector-editLink"></span>' )
- .append(
- $(this)
- .prev( 'span.editsection' )
- .find( 'a' )
- .each( function () {
- var text = $(this).text();
- $(this).text(
- text.substr( 0, 1 ).toUpperCase() + text.substr( 1 )
- );
- } )
- .detach()
- )
- )
- .prev( 'span.editsection' )
- .remove();
- } );
- }
-} );
-
-} )( jQuery, mediaWiki );