-11 Removals
+13 Additions

Created by:phpboost

1<script> 1<script>
2<!-- 2<!--
3var QuestionCaptchaFormFieldQuestions = function(){ 3var QuestionCaptchaFormFieldQuestions = function(){
4 this.integer = {NBR_QUESTIONS}; 4 this.integer = {NBR_QUESTIONS};
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
9QuestionCaptchaFormFieldQuestions.prototype = { 9QuestionCaptchaFormFieldQuestions.prototype = {
10 add_question : function () { 10 add_question : 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_questions_' + this.id_input); 14 jQuery('<div/>', {'id' : id}).appendTo('#input_questions_' + this.id_input);
15 15
16 jQuery('<textarea/> ', {id : 'field_label_' + id, name : 'field_label_' + id, placeholder : '{@form.question}'}).appendTo('#' + id); 16 jQuery('<textarea/> ', {id : 'field_label_' + id, name : 'field_label_' + id, placeholder : '{@form.question}'}).appendTo('#' + id);
17 17
18 jQuery('<textarea/> ', {id : 'field_answers_' + id, name : 'field_answers_' + id, class : 'answers', placeholder : '{@form.answers}'}).appendTo('#' + id); 18 jQuery('<textarea/> ', {id : 'field_answers_' + id, name : 'field_answers_' + id, class : 'answers', placeholder : '{@form.answers}'}).appendTo('#' + id);
19 19
20 jQuery('<a/> ', {href : 'javascript:QuestionCaptchaFormFieldQuestions.delete_question('+ this.integer +');', id : 'delete_' + id, class : 'fa fa-delete'}).appendTo('#' + id); 20 jQuery('<a/> ', {'aria-label' : ${escapejs(@config.delete)}, title : '{@config.delete}', href : 'javascript:QuestionCaptchaFormFieldQuestions.delete_question('+ this.integer +');', id : 'delete_' + id}).html('<i class="fa fa-delete" aria-hidden="true" title="${@config.delete}"></i>').appendTo('#' + id);
21 21
22 jQuery('<div/> ', {class : 'spacer'}).appendTo('#' + id); 22 jQuery('<div/> ', {class : 'spacer'}).appendTo('#' + id);
23 23
24 this.integer++; 24 this.integer++;
25 } 25 }
26 if (this.integer == this.max_input) { 26 if (this.integer == this.max_input) {
27 jQuery('#add_' + this.id_input).hide(); 27 jQuery('#add_' + this.id_input).hide();
28 } 28 }
29 }, 29 },
30 delete_question : function (id) { 30 delete_question : function (id) {
31 var id = this.id_input + '_' + id; 31 var id = this.id_input + '_' + id;
32 jQuery('#' + id).remove(); 32 jQuery('#' + id).remove();
33 this.integer--; 33 this.integer--;
34 jQuery('#add_' + this.id_input).show(); 34 jQuery('#add_' + this.id_input).show();
35 }, 35 },
36}; 36};
37var QuestionCaptchaFormFieldQuestions = new QuestionCaptchaFormFieldQuestions(); 37var QuestionCaptchaFormFieldQuestions = new QuestionCaptchaFormFieldQuestions();
38--> 38-->
39</script> 39</script>
40 40
41<div id="input_questions_${escape(HTML_ID)}"> 41<div id="input_questions_${escape(HTML_ID)}">
42# START fieldelements # 42# START fieldelements #
43 <div id="${escape(HTML_ID)}_{fieldelements.ID}"> 43 <div id="${escape(HTML_ID)}_{fieldelements.ID}">
44 <textarea name="field_label_${escape(HTML_ID)}_{fieldelements.ID}" id="field_label_${escape(ID)}_{fieldelements.ID}" placeholder="{@form.question}">{fieldelements.LABEL}</textarea> 44 <textarea name="field_label_${escape(HTML_ID)}_{fieldelements.ID}" id="field_label_${escape(ID)}_{fieldelements.ID}" placeholder="{@form.question}">{fieldelements.LABEL}</textarea>
45 <textarea name="field_answers_${escape(HTML_ID)}_{fieldelements.ID}" id="field_answers_${escape(ID)}_{fieldelements.ID}" placeholder="{@form.answers}" class="answers">{fieldelements.ANSWERS}</textarea> 45 <textarea name="field_answers_${escape(HTML_ID)}_{fieldelements.ID}" id="field_answers_${escape(ID)}_{fieldelements.ID}" placeholder="{@form.answers}" class="answers">{fieldelements.ANSWERS}</textarea>
46 46
47 # IF fieldelements.C_DELETE #<a href="javascript:QuestionCaptchaFormFieldQuestions.delete_question({fieldelements.ID});" id="delete_${escape(HTML_ID)}_{fieldelements.ID}" class="fa fa-delete" data-confirmation="delete-element"></a># ENDIF # 47 # IF fieldelements.C_DELETE #
48 <a href="javascript:QuestionCaptchaFormFieldQuestions.delete_question({fieldelements.ID});" id="delete_${escape(HTML_ID)}_{fieldelements.ID}" aria-label="{@config.delete}" data-confirmation="delete-element"><i class="fa fa-delete" aria-hidden="true" title="{@config.delete}"></i></a>
49 # ENDIF #
48 <div class="spacer"></div> 50 <div class="spacer"></div>
49 </div> 51 </div>
50# END fieldelements # 52# END fieldelements #
51</div> 53</div>
52<a href="javascript:QuestionCaptchaFormFieldQuestions.add_question();" id="add_${escape(HTML_ID)}" class="field-question-more-value" title="${LangLoader::get_message('add', 'common')}"><i class="fa fa-plus"></i></a> 54<a href="javascript:QuestionCaptchaFormFieldQuestions.add_question();" id="add_${escape(HTML_ID)}" class="field-question-more-value" aria-label="{@config.add}"><i class="fa fa-plus" aria-hidden="true" title="{@config.add}"></i></a>
Editor
Original Text
Changed Text
Recommended videos