MediaWiki:Common.js: Difference between revisions
From Celeste Wiki
Content deleted Content added
seems like jQuery does not work, reversing |
removed autoscroll maps, unused |
||
(12 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
* By [[User:Sikon|Sikon]], updated by [[User:Bizzeebeever]] |
* By [[User:Sikon|Sikon]], updated by [[User:Bizzeebeever]] |
||
*/ |
*/ |
||
/* |
|||
$j( function() { |
$j( function() { |
||
var $title = $j( '#title-meta0' ), |
var $title = $j( '#title-meta0' ), |
||
Line 18: | Line 18: | ||
} |
} |
||
} ); |
} ); |
||
*/ |
|||
Line 24: | Line 24: | ||
* Used by [[Template:Nologo]] |
* Used by [[Template:Nologo]] |
||
* Updated by [[User:Bizzeebeever]] |
* Updated by [[User:Bizzeebeever]] |
||
*/ |
*//* |
||
$j( function() { |
$j( function() { |
||
if ( $j( '#nologo' ).length ) { |
if ( $j( '#nologo' ).length ) { |
||
Line 30: | Line 30: | ||
} |
} |
||
} ); |
} ); |
||
*/ |
|||
/** Title remover ******************************************************** |
/** Title remover ******************************************************** |
||
* Used by [[Template:Notitle]] |
* Used by [[Template:Notitle]] |
||
* Updated by [[User:Bizzeebeever]] |
* Updated by [[User:Bizzeebeever]] |
||
*/ |
*//* |
||
$j( function () { |
$j( function () { |
||
if ( $j( '#notitle' ).length ) { |
if ( $j( '#notitle' ).length ) { |
||
Line 41: | Line 41: | ||
} |
} |
||
} ); |
} ); |
||
*/ |
|||
/** Categories remover *************************************************** |
/** Categories remover *************************************************** |
||
* Used by [[Template:Nocategories]] |
* Used by [[Template:Nocategories]] |
||
* Updated by [[User:Bizzeebeever]] |
* Updated by [[User:Bizzeebeever]] |
||
*/ |
*//* |
||
$j( function() { |
$j( function() { |
||
if ( $j( '#nocategories' ).length ) { |
if ( $j( '#nocategories' ).length ) { |
||
Line 51: | Line 51: | ||
} |
} |
||
} ); |
} ); |
||
*/ |
|||
/** Show username ******************************************************** |
/** Show username ******************************************************** |
||
* The annoying hack used by [[Template:USERNAME]]! |
* The annoying hack used by [[Template:USERNAME]]! |
||
Line 57: | Line 57: | ||
* Originally by [[wikia:User:Splarka|Splarka]], [[User:Spang]] |
* Originally by [[wikia:User:Splarka|Splarka]], [[User:Spang]] |
||
* New version by [[User:Bizzeebeever]] |
* New version by [[User:Bizzeebeever]] |
||
*/ |
*//* |
||
$j( function() { |
$j( function() { |
||
var name = mw.config.get( 'wgUserName' ); |
var name = mw.config.get( 'wgUserName' ); |
||
Line 63: | Line 63: | ||
$j( 'span.insertusername' ).text( name ); |
$j( 'span.insertusername' ).text( name ); |
||
} |
} |
||
} ); |
} );*/ |
||
/** Archive edit tab disabling ******************************************* |
/** Archive edit tab disabling ******************************************* |
||
Line 70: | Line 70: | ||
* or by typing the edit address manually. |
* or by typing the edit address manually. |
||
* By [[User:Spang|Spang]], rewritten by [[User:Bizzeebeever]] |
* By [[User:Spang|Spang]], rewritten by [[User:Bizzeebeever]] |
||
*/ |
*//* |
||
$j( function() { |
$j( function() { |
||
if ( $j( '#old-forum-warning' ).length && !window.enableOldForumEdit ) { |
if ( $j( '#old-forum-warning' ).length && !window.enableOldForumEdit ) { |
||
Line 77: | Line 77: | ||
.text( 'No editing' ); |
.text( 'No editing' ); |
||
} |
} |
||
} ); |
} );*/ |
||
/** Add-section tab disabling ******************************************** |
/** Add-section tab disabling ******************************************** |
||
Line 85: | Line 85: | ||
* example: <div id="disableAddSection"></div> |
* example: <div id="disableAddSection"></div> |
||
* By [[User:Olipro|Olipro]], updated by [[User:Bizzeebeever]] |
* By [[User:Olipro|Olipro]], updated by [[User:Bizzeebeever]] |
||
*/ |
*//* |
||
$j( function() { |
$j( function() { |
||
if ( $j( '#disableAddSection' ).length ) { |
if ( $j( '#disableAddSection' ).length ) { |
||
$j( '#ca-addsection' ).remove(); |
$j( '#ca-addsection' ).remove(); |
||
} |
} |
||
} ); |
} );*/ |
||
// |
// Replaces image |
||
document. |
if (document.getElementById('replaceImageButton')) { |
||
document.getElementById('replaceImageButton').addEventListener('click', function() { |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
}); |
|||
} |
|||
// Default scroll position for maps |
|||
⚫ | |||
/* |
|||
⚫ | |||
⚫ | |||
console.log("started execution"); |
|||
⚫ | |||
const bottom = ["scroll0", "scroll1", "scroll2", "scroll4", "scroll7", "scroll8"]; // ids of maps where we need to push the scrollbar to bottom |
|||
⚫ | |||
bottom.forEach(function(id){ |
|||
⚫ | |||
console.log("trying to change scroll position of " + id); |
|||
if (document.getElementById(id)) { |
|||
// document.getElementById(id).scrollTop = document.getElementById(id).scrollHeight; |
|||
document.getElementById(id).scrollTop = 999999; |
|||
} |
|||
}); |
|||
}); |
}); |
||
*/ |