Lines 17-22
$(document).ready(function() {
Link Here
|
17 |
link.html(_("Display more constraints")); |
17 |
link.html(_("Display more constraints")); |
18 |
} |
18 |
} |
19 |
}); |
19 |
}); |
|
|
20 |
$("input[id^='hidden_']").click(setHiddenValue); |
21 |
$("input[id^='hidden-']").each(function() { |
22 |
populateHiddenCheckboxes($(this).attr('id').split('-')[1]); |
23 |
}); |
20 |
}); |
24 |
}); |
21 |
|
25 |
|
22 |
/*function displayMoreConstraint(numlayer){ |
26 |
/*function displayMoreConstraint(numlayer){ |
Lines 30-35
$(document).ready(function() {
Link Here
|
30 |
} |
34 |
} |
31 |
}*/ |
35 |
}*/ |
32 |
|
36 |
|
|
|
37 |
/* Function to serialize and set the 'hidden' field */ |
38 |
function setHiddenValue() { |
39 |
|
40 |
var tab = $(this).attr('id').split('_')[2]; |
41 |
var opac_checked = $("#hidden_opac_" + tab).is(':checked'); |
42 |
var intranet_checked = $("#hidden_intranet_" + tab).is(':checked'); |
43 |
var editor_checked = $("#hidden_editor_" + tab).is(':checked'); |
44 |
var collapsed_checked = $("#hidden_collapsed_" + tab).is(':checked'); |
45 |
var hidden_value = ""; |
46 |
|
47 |
if ( opac_checked && ! intranet_checked && ! editor_checked && collapsed_checked ) { |
48 |
hidden_value='-7'; |
49 |
} else if ( opac_checked && intranet_checked && ! editor_checked && ! collapsed_checked) { |
50 |
hidden_value='-6'; |
51 |
} else if ( opac_checked && intranet_checked && ! editor_checked && collapsed_checked) { |
52 |
hidden_value='-5'; |
53 |
} else if ( opac_checked && ! intranet_checked && ! editor_checked && ! collapsed_checked) { |
54 |
hidden_value='-4'; |
55 |
} else if ( opac_checked && ! intranet_checked && editor_checked && collapsed_checked) { |
56 |
hidden_value='-3'; |
57 |
} else if ( opac_checked && ! intranet_checked && editor_checked && ! collapsed_checked) { |
58 |
hidden_value='-2'; |
59 |
} else if ( opac_checked && intranet_checked && editor_checked && collapsed_checked) { |
60 |
hidden_value='-1'; |
61 |
} else if ( opac_checked && intranet_checked && editor_checked && ! collapsed_checked) { |
62 |
hidden_value='0'; |
63 |
} else if ( ! opac_checked && intranet_checked && editor_checked && collapsed_checked) { |
64 |
hidden_value='1'; |
65 |
} else if ( ! opac_checked && ! intranet_checked && editor_checked && ! collapsed_checked) { |
66 |
hidden_value='2'; |
67 |
} else if ( ! opac_checked && ! intranet_checked && editor_checked && collapsed_checked) { |
68 |
hidden_value='3'; |
69 |
} else if ( ! opac_checked && intranet_checked && editor_checked && ! collapsed_checked) { |
70 |
hidden_value='4'; |
71 |
} else if ( ! opac_checked && ! intranet_checked && ! editor_checked && collapsed_checked) { |
72 |
hidden_value='5'; |
73 |
} else if ( ! opac_checked && intranet_checked && ! editor_checked && ! collapsed_checked) { |
74 |
hidden_value='6'; |
75 |
} else if ( ! opac_checked && intranet_checked && ! editor_checked && collapsed_checked) { |
76 |
hidden_value='7'; |
77 |
} else if ( ! opac_checked && ! intranet_checked && ! editor_checked && ! collapsed_checked) { |
78 |
hidden_value='8'; |
79 |
} |
80 |
|
81 |
$('#hidden-' + tab).val(hidden_value); |
82 |
} |
83 |
|
84 |
function populateHiddenCheckboxes(tab) { |
85 |
// read the serialized value |
86 |
var hidden_value = $('#hidden-' + tab).val(); |
87 |
// deafult to false |
88 |
var opac_checked = false; |
89 |
var intranet_checked = false; |
90 |
var editor_checked = false; |
91 |
var collapsed_checked = false; |
92 |
|
93 |
if ( hidden_value == '-7') { |
94 |
opac_checked = true; |
95 |
collapsed_checked = true; |
96 |
} else if ( hidden_value == '-6' ) { |
97 |
opac_checked = true; |
98 |
intranet_checked = true; |
99 |
} else if ( hidden_value == '-5') { |
100 |
opac_checked = true; |
101 |
intranet_checked = true; |
102 |
collapsed_checked = true; |
103 |
} else if ( hidden_value == '-4' ) { |
104 |
opac_checked = true; |
105 |
} else if ( hidden_value == '-3') { |
106 |
opac_checked = true; |
107 |
editor_checked = true; |
108 |
collapsed_checked = true; |
109 |
} else if ( hidden_value == '-2' ) { |
110 |
opac_checked = true; |
111 |
editor_checked = true; |
112 |
} else if ( hidden_value == '-1' ) { |
113 |
opac_checked = true; |
114 |
intranet_checked = true; |
115 |
editor_checked = true; |
116 |
collapsed_checked = true; |
117 |
} else if ( hidden_value == '0' ) { |
118 |
opac_checked = true; |
119 |
intranet_checked = true; |
120 |
editor_checked = true; |
121 |
} else if ( hidden_value == '1' ) { |
122 |
intranet_checked = true; |
123 |
editor_checked = true; |
124 |
collapsed_checked = true; |
125 |
} else if ( hidden_value == '2' ) { |
126 |
editor_checked = true; |
127 |
} else if ( hidden_value == '3' ) { |
128 |
editor_checked = true; |
129 |
collapsed_checked = true; |
130 |
} else if ( hidden_value == '4' ) { |
131 |
intranet_checked = true; |
132 |
editor_checked = true; |
133 |
} else if ( hidden_value == '5' ) { |
134 |
collapsed_checked = true; |
135 |
} else if ( hidden_value == '6' ) { |
136 |
intranet_checked = true; |
137 |
} else if ( hidden_value == '7' ) { |
138 |
intranet_checked = true; |
139 |
collapsed_checked = true; |
140 |
} // else if ( hidden_value == '8') { skip } |
141 |
|
142 |
$("#hidden_opac_" + tab).attr('checked',opac_checked); |
143 |
$("#hidden_intranet_" + tab).attr('checked',intranet_checked); |
144 |
$("#hidden_editor_" + tab).attr('checked',editor_checked); |
145 |
$("#hidden_collapsed_" + tab).attr('checked',collapsed_checked); |
146 |
|
147 |
} |
148 |
|
33 |
//]]> |
149 |
//]]> |
34 |
</script> |
150 |
</script> |
35 |
</head> |
151 |
</head> |
Lines 111-117
$(document).ready(function() {
Link Here
|
111 |
<ol><li><label for="defaultvalue[% loo.row %]">Default value:</label> |
227 |
<ol><li><label for="defaultvalue[% loo.row %]">Default value:</label> |
112 |
<input type="text" name="defaultvalue" id="defaultvalue[% loo.row %]" value="[% loo.defaultvalue %]" /></li> |
228 |
<input type="text" name="defaultvalue" id="defaultvalue[% loo.row %]" value="[% loo.defaultvalue %]" /></li> |
113 |
<li><label for="maxlength[% loo.row %]">Max length:</label><input type="text" id="maxlength[% loo.row %]" name="maxlength" value="[% loo.maxlength %]" size="4" /> (see online help)</li> |
229 |
<li><label for="maxlength[% loo.row %]">Max length:</label><input type="text" id="maxlength[% loo.row %]" name="maxlength" value="[% loo.maxlength %]" size="4" /> (see online help)</li> |
114 |
<li><label for="hidden[% loo.row %]">hidden</label><input type="text" id="hidden[% loo.row %]" name="hidden" value="[% loo.hidden %]" size="2" /> (see online help)</li> |
230 |
<li><input type="hidden" id="hidden-[% loo.row %]" name="hidden" value="[% loo.hidden %]" /> |
|
|
231 |
<label for="hidden[% loo.row %]">Visibility: </label> |
232 |
<input class="radio" type="checkbox" id="hidden_opac_[% loo.row %]" name="hidden_opac_[% loo.row %]"/> OPAC |
233 |
<input type="checkbox" id="hidden_intranet_[% loo.row %]" name="hidden_intranet_[% loo.row %]"/> Intranet |
234 |
<input type="checkbox" id="hidden_editor_[% loo.row %]" name="hidden_editor_[% loo.row %]"/> Editor |
235 |
<input type="checkbox" id="hidden_collapsed_[% loo.row %]" name="hidden_collapsed_[% loo.row %]"/> Collapsed |
236 |
</li> |
115 |
<li><label for="isurl[% loo.row %]">Is a URL:</label>[% loo.isurl %] (if checked, it means that the subfield is a URL and can be clicked)</li> |
237 |
<li><label for="isurl[% loo.row %]">Is a URL:</label>[% loo.isurl %] (if checked, it means that the subfield is a URL and can be clicked)</li> |
116 |
<li><label for="link[% loo.row %]">Link:</label><input type="text" id="link[% loo.row %]" name="link" value="[% loo.link %]" size="10" maxlength="80" /> (e.g., Title or Local-Number) <span class="error"><em>NOTE: If you change this value you must ask your administrator to run misc/batchRebuildBiblioTables.pl.</em></span></li> |
238 |
<li><label for="link[% loo.row %]">Link:</label><input type="text" id="link[% loo.row %]" name="link" value="[% loo.link %]" size="10" maxlength="80" /> (e.g., Title or Local-Number) <span class="error"><em>NOTE: If you change this value you must ask your administrator to run misc/batchRebuildBiblioTables.pl.</em></span></li> |
117 |
<li><label for="kohafield[% loo.row %]">Koha link:</label>[% loo.kohafield %]</li> |
239 |
<li><label for="kohafield[% loo.row %]">Koha link:</label>[% loo.kohafield %]</li> |
118 |
- |
|
|