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)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
// Project scope tagger for galleries, not images
// Code by [[User:Animum]]
 
importScript('User:Animum/urlparameters.js');
 
 readparams();
 
if(UrlParameters["action"] == "edit" && UrlParameters["projectscopetag"] == 1) {
    addOnloadHook(function() {
        var req = sajax_init_object();
        req.open("GET", wgScriptPath + "/api.php?action=query&prop=revisions&titles=" + wgPageName + "&rvlimit=1&rvprop=user&rvdir=newer&format=json", false);
        req.send(null);
        var text = eval("(" + req.responseText + ")").query.pages;
        for(var index in text) {
            text = text[index];
            var user = text.revisions[0].user;
        }
        document.forms["editform"].wpTextbox1.value = '\{\{speedydelete|outside of [[COM:PS|project scope]]\}\}' + "\n" + document.forms["editform"].wpTextbox1.value;
        document.forms["editform"].wpSummary.value = 'Tagging as outside of the [[Commons:Project scope|project scope]] (using [[User:Garden/omnitag.js|omnitag]] script)';
        document.forms["editform"].wpMinoredit.checked = true;
        document.forms["editform"].submit();
        if(typeof(user) != 'undefined') window.setTimeout(function() { location.href = wgScript + "?title=User_talk:" + user + "&action=edit&projectscopenotify=1&projectscope=" + wgPageName; }, 1000);
    });
}
 
if(UrlParameters["action"] == "edit" && UrlParameters["projectscopenotify"] == 1 && UrlParameters["projectscope"].length > 0 && wgNamespaceNumber == 3) {
    addOnloadHook(function() {
        var projectscope = decodeURIComponent(UrlParameters["projectscope"].replace(/_/g, " "));
        document.forms["editform"].wpTextbox1.value += "\{\{subst:Project scope|" + projectscope + "\}\} \~\~\~\~";
        document.forms["editform"].wpSummary.value = 'Notification - [[' + projectscope+ ']] is outside of the [[Commons:Project scope|project scope]] (using [[User:Garden/omnitag.js|omnitag]] script)';
        document.forms["editform"].wpMinoredit.checked = true;
        document.forms["editform"].submit();
    });
}
 
$(function() {
    if(wgNamespaceNumber == 0 && !UrlParameters["projectscopetag"]) mw.util.addPortletLink("p-cactions", wgScript + "?title=" + wgPageName + "&action=edit&projectscopetag=1", "scope", "ca-scope");
});

// Project scope tagger for IMAGES
// Code by [[User:Animum]]
 
importScript('User:Animum/urlparameters.js');
 
 readparams();
 
if(UrlParameters["action"] == "edit" && UrlParameters["projectscopeimgtag"] == 1) {
    addOnloadHook(function() {
        var req = sajax_init_object();
        req.open("GET", wgScriptPath + "/api.php?action=query&prop=revisions&titles=" + wgPageName + "&rvlimit=1&rvprop=user&rvdir=newer&format=json", false);
        req.send(null);
        var text = eval("(" + req.responseText + ")").query.pages;
        for(var index in text) {
            text = text[index];
            var user = text.revisions[0].user;
        }
        document.forms["editform"].wpTextbox1.value += '\{\{speedydelete|outside of [[COM:PS|project scope]]\}\}'
        document.forms["editform"].wpSummary.value = 'Tagging as outside of the [[Commons:Project scope|project scope]] (using [[User:Garden/omnitag.js|omnitag]] script)';
        document.forms["editform"].wpMinoredit.checked = true;
        document.forms["editform"].submit();
        if(typeof(user) != 'undefined') window.setTimeout(function() { location.href = wgScript + "?title=User_talk:" + user + "&action=edit&projectscopeimgnotify=1&projectscopeimg=" + wgPageName; }, 1000);
    });
}
 
if(UrlParameters["action"] == "edit" && UrlParameters["projectscopeimgnotify"] == 1 && UrlParameters["projectscopeimg"].length > 0 && wgNamespaceNumber == 3) {
    addOnloadHook(function() {
        var projectscopeimg = decodeURIComponent(UrlParameters["projectscopeimg"].replace(/_/g, " "));
        document.forms["editform"].wpTextbox1.value += "\{\{subst:Project scope|" + projectscopeimg + "\}\} \~\~\~\~";
        document.forms["editform"].wpSummary.value = 'Notification - [[' + projectscopeimg + ']] is outside of the [[Commons:Project scope|project scope]] (using [[User:Garden/omnitag.js|omnitag]] script)';
        document.forms["editform"].wpMinoredit.checked = true;
        document.forms["editform"].submit();
    });
}
 
$(function() {
    if(wgNamespaceNumber == 6 && !UrlParameters["projectscopeimgtag"]) mw.util.addPortletLink("p-cactions", wgScript + "?title=" + wgPageName + "&action=edit&projectscopeimgtag=1", "scopeimg", "ca-scopeimg");
});

// Testpage tagger

if(UrlParameters["action"] == "edit" && UrlParameters["testtag"] == 1) {
    addOnloadHook(function() {
        var req = sajax_init_object();
        req.open("GET", wgScriptPath + "/api.php?action=query&prop=revisions&titles=" + wgPageName + "&rvlimit=1&rvprop=user&rvdir=newer&format=json", false);
        req.send(null);
        var text = eval("(" + req.responseText + ")").query.pages;
        for(var index in text) {
            text = text[index];
            var user = text.revisions[0].user;
        }
        document.forms["editform"].wpTextbox1.value = '\{\{speedydelete|Test page\}\}' + "\n" + document.forms["editform"].wpTextbox1.value;
        document.forms["editform"].wpSummary.value = 'Tagging as a probable test page (using [[User:Garden/omnitag.js|omnitag]] script)';
        document.forms["editform"].wpMinoredit.checked = true;
        document.forms["editform"].submit();
        if(typeof(user) != 'undefined') window.setTimeout(function() { location.href = wgScript + "?title=User_talk:" + user + "&action=edit&testnotify=1&test=" + wgPageName; }, 1000);
    });
}
 
if(UrlParameters["action"] == "edit" && UrlParameters["testnotify"] == 1 && UrlParameters["test"].length > 0 && wgNamespaceNumber == 3) {
    addOnloadHook(function() {
        var test = decodeURIComponent(UrlParameters["test"].replace(/_/g, " "));
        document.forms["editform"].wpTextbox1.value += "\{\{subst:Test\}\} \~\~\~\~";
        document.forms["editform"].wpSummary.value = 'Notification - your latest creation appears to be a testpage (using [[User:Garden/omnitag.js|omnitag]] script)';
        document.forms["editform"].wpMinoredit.checked = true;
        document.forms["editform"].submit();
    });
}
 
$(function() {
    if(wgNamespaceNumber == 0 && !UrlParameters["testtag"]) mw.util.addPortletLink("p-cactions", wgScript + "?title=" + wgPageName + "&action=edit&testtag=1", "test", "ca-test");
});