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