User:Void/testing.js: Difference between revisions
Content added Content deleted
m (more confused scribbling) |
m (test) |
||
Line 5: | Line 5: | ||
if(/Status: (Open|Done)/.test(headings[i].innerText)) { |
if(/Status: (Open|Done)/.test(headings[i].innerText)) { |
||
headings[i].nextSibling.lastChild.id = 'edit-' + i; |
headings[i].nextSibling.lastChild.id = 'edit-' + i; |
||
$('#edit-' + i).before('| <a click=" |
$('#edit-' + i).before('| <a click="console.log(' + i + ')">respond</a>'); |
||
} |
} |
||
} |
} |
Revision as of 22:52, 11 September 2017
// <nowiki>
if( mw.config.get('wgPageName') === 'TestWiki:Request_permissions' ) {
var headings = $('.mw-headline');
for(var i = 0; i < headings.length; i++) {
if(/Status: (Open|Done)/.test(headings[i].innerText)) {
headings[i].nextSibling.lastChild.id = 'edit-' + i;
$('#edit-' + i).before('| <a click="console.log(' + i + ')">respond</a>');
}
}
}
function doThing(num) {
console.log(num);
}
// </nowiki>