| | |
| | | else if (input_subject.val() == '') |
| | | input_subject.focus(); |
| | | else if (input_message) |
| | | this.set_caret2start(input_message); |
| | | input_message.focus(); |
| | | |
| | | // get summary of all field values |
| | | this.compose_field_hash(true); |
| | |
| | | var input_message = $("[name='_message']"); |
| | | var message = input_message.val(); |
| | | var is_html = ($("input[name='_is_html']").val() == '1'); |
| | | var sig, p; |
| | | var sig, p, len; |
| | | |
| | | if (!this.env.identity) |
| | | this.env.identity = id |
| | |
| | | } |
| | | |
| | | message = message.replace(/[\r\n]+$/, ''); |
| | | |
| | | len = message.length; |
| | | |
| | | // add the new signature string |
| | | if (this.env.signatures && this.env.signatures[id]) |
| | | { |
| | |
| | | if (sig.indexOf('-- ')!=0) |
| | | sig = '-- \n'+sig; |
| | | message += '\n\n'+sig; |
| | | if (len) len += 1; |
| | | } |
| | | } |
| | | else |
| | |
| | | } |
| | | |
| | | input_message.val(message); |
| | | |
| | | // move cursor before the signature |
| | | if (!is_html) |
| | | this.set_caret_pos(input_message.get(0), len); |
| | | |
| | | this.env.identity = id; |
| | | return true; |
| | |
| | | }; |
| | | |
| | | // send remote request to search mail or contacts |
| | | this.qsearch = function(value, addurl) |
| | | this.qsearch = function(value) |
| | | { |
| | | if (value != '') |
| | | { |
| | | if (this.message_list) |
| | | var addurl = ''; |
| | | if (this.message_list) { |
| | | this.message_list.clear(); |
| | | else if (this.contact_list) { |
| | | if (this.env.search_mods) { |
| | | var head_arr = new Array(); |
| | | for (var n in this.env.search_mods) |
| | | head_arr.push(n); |
| | | addurl += '&_headers='+head_arr.join(','); |
| | | } |
| | | } else if (this.contact_list) { |
| | | this.contact_list.clear(true); |
| | | this.show_contentframe(false); |
| | | } |
| | | |
| | | if (this.gui_objects.search_filter) |
| | | addurl = '&_filter=' + this.gui_objects.search_filter.value; |
| | | addurl += '&_filter=' + this.gui_objects.search_filter.value; |
| | | |
| | | // reset vars |
| | | this.env.current_page = 1; |
| | |
| | | return obj.value.length; |
| | | }; |
| | | |
| | | this.set_caret2start = function(obj) |
| | | this.set_caret_pos = function(obj, pos) |
| | | { |
| | | if (obj.createTextRange) |
| | | if (obj.setSelectionRange) |
| | | obj.setSelectionRange(pos, pos); |
| | | else if (obj.createTextRange) |
| | | { |
| | | var range = obj.createTextRange(); |
| | | range.collapse(true); |
| | | range.moveEnd('character', pos); |
| | | range.moveStart('character', pos); |
| | | range.select(); |
| | | } |
| | | else if (obj.setSelectionRange) |
| | | obj.setSelectionRange(0,0); |
| | | |
| | | obj.focus(); |
| | | }; |
| | | } |
| | | |
| | | // set all fields of a form disabled |
| | | this.lock_form = function(form, lock) |