FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » select all and deselect all in thread view [For 2.7.7]
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
select all and deselect all in thread view [For 2.7.7] [message #158151] Thu, 05 February 2009 10:00 Go to next message
Marticus   United States
Messages: 272
Registered: June 2002
Karma: 1
Senior Member
Note: There is a much cleaner solution found in 2.8. Be looking forward to it.

This change will add two links next to the Delete All and Move All Selected boxes at the top and the bottom of thread display. I borrowed the js function from rkquest's post at digitalpoint
--- thread.tmpl.dist    2009-02-05 01:39:24.000000000 -0700
+++ thread.tmpl 2009-02-05 02:51:40.000000000 -0700
@@ -93,7 +93,7 @@
 {SECTION: END}

 {SECTION: thread_list}
-{IF: $MOD || $mo == 8224}<form method="post" action="{TEMPLATE: thread_mod_mass_lnk}">{ENDIF}
+{IF: $MOD || $mo == 8224}<form method="post" action="{TEMPLATE: thread_mod_mass_lnk}" name="frmthreadsel">{ENDIF}
 <table border="0" cellspacing="1" cellpadding="2" class="pad">
 <tr>
    <th>&nbsp;</th>
@@ -106,14 +106,14 @@
 {TEMPLATE-DATA: announcements}
 {IF: $MOD || $mo == 8224}
 <tr>
-   <td colspan="3" class="RowStyleC ar"><input type="submit" class="button" name="del_sel_all" value="{MSG: thread_del_all}"> <input type="submit" class="button" name="mov_sel_all" value="{MSG: thread_mov_all}"></td>
+   <td colspan="3" class="RowStyleC ar"><input type="submit" class="button" name="del_sel_all" value="{MSG: thread_del_all}"> <input type="submit" class="button" name="mov_sel_all" value="{MSG: thread_mov_all}"> <a href="javascript:thread_select(1)">{MSG: select_all}</a> <a href="javascript:thread_select(0)">{MSG: deselect_all}</a></td>
    <td colspan="3" class="RowStyleC"> </td>
 </tr>
 {ENDIF}
 {TEMPLATE-DATA: thread_list_table_data}
 {IF: $MOD || $mo == 8224}
 <tr>
-   <td colspan="3" class="RowStyleC ar"><input type="submit" class="button" name="del_sel_all" value="{MSG: thread_del_all}"> <input type="submit" class="button" name="mov_sel_all" value="{MSG: thread_mov_all}"></td>
+   <td colspan="3" class="RowStyleC ar"><input type="submit" class="button" name="del_sel_all" value="{MSG: thread_del_all}"> <input type="submit" class="button" name="mov_sel_all" value="{MSG: thread_mov_all}"> <a href="javascript:thread_select(1)">{MSG: select_all}</a> <a href="javascript:thread_select(0)">{MSG: deselect_all}</a></td>
    <td colspan="3" class="RowStyleC"> </td>
 </tr>
 {ENDIF}
--- msg 2009-02-05 02:55:07.000000000 -0700
+++ msg.dist    2009-02-05 02:54:58.000000000 -0700
@@ -1004,6 +1004,8 @@
 search_results_hdr:            {VAR: total} Search Results Found
 thread_del_all:                        Delete All Selected
 thread_mov_all:                        Move All Selected
+select_all:                            Select All
+deselect_all:                  Deselect All
 dmsg_ip:                       IP:
 err_blockedaccnt_title:                ERROR: Your account has been filtered out.
 err_blockedaccnt_msg:          Your account has been blocked from accessing the forum due to one of the installed user filters.
--- lib.js.dist 2009-02-05 01:50:24.000000000 -0700
+++ lib.js  2009-02-05 02:58:27.000000000 -0700
@@ -16,6 +16,15 @@
 var OPERA = navigator.userAgent.indexOf("Opera") > -1 ? 1 : 0;
 var MAC = navigator.userAgent.indexOf("Mac") > -1 ? 1 : 0;

+/* select or deselect all, see thread.tmpl */
+function thread_select(a) {
+    var theForm = document.frmthreadsel;
+    for (i=0; i<theForm.elements.length; i++) {
+        if (theForm.elements[i].name=='_sel[]')
+            theForm.elements[i].checked = a;
+    }
+}
+
 /* edit box stuff */
 function insertTag(obj, stag, etag)
 {

[Updated on: Thu, 05 February 2009 11:08]

Report message to a moderator

Re: select all and deselect all in thread view [message #158153 is a reply to message #158151] Thu, 05 February 2009 10:33 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
A similar patch was implemented as part of the 2.8 RC1 release. Here is the code: http://cvs.prohost.org/c/index.cgi/FUDforum/chngview?cn=11817

I would appreciate if you can test the new release and let me know if it meets your requirement.

Best regards.

Frank
Re: select all and deselect all in thread view [message #158157 is a reply to message #158151] Thu, 05 February 2009 11:07 Go to previous messageGo to next message
Marticus   United States
Messages: 272
Registered: June 2002
Karma: 1
Senior Member
Wow, I like it. Very clean looking.
Re: select all and deselect all in thread view [message #158163 is a reply to message #158157] Thu, 05 February 2009 18:36 Go to previous message
kerryg is currently offline  kerryg   Canada
Messages: 157
Registered: September 2008
Karma: 0
Senior Member
Excellent, new "select/deselect all" works like a charm and fits the bill perfectly. Thanks!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: sync up group members with wow roster [Works with armory as of Feb 04, 2009]
Next Topic: Adding FUDcode tags for (WoW) ItemStats
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 12:21:14 GMT 2024

Total time taken to generate the page: 0.02297 seconds