Changeset 510 in subversion


Ignore:
Timestamp:
Mar 18, 2007 2:46:03 PM (6 years ago)
Author:
thomasb
Message:

Improved contacts drop down; HTML output improvements; JS code cleanup

Location:
trunk/roundcubemail
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/CHANGELOG

    r506 r510  
    11CHANGELOG RoundCube Webmail 
    22--------------------------- 
     3 
     42007/03/18 (thomasb) 
     5---------- 
     6- Also use user_id for unique key in messages table (closes #1484074) 
     7- Hide contacts drop down on blur (closes #1484203) 
     8- Make entries in contacts drop down clickable 
     9- Turn off browser autocompletion on login page 
     10- Quote <? in text/html message parts 
     11- Hide border around radio buttons 
     12- Replaced old JS function calls. 
     13 
    314 
    4152007/03/13 (thomasb) 
  • trunk/roundcubemail/index.php

    r502 r510  
    196196 
    197197// check session and auth cookie 
    198 else if ($_action!='login' && $_SESSION['user_id']) 
     198else if ($_action != 'login' && $_SESSION['user_id'] && $_action != 'send') 
    199199  { 
    200200  if (!rcmail_authenticate_session() || 
  • trunk/roundcubemail/program/include/main.inc

    r508 r510  
    18471847  $labels['host'] = rcube_label('server'); 
    18481848   
    1849   $input_user = new textfield(array('name' => '_user', 'id' => 'rcmloginuser', 'size' => 30)); 
     1849  $input_user = new textfield(array('name' => '_user', 'id' => 'rcmloginuser', 'size' => 30, 'autocomplete' => 'off')); 
    18501850  $input_pass = new passwordfield(array('name' => '_pass', 'id' => 'rcmloginpwd', 'size' => 30)); 
    18511851  $input_action = new hiddenfield(array('name' => '_action', 'value' => 'login')); 
  • trunk/roundcubemail/program/js/app.js

    r505 r510  
    44 |                                                                       | 
    55 | This file is part of the RoundCube Webmail client                     | 
    6  | Copyright (C) 2005-2006, RoundCube Dev, - Switzerland                 | 
     6 | Copyright (C) 2005-2007, RoundCube Dev, - Switzerland                 | 
    77 | Licensed under the GNU GPL                                            | 
    88 |                                                                       | 
     
    179179          if (this.env.spellcheck) 
    180180            { 
    181             this.env.spellcheck.spelling_state_observer = function(s){ rcube_webmail_client.set_spellcheck_state(s); }; 
     181            this.env.spellcheck.spelling_state_observer = function(s){ ref.set_spellcheck_state(s); }; 
    182182            this.set_spellcheck_state('ready'); 
    183183            } 
     
    387387  this.init_address_input_events = function(obj) 
    388388    { 
    389     var handler = function(e){ return rcube_webmail_client.ksearch_keypress(e,this); }; 
    390     var handler2 = function(e){ return rcube_webmail_client.ksearch_blur(e,this); }; 
    391  
    392     if (bw.safari) 
    393       obj.addEventListener('keydown', handler, false); 
    394     else if (bw.mz) 
    395       { 
    396       obj.addEventListener('keypress', handler, false); 
     389    var handler = function(e){ return ref.ksearch_keypress(e,this); }; 
     390    var handler2 = function(e){ return ref.ksearch_blur(e,this); }; 
     391     
     392    if (obj.addEventListener) 
     393    { 
     394      obj.addEventListener(bw.safari ? 'keydown' : 'keypress', handler, false); 
    397395      obj.addEventListener('blur', handler2, false); 
    398       } 
    399     else if (bw.ie) 
     396    } 
     397    else 
     398    { 
    400399      obj.onkeydown = handler; 
     400      obj.onblur = handler2; 
     401    } 
    401402 
    402403    obj.setAttribute('autocomplete', 'off');        
     
    16831684  this.set_spellcheck_state = function(s) 
    16841685    { 
    1685   this.spellcheck_ready = (s=='check_spelling' || s=='ready'); 
     1686    this.spellcheck_ready = (s=='check_spelling' || s=='ready'); 
    16861687    this.enable_command('spellcheck', this.spellcheck_ready); 
    1687   }; 
     1688    }; 
    16881689 
    16891690 
     
    19871988          { 
    19881989          highlight.removeAttribute('id'); 
    1989           //highlight.removeAttribute('class'); 
    19901990          this.set_classname(highlight, 'selected', false); 
    19911991          } 
     
    19981998          } 
    19991999 
    2000         if (e.preventDefault) 
    2001           e.preventDefault(); 
    2002         return false; 
     2000        return rcube_event.cancel(e); 
    20032001 
    20042002      case 9:  // tab 
     
    20102008          break; 
    20112009 
    2012         // get cursor pos 
    2013         var inp_value = this.ksearch_input.value.toLowerCase(); 
    2014         var cpos = this.get_caret_pos(this.ksearch_input); 
    2015         var p = inp_value.lastIndexOf(this.ksearch_value, cpos); 
    2016          
    2017         // replace search string with full address 
    2018         var pre = this.ksearch_input.value.substring(0, p); 
    2019         var end = this.ksearch_input.value.substring(p+this.ksearch_value.length, this.ksearch_input.value.length); 
    2020         var insert = this.env.contacts[this.ksearch_selected]+', '; 
    2021         this.ksearch_input.value = pre + insert + end; 
    2022          
    2023         //this.ksearch_input.value = this.ksearch_input.value.substring(0, p)+insert; 
    2024          
    2025         // set caret to insert pos 
    2026         cpos = p+insert.length; 
    2027         if (this.ksearch_input.setSelectionRange) 
    2028           this.ksearch_input.setSelectionRange(cpos, cpos); 
    2029          
    2030         // hide ksearch pane 
     2010        // insert selected address and hide ksearch pane 
     2011        this.insert_recipient(this.ksearch_selected); 
    20312012        this.ksearch_hide(); 
    2032        
    2033         if (e.preventDefault) 
    2034           e.preventDefault(); 
    2035         return false; 
     2013 
     2014        return rcube_event.cancel(e); 
    20362015 
    20372016      case 27:  // escape 
     
    20472026    return true; 
    20482027    }; 
     2028 
     2029 
     2030  this.insert_recipient = function(id) 
     2031  { 
     2032    if (!this.env.contacts[id] || !this.ksearch_input) 
     2033      return; 
     2034     
     2035    // get cursor pos 
     2036    var inp_value = this.ksearch_input.value.toLowerCase(); 
     2037    var cpos = this.get_caret_pos(this.ksearch_input); 
     2038    var p = inp_value.lastIndexOf(this.ksearch_value, cpos); 
     2039     
     2040    // replace search string with full address 
     2041    var pre = this.ksearch_input.value.substring(0, p); 
     2042    var end = this.ksearch_input.value.substring(p+this.ksearch_value.length, this.ksearch_input.value.length); 
     2043    var insert  = this.env.contacts[id]+', '; 
     2044    this.ksearch_input.value = pre + insert + end; 
     2045     
     2046    // set caret to insert pos 
     2047    cpos = p+insert.length; 
     2048    if (this.ksearch_input.setSelectionRange) 
     2049      this.ksearch_input.setSelectionRange(cpos, cpos); 
     2050     
     2051  }; 
    20492052 
    20502053 
     
    21142117        li = document.createElement('LI'); 
    21152118        li.innerHTML = a_results[i].replace(/</, '&lt;').replace(/>/, '&gt;'); 
     2119        li.onmousedown = function(e){ ref.insert_recipient(this._rcm_id); ref.ksearch_pane.show(0); return rcube_event.cancel(e); }; 
     2120        li.style.cursor = 'pointer'; 
    21162121        li._rcm_id = a_result_ids[i]; 
    21172122        ul.appendChild(li); 
     
    21392144        } 
    21402145 
    2141       // resize the containing layer to fit the list 
    2142       //this.ksearch_pane.resize(ul.offsetWidth, ul.offsetHeight); 
    2143      
    21442146      // move the results pane right under the input box and make it visible 
    21452147      var pos = rcube_get_object_pos(this.ksearch_input); 
     
    32293231      request_obj.__lock = lock ? true : false; 
    32303232      request_obj.__action = action; 
    3231       request_obj.onerror = function(o){ rcube_webmail_client.http_error(o); }; 
    3232       request_obj.oncomplete = function(o){ rcube_webmail_client.http_response(o); }; 
     3233      request_obj.onerror = function(o){ ref.http_error(o); }; 
     3234      request_obj.oncomplete = function(o){ ref.http_response(o); }; 
    32333235      request_obj.GET(this.env.comm_path+'&_action='+action+'&'+querystring); 
    32343236      } 
  • trunk/roundcubemail/program/js/common.js

    r412 r510  
    497497    if(d.layers[id]) obj = d.layers[id]; 
    498498    for(n=0; !obj && n<d.layers.length; n++) 
    499       obj = nex_get_object(id, d.layers[n].document); 
     499      obj = rcube_find_object(id, d.layers[n].document); 
    500500    } 
    501501 
     
    508508  { 
    509509  if(typeof(obj)=='string') 
    510     obj = nex_get_object(obj); 
     510    obj = rcube_find_object(obj); 
    511511 
    512512  if(!obj) return {x:0, y:0}; 
     
    526526    } 
    527527 
    528   if(bw.mac && bw.ie5) iX += document.body.leftMargin; 
    529   if(bw.mac && bw.ie5) iY += document.body.topMargin; 
     528  //if(bw.mac && bw.ie5) iX += document.body.leftMargin; 
     529  //if(bw.mac && bw.ie5) iY += document.body.topMargin; 
    530530 
    531531  return {x:iX, y:iY}; 
     
    549549  var el = html_element; 
    550550  if (typeof(html_element)=='string') 
    551     el = nex_get_object(html_element); 
     551    el = rcube_find_object(html_element); 
    552552 
    553553  if (el && el.currentStyle) 
  • trunk/roundcubemail/program/steps/mail/func.inc

    r501 r510  
    12491249                      $out); 
    12501250 
     1251  // quote <? of php and xml files that are specified as text/html 
     1252  $out = preg_replace(array('/<\?/', '/\?>/'), array('&lt;?', '?&gt;'), $out); 
     1253 
    12511254  return $out; 
    12521255  } 
  • trunk/roundcubemail/skins/default/common.css

    r492 r510  
    7474} 
    7575 
    76 input[type="checkbox"] 
     76input[type="checkbox"], 
     77input[type="radio"] 
    7778{ 
    7879  border: 0; 
Note: See TracChangeset for help on using the changeset viewer.