User:Sav/welcome.js: Difference between revisions
From Test Wiki
Content deleted Content added
Created page with "→TO USE: ADD LINES LIKE BELOW const WELCOME_TEMPLATE = "<full page name of your welcome template>"; mw.loader.load('/w/index.php?title=User:Sav/welcome.js&action=raw&ctype=text/javascript'); FOR EXAMPLE: const WELCOME_TEMPLATE = "User:Sav/Welcome"; mw.loader.load('/w/index.php?title=User:Sav/welcome.js&action=raw&ctype=text/javascript');: const tag = "welcomingnice"; // Change this to change the query used to detect if you're welcoming if (mw.config.get('wgName..." |
No edit summary |
||
| (6 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
// THIS IS A WORK IN PROGRESS, DO NOT INSTALL THIS SCRIPT OR MAKE CHANGES. |
|||
/* TO USE: ADD LINES LIKE BELOW |
|||
const WELCOME_TEMPLATE = " |
const WELCOME_TEMPLATE = "User:Sav/Welcome"; |
||
| ⚫ | |||
mw.loader.load('/w/index.php?title=User:Sav/welcome.js&action=raw&ctype=text/javascript'); |
|||
document.addEventListener('DOMContentLoaded', function () { |
|||
FOR EXAMPLE: |
|||
| ⚫ | |||
| ⚫ | |||
if (actions) { |
|||
| ⚫ | |||
if (ul) { |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
const WELCOME_TEMPLATE = "User:Sav/Welcome"; |
|||
mw.loader.load('/w/index.php?title=User:Sav/welcome.js&action=raw&ctype=text/javascript'); |
|||
| ⚫ | |||
*/ |
|||
| ⚫ | |||
| ⚫ | |||
document.getElementById("wpSummary").value = 'Welcome!'; |
|||
| ⚫ | |||
} |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
$("#wpSummary").textSelection('setContents', 'Welcome!'); |
|||
| ⚫ | |||
} |
|||
} |
|||
console.log("Loaded Wiki Welcome"); |
console.log("Loaded Wiki Welcome"); |
||