Project

General

Profile

« Previous | Next » 

Revision 96c18fe4

Added by Stephen Beaver almost 10 years ago

Addresses #5159 by removing hide/show/disable/enable functions to included file

View differences:

src/usr/local/www/diag_backup.php
776 776
<script type="text/javascript">
777 777
//<![CDATA[
778 778
events.push(function(){
779
	//---------- "Standard" show/hide functions ---------------------------------------------------
780

  
781
	// Hides all elements of the specified class. This will usually be a section or group
782
	function hideClass(s_class, hide) {
783
		if(hide)
784
			$('.' + s_class).hide();
785
		else
786
			$('.' + s_class).show();
787
	}
788

  
789
	// Hides all elements of the specified class belonging to a multiselect.
790
	function hideMultiClass(s_class, hide) {
791
		if(hide)
792
			$('.' + s_class).parent().parent().hide();
793
		else
794
			$('.' + s_class).parent().parent().show();
795
	}
796

  
797
	// Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden
798
	function hideInput(id, hide) {
799
		if(hide)
800
			$('#' + id).parent().parent('div').addClass('hidden');
801
		else
802
			$('#' + id).parent().parent('div').removeClass('hidden');
803
	}
804

  
805
	// Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden
806
	function hideCheckbox(id, hide) {
807
		if(hide)
808
			$('#' + id).parent().parent().parent('div').addClass('hidden');
809
		else
810
			$('#' + id).parent().parent().parent('div').removeClass('hidden');
811
	}
812

  
813
	// Disables the specified input element
814
	function disableInput(id, disable) {
815
		$('#' + id).prop("disabled", disable);
816
	}
817 779

  
818 780
	// ------- Show/hide sections based on checkbox settings --------------------------------------
819 781
	
src/usr/local/www/diag_logs_settings.php
189 189
		$retval = 0;
190 190
		$retval = system_syslogd_start();
191 191
		if (($oldnologdefaultblock !== isset($config['syslog']['nologdefaultblock'])) ||
192
		    ($oldnologdefaultpass !== isset($config['syslog']['nologdefaultpass'])) ||
193
		    ($oldnologbogons !== isset($config['syslog']['nologbogons'])) ||
194
		    ($oldnologprivatenets !== isset($config['syslog']['nologprivatenets']))) {
192
			($oldnologdefaultpass !== isset($config['syslog']['nologdefaultpass'])) ||
193
			($oldnologbogons !== isset($config['syslog']['nologbogons'])) ||
194
			($oldnologprivatenets !== isset($config['syslog']['nologprivatenets']))) {
195 195
			$retval |= filter_configure();
196 196
		}
197 197

  
......
462 462
	$pconfig['hostapd']
463 463
));
464 464

  
465
// Ugly hack to prevent the "Toggle all" button from being automatically
465
// Ugly hack to prevent the "Toggle all" button from being automatically created
466 466
$group->add(new Form_MultiCheckbox(
467 467
	'notoggleall',
468 468
	null,
......
477 477
$section->add($group);
478 478

  
479 479
$form->add($section);
480

  
480 481
print $form;
481 482
?>
482 483
<script>
483 484
//<![CDATA[
484 485
events.push(function(){
485 486

  
486
	function hideSelect(id, hide) {
487
		if(hide)
488
			$('#' + id).parent('div').parent('div').addClass('hidden');
489
		else
490
			$('#' + id).parent('div').parent('div').removeClass('hidden');
491
	}
492

  
493
	//---------- "Standard" show/hide functions ---------------------------------------------------
494
	
495
	function hideClass(s_class, hide) {
496
		if(hide)
497
			$('.' + s_class).hide();
498
		else
499
			$('.' + s_class).show();
500
	}
487
	hideMultiCheckbox('notoggleall', true);
501 488

  
502
	function hideInput(id, hide) {
503
		if(hide)
504
			$('#' + id).parent().addClass('hidden');
505
		else
506
			$('#' + id).parent().removeClass('hidden');
507
	}
489
	// ---------- Click checkbox handlers ---------------------------------------------------------
508 490

  
509
	function disableInput(id, disable) {
510
		$('#' + id).prop("disabled", disable);
511
	}
491
	$('#logall').click(function () {
492
		disableEverything();
493
	});
512 494

  
513
	hideInput('notoggleall', true);
495
	 $('#enable').click(function () {
496
		hideClass('remotelogging', !this.checked);
497
		hideSelect('sourceip', !this.checked);
498
		hideSelect('ipproto', !this.checked);
499
		hideMultiCheckbox('notoggleall', true);
500
	});
514 501

  
515 502
	function disableEverything() {
516 503
		var hide = $('#logall').prop('checked');
......
525 512
		disableInput('hostapd', hide);
526 513
	}
527 514

  
528
	// ---------- Click checkbox handlers ---------------------------------------------------------
529

  
530
	$('#logall').click(function () {
531
		disableEverything();
532
	});
533

  
534
	 $('#enable').click(function () {
535
		hideClass('remotelogging', !this.checked);
536
		hideSelect('sourceip', !this.checked);
537
		hideSelect('ipproto', !this.checked);
538
	});
539

  
540 515
	// ---------- On initial page load ------------------------------------------------------------
541 516

  
542
	disableEverything();
543 517
	hideClass('remotelogging', !$('#enable').prop('checked'));
544 518
	hideSelect('sourceip', !$('#enable').prop('checked'));
545 519
	hideSelect('ipproto', !$('#enable').prop('checked'));
......
548 522
</script>
549 523

  
550 524
<?php
525

  
551 526
include("foot.inc");
src/usr/local/www/firewall_nat_out_edit.php
689 689
events.push(function(){
690 690
	var portsenabled = 1;
691 691

  
692
	// Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden
693
	function hideInput(id, hide) {
694
		if (hide)
695
			$('#' + id).parent().parent('div').addClass('hidden');
696
		else
697
			$('#' + id).parent().parent('div').removeClass('hidden');
698
	}
699

  
700
	// Hides the <div> in which the specified group input element lives so that the input,
701
	// its label and help text are hidden
702
	function hideGroupInput(id, hide) {
703
		if (hide)
704
			$('#' + id).parent('div').addClass('hidden');
705
		else
706
			$('#' + id).parent('div').removeClass('hidden');
707
	}
708

  
709
	// Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden
710
	function hideCheckbox(id, hide) {
711
		if (hide)
712
			$('#' + id).parent().parent().parent('div').addClass('hidden');
713
		else
714
			$('#' + id).parent().parent().parent('div').removeClass('hidden');
715
	}
716

  
717
	// Disables the specified input element
718
	function disableInput(id, disable) {
719
		$('#' + id).prop("disabled", disable);
720
	}
721

  
722
	// Hides all elements of the specified class. This will usually be a section
723
	function hideClass(s_class, hide) {
724
		if (hide)
725
			$('.' + s_class).hide();
726
		else
727
			$('.' + s_class).show();
728
	}
729

  
730
	// Hides all elements of the specified class assigned to a group. This will usually be a group
731
	function hideGroupClass(s_class, hide) {
732
		if (hide)
733
			$('.' + s_class).parent().parent().parent().hide();
734
		else
735
			$('.' + s_class).parent().parent().parent().show();
736
	}
737

  
738 692
	function staticportchange() {
739 693
		if ($('#staticnatport').prop('checked'))	 {
740 694
			$('#natport').val("");
src/usr/local/www/firewall_rules_edit.php
1661 1661
<script>
1662 1662
//<![CDATA[
1663 1663
events.push(function(){
1664
	//---------- "Standard" show/hide functions ---------------------------------------------------
1665

  
1666
	// Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden
1667
	function hideInput(id, hide) {
1668
		if (hide)
1669
			$('#' + id).parent().parent('div').addClass('hidden');
1670
		else
1671
			$('#' + id).parent().parent('div').removeClass('hidden');
1672
	}
1673

  
1674
	// Hides the <div> in which the specified group input element lives so that the input,
1675
	// its label and help text are hidden
1676
	function hideGroupInput(id, hide) {
1677
		if (hide)
1678
			$('#' + id).parent('div').addClass('hidden');
1679
		else
1680
			$('#' + id).parent('div').removeClass('hidden');
1681
	}
1682

  
1683
	// Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden
1684
	function hideCheckbox(id, hide) {
1685
		if (hide)
1686
			$('#' + id).parent().parent().parent('div').addClass('hidden');
1687
		else
1688
			$('#' + id).parent().parent().parent('div').removeClass('hidden');
1689
	}
1690

  
1691
	// Disables the specified input element
1692
	function disableInput(id, disable) {
1693
		$('#' + id).prop("disabled", disable);
1694
	}
1695

  
1696
	// Hides all elements of the specified class. This will usually be a section
1697
	function hideClass(s_class, hide) {
1698
		if (hide)
1699
			$('.' + s_class).hide();
1700
		else
1701
			$('.' + s_class).show();
1702
	}
1703

  
1704
	// Hides all elements of the specified class assigned to a group. This will usually be a group
1705
	function hideGroupClass(s_class, hide) {
1706
		if (hide)
1707
			$('.' + s_class).parent().parent().parent().hide();
1708
		else
1709
			$('.' + s_class).parent().parent().parent().show();
1710
	}
1711 1664

  
1712 1665
	var portsenabled = 1;
1713 1666
	var editenabled = 1;
src/usr/local/www/interfaces.php
3624 3624
		});
3625 3625
	}
3626 3626

  
3627
	// Hides all elements of the specified class. This will usually be a section
3628
	function hideClass(s_class, hide) {
3629
		if(hide)
3630
			$('.' + s_class).hide();
3631
		else
3632
			$('.' + s_class).show();
3633
	}
3634

  
3635
	// Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden
3636
	function hideInput(id, hide) {
3637
		if(hide)
3638
			$('#' + id).parent().parent('div').addClass('hidden');
3639
		else
3640
			$('#' + id).parent().parent('div').removeClass('hidden');
3641
	}
3642

  
3643
	// Hides the <div> in which the specified IP address element lives so that the input, its label and help text are hidden
3644
	function hideIpAddress(id, hide) {
3645
		if(hide)
3646
			$('#' + id).parent().parent().parent('div').addClass('hidden');
3647
		else
3648
			$('#' + id).parent().parent().parent('div').removeClass('hidden');
3649
	}
3650

  
3651
	// Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden
3652
	function hideCheckbox(id, hide) {
3653
		if(hide)
3654
			$('#' + id).parent().parent().parent('div').addClass('hidden');
3655
		else
3656
			$('#' + id).parent().parent().parent('div').removeClass('hidden');
3657
	}
3658

  
3659 3627
	function show_dhcp6adv() {
3660 3628
		var ovr = $('#adv_dhcp6_config_file_override').prop('checked');
3661 3629
		var adv = $('#dhcp6adv').prop('checked');
src/usr/local/www/interfaces_ppps_edit.php
985 985
events.push(function(){
986 986
	var showadvanced = false;
987 987

  
988
	// Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden
989
	function hideInput(id, hide) {
990
		if(hide)
991
			$('#' + id).parent().parent('div').addClass('hidden');
992
		else
993
			$('#' + id).parent().parent('div').removeClass('hidden');
994
	}
995

  
996
	// Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden
997
	function hideCheckbox(id, hide) {
998
		if(hide)
999
			$('#' + id).parent().parent().parent('div').addClass('hidden');
1000
		else
1001
			$('#' + id).parent().parent().parent('div').removeClass('hidden');
1002
	}
1003

  
1004
	// Disables the specified input element
1005
	function disableInput(id, disable) {
1006
		$('#' + id).prop("disabled", disable);
1007
	}
1008

  
1009
	// Hides all elements of the specified class. This will usually be a section or group
1010
	function hideClass(s_class, hide) {
1011
		if(hide)
1012
			$('.' + s_class).hide();
1013
		else
1014
			$('.' + s_class).show();
1015
	}
1016

  
1017
	// Simple test in which clicking the ‘clear’ button toggles certain display elements
1018 988
	function setAdvVisible() {
1019 989
		// Update the button text and toggle showadvanced
1020 990
		if(showadvanced) {
src/usr/local/www/jquery/pfSenseHelpers.js
2 2

  
3 3
// Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden
4 4
function hideInput(id, hide) {
5
    if(hide)
6
        $('#' + id).parent().parent('div').addClass('hidden');
7
    else
8
        $('#' + id).parent().parent('div').removeClass('hidden');
5
	if(hide)
6
		$('#' + id).parent().parent('div').addClass('hidden');
7
	else
8
		$('#' + id).parent().parent('div').removeClass('hidden');
9 9
}
10 10

  
11 11
// Hides the <div> in which the specified group input element lives so that the input,
12 12
// its label and help text are hidden
13 13
function hideGroupInput(id, hide) {
14
    if(hide)
15
        $('#' + id).parent('div').addClass('hidden');
16
    else
17
        $('#' + id).parent('div').removeClass('hidden');
14
	if(hide)
15
		$('#' + id).parent('div').addClass('hidden');
16
	else
17
		$('#' + id).parent('div').removeClass('hidden');
18 18
}
19 19

  
20 20
// Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden
21 21
function hideCheckbox(id, hide) {
22
    if(hide)
23
        $('#' + id).parent().parent().parent('div').addClass('hidden');
24
    else
25
        $('#' + id).parent().parent().parent('div').removeClass('hidden');
22
	if(hide)
23
		$('#' + id).parent().parent().parent('div').addClass('hidden');
24
	else
25
		$('#' + id).parent().parent().parent('div').removeClass('hidden');
26 26
}
27 27

  
28 28
// Disables the specified input element
29 29
function disableInput(id, disable) {
30
    $('#' + id).prop("disabled", disable);
30
	$('#' + id).prop("disabled", disable);
31 31
}
32 32

  
33 33
// Hides all elements of the specified class. This will usually be a section
34 34
function hideClass(s_class, hide) {
35
    if(hide)
36
        $('.' + s_class).hide();
37
    else
38
        $('.' + s_class).show();
35
	if(hide)
36
		$('.' + s_class).hide();
37
	else
38
		$('.' + s_class).show();
39 39
}
40 40

  
41 41
// Hides all elements of the specified class assigned to a group. This will usually be a group
42 42
function hideGroupClass(s_class, hide) {
43
    if(hide)
44
        $('.' + s_class).parent().parent().parent().hide();
45
    else
46
        $('.' + s_class).parent().parent().parent().show();
43
	if(hide)
44
		$('.' + s_class).parent().parent().parent().hide();
45
	else
46
		$('.' + s_class).parent().parent().parent().show();
47 47
}
48 48

  
49
function hideSelect(id, hide) {
50
	if(hide)
51
		$('#' + id).parent('div').parent('div').addClass('hidden');
52
	else
53
		$('#' + id).parent('div').parent('div').removeClass('hidden');
54
}
55

  
56
function hideMultiCheckbox(id, hide) {
57
	if(hide)
58
		$('#' + id).parent().addClass('hidden');
59
	else
60
		$('#' + id).parent().removeClass('hidden');
61
}
62

  
63
// Hides the <div> in which the specified IP address element lives so that the input, its label and help text are hidden
64
function hideIpAddress(id, hide) {
65
	if(hide)
66
		$('#' + id).parent().parent().parent('div').addClass('hidden');
67
	else
68
		$('#' + id).parent().parent().parent('div').removeClass('hidden');
69
}
70

  
71
// Hides all elements of the specified class belonging to a multiselect.
72
function hideMultiClass(s_class, hide) {
73
	if(hide)
74
		$('.' + s_class).parent().parent().hide();
75
	else
76
		$('.' + s_class).parent().parent().show();
77
}
78

  
79
// Hides div whose label contains the specified text. (Good for StaticText)
80
function hideLabel(text, hide) {
81

  
82
	var element = $('label:contains(' + text + ')');
49 83

  
50
	
84
	if(hide)
85
		element.parent('div').addClass('hidden');
86
	else
87
		element.parent('div').removeClass('hidden');
88
}
src/usr/local/www/services_captiveportal.php
1146 1146
<script type="text/javascript">
1147 1147
//<![CDATA[
1148 1148
events.push(function(){
1149
	//---------- "Standard" show/hide functions ---------------------------------------------------
1150

  
1151
	// Hides all elements of the specified class. This will usually be a section or group
1152
	function hideClass(s_class, hide) {
1153
		if(hide)
1154
			$('.' + s_class).hide();
1155
		else
1156
			$('.' + s_class).show();
1157
	}
1158

  
1159
	// Hides all elements of the specified class belonging to a multiselect.
1160
	function hideMultiClass(s_class, hide) {
1161
		if(hide)
1162
			$('.' + s_class).parent().parent().hide();
1163
		else
1164
			$('.' + s_class).parent().parent().show();
1165
	}
1166

  
1167
	// Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden
1168
	function hideInput(id, hide) {
1169
		if(hide)
1170
			$('#' + id).parent().parent('div').addClass('hidden');
1171
		else
1172
			$('#' + id).parent().parent('div').removeClass('hidden');
1173
	}
1174

  
1175
	// Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden
1176
	function hideCheckbox(id, hide) {
1177
		if(hide)
1178
			$('#' + id).parent().parent().parent('div').addClass('hidden');
1179
		else
1180
			$('#' + id).parent().parent().parent('div').removeClass('hidden');
1181
	}
1182

  
1183
	// Disables the specified input element
1184
	function disableInput(id, disable) {
1185
		$('#' + id).prop("disabled", disable);
1186
	}
1187 1149

  
1188 1150
	// ------- Show/hide sections based on checkbox settings --------------------------------------
1189 1151
	function hideSections(hide) {
src/usr/local/www/services_dhcp.php
1337 1337
<script>
1338 1338
//<![CDATA[
1339 1339
events.push(function(){
1340
	var visible = false;
1341

  
1342
	// Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden
1343
	function hideInput(id, hide) {
1344
		if(hide)
1345
			$('#' + id).parent().parent('div').addClass('hidden');
1346
		else
1347
			$('#' + id).parent().parent('div').removeClass('hidden');
1348
	}
1349

  
1350
	// Hides the <div> in which the specified group input element lives so that the input,
1351
	// its label and help text are hidden
1352
	function hideGroupInput(id, hide) {
1353
		if(hide)
1354
			$('#' + id).parent('div').addClass('hidden');
1355
		else
1356
			$('#' + id).parent('div').removeClass('hidden');
1357
	}
1358

  
1359
	// Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden
1360
	function hideCheckbox(id, hide) {
1361
		if(hide)
1362
			$('#' + id).parent().parent().parent('div').addClass('hidden');
1363
		else
1364
			$('#' + id).parent().parent().parent('div').removeClass('hidden');
1365
	}
1366

  
1367
	// Disables the specified input element
1368
	function disableInput(id, disable) {
1369
		$('#' + id).prop("disabled", disable);
1370
	}
1371

  
1372
	// Hides all elements of the specified class. This will usually be a section
1373
	function hideClass(s_class, hide) {
1374
		if(hide)
1375
			$('.' + s_class).hide();
1376
		else
1377
			$('.' + s_class).show();
1378
	}
1379

  
1380
	// Hides all elements of the specified class assigned to a group. This will usually be a group
1381
	function hideGroupClass(s_class, hide) {
1382
		if(hide)
1383
			$('.' + s_class).parent().parent().parent().hide();
1384
		else
1385
			$('.' + s_class).parent().parent().parent().show();
1386
	}
1387 1340

  
1388 1341
	// Row add/delete function for class="repeatable" =================================================================
1389 1342

  
src/usr/local/www/services_dhcp_edit.php
663 663
<script>
664 664
//<![CDATA[
665 665
events.push(function(){
666
	// Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden
667
	function hideInput(id, hide) {
668
		if(hide)
669
			$('#' + id).parent().parent('div').addClass('hidden');
670
		else
671
			$('#' + id).parent().parent('div').removeClass('hidden');
672
	}
673

  
674
	// Hides the <div> in which the specified icheckbox lives so that the input, its label and help text are hidden
675
	// Checkboxes live inside <label></label> tags so we need another parent level
676
	function hideCheckBox(id, hide) {
677
		if(hide)
678
			$('#' + id).parent().parent().parent('div').addClass('hidden');
679
		else
680
			$('#' + id).parent().parent().parent('div').removeClass('hidden');
681
	}
682

  
683
	// Hides all elements of the specified class. This will usually be a section or group
684
	function hideClass(s_class, hide) {
685
		if(hide)
686
			$('.' + s_class).hide();
687
		else
688
			$('.' + s_class).show();
689
	}
690 666

  
691 667
	function hideDDNS(hide) {
692
		hideCheckBox('ddnsupdate', hide);
668
		hideCheckbox('ddnsupdate', hide);
693 669
		hideInput('ddnsdomain', hide);
694 670
		hideInput('ddnsdomainprimary', hide);
695 671
		hideInput('ddnsdomainkeyname', hide);
src/usr/local/www/services_dhcpv6.php
925 925
<script>
926 926
//<![CDATA[
927 927
events.push(function(){
928
	// Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden
929
	function hideInput(id, hide) {
930
		if(hide)
931
			$('#' + id).parent().parent('div').addClass('hidden');
932
		else
933
			$('#' + id).parent().parent('div').removeClass('hidden');
934
	}
935

  
936
	// Hides the <div> in which the specified icheckbox lives so that the input, its label and help text are hidden
937
	// Checkboxes live inside <label></label> tags so we need another parent level
938
	function hideCheckBox(id, hide) {
939
		if(hide)
940
			$('#' + id).parent().parent().parent('div').addClass('hidden');
941
		else
942
			$('#' + id).parent().parent().parent('div').removeClass('hidden');
943
	}
944

  
945
	// Hides all elements of the specified class. This will usually be a section or group
946
	function hideClass(s_class, hide) {
947
		if(hide)
948
			$('.' + s_class).hide();
949
		else
950
			$('.' + s_class).show();
951
	}
952 928

  
953 929
	function hideDDNS(hide) {
954 930
		hideCheckBox('ddnsupdate', hide);
src/usr/local/www/services_dyndns_edit.php
393 393
<script>
394 394
//<![CDATA[
395 395
events.push(function(){
396
	var visible = false;
397

  
398
	// Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden
399
	function hideInput(id, hide) {
400
		if(hide)
401
			$('#' + id).parent().parent('div').addClass('hidden');
402
		else
403
			$('#' + id).parent().parent('div').removeClass('hidden');
404
	}
405

  
406
	// Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden
407
	function hideCheckbox(id, hide) {
408
		if(hide)
409
			$('#' + id).parent().parent().parent('div').addClass('hidden');
410
		else
411
			$('#' + id).parent().parent().parent('div').removeClass('hidden');
412
	}
413 396

  
414 397
	function setVisible(service) {
415 398
		switch(service) {
src/usr/local/www/services_ntpd.php
505 505
//<![CDATA[
506 506
events.push(function(){
507 507

  
508
	// Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden
509
	function hideInput(id, hide) {
510
		if(hide)
511
			$('#' + id).parent().parent('div').addClass('hidden');
512
		else
513
			$('#' + id).parent().parent('div').removeClass('hidden');
514
	}
515

  
516
	// Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden
517
	function hideCheckbox(id, hide) {
518
		if(hide)
519
			$('#' + id).parent().parent().parent('div').addClass('hidden');
520
		else
521
			$('#' + id).parent().parent().parent('div').removeClass('hidden');
522
	}
523

  
524 508
	function setMasks() {
525 509
		// Find all ipaddress masks and make dynamic based on address family of input
526 510
		$('span.pfIpMask + select').each(function (idx, select){
src/usr/local/www/services_ntpd_gps.php
424 424
		return(hexsum);
425 425
	}
426 426

  
427
	// Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden
428
	function hideInput(id, hide) {
429
		if(hide)
430
			$('#' + id).parent().parent('div').addClass('hidden');
431
		else
432
			$('#' + id).parent().parent('div').removeClass('hidden');
433
	}
434

  
435
	// Hides all elements of the specified class. This will usually be a section or group
436
	function hideClass(s_class, hide) {
437
		if(hide)
438
			$('.' + s_class).hide();
439
		else
440
			$('.' + s_class).show();
441
	}
442

  
443 427
	function set_gps_default(type) {
444 428
		$('#gpsnmea').val(0);
445 429
		$('#gpsspeed').val(0);
src/usr/local/www/services_unbound.php
353 353
<script>
354 354
//<![CDATA[
355 355
events.push(function(){
356
	// Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden
357
	function hideInput(id, hide) {
358
		if(hide)
359
			$('#' + id).parent().parent('div').addClass('hidden');
360
		else
361
			$('#' + id).parent().parent('div').removeClass('hidden');
362
	}
363

  
364
	// Disables the specified input element
365
	function disableInput(id, disable) {
366
		$('#' + id).prop("disabled", disable);
367
	}
368 356

  
369
	// If hte enable checkbox is not checked, disable the next three checkboxes
357
	// If the enable checkbox is not checked, disable the next three checkboxes
370 358
	function disableDHCP() {
371 359
		var hide = ! $('#enable').prop('checked');
372 360

  
src/usr/local/www/system_advanced_admin.php
527 527
//<![CDATA[
528 528
events.push(function(){
529 529

  
530
	//---------- "Standard" show/hide functions ---------------------------------------------------
531

  
532
	// Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden
533
	function hideInput(id, hide) {
534
		if(hide)
535
			$('#' + id).parent().parent('div').addClass('hidden');
536
		else
537
			$('#' + id).parent().parent('div').removeClass('hidden');
538
	}
539

  
540 530
	// ---------- On initial page load ------------------------------------------------------------
541 531

  
542
	hideInput('ssl-certificate', $('input[name=webguiproto]:checked').val() == 'http');
532
	hideInput('ssl-certref', $('input[name=webguiproto]:checked').val() == 'http');
543 533

  
544 534
	// ---------- Click checkbox handlers ---------------------------------------------------------
545 535

  
546 536
	 $('[id=webguiproto]').click(function () {
547
		hideInput('ssl-certificate', $('input[name=webguiproto]:checked').val() == 'http');
537
		hideInput('ssl-certref', $('input[name=webguiproto]:checked').val() == 'http');
548 538
	});
549 539
});
550 540
//]]>
src/usr/local/www/vpn_ipsec_phase1.php
1023 1023
			$('#dpd_maxfail').val('5')
1024 1024
	}
1025 1025

  
1026
	// ---------- Library of show/hide functions --------------------------------------------------
1027

  
1028
	// Hides the <div> in which the specified input element lives so that the input,
1029
	// its label and help text are hidden
1030
	function hideInput(id, hide) {
1031
		if(hide)
1032
			$('#' + id).parent().parent('div').addClass('hidden');
1033
		else
1034
			$('#' + id).parent().parent('div').removeClass('hidden');
1035
	}
1036

  
1037
	// Hides the <div> in which the specified group input element lives so that the input,
1038
	// its label and help text are hidden
1039
	function hideGroupInput(id, hide) {
1040
		if(hide)
1041
			$('#' + id).parent('div').addClass('hidden');
1042
		else
1043
			$('#' + id).parent('div').removeClass('hidden');
1044
	}
1045

  
1046
	// Hides the <div> in which the specified checkbox lives so that the checkbox,
1047
	// its label and help text are hidden
1048
	function hideCheckbox(id, hide) {
1049
		if(hide)
1050
			$('#' + id).parent().parent().parent('div').addClass('hidden');
1051
		else
1052
			$('#' + id).parent().parent().parent('div').removeClass('hidden');
1053
	}
1054

  
1055
	// Disables the specified input element
1056
	function disableInput(id, disable) {
1057
		$('#' + id).prop("disabled", disable);
1058
	}
1059

  
1060
	// Hides all elements of the specified class. This will usually be a section or group
1061
	function hideClass(s_class, hide) {
1062
		if(hide)
1063
			$('.' + s_class).hide();
1064
		else
1065
			$('.' + s_class).show();
1066
	}
1067

  
1068 1026
	// ---------- Monitor elements for change and call the appropriate display functions ----------
1069 1027

  
1070 1028
	 // Enable DPD
src/usr/local/www/vpn_ipsec_phase2.php
909 909
			hideClass('encalg', ($('#proto').val() != 'esp'));
910 910
	}
911 911

  
912
	// ---------- Library of show/hide functions --------------------------------------------------
913

  
914
	// Hides the <div> in which the specified input element lives so that the input,
915
	// its label and help text are hidden
916
	function hideInput(id, hide) {
917
		if(hide)
918
			$('#' + id).parent().parent('div').addClass('hidden');
919
		else
920
			$('#' + id).parent().parent('div').removeClass('hidden');
921
	}
922

  
923
	// Hides the <div> in which the specified group input element lives so that the input,
924
	// its label and help text are hidden
925
	function hideGroupInput(id, hide) {
926
		if(hide)
927
			$('#' + id).parent('div').addClass('hidden');
928
		else
929
			$('#' + id).parent('div').removeClass('hidden');
930
	}
931

  
932
	// Hides the <div> in which the specified checkbox lives so that the checkbox,
933
	// its label and help text are hidden
934
	function hideCheckbox(id, hide) {
935
		if(hide)
936
			$('#' + id).parent().parent().parent('div').addClass('hidden');
937
		else
938
			$('#' + id).parent().parent().parent('div').removeClass('hidden');
939
	}
940

  
941
	// Disables the specified input element
942
	function disableInput(id, disable) {
943
		$('#' + id).prop("disabled", disable);
944
	}
945

  
946
	// Hides all elements of the specified class. This will usually be a section or group
947
	function hideClass(s_class, hide) {
948
		if(hide)
949
			$('.' + s_class).hide();
950
		else
951
			$('.' + s_class).show();
952
	}
953

  
954 912
	// ---------- Monitor elements for change and call the appropriate display functions ----------
955 913

  
956 914
	 // Protocol
src/usr/local/www/vpn_openvpn_client.php
926 926
		hideInput('tls', $('#autotls_enable').prop('checked') || !$('#tlsauth_enable').prop('checked'));
927 927
	}
928 928

  
929
	// ---------- Library of show/hide functions ----------------------------------------------------------------------
930

  
931
	// Hides div whose label contains the specified text. (Good for StaticText)
932
	function hideLabel(text, hide) {
933
		var element = $('label:contains(' + text + ')');
934

  
935
		if(hide)
936
			element.parent('div').addClass('hidden');
937
		else
938
			element.parent('div').removeClass('hidden');
939
	}
940

  
941
	// Hides the <div> in which the specified input element lives so that the input,
942
	// its label and help text are hidden
943
	function hideInput(id, hide) {
944
		if(hide)
945
			$('#' + id).parent().parent('div').addClass('hidden');
946
		else
947
			$('#' + id).parent().parent('div').removeClass('hidden');
948
	}
949

  
950
	// Hides the <div> in which the specified checkbox lives so that the checkbox,
951
	// its label and help text are hidden
952
	function hideCheckbox(id, hide) {
953
		if(hide)
954
			$('#' + id).parent().parent().parent('div').addClass('hidden');
955
		else
956
			$('#' + id).parent().parent().parent('div').removeClass('hidden');
957
	}
958

  
959
	// Disables the specified input element
960
	function disableInput(id, disable) {
961
		$('#' + id).prop("disabled", disable);
962
	}
963

  
964
	// Hides all elements of the specified class. This will usually be a section or group
965
	function hideClass(s_class, hide) {
966
		if(hide)
967
			$('.' + s_class).hide();
968
		else
969
			$('.' + s_class).show();
970
	}
971

  
972 929
	// ---------- Monitor elements for change and call the appropriate display functions ------------------------------
973 930

  
974 931
	 // TLS Authorization
src/usr/local/www/vpn_openvpn_csc.php
565 565
<script>
566 566
//<![CDATA[
567 567
events.push(function(){
568
	var visible = false;
569

  
570
	//---------- "Standard" show/hide functions ---------------------------------------------------	
571

  
572
	// Hides the <div> in which the specified input element lives so that the input, its label and help text are hidden
573
	function hideInput(id, hide) {
574
		if(hide)
575
			$('#' + id).parent().parent('div').addClass('hidden');
576
		else
577
			$('#' + id).parent().parent('div').removeClass('hidden');
578
	}
579

  
580
	// Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden
581
	function hideCheckbox(id, hide) {
582
		if(hide)
583
			$('#' + id).parent().parent().parent('div').addClass('hidden');
584
		else
585
			$('#' + id).parent().parent().parent('div').removeClass('hidden');
586
	}
587

  
588
	// Hides all elements of the specified class. This will usually be a section or group
589
	function hideClass(s_class, hide) {
590
		if(hide)
591
			$('.' + s_class).hide();
592
		else
593
			$('.' + s_class).show();
594
	}
595 568

  
596 569
	// Hide/show that section, but have to also respect the wins_server_enable checkbox
597 570
	function setNetbios() {
src/usr/local/www/vpn_openvpn_server.php
1586 1586
		}
1587 1587
	}
1588 1588

  
1589
	// ---------- Library of show/hide functions ----------------------------------------------------------------------
1590

  
1591
	// Hides all elements of the specified class belonging to a multiselect.
1592
	function hideMultiClass(s_class, hide) {
1593
		if(hide)
1594
			$('.' + s_class).parent().parent().hide();
1595
		else
1596
			$('.' + s_class).parent().parent().show();
1597
	}
1598

  
1599
	// Hides div whose label contains the specified text. (Good for StaticText)
1600
	function hideLabel(text, hide) {
1601

  
1602
		var element = $('label:contains(' + text + ')');
1603

  
1604
		if(hide)
1605
			element.parent('div').addClass('hidden');
1606
		else
1607
			element.parent('div').removeClass('hidden');
1608
	}
1609

  
1610
	// Hides the <div> in which the specified input element lives so that the input,
1611
	// its label and help text are hidden
1612
	function hideInput(id, hide) {
1613
		if(hide)
1614
			$('#' + id).parent().parent('div').addClass('hidden');
1615
		else
1616
			$('#' + id).parent().parent('div').removeClass('hidden');
1617
	}
1618

  
1619
	// Hides the <div> in which the specified checkbox lives so that the checkbox,
1620
	// its label and help text are hidden
1621
	function hideCheckbox(id, hide) {
1622
		if(hide)
1623
			$('#' + id).parent().parent().parent('div').addClass('hidden');
1624
		else
1625
			$('#' + id).parent().parent().parent('div').removeClass('hidden');
1626
	}
1627

  
1628
	// Disables the specified input element
1629
	function disableInput(id, disable) {
1630
		$('#' + id).prop("disabled", disable);
1631
	}
1632

  
1633
	// Hides all elements of the specified class. This will usually be a section or group
1634
	function hideClass(s_class, hide) {
1635
		if(hide)
1636
			$('.' + s_class).hide();
1637
		else
1638
			$('.' + s_class).show();
1639
	}
1640

  
1641 1589
	// ---------- Monitor elements for change and call the appropriate display functions ------------------------------
1642 1590

  
1643 1591
	// NTP

Also available in: Unified diff