Revision ae6814a2
Added by Phil Davis over 9 years ago
src/usr/local/www/firewall_nat.php | ||
---|---|---|
424 | 424 |
cursor: 'grabbing', |
425 | 425 |
update: function(event, ui) { |
426 | 426 |
$('#order-store').removeAttr('disabled'); |
427 |
dirty = true; |
|
427 | 428 |
} |
428 | 429 |
}); |
429 | 430 |
|
430 | 431 |
// Check all of the rule checkboxes so that their values are posted |
431 | 432 |
$('#order-store').click(function () { |
432 | 433 |
$('[id^=frc]').prop('checked', true); |
434 |
|
|
435 |
// Suppress the "Do you really want to leave the page" message |
|
436 |
saving = true; |
|
437 |
}); |
|
438 |
|
|
439 |
// Globals |
|
440 |
saving = false; |
|
441 |
dirty = false; |
|
442 |
|
|
443 |
// provide a warning message if the user tries to change page before saving |
|
444 |
$(window).bind('beforeunload', function(){ |
|
445 |
if (!saving && dirty) { |
|
446 |
return ("<?=gettext('You have moved one or more Port Forward rules but have not yet saved')?>"); |
|
447 |
} else { |
|
448 |
return undefined; |
|
449 |
} |
|
433 | 450 |
}); |
434 | 451 |
}); |
435 | 452 |
//]]> |
src/usr/local/www/firewall_nat_1to1.php | ||
---|---|---|
303 | 303 |
cursor: 'grabbing', |
304 | 304 |
update: function(event, ui) { |
305 | 305 |
$('#order-store').removeAttr('disabled'); |
306 |
dirty = true; |
|
306 | 307 |
} |
307 | 308 |
}); |
308 | 309 |
|
309 | 310 |
// Check all of the rule checkboxes so that their values are posted |
310 | 311 |
$('#order-store').click(function () { |
311 | 312 |
$('[id^=frc]').prop('checked', true); |
313 |
|
|
314 |
// Suppress the "Do you really want to leave the page" message |
|
315 |
saving = true; |
|
316 |
}); |
|
317 |
|
|
318 |
// Globals |
|
319 |
saving = false; |
|
320 |
dirty = false; |
|
321 |
|
|
322 |
// provide a warning message if the user tries to change page before saving |
|
323 |
$(window).bind('beforeunload', function(){ |
|
324 |
if (!saving && dirty) { |
|
325 |
return ("<?=gettext('You have moved one or more NAT 1:1 mappings but have not yet saved')?>"); |
|
326 |
} else { |
|
327 |
return undefined; |
|
328 |
} |
|
312 | 329 |
}); |
313 | 330 |
}); |
314 | 331 |
//]]> |
src/usr/local/www/firewall_nat_npt.php | ||
---|---|---|
281 | 281 |
cursor: 'grabbing', |
282 | 282 |
update: function(event, ui) { |
283 | 283 |
$('#order-store').removeAttr('disabled'); |
284 |
dirty = true; |
|
284 | 285 |
} |
285 | 286 |
}); |
286 | 287 |
|
287 | 288 |
// Check all of the rule checkboxes so that their values are posted |
288 | 289 |
$('#order-store').click(function () { |
289 | 290 |
$('[id^=frc]').prop('checked', true); |
291 |
|
|
292 |
// Suppress the "Do you really want to leave the page" message |
|
293 |
saving = true; |
|
294 |
}); |
|
295 |
|
|
296 |
// Globals |
|
297 |
saving = false; |
|
298 |
dirty = false; |
|
299 |
|
|
300 |
// provide a warning message if the user tries to change page before saving |
|
301 |
$(window).bind('beforeunload', function(){ |
|
302 |
if (!saving && dirty) { |
|
303 |
return ("<?=gettext('You have moved one or more NPt mappings but have not yet saved')?>"); |
|
304 |
} else { |
|
305 |
return undefined; |
|
306 |
} |
|
290 | 307 |
}); |
291 | 308 |
}); |
292 | 309 |
//]]> |
src/usr/local/www/firewall_nat_out.php | ||
---|---|---|
684 | 684 |
cursor: 'grabbing', |
685 | 685 |
update: function(event, ui) { |
686 | 686 |
$('#order-store').removeAttr('disabled'); |
687 |
dirty = true; |
|
687 | 688 |
} |
688 | 689 |
}); |
689 | 690 |
|
690 | 691 |
// Check all of the rule checkboxes so that their values are posted |
691 | 692 |
$('#order-store').click(function () { |
692 | 693 |
$('[id^=frc]').prop('checked', true); |
694 |
|
|
695 |
// Suppress the "Do you really want to leave the page" message |
|
696 |
saving = true; |
|
697 |
}); |
|
698 |
|
|
699 |
// Globals |
|
700 |
saving = false; |
|
701 |
dirty = false; |
|
702 |
|
|
703 |
// provide a warning message if the user tries to change page before saving |
|
704 |
$(window).bind('beforeunload', function(){ |
|
705 |
if (!saving && dirty) { |
|
706 |
return ("<?=gettext('You have moved one or more NAT outbound mappings but have not yet saved')?>"); |
|
707 |
} else { |
|
708 |
return undefined; |
|
709 |
} |
|
693 | 710 |
}); |
694 | 711 |
}); |
695 | 712 |
//]]> |
Also available in: Unified diff
Add leaving page message to NAT pages
These pages use the draggable/sortable rows stuff, so could use the same
warning message if the user tries to change page before saving