Content deleted Content added
mNo edit summary |
mNo edit summary |
||
(13 intermediate revisions by the same user not shown) | |||
Line 5:
if(mw.config.get("wgAction") !== "edit") return;
window.rc_refs = [];▼
if(debug) console.log("Running");
// Add key handler.
window.addEventListener("keydown", e =>
{
if(e.ctrlKey && e.altKey && e.which == 82)
{
run();
if(window.rc_refsCrunched)▼
{▼
uncrunchRefs();▼
▲ window.rc_refsCrunched = false;
}▼
else▼
{▼
crunchRefs();▼
}▼
}
});
function run()
{
if(debug) console.log("Activate");
}
function crunchRefs()
Line 34 ⟶ 42:
var counter = 0;
text = text.replace(/(<ref.*?\/>)|(<ref.*?>(.|\s)*?<\/ref>)/g,
{
if(debug) console.log(match);
return `
});
txtarea.value = text;
return true;
}
Line 52 ⟶ 62:
var text = txtarea.value;
text = text.replace(/
{
if(debug) console.log(match);
return
});
Line 62 ⟶ 72:
txtarea.value = text;
return false;
}
});
|