Commit dbe93caa authored by sikeda's avatar sikeda
Browse files

[dev] Deprecating toggle_selection() in sympa.js. Event handler will be...

[dev] Deprecating toggle_selection() in sympa.js.  Event handler will be registered instead.  That function embedded in earlier archives will be invalidated.


git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@12960 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 3c87611b
......@@ -211,8 +211,10 @@ IDXPGEND
<input type="hidden" name="month" value="$mois$" />
<input type="hidden" name="action" value="remove_arc" />
<input type="hidden" name="list" value ="($tag$% list %$tag$)" />
<input class="MainMenuLinks" type="button" value="($tag$%|loc%$tag$)Toggle Selection($tag$%END%$tag$)" onclick="toggle_selection(document.forms['msglist'].msgid)" />
<input type="submit" class="MainMenuLinks" name="action_remove_arc" value="($tag$%|loc%$tag$)Tag messages for deletion($tag$%END%$tag$)" /><br />
<input class="MainMenuLinks" type="button"
value="($tag$%|loc%$tag$)Toggle Selection($tag$%END%$tag$)" />
<input type="submit" class="MainMenuLinks" name="action_remove_arc"
value="($tag$%|loc%$tag$)Tag messages for deletion($tag$%END%$tag$)" /><br />
<br />
</form>
......@@ -327,8 +329,10 @@ TIDXPGEND
<input type="hidden" name="month" value="$mois$" />
<input type="hidden" name="action" value="remove_arc" />
<input type="hidden" name="list" value ="($tag$% list %$tag$)" />
<input class="MainMenuLinks" type="button" value="($tag$%|loc%$tag$)Toggle Selection($tag$%END%$tag$)" onclick="toggle_selection(document.forms['msglist'].msgid)" />
<input type="submit" class="MainMenuLinks" name="action_remove_arc" value="($tag$%|loc%$tag$)Tag messages for deletion($tag$%END%$tag$)" /><br />
<input class="MainMenuLinks" type="button"
value="($tag$%|loc%$tag$)Toggle Selection($tag$%END%$tag$)" />
<input type="submit" class="MainMenuLinks" name="action_remove_arc"
value="($tag$%|loc%$tag$)Tag messages for deletion($tag$%END%$tag$)" /><br />
<br />
</form>
($tag$%END%$tag$)<br />
......
<!-- $Id$ -->
<h2>[%|loc%]Listing of shared documents to moderate[%END%]</h2>
[% IF shared_doc.children %]
<form class="noborder" action="[% path_cgi %]" method="post" name="moderate_shared">
<form class="noborder toggleContainer" data-toggle-selector="input[name='id']"
action="[% path_cgi %]" method="POST" name="moderate_shared">
<fieldset>
<input type="hidden" name="list" value="[% list %]" />
<input class="MainMenuLinks" type="submit" name="action_d_install_shared" value="[%|loc%]Install[%END%]" />
......@@ -11,11 +12,14 @@
<table class="responsive listOfItems">
<caption>[%|loc%]Listing of documents shared to moderate[%END%]</caption>
<tr>
<th><a href="#" onclick="toggle_selection(document.moderate_shared.id)" title="[%|loc%]Toggle Selection[%END%]"><i class="fa fa-check-square-o"></i></a></th>
<th><a href="#"
data-tooltip aria-haspopup="true"
title="[%|loc%]Toggle Selection[%END%]"
class="toggleButton"><i class="fa fa-check-square-o"></i></a></th>
<th>[%|loc%]Date[%END%]</th>
<th>[%|loc%]Author[%END%]</th>
<th>[%|loc%]Path[%END%]</th>
<th>[%|loc%]Size[%END%] </th>
<th>[%|loc%]Author[%END%]</th>
<th>[%|loc%]Path[%END%]</th>
<th>[%|loc%]Size[%END%] </th>
</tr>
[% FOREACH f = shared_doc.children %]
<tr>
......@@ -38,7 +42,8 @@
[% END %]
</table>
<input class="MainMenuLinks" type="button" value="[%|loc%]Toggle Selection[%END%]" onclick="toggle_selection(document.moderate_shared.id)" />
<input class="MainMenuLinks toggleButton" type="button"
value="[%|loc%]Toggle Selection[%END%]" />
<br /><br />
<input class="MainMenuLinks" type="submit" name="action_d_install_shared" value="[%|loc%]Install[%END%]" />
<input class="MainMenuLinks" type="submit" name="action_d_reject_shared.quiet" value="[%|loc%]Reject[%END%]" />
......
<!-- $Id$ -->
<form name="myform" action="[% path_cgi %]" method="post">
<form name="myform"
class="toggleContainer" data-toggle-selector="input[name='selected_lists']"
action="[% path_cgi %]" method="POST">
<fieldset>
<h2>[%|loc%]Closed lists[%END%]</h2>
......@@ -8,7 +10,10 @@
<table class="responsive table_style">
<caption>[%|loc%]Closed lists[%END%]</caption>
<tr class="color_light">
<th><a href="#" onclick="toggle_selection(document.myform.selected_lists);return false;" title="[%|loc%]Toggle Selection[%END%]"><i class="fa fa-check-square-o"></i> </a></th>
<th><a href="#"
data-tooltip aria-haspopup="true"
title="[%|loc%]Toggle Selection[%END%]"
class="toggleButton"><i class="fa fa-check-square-o"></i> </a></th>
<th>[%|loc%]list name[%END%]</th>
<th>[%|loc%]list subject[%END%]</th>
<th>[%|loc%]Requested by[%END%]</th>
......@@ -28,7 +33,8 @@
</tr>
[% END %]
</table>
<input class="MainMenuLinks" type="button" value="[%|loc%]Toggle Selection[%END%]" onclick="toggle_selection(document.myform.selected_lists)" />
<input class="MainMenuLinks toggleButton" type="button"
value="[%|loc%]Toggle Selection[%END%]" />
<input class="MainMenuLinks" type="submit" name="action_purge_list" value="[%|loc%]Purge selected lists[%END%]" />
[% ELSE %]
......
......@@ -73,7 +73,8 @@
<hr>
<h3>[%|loc%]Subscriber Table[%END%]</h3>
<form name="myform" action="[% path_cgi %]" method="post">
<form class="toggleContainer" data-toggle-selector="input[name='email']"
name="myform" action="[% path_cgi %]" method="POST">
<fieldset>
<input type="hidden" name="previous_action" value="[% action %]" />
<input type="hidden" name="previous_list" value="[% list %]" />
......@@ -96,9 +97,8 @@
[% IF total != 0 %]
[% IF is_owner %]
<div>
<input class="MainMenuLinks" type="button"
value="[%|loc%]Toggle Selection[%END%]"
onclick="toggle_selection(document.myform.email)" />
<input class="MainMenuLinks toggleButton" type="button"
value="[%|loc%]Toggle Selection[%END%]" />
</div>
<div>
<input class="MainMenuLinks" type="submit" name="action_del"
......
......@@ -55,14 +55,18 @@
[% END %]
</div>
<form name="myform" action="[% path_cgi %]" method="post">
<form name="myform" action="[% path_cgi %]" method="POST"
class="toggleContainer" data-toggle-selector="input[name='email']">
<fieldset>
<input type="hidden" name="list" value="[% list %]" />
<input type="hidden" name="previous_action" value="reviewbouncing" />
<table class="listOfItems">
<caption>[%|loc%]Table which display list bounces[%END%]</caption>
<tr>
<th rowspan="2"><a href="#" onclick="toggle_selection(document.myform.email);return false;" title="[%|loc%]Toggle Selection[%END%]"><i class="fa fa-check-square-o"></i> </a></th>
<th rowspan="2"><a href="#"
data-tooltip aria-haspopup="true"
title="[%|loc%]Toggle Selection[%END%]"
class="toggleButton"><i class="fa fa-check-square-o"></i> </a></th>
<th rowspan="2">[%|loc%]Email[%END%]</th>
<th rowspan="2">[%|loc%]Bounce score[%END%]</th>
<th colspan="3">[%|loc%]Details[%END%]</th>
......@@ -139,7 +143,8 @@
</div>
[% END %]
<input class="MainMenuLinks" type="button" value="[%|loc%]Toggle Selection[%END%]" onclick="toggle_selection(document.myform.email)" />
<input class="MainMenuLinks toggleButton" type="button"
value="[%|loc%]Toggle Selection[%END%]" />
</fieldset>
</form>
[% ELSE %]
......
......@@ -8,8 +8,9 @@ he should be included via an external data source. Users get into the exclusion
They get off the exclusion table with the standard subscribe/add functions.[%END%]</p>
[% IF exclude_users ~%]
<form class="noborder" action="[% path_cgi %]" method="post"
name="show_exclude">
<form class="noborder toggleContainer"
data-toggle-selector="input[name='email']"
action="[% path_cgi %]" method="POST" name="show_exclude">
<fieldset>
<input type="hidden" name="previous_list" value="[% list %]" />
<input type="hidden" name="list" value="[% list %]" />
......@@ -18,10 +19,9 @@ They get off the exclusion table with the standard subscribe/add functions.[%END
<tr>
[% IF is_listmaster || is_owner || may_add ~%]
<th><a href="#"
onclick="toggle_selection(document.show_exclude.email);return false;"
title="[%|loc%]Toggle Selection[%END%]">
<i class="fa fa-check-square-o"></i>
</a></th>
data-tooltip aria-haspopup="true"
title="[%|loc%]Toggle Selection[%END%]"
class="toggleButton"><i class="fa fa-check-square-o"></i> </a></th>
[%~ END %]
<th>[%|loc%]Email[%END%]</th>
<th>[%|loc%]Since[%END%]</th>
......@@ -42,9 +42,8 @@ They get off the exclusion table with the standard subscribe/add functions.[%END
[% IF may_add ~%]
<div>
<input class="MainMenuLinks" type="button"
value="[%|loc%]Toggle Selection[%END%]"
onclick="toggle_selection(document.show_exclude.email)" />
<input class="MainMenuLinks toggleButton" type="button"
value="[%|loc%]Toggle Selection[%END%]" />
</div>
<div>
<input class="MainMenuLinks" type="submit" name="action_add"
......
......@@ -2,15 +2,19 @@
<h2>[%|loc%]Listing unsubscription to moderate[%END%]</h2>
[% IF mod_signoff %]
<form class="noborder" action="[% path_cgi %]" method="post" name="myform">
<form class="noborder toggleContainer" data-toggle-selector="input[name='id']"
action="[% path_cgi %]" method="POST" name="myform">
<fieldset>
<input type="hidden" name="list" value="[% list %]" />
<table class="responsive listOfItems">
<caption>[%|loc%]Listing unsubscription to moderate[%END%]</caption>
<tr>
<th><a href="#" onclick="toggle_selection(document.myform.id);return false;" title="[%|loc%]Toggle Selection[%END%]"><i class="fa fa-check-square-o"></i> </a></strong></th>
<th colspan="2">[%|loc%]Email[%END%]</th>
<th>[%|loc%]Date[%END%]</th>
<th><a href="#"
data-tooltip aria-haspopup="true"
title="[%|loc%]Toggle Selection[%END%]"
class="toggleButton"><i class="fa fa-check-square-o"></i> </a></th>
<th colspan="2">[%|loc%]Email[%END%]</th>
<th>[%|loc%]Date[%END%]</th>
</tr>
[% IF signoffs %]
......@@ -48,9 +52,8 @@
<input type="hidden" name="previous_action" value="sigindex" />
<input type="hidden" name="previous_list" value="[% list %]" />
<div>
<input class="MainMenuLinks" type="button"
value="[%|loc%]Toggle Selection[%END%]"
onclick="toggle_selection(document.myform.id)" />
<input class="MainMenuLinks toggleButton" type="button"
value="[%|loc%]Toggle Selection[%END%]" />
</div>
<div>
<input class="MainMenuLinks" type="submit" name="action_del_fromsig"
......
......@@ -2,13 +2,17 @@
<h2>[%|loc%]Listing subscription to moderate[%END%]</h2>
[% IF mod_subscription %]
<form class="noborder" action="[% path_cgi %]" method="post" name="myform">
<form class="noborder toggleContainer" data-toggle-selector="input[name='id']"
action="[% path_cgi %]" method="POST" name="myform">
<fieldset>
<input type="hidden" name="list" value="[% list %]" />
<table class="responsive listOfItems">
<caption>[%|loc%]Listing subscription to moderate[%END%]</caption>
<tr>
<th><a href="#" onclick="toggle_selection(document.myform.id);return false;" title="[%|loc%]Toggle Selection[%END%]"><i class="fa fa-check-square-o"></i> </a></strong></th>
<th><a href="#"
data-tooltip aria-haspopup="true"
title="[%|loc%]Toggle Selection[%END%]"
class="toggleButton"><i class="fa fa-check-square-o"></i> </a></th>
<th colspan="2">[%|loc%]Email[%END%]</th>
<th>[%|loc%]Name[%END%]</th>
<th>[%|loc%]Date[%END%]</th>
......@@ -55,7 +59,8 @@
</table>
<input type="hidden" name="previous_action" value="subindex" />
<input type="hidden" name="previous_list" value="[% list %]" />
<input class="MainMenuLinks" type="button" value="[%|loc%]Toggle Selection[%END%]" onclick="toggle_selection(document.myform.id)" />
<input class="MainMenuLinks toggleButton" type="button"
value="[%|loc%]Toggle Selection[%END%]" />
<input class="MainMenuLinks" type="submit" name="action_add_fromsub" value="[%|loc%]Add selected addresses[%END%]" />
<input class="MainMenuLinks" type="submit" name="action_ignoresub" value="[%|loc%]Reject selected addresses[%END%]" />
</fieldset>
......
......@@ -4,11 +4,14 @@
<caption>[%|loc%]List members[%END%]</caption>
<tbody>
<tr>
[% SET colspan = 0 %]
[% IF is_owner %]
[% SET colspan = colspan + 1 %]
<th><a href="#" onclick="toggle_selection(document.myform.email);return false;" title="[%|loc%]Toggle Selection[%END%]"><i class="fa fa-check-square-o"></i> </a></th>
[% END %]
[% SET colspan = 0 %]
[% IF is_owner %]
[% SET colspan = colspan + 1 %]
<th><a href="#"
data-tooltip aria-haspopup="true"
title="[%|loc%]Toggle Selection[%END%]"
class="toggleButton"><i class="fa fa-check-square-o"></i> </a></th>
[% END %]
[% SET colspan = colspan + 3 %]
[% IF sortby == 'email' %]
......
......@@ -6,7 +6,9 @@
<p>[%|loc%]You are subscribed to the following lists[%END%]</p>
<form class="noborder" action="[% path_cgi %]" method="post" name="suspend_request">
<form class="noborder toggleContainer"
data-toggle-selector="input[name='listname']"
action="[% path_cgi %]" method="POST" name="suspend_request">
[% IF which_info.size %]
<div class="item_list">
[% FOREACH l = which_info %]
......@@ -72,7 +74,8 @@
<p>[%|loc%]You can bulk suspend or revoke your memberships by selecting relevant lists and using the buttons below. The suspend option prevents delivery of emails, this can be useful if you are out of the office for some time.[%END%]</p>
<input class="MainMenuLinks" type="button" value="[%|loc%]Toggle selection[%END%]" onclick="toggle_selection(document.suspend_request.listname)" />
<input class="MainMenuLinks toggleButton" type="button"
value="[%|loc%]Toggle selection[%END%]" />
<br />
<input type="hidden" name="action" value="suspend_request_action"/>
......
......@@ -24,13 +24,30 @@ $(function() {
*/
function isNotEmpty(i) { return true; }
function request_confirm(m) { return true; }
function toggle_selection(myfield) { return false; }
function toggle_selection(myfield) {
if(typeof myfield.length == 'undefined') myfield = [myfield];
$.each(myfield, function() {
$(this).prop('checked', !$(this).is(':checked'));
/* Toggle selection. */
/* Fields included in .toggleContainer and specified by data-selector
* will be toggled by clicking .toggleButton. */
$(function() {
/* Compatibility for older archives created by Sympa prior to 6.2.17. */
$('form#msglist').each(function(){
$(this).addClass('toggleContainer')
.data('toggle-selector', 'input[name="msgid"]');
$(this).find('input[type="button"]').addClass('toggleButton');
});
}
$('.toggleContainer').each(function(){
var container = this;
var selector = $(this).data('toggle-selector');
$(this).find('.toggleButton').on('click', function(){
$(container).find(selector).each(function(){
$(this).prop('checked', !$(this).is(':checked'));
});
return false;
});
});
});
function chooseColorNumber(cn, cv) {
$('#custom_color_number').val(cn);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment