Changeset ad334a12 in github
- Timestamp:
- Oct 13, 2010 2:44:41 PM (3 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- f6aac38
- Parents:
- 48e8b31
- Files:
-
- 6 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/rcube_json_output.php (modified) (7 diffs)
-
program/include/rcube_template.php (modified) (26 diffs)
-
program/js/app.js (modified) (40 diffs)
-
program/js/googiespell.js (modified) (2 diffs)
-
program/steps/mail/sendmail.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
ra392125 rad334a12 28 28 - Add caching support in id2uid and uid2id functions (#1487019) 29 29 - Add SASL proxy authentication for SMTP (#1486693) 30 - Improve displaying of UI messages (#1486977) 30 31 31 32 RELEASE 0.4.2 -
program/include/rcube_json_output.php
r5c461ba rad334a12 135 135 { 136 136 $cmd = func_get_args(); 137 137 138 138 if (strpos($cmd[0], 'plugin.') === 0) 139 139 $this->callbacks[] = $cmd; … … 141 141 $this->commands[] = $cmd; 142 142 } 143 144 143 144 145 145 /** 146 146 * Add a localized label to the client environment … … 151 151 if (count($args) == 1 && is_array($args[0])) 152 152 $args = $args[0]; 153 153 154 154 foreach ($args as $name) { 155 155 $this->texts[$name] = rcube_label($name); … … 204 204 exit; 205 205 } 206 207 206 207 208 208 /** 209 209 * Send an AJAX response to the client. … … 214 214 exit; 215 215 } 216 217 216 217 218 218 /** 219 219 * Send an AJAX response with executable JS code … … 238 238 239 239 $rcmail = rcmail::get_instance(); 240 $response = array('action' => $rcmail->action, 'unlock' => (bool)$_REQUEST['_unlock']);241 240 $response = array('action' => $rcmail->action, 'unlock' => get_input_value('_unlock', RCUBE_INPUT_GPC)); 241 242 242 if (!empty($this->env)) 243 243 $response['env'] = $this->env; 244 244 245 245 if (!empty($this->texts)) 246 246 $response['texts'] = $this->texts; … … 248 248 // send function calls 249 249 $response['exec'] = $this->get_js_commands() . $add; 250 250 251 251 if (!empty($this->callbacks)) 252 252 $response['callbacks'] = $this->callbacks; -
program/include/rcube_template.php
re999919 rad334a12 58 58 $this->config = $this->app->config->all(); 59 59 $this->browser = new rcube_browser(); 60 60 61 61 //$this->framed = $framed; 62 62 $this->set_env('task', $task); … … 130 130 $title = ucfirst($this->env['task']); 131 131 } 132 132 133 133 return $title; 134 134 } … … 141 141 { 142 142 $valid = false; 143 143 144 144 if (!empty($skin) && is_dir('skins/'.$skin) && is_readable('skins/'.$skin)) { 145 145 $skin_path = 'skins/'.$skin; … … 153 153 $this->app->config->set('skin_path', $skin_path); 154 154 $this->config['skin_path'] = $skin_path; 155 155 156 156 return $valid; 157 157 } … … 227 227 if (count($args) == 1 && is_array($args[0])) 228 228 $args = $args[0]; 229 229 230 230 foreach ($args as $name) { 231 231 $this->command('add_label', $name, rcube_label($name)); … … 316 316 ob_flush(); 317 317 flush(); 318 318 319 319 if ($exit) { 320 320 exit; … … 332 332 { 333 333 // unlock interface after iframe load 334 $unlock = preg_replace('/[^a-z0-9]/i', '', $_GET['_unlock']); 334 335 if ($this->framed) { 335 array_unshift($this->js_commands, array('set_busy', false)); 336 array_unshift($this->js_commands, array('set_busy', false, null, $unlock)); 337 } 338 else if ($unlock) { 339 array_unshift($this->js_commands, array('hide_message', $unlock)); 336 340 } 337 341 // write all env variables to client … … 339 343 $js .= $this->get_js_commands() . ($this->framed ? ' }' : ''); 340 344 $this->add_script($js, 'head_top'); 341 345 342 346 // make sure all <form> tags have a valid request token 343 347 $template = preg_replace_callback('/<form\s+([^>]+)>/Ui', array($this, 'alter_form_tag'), $template); … … 362 366 $skin_path = $this->config['skin_path']; 363 367 $plugin = false; 364 368 365 369 $temp = explode(".", $name, 2); 366 370 if (count($temp) > 1) { … … 374 378 } 375 379 } 376 380 377 381 $path = "$skin_path/templates/$name.html"; 378 382 … … 388 392 return false; 389 393 } 390 394 391 395 // replace all path references to plugins/... with the configured plugins dir 392 396 // and /this/ to the current plugin skin directory … … 398 402 $output = $this->parse_conditions($templ); 399 403 $output = $this->parse_xml($output); 400 404 401 405 // trigger generic hook where plugins can put additional content to the page 402 406 $hook = $this->app->plugins->exec_hook("render_page", array('template' => $name, 'content' => $output)); … … 409 413 ); 410 414 } 411 415 412 416 $output = $this->parse_with_globals($hook['content']); 413 417 $this->write(trim($output)); … … 442 446 ); 443 447 } 444 448 445 449 return $out; 446 450 } … … 546 550 return eval("return (".$this->parse_expression($condition).");"); 547 551 } 548 549 552 553 550 554 /** 551 555 * Inserts hidden field with CSRF-prevention-token into POST forms … … 555 559 $out = $matches[0]; 556 560 $attrib = parse_attrib_string($matches[1]); 557 561 558 562 if (strtolower($attrib['method']) == 'post') { 559 563 $hidden = new html_hiddenfield(array('name' => '_token', 'value' => $this->app->get_request_token())); 560 564 $out .= "\n" . $hidden->show(); 561 565 } 562 566 563 567 return $out; 564 568 } … … 661 665 return $hook['content']; 662 666 break; 663 667 664 668 // define a container block 665 669 case 'container': … … 707 711 $content = Q($title); 708 712 } 709 713 710 714 // exec plugin hooks for this template object 711 715 $hook = $this->app->plugins->exec_hook("template_object_$object", $attrib + array('content' => $content)); … … 716 720 $value = $this->parse_expression($attrib['expression']); 717 721 return eval("return Q($value);"); 718 722 719 723 // return variable 720 724 case 'var': … … 804 808 if ($attrib['task']) 805 809 $command = $attrib['task'] . '.' . $command; 806 810 807 811 if (!$attrib['image']) { 808 812 $attrib['image'] = $attrib['imagepas'] ? $attrib['imagepas'] : $attrib['imageact']; … … 940 944 $hidden = $hiddenfield->show(); 941 945 } 942 946 943 947 if (!$content) 944 948 $attrib['noclose'] = true; 945 949 946 950 return html::tag('form', 947 951 $attrib + array('action' => "./", 'method' => "get"), … … 949 953 array('id','class','style','name','method','action','enctype','onsubmit')); 950 954 } 951 952 955 956 953 957 /** 954 958 * Build a form tag with a unique request token … … 967 971 $hidden->add(array('name' => '_action', 'value' => $attrib['action'])); 968 972 } 969 973 970 974 unset($attrib['task'], $attrib['request']); 971 975 $attrib['action'] = './'; 972 976 973 977 // we already have a <form> tag 974 978 if ($attrib['form']) … … 1023 1027 1024 1028 $_SESSION['temp'] = true; 1025 1029 1026 1030 // save original url 1027 1031 $url = get_input_value('_url', RCUBE_INPUT_POST); … … 1080 1084 $out .= $input_url->show(); 1081 1085 $out .= $table->show(); 1082 1086 1083 1087 if ($hide_host) { 1084 1088 $out .= $input_host->show(); … … 1138 1142 unset($attrib['type'], $attrib['results']); 1139 1143 } 1140 1144 1141 1145 $input_q = new html_inputfield($attrib); 1142 1146 $out = $input_q->show(); -
program/js/app.js
rbb26996 rad334a12 30 30 this.command_handlers = {}; 31 31 this.onloads = []; 32 this.messages = {}; 32 33 33 34 // create protected reference to myself … … 148 149 149 150 // tell parent window that this frame is loaded 150 if (this.env.framed && parent.rcmail && parent.rcmail.set_busy) 151 parent.rcmail.set_busy(false); 151 if (this.env.framed && parent.rcmail && parent.rcmail.set_busy) { 152 parent.rcmail.set_busy(false, null, parent.rcmail.env.frame_lock); 153 parent.rcmail.env.frame_lock = null; 154 } 152 155 153 156 // enable general commands … … 370 373 // display 'loading' message on form submit 371 374 $('form').submit(function () { 372 rcmail.display_message(rcmail.get_label('loading'), 'loading' , true);375 rcmail.display_message(rcmail.get_label('loading'), 'loading'); 373 376 }); 374 377 … … 845 848 break; 846 849 847 this.set_busy(true, 'savingmessage'); 848 var form = this.gui_objects.messageform; 850 var form = this.gui_objects.messageform, 851 msgid = this.set_busy(true, 'savingmessage'); 852 849 853 form.target = "savetarget"; 850 854 form._draft.value = '1'; 855 form.action = this.add_url(form.action, '_unlock', msgid); 851 856 form.submit(); 852 857 break; … … 863 868 864 869 // all checks passed, send message 865 this.set_busy(true, 'sendingmessage'); 866 var form = this.gui_objects.messageform; 870 var form = this.gui_objects.messageform, 871 msgid = this.set_busy(true, 'sendingmessage'); 872 867 873 form.target = 'savetarget'; 868 874 form._draft.value = ''; 875 form.action = this.add_url(form.action, '_unlock', msgid); 869 876 form.submit(); 870 877 … … 1031 1038 1032 1039 // lock/unlock interface 1033 this.set_busy = function(a, message )1040 this.set_busy = function(a, message, id) 1034 1041 { 1035 1042 if (a && message) { … … 1038 1045 msg = 'Loading...'; 1039 1046 1040 // @TODO: show many messages at a time (one below the other ?) 1041 if (this.message_type() != 'error') 1042 this.display_message(msg, 'loading', true); 1043 } 1044 else if (!a && this.message_type() != 'error') { 1045 this.hide_message(); 1047 id = this.display_message(msg, 'loading'); 1048 } 1049 else if (!a && id) { 1050 this.hide_message(id); 1046 1051 } 1047 1052 … … 1059 1064 if (a && this.env.request_timeout) 1060 1065 this.request_timer = window.setTimeout(function(){ ref.request_timed_out(); }, this.env.request_timeout * 1000); 1066 1067 return id; 1061 1068 }; 1062 1069 … … 1113 1120 }; 1114 1121 1122 // Add variable to GET string, replace old value if exists 1123 this.add_url = function(url, name, value) 1124 { 1125 value = urlencode(value); 1126 1127 if (/(\?.*)$/.test(url)) { 1128 var urldata = RegExp.$1, 1129 datax = RegExp('((\\?|&)'+RegExp.escape(name)+'=[^&]*)'); 1130 1131 if (datax.test(urldata)) { 1132 urldata = urldata.replace(datax, RegExp.$2 + name + '=' + value); 1133 } 1134 else 1135 urldata += '&' + name + '=' + value 1136 1137 return url.replace(/(\?.*)$/, urldata); 1138 } 1139 else 1140 return url + '?' + name + '=' + value; 1141 }; 1115 1142 1116 1143 /*********************************************************/ … … 1770 1797 this.show_contentframe(true); 1771 1798 else { 1772 this.set_busy(true, 'loading'); 1799 if (!this.env.frame_lock) 1800 this.env.frame_lock = this.set_busy(true, 'loading'); 1773 1801 target.location.href = this.env.comm_path+url; 1774 1802 … … 1830 1858 this.filter_mailbox = function(filter) 1831 1859 { 1832 var search; 1860 var search, lock = this.set_busy(true, 'searching'); 1861 1833 1862 if (this.gui_objects.qsearchbox) 1834 1863 search = this.gui_objects.qsearchbox.value; … … 1838 1867 // reset vars 1839 1868 this.env.current_page = 1; 1840 this.set_busy(true, 'searching');1841 1869 this.http_request('search', '_filter='+filter 1842 1870 + (search ? '&_q='+urlencode(search) : '') 1843 + (this.env.mailbox ? '&_mbox='+urlencode(this.env.mailbox) : ''), true);1871 + (this.env.mailbox ? '&_mbox='+urlencode(this.env.mailbox) : ''), lock); 1844 1872 }; 1845 1873 … … 1914 1942 1915 1943 // send request to server 1916 var url = '_mbox='+urlencode(mbox)+(page ? '&_page='+page : '') ;1917 this.set_busy(true, 'loading');1918 this.http_request('list', url+add_url, true);1944 var url = '_mbox='+urlencode(mbox)+(page ? '&_page='+page : ''), 1945 lock = this.set_busy(true, 'loading'); 1946 this.http_request('list', url+add_url, lock); 1919 1947 }; 1920 1948 … … 2321 2349 2322 2350 // show wait message 2323 if (this.env.action=='show') { 2324 lock = true; 2325 this.set_busy(true, 'movingmessage'); 2351 if (this.env.action == 'show') { 2352 lock = this.set_busy(true, 'movingmessage'); 2326 2353 } 2327 2354 else … … 2656 2683 // lock interface if it's the active mailbox 2657 2684 if (mbox == this.env.mailbox) { 2658 lock = true; 2659 this.set_busy(true, 'loading'); 2685 lock = this.set_busy(true, 'loading'); 2660 2686 add_url = '&_reload=1'; 2661 2687 } … … 2676 2702 // lock interface if it's the active mailbox 2677 2703 if (mbox == this.env.mailbox) { 2678 lock = true; 2679 this.set_busy(true, 'loading'); 2704 lock = this.set_busy(true, 'loading'); 2680 2705 add_url = '&_reload=1'; 2681 2706 } … … 3241 3266 // reset vars 3242 3267 this.env.current_page = 1; 3243 this.set_busy(true, 'searching');3268 var lock = this.set_busy(true, 'searching'); 3244 3269 this.http_request('search', '_q='+urlencode(value) 3245 3270 + (this.env.mailbox ? '&_mbox='+urlencode(this.env.mailbox) : '') 3246 3271 + (this.env.source ? '&_source='+urlencode(this.env.source) : '') 3247 3272 + (this.env.group ? '&_gid='+urlencode(this.env.group) : '') 3248 + (addurl ? addurl : ''), true);3273 + (addurl ? addurl : ''), lock); 3249 3274 } 3250 3275 return true; … … 3263 3288 this.sent_successfully = function(type, msg) 3264 3289 { 3265 this.display_message(msg, type , true);3290 this.display_message(msg, type); 3266 3291 // before redirect we need to wait some time for Chrome (#1486177) 3267 3292 window.setTimeout(function(){ ref.list_mailbox(); }, 500); … … 3418 3443 return; 3419 3444 3420 this.display_message(this.get_label('searching'), 'loading', false);3421 this.http_post('autocomplete', '_search='+urlencode(q) );3445 var lock = this.display_message(this.get_label('searching'), 'loading'); 3446 this.http_post('autocomplete', '_search='+urlencode(q), lock); 3422 3447 }; 3423 3448 … … 3428 3453 return; 3429 3454 3430 this.hide_message();3431 3455 this.env.contacts = results ? results : []; 3432 3456 this.ksearch_display_results(this.env.contacts); … … 3587 3611 3588 3612 // send request to server 3589 var url = (src ? '_source='+urlencode(src) : '') + (page ? (src?'&':'') + '_page='+page : ''); 3613 var url = (src ? '_source='+urlencode(src) : '') + (page ? (src?'&':'') + '_page='+page : ''), 3614 lock = this.set_busy(true, 'loading'); 3615 3590 3616 this.env.source = src; 3591 3617 this.env.group = group; … … 3598 3624 url += '&_search='+this.env.search_request; 3599 3625 3600 this.set_busy(true, 'loading'); 3601 this.http_request('list', url, true); 3626 this.http_request('list', url, lock); 3602 3627 }; 3603 3628 … … 3809 3834 3810 3835 if (newname) { 3811 this.set_busy(true, 'loading');3836 var lock = this.set_busy(true, 'loading'); 3812 3837 if (this.env.group_renaming) 3813 this.http_post('group-rename', '_source='+urlencode(this.env.source)+'&_gid='+urlencode(this.env.group)+'&_name='+urlencode(newname), true);3838 this.http_post('group-rename', '_source='+urlencode(this.env.source)+'&_gid='+urlencode(this.env.group)+'&_name='+urlencode(newname), lock); 3814 3839 else 3815 this.http_post('group-create', '_source='+urlencode(this.env.source)+'&_name='+urlencode(newname), true);3840 this.http_post('group-create', '_source='+urlencode(this.env.source)+'&_name='+urlencode(newname), lock); 3816 3841 } 3817 3842 return false; … … 4022 4047 var newname = this.env.dstfolder==this.env.delimiter ? basename : this.env.dstfolder+this.env.delimiter+basename; 4023 4048 4024 this.set_busy(true, 'foldermoving');4025 this.http_post('rename-folder', '_folder_oldname='+urlencode(this.env.folder)+'&_folder_newname='+urlencode(newname), true);4049 var lock = this.set_busy(true, 'foldermoving'); 4050 this.http_post('rename-folder', '_folder_oldname='+urlencode(this.env.folder)+'&_folder_newname='+urlencode(newname), lock); 4026 4051 } 4027 4052 this.drag_active = false; … … 4047 4072 name = this.env.folder+this.env.delimiter+name; 4048 4073 4049 this.set_busy(true, 'foldercreating');4050 this.http_post('create-folder', '_name='+urlencode(name), true);4074 var lock = this.set_busy(true, 'foldercreating'); 4075 this.http_post('create-folder', '_name='+urlencode(name), lock); 4051 4076 } 4052 4077 else if (form.elements['_folder_name']) … … 4114 4139 newname = this.name_input.__parent + this.env.delimiter + newname; 4115 4140 4116 this.set_busy(true, 'folderrenaming');4117 this.http_post('rename-folder', '_folder_oldname='+urlencode(this.env.subscriptionrows[this.edit_folder][0])+'&_folder_newname='+urlencode(newname), true);4141 var lock = this.set_busy(true, 'folderrenaming'); 4142 this.http_post('rename-folder', '_folder_oldname='+urlencode(this.env.subscriptionrows[this.edit_folder][0])+'&_folder_newname='+urlencode(newname), lock); 4118 4143 } 4119 4144 } … … 4132 4157 4133 4158 if (folder && confirm(this.get_label('deletefolderconfirm'))) { 4134 this.set_busy(true, 'folderdeleting');4135 this.http_post('delete-folder', '_mboxes='+urlencode(folder), true);4159 var lock = this.set_busy(true, 'folderdeleting'); 4160 this.http_post('delete-folder', '_mboxes='+urlencode(folder), lock); 4136 4161 this.set_env('folder', null); 4137 4162 … … 4502 4527 }; 4503 4528 4504 // display a system message 4505 this.display_message = function(msg, type, hold) 4506 { 4507 if (!this.loaded) { 4508 // save message in order to display after page loaded 4509 this.pending_message = new Array(msg, type); 4510 return true; 4511 } 4512 4529 // display a system message, list of types in common.css (below #message definition) 4530 this.display_message = function(msg, type) 4531 { 4513 4532 // pass command to parent window 4514 4533 if (this.env.framed && parent.rcmail) 4515 return parent.rcmail.display_message(msg, type, hold); 4516 4517 if (!this.gui_objects.message) 4534 return parent.rcmail.display_message(msg, type); 4535 4536 if (!this.gui_objects.message) { 4537 // save message in order to display after page loaded 4538 if (type != 'loading') 4539 this.pending_message = new Array(msg, type); 4518 4540 return false; 4519 4520 if (this.message_timer) 4521 clearTimeout(this.message_timer); 4522 4523 var cont = msg; 4524 if (type) 4525 cont = '<div class="'+type+'">'+cont+'</div>'; 4526 4527 var obj = $(this.gui_objects.message).html(cont).show(); 4528 this.gui_objects.message.__type = type; 4529 4530 if (type!='loading') 4531 obj.bind('mousedown', function(){ ref.hide_message(); return true; }); 4532 4533 if (!hold) 4534 this.message_timer = window.setTimeout(function(){ ref.hide_message(true); }, this.message_time); 4535 }; 4536 4537 // make a message row disapear 4538 this.hide_message = function(fade) 4539 { 4540 var msg; 4541 if (this.gui_objects.message) 4542 msg = this.gui_objects.message; 4543 else if (this.env.framed && parent.rcmail) 4544 msg = parent.rcmail.gui_objects.message; 4545 4546 if (msg) { 4547 $(msg).unbind()[(fade?'fadeOut':'hide')](); 4548 msg.__type = null; 4549 } 4550 }; 4551 4552 // get type of currently displayed message 4553 this.message_type = function() 4554 { 4555 if (this.gui_objects.message) 4556 return this.gui_objects.message.__type; 4557 else if (this.env.framed && parent.rcmail && parent.rcmail.gui_objects.message) 4558 return parent.rcmail.gui_objects.message.__type; 4541 } 4542 4543 type = type ? type : 'notice'; 4544 4545 var date = new Date(), 4546 id = type + date.getTime(); 4547 4548 // The same message of type 'loading' is already displayed 4549 if (type == 'loading' && this.messages[msg]) { 4550 this.messages[msg].elements.push(id); 4551 return id; 4552 } 4553 4554 var ref = this, 4555 obj = $('<div>').addClass(type).html(msg), 4556 cont = $(this.gui_objects.message).show(); 4557 4558 if (type == 'loading') { 4559 obj.appendTo(cont); 4560 this.messages[msg] = {'obj': obj, 'elements': [id]}; 4561 window.setTimeout(function() { rcmail.hide_message(id); }, this.env.request_timeout * 1000); 4562 return id; 4563 } 4564 else { 4565 obj.appendTo(cont).bind('mousedown', function(){ return ref.hide_message(obj); }); 4566 window.setTimeout(function(){ ref.hide_message(obj, true); }, this.message_time); 4567 return obj; 4568 } 4569 }; 4570 4571 // make a message to disapear 4572 this.hide_message = function(obj, fade) 4573 { 4574 // pass command to parent window 4575 if (this.env.framed && parent.rcmail) 4576 return parent.rcmail.hide_message(obj, fade); 4577 4578 if (typeof(obj) == 'object') { 4579 // custom message 4580 $(obj)[fade?'fadeOut':'hide'](); 4581 } 4582 else { 4583 // 'loading' message 4584 var k, n; 4585 for (k in this.messages) { 4586 for (n in this.messages[k].elements) { 4587 if (this.messages[k].elements[n] == obj) { 4588 this.messages[k].elements.splice(n, 1); 4589 if (!this.messages[k].elements.length) { 4590 this.messages[k].obj[fade?'fadeOut':'hide'](); 4591 delete this.messages[k]; 4592 } 4593 } 4594 } 4595 } 4596 } 4559 4597 }; 4560 4598 … … 4765 4803 this.set_headers = function(content) 4766 4804 { 4767 if (this.gui_objects.all_headers_row && this.gui_objects.all_headers_box && content) {4805 if (this.gui_objects.all_headers_row && this.gui_objects.all_headers_box && content) 4768 4806 $(this.gui_objects.all_headers_box).html(content).show(); 4769 4770 if (this.env.framed && parent.rcmail)4771 parent.rcmail.set_busy(false);4772 else4773 this.set_busy(false);4774 }4775 4807 }; 4776 4808 … … 4787 4819 // fetch headers only once 4788 4820 if (!this.gui_objects.all_headers_box.innerHTML) { 4789 this.display_message(this.get_label('loading'), 'loading', true);4790 this.http_post('headers', '_uid='+this.env.uid );4821 var lock = this.display_message(this.get_label('loading'), 'loading'); 4822 this.http_post('headers', '_uid='+this.env.uid, lock); 4791 4823 } 4792 4824 }; … … 4873 4905 { 4874 4906 var rcmail = this, 4875 url = '?_task=utils&_action=html2text' ;4876 4877 this.set_busy(true, 'converting'); 4907 url = '?_task=utils&_action=html2text', 4908 lock = this.set_busy(true, 'converting'); 4909 4878 4910 console.log('HTTP POST: ' + url); 4879 4911 4880 4912 $.ajax({ type: 'POST', url: url, data: htmlText, contentType: 'application/octet-stream', 4881 error: function(o ) { rcmail.http_error(o); },4882 success: function(data) { rcmail.set_busy(false ); $(document.getElementById(id)).val(data); console.log(data); }4913 error: function(o, status, err) { rcmail.http_error(o, status, err, lock); }, 4914 success: function(data) { rcmail.set_busy(false, null, lock); $(document.getElementById(id)).val(data); console.log(data); } 4883 4915 }); 4884 4916 }; … … 4886 4918 this.plain2html = function(plainText, id) 4887 4919 { 4888 this.set_busy(true, 'converting');4920 var lock = this.set_busy(true, 'converting'); 4889 4921 $(document.getElementById(id)).val('<pre>'+plainText+'</pre>'); 4890 this.set_busy(false );4922 this.set_busy(false, null, lock); 4891 4923 }; 4892 4924 … … 4947 4979 // send request 4948 4980 console.log('HTTP GET: ' + url); 4949 $.get(url, { _unlock:(lock?1:0) }, function(data){ ref.http_response(data); }, 'json'); 4981 $.ajax({ 4982 type: 'GET', url: url, data: { _unlock:(lock?lock:0) }, dataType: 'json', 4983 success: function(data){ ref.http_response(data); }, 4984 error: function(o, status, err) { rcmail.http_error(o, status, err, lock); } 4985 }); 4950 4986 }; 4951 4987 … … 4965 5001 if (postdata && typeof(postdata) == 'object') { 4966 5002 postdata._remote = 1; 4967 postdata._unlock = (lock ? 1: 0);5003 postdata._unlock = (lock ? lock : 0); 4968 5004 } 4969 5005 else 4970 postdata += (postdata ? '&' : '') + '_remote=1' + (lock ? '&_unlock= 1': '');5006 postdata += (postdata ? '&' : '') + '_remote=1' + (lock ? '&_unlock='+lock : ''); 4971 5007 4972 5008 // trigger plugin hook … … 4982 5018 // send request 4983 5019 console.log('HTTP POST: ' + url); 4984 $.post(url, postdata, function(data){ ref.http_response(data); }, 'json'); 5020 $.ajax({ 5021 type: 'POST', url: url, data: postdata, dataType: 'json', 5022 success: function(data){ ref.http_response(data); }, 5023 error: function(o, status, err) { rcmail.http_error(o, status, err, lock); } 5024 }); 4985 5025 }; 4986 5026 … … 4988 5028 this.http_response = function(response) 4989 5029 { 5030 if (!response) 5031 return; 5032 4990 5033 if (response.unlock) 4991 5034 this.set_busy(false); … … 5082 5125 } 5083 5126 5127 if (response.unlock) 5128 this.hide_message(response.unlock); 5129 5084 5130 this.triggerEvent('responseafter', {response: response}); 5085 5131 this.triggerEvent('responseafter'+response.action, {response: response}); … … 5087 5133 5088 5134 // handle HTTP request errors 5089 this.http_error = function(request, status, err )5135 this.http_error = function(request, status, err, lock) 5090 5136 { 5091 5137 var errmsg = request.statusText; 5092 5138 5093 this.set_busy(false );5139 this.set_busy(false, null, lock); 5094 5140 request.abort(); 5095 5141 … … 5123 5169 return; 5124 5170 5125 var addurl = '_t=' + (new Date().getTime()) + '&_mbox=' + urlencode(this.env.mailbox);5171 var lock, addurl = '_t=' + (new Date().getTime()) + '&_mbox=' + urlencode(this.env.mailbox); 5126 5172 5127 5173 if (refresh) { 5128 this.set_busy(true, 'checkingmail');5174 lock = this.set_busy(true, 'checkingmail'); 5129 5175 addurl += '&_refresh=1'; 5130 5176 // reset check-recent interval … … 5139 5185 addurl += '&_search=' + this.env.search_request; 5140 5186 5141 this.http_request('check-recent', addurl, true);5187 this.http_request('check-recent', addurl, lock); 5142 5188 }; 5143 5189 -
program/js/googiespell.js
r48e8b31 rad334a12 978 978 // roundcube mod. 979 979 if (window.rcmail) 980 rcmail.set_busy(false);980 rcmail.set_busy(false, null, this.rc_msg_id); 981 981 }; 982 982 … … 984 984 // modified by roundcube 985 985 if (window.rcmail) 986 rcmail.set_busy(true, 'checking');986 this.rc_msg_id = rcmail.set_busy(true, 'checking'); 987 987 /* 988 988 this.indicator = document.createElement('img'); -
program/steps/mail/sendmail.inc
rf22ea7b rad334a12 25 25 $OUTPUT->framed = TRUE; 26 26 27 $savedraft = !empty($_POST['_draft']) ? TRUE : FALSE;27 $savedraft = !empty($_POST['_draft']) ? true : false; 28 28 29 29 /****** checks ********/
Note: See TracChangeset
for help on using the changeset viewer.
