summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2016-03-14 17:08:24 -0400
committerStephen Beaver <sbeaver@netgate.com>2016-03-14 17:08:47 -0400
commit3f597adbf9bf72433f1869f7754187ce647e1703 (patch)
treeb2796722ad57252c8f7bddf0f54c7668c9454467 /src
parent533bce6f753a673cced9acc96d982bd24557fd68 (diff)
downloadpfsense-3f597adbf9bf72433f1869f7754187ce647e1703.zip
pfsense-3f597adbf9bf72433f1869f7754187ce647e1703.tar.gz
Re-commit change
Diffstat (limited to 'src')
-rw-r--r--src/usr/local/www/firewall_rules.php26
-rw-r--r--src/usr/local/www/jquery/pfSenseHelpers.js8
2 files changed, 32 insertions, 2 deletions
diff --git a/src/usr/local/www/firewall_rules.php b/src/usr/local/www/firewall_rules.php
index cd05fbf..2d16205 100644
--- a/src/usr/local/www/firewall_rules.php
+++ b/src/usr/local/www/firewall_rules.php
@@ -789,6 +789,7 @@ foreach ($a_filter as $filteri => $filterent):
</td>
<td class="action-icons">
<!-- <?=(isset($filterent['disabled']) ? 'enable' : 'disable')?> -->
+ <a class="fa fa-anchor icon-pointer" id="Xmove_<?=$filteri?>" title="<?=gettext("Move checked rules above this one")?>"></a>
<a href="firewall_rules_edit.php?id=<?=$filteri;?>" class="fa fa-pencil" title="<?=gettext('Edit')?>"></a>
<a href="firewall_rules_edit.php?dup=<?=$filteri;?>" class="fa fa-clone" title="<?=gettext('Copy')?>"></a>
<?php if (isset($filterent['disabled'])) {
@@ -900,6 +901,30 @@ configsection = "filter";
events.push(function() {
+ // "Move to here" (anchor) action
+ $('[id^=Xmove_]').click(function (event) {
+
+ event.stopImmediatePropagation();
+
+ var anchor_row = $(this).parents("tr:first");
+
+ $('#ruletable > tbody > tr').each(function() {
+ ruleid = this.id.slice(2);
+
+ if (ruleid && !isNaN(ruleid)) {
+ if ($('#frc' + ruleid).prop('checked')) {
+ $(this).insertBefore(anchor_row);
+ fr_toggle(ruleid, "fr");
+ }
+ }
+ });
+
+ $('#order-store').removeAttr('disabled');
+ reindex_rules($(anchor_row).parent('tbody'));
+ dirty = true;
+
+ });
+
// Make rules sortable. Hiding the table before applying sortable, then showing it again is
// a work-around for very slow sorting on FireFox
$('table tbody.user-entries').hide();
@@ -934,7 +959,6 @@ events.push(function() {
return undefined;
}
});
-
});
//]]>
</script>
diff --git a/src/usr/local/www/jquery/pfSenseHelpers.js b/src/usr/local/www/jquery/pfSenseHelpers.js
index 70151ca..9e90e5d 100644
--- a/src/usr/local/www/jquery/pfSenseHelpers.js
+++ b/src/usr/local/www/jquery/pfSenseHelpers.js
@@ -579,9 +579,15 @@ $('.container .panel-heading a[data-toggle="collapse"]').each(function (idx, el)
section.find('tr').each(function() {
if(this.id) {
$(this).attr("id", "fr" + row);
+ $(this).attr("onclick", "fr_toggle(" + row + ")")
+ $(this).find('input:checkbox:first').each(function() {
+ $(this).attr("id", "frc" + row);
+ $(this).attr("onclick", "fr_toggle(" + row + ")");
+ });
+
row++;
}
- })
+ });
}
function handle_colors() {
OpenPOWER on IntegriCloud