diff options
author | thomascube <thomas@roundcube.net> | 2007-03-18 18:46:03 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2007-03-18 18:46:03 +0000 |
commit | 86958f70d2970704e9ec6935d65e294c077143ea (patch) | |
tree | 43d9a57ffda90e2ff4f5adbe0ce64e335dc984a9 | |
parent | 43a42dcf405c1667f0f39150ffaa8bbda7d9d1a0 (diff) |
Improved contacts drop down; HTML output improvements; JS code cleanup
-rw-r--r-- | CHANGELOG | 11 | ||||
-rw-r--r-- | index.php | 2 | ||||
-rw-r--r-- | program/include/main.inc | 2 | ||||
-rw-r--r-- | program/js/app.js | 94 | ||||
-rw-r--r-- | program/js/common.js | 10 | ||||
-rw-r--r-- | program/steps/mail/func.inc | 3 | ||||
-rwxr-xr-x | skins/default/common.css | 3 |
7 files changed, 71 insertions, 54 deletions
@@ -1,6 +1,17 @@ CHANGELOG RoundCube Webmail --------------------------- +2007/03/18 (thomasb) +---------- +- Also use user_id for unique key in messages table (closes #1484074) +- Hide contacts drop down on blur (closes #1484203) +- Make entries in contacts drop down clickable +- Turn off browser autocompletion on login page +- Quote <? in text/html message parts +- Hide border around radio buttons +- Replaced old JS function calls. + + 2007/03/13 (thomasb) ---------- - Applied patch for attachment download by crichardson (closes #1484198) @@ -195,7 +195,7 @@ else if ($_action=='logout' && isset($_SESSION['user_id'])) } // check session and auth cookie -else if ($_action!='login' && $_SESSION['user_id']) +else if ($_action != 'login' && $_SESSION['user_id'] && $_action != 'send') { if (!rcmail_authenticate_session() || (!empty($CONFIG['session_lifetime']) && isset($SESS_CHANGED) && $SESS_CHANGED + $CONFIG['session_lifetime']*60 < mktime())) diff --git a/program/include/main.inc b/program/include/main.inc index 68cc9032c..e522b4350 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -1846,7 +1846,7 @@ function rcmail_login_form($attrib) $labels['pass'] = rcube_label('password'); $labels['host'] = rcube_label('server'); - $input_user = new textfield(array('name' => '_user', 'id' => 'rcmloginuser', 'size' => 30)); + $input_user = new textfield(array('name' => '_user', 'id' => 'rcmloginuser', 'size' => 30, 'autocomplete' => 'off')); $input_pass = new passwordfield(array('name' => '_pass', 'id' => 'rcmloginpwd', 'size' => 30)); $input_action = new hiddenfield(array('name' => '_action', 'value' => 'login')); diff --git a/program/js/app.js b/program/js/app.js index c19a3e14a..2f4b471c5 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -3,7 +3,7 @@ | RoundCube Webmail Client Script | | | | This file is part of the RoundCube Webmail client | - | Copyright (C) 2005-2006, RoundCube Dev, - Switzerland | + | Copyright (C) 2005-2007, RoundCube Dev, - Switzerland | | Licensed under the GNU GPL | | | +-----------------------------------------------------------------------+ @@ -178,7 +178,7 @@ function rcube_webmail() this.enable_command('add-attachment', 'send-attachment', 'remove-attachment', 'send', true); if (this.env.spellcheck) { - this.env.spellcheck.spelling_state_observer = function(s){ rcube_webmail_client.set_spellcheck_state(s); }; + this.env.spellcheck.spelling_state_observer = function(s){ ref.set_spellcheck_state(s); }; this.set_spellcheck_state('ready'); } if (this.env.drafts_mailbox) @@ -386,18 +386,19 @@ function rcube_webmail() this.init_address_input_events = function(obj) { - var handler = function(e){ return rcube_webmail_client.ksearch_keypress(e,this); }; - var handler2 = function(e){ return rcube_webmail_client.ksearch_blur(e,this); }; - - if (bw.safari) - obj.addEventListener('keydown', handler, false); - else if (bw.mz) - { - obj.addEventListener('keypress', handler, false); + var handler = function(e){ return ref.ksearch_keypress(e,this); }; + var handler2 = function(e){ return ref.ksearch_blur(e,this); }; + + if (obj.addEventListener) + { + obj.addEventListener(bw.safari ? 'keydown' : 'keypress', handler, false); obj.addEventListener('blur', handler2, false); - } - else if (bw.ie) + } + else + { obj.onkeydown = handler; + obj.onblur = handler2; + } obj.setAttribute('autocomplete', 'off'); }; @@ -1682,9 +1683,9 @@ function rcube_webmail() this.set_spellcheck_state = function(s) { - this.spellcheck_ready = (s=='check_spelling' || s=='ready'); + this.spellcheck_ready = (s=='check_spelling' || s=='ready'); this.enable_command('spellcheck', this.spellcheck_ready); - }; + }; this.auto_save_start = function() @@ -1986,7 +1987,6 @@ function rcube_webmail() if (highlight && (next = dir ? highlight.previousSibling : highlight.nextSibling)) { highlight.removeAttribute('id'); - //highlight.removeAttribute('class'); this.set_classname(highlight, 'selected', false); } @@ -1997,9 +1997,7 @@ function rcube_webmail() this.ksearch_selected = next._rcm_id; } - if (e.preventDefault) - e.preventDefault(); - return false; + return rcube_event.cancel(e); case 9: // tab if(e.shiftKey) @@ -2009,30 +2007,11 @@ function rcube_webmail() if (this.ksearch_selected===null || !this.ksearch_input || !this.ksearch_value) break; - // get cursor pos - var inp_value = this.ksearch_input.value.toLowerCase(); - var cpos = this.get_caret_pos(this.ksearch_input); - var p = inp_value.lastIndexOf(this.ksearch_value, cpos); - - // replace search string with full address - var pre = this.ksearch_input.value.substring(0, p); - var end = this.ksearch_input.value.substring(p+this.ksearch_value.length, this.ksearch_input.value.length); - var insert = this.env.contacts[this.ksearch_selected]+', '; - this.ksearch_input.value = pre + insert + end; - - //this.ksearch_input.value = this.ksearch_input.value.substring(0, p)+insert; - - // set caret to insert pos - cpos = p+insert.length; - if (this.ksearch_input.setSelectionRange) - this.ksearch_input.setSelectionRange(cpos, cpos); - - // hide ksearch pane + // insert selected address and hide ksearch pane + this.insert_recipient(this.ksearch_selected); this.ksearch_hide(); - - if (e.preventDefault) - e.preventDefault(); - return false; + + return rcube_event.cancel(e); case 27: // escape this.ksearch_hide(); @@ -2048,6 +2027,30 @@ function rcube_webmail() }; + this.insert_recipient = function(id) + { + if (!this.env.contacts[id] || !this.ksearch_input) + return; + + // get cursor pos + var inp_value = this.ksearch_input.value.toLowerCase(); + var cpos = this.get_caret_pos(this.ksearch_input); + var p = inp_value.lastIndexOf(this.ksearch_value, cpos); + + // replace search string with full address + var pre = this.ksearch_input.value.substring(0, p); + var end = this.ksearch_input.value.substring(p+this.ksearch_value.length, this.ksearch_input.value.length); + var insert = this.env.contacts[id]+', '; + this.ksearch_input.value = pre + insert + end; + + // set caret to insert pos + cpos = p+insert.length; + if (this.ksearch_input.setSelectionRange) + this.ksearch_input.setSelectionRange(cpos, cpos); + + }; + + // address search processor this.ksearch_get_results = function() { @@ -2113,6 +2116,8 @@ function rcube_webmail() { li = document.createElement('LI'); li.innerHTML = a_results[i].replace(/</, '<').replace(/>/, '>'); + li.onmousedown = function(e){ ref.insert_recipient(this._rcm_id); ref.ksearch_pane.show(0); return rcube_event.cancel(e); }; + li.style.cursor = 'pointer'; li._rcm_id = a_result_ids[i]; ul.appendChild(li); } @@ -2138,9 +2143,6 @@ function rcube_webmail() this.ksearch_selected = a_result_ids[0]; } - // resize the containing layer to fit the list - //this.ksearch_pane.resize(ul.offsetWidth, ul.offsetHeight); - // move the results pane right under the input box and make it visible var pos = rcube_get_object_pos(this.ksearch_input); this.ksearch_pane.move(pos.x, pos.y+this.ksearch_input.offsetHeight); @@ -3228,8 +3230,8 @@ function rcube_webmail() request_obj.__lock = lock ? true : false; request_obj.__action = action; - request_obj.onerror = function(o){ rcube_webmail_client.http_error(o); }; - request_obj.oncomplete = function(o){ rcube_webmail_client.http_response(o); }; + request_obj.onerror = function(o){ ref.http_error(o); }; + request_obj.oncomplete = function(o){ ref.http_response(o); }; request_obj.GET(this.env.comm_path+'&_action='+action+'&'+querystring); } }; diff --git a/program/js/common.js b/program/js/common.js index 2df349a91..82d7ed17c 100644 --- a/program/js/common.js +++ b/program/js/common.js @@ -496,7 +496,7 @@ function rcube_find_object(id, d) { if(d.layers[id]) obj = d.layers[id]; for(n=0; !obj && n<d.layers.length; n++) - obj = nex_get_object(id, d.layers[n].document); + obj = rcube_find_object(id, d.layers[n].document); } return obj; @@ -507,7 +507,7 @@ function rcube_find_object(id, d) function rcube_get_object_pos(obj) { if(typeof(obj)=='string') - obj = nex_get_object(obj); + obj = rcube_find_object(obj); if(!obj) return {x:0, y:0}; @@ -525,8 +525,8 @@ function rcube_get_object_pos(obj) } } - if(bw.mac && bw.ie5) iX += document.body.leftMargin; - if(bw.mac && bw.ie5) iY += document.body.topMargin; + //if(bw.mac && bw.ie5) iX += document.body.leftMargin; + //if(bw.mac && bw.ie5) iY += document.body.topMargin; return {x:iX, y:iY}; } @@ -548,7 +548,7 @@ function get_elements_computed_style(html_element, css_property, mozilla_equival var el = html_element; if (typeof(html_element)=='string') - el = nex_get_object(html_element); + el = rcube_find_object(html_element); if (el && el.currentStyle) return el.currentStyle[css_property]; diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 606c977a0..be9558fe1 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -1248,6 +1248,9 @@ function rcmail_mod_html_body($body, $container_id) '</div>'), $out); + // quote <? of php and xml files that are specified as text/html + $out = preg_replace(array('/<\?/', '/\?>/'), array('<?', '?>'), $out); + return $out; } diff --git a/skins/default/common.css b/skins/default/common.css index 2e7c169e4..afccc8f8c 100755 --- a/skins/default/common.css +++ b/skins/default/common.css @@ -73,7 +73,8 @@ input, textarea border: 1px solid #666666; } -input[type="checkbox"] +input[type="checkbox"], +input[type="radio"] { border: 0; padding: 0; |