User:PetraMagna/common.js: Difference between revisions

multiple js loads will interfere with each other
mNo edit summary
(multiple js loads will interfere with each other)
 
(11 intermediate revisions by the same user not shown)
Line 1:
mw.loader.load( '/wiki/commons.wikimedia.orgUser:PetraMagna/w/index.php?title=MediaWiki:Gadget-HotCat.js&?action=raw&ctype=text/javascript' );
/* common.js does not work in previews; need this to see momotalk choice effects */
if (document.getElementsByClassName("momotalk-container").length > 0) {
console.log("Loading personal momotalk js.");
mw.loader.load( '//bluearchive.wiki/w/index.php?title=User:PetraMagna/momotalk-choice.js&?action=raw&ctype=text/javascript' );
}
 
// if (document.getElementsByClassName("story-container").length > 0) {
// console.log("Loading story js");
// mw.loader.load( '//bluearchive.wiki/w/index.php?title=User:PetraMagna/story.js&?action=raw&ctype=text/javascript' );
// }
 
// if (document.getElementsByClassName("audio-player").length > 0) {
// console.log("Loading audio js");
// mw.loader.load ( '//bluearchive.wiki/w/index.php?title=User:PetraMagna/audio.js&?action=raw&ctype=text/javascript' );
// }
 
// if (document.getElementsByClassName("server-toggle-parent").length > 0 || document.getElementsByClassName("server-toggle-jp-button").length > 0 || document.getElementsByClassName("tabber__tabs").length > 0) {
// console.log("Loading server switching js");
// mw.loader.load ( '/wiki/User:PetraMagna/server-toggle.js?action=raw&ctype=text/javascript' );
// }
 
// mw.loader.load('https://cdn.jsdelivr.net/npm/wikiplus-core@latest/dist/Main.js');
(function() {
(window.InPageEdit = window.InPageEdit || {}).myPreference = {
"doNotCollectMyInfo": false,
"editMinor": true,
"editSummary": "[InPageEdit] $section $oldid",
"lockToolBox": false,
"redLinkQuickEdit": true,
"outSideClose": false,
"watchList": "nochange",
"noConfirmEdit": true,
"plugins": [
"toolbox.js",
"wiki-editor.js",
"edit-any-page.js"
]
}
mw.loader.load('https://cdn.jsdelivr.net/npm/mediawiki-inpageedit');
const editButton = document.getElementById("ca-edit");
if (!editButton) {
return;
}
const span = document.createElement("span");
span.innerText = "IPE";
Line 30 ⟶ 55:
listItem.classList.add(["mw-list-item", "collapsible"]);
const editButton = document.getElementById("ca-edit");
editButton.parentNode.insertBefore(listItem, editButton.nextSibling);
})();
 
 
// (function() {
// console.log("Loading popups.");
// mw.loader.load('//commons.wikimedia.org/wwiki/index.php?title=MediaWiki:Gadget-popups.js&?action=raw&ctype=text/javascript');
// mw.loader.load('//commons.wikimedia.org/wwiki/index.php?title=MediaWiki:Gadget-popups.css&?action=raw&ctype=text/css', 'text/css');
// })();
 
mw.loader.load( '//bluearchive.wiki/w/index.php?title=User:PetraMagna/popups.js&?action=raw&ctype=text/javascript'); // [[w:Wikipedia:Tools/Navigation popups]]
/**
* Cat-a-lot - changes category of multiple files
Line 49 ⟶ 73:
mw.loader.using(['jquery.ui', 'mediawiki.util']).done(function () {
mw.util.addCSS("#cat_a_lot_settings { display:none !important;}"); // Preferences depend on some Commons gadgets, not available locally
mw.loader.load('//commons.wikimedia.org/wwiki/index.php?title=MediaWiki:Gadget-Cat-a-lot.js&?action=raw&ctype=text/javascript');
mw.loader.load('//commons.wikimedia.org/wwiki/index.php?title=MediaWiki:Gadget-Cat-a-lot.css&?action=raw&ctype=text/css', 'text/css');
});
}