Changeset 20109 for extensions/Piwecard/admin/template
- Timestamp:
- Jan 13, 2013, 8:56:16 PM (12 years ago)
- Location:
- extensions/Piwecard/admin/template
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Piwecard/admin/template/admin_configuration.tpl
r20103 r20109 1 {footer_script} 1 {combine_script id='piwecard' load="footer" path='plugins/Piwecard/js/piwecard.js'} 2 3 {footer_script require="piwecard"} 2 4 {literal} 3 5 $(document).ready(function(){ … … 29 31 }); 30 32 31 function ecard_checkField(element, elementType) { 32 var TEXT = 0; 33 var EMAIL = 1; 34 35 switch (elementType) { 36 case TEXT: 37 if (element.value == '') { 38 document.getElementById(element.id+'_error').style.display = 'block'; 39 element.className += " ecard_admin_error_input"; 40 return false; 41 } else { 42 document.getElementById(element.id+'_error').style.display = 'none'; 43 element.className = element.className.replace( /(?:^|\s)ecard_admin_error_input(?!\S)/g , ''); 44 return true; 45 } 46 break; 47 case EMAIL: 48 var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 49 if (element.value != '' && !filter.test(element.value)) { 50 document.getElementById(element.id+'_error').style.display = 'block'; 51 element.className += " ecard_admin_error_input"; 52 return false; 53 } else { 54 document.getElementById(element.id+'_error').style.display = 'none'; 55 element.className = element.className.replace( /(?:^|\s)ecard_admin_error_input(?!\S)/g , ''); 56 return true; 57 } 58 break; 59 default: 60 return false; 61 break; 62 } 63 } 64 65 function ecard_checkForm(form) { 66 var guestEmailOK = ecard_checkField(form.ecard_default_guest_email, 1); 67 var subjectOK = ecard_checkField(form.ecard_email_subject, 0); 68 var messageTextOK = ecard_checkField(form.ecard_email_message_text, 0); 69 var messageHTMLOK = ecard_checkField(form.ecard_email_message_html, 0); 33 function piwecard_checkForm(form) { 34 var guestEmailOK; 35 if (form.ecard_default_guest_email.value == '') 36 guestEmailOK = true; 37 else 38 guestEmailOK = piwecard_checkField(form.ecard_default_guest_email, 1); 39 var subjectOK = piwecard_checkField(form.ecard_email_subject, 0); 40 var messageTextOK = piwecard_checkField(form.ecard_email_message_text, 0); 41 var messageHTMLOK = piwecard_checkField(form.ecard_email_message_html, 0); 70 42 71 43 if(guestEmailOK && subjectOK && messageTextOK && messageHTMLOK) … … 81 53 </div> 82 54 <div id="ECardAdminConfiguration"> 83 <form method="post" onsubmit="return ecard_checkForm(this);">55 <form method="post" onsubmit="return piwecard_checkForm(this);"> 84 56 <fieldset> 85 57 <legend>{'piwecard_configuration'|@translate}</legend> … … 129 101 <span id="ecard_form_line_default_{$ecard_email_format_default.id}"><input type="radio" name="ecard_email_format_default" id="ecard_email_format_default_{$ecard_email_format_default.id}" value="{$ecard_email_format_default.id}" {$ecard_email_format_default.selected_default}/><label for="ecard_email_format_default_{$ecard_email_format_default.id}"> {$ecard_email_format_default.language_string|@translate}</label></span> 130 102 {/foreach} 131 <span class="ecard_ admin_error" id="ecard_email_format_default_error" style="{$piwecard_errors.email_format_default.style_error_text}">{'piwecard_error'|@translate} {'piwecard_email_format_default_error'|@translate}</span>103 <span class="ecard_error" id="ecard_email_format_default_error" style="{$piwecard_errors.email_format_default.style_error_text}">{'piwecard_error'|@translate} {'piwecard_email_format_default_error'|@translate}</span> 132 104 </div> 133 105 </div> 134 106 <div class="ecard_form_line ecard_email_config"> 135 <label for="ecard_default_guest_email">{'piwecard_default_guest_email'|@translate}</label><span class="ecard_ admin_error" id="ecard_default_guest_email_error" style="{$ecard_errors.default_guest_email.style_error_text}">{'piwecard_error'|@translate} {'piwecard_error_email'|@translate}</span><br />136 <input type="text" maxlength="50" name="ecard_default_guest_email" id="ecard_default_guest_email" {$ecard_errors.default_guest_email.style_error_input} value="{$ecard_default_guest_email}" onblur=" ecard_checkField(this, 1);" />107 <label for="ecard_default_guest_email">{'piwecard_default_guest_email'|@translate}</label><span class="ecard_error" id="ecard_default_guest_email_error" style="{$ecard_errors.default_guest_email.style_error_text}">{'piwecard_error'|@translate} {'piwecard_error_email'|@translate}</span> 108 <input type="text" maxlength="50" name="ecard_default_guest_email" id="ecard_default_guest_email" {$ecard_errors.default_guest_email.style_error_input} value="{$ecard_default_guest_email}" onblur="piwecard_checkField(this, 1);" /> 137 109 </div> 138 110 <div class="ecard_form_line ecard_email_config"> 139 <label for="ecard_email_subject">{'piwecard_email_subject'|@translate}</label>< span class="ecard_admin_error" id="ecard_email_subject_error" style="{$ecard_errors.email_subject.style_error_text}">{'piwecard_error'|@translate} {'piwecard_error_text'|@translate}</span><br />111 <label for="ecard_email_subject">{'piwecard_email_subject'|@translate}</label><br /><span class="ecard_error" id="ecard_email_subject_error" style="{$ecard_errors.email_subject.style_error_text}">{'piwecard_error'|@translate} {'piwecard_error_text'|@translate}</span> 140 112 <input type="text" maxlength="255" name="ecard_email_subject" id="ecard_email_subject" {$ecard_errors.email_subject.style_error_input} value="{$ecard_email_subject}" /> 141 113 </div> 142 114 <div class="ecard_form_line ecard_email_config"> 143 <label for="ecard_email_message_text">{'piwecard_email_message_text'|@translate}</label><span class="ecard_ admin_error" id="ecard_email_message_text_error" style="{$ecard_errors.email_message.text.style_error_text}">{'piwecard_error'|@translate} {'piwecard_error_text'|@translate}</span><br />115 <label for="ecard_email_message_text">{'piwecard_email_message_text'|@translate}</label><span class="ecard_error" id="ecard_email_message_text_error" style="{$ecard_errors.email_message.text.style_error_text}">{'piwecard_error'|@translate} {'piwecard_error_text'|@translate}</span> 144 116 <textarea name="ecard_email_message_text" id="ecard_email_message_text" {$ecard_errors.email_message.text.style_error_input}>{$ecard_email_message_text}</textarea> 145 117 </div> 146 118 <div class="ecard_form_line ecard_email_config"> 147 <label for="ecard_email_message_html">{'piwecard_email_message_html'|@translate}</label><span class="ecard_ admin_error" id="ecard_email_message_html_error" style="{$ecard_errors.email_message.html.style_error_text}">{'piwecard_error'|@translate} {'piwecard_error_text'|@translate}</span><br />119 <label for="ecard_email_message_html">{'piwecard_email_message_html'|@translate}</label><span class="ecard_error" id="ecard_email_message_html_error" style="{$ecard_errors.email_message.html.style_error_text}">{'piwecard_error'|@translate} {'piwecard_error_text'|@translate}</span> 148 120 <textarea name="ecard_email_message_html" id="ecard_email_message_html" {$ecard_errors.email_message.html.style_error_input}>{$ecard_email_message_html}</textarea> 149 121 </div> -
extensions/Piwecard/admin/template/admin_management.tpl
r20080 r20109 1 {footer_script} 1 {combine_script id='piwecard' load="footer" path='plugins/Piwecard/js/piwecard.js'} 2 3 {footer_script require="piwecard"} 2 4 {literal} 3 function ecard_checkField(element, elementType) { 4 var NUMBER = 0; 5 6 switch (elementType) { 7 case NUMBER: 8 if (element.value == '') { 9 document.getElementById(element.id+'_error').style.display = 'inline'; 10 element.className += " ecard_admin_error_input"; 11 return false; 12 } else { 13 if(parseFloat(element.value) % 1 == 0){ 14 return true; 15 } else { 16 document.getElementById(element.id+'_error').style.display = 'inline'; 17 element.className += " ecard_admin_error_input"; 18 return false; 19 } 20 } 21 break; 22 default: 23 return false; 24 break; 25 } 26 } 27 28 function ecard_checkForm(form) { 29 var nbPageOK = ecard_checkField(form.ecard_nb_ecard_page, 0); 5 function piwecard_checkForm(form) { 6 var nbPageOK = piwecard_checkField(form.ecard_nb_ecard_page, 2); 30 7 31 8 if(nbPageOK) … … 50 27 <fieldset> 51 28 <legend>{'Filter'|@translate}</legend> 52 <form method="post" id="ecard_nb_ecard_page_form" onsubmit="return ecard_checkForm(this);">29 <form method="post" id="ecard_nb_ecard_page_form" onsubmit="return piwecard_checkForm(this);"> 53 30 <span><label for="ecard_nb_ecard_page">{'piwecard_nb_ecard_page'|@translate}</label></span> 54 31 <span><input type="text" maxlength="3" size="3" name="ecard_nb_ecard_page" id="ecard_nb_ecard_page" value="{$ecard_nb_ecard_page}" /></span> 55 32 <span><input type="submit" name="nb_ecard_page_submit" value="{'Submit'|@translate}" /></span> 56 <span class="ecard_ admin_error" id="ecard_nb_ecard_page_error">{'piwecard_error'|@translate} {'piwecard_error_number'|@translate}</span>33 <span class="ecard_error" id="ecard_nb_ecard_page_error">{'piwecard_error'|@translate} {'piwecard_error_number'|@translate}</span> 57 34 </form> 58 35 </fieldset>
Note: See TracChangeset
for help on using the changeset viewer.