Based almost entirely on jdporter's Free Nodelet Hack: Clear all Radio buttons, and in the spirit of putting my money where my mouth is (because the other day in the CB I mentioned such a feature would be nice to have in one's Message Inbox), I humbly offer the following:
<script language="javascript"><!--
function check_all_deletemsg(){
var lb = "\x5B";
var rb = "\x5D"
var elements = document.getElementsByTagName('input');
var elnum;
for(elnum=0;elnum<elements.length;elnum++){
var el = eval("elements"+lb+"elnum"+rb);
var s = el.name;
if (( el.type == 'checkbox') && ( s.substring(0,9) == 'deletem
+sg' )) {
el.checked = true;
}
}
}
//--></script>
<p><a href="javascript:check_all_deletemsg()">Check All Deletemsg</a><
+/p>
<script language="javascript"><!--
function clear_all_deletemsg(){
var lb = "\x5B";
var rb = "\x5D"
var elements = document.getElementsByTagName('input');
var elnum;
for(elnum=0;elnum<elements.length;elnum++){
var el = eval("elements"+lb+"elnum"+rb);
var s = el.name;
if (( el.type == 'checkbox') && ( s.substring(0,9) == 'deletem
+sg' )) {
el.checked = false;
}
}
}
//--></script>
<p><a href="javascript:clear_all_deletemsg()">Clear All Deletemsg</a><
+/p>
(BTW, if you haven't already, hoof it over to Nodelet Settings and add the "Free Nodelet" to your list of nodelets.)
It should be obvious how to modify the code above to check or clear all "Archive" Message Checkboxes if desired. (Update: If it isn't obvious, view the HTML source of the Message Inbox page.)
Update: Many thanks to Corion for pointing out to Yours Truly that this could in fact be accomplished with Javascript!
HTH,
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|