Changeset 5134 for trunk/expressoMail1_2/js/filter.js
- Timestamp:
- 11/03/11 13:24:28 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/js/filter.js
r4855 r5134 51 51 var handler_sieve = function(data) 52 52 { 53 if(data.toString().indexOf('Error:') == 0) 54 { 55 53 if (data.toString().indexOf('Error:') == 0) 54 { 56 55 _this.criticalError = true; 57 56 alert(get_lang('The filters service is out of service, try again later...')); … … 69 68 } 70 69 } 71 if(typeof(data.vacation[0]) == 'undefined'){ 72 _this.out_officeR = ""; 73 } 74 else 75 _this.out_officeR = url_decode_s(data.vacation[0]); 70 _this.out_officeR = data.vacation[0]; 71 _this.out_officeR = _this.out_officeR ? trim(_this.out_officeR.toString().replace("\n","")) : ""; 72 if(data.mode.length > 0){_this.mode_in = data.mode[0];} 76 73 } 77 74 catch(e){ 78 75 _this.criticalError = true; 79 alert(get_lang('==> The filters service is out of service, try again later...')); 80 } 81 if(data.mode.length > 0){_this.mode_in = data.mode[0];} 76 alert(get_lang('The filters service is out of service, try again later...')); 77 } 82 78 if (typeof(posHandler) == 'function') 83 79 posHandler(param); … … 93 89 Element('form_body').innerHTML = ""; 94 90 Element('form_buttons').style.display = ''; 91 Element('Edit_form_buttons').style.display = 'none'; 95 92 filters.mount_list(); 96 93 this.ac_form = ""; … … 109 106 Element('form_body').innerHTML = ""; 110 107 Element('form_body').innerHTML = this.forms_(); 108 Element('Edit_form_buttons').style.display = ''; 109 Element('form_buttons').style.display = 'none'; 111 110 this.ind = pos; 112 111 … … 221 220 var mark_values = this.values[fields[8]].split(","); 222 221 for(var i=0; i < mark_values.length; i++){ 222 if( mark_values[i] == "checkBox1" || mark_values[i] == "checkBox2"){ 223 document.getElementById(mark_values[i]).checked = true; 224 } 223 225 if( mark_values[i] == "checkBox2"){ 224 226 document.getElementById(mark_values[i]).checked = true; … … 313 315 var form = ""; 314 316 form = "<div id='div_rule' style='display:none'><table id='table_rule' border='0' cellpading='0' cellspacing='0' width='100%'>"+ 317 "<tr><td colspan='2'><input type='checkBox' id='checkBox1' name='checkb'>"+get_lang('Also check message against next rule') + "</td></tr>"+ 318 //"<tr><td colspan='2'><input type='checkBox' id='checkBox2' onclick='filter.disable_radio3();' name='checkb'>"+get_lang('Keep a copy of the message at your Inbox')+ "</td><tr>"+ 319 "<tr><td colspan='2'><hr size='1' width='100%'></td></tr><tr>"+ 315 320 "<tr><td colspan='2'><b>"+get_lang("Criteria")+":</b></td></tr><tr>"+ 316 321 "<td rowspan='4' width='20%'>"+get_lang('Find items')+":<br><select id='select_rules' name='select_rules'>"+ … … 338 343 //"<tr><td colspan='3'><br>"+get_lang('Subject')+".: <input type='text' id='field7' name='field7' size='35' maxlength='200'/></td></tr>"+ 339 344 "<tr><td colspan='3'><br>"+get_lang('With the following message')+".:</td>"+ 340 "</tr><tr><td colspan='3'><textarea id='field8' onkeypress='return charCounter(this);'rows='8' cols='50'></textarea></td></tr></table></div>" +345 "</tr><tr><td colspan='3'><textarea id='field8' rows='8' cols='50'></textarea></td></tr></table></div>" + 341 346 "<div id='div_voipFilter' style='display:none'>" + 342 347 "<br/><table id='table_voipFilter'>" + 343 348 "<tr><td>"+get_lang("Type the subject of the message for receiving a phone warning")+" .:"+ 344 349 "</td></tr><tr><td><input type='text' id='field9' size='50' maxlength='200'>" + 345 "</td></tr><br/></table></div>" +346 "<span align='right'><input type='button' value="+get_lang("Back")+" onclick='filter.form_m()'></span>"+347 "<span align='right'><input type='button' value="+get_lang("Save")+" onclick='filter.saved_rules()'></span>";350 "</td></tr><br/></table></div>";// + 351 //"<span align='right'><input type='button' value="+get_lang("Back")+" onclick='filter.form_m()'></span>"+ 352 //"<span align='right'><input type='button' value="+get_lang("Save")+" onclick='filter.saved_rules()'></span>"; 348 353 return form; 349 354 } … … 487 492 //Save outoffice in prefs: 488 493 connector.loadScript("preferences"); 489 if(typeof(prefe) == 'undefined'){490 setTimeout("filter.delete_r();",500);491 }492 else493 494 prefe.save("outoffice", _this.out_officeF); 494 495 } … … 573 574 } 574 575 575 if(LTrim(Element("field1").value) == "" && LTrim(Element("field2").value) == "" && LTrim(Element("field3").value) == "" && Element("field4").value == "")576 if(LTrim(Element("field1").value) == "" && LTrim(Element("field2").value) == "" && LTrim(Element("field3").value) == "" && LTrim(Element("field4").value).length == 0) 576 577 { 577 578 alert(get_lang("Define some criterion to the fields Sender, To and Subject with more than 3 characters!")); 578 579 return false; 579 580 } 580 581 if((LTrim(Element("field1").value).length <= 3) && (LTrim(Element("field2").value).length <= 3) && (LTrim(Element("field3").value).length <= 3 && Element("field4").value == "")){ 581 if((LTrim(Element("field1").value).length <= 3) && LTrim(Element("field1").value) != ""){ 582 alert(get_lang("Define some criterion to the fields Sender, To and Subject with more than 3 characters!")); 583 return false; 584 }if((LTrim(Element("field2").value).length <= 3) && LTrim(Element("field2").value) != ""){ 585 alert(get_lang("Define some criterion to the fields Sender, To and Subject with more than 3 characters!")); 586 return false; 587 }if((LTrim(Element("field3").value).length <= 3) && LTrim(Element("field3").value) != ""){ 582 588 alert(get_lang("Define some criterion to the fields Sender, To and Subject with more than 3 characters!")); 583 589 return false; … … 649 655 } 650 656 var opts = ""; 657 if(Element("checkBox1").checked == true){ 658 opts += ",checkBox1"; 659 } 651 660 if(Element("checkBox2").checked == true){ 652 661 opts += ",checkBox2"; … … 691 700 return false; 692 701 } 702 else if(fld_men.value.length > 10000){ 703 alert(get_lang("Your message have %1 characters, the message needs to have less then 10000 characters",fld_men.value.length)); 704 return false; 705 } 693 706 this.out_officeR = mount_rule; 694 707 } … … 740 753 741 754 Element('form_buttons').style.display = ''; 755 Element('Edit_form_buttons').style.display = 'none'; 742 756 this.reload_rules(); 743 757 } … … 824 838 } 825 839 826 connector.loadScript("preferences");827 840 // build object 828 841 var filter;
Note: See TracChangeset
for help on using the changeset viewer.