User:Writ Keeper/Scripts/massRevdel.js: Difference between revisions

Content deleted Content added
into the unknooooown
swap for document.ready
 
(6 intermediate revisions by the same user not shown)
Line 1:
mw.hook$("wikipage.content"document).addready( function()
{
mw.loader.using(["mediawiki.api"]).then(function ()
Line 8:
{
wkContribsCheckboxInit = true;
$("ul.mw-contributions-list:first").before("<div style='display:inline-block;' id='revdelCP'><span id='revdelLabel' style='cursor:pointer;'>Revision deletion\
<img id='revdelLabelImg' src='/w/load.php?modules=oojs-ui.styles.icons-movement&image=expand&format=rasterized&lang=en' style='width:12px; transform:rotate(270deg);'/></span>\
<span id='revdelCPBody' style='display:none;'><input type='button' id='revdelSelectAll' value='Select all'><input type='button' id='revdelSelectNone' value='Select none'>\
Line 76:
$(this).prop("checked", true);
});
$("#revdelCP").data("lastSelectedIndex", -1);
}
);
Line 85 ⟶ 86:
$(this).prop("checked", false);
});
$("#revdelCP").data("lastSelectedIndex", -1);
}
);
Line 95 ⟶ 97:
$(this).prop("checked", !($(this).prop("checked")));
});
$("#revdelCP").data("lastSelectedIndex", -1);
}
);
$("input.revdelIds").off("click").click(
function(ev)
{
Line 111 ⟶ 114:
for(var i = start; i < stop; i++)
{
if(i != lastSelectedRevdel)
$(checkboxArray[i]).prop("checked", true);
{
$(checkboxArray[i]).prop("checked", true!($(checkboxArray[i]).prop("checked")));
}
}
}
Line 118 ⟶ 124:
for(var i = start; i > stop; i--)
{
if(i != lastSelectedRevdel)
$(checkboxArray[i]).prop("checked", true);
{
$(checkboxArray[i]).prop("checked", true!($(checkboxArray[i]).prop("checked")));
}
}
}