Lines 25-41
$(document).ready(function(){
Link Here
|
25 |
var row = $(this).attr("id"); |
25 |
var row = $(this).attr("id"); |
26 |
row = row.replace("row","hint"); |
26 |
row = row.replace("row","hint"); |
27 |
var editor = $(this).parent().find("[name='field_value']"); |
27 |
var editor = $(this).parent().find("[name='field_value']"); |
|
|
28 |
var regex_input = $(this).parent().find("[name='field_regex']"); |
28 |
if ($(this).is(":checked")) { |
29 |
if ($(this).is(":checked")) { |
29 |
$(editor).prop('disabled', true); |
30 |
$(editor).prop('disabled', true); |
30 |
$("#"+row).html(_("This subfield will be deleted")); |
31 |
$("#"+row).html(_("This subfield will be deleted")); |
|
|
32 |
$(regex_input).prop('disabled', true); |
31 |
} else { |
33 |
} else { |
32 |
$(editor).prop('disabled', false); |
34 |
$(editor).prop('disabled', false); |
33 |
$("#"+row).html(""); |
35 |
$("#"+row).html(""); |
|
|
36 |
$(regex_input).prop('disabled', false); |
34 |
} |
37 |
} |
35 |
}); |
38 |
}); |
36 |
$("#mainformsubmit").on("click",function(){ |
39 |
$("#mainformsubmit").on("click",function(){ |
37 |
return submitBackgroundJob(this.form); |
40 |
return submitBackgroundJob(this.form); |
38 |
}); |
41 |
}); |
|
|
42 |
$('input[name="field_regex"]').change(function() { |
43 |
var id = $(this).attr('id'); |
44 |
var editor = $(this).parent().find("[name='field_value']"); |
45 |
var regex = $(this).parent().find("[name='regex_fields']"); |
46 |
var disable_input = $(this).parent().find("[name='disable_input']"); |
47 |
if ($(this).is(':checked')) { |
48 |
$(editor).hide(); |
49 |
$(regex).show(); |
50 |
$(this).parent().find('.hint').html(_("Enter a regular expression for this subflied")); |
51 |
$(disable_input).prop('disabled', true); |
52 |
} else { |
53 |
$(editor).show(); |
54 |
$(regex).hide(); |
55 |
$(this).parent().find('.hint').html(_("")); |
56 |
$(disable_input).prop('disabled', false); |
57 |
} |
58 |
}); |
39 |
}); |
59 |
}); |
40 |
//]]> |
60 |
//]]> |
41 |
</script> |
61 |
</script> |
Lines 281-292
$(document).ready(function(){
Link Here
|
281 |
<textarea tabindex="1" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="255">[%- mv.value | html -%]"</textarea> |
301 |
<textarea tabindex="1" id="[%- mv.id | html -%]" name="field_value" class="input_marceditor" size="50" maxlength="255">[%- mv.value | html -%]"</textarea> |
282 |
[%- END -%] |
302 |
[%- END -%] |
283 |
|
303 |
|
|
|
304 |
<span name="regex_fields" style="display: none;"> |
305 |
s/<input type="text" id="[% mv.id | html %]" name="regex_search" placeholder="regex pattern" />/ |
306 |
<input type="text" id="[% mv.id | html %]" name="regex_replace" placeholder="regex replacement" />/ |
307 |
<input type="text" id="[% mv.id | html %]" name="regex_modifiers" placeholder="ig" size="3" /> |
308 |
</span> |
309 |
|
284 |
[% UNLESS ( ite.mandatory ) %] |
310 |
[% UNLESS ( ite.mandatory ) %] |
285 |
<input type="checkbox" id="row[% ite.tag | html %][% ite.subfield | html %][% ite.random | html %]" title="Check to delete subfield [% ite.subfield | html %]" name="disable_input" value="[% ite.subfield | html %]" /> |
311 |
<input type="checkbox" id="row[% ite.tag | html %][% ite.subfield | html %][% ite.random | html %]" title="Check to delete subfield [% ite.subfield | html %]" name="disable_input" value="[% ite.subfield | html %]" /> |
286 |
[% ELSE %] |
312 |
[% ELSE %] |
287 |
<span class="required">Required</span> |
313 |
<span class="required">Required</span> |
288 |
[% END %] |
314 |
[% END %] |
289 |
|
315 |
|
|
|
316 |
[% IF (mv.type == 'text' || mv.type == 'textarea' ) %] |
317 |
<input type="checkbox" name="field_regex" id="[% ite.id | html %]" title="Use regular expression"> |
318 |
[% END %] |
319 |
|
290 |
<input type="hidden" name="tag" value="[% ite.tag | html %]" /> |
320 |
<input type="hidden" name="tag" value="[% ite.tag | html %]" /> |
291 |
<input type="hidden" name="subfield" value="[% ite.subfield | html %]" /> |
321 |
<input type="hidden" name="subfield" value="[% ite.subfield | html %]" /> |
292 |
<input type="hidden" name="mandatory" value="[% ite.mandatory | html %]" /> |
322 |
<input type="hidden" name="mandatory" value="[% ite.mandatory | html %]" /> |