Benutzer:Totto/common.js: Unterschied zwischen den Versionen
K
localscript Executionj
Totto (Diskussion | Beiträge) K (online counter improved) |
Totto (Diskussion | Beiträge) K (localscript Executionj) |
||
Zeile 1:
var id = null;
function mainTotto() {
var tf = document.getElementById("p-personal");
var containerQuickJump = tf.getElementsByTagName("ul")[0];
var
container.setAttribute("class", "TottoCustomContainer");
container.innerHTML = '<a href="/wiki/ConanWiki:NextHints" dir="auto" title="Quick Acess Hints" >Hints</a>';
containerQuickJump.prepend(container);
var container2 = document.createElement("li");
container2.innerHTML = '<a href="/wiki/Vorlage:Anime-JP" dir="auto" title="Quick Acess Vorlage JP" >Vorlage JP</a>';
container2.setAttribute("id", "TottoVorlageJP");
containerQuickJump.prepend(container2);
var container3 = document.createElement("li");
container3.innerHTML = '<a onclick="scrollToBottom();" dir="auto" title="Quick Acess Down" >Downscroll</a>';
container3.setAttribute("id", "TottoScrollDown");
containerQuickJump.prepend(container3);
var container4 = document.createElement("li");
container4.innerHTML = '<a onclick="refresh()" dir="auto" title="Online Counter">0</a>';
container4.setAttribute("id", "TottoOnlineCounter");
containerQuickJump.prepend(container4);
//addHotkey("u","scrollToTop");
executeLocalScripts()
}
function preview() {
var ed = document.getElementsByClassName("editButtons");
if (ed.length >= 1) {
///Auto HotkeyPreview Preview :yum:
var previewbt = document.getElementById("wpPreview");
previewbt.click();
}
}
function addToQuicklink(title, link) {
var tf = document.getElementById("p-personal");
var containerQuickJump = tf.getElementsByTagName("ul")[0];
var container = document.createElement("li");
container.innerHTML = '<a href="' + link + '" dir="auto" title="Quick Acess ' + title + '" >' + title + '</a>';
container.setAttribute("id", "TottoHints");
containerQuickJump.prepend(container);
}
function scrollToBottom() {
window.scrollTo(0, document.body.scrollHeight);
}
function scrollToTop() {
window.scrollTo(0, document, 0)
}
function addHotkey(hotkey, function_to_call) {
var num = hotkey.toUpperCase().charCodeAt(0);
document.addEventListener("keydown", function(event) { const key = event.keyCode; if (key === num && event.altKey && event.shiftKey) { window[function_to_call](); } });
}
function addHotkeyF(hotkey, function_to_call) {
var num = hotkey.toUpperCase().charCodeAt(0);
document.addEventListener("keydown", function(event) { const key = event.keyCode; if (key === num && event.altKey && event.shiftKey) { function_to_call(); } });
}
function getAllElementsWithAttribute(attribute) {
var matchingElements = [];
var allElements = document.getElementsByTagName('*');
for (var i = 0, n = allElements.length; i < n; i++) {
if (allElements[i].getAttribute(attribute) !== null) {
// Element exists with attribute. Add to array.
matchingElements.push(allElements[i]);
}
}
return matchingElements;
}
function clickf(elementr) {
}
function AddAcessKeys() {
}
}
}
function refresh() {
onlinecounter();
var url = "https://conanwiki.org/wiki/Spezial:Wer_ist_gerade_online"
window.open(url, "_blank")
}
function onlinecounter() {
var url = "https://conanwiki.org/wiki/Spezial:Wer_ist_gerade_online"
}).then(function
}
}
}
});
}
function isDatei() {
var is = window.location.pathname.split("/").map(function
}
}
function getText() {
// ev.preventDefault();
// alert('success!');
// return false;
}
}
function alertinit() {
var div = document.createElement('div');
var style = document.createElement('style');
style.innerHTML = '.alert { padding: 20px; background-color: #4bac4f; color: white; margin-bottom: 15px;}.closebtn { margin-left: 15px; color: white; font-weight: bold; float: right; font-size: 22px; line-height: 20px; cursor: pointer; transition: 0.3s;} .closebtn:hover { color: black;} .fade-out-20 { animation: fadeOut ease 20s; -moz-animation: fadeOut ease 20s; } .fade-out-5 { animation: fadeOut ease 5s; -moz-animation: fadeOut ease 5s; } @keyframes fadeOut { 0% { opacity:1; } 100% { opacity:0; } } @-moz-keyframes fadeOut { 0% { opacity:1; } 100% { opacity:0; } } ';
div.innerHTML = ' <div id="alert-box" class="alert" style="display:none;position: fixed;top: 50%;z-index: 100;left: 25%;width: 50%;text-align: center;font-size: 49px;"><span onclick="this.parentElement.style.display=\'none\'" class="closebtn" style="font-size: 63px;">×</span><span id="alert-text">Alert</span></div>';
document.head.appendChild(style);
document.body.appendChild(div);
}
function alertSucess(text) {
}
function alert(text, color) {
}
function executeLocalScripts() {
if (window.LocalScript.wiki) {
window.LocalScript.wiki();
} else {
window.LocalScript.startWiki = true;
}
}
|