PluginProbe
404 Solution / trunk
404 Solution vtrunk
4.3.5 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.2.0 4.1.19 4.1.18 4.1.17 4.1.16 4.1.15 4.1.13 4.1.12 4.1.11 4.1.10 4.1.9 4.1.8 4.1.7 4.1.6 4.1.5 4.1.4 4.1.3 trunk 2.30.0 All 109 releases
404-solution / includes / html / redirectConditionsScript.html

redirectConditionsScript.html in 404 Solution trunk, at includes/html/redirectConditionsScript.html

37 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <script type="text/javascript">
2 (function() {
3 var abj404ConditionIndex = {initial_index};
4
5 window.abj404AddConditionRow = function() {
6 var template = document.getElementById('abj404-condition-row-template');
7 if (!template) { return; }
8 var html = template.innerHTML.replace(/__IDX__/g, String(abj404ConditionIndex));
9 var container = document.getElementById('abj404-conditions-container');
10 if (!container) { return; }
11 var div = document.createElement('div');
12 div.innerHTML = html;
13 while (div.firstChild) {
14 container.appendChild(div.firstChild);
15 }
16 abj404UpdateConditionSortOrders();
17 abj404ConditionIndex++;
18 };
19
20 window.abj404RemoveConditionRow = function(btn) {
21 var row = btn.closest('.abj404-condition-row');
22 if (row) {
23 row.parentNode.removeChild(row);
24 abj404UpdateConditionSortOrders();
25 }
26 };
27
28 function abj404UpdateConditionSortOrders() {
29 var rows = document.querySelectorAll('#abj404-conditions-container .abj404-condition-row');
30 for (var i = 0; i < rows.length; i++) {
31 var so = rows[i].querySelector('.abj404-condition-sort-order');
32 if (so) { so.value = String(i); }
33 }
34 }
35 }());
36 </script>
37