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