„Benutzer:Wurgl/WikiHistory.js“ – Versionsunterschied
Inhalt gelöscht Inhalt hinzugefügt
Wurgl (Diskussion | Beiträge) KKeine Bearbeitungszusammenfassung |
Wurgl (Diskussion | Beiträge) K bessere Anordnung |
||
(Eine dazwischenliegende Version desselben Benutzers wird nicht angezeigt) | |||
Zeile 4: | Zeile 4: | ||
if (mw.config.get('wgArticleId') == 0) return; // no deleted articles |
if (mw.config.get('wgArticleId') == 0) return; // no deleted articles |
||
if (mw.config.get('wgRevisionId') != 0 && mw.config.get('wgCurRevisionId') != mw.config.get('wgRevisionId')) return; // only current revision |
if (mw.config.get('wgRevisionId') != 0 && mw.config.get('wgCurRevisionId') != mw.config.get('wgRevisionId')) return; // only current revision |
||
$("<div id='authors' style='font-size:84%; line-height:1.2em; margin:0 0 0 1em; width:auto;'>von <span id='authorsresult'></span><span id='authorsloading'>...</span></div>").insertBefore(" |
$("<div id='authors' style='font-size:84%; line-height:1.2em; margin:0 0 0 1em; width:auto;'>von <span id='authorsresult'></span><span id='authorsloading'>...</span></div>").insertBefore(document.getElementById("contentSub") || document.getElementById("mw-content-text")); |
||
loadinganimation = window.setInterval( function() { if ($("#authorsloading").html() == ". ") $("#authorsloading").html(" . "); else if ($("#authorsloading").html() == " . ") $("#authorsloading").html(" ."); else $("#authorsloading").html(". "); }, 300); |
loadinganimation = window.setInterval( function() { if ($("#authorsloading").html() == ". ") $("#authorsloading").html(" . "); else if ($("#authorsloading").html() == " . ") $("#authorsloading").html(" ."); else $("#authorsloading").html(". "); }, 300); |
||
mw.loader.load("//wikihistory.toolforge.org/wiki/getauthors.php?wiki=" + window.location.hostname.split(".", 1)[0] + "wiki&page_id=" + mw.config.get('wgArticleId')); |
mw.loader.load("//wikihistory.toolforge.org/wiki/getauthors.php?wiki=" + window.location.hostname.split(".", 1)[0] + "wiki&page_id=" + mw.config.get('wgArticleId')); |
Version vom 25. Juni 2020, 11:05 Uhr
var authors = {
loadinganimation : 0,
execute : function () {
if (mw.config.get('wgArticleId') == 0) return; // no deleted articles
if (mw.config.get('wgRevisionId') != 0 && mw.config.get('wgCurRevisionId') != mw.config.get('wgRevisionId')) return; // only current revision
$("<div id='authors' style='font-size:84%; line-height:1.2em; margin:0 0 0 1em; width:auto;'>von <span id='authorsresult'></span><span id='authorsloading'>...</span></div>").insertBefore(document.getElementById("contentSub") || document.getElementById("mw-content-text"));
loadinganimation = window.setInterval( function() { if ($("#authorsloading").html() == ". ") $("#authorsloading").html(" . "); else if ($("#authorsloading").html() == " . ") $("#authorsloading").html(" ."); else $("#authorsloading").html(". "); }, 300);
mw.loader.load("//wikihistory.toolforge.org/wiki/getauthors.php?wiki=" + window.location.hostname.split(".", 1)[0] + "wiki&page_id=" + mw.config.get('wgArticleId'));
},
resultloaded : function( res, old ) {
$("#authorsresult").html(res);
if (old == 1) mw.loader.load("//wikihistory.toolforge.org/wiki/getauthors.php?wiki=" + window.location.hostname.split(".", 1)[0] + "wiki&page_id=" + mw.config.get('wgArticleId') + '&onlynew=1');
},
stoploading : function() {
clearInterval(loadinganimation);
$('#authorsloading').remove();
}
}
if ( mw.config.get('wgNamespaceNumber') == 0 && ((typeof WikiHistory === 'undefined' || WikiHistory == "all" || WikiHistory == "view") && mw.config.get('wgAction') == "view" || (typeof WikiHistory !== 'undefined' && (WikiHistory == "all" || WikiHistory == "info")) && mw.config.get('wgAction') == "info") ) $( authors.execute );