Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Free Nodelet Hack: Check or Clear all "Delete" Message Checkboxes in Your Message Inbox

by planetscape (Canon)
on Jul 15, 2005 at 07:43 UTC ( #475126=monkdiscuss: print w/ replies, xml ) Need Help??

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,

planetscape

Comment on Free Nodelet Hack: Check or Clear all "Delete" Message Checkboxes in Your Message Inbox
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: monkdiscuss [id://475126]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2014-07-13 06:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (247 votes), past polls