mw.loader.using( [ 'mediawiki.util', 'mediawiki.user', 'mediawiki.notify' ], function ( ) {
/* // // // //
XXX: We don't actually use all these modules here. Specifically, .user probably isn't needed.
However, if the modules listed here are a proper subset of those listed in common.js, this might execute before the corresponding call in common.js; is that a problem?
*/
var sixTEdit = 'commons/9/98/Pencil_go.png';
if ( mw.config.get( 'wgRevisionId' ) > 0 && mw.config.get( 'wgRevisionId' ) !== mw.config.get( 'wgCurRevisionId' ) ) {
sixTEdit = 'commons/d/d5/Silk_arrow_undo.png';
}
window.sixTabsNames = {
've-edit':'commons/3/36/Monitor_edit.png',
'edit':sixTEdit,
'viewsource':'commons/2/26/Page_key.png',
'history':'commons/5/57/Calendar-silk.png',
'addsection':'commons/7/72/Pencil_add.png'
}
mw.loader.load( '/mw/index.php?title=User:Eighty5cacao/6tabs-vector.js&action=raw&ctype=text/javascript' );
window.shouldUseFH = function ( ) {
// XXX: Do we actually need these, or will the globals defined in common.js work?
var zzAction = mw.config.get( 'wgAction' );
var zzNamespaceNumber = mw.config.get( 'wgNamespaceNumber' );
var zzPageName = mw.config.get( 'wgPageName' );
if ( /it$/.test( zzAction ) ) return false;
if ( ( zzNamespaceNumber === 2 || zzNamespaceNumber === 8 ) && ( /\.(cs|j)s$/.test( zzPageName ) ) ) return true;
if ( zzNamespaceNumber === -1 ) {
if ( /(Contributions|Log)(\/|$)/.test( zzPageName ) ) return $( 'a.mw-numlink' ).length > 0;
return true;
}
if ( zzAction === 'history' ) return $( 'a.mw-numlink' ).length > 0;
// else action is 'view'
var longPageHeuristic = $( '.mw-headline' ).length;
longPageHeuristic += $( 'a.image' ).length / 2;
longPageHeuristic += $( '#bodyContent > div > p' ).length / 4;
longPageHeuristic += $( '#bodyContent > div > table:not(.stub) > tbody > tr' ).length / 8;
longPageHeuristic += $( 'dl' ).length / 16;
longPageHeuristic += $( '#bodyContent > div:not(#catlinks) li:not([class*="toclevel"])' ).length / 32;
return Math.floor( longPageHeuristic ) >= 6;
}
if ( shouldUseFH( ) ) $( 'body' ).addClass( 'allow-floathead' );
// moved from common.js because it wouldn't otherwise work for some reason
var yyAction = mw.config.get( 'wgAction' );
if ( yyAction === 'edit' || yyAction === 'submit' ) {
if ( typeof window.checkBadPipeTrick === 'function' ) { window.checkBadPipeTrick(); }
if ( typeof window.fakeEditNoticeForDotClockRates === 'function' ) { window.fakeEditNoticeForDotClockRates(); }
}
// // // // //
})