MediaWiki:Common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 2:
 
function runUntilSuccess(f) {
console.log("Running function");
(function run() {
if (!f()) {
console.log("Rerunning function");
setTimeout(run, 10);
}
Line 14 ⟶ 12:
 
// Sort table by the first column
/*runUntilSuccess(function() {
var tables = document.getElementsByClassName("ram_rom_map");
for (var i = 0; i < tables.length; i++) {
Line 29 ⟶ 27:
}
return true;
});*/
 
// Add the ending address to the length column
Line 50 ⟶ 48:
// Modify BPMN chart embeds to be just the SVG
runUntilSuccess(function() {
console.log("Checking for BPMN");
if (document.getElementsByClassName("bpmn_embed").length > 0) {
console.log("BPMN found");
var canvas = document.getElementById("canvas");
var parent = canvas.parentElement;
var svgs = canvas.getElementsByTagName("svg");
if (svgs.length == 0 || svgs[0].getAttribute("data-element-id") == null) {
console.log("No SVG found");
return false;
}
console.log("SVG found");
var clone = svgs[0].cloneNode(true);