| | |
| | | url += (url.match(/\?/) ? '&' : '?') + '_extwin=1'; |
| | | |
| | | if (this.env.standard_windows) |
| | | extwin = window.open(url, wname); |
| | | var extwin = window.open(url, wname); |
| | | else { |
| | | var win = this.is_framed() ? parent.window : window, |
| | | page = $(win), |
| | |
| | | } |
| | | |
| | | // focus window, delayed to bring to front |
| | | window.setTimeout(function() { extwin.focus(); }, 10); |
| | | window.setTimeout(function() { extwin && extwin.focus(); }, 10); |
| | | |
| | | return extwin; |
| | | }; |
| | |
| | | formdata.draft_id = this.env.draft_id; |
| | | } |
| | | |
| | | $('input, select, textarea', this.gui_objects.messageform).each(function(i, elem){ |
| | | $('input, select, textarea', this.gui_objects.messageform).each(function(i, elem) { |
| | | switch (elem.tagName.toLowerCase()) { |
| | | case 'input': |
| | | if (elem.type == 'button' || elem.type == 'submit' || (elem.type == 'hidden' && elem.name != '_is_html')) { |
| | |
| | | var index = this.local_storage_get_item('compose.index', []), |
| | | key = this.env.compose_id; |
| | | |
| | | if (index.indexOf(key) < 0) { |
| | | if ($.inArray(key, index) < 0) { |
| | | index.push(key); |
| | | } |
| | | this.local_storage_set_item('compose.' + key, formdata, true); |
| | |
| | | var ed, formdata = this.local_storage_get_item('compose.' + key, true); |
| | | |
| | | if (formdata && typeof formdata == 'object') { |
| | | $.each(formdata, function(k, value){ |
| | | $.each(formdata, function(k, value) { |
| | | if (k[0] == '_') { |
| | | var elem = $("*[name='"+k+"']"); |
| | | if (elem[0] && elem[0].type == 'checkbox') { |
| | |
| | | if (window.localStorage) { |
| | | var index = this.local_storage_get_item('compose.index', []); |
| | | |
| | | if (index.indexOf(key) >= 0) { |
| | | if ($.inArray(key, index) >= 0) { |
| | | this.local_storage_remove_item('compose.' + key); |
| | | this.local_storage_set_item('compose.index', $.grep(index, function(val,i){ return val != key; })); |
| | | this.local_storage_set_item('compose.index', $.grep(index, function(val,i) { return val != key; })); |
| | | } |
| | | } |
| | | }; |
| | |
| | | if (!this.gui_objects.subscriptionlist) |
| | | return false; |
| | | |
| | | var row, n, i, tmp, tmp_name, folders, rowid, list = [], slist = [], |
| | | var row, n, i, tmp, tmp_name, rowid, folders = [], list = [], slist = [], |
| | | tbody = this.gui_objects.subscriptionlist.tBodies[0], |
| | | refrow = $('tr', tbody).get(1), |
| | | id = 'rcmrow'+((new Date).getTime()); |
| | |
| | | row = $(refrow).clone(true); |
| | | |
| | | // set ID, reset css class |
| | | row.attr('id', id); |
| | | row.attr('class', class_name); |
| | | row.attr({id: id, 'class': class_name}); |
| | | |
| | | // set folder name |
| | | row.find('td:first').html(display_name); |
| | |
| | | // add to folder/row-ID map |
| | | this.env.subscriptionrows[id] = [name, display_name, 0]; |
| | | |
| | | // sort folders, to find a place where to insert the row |
| | | folders = []; |
| | | $.each(this.env.subscriptionrows, function(k,v){ folders.push(v) }); |
| | | folders.sort(function(a,b){ return a[0] < b[0] ? -1 : (a[0] > b[0] ? 1 : 0) }); |
| | | // sort folders (to find a place where to insert the row) |
| | | // replace delimiter with \0 character to fix sorting |
| | | // issue where 'Abc Abc' would be placed before 'Abc/def' |
| | | var replace_from = RegExp(RegExp.escape(this.env.delimiter), 'g'), |
| | | replace_to = String.fromCharCode(0); |
| | | $.each(this.env.subscriptionrows, function(k,v) { |
| | | var n = v[0]; |
| | | n = n.replace(replace_from, replace_to); |
| | | v.push(n); |
| | | folders.push(v); |
| | | }); |
| | | folders.sort(function(a, b) { |
| | | var len = a.length - 1; n1 = a[len], n2 = b[len]; |
| | | return n1 < n2 ? -1 : 1; |
| | | }); |
| | | |
| | | for (n in folders) { |
| | | // protected folder |