Changeset bf2f39e in github


Ignore:
Timestamp:
Sep 29, 2008 9:02:02 AM (5 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
526d170
Parents:
f7028b2
Message:
  • #1485290: Fix unread counter when displaying cached massage in preview panel
  • remove some empty lines in app.js
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    rffae15e5 rbf2f39e  
    88  in MS Outlook/OE (#1485320) 
    99- Added "advanced options" feature in User Preferences 
     10- Fix unread counter when displaying cached massage in preview panel (#1485290) 
    1011 
    11122008/09/25 (alec) 
  • program/js/app.js

    r07d3670 rbf2f39e  
    6565    }; 
    6666 
    67  
    6867  // add a localized label to the client environment 
    6968  this.add_label = function(key, value) 
     
    7170    this.labels[key] = value; 
    7271    }; 
    73  
    7472 
    7573  // add a button to the button list 
     
    340338      } 
    341339 
    342  
    343340    // enable basic commands 
    344341    this.enable_command('logout', true); 
     
    353350    // start keep-alive interval 
    354351    this.start_keepalive(); 
    355      
    356352     
    357353    // execute all foreign onload scripts 
     
    364360      } 
    365361    }; 
    366  
    367362 
    368363  // start interval for keep-alive/recent_check signal 
     
    375370    } 
    376371 
    377  
    378372  this.init_message_row = function(row) 
    379373  { 
     
    415409      } 
    416410  }; 
    417  
    418411 
    419412  // init message compose form: set focus and eventhandlers 
     
    478471 
    479472 
    480  
    481473  /*********************************************************/ 
    482474  /*********       client command interface        *********/ 
    483475  /*********************************************************/ 
    484476 
    485  
    486477  // execute a specific command on the web client 
    487478  this.command = function(command, props, obj) 
     
    502493      return false; 
    503494      } 
    504        
    505495       
    506496   // check input before leaving compose step 
     
    10731063    }; 
    10741064 
    1075  
    10761065  // set command enabled or disabled 
    10771066  this.enable_command = function() 
     
    10911080      return true; 
    10921081    }; 
    1093  
    10941082 
    10951083  // lock/unlock interface 
     
    11221110    }; 
    11231111 
    1124  
    11251112  // return a localized string 
    11261113  this.get_label = function(name) 
     
    11321119    }; 
    11331120 
    1134  
    11351121  // switch to another application task 
    11361122  this.switch_task = function(task) 
     
    11461132    }; 
    11471133 
    1148  
    11491134  this.get_task_url = function(task, url) 
    11501135    { 
     
    11551140    }; 
    11561141     
    1157    
    11581142  // called when a request timed out 
    11591143  this.request_timed_out = function() 
     
    11671151  /*********        event handling methods         *********/ 
    11681152  /*********************************************************/ 
    1169  
    11701153 
    11711154  this.doc_mouse_up = function(e) 
     
    12651248    }; 
    12661249 
    1267  
    12681250  this.msglist_select = function(list) 
    12691251    { 
     
    12931275    }; 
    12941276 
    1295  
    12961277  this.msglist_dbl_click = function(list) 
    12971278    { 
     
    13051286      this.show_message(uid, false, false); 
    13061287    }; 
    1307  
    13081288 
    13091289  this.msglist_keypress = function(list) 
     
    13191299    }; 
    13201300 
    1321  
    13221301  this.msglist_get_preview = function() 
    13231302  { 
     
    13281307      this.show_contentframe(false); 
    13291308  }; 
    1330    
    13311309   
    13321310  this.check_droptarget = function(id) 
     
    13481326  this.show_message = function(id, safe, preview) 
    13491327    { 
     1328    if (!id) return; 
     1329     
    13501330    var add_url = ''; 
    13511331    var action = preview ? 'preview': 'show'; 
    13521332    var target = window; 
     1333     
    13531334    if (preview && this.env.contentframe && window.frames && window.frames[this.env.contentframe]) 
    13541335      { 
     
    13631344    if (this.env.search_request) 
    13641345      add_url += '&_search='+this.env.search_request; 
    1365  
    1366     if (id) 
    1367       { 
    1368       var url = '&_action='+action+'&_uid='+id+'&_mbox='+urlencode(this.env.mailbox)+add_url; 
    1369       if (action == 'preview' && String(target.location.href).indexOf(url) >= 0) 
    1370         this.show_contentframe(true); 
    1371       else 
    1372         { 
    1373         this.set_busy(true, 'loading'); 
    1374         target.location.href = this.env.comm_path+url; 
    1375         } 
    1376       } 
    1377     }; 
    1378  
     1346    var url = '&_action='+action+'&_uid='+id+'&_mbox='+urlencode(this.env.mailbox)+add_url; 
     1347    if (action == 'preview' && String(target.location.href).indexOf(url) >= 0) 
     1348      this.show_contentframe(true); 
     1349    else 
     1350      { 
     1351      this.set_busy(true, 'loading'); 
     1352      target.location.href = this.env.comm_path+url; 
     1353      // mark as read and change mbox unread counter 
     1354      if (action == 'preview' && this.message_list && this.message_list.rows[id] && this.message_list.rows[id].unread) 
     1355        { 
     1356        this.set_message(id, 'unread', false); 
     1357        if (this.env.unread_counts[this.env.mailbox]) 
     1358          { 
     1359          this.env.unread_counts[this.env.mailbox] -= 1; 
     1360          this.set_unread_count(this.env.mailbox, this.env.unread_counts[this.env.mailbox], this.env.mailbox == 'INBOX'); 
     1361          } 
     1362        } 
     1363      } 
     1364    }; 
    13791365 
    13801366  this.show_contentframe = function(show) 
     
    13951381      this.set_busy(false); 
    13961382    }; 
    1397  
    13981383 
    13991384  // list a specific page 
     
    14201405    }; 
    14211406 
    1422  
    14231407  // list messages of a specific mailbox 
    14241408  this.list_mailbox = function(mbox, page, sort) 
     
    14761460    }; 
    14771461 
    1478  
    14791462  // send remote request to load message list 
    14801463  this.list_mailbox_remote = function(mbox, page, add_url) 
     
    14881471    this.http_request('list', url+add_url, true); 
    14891472    }; 
    1490  
    14911473 
    14921474  this.expunge_mailbox = function(mbox) 
     
    15071489    this.http_post('expunge', url+add_url, lock); 
    15081490    }; 
    1509  
    15101491 
    15111492  this.purge_mailbox = function(mbox) 
     
    16951676  }; 
    16961677 
    1697  
    16981678  // delete the selected messages permanently 
    16991679  this.permanently_remove_messages = function() 
     
    17441724    this.http_post(action, '_uid='+a_uids.join(',')+'&_mbox='+urlencode(this.env.mailbox)+add_url, lock); 
    17451725  }; 
    1746  
    17471726 
    17481727  // set a specific flag to one or more messages 
     
    18591838  }; 
    18601839 
    1861  
    18621840  this.flag_as_undeleted = function(a_uids) 
    18631841  { 
     
    18691847  }; 
    18701848 
    1871    
    18721849  this.flag_as_deleted = function(a_uids) 
    18731850  { 
     
    18931870    return true;   
    18941871  }; 
    1895  
    18961872 
    18971873  // flag as read without mark request (called from backend) 
     
    19421918  /*********************************************************/ 
    19431919   
    1944    
    19451920  // checks the input fields before sending a message 
    19461921  this.check_compose_input = function() 
     
    20081983    }; 
    20091984 
    2010  
    20111985  this.set_draft_id = function(id) 
    20121986    { 
     
    20241998    this.busy = false; 
    20251999    }; 
    2026  
    20272000 
    20282001  this.compose_field_hash = function(save) 
     
    20592032    }; 
    20602033     
    2061    
    20622034  this.change_identity = function(obj) 
    20632035    { 
     
    21432115    }; 
    21442116 
    2145  
    21462117  this.show_attachment_form = function(a) 
    21472118    { 
     
    21752146    }; 
    21762147 
    2177  
    21782148  // upload attachment file 
    21792149  this.upload_file = function(form) 
     
    22252195    return true; 
    22262196    }; 
    2227  
    22282197 
    22292198  // add file name to attachment list 
     
    22982267    return true; 
    22992268    }; 
    2300  
    23012269 
    23022270  this.sent_successfully = function(type, msg) 
     
    23802348    }; 
    23812349 
    2382  
    23832350  this.insert_recipient = function(id) 
    23842351  { 
     
    24022369      this.ksearch_input.setSelectionRange(cpos, cpos); 
    24032370  }; 
    2404  
    24052371 
    24062372  // address search processor 
     
    25042470    }; 
    25052471 
    2506  
    25072472  this.ksearch_blur = function(e, obj) 
    25082473    { 
     
    25242489      this.ksearch_pane.show(0);     
    25252490    }; 
    2526  
    25272491 
    25282492 
     
    25362500        this.command('delete'); 
    25372501    }; 
    2538  
    25392502 
    25402503  this.contactlist_select = function(list) 
     
    25562519    }; 
    25572520 
    2558  
    25592521  this.list_contacts = function(src, page) 
    25602522    { 
     
    25992561    }; 
    26002562 
    2601  
    26022563  // send remote request to load contacts list 
    26032564  this.list_contacts_remote = function(src, page) 
     
    26202581    }; 
    26212582 
    2622  
    26232583  // load contact record 
    26242584  this.load_contact = function(cid, action, framed) 
     
    26452605  // copy a contact to the specified target (group or directory) 
    26462606  this.copy_contact = function(cid, to) 
    2647   { 
     2607    { 
    26482608    if (!cid) 
    26492609      cid = this.contact_list.get_selection().join(','); 
     
    26512611    if (to != this.env.source && cid && this.env.address_sources[to] && !this.env.address_sources[to].readonly) 
    26522612      this.http_post('copy', '_cid='+urlencode(cid)+'&_source='+urlencode(this.env.source)+'&_to='+urlencode(to)); 
    2653   }; 
     2613    }; 
    26542614 
    26552615 
     
    26902650    }; 
    26912651 
    2692  
    26932652  // update a contact record in the list 
    26942653  this.update_contact_row = function(cid, cols_arr) 
     
    27622721    }; 
    27632722 
    2764  
    27652723  this.delete_identity = function(id) 
    27662724    { 
     
    27772735    return true; 
    27782736    }; 
    2779  
    27802737 
    27812738  this.focus_subscription = function(id) 
     
    28042761    } 
    28052762 
    2806  
    28072763  this.unfocus_subscription = function(id) 
    28082764    { 
     
    28152771        this.set_classname(this.subscription_list.frame, 'droptarget', false); 
    28162772    } 
    2817  
    28182773 
    28192774  this.subscription_select = function(list) 
     
    28312786    }; 
    28322787 
    2833  
    28342788  this.subscription_move_folder = function(list) 
    28352789    { 
     
    28472801    }; 
    28482802 
    2849  
    28502803  // tell server to create and subscribe a new mailbox 
    28512804  this.create_folder = function(name) 
     
    28742827      form.elements['_folder_name'].focus(); 
    28752828    }; 
    2876  
    28772829 
    28782830  // start renaming the mailbox name. 
     
    29102862    }; 
    29112863 
    2912  
    29132864  // remove the input field and write the current mailbox name to the table cell 
    29142865  this.reset_folder_rename = function() 
     
    29212872    this.edit_folder = null; 
    29222873    }; 
    2923  
    29242874 
    29252875  // handler for keyboard events on the input field 
     
    29522902    }; 
    29532903 
    2954  
    29552904  // delete a specific mailbox with all its messages 
    29562905  this.delete_folder = function(id) 
     
    29712920      } 
    29722921    }; 
    2973  
    29742922 
    29752923  // add a new folder to the subscription list by cloning a folder row 
     
    30482996    }; 
    30492997 
    3050  
    30512998  // replace an existing table row with a new folder line 
    30522999  this.replace_folder_row = function(oldfolder, newfolder, display_name, before) 
     
    30763023    }; 
    30773024 
    3078  
    30793025  // remove the table row of a specific mailbox from the table 
    30803026  // (the row will not be removed, just hidden) 
     
    31043050    }; 
    31053051 
    3106  
    31073052  this.subscribe_folder = function(folder) 
    31083053    { 
     
    31113056    }; 
    31123057 
    3113  
    31143058  this.unsubscribe_folder = function(folder) 
    31153059    { 
     
    31183062    }; 
    31193063     
    3120  
    31213064  // helper method to find a specific mailbox row ID 
    31223065  this.get_folder_row_id = function(folder) 
     
    31563099  /*********************************************************/ 
    31573100 
    3158  
    31593101  // eable/disable buttons for page shifting 
    31603102  this.set_page_buttons = function() 
     
    31653107    this.enable_command('firstpage', (this.env.current_page > 1)); 
    31663108    } 
    3167  
    31683109 
    31693110  // set button to a specific state 
     
    32993240    }; 
    33003241 
    3301  
    33023242  // set/unset a specific class name 
    33033243  this.set_classname = function(obj, classname, set) 
     
    33093249      obj.className += ' '+classname; 
    33103250    }; 
    3311  
    33123251 
    33133252  // write to the document/window title 
     
    33183257  } 
    33193258 
    3320  
    33213259  // display a system message 
    33223260  this.display_message = function(msg, type, hold) 
     
    33533291    }; 
    33543292 
    3355  
    33563293  // make a message row disapear 
    33573294  this.hide_message = function() 
     
    33633300      } 
    33643301    }; 
    3365  
    33663302 
    33673303  // mark a mailbox as selected and set environment variable 
     
    33973333    return null; 
    33983334  }; 
    3399  
    34003335 
    34013336  // for reordering column array, Konqueror workaround 
     
    35123447    }; 
    35133448 
    3514  
    35153449  // replace content of row count display 
    35163450  this.set_rowcount = function(text) 
     
    35233457    }; 
    35243458 
    3525  
    35263459  // replace content of mailboxname display 
    35273460  this.set_mailboxname = function(content) 
     
    35373470      this.gui_objects.quotadisplay.innerHTML = content; 
    35383471    }; 
    3539  
    35403472 
    35413473  // update the mailboxlist 
     
    35483480    this.set_unread_count_display(mbox, set_title); 
    35493481    } 
    3550  
    35513482 
    35523483  // update the mailbox count display 
     
    36353566    }; 
    36363567 
    3637  
    36383568  this.toggle_editor = function(checkbox, textAreaId) 
    36393569    { 
     
    36573587    }; 
    36583588 
    3659  
    36603589  this.toggle_prefer_html = function(checkbox) 
    36613590    { 
     
    36653594    } 
    36663595 
    3667  
    36683596  // display fetched raw headers 
    36693597  this.set_headers = function(content) 
     
    36823610    }; 
    36833611 
    3684  
    36853612  // display all-headers row and fetch raw message headers 
    36863613  this.load_headers = function(elem) 
     
    37013628      } 
    37023629    } 
    3703  
    37043630 
    37053631  // hide all-headers row 
     
    37633689    }; 
    37643690 
    3765  
    37663691  this.http_sockets = new Array(); 
    37673692   
     
    37823707    }; 
    37833708   
    3784  
    37853709  // send a http request to the server 
    37863710  this.http_request = function(action, querystring, lock) 
     
    38403764    { 
    38413765    var ctype = request_obj.get_header('Content-Type'); 
    3842     if (ctype){ 
     3766    if (ctype) 
     3767      { 
    38433768      ctype = String(ctype).toLowerCase(); 
    38443769      var ctype_array=ctype.split(";"); 
    38453770      ctype = ctype_array[0]; 
    3846     } 
     3771      } 
    38473772 
    38483773    if (request_obj.__lock) 
     
    38963821          this.enable_command('export', (this.contact_list && this.contact_list.rowcount > 0)); 
    38973822        break; 
    3898     } 
     3823      } 
    38993824 
    39003825    request_obj.reset(); 
    39013826    }; 
    3902  
    39033827 
    39043828  // handle HTTP request errors 
     
    39063830    { 
    39073831    //alert('Error sending request: '+request_obj.url+' => HTTP '+request_obj.xmlhttp.status); 
    3908  
    39093832    if (request_obj.__lock) 
    39103833      this.set_busy(false); 
     
    39153838    }; 
    39163839 
    3917  
    39183840  // use an image to send a keep-alive siganl to the server 
    39193841  this.send_keep_alive = function() 
     
    39233845    }; 
    39243846 
    3925      
    39263847  // send periodic request to check for recent messages 
    39273848  this.check_for_recent = function() 
     
    39803901    }; 
    39813902 
    3982  
    39833903  this.set_caret2start = function(obj) 
    39843904    { 
     
    39943914    obj.focus(); 
    39953915    }; 
    3996  
    39973916 
    39983917  // set all fields of a form disabled 
     
    40143933     
    40153934  }  // end object rcube_webmail 
    4016  
    40173935 
    40183936 
     
    40273945  this.xmlhttp = null; 
    40283946 
    4029  
    40303947  // reset object properties 
    40313948  this.reset = function() 
     
    40443961    } 
    40453962 
    4046  
    40473963  // create HTMLHTTP object 
    40483964  this.build = function() 
     
    40813997    this.xmlhttp.send(null); 
    40823998    }; 
    4083  
    40843999 
    40854000  this.POST = function(url, body, contentType) 
     
    41154030    this.xmlhttp.send(req_body); 
    41164031    }; 
    4117  
    41184032 
    41194033  // handle onreadystatechange event 
  • program/steps/mail/show.inc

    r25c35c8 rbf2f39e  
    6868  // mark message as read 
    6969  if (!$MESSAGE->headers->seen) 
    70   { 
    71     $marked = $IMAP->set_flag($MESSAGE->uid, 'SEEN'); 
    72     if($RCMAIL->action == 'preview' && $marked != -1) 
    73     { 
    74       $OUTPUT->command('parent.set_unread_count', $mbox_name, $IMAP->messagecount($mbox_name, 'UNSEEN'), ($mbox_name == 'INBOX')); 
    75       $OUTPUT->command('parent.set_message', $MESSAGE->uid, 'unread', false); 
    76     } 
    77   } 
     70    $IMAP->set_flag($MESSAGE->uid, 'SEEN'); 
    7871 
    7972  // give message uid to the client 
Note: See TracChangeset for help on using the changeset viewer.