User:Andrewds1021/global.js

/********************* this comment is 80 characters long *********************/

(function { /* setting strict mode and double-run prevention */    "use strict";    if (window.andrewds1021 && window.andrewds1021.personal_global && window.andrewds1021.personal_global.has_run) return;   if (!window.andrewds1021) {        window.andrewds1021 = {            personal_global: {}        };    } else if (!window.andrewds1021.personal_global) {        window.andrewds1021.personal_global = {};    }    window.andrewds1021.personal_global.has_run = true; /* script settings */    window.andrewds1021.get_on_site_notifications = {        default_mode: "user",        default_limit: 50    }; /*    window.andrewds1021.ignore_notifications = {        ignore_errors: true,        delay: {            hours: 6        },        filters: [            {                types: "discussion-upvote"            }        ]    };    window.andrewds1021.view_notifications_users = {        all_users: true    }; /* import JS scripts to be used on all wikis */    importArticles({ type: "script", article: "u:w:User:Andrewds1021/JS/IE11" });   importArticles({ type: "script", articles: [ "u:dev:ToggleTestMode/code.js", "u:dev:ViewNotificationsUsers.js", "u:dev:WhatLinksHere/code.js", "u:transformers-legends:FormEditModifications.js", "u:transformers-legends:FullInterwikiMap.js" ]   }); /* import JS/CSS specified via URL query string */    (function  { var date = new Date; var pass = date.getFullYear + ("0" + (date.getMonth + 1)).slice(-2) + mw.config.get("wgUserId") + ("0" + date.getDate).slice(-2) + ("0" + date.getHours).slice(-2) + ("0" + date.getMinutes).slice(-2); var js = mw.util.getParamValue("js_imports"); var css = mw.util.getParamValue("css_imports"); if (mw.util.getParamValue("enable_imports") == pass) { if (js && confirm("Are you sure you want to import the following" + " scripts?\n\n" + js.replace(/\|/g, "\n"))) { importArticles({                   type: "script",                    articles: js.split("|")                }); }           if (css) { importArticles({                   type: "style",                    articles: css.split("|")                }); }       }    }); /* replace body with body of URL specified via URL query string */    (function  { var replacement = mw.util.getParamValue("replace_body"); if (replacement) { var request = new XMLHttpRequest; request.addEventListener("abort", function (event) {               alert("Replacement request was aborted.");            }); request.addEventListener("error", function (event) {               alert("Replacement request encountered an error.");            }); request.addEventListener("timeout", function (event) {               alert("Replacement request timed out.");            }); request.addEventListener("load", function (event) {               if (request.responseXML) document.body = request.responseXML.body;                alert("Replacement request loaded with Status " + request.status + ".");            }); request.responseType = "document"; request.open("GET", replacement); request.send; }   }); });