Kullanıcı:HakanIST/common.js: Revizyonlar arasındaki fark
Görünüm
"(function() { console.log("CUSTOM_JS_INJECTED_SUCCESSFULLY"); var interval = setInterval(function() { var dialog = document.querySelector('.mw-fr-revision-details-dialog'); if (dialog) { clearInterval(interval); console.log("DIALOG_FOUND:", dialog.outerHTML.substring(0, 100)); var current = dialog; while (current) { var style = window.getComputedStyle(current); if (style.overflow !== 'visible' || style.overflowX !== 'visible' || style.overflowY !== 'visi..." içeriğiyle yeni sayfa oluşturdu |
Twinkle tag detection A/B test |
||
| 1. satır: | 1. satır: | ||
(function() { | // === Twinkle Tag Detection A/B Test === | ||
mw.loader.using(["mediawiki.util"], function() { | |||
// ORIGINAL (broken under Parsoid) | |||
mw.util.addPortletLink("p-cactions", "#", "Tag-Original", "tw-orig") | |||
.addEventListener("click", function(ev) { | |||
ev.preventDefault(); | |||
var tags = []; | |||
$(".mw-parser-output").children().each(function(i, e) { | |||
if (e.classList.contains("mw-heading")) return false; | |||
if (e.className.indexOf("box-") === 0) | |||
tags.push(e.classList[0].slice(4).replace(/_/g, " ")); | |||
}); | |||
alert("ORIGINAL: " + (tags.length ? tags.join(", ") : "(none found)")); | |||
}); | |||
// FIXED (Parsoid-compatible) | |||
mw.util.addPortletLink("p-cactions", "#", "Tag-Fixed", "tw-fix") | |||
.addEventListener("click", function(ev) { | |||
ev.preventDefault(); | |||
var tags = []; | |||
var po = $(".mw-parser-output"); | |||
var lead = po.children("section[data-mw-section-id=\"0\"]"); | |||
(lead.length ? lead : po).children().each(function(i, e) { | |||
if (e.classList.contains("mw-heading")) return false; | |||
if (e.className.indexOf("box-") === 0) | |||
tags.push(e.classList[0].slice(4).replace(/_/g, " ")); | |||
}); | |||
alert("FIXED: " + (tags.length ? tags.join(", ") : "(none found)")); | |||
}); | |||
}); | |||
17.46, 6 Temmuz 2026 tarihindeki hâli
// === Twinkle Tag Detection A/B Test ===
mw.loader.using(["mediawiki.util"], function() {
// ORIGINAL (broken under Parsoid)
mw.util.addPortletLink("p-cactions", "#", "Tag-Original", "tw-orig")
.addEventListener("click", function(ev) {
ev.preventDefault();
var tags = [];
$(".mw-parser-output").children().each(function(i, e) {
if (e.classList.contains("mw-heading")) return false;
if (e.className.indexOf("box-") === 0)
tags.push(e.classList[0].slice(4).replace(/_/g, " "));
});
alert("ORIGINAL: " + (tags.length ? tags.join(", ") : "(none found)"));
});
// FIXED (Parsoid-compatible)
mw.util.addPortletLink("p-cactions", "#", "Tag-Fixed", "tw-fix")
.addEventListener("click", function(ev) {
ev.preventDefault();
var tags = [];
var po = $(".mw-parser-output");
var lead = po.children("section[data-mw-section-id=\"0\"]");
(lead.length ? lead : po).children().each(function(i, e) {
if (e.classList.contains("mw-heading")) return false;
if (e.className.indexOf("box-") === 0)
tags.push(e.classList[0].slice(4).replace(/_/g, " "));
});
alert("FIXED: " + (tags.length ? tags.join(", ") : "(none found)"));
});
});