Szerkesztő:Winston/common.js
Megjelenés
Megjegyzés: közzététel után frissítened kell a böngésződ gyorsítótárát, hogy lásd a változásokat.
- Firefox / Safari: tartsd lenyomva a Shift gombot és kattints a Frissítés gombra a címsorban, vagy használd a Ctrl–F5 vagy Ctrl–R (Macen ⌘–R) billentyűkombinációt
- Google Chrome: használd a Ctrl–Shift–R (Macen ⌘–Shift–R) billentyűkombinációt
- Edge: tartsd nyomva a Ctrl-t, és kattints a Frissítés gombra, vagy nyomj Ctrl–F5-öt
function PMsTitle() {
if (document.getElementById("title") && document.getElementById("firstHeading").innerHTML == "Szerkesztő:Winston/PMs") {
document.getElementById("firstHeading").innerHTML = document.getElementById("title").firstChild.nodeValue;
}
}
$(PMsTitle);
// Lapfigyelés vége link a friss változtatások lapon KEZD
function unwatchAjax (title, token, rowToHideRevidId) {
$.ajax({
type: 'POST', // request type ( GET or POST )
url: mw.util.wikiScript('api'), // the URL to which the request is sent
data: { 'action':'watch', 'format':'json', 'uselang':'hu', 'unwatch':'', 'format':'json', 'title':title, 'token':token }, // data to be sent to the server
dataType: 'json', // the type of data that you're expecting back from the server
success: function(row){ //function to be called if the request succeeds
$('*[data-mw-revid="' + rowToHideRevidId + '"]').hide();
//alert(jsondata.watch.message);
}
});
}
function watchListUnwatch () {
var fh = document.getElementById("firstHeading");
if (fh && fh.innerHTML == "Figyelőlistám") {
var watchToken = mw.user.tokens.get("watchToken");
var bcontent = $(".mw-changeslist-history");
bcontent.each(function(index) {
var historyLink = $(this);
historyLink.parent().after(function() {
return $("<span></span>").append(function() {
var remover = $('<a href="#" class="mw-changeslist-remover-custom" title="lapfigyelés vége">lapfigyelés vége</a>');
var articleTitle = historyLink.parent().parent().parent().parent().find(".mw-changeslist-title").attr("title");
var rowToHideRevidId = historyLink.parent().parent().parent().parent().parent().parent().parent().data("mw-revid");
remover.attr("onclick", "unwatchAjax('" + articleTitle + "', '" + watchToken + "\\', '" + rowToHideRevidId + "'); return false;"); // escape character needed because token ends with "\"
return remover;
});
});
});
}
}
$(watchListUnwatch);
// Lapfigyelés vége link a friss változtatások lapon VÉGE
importScript("User:BáthoryPéter/interwikiFordito.js");