User:Vijuki/common.js: Difference between revisions
From Growtopia
More actions
>Vijuki No edit summary |
>Vijuki No edit summary |
||
| Line 86: | Line 86: | ||
const value = this.getAttribute(a); | const value = this.getAttribute(a); | ||
if (!value) continue; | if (!value) continue; | ||
const updatedValue = value.replace(/\/scale-to-width(?:-down)?\/\d+/g, '/scale-to-width-down/ | const updatedValue = value.replace(/\/scale-to-width(?:-down)?\/\d+/g, '/scale-to-width-down/2400'); | ||
if (updatedValue !== value) this.setAttribute(a, updatedValue); | if (updatedValue !== value) this.setAttribute(a, updatedValue); | ||
} | } | ||
}); | }); | ||
}); | }); | ||
Revision as of 17:37, 2 September 2025
// 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/2400');
if (updatedValue !== value) this.setAttribute(a, updatedValue);
}
});
});