Changeset da8f11c in github
- Timestamp:
- Apr 15, 2010 7:28:15 AM (3 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 633a106
- Parents:
- 8a79f22
- Files:
-
- 4 edited
-
CHANGELOG (modified) (1 diff)
-
program/js/app.js (modified) (29 diffs)
-
program/js/list.js (modified) (2 diffs)
-
program/steps/mail/func.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
ra35062a1 rda8f11c 2 2 =========================== 3 3 4 - Fix messages list scrolling in FF3.6 (#1486472) 5 - Fix quicksearch input focus (#1486637) 4 6 - Always set changed date when flagging a DB record as deleted + provide a cleanup script 5 7 - Fix address book/group selection (#1486619) -
program/js/app.js
r5889282 rda8f11c 56 56 57 57 // set jQuery ajax options 58 jQuery.ajaxSetup({ cache:false, 58 jQuery.ajaxSetup({ 59 cache:false, 59 60 error:function(request, status, err){ ref.http_error(request, status, err); }, 60 61 beforeSend:function(xmlhttp){ xmlhttp.setRequestHeader('X-RoundCube-Request', ref.env.request_token); } … … 132 133 133 134 // check browser 134 if (!bw.dom || !bw.xmlhttp_test()) 135 { 135 if (!bw.dom || !bw.xmlhttp_test()) { 136 136 this.goto_url('error', '_code=0x199'); 137 137 return; … … 177 177 this.message_list.addEventListener('dragend', function(e){ p.drag_end(e); }); 178 178 this.message_list.addEventListener('expandcollapse', function(e){ p.msglist_expand(e); }); 179 179 180 document.onmouseup = function(e){ return p.doc_mouse_up(e); }; 181 this.gui_objects.messagelist.parentNode.onmousedown = function(e){ return p.click_on_list(e); }; 180 182 181 183 this.set_message_coltypes(this.env.coltypes); 182 184 this.message_list.init(); 183 185 this.enable_command('toggle_status', 'toggle_flag', 'menu-open', 'menu-save', true); 184 185 if (this.gui_objects.mailcontframe)186 this.gui_objects.mailcontframe.onmousedown = function(e){ return p.click_on_list(e); };187 else188 this.message_list.focus();189 186 190 187 // load messages … … 193 190 } 194 191 195 if (this.env.search_text != null && document.getElementById('quicksearchbox') != null) 196 document.getElementById('quicksearchbox').value = this.env.search_text; 197 198 if (this.env.action=='show' || this.env.action=='preview') 199 { 192 if (this.gui_objects.qsearchbox) { 193 if (this.env.search_text != null) { 194 this.gui_objects.qsearchbox.value = this.env.search_text; 195 } 196 $(this.gui_objects.qsearchbox).focusin(function() { rcmail.message_list.blur(); }); 197 } 198 199 if (this.env.trash_mailbox && this.env.mailbox != this.env.trash_mailbox) 200 this.set_alttext('delete', 'movemessagetotrash'); 201 202 if (this.env.action=='show' || this.env.action=='preview') { 200 203 this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'copy', 'delete', 201 204 'open', 'mark', 'edit', 'viewsource', 'download', 'print', 'load-attachment', 'load-headers', true); 202 205 203 if (this.env.next_uid) 204 { 206 if (this.env.next_uid) { 205 207 this.enable_command('nextmessage', true); 206 208 this.enable_command('lastmessage', true); 207 209 } 208 if (this.env.prev_uid) 209 { 210 if (this.env.prev_uid) { 210 211 this.enable_command('previousmessage', true); 211 212 this.enable_command('firstmessage', true); 212 213 } 213 214 214 if (this.env.blockedobjects) 215 { 215 if (this.env.blockedobjects) { 216 216 if (this.gui_objects.remoteobjectsmsg) 217 217 this.gui_objects.remoteobjectsmsg.style.display = 'block'; 218 218 this.enable_command('load-images', 'always-load', true); 219 219 } 220 221 // make preview/message frame visible 222 if (this.env.action == 'preview' && this.env.framed && parent.rcmail) { 223 this.enable_command('compose', 'add-contact', false); 224 parent.rcmail.show_contentframe(true); 225 } 220 226 } 221 222 if (this.env.trash_mailbox && this.env.mailbox != this.env.trash_mailbox) 223 this.set_alttext('delete', 'movemessagetotrash'); 224 225 // make preview/message frame visible 226 if (this.env.action == 'preview' && this.env.framed && parent.rcmail) 227 { 228 this.enable_command('compose', 'add-contact', false); 229 parent.rcmail.show_contentframe(true); 230 } 231 232 if (this.env.action=='compose') 233 { 227 else if (this.env.action == 'compose') { 234 228 this.enable_command('add-attachment', 'send-attachment', 'remove-attachment', 'send', true); 235 if (this.env.spellcheck) 236 {229 230 if (this.env.spellcheck) { 237 231 this.env.spellcheck.spelling_state_observer = function(s){ ref.set_spellcheck_state(s); }; 238 232 this.set_spellcheck_state('ready'); … … 240 234 this.display_spellcheck_controls(false); 241 235 } 236 242 237 if (this.env.drafts_mailbox) 243 238 this.enable_command('savedraft', true); … … 248 243 this.init_messageform(); 249 244 } 245 // show printing dialog 246 else if (this.env.action == 'print') 247 window.print(); 250 248 251 249 if (this.env.messagecount) { 252 250 this.enable_command('select-all', 'select-none', 'expunge', true); 253 251 this.enable_command('expand-all', 'expand-unread', 'collapse-all', this.env.threading); 254 }252 } 255 253 256 254 if (this.purge_mailbox_test()) … … 259 257 this.set_page_buttons(); 260 258 261 // show printing dialog262 if (this.env.action=='print')263 window.print();264 265 259 // get unread count for each mailbox 266 if (this.gui_objects.mailboxlist) 267 { 260 if (this.gui_objects.mailboxlist) { 268 261 this.env.unread_counts = {}; 269 262 this.gui_objects.folderlist = this.gui_objects.mailboxlist; 270 263 this.http_request('getunread', ''); 271 }264 } 272 265 273 266 // ask user to send MDN 274 if (this.env.mdn_request && this.env.uid) 275 { 267 if (this.env.mdn_request && this.env.uid) { 276 268 var mdnurl = '_uid='+this.env.uid+'&_mbox='+urlencode(this.env.mailbox); 277 269 if (confirm(this.get_label('mdnrequest'))) … … 279 271 else 280 272 this.http_post('mark', mdnurl+'&_flag=mdnsent'); 281 }273 } 282 274 283 275 break; … … 303 295 this.contact_list.highlight_row(this.env.cid); 304 296 305 if (this.gui_objects.contactslist.parentNode)306 {307 this.gui_objects.contactslist.parentNode.onmousedown = function(e){ return p.click_on_list(e); };308 document.onmouseup = function(e){ return p.doc_mouse_up(e); };297 this.gui_objects.contactslist.parentNode.onmousedown = function(e){ return p.click_on_list(e); }; 298 document.onmouseup = function(e){ return p.doc_mouse_up(e); }; 299 if (this.gui_objects.qsearchbox) { 300 $(this.gui_objects.qsearchbox).focusin(function() { rcmail.contact_list.blur(); }); 309 301 } 310 else311 this.contact_list.focus();312 313 //this.gui_objects.folderlist = this.gui_objects.contactslist;314 302 } 315 303 … … 406 394 // execute all foreign onload scripts 407 395 // @deprecated 408 for (var i=0; i<this.onloads.length; i++) 409 { 396 for (var i=0; i<this.onloads.length; i++) { 410 397 if (typeof(this.onloads[i]) == 'string') 411 398 eval(this.onloads[i]); … … 501 488 case 'open': 502 489 var uid; 503 if (uid = this.get_single_uid()) 504 { 490 if (uid = this.get_single_uid()) { 505 491 obj.href = '?_task='+this.env.task+'&_action=show&_mbox='+urlencode(this.env.mailbox)+'&_uid='+uid; 506 492 return true; … … 510 496 // misc list commands 511 497 case 'list': 512 if (this.task=='mail') 513 { 498 if (this.task=='mail') { 514 499 if (this.env.search_request<0 || (props != '' && (this.env.search_request && props != this.env.mailbox))) 515 500 this.reset_qsearch(); … … 519 504 if (this.env.trash_mailbox) 520 505 this.set_alttext('delete', this.env.mailbox != this.env.trash_mailbox ? 'movemessagetotrash' : 'deletemessage'); 521 } 522 else if (this.task=='addressbook') 523 { 506 } 507 else if (this.task=='addressbook') { 524 508 if (this.env.search_request<0 || (this.env.search_request && props != this.env.source)) 525 509 this.reset_qsearch(); … … 527 511 this.list_contacts(props); 528 512 this.enable_command('add', 'import', (this.env.address_sources && !this.env.address_sources[this.env.source].readonly)); 529 }513 } 530 514 break; 531 515 … … 586 570 // common commands used in multiple tasks 587 571 case 'show': 588 if (this.task=='mail') 589 { 572 if (this.task=='mail') { 590 573 var uid = this.get_single_uid(); 591 if (uid && (!this.env.uid || uid != this.env.uid)) 592 { 574 if (uid && (!this.env.uid || uid != this.env.uid)) { 593 575 if (this.env.mailbox == this.env.drafts_mailbox) 594 576 this.goto_url('compose', '_draft_uid='+uid+'&_mbox='+urlencode(this.env.mailbox), true); 595 577 else 596 578 this.show_message(uid); 597 }598 579 } 599 else if (this.task=='addressbook')600 {580 } 581 else if (this.task=='addressbook') { 601 582 var cid = props ? props : this.get_single_cid(); 602 583 if (cid && !(this.env.action=='show' && cid==this.env.cid)) 603 584 this.load_contact(cid, 'show'); 604 }585 } 605 586 break; 606 587 … … 608 589 if (this.task=='addressbook') 609 590 this.load_contact(0, 'add'); 610 else if (this.task=='settings') 611 { 591 else if (this.task=='settings') { 612 592 this.identity_list.clear_selection(); 613 593 this.load_identity(0, 'add-identity'); 614 }594 } 615 595 break; 616 596 … … 701 681 var flag = 'read'; 702 682 703 if (props._row.uid) 704 { 683 if (props._row.uid) { 705 684 uid = props._row.uid; 706 685 … … 708 687 if (this.message_list.rows[uid].deleted) { 709 688 flag = 'undelete'; 710 } else if (!this.message_list.rows[uid].unread) 689 } 690 else if (!this.message_list.rows[uid].unread) 711 691 flag = 'unread'; 712 }692 } 713 693 714 694 this.mark_message(flag, uid); … … 722 702 var flag = 'flagged'; 723 703 724 if (props._row.uid) 725 { 704 if (props._row.uid) { 726 705 uid = props._row.uid; 727 706 // toggle flagged/unflagged … … 748 727 749 728 // open attachment in frame if it's of a supported mimetype 750 if (this.env.uid && props.mimetype && jQuery.inArray(props.mimetype, this.mimetypes)>=0) 751 { 729 if (this.env.uid && props.mimetype && jQuery.inArray(props.mimetype, this.mimetypes)>=0) { 752 730 if (props.mimetype == 'text/html') 753 731 qstring += '&_safe=1'; 754 732 this.attachment_win = window.open(this.env.comm_path+'&_action=get&'+qstring+'&_frame=1', 'rcubemailattachment'); 755 if (this.attachment_win) 756 { 733 if (this.attachment_win) { 757 734 window.setTimeout(function(){ ref.attachment_win.focus(); }, 10); 758 735 break; 759 }760 736 } 737 } 761 738 762 739 this.goto_url('get', qstring+'&_download=1', false); … … 818 795 var url = this.env.comm_path+'&_action=compose'; 819 796 820 if (this.task=='mail') 821 { 797 if (this.task=='mail') { 822 798 url += '&_mbox='+urlencode(this.env.mailbox); 823 799 824 if (this.env.mailbox==this.env.drafts_mailbox) 825 { 800 if (this.env.mailbox==this.env.drafts_mailbox) { 826 801 var uid; 827 802 if (uid = this.get_single_uid()) … … 832 807 } 833 808 // modify url if we're in addressbook 834 else if (this.task=='addressbook') 835 { 809 else if (this.task=='addressbook') { 836 810 // switch to mail compose step directly 837 if (props && props.indexOf('@') > 0) 838 { 811 if (props && props.indexOf('@') > 0) { 839 812 url = this.get_task_url('mail', url); 840 813 this.redirect(url + '&_to='+urlencode(props)); 841 814 break; 842 }815 } 843 816 844 817 // use contact_id passed as command parameter … … 847 820 a_cids[a_cids.length] = props; 848 821 // get selected contacts 849 else if (this.contact_list) 850 { 822 else if (this.contact_list) { 851 823 var selection = this.contact_list.get_selection(); 852 824 for (var n=0; n<selection.length; n++) 853 825 a_cids[a_cids.length] = selection[n]; 854 }826 } 855 827 856 828 if (a_cids.length) … … 858 830 859 831 break; 860 }832 } 861 833 862 834 // don't know if this is necessary... 863 url = url.replace(/&_framed=1/, "");835 url = url.replace(/&_framed=1/, ''); 864 836 865 837 this.redirect(url); … … 1200 1172 /*********************************************************/ 1201 1173 1202 this.doc_mouse_up = function(e)1203 {1204 var model, list, li;1205 1206 if (this.message_list) {1207 if (!rcube_mouse_is_over(e, this.message_list.list))1208 this.message_list.blur();1209 list = this.message_list;1210 model = this.env.mailboxes;1211 }1212 else if (this.contact_list) {1213 if (!rcube_mouse_is_over(e, this.contact_list.list))1214 this.contact_list.blur();1215 list = this.contact_list;1216 model = this.env.contactfolders;1217 }1218 else if (this.ksearch_value) {1219 this.ksearch_blur();1220 }1221 1222 // handle mouse release when dragging1223 if (this.drag_active && model && this.env.last_folder_target) {1224 var target = model[this.env.last_folder_target];1225 1226 $(this.get_folder_li(this.env.last_folder_target)).removeClass('droptarget');1227 this.env.last_folder_target = null;1228 list.draglayer.hide();1229 1230 if (!this.drag_menu(e, target))1231 this.command('moveto', target);1232 }1233 1234 // reset 'pressed' buttons1235 if (this.buttons_sel) {1236 for (var id in this.buttons_sel)1237 if (typeof id != 'function')1238 this.button_out(this.buttons_sel[id], id);1239 this.buttons_sel = {};1240 }1241 };1242 1243 1174 this.drag_menu = function(e, target) 1244 1175 { … … 1352 1283 1353 1284 li = this.get_folder_li(k); 1354 div = $(li.getElementsByTagName( "div")[0]);1285 div = $(li.getElementsByTagName('div')[0]); 1355 1286 1356 1287 // if the folder is collapsed, expand it after 1sec and restart the drag & drop process. … … 1361 1292 this.folder_auto_expand = k; 1362 1293 this.folder_auto_timer = window.setTimeout(function() { 1363 rcmail.command( "collapse-folder", rcmail.folder_auto_expand);1294 rcmail.command('collapse-folder', rcmail.folder_auto_expand); 1364 1295 rcmail.drag_start(null); 1365 1296 }, 1000); … … 1383 1314 1384 1315 this.collapse_folder = function(id) 1385 { 1386 var div; 1387 if ((li = this.get_folder_li(id)) && 1388 (div = $(li.getElementsByTagName("div")[0])) && 1389 (div.hasClass('collapsed') || div.hasClass('expanded'))) 1390 { 1391 var ul = $(li.getElementsByTagName("ul")[0]); 1392 if (div.hasClass('collapsed')) 1393 { 1394 ul.show(); 1395 div.removeClass('collapsed').addClass('expanded'); 1396 var reg = new RegExp('&'+urlencode(id)+'&'); 1397 this.set_env('collapsed_folders', this.env.collapsed_folders.replace(reg, '')); 1398 } 1316 { 1317 var li = this.get_folder_li(id); 1318 var div = $(li.getElementsByTagName('div')[0]); 1319 1320 if (!div || (!div.hasClass('collapsed') && !div.hasClass('expanded'))) 1321 return; 1322 1323 var ul = $(li.getElementsByTagName('ul')[0]); 1324 if (div.hasClass('collapsed')) { 1325 ul.show(); 1326 div.removeClass('collapsed').addClass('expanded'); 1327 var reg = new RegExp('&'+urlencode(id)+'&'); 1328 this.set_env('collapsed_folders', this.env.collapsed_folders.replace(reg, '')); 1329 } 1330 else { 1331 ul.hide(); 1332 div.removeClass('expanded').addClass('collapsed'); 1333 this.set_env('collapsed_folders', this.env.collapsed_folders+'&'+urlencode(id)+'&'); 1334 1335 // select parent folder if one of its childs is currently selected 1336 if (this.env.mailbox.indexOf(id + this.env.delimiter) == 0) 1337 this.command('list', id); 1338 } 1339 1340 // Work around a bug in IE6 and IE7, see #1485309 1341 if (bw.ie6 || bw.ie7) { 1342 var siblings = li.nextSibling ? li.nextSibling.getElementsByTagName('ul') : null; 1343 if (siblings && siblings.length && (li = siblings[0]) && li.style && li.style.display != 'none') { 1344 li.style.display = 'none'; 1345 li.style.display = ''; 1346 } 1347 } 1348 1349 this.http_post('save-pref', '_name=collapsed_folders&_value='+urlencode(this.env.collapsed_folders)); 1350 this.set_unread_count_display(id, false); 1351 }; 1352 1353 this.doc_mouse_up = function(e) 1354 { 1355 var model, list, li; 1356 1357 if (this.message_list) { 1358 if (!rcube_mouse_is_over(e, this.message_list.list.parentNode)) 1359 this.message_list.blur(); 1399 1360 else 1400 { 1401 ul.hide(); 1402 div.removeClass('expanded').addClass('collapsed'); 1403 this.set_env('collapsed_folders', this.env.collapsed_folders+'&'+urlencode(id)+'&'); 1404 1405 // select parent folder if one of its childs is currently selected 1406 if (this.env.mailbox.indexOf(id + this.env.delimiter) == 0) 1407 this.command('list', id); 1408 } 1409 1410 // Work around a bug in IE6 and IE7, see #1485309 1411 if ((bw.ie6 || bw.ie7) && 1412 li.nextSibling && 1413 (li.nextSibling.getElementsByTagName("ul").length>0) && 1414 li.nextSibling.getElementsByTagName("ul")[0].style && 1415 (li.nextSibling.getElementsByTagName("ul")[0].style.display!='none')) 1416 { 1417 li.nextSibling.getElementsByTagName("ul")[0].style.display = 'none'; 1418 li.nextSibling.getElementsByTagName("ul")[0].style.display = ''; 1419 } 1420 1421 this.http_post('save-pref', '_name=collapsed_folders&_value='+urlencode(this.env.collapsed_folders)); 1422 this.set_unread_count_display(id, false); 1423 } 1424 } 1361 this.message_list.focus(); 1362 list = this.message_list; 1363 model = this.env.mailboxes; 1364 } 1365 else if (this.contact_list) { 1366 if (!rcube_mouse_is_over(e, this.contact_list.list.parentNode)) 1367 this.contact_list.blur(); 1368 else 1369 this.contact_list.focus(); 1370 list = this.contact_list; 1371 model = this.env.contactfolders; 1372 } 1373 else if (this.ksearch_value) { 1374 this.ksearch_blur(); 1375 } 1376 1377 // handle mouse release when dragging 1378 if (this.drag_active && model && this.env.last_folder_target) { 1379 var target = model[this.env.last_folder_target]; 1380 1381 $(this.get_folder_li(this.env.last_folder_target)).removeClass('droptarget'); 1382 this.env.last_folder_target = null; 1383 list.draglayer.hide(); 1384 1385 if (!this.drag_menu(e, target)) 1386 this.command('moveto', target); 1387 } 1388 1389 // reset 'pressed' buttons 1390 if (this.buttons_sel) { 1391 for (var id in this.buttons_sel) 1392 if (typeof id != 'function') 1393 this.button_out(this.buttons_sel[id], id); 1394 this.buttons_sel = {}; 1395 } 1396 }; 1425 1397 1426 1398 this.click_on_list = function(e) … … 1434 1406 this.contact_list.focus(); 1435 1407 1436 return rcube_event.get_button(e) == 2 ? true : rcube_event.cancel(e);1408 return true; 1437 1409 }; 1438 1410 -
program/js/list.js
r6c11ee2 rda8f11c 1160 1160 } 1161 1161 1162 if (this.drag_active) 1163 this.focus(); 1162 1164 this.drag_active = false; 1163 1165 … … 1169 1171 1170 1172 this.triggerEvent('dragend'); 1171 1173 1172 1174 return rcube_event.cancel(e); 1173 1175 }, -
program/steps/mail/func.inc
r6b01133 rda8f11c 176 176 177 177 // set client env 178 $OUTPUT->add_gui_object('mailcontframe', 'mailcontframe');179 178 $OUTPUT->add_gui_object('messagelist', $attrib['id']); 180 179 $OUTPUT->set_env('autoexpand_threads', intval($CONFIG['autoexpand_threads']));
Note: See TracChangeset
for help on using the changeset viewer.
