Changeset 6080 in subversion
- Timestamp:
- Apr 13, 2012 9:50:54 AM (14 months ago)
- File:
-
- 1 edited
-
trunk/roundcubemail/program/js/app.js (modified) (74 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/js/app.js
r6066 r6080 232 232 233 233 if (this.env.action == 'show') { 234 this.http_request('pagenav', '_uid='+this.env.uid+'&_mbox='+urlencode(this.env.mailbox) 235 + (this.env.search_request ? '&_search='+this.env.search_request : ''), 234 this.http_request('pagenav', {_uid: this.env.uid, _mbox: this.env.mailbox, _search: this.env.search_request}, 236 235 this.display_message('', 'loading')); 237 236 } … … 282 281 this.env.unread_counts = {}; 283 282 this.gui_objects.folderlist = this.gui_objects.mailboxlist; 284 this.http_request('getunread' , '');283 this.http_request('getunread'); 285 284 } 286 285 … … 301 300 // ask user to send MDN 302 301 if (this.env.mdn_request && this.env.uid) { 303 var mdnurl = '_uid='+this.env.uid+'&_mbox='+urlencode(this.env.mailbox); 304 if (confirm(this.get_label('mdnrequest'))) 305 this.http_post('sendmdn', mdnurl); 306 else 307 this.http_post('mark', mdnurl+'&_flag=mdnsent'); 302 var postact = 'sendmdn', 303 postdata = {_uid: this.env.uid, _mbox: this.env.mailbox}; 304 if (!confirm(this.get_label('mdnrequest'))) { 305 postdata._flag = 'mdnsent'; 306 postact = 'mark'; 307 } 308 this.http_post(postact, postdata); 308 309 } 309 310 … … 1236 1237 return url.replace(/(\?.*)$/, urldata); 1237 1238 } 1238 else 1239 return url + '?' + name + '=' + value;1239 1240 return url + '?' + name + '=' + value; 1240 1241 }; 1241 1242 … … 1892 1893 this.set_list_options = function(cols, sort_col, sort_order, threads) 1893 1894 { 1894 var update, add_url = '';1895 var update, post_data = {}; 1895 1896 1896 1897 if (sort_col === undefined) … … 1906 1907 if (this.env.threading != threads) { 1907 1908 update = 1; 1908 add_url += '&_threads=' +threads;1909 post_data._threads = threads; 1909 1910 } 1910 1911 … … 1926 1927 if (newcols.join() != oldcols.join()) { 1927 1928 update = 1; 1928 add_url += '&_cols=' +newcols.join(',');1929 post_data._cols = newcols.join(','); 1929 1930 } 1930 1931 } 1931 1932 1932 1933 if (update) 1933 this.list_mailbox('', '', sort_col+'_'+sort_order, add_url);1934 this.list_mailbox('', '', sort_col+'_'+sort_order, post_data); 1934 1935 }; 1935 1936 … … 1971 1972 } 1972 1973 if (ref.env.preview_pane_mark_read > 0) 1973 ref.http_post('mark', '_uid='+id+'&_flag=read&_quiet=1');1974 ref.http_post('mark', {_uid: id, _flag: 'read', _quiet: 1}); 1974 1975 }, this.env.preview_pane_mark_read * 1000); 1975 1976 } … … 2034 2035 2035 2036 // list messages of a specific mailbox 2036 this.list_mailbox = function(mbox, page, sort, add_url) 2037 { 2038 var url = '', target = window; 2037 this.list_mailbox = function(mbox, page, sort, url) 2038 { 2039 var target = window; 2040 2041 if (typeof url != 'object') 2042 url = {}; 2039 2043 2040 2044 if (!mbox) 2041 2045 mbox = this.env.mailbox ? this.env.mailbox : 'INBOX'; 2042 2046 2043 if (add_url)2044 url += add_url;2045 2046 2047 // add sort to url if set 2047 2048 if (sort) 2048 url += '&_sort=' +sort;2049 url._sort = sort; 2049 2050 2050 2051 // also send search request to get the right messages 2051 2052 if (this.env.search_request) 2052 url += '&_search='+this.env.search_request;2053 url._search = this.env.search_request; 2053 2054 2054 2055 // set page=1 if changeing to another mailbox … … 2063 2064 2064 2065 if (mbox != this.env.mailbox || (mbox == this.env.mailbox && !page && !sort)) 2065 url += '&_refresh=1';2066 url._refresh = 1; 2066 2067 2067 2068 this.select_folder(mbox, '', true); … … 2077 2078 if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) { 2078 2079 target = window.frames[this.env.contentframe]; 2079 url += '&_framed=1';2080 url._framed = 1; 2080 2081 } 2081 2082 … … 2083 2084 if (mbox) { 2084 2085 this.set_busy(true, 'loading'); 2085 this.location_href(this.env.comm_path+'&_mbox='+urlencode(mbox)+(page ? '&_page='+page : '')+url, target); 2086 url._mbox = mbox; 2087 if (page) 2088 url._page = page; 2089 this.location_href(url, target); 2086 2090 } 2087 2091 }; … … 2098 2102 2099 2103 // send remote request to load message list 2100 this.list_mailbox_remote = function(mbox, page, add_url)2104 this.list_mailbox_remote = function(mbox, page, post_data) 2101 2105 { 2102 2106 // clear message list first 2103 2107 this.message_list.clear(); 2104 2108 2105 // send request to server 2106 var url = '_mbox='+urlencode(mbox)+(page ? '&_page='+page : ''), 2107 lock = this.set_busy(true, 'loading'); 2108 this.http_request('list', url+add_url, lock); 2109 var lock = this.set_busy(true, 'loading'); 2110 2111 if (typeof post_data != 'object') 2112 post_data = {}; 2113 post_data._mbox = mbox; 2114 if (page) 2115 post_data._page = page; 2116 2117 this.http_request('list', post_data, lock); 2109 2118 }; 2110 2119 … … 2499 2508 return; 2500 2509 2501 var a_uids = [], 2510 var a_uids = [], n, selection, 2502 2511 lock = this.display_message(this.get_label('copyingmessage'), 'loading'), 2503 add_url = '&_target_mbox='+urlencode(mbox)+'&_from='+(this.env.action ? this.env.action : '');2512 post_data = {_mbox: this.env.mailbox, _target_mbox: mbox, _from: (this.env.action ? this.env.action : '')}; 2504 2513 2505 2514 if (this.env.uid) 2506 2515 a_uids[0] = this.env.uid; 2507 2516 else { 2508 varselection = this.message_list.get_selection();2509 for ( varn in selection) {2517 selection = this.message_list.get_selection(); 2518 for (n in selection) { 2510 2519 a_uids.push(selection[n]); 2511 2520 } 2512 2521 } 2513 2522 2514 add_url += '&_uid='+this.uids_to_list(a_uids);2523 post_data._uid = this.uids_to_list(a_uids); 2515 2524 2516 2525 // send request to server 2517 this.http_post('copy', '_mbox='+urlencode(this.env.mailbox)+add_url, lock);2526 this.http_post('copy', post_data, lock); 2518 2527 }; 2519 2528 … … 2529 2538 2530 2539 var lock = false, 2531 add_ url = '&_target_mbox='+urlencode(mbox)+'&_from='+(this.env.action ? this.env.action : '');2540 add_post = {_target_mbox: mbox, _from: (this.env.action ? this.env.action : '')}; 2532 2541 2533 2542 // show wait message 2534 if (this.env.action == 'show') {2543 if (this.env.action == 'show') 2535 2544 lock = this.set_busy(true, 'movingmessage'); 2536 }2537 2545 else 2538 2546 this.show_contentframe(false); … … 2541 2549 this.enable_command(this.env.message_commands, false); 2542 2550 2543 this._with_selected_messages('moveto', lock, add_ url);2551 this._with_selected_messages('moveto', lock, add_post); 2544 2552 }; 2545 2553 … … 2596 2604 2597 2605 this.show_contentframe(false); 2598 this._with_selected_messages('delete', false, '&_from='+(this.env.action ? this.env.action : ''));2606 this._with_selected_messages('delete', false, {_from: this.env.action ? this.env.action : ''}); 2599 2607 }; 2600 2608 2601 2609 // Send a specifc moveto/delete request with UIDs of all selected messages 2602 2610 // @private 2603 this._with_selected_messages = function(action, lock, add_url) 2604 { 2605 var a_uids = [], count = 0, msg; 2611 this._with_selected_messages = function(action, lock, post_data) 2612 { 2613 var a_uids = [], count = 0, msg, lock; 2614 2615 if (typeof(post_data) != 'object') 2616 post_data = {}; 2606 2617 2607 2618 if (this.env.uid) … … 2635 2646 // also send search request to get the right messages 2636 2647 if (this.env.search_request) 2637 add_url += '&_search='+this.env.search_request;2648 post_data._search = this.env.search_request; 2638 2649 2639 2650 if (this.env.display_next && this.env.next_uid) 2640 add_url += '&_next_uid='+this.env.next_uid;2651 post_data._next_uid = this.env.next_uid; 2641 2652 2642 2653 if (count < 0) 2643 add_url += '&_count='+(count*-1);2644 else if (count > 0)2645 // remove threads from the end of the list2654 post_data._count = (count*-1); 2655 // remove threads from the end of the list 2656 else if (count > 0) 2646 2657 this.delete_excessive_thread_rows(); 2647 2658 2648 add_url += '&_uid='+this.uids_to_list(a_uids); 2659 post_data._uid = this.uids_to_list(a_uids); 2660 post_data._mbox = this.env.mailbox; 2649 2661 2650 2662 if (!lock) { … … 2654 2666 2655 2667 // send request to server 2656 this.http_post(action, '_mbox='+urlencode(this.env.mailbox)+add_url, lock);2668 this.http_post(action, post_data, lock); 2657 2669 }; 2658 2670 … … 2713 2725 { 2714 2726 var i, len = a_uids.length, 2715 url = '_uid='+this.uids_to_list(a_uids)+'&_flag='+flag,2727 post_data = {_uid: this.uids_to_list(a_uids), _flag: flag}, 2716 2728 lock = this.display_message(this.get_label('markingmessage'), 'loading'); 2717 2729 … … 2722 2734 // also send search request to get the right messages 2723 2735 if (this.env.search_request) 2724 url += '&_search='+this.env.search_request;2725 2726 this.http_post('mark', url, lock);2736 post_data._search = this.env.search_request; 2737 2738 this.http_post('mark', post_data, lock); 2727 2739 2728 2740 for (i=0; i<len; i++) … … 2734 2746 { 2735 2747 var i, len = a_uids.length, 2736 url = '_uid='+this.uids_to_list(a_uids)+'&_flag='+flag,2748 post_data = {_uid: this.uids_to_list(a_uids), _flag: flag}, 2737 2749 lock = this.display_message(this.get_label('markingmessage'), 'loading'); 2738 2750 … … 2743 2755 // also send search request to get the right messages 2744 2756 if (this.env.search_request) 2745 url += '&_search='+this.env.search_request;2746 2747 this.http_post('mark', url, lock);2757 post_data._search = this.env.search_request; 2758 2759 this.http_post('mark', post_data, lock); 2748 2760 }; 2749 2761 … … 2783 2795 { 2784 2796 var i, len=a_uids.length, 2785 url = '_uid='+this.uids_to_list(a_uids)+'&_flag=undelete',2797 post_data = {_uid: this.uids_to_list(a_uids), _flag: 'undelete'}, 2786 2798 lock = this.display_message(this.get_label('markingmessage'), 'loading'); 2787 2799 … … 2791 2803 // also send search request to get the right messages 2792 2804 if (this.env.search_request) 2793 url += '&_search='+this.env.search_request;2794 2795 this.http_post('mark', url, lock);2805 post_data._search = this.env.search_request; 2806 2807 this.http_post('mark', post_data, lock); 2796 2808 return true; 2797 2809 }; … … 2799 2811 this.flag_as_deleted = function(a_uids) 2800 2812 { 2801 var add_url = '', 2802 r_uids = [], 2813 var r_uids = [], 2814 post_data = {_uid: this.uids_to_list(a_uids), _flag: 'delete'}, 2815 lock = this.display_message(this.get_label('markingmessage'), 'loading'), 2803 2816 rows = this.message_list ? this.message_list.rows : [], 2804 2817 count = 0; … … 2824 2837 this.message_list.clear_selection(); 2825 2838 if (count < 0) 2826 add_url += '&_count='+(count*-1);2839 post_data._count = (count*-1); 2827 2840 else if (count > 0) 2828 2841 // remove threads from the end of the list … … 2830 2843 } 2831 2844 2832 add_url = '&_from='+(this.env.action ? this.env.action : ''),2833 lock = this.display_message(this.get_label('markingmessage'), 'loading');2845 if (this.env.action) 2846 post_data._from = this.env.action; 2834 2847 2835 2848 // ?? 2836 2849 if (r_uids.length) 2837 add_url += '&_ruid='+this.uids_to_list(r_uids); 2838 2839 if (this.env.skip_deleted) { 2840 if (this.env.display_next && this.env.next_uid) 2841 add_url += '&_next_uid='+this.env.next_uid; 2842 } 2850 post_data._ruid = this.uids_to_list(r_uids); 2851 2852 if (this.env.skip_deleted && this.env.display_next && this.env.next_uid) 2853 post_data._next_uid = this.env.next_uid; 2843 2854 2844 2855 // also send search request to get the right messages 2845 2856 if (this.env.search_request) 2846 add_url += '&_search='+this.env.search_request;2847 2848 this.http_post('mark', '_uid='+this.uids_to_list(a_uids)+'&_flag=delete'+add_url, lock);2857 post_data._search = this.env.search_request; 2858 2859 this.http_post('mark', post_data, lock); 2849 2860 return true; 2850 2861 }; … … 2893 2904 this.expunge_mailbox = function(mbox) 2894 2905 { 2895 var lock, url = '_mbox='+urlencode(mbox);2906 var lock, post_data = {_mbox: mbox}; 2896 2907 2897 2908 // lock interface if it's the active mailbox 2898 2909 if (mbox == this.env.mailbox) { 2899 2910 lock = this.set_busy(true, 'loading'); 2900 url += '&_reload=1';2911 post_data._reload = 1; 2901 2912 if (this.env.search_request) 2902 url += '&_search='+this.env.search_request;2913 post_data._search = this.env.search_request; 2903 2914 } 2904 2915 2905 2916 // send request to server 2906 this.http_post('expunge', url, lock);2917 this.http_post('expunge', post_data, lock); 2907 2918 }; 2908 2919 2909 2920 this.purge_mailbox = function(mbox) 2910 2921 { 2911 var lock = false, 2912 url = '_mbox='+urlencode(mbox); 2922 var lock, post_data = {_mbox: mbox}; 2913 2923 2914 2924 if (!confirm(this.get_label('purgefolderconfirm'))) … … 2918 2928 if (mbox == this.env.mailbox) { 2919 2929 lock = this.set_busy(true, 'loading'); 2920 url += '&_reload=1';2930 post_data._reload = 1; 2921 2931 } 2922 2932 2923 2933 // send request to server 2924 this.http_post('purge', url, lock);2934 this.http_post('purge', post_data, lock); 2925 2935 }; 2926 2936 … … 3038 3048 var gid = id.substr(1); 3039 3049 this.group2expand[gid] = { name:this.env.contactdata[id], input:input.get(0) }; 3040 this.http_request('group-expand', '_source='+urlencode(this.env.source)+'&_gid='+urlencode(gid), false);3050 this.http_request('group-expand', {_source: this.env.source, _gid: gid}, false); 3041 3051 } 3042 3052 } … … 3548 3558 { 3549 3559 if (value) 3550 this.http_post('addcontact', '_address='+value);3560 this.http_post('addcontact', {_address: value}); 3551 3561 3552 3562 return true; … … 3557 3567 { 3558 3568 if (value != '') { 3559 var n, lock = this.set_busy(true, 'searching'); 3569 var r, lock = this.set_busy(true, 'searching'), 3570 url = this.search_params(value); 3560 3571 3561 3572 if (this.message_list) … … 3564 3575 this.list_contacts_clear(); 3565 3576 3577 if (this.env.source) 3578 url._source = this.env.source; 3579 if (this.env.group) 3580 url._gid = this.env.group; 3581 3566 3582 // reset vars 3567 3583 this.env.current_page = 1; 3568 r = this.http_request('search', this.search_params(value) 3569 + (this.env.source ? '&_source='+urlencode(this.env.source) : '') 3570 + (this.env.group ? '&_gid='+urlencode(this.env.group) : ''), lock); 3584 3585 r = this.http_request('search', url, lock); 3571 3586 3572 3587 this.env.qsearch = {lock: lock, request: r}; … … 3577 3592 this.search_params = function(search, filter) 3578 3593 { 3579 var n, url = [], mods_arr = [],3594 var n, url = {}, mods_arr = [], 3580 3595 mods = this.env.search_mods, 3581 3596 mbox = this.env.mailbox; … … 3588 3603 3589 3604 if (filter) 3590 url. push('_filter=' + urlencode(filter));3605 url._filter = filter; 3591 3606 3592 3607 if (search) { 3593 url. push('_q='+urlencode(search));3608 url._q = search; 3594 3609 3595 3610 if (mods && this.message_list) … … 3599 3614 for (n in mods) 3600 3615 mods_arr.push(n); 3601 url. push('_headers='+mods_arr.join(','));3616 url._headers = mods_arr.join(','); 3602 3617 } 3603 3618 } 3604 3619 3605 3620 if (mbox) 3606 url. push('_mbox='+urlencode(mbox));3607 3608 return url .join('&');3621 url._mbox = mbox; 3622 3623 return url; 3609 3624 }; 3610 3625 … … 3734 3749 insert += this.env.contacts[id].name + this.env.recipients_delimiter; 3735 3750 this.group2expand[this.env.contacts[id].id] = $.extend({ input: this.ksearch_input }, this.env.contacts[id]); 3736 this.http_request('mail/group-expand', '_source='+urlencode(this.env.contacts[id].source)+'&_gid='+urlencode(this.env.contacts[id].id), false);3751 this.http_request('mail/group-expand', {_source: this.env.contacts[id].source, _gid: this.env.contacts[id].id}, false); 3737 3752 } 3738 3753 else if (typeof this.env.contacts[id] === 'string') { … … 3808 3823 3809 3824 var i, lock, source, xhr, reqid = new Date().getTime(), 3825 post_data = {_search: q, _id: reqid}, 3810 3826 threads = props && props.threads ? props.threads : 1, 3811 3827 sources = props && props.sources ? props.sources : [], … … 3820 3836 break; 3821 3837 3838 post_data._source = source ? source : ''; 3822 3839 lock = this.display_message(this.get_label('searching'), 'loading'); 3823 xhr = this.http_post(action, '_search='+urlencode(q)+'&_id='+reqid 3824 + (source ? '&_source='+urlencode(source) : ''), lock); 3840 xhr = this.http_post(action, post_data, lock); 3825 3841 3826 3842 this.ksearch_data.locks.push(lock); … … 3900 3916 data.num--; 3901 3917 if (maxlen > 0 && data.sources.length) { 3902 var lock, xhr, source = data.sources.shift() ;3918 var lock, xhr, source = data.sources.shift(), post_data; 3903 3919 if (source) { 3920 post_data = {_search: value, _id: reqid, _source: source}; 3904 3921 lock = this.display_message(this.get_label('searching'), 'loading'); 3905 xhr = this.http_post(data.action, '_search='+urlencode(value)+'&_id='+reqid 3906 +'&_source='+urlencode(source), lock); 3922 xhr = this.http_post(data.action, post_data, lock); 3907 3923 3908 3924 this.ksearch_data.locks.push(lock); … … 4030 4046 this.list_contacts = function(src, group, page) 4031 4047 { 4032 var folder, add_url = '',4048 var folder, url = {}, 4033 4049 target = window; 4034 4050 … … 4064 4080 if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) { 4065 4081 target = window.frames[this.env.contentframe]; 4066 add_url = '&_framed=1';4082 url._framed = 1; 4067 4083 } 4068 4084 4069 4085 if (group) 4070 add_url += '&_gid='+group;4086 url._gid = group; 4071 4087 if (page) 4072 add_url += '&_page='+page; 4088 url._page = page; 4089 if (src) 4090 url._source = src; 4073 4091 4074 4092 // also send search request to get the correct listing 4075 4093 if (this.env.search_request) 4076 add_url += '&_search='+this.env.search_request;4094 url._search = this.env.search_request; 4077 4095 4078 4096 this.set_busy(true, 'loading'); 4079 this.location_href( this.env.comm_path + (src ? '&_source='+urlencode(src) : '') + add_url, target);4097 this.location_href(url, target); 4080 4098 }; 4081 4099 … … 4087 4105 4088 4106 // send request to server 4089 var url = (src ? '_source='+urlencode(src) : '') + (page ? (src?'&':'') + '_page='+page : ''), 4090 lock = this.set_busy(true, 'loading'); 4107 var url = {}, lock = this.set_busy(true, 'loading'); 4108 4109 if (src) 4110 url._source = src; 4111 if (page) 4112 url._page = page; 4113 if (group) 4114 url._gid = group; 4091 4115 4092 4116 this.env.source = src; 4093 4117 this.env.group = group; 4094 4118 4095 if (group)4096 url += '&_gid='+group;4097 4098 4119 // also send search request to get the right messages 4099 4120 if (this.env.search_request) 4100 url += '&_search='+this.env.search_request;4121 url._search = this.env.search_request; 4101 4122 4102 4123 this.http_request(this.env.task == 'mail' ? 'list-contacts' : 'list', url, lock); … … 4114 4135 this.load_contact = function(cid, action, framed) 4115 4136 { 4116 var add_url = '', target = window;4137 var url = {}, target = window; 4117 4138 4118 4139 if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) { 4119 add_url = '&_framed=1';4140 url._framed = 1; 4120 4141 target = window.frames[this.env.contentframe]; 4121 4142 this.show_contentframe(true); … … 4133 4154 if (action && (cid || action=='add') && !this.drag_active) { 4134 4155 if (this.env.group) 4135 add_url += '&_gid='+urlencode(this.env.group); 4136 4137 this.location_href(this.env.comm_path+'&_action='+action 4138 +'&_source='+urlencode(this.env.source) 4139 +'&_cid='+urlencode(cid) + add_url, target, true); 4140 } 4156 url._gid = this.env.group; 4157 4158 url._action = action; 4159 url._source = this.env.source; 4160 url._cid = cid; 4161 4162 this.location_href(url, target, true); 4163 } 4164 4141 4165 return true; 4142 4166 }; … … 4146 4170 { 4147 4171 what = what == 'add' ? 'add' : 'del'; 4148 var l ock = this.display_message(this.get_label(what == 'add' ? 'addingmember' : 'removingmember'), 'loading');4149 4150 this.http_post('group-'+what+'members', '_cid='+urlencode(cid)4151 + '&_source='+urlencode(source) 4152 + '&_gid='+urlencode(gid), lock);4172 var label = this.get_label(what == 'add' ? 'addingmember' : 'removingmember'), 4173 lock = this.display_message(label, 'loading'), 4174 post_data = {_cid: cid, _source: source, _gid: gid}; 4175 4176 this.http_post('group-'+what+'members', post_data, lock); 4153 4177 }; 4154 4178 … … 4162 4186 this.group_member_change('add', cid, to.source, to.id); 4163 4187 else if (to.type == 'group' && !this.env.address_sources[to.source].readonly) { 4164 var lock = this.display_message(this.get_label('copyingcontact'), 'loading'); 4165 this.http_post('copy', '_cid='+urlencode(cid) 4166 + '&_source='+urlencode(this.env.source) 4167 + '&_to='+urlencode(to.source) 4168 + '&_togid='+urlencode(to.id) 4169 + (this.env.group ? '&_gid='+urlencode(this.env.group) : ''), lock); 4188 var lock = this.display_message(this.get_label('copyingcontact'), 'loading'), 4189 post_data = {_cid: cid, _source: this.env.source, _to: to.source, _togid: to.id, 4190 _gid: (this.env.group ? this.env.group : '')}; 4191 4192 this.http_post('copy', post_data, lock); 4170 4193 } 4171 4194 else if (to.id != this.env.source && cid && this.env.address_sources[to.id] && !this.env.address_sources[to.id].readonly) { 4172 var lock = this.display_message(this.get_label('copyingcontact'), 'loading') ;4173 this.http_post('copy', '_cid='+urlencode(cid)4174 + '&_source='+urlencode(this.env.source)4175 + '&_to='+urlencode(to.id) 4176 + (this.env.group ? '&_gid='+urlencode(this.env.group) : ''), lock);4195 var lock = this.display_message(this.get_label('copyingcontact'), 'loading'), 4196 post_data = {_cid: cid, _source: this.env.source, _to: to.id, 4197 _gid: (this.env.group ? this.env.group : '')}; 4198 4199 this.http_post('copy', post_data, lock); 4177 4200 } 4178 4201 }; … … 4187 4210 return; 4188 4211 4189 var id, n, a_cids = [], qs = ''; 4212 var id, n, a_cids = [], 4213 post_data = {_source: this.env.source, _from: (this.env.action ? this.env.action : '')}, 4214 lock = this.display_message(this.get_label('contactdeleting'), 'loading'); 4190 4215 4191 4216 if (this.env.cid) … … 4203 4228 } 4204 4229 4230 post_data._cid = a_cids.join(','); 4231 4205 4232 if (this.env.group) 4206 qs += '&_gid='+urlencode(this.env.group);4233 post_data._gid = this.env.group; 4207 4234 4208 4235 // also send search request to get the right records from the next page 4209 4236 if (this.env.search_request) 4210 qs += '&_search='+this.env.search_request;4237 post_data._search = this.env.search_request; 4211 4238 4212 4239 // send request to server 4213 this.http_post('delete', '_cid='+urlencode(a_cids.join(',')) 4214 +'&_source='+urlencode(this.env.source) 4215 +'&_from='+(this.env.action ? this.env.action : '')+qs, 4216 this.display_message(this.get_label('contactdeleting'), 'loading')); 4240 this.http_post('delete', post_data, lock) 4217 4241 4218 4242 return true; … … 4343 4367 if (this.env.group && confirm(this.get_label('deletegroupconfirm'))) { 4344 4368 var lock = this.set_busy(true, 'groupdeleting'); 4345 this.http_post('group-delete', '_source='+urlencode(this.env.source)+'&_gid='+urlencode(this.env.group), lock);4369 this.http_post('group-delete', {_source: this.env.source, _gid: this.env.group}, lock); 4346 4370 } 4347 4371 }; … … 4383 4407 this.group_remove_selected = function() 4384 4408 { 4385 ref.http_post('group-delmembers','_cid='+urlencode(this.contact_list.selection) 4386 + '&_source='+urlencode(this.env.source) 4387 + '&_gid='+urlencode(this.env.group)); 4409 ref.http_post('group-delmembers', {_cid: this.contact_list.selection, 4410 _source: this.env.source, _gid: this.env.group}); 4388 4411 }; 4389 4412 … … 4392 4415 { 4393 4416 if('undefined' != typeof this.env.group && (this.env.group === props.gid)){ 4394 var selection = this.contact_list.get_selection();4395 for ( varn=0; n<selection.length; n++) {4396 id = selection[n];4397 this.contact_list.remove_row(id, (n == selection.length-1));4417 var n, selection = this.contact_list.get_selection(); 4418 for (n=0; n<selection.length; n++) { 4419 id = selection[n]; 4420 this.contact_list.remove_row(id, (n == selection.length-1)); 4398 4421 } 4399 4422 } 4400 4423 } 4401 4402 4403 4424 4404 4425 // handler for keyboard events on the input field … … 4416 4437 4417 4438 if (itype == 'contactsearch') 4418 this.http_post('search-create', '_search='+urlencode(this.env.search_request)+'&_name='+urlencode(newname), lock);4439 this.http_post('search-create', {_search: this.env.search_request, _name: newname}, lock); 4419 4440 else if (this.env.group_renaming) 4420 this.http_post('group-rename', '_source='+urlencode(this.env.source)+'&_gid='+urlencode(this.env.group)+'&_name='+urlencode(newname), lock);4441 this.http_post('group-rename', {_source: this.env.source, _gid: this.env.group, _name: newname}, lock); 4421 4442 else 4422 this.http_post('group-create', '_source='+urlencode(this.env.source)+'&_name='+urlencode(newname), lock);4443 this.http_post('group-create', {_source: this.env.source, _name: newname}, lock); 4423 4444 } 4424 4445 return false; … … 4728 4749 this.advanced_search = function() 4729 4750 { 4730 var add_url = '&_form=1', target = window;4751 var url = {_form: 1, _action: 'search'}, target = window; 4731 4752 4732 4753 if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) { 4733 add_url += '&_framed=1';4754 url._framed = 1; 4734 4755 target = window.frames[this.env.contentframe]; 4735 4756 this.contact_list.clear_selection(); 4736 4757 } 4737 4758 4738 this.location_href( this.env.comm_path+'&_action=search'+add_url, target, true);4759 this.location_href(url, target, true); 4739 4760 4740 4761 return true; … … 4809 4830 if (this.env.search_request) { 4810 4831 var lock = this.set_busy(true, 'savedsearchdeleting'); 4811 this.http_post('search-delete', '_sid='+urlencode(this.env.search_id), lock);4832 this.http_post('search-delete', {_sid: this.env.search_id}, lock); 4812 4833 } 4813 4834 }; … … 4843 4864 // reset vars 4844 4865 this.env.current_page = 1; 4845 this.http_request('search', '_sid='+urlencode(id), lock);4866 this.http_request('search', {_sid: id}, lock); 4846 4867 }; 4847 4868 … … 4854 4875 this.section_select = function(list) 4855 4876 { 4856 var id = list.get_single_selection(), add_url = '', target = window; 4877 var id = list.get_single_selection(), target = window, 4878 url = {_action: 'edit-prefs', _section: id}; 4857 4879 4858 4880 if (id) { 4859 4881 if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) { 4860 add_url = '&_framed=1';4882 url._framed = 1; 4861 4883 target = window.frames[this.env.contentframe]; 4862 4884 } 4863 this.location_href( this.env.comm_path+'&_action=edit-prefs&_section='+id+add_url, target, true);4885 this.location_href(url, target, true); 4864 4886 } 4865 4887 … … 4882 4904 return false; 4883 4905 4884 var add_url = '', target = window; 4906 var target = window, 4907 url = {_action: action, _iid: id}; 4885 4908 4886 4909 if (this.env.contentframe && window.frames && window.frames[this.env.contentframe]) { 4887 add_url = '&_framed=1';4910 url._framed = 1; 4888 4911 target = window.frames[this.env.contentframe]; 4889 4912 document.getElementById(this.env.contentframe).style.visibility = 'inherit'; … … 4892 4915 if (action && (id || action == 'add-identity')) { 4893 4916 this.set_busy(true); 4894 this.location_href( this.env.comm_path+'&_action='+action+'&_iid='+id+add_url, target);4917 this.location_href(url, target); 4895 4918 } 4896 4919 … … 5017 5040 5018 5041 if (newname != this.env.mailbox) { 5019 this.http_post('rename-folder', '_folder_oldname='+urlencode(this.env.mailbox)+'&_folder_newname='+urlencode(newname), this.set_busy(true, 'foldermoving'));5042 this.http_post('rename-folder', {_folder_oldname: this.env.mailbox, _folder_newname: newname}, this.set_busy(true, 'foldermoving')); 5020 5043 this.subscription_list.draglayer.hide(); 5021 5044 } … … 5039 5062 if (folder && confirm(this.get_label('deletefolderconfirm'))) { 5040 5063 var lock = this.set_busy(true, 'folderdeleting'); 5041 this.http_post('delete-folder', '_mbox='+urlencode(folder), lock);5064 this.http_post('delete-folder', {_mbox: folder}, lock); 5042 5065 } 5043 5066 }; … … 5237 5260 if (folder) { 5238 5261 var lock = this.display_message(this.get_label('foldersubscribing'), 'loading'); 5239 this.http_post('subscribe', '_mbox='+urlencode(folder), lock);5262 this.http_post('subscribe', {_mbox: folder}, lock); 5240 5263 } 5241 5264 }; … … 5245 5268 if (folder) { 5246 5269 var lock = this.display_message(this.get_label('folderunsubscribing'), 'loading'); 5247 this.http_post('unsubscribe', '_mbox='+urlencode(folder), lock);5270 this.http_post('unsubscribe', {_mbox: folder}, lock); 5248 5271 } 5249 5272 }; … … 5274 5297 } 5275 5298 5276 if (String(target.location.href).indexOf(url) >= 0 && !force) {5299 if (String(target.location.href).indexOf(url) >= 0 && !force) 5277 5300 this.show_contentframe(true); 5278 } 5279 else { 5301 else 5280 5302 this.location_href(this.env.comm_path+url, target, true); 5281 }5282 5303 }; 5283 5304 … … 5293 5314 { 5294 5315 var lock = this.set_busy(true, 'loading'); 5295 this.http_post('folder-size', '_mbox='+urlencode(folder), lock);5316 this.http_post('folder-size', {_mbox: folder}, lock); 5296 5317 }; 5297 5318 … … 5368 5389 5369 5390 // get default/passive setting of the button 5370 if (obj && button.type =='image' && !button.status) {5391 if (obj && button.type == 'image' && !button.status) { 5371 5392 button.pas = obj._original_src ? obj._original_src : obj.src; 5372 5393 // respect PNG fix on IE browsers … … 5378 5399 5379 5400 // set image according to button state 5380 if (obj && button.type =='image' && button[state]) {5401 if (obj && button.type == 'image' && button[state]) { 5381 5402 button.status = state; 5382 5403 obj.src = button[state]; … … 5837 5858 if (!this.gui_objects.all_headers_box.innerHTML) { 5838 5859 var lock = this.display_message(this.get_label('loading'), 'loading'); 5839 this.http_post('headers', '_uid='+this.env.uid, lock);5860 this.http_post('headers', {_uid: this.env.uid}, lock); 5840 5861 } 5841 5862 }; … … 5901 5922 query._action = this.env.action; 5902 5923 5903 var base = this.env.comm_path ;5924 var base = this.env.comm_path, k, param = {}; 5904 5925 5905 5926 // overwrite task name … … 5910 5931 5911 5932 // remove undefined values 5912 var param = {}; 5913 for (var k in query) { 5933 for (k in query) { 5914 5934 if (query[k] !== undefined && query[k] !== null) 5915 5935 param[k] = query[k]; … … 5939 5959 if (frame) 5940 5960 this.lock_frame(); 5961 5962 if (typeof url == 'object') 5963 url = this.env.comm_path + '&' + $.param(url); 5941 5964 5942 5965 // simulate real link click to force IE to send referer header … … 6219 6242 return; 6220 6243 6221 var lock, addurl = '_mbox=' + urlencode(this.env.mailbox);6244 var lock, url = {_mbox: this.env.mailbox}; 6222 6245 6223 6246 if (refresh) { 6224 6247 lock = this.set_busy(true, 'checkingmail'); 6225 addurl += '&_refresh=1';6248 url._refresh = 1; 6226 6249 // reset check-recent interval 6227 6250 this.start_keepalive(); … … 6229 6252 6230 6253 if (this.gui_objects.messagelist) 6231 addurl += '&_list=1';6254 url._list = 1; 6232 6255 if (this.gui_objects.quotadisplay) 6233 addurl += '&_quota=1';6256 url._quota = 1; 6234 6257 if (this.env.search_request) 6235 addurl += '&_search=' +this.env.search_request;6236 6237 this.http_request('check-recent', addurl, lock);6258 url._search = this.env.search_request; 6259 6260 this.http_request('check-recent', url, lock); 6238 6261 }; 6239 6262
Note: See TracChangeset
for help on using the changeset viewer.
