-21 Removals
+19 Additions

Created by:phpboost

1<script> 1<script>
2<!-- 2<!--
3var ContactFormFieldObjectPossibleValues = function(){ 3var ContactFormFieldObjectPossibleValues = function(){
4 this.integer = {NBR_FIELDS}; 4 this.integer = {NBR_FIELDS};
5 this.id_input = ${escapejs(HTML_ID)}; 5 this.id_input = ${escapejs(HTML_ID)};
6 this.max_input = {MAX_INPUT}; 6 this.max_input = {MAX_INPUT};
7}; 7};
8 8
9ContactFormFieldObjectPossibleValues.prototype = { 9ContactFormFieldObjectPossibleValues.prototype = {
10 add : function () { 10 add : function () {
11 if (this.integer <= this.max_input) { 11 if (this.integer <= this.max_input) {
12 var id = this.id_input + '_' + this.integer; 12 var id = this.id_input + '_' + this.integer;
13 13
14 jQuery('<div/>', {'id' : id}).appendTo('#input_fields_' + this.id_input); 14 jQuery('<div/>', {'id' : id, 'class' : 'possible-values'}).appendTo('#input_fields_' + this.id_input);
15 15
16 jQuery('<div/>', {id : 'radio_' + this.integer, class: 'form-field-radio'}).appendTo('#' + id); 16 jQuery('<div/>', {id : 'radio_' + this.integer, class: 'form-field-radio'}).appendTo('#' + id);
17 jQuery('<input/>', {type : 'radio', id : 'field_is_default_' + id, name : 'field_is_default_' + this.id_input, value : this.integer}).appendTo('#radio_' + this.integer); 17 jQuery('<input/>', {type : 'radio', id : 'field_is_default_' + id, name : 'field_is_default_' + this.id_input, value : this.integer}).appendTo('#radio_' + this.integer);
18 jQuery('<label/>', {for : 'field_is_default_' + id}).appendTo('#radio_' + this.integer); 18 jQuery('<label/>', {for : 'field_is_default_' + id}).appendTo('#radio_' + this.integer);
19 jQuery('<span/>', {class : 'is-default-title hidden-large-screens'}).html('${LangLoader::get_message('field.possible_values.is_default', 'admin-user-common')}').appendTo('#radio_' + this.integer);
20 jQuery('#radio_' + this.integer).after(' '); 19 jQuery('#radio_' + this.integer).after(' ');
21 20
22 jQuery('<input/>', {type : 'text', id : 'field_name_' + id, name : 'field_name_' + id, required : "required", placeholder : '{@field.possible_values.subject}'}).appendTo('#' + id); 21 jQuery('<input/>', {type : 'text', id : 'field_name_' + id, name : 'field_name_' + id, required : "required", placeholder : '{@field.possible_values.subject}'}).appendTo('#' + id);
23 jQuery('#' + id).append(' '); 22 jQuery('#' + id).append(' ');
24 23
25 jQuery('<select/>', {'id' : 'field_recipient_' + id, 'name' : 'field_recipient_' + id}).appendTo('#' + id); 24 jQuery('<select/>', {'id' : 'field_recipient_' + id, 'name' : 'field_recipient_' + id}).appendTo('#' + id);
26 jQuery('#' + id).append(' '); 25 jQuery('#' + id).append(' ');
27 26
28 # START recipients_list # 27 # START recipients_list #
29 jQuery('<option/>', {'value' : ${escapejs(recipients_list.ID)}}).text(${escapejs(recipients_list.NAME)}).appendTo('#field_recipient_' + id); 28 jQuery('<option/>', {'value' : ${escapejs(recipients_list.ID)}}).text(${escapejs(recipients_list.NAME)}).appendTo('#field_recipient_' + id);
30 # END recipients_list # 29 # END recipients_list #
31 30
32 jQuery('<a/>', {href : 'javascript:ContactFormFieldObjectPossibleValues.delete('+ this.integer +');', title : "${LangLoader::get_message('delete', 'common')}"}).html('<i class="fa fa-delete"></i>').appendTo('#' + id); 31 jQuery('<a/>', {href : 'javascript:ContactFormFieldObjectPossibleValues.delete('+ this.integer +');', 'aria-label' : "${LangLoader::get_message('delete', 'common')}"}).html('<i class="fa fa-delete" aria-hidden="true" title="' + ${escapejs(LangLoader::get_message('delete', 'common'))} + '"></i>').appendTo('#' + id);
33 32
34 jQuery('<script/>').html('jQuery("#field_is_default_' + id + '").on(\'click\',function(){ jQuery("#uncheck_default_${escape(HTML_ID)}").show(); });').appendTo('#' + id); 33 jQuery('<script/>').html('jQuery("#field_is_default_' + id + '").on(\'click\',function(){ jQuery("#uncheck_default_${escape(HTML_ID)}").show(); });').appendTo('#' + id);
35 34
36 this.integer++; 35 this.integer++;
37 } 36 }
38 if (this.integer == this.max_input) { 37 if (this.integer == this.max_input) {
39 jQuery('#add-' + this.id_input).hide(); 38 jQuery('#add-' + this.id_input).hide();
40 } 39 }
41 }, 40 },
42 delete : function (id) { 41 delete : function (id) {
43 var id = this.id_input + '_' + id; 42 var id = this.id_input + '_' + id;
44 jQuery('#' + id).remove(); 43 jQuery('#' + id).remove();
45 this.integer--; 44 this.integer--;
46 jQuery('#add-' + this.id_input).show(); 45 jQuery('#add-' + this.id_input).show();
47 }, 46 },
48}; 47};
49 48
50var ContactFormFieldObjectPossibleValues = new ContactFormFieldObjectPossibleValues(); 49var ContactFormFieldObjectPossibleValues = new ContactFormFieldObjectPossibleValues();
51--> 50-->
52</script> 51</script>
53 52
54<div id="input_fields_${escape(HTML_ID)}"> 53<div id="input_fields_${escape(HTML_ID)}">
55 <div class="text-strong hidden-small-screens"> 54 <div class="text-strong">
56 <span class="title-possible-value is-default-title">${LangLoader::get_message('field.possible_values.is_default', 'admin-user-common')}</span> 55 <span class="title-possible-value is-default-title">${LangLoader::get_message('field.possible_values.is_default', 'admin-user-common')}</span>
57 <span class="title-possible-value name-title">{@field.possible_values.subject}</span> 56 <span class="title-possible-value name-title">{@field.possible_values.subject}</span>
58 <span class="title-possible-value title-desc">${LangLoader::get_message('field.possible_values.recipient', 'common', 'contact')}</span> 57 <span class="title-possible-value title-desc">${LangLoader::get_message('field.possible_values.recipient', 'common', 'contact')}</span>
59 </div> 58 </div>
60 # START fieldelements # 59 # START fieldelements #
61 <div id="${escape(HTML_ID)}_{fieldelements.ID}"> 60 <div id="${escape(HTML_ID)}_{fieldelements.ID}" class="possible_values">
62 <div class="form-field-radio"> 61 <div class="form-field-radio possible-values">
63 <input type="radio" name="field_is_default_${escape(HTML_ID)}" id="field_is_default_${escape(HTML_ID)}_{fieldelements.ID}" value="{fieldelements.ID}"# IF fieldelements.IS_DEFAULT # checked="checked"# ENDIF #> 62 <input type="radio" name="field_is_default_${escape(HTML_ID)}" id="field_is_default_${escape(HTML_ID)}_{fieldelements.ID}" value="{fieldelements.ID}"# IF fieldelements.IS_DEFAULT # checked="checked"# ENDIF #>
64 <label for="field_is_default_${escape(HTML_ID)}_{fieldelements.ID}"></label> 63 <label for="field_is_default_${escape(HTML_ID)}_{fieldelements.ID}"></label>
65 <span class="is-default-title hidden-large-screens">${LangLoader::get_message('field.possible_values.is_default', 'admin-user-common')}</span>
66 </div> 64 </div>
67 <input type="text" name="field_name_${escape(HTML_ID)}_{fieldelements.ID}" id="field_name_${escape(HTML_ID)}_{fieldelements.ID}" value="{fieldelements.NAME}" placeholder="{@field.possible_values.subject}"> 65 <input type="text" name="field_name_${escape(HTML_ID)}_{fieldelements.ID}" id="field_name_${escape(HTML_ID)}_{fieldelements.ID}" value="{fieldelements.NAME}" placeholder="{@field.possible_values.subject}">
68 <select id="field_recipient_${escape(HTML_ID)}_{fieldelements.ID}" name="field_recipient_${escape(HTML_ID)}_{fieldelements.ID}"> 66 <select id="field_recipient_${escape(HTML_ID)}_{fieldelements.ID}" name="field_recipient_${escape(HTML_ID)}_{fieldelements.ID}">
69 # START fieldelements.recipients_list # 67 # START fieldelements.recipients_list #
70 <option value="{fieldelements.recipients_list.ID}" # IF fieldelements.recipients_list.C_RECIPIENT_SELECTED #selected="selected"# ENDIF #>{fieldelements.recipients_list.NAME}</option> 68 <option value="{fieldelements.recipients_list.ID}" # IF fieldelements.recipients_list.C_RECIPIENT_SELECTED #selected="selected"# ENDIF #>{fieldelements.recipients_list.NAME}</option>
71 # END fieldelements.recipients_list # 69 # END fieldelements.recipients_list #
72 </select> 70 </select>
73 <a href="javascript:ContactFormFieldObjectPossibleValues.delete({fieldelements.ID});" title="${LangLoader::get_message('delete', 'common')}" data-confirmation="delete-element"><i class="fa fa-delete"></i></a> 71 <a href="javascript:ContactFormFieldObjectPossibleValues.delete({fieldelements.ID});" aria-label="${LangLoader::get_message('delete', 'common')}" data-confirmation="delete-element"><i class="fa fa-delete" aria-hidden="true" title="${LangLoader::get_message('delete', 'common')}"></i></a>
74 <script> 72 <script>
75 <!-- 73 <!--
76 jQuery("#field_is_default_${escape(HTML_ID)}_{fieldelements.ID}").on('click',function(){ 74 jQuery("#field_is_default_${escape(HTML_ID)}_{fieldelements.ID}").on('click',function(){
77 jQuery("#uncheck_default_${escape(HTML_ID)}").show(); 75 jQuery("#uncheck_default_${escape(HTML_ID)}").show();
78 }); 76 });
79 --> 77 -->
80 </script> 78 </script>
81 </div> 79 </div>
82# END fieldelements # 80# END fieldelements #
83</div> 81</div>
84<a href="javascript:ContactFormFieldObjectPossibleValues.add();" id="add-${escape(HTML_ID)}" class="form-field-more-values" title="${LangLoader::get_message('add', 'common')}"><i class="fa fa-plus"></i></a> 82<a href="javascript:ContactFormFieldObjectPossibleValues.add();" id="add-${escape(HTML_ID)}" class="form-field-more-values" aria-label="${LangLoader::get_message('add', 'common')}"><i class="fa fa-plus" aria-hidden="true" title="${LangLoader::get_message('add', 'common')}"></i></a>
85<a href="" onclick="return false;" id="uncheck_default_${escape(HTML_ID)}"# IF NOT C_HAS_DEFAULT_VALUE # style="display: none;"# ENDIF # title="${LangLoader::get_message('field.possible_values.delete_default', 'admin-user-common')}" class="small">${LangLoader::get_message('field.possible_values.delete_default', 'admin-user-common')}</a> 83<a href="" onclick="return false;" id="uncheck_default_${escape(HTML_ID)}"# IF NOT C_HAS_DEFAULT_VALUE # style="display: none;"# ENDIF # title="${LangLoader::get_message('field.possible_values.delete_default', 'admin-user-common')}" class="small">${LangLoader::get_message('field.possible_values.delete_default', 'admin-user-common')}</a>
86<script> 84<script>
87<!-- 85<!--
88jQuery(document).ready(function() { 86jQuery(document).ready(function() {
89 jQuery("#uncheck_default_${escape(HTML_ID)}").click(function() { 87 jQuery("#uncheck_default_${escape(HTML_ID)}").on('click',function() {
90 jQuery("input[name=field_is_default_${escape(HTML_ID)}]").prop("checked", false); 88 jQuery("input[name=field_is_default_${escape(HTML_ID)}]").prop("checked", false);
91 jQuery("#uncheck_default_${escape(HTML_ID)}").hide(); 89 jQuery("#uncheck_default_${escape(HTML_ID)}").hide();
92 }); 90 });
93}); 91});
94--> 92-->
95</script> 93</script>
Editor
Original Text
Changed Text
Recommended videos