User:Vijuki/common.js
From Growtopia
More actions
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
// 1. AjaxRC configuration option
window.ajaxRefresh = 20000;
// 2. AjaxRC import statement
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:AjaxRC.js'
]
});
importArticles({
type: 'script',
articles: [
'u:dev:QuickComments/advanced.js',
]
});
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:LastEdited/code.js',
]
});
importArticles({
type: "script",
articles: [
'u:dev:AjaxDelete/code.js',
]
});
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:FastFileDelete.js',
]
});
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:BackToTopButton/code.js',
]
});
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:MultiUpload.js',
]
});
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:DisplayTimer/code.js',
]
});
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:Tooltips.js',
]
});
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:CategoryQuickRemove.js',
]
});
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:MassRollback.js',
]
});
importArticles({
type: 'script',
articles: [
'u:dev:MediaWiki:AjaxRename/code.js',
]
});
massCategorizationDelay = 1000;
importScriptPage('MediaWiki:MassCategorization/code.js', 'dev');
//----- [ Sharper Slider Images ] -----//
mw.hook('wikipage.content').add(($content) => {
const slides = $content.find('.sharper-slider.gtw-slider .fandom-slider .gallerybox img');
slides.each(function () {
const attrs = ['src','srcset','data-src','data-srcset'];
for (const a of attrs) {
const value = this.getAttribute(a);
if (!value) continue;
const updatedValue = value.replace(/\/scale-to-width(?:-down)?\/\d+/g, '/scale-to-width-down/1200');
if (updatedValue !== value) this.setAttribute(a, updatedValue);
}
});
});