Changeset 5481 in subversion
- Timestamp:
- Nov 24, 2011 2:53:00 AM (18 months ago)
- Location:
- branches/release-0.7
- Files:
-
- 27 edited
-
CHANGELOG (modified) (1 diff)
-
SQL/mssql.initial.sql (modified) (1 diff)
-
SQL/mssql.upgrade.sql (modified) (1 diff)
-
SQL/mysql.initial.sql (modified) (1 diff)
-
SQL/mysql.update.sql (modified) (1 diff)
-
SQL/postgres.initial.sql (modified) (1 diff)
-
SQL/postgres.update.sql (modified) (1 diff)
-
SQL/sqlite.initial.sql (modified) (1 diff)
-
SQL/sqlite.update.sql (modified) (1 diff)
-
plugins/archive/archive.js (modified) (1 diff)
-
plugins/archive/package.xml (modified) (2 diffs)
-
plugins/managesieve/Changelog (modified) (1 diff)
-
plugins/managesieve/localization/es_ES.inc (modified) (2 diffs)
-
plugins/managesieve/managesieve.js (modified) (3 diffs)
-
plugins/managesieve/skins/default/managesieve.css (modified) (4 diffs)
-
plugins/password/drivers/ldap.php (modified) (1 diff)
-
plugins/password/drivers/ldap_simple.php (modified) (1 diff)
-
plugins/password/package.xml (modified) (5 diffs)
-
program/include/main.inc (modified) (2 diffs)
-
program/include/rcube_string_replacer.php (modified) (1 diff)
-
program/include/rcube_template.php (modified) (2 diffs)
-
program/js/app.js (modified) (58 diffs)
-
program/js/common.js (modified) (1 diff)
-
program/steps/mail/get.inc (modified) (1 diff)
-
program/steps/settings/func.inc (modified) (2 diffs)
-
skins/default/common.css (modified) (6 diffs)
-
tests/mailfunc.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-0.7/CHANGELOG
r5452 r5481 2 2 =========================== 3 3 4 - Fix possible infinite redirect on attachment preview (#1488199) 5 - Improved clickjacking protection for browsers which don't support X-Frame-Options headers 6 - Fixed bug where similiar folder names were highlighted wrong (#1487860) 7 - Fixed bug in handling link with '!' character in it (#1488195) 8 - Fixed bug where session ID's length was limited to 40 characters (#1488196) 4 9 10 RELEASE 0.7-beta 11 ---------------- 5 12 - Fix handling of HTML form elements in messages (#1485137) 6 13 - Fix regression in setting recipient to self when replying to a Sent message (#1487074) -
branches/release-0.7/SQL/mssql.initial.sql
r5234 r5481 82 82 83 83 CREATE TABLE [dbo].[session] ( 84 [sess_id] [varchar] ( 32) COLLATE Latin1_General_CI_AI NOT NULL ,84 [sess_id] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL , 85 85 [created] [datetime] NOT NULL , 86 86 [changed] [datetime] NULL , -
branches/release-0.7/SQL/mssql.upgrade.sql
r5294 r5481 240 240 GO 241 241 242 -- Updates from version 0.7-beta 243 244 ALTER TABLE [dbo].[session] ALTER COLUMN [sess_id] [varchar] (128) COLLATE Latin1_General_CI_AI NOT NULL 245 GO 246 -
branches/release-0.7/SQL/mysql.initial.sql
r5233 r5481 7 7 8 8 CREATE TABLE `session` ( 9 `sess_id` varchar( 40) NOT NULL,9 `sess_id` varchar(128) NOT NULL, 10 10 `created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00', 11 11 `changed` datetime NOT NULL DEFAULT '1000-01-01 00:00:00', -
branches/release-0.7/SQL/mysql.update.sql
r5294 r5481 209 209 PRIMARY KEY (`user_id`, `mailbox`, `uid`) 210 210 ) /*!40000 ENGINE=INNODB */ /*!40101 CHARACTER SET utf8 COLLATE utf8_general_ci */; 211 212 -- Updates from version 0.7-beta 213 214 ALTER TABLE `session` CHANGE `sess_id` `sess_id` varchar(128) NOT NULL; -
branches/release-0.7/SQL/postgres.initial.sql
r5233 r5481 38 38 39 39 CREATE TABLE "session" ( 40 sess_id varchar( 40) DEFAULT '' PRIMARY KEY,40 sess_id varchar(128) DEFAULT '' PRIMARY KEY, 41 41 created timestamp with time zone DEFAULT now() NOT NULL, 42 42 changed timestamp with time zone DEFAULT now() NOT NULL, -
branches/release-0.7/SQL/postgres.update.sql
r5294 r5481 166 166 167 167 CREATE INDEX cache_messages_changed_idx ON cache_messages (changed); 168 169 -- Updates from version 0.7-beta 170 171 ALTER TABLE "session" ALTER sess_id TYPE varchar(128); -
branches/release-0.7/SQL/sqlite.initial.sql
r5233 r5481 111 111 112 112 CREATE TABLE session ( 113 sess_id varchar( 40) NOT NULL PRIMARY KEY,113 sess_id varchar(128) NOT NULL PRIMARY KEY, 114 114 created datetime NOT NULL default '0000-00-00 00:00:00', 115 115 changed datetime NOT NULL default '0000-00-00 00:00:00', -
branches/release-0.7/SQL/sqlite.update.sql
r5294 r5481 283 283 284 284 CREATE INDEX ix_cache_messages_changed ON cache_messages (changed); 285 286 -- Updates from version 0.7-beta 287 288 DROP TABLE session; 289 CREATE TABLE session ( 290 sess_id varchar(128) NOT NULL PRIMARY KEY, 291 created datetime NOT NULL default '0000-00-00 00:00:00', 292 changed datetime NOT NULL default '0000-00-00 00:00:00', 293 ip varchar(40) NOT NULL default '', 294 vars text NOT NULL 295 ); 296 297 CREATE INDEX ix_session_changed ON session (changed); -
branches/release-0.7/plugins/archive/archive.js
r4390 r5481 28 28 // set css style for archive folder 29 29 var li; 30 if (rcmail.env.archive_folder && rcmail.env.archive_folder_icon && (li = rcmail.get_folder_li(rcmail.env.archive_folder))) 30 if (rcmail.env.archive_folder && rcmail.env.archive_folder_icon 31 && (li = rcmail.get_folder_li(rcmail.env.archive_folder, '', true)) 32 ) 31 33 $(li).css('background-image', 'url(' + rcmail.env.archive_folder_icon + ')'); 32 34 }) -
branches/release-0.7/plugins/archive/package.xml
r3439 r5481 14 14 <active>yes</active> 15 15 </lead> 16 <date>2010-02-06</date> 17 <time>12:12:00</time> 16 <date>2011-11-23</date> 18 17 <version> 19 <release>1. 4</release>18 <release>1.5</release> 20 19 <api>1.4</api> 21 20 </version> … … 36 35 <tasks:replace from="@package_version@" to="version" type="package-info"/> 37 36 </file> 38 <file name="localization/en_US.inc" role="data"></file>39 37 <file name="localization/cs_CZ.inc" role="data"></file> 40 38 <file name="localization/de_CH.inc" role="data"></file> 41 39 <file name="localization/de_DE.inc" role="data"></file> 40 <file name="localization/en_US.inc" role="data"></file> 41 <file name="localization/es_AR.inc" role="data"></file> 42 <file name="localization/es_ES.inc" role="data"></file> 42 43 <file name="localization/et_EE.inc" role="data"></file> 43 44 <file name="localization/fr_FR.inc" role="data"></file> 45 <file name="localization/gl_ES.inc" role="data"></file> 46 <file name="localization/ja_JP.inc" role="data"></file> 47 <file name="localization/nl_NL.inc" role="data"></file> 44 48 <file name="localization/pl_PL.inc" role="data"></file> 49 <file name="localization/pt_BR.inc" role="data"></file> 45 50 <file name="localization/ru_RU.inc" role="data"></file> 51 <file name="localization/sv_SE.inc" role="data"></file> 46 52 <file name="localization/zh_TW.inc" role="data"></file> 47 53 <file name="skins/default/archive_act.png" role="data"></file> -
branches/release-0.7/plugins/managesieve/Changelog
r5452 r5481 1 1 - Fixed setting test type to :is when none is specified 2 - Fixed javascript error in IE8 2 3 3 4 * version 5.0-rc1 [2011-11-17] -
branches/release-0.7/plugins/managesieve/localization/es_ES.inc
r4434 r5481 54 54 $labels['fromfile'] = 'de archivo'; 55 55 $labels['filterdisabled'] = 'Filtro desactivado'; 56 $labels['filtermatches'] = 'coincide con la expresión'; 57 $labels['filternotmatches'] = 'no coincide con la expresión'; 58 $labels['filterregex'] = 'coincide con la expresión regular'; 59 $labels['filternotregex'] = 'no coincide con la expresión regular'; 60 $labels['vacationsubject'] = 'Asunto del Mensaje:'; 61 $labels['countisgreaterthan'] = 'contiene más que'; 62 $labels['countisgreaterthanequal'] = 'contiene más o igual que'; 63 $labels['countislessthan'] = 'contiene menos que'; 64 $labels['countislessthanequal'] = 'contiene menos o igual que'; 65 $labels['countequals'] = 'contiene igual que'; 66 $labels['countnotequals'] = 'contiene distinto que'; 67 $labels['valueisgreaterthan'] = 'el valor es mayor que'; 68 $labels['valueisgreaterthanequal'] = 'el valor es mayor o igual que'; 69 $labels['valueislessthan'] = 'el valor es menor que'; 70 $labels['valueislessthanequal'] = 'el valor es menor o igual que'; 71 $labels['valueequals'] = 'el valor es igual que'; 72 $labels['valuenotequals'] = 'el valor es distinto que'; 73 $labels['setflags'] = 'Etiquetar el mensaje'; 74 $labels['addflags'] = 'Agregar etiqueta al mensaje'; 75 $labels['removeflags'] = 'Eliminar etiquetas al mensaje'; 76 $labels['flagread'] = 'Leido'; 77 $labels['flagdeleted'] = 'Eliminado'; 78 $labels['flaganswered'] = 'Respondido'; 79 $labels['flagflagged'] = 'Marcado'; 80 $labels['flagdraft'] = 'Borrador'; 56 81 57 82 $messages = array(); … … 78 103 $messages['emptyname'] = 'Imposible crear el conjunto de filtros. Sin nombre'; 79 104 $messages['nametoolong'] = 'Imposible crear el conjunto de filtros. Nombre demasiado largo' 105 $messages['setdeactivateerror'] = 'Imposible desactivar el conjunto de filtros seleccionado. Ha ocurrido un error en el servidor'; 80 106 81 107 ?> -
branches/release-0.7/plugins/managesieve/managesieve.js
r5452 r5481 291 291 td.className = 'name'; 292 292 tr.id = 'rcmrow' + el.id; 293 if (el .class)294 tr.className = el .class293 if (el['class']) 294 tr.className = el['class']; 295 295 tr.appendChild(td); 296 296 … … 722 722 // load form in the iframe 723 723 var frame = $('<iframe>').attr({src: url, frameborder: 0}) 724 frame.height(dialog.height()); // temp. 725 dialog.empty().append(frame); 726 dialog.dialog('dialog').resize(); 724 dialog.empty().append(frame).dialog('dialog').resize(); 727 725 728 726 // Change [Next Step] button with [Save] button 729 727 buttons = {}; 730 buttons[rcmail.gettext('save')] = function() { 728 buttons[rcmail.gettext('save')] = function() { 731 729 var win = $('iframe', dialog).get(0).contentWindow; 732 730 win.rcmail.managesieve_save(); … … 744 742 buttons: buttons, 745 743 minWidth: 600, 746 minHeight: 300 744 minHeight: 300, 745 height: 250 747 746 }).show(); 748 747 -
branches/release-0.7/plugins/managesieve/skins/default/managesieve.css
r5452 r5481 111 111 { 112 112 min-width: 550px; 113 width: expression(Math.max(550, document.documentElement.clientWidth)+'px'); 113 114 white-space: nowrap; 114 115 padding: 20px 10px 10px 10px; … … 146 147 { 147 148 padding: 0px; 148 width: 100%;149 min-width: 620px;149 min-width: 600px; 150 width: expression(Math.max(600, document.documentElement.clientWidth)+'px'); 150 151 } 151 152 … … 190 191 white-space: nowrap; 191 192 width: 1%; 193 padding-top: 2px; 192 194 } 193 195 … … 197 199 width: 98%; 198 200 padding-left: 3px; 201 padding-top: 2px; 199 202 } 200 203 -
branches/release-0.7/plugins/password/drivers/ldap.php
r5035 r5481 273 273 if (function_exists('hash')) { 274 274 $cryptedPassword = hash('md4', rcube_charset_convert($passwordClear, RCMAIL_CHARSET, 'UTF-16LE')); 275 $cryptedPassword = strtoupper($cryptedPassword); 275 276 } else { 276 277 /* Your PHP install does not have the hash() function */ -
branches/release-0.7/plugins/password/drivers/ldap_simple.php
r4529 r5481 239 239 if (function_exists('hash')) { 240 240 $crypted_password = hash('md4', rcube_charset_convert($password_clear, RCMAIL_CHARSET, 'UTF-16LE')); 241 $crypted_password = strtoupper($crypted_password); 241 242 } else { 242 243 /* Your PHP install does not have the hash() function */ -
branches/release-0.7/plugins/password/package.xml
r5426 r5481 16 16 <active>yes</active> 17 17 </lead> 18 <date></date> 19 <time></time> 18 <date>2011-11-23</date> 20 19 <version> 21 <release> </release>20 <release>2.4</release> 22 21 <api>1.6</api> 23 22 </version> … … 29 28 <notes> 30 29 - Added option to use punycode or unicode for domain names (#1488103) 30 - Save Samba password hashes in capital letters (#1488197) 31 31 </notes> 32 32 <contents> … … 52 52 <file name="localization/de_DE.inc" role="data"></file> 53 53 <file name="localization/en_US.inc" role="data"></file> 54 <file name="localization/es_AR.inc" role="data"></file> 54 55 <file name="localization/es_ES.inc" role="data"></file> 55 56 <file name="localization/et_EE.inc" role="data"></file> … … 57 58 <file name="localization/fr_FR.inc" role="data"></file> 58 59 <file name="localization/gl_ES.inc" role="data"></file> 60 <file name="localization/hr_HR.inc" role="data"></file> 59 61 <file name="localization/hu_HU.inc" role="data"></file> 60 62 <file name="localization/it_IT.inc" role="data"></file> 63 <file name="localization/ja_JA.inc" role="data"></file> 61 64 <file name="localization/lt_LT.inc" role="data"></file> 62 65 <file name="localization/lv_LV.inc" role="data"></file> … … 65 68 <file name="localization/pt_BR.inc" role="data"></file> 66 69 <file name="localization/pt_PT.inc" role="data"></file> 70 <file name="localization/ru_RU.inc" role="data"></file> 71 <file name="localization/sk_SK.inc" role="data"></file> 67 72 <file name="localization/sl_SI.inc" role="data"></file> 68 73 <file name="localization/sv_SE.inc" role="data"></file> 74 <file name="localization/tr_TR.inc" role="data"></file> 69 75 <file name="localization/zh_TW.inc" role="data"></file> 70 76 -
branches/release-0.7/program/include/main.inc
r5426 r5481 731 731 /** 732 732 * Convert the given string into a valid HTML identifier 733 * Same functionality as done in app.js with this.identifier_expr 734 * 735 */ 736 function html_identifier($str) 737 { 738 return asciiwords($str, true, '_'); 733 * Same functionality as done in app.js with rcube_webmail.html_identifier() 734 */ 735 function html_identifier($str, $encode=false) 736 { 737 if ($encode) 738 return rtrim(strtr(base64_encode($str), '+/', '-_'), '='); 739 else 740 return asciiwords($str, true, '_'); 739 741 } 740 742 … … 1332 1334 1333 1335 // make folder name safe for ids and class names 1334 $folder_id = html_identifier($folder['id'] );1336 $folder_id = html_identifier($folder['id'], true); 1335 1337 $classes = array('mailbox'); 1336 1338 -
branches/release-0.7/program/include/rcube_string_replacer.php
r5402 r5481 40 40 $utf_domain = '[^?&@"\'\\/()\s\r\t\n]+\\.([^\\x00-\\x2f\\x3b-\\x40\\x5b-\\x60\\x7b-\\x7f]{2,}|xn--[a-z0-9]{2,})'; 41 41 $url1 = '.:;,'; 42 $url2 = 'a-z0-9%=#@+? &\\/_~\\[\\]{}-';42 $url2 = 'a-z0-9%=#@+?!&\\/_~\\[\\]{}-'; 43 43 44 44 $this->link_pattern = "/([\w]+:\/\/|\Wwww\.)($utf_domain([$url1]?[$url2]+)*)/i"; -
branches/release-0.7/program/include/rcube_template.php
r5336 r5481 72 72 //$this->framed = $framed; 73 73 $this->set_env('task', $task); 74 $this->set_env('x_frame_options', $this->app->config->get('x_frame_options', 'sameorigin')); 74 75 75 76 // load the correct skin (in case user-defined) … … 916 917 if (in_array($attrib['command'], rcmail::$main_tasks)) { 917 918 $attrib['href'] = rcmail_url(null, null, $attrib['command']); 919 $attrib['onclick'] = sprintf("%s.switch_task('%s');return false", JS_OBJECT_NAME, $attrib['command']); 918 920 } 919 921 else if ($attrib['task'] && in_array($attrib['task'], rcmail::$main_tasks)) { -
branches/release-0.7/program/js/app.js
r5452 r5481 38 38 // webmail client settings 39 39 this.dblclick_time = 500; 40 this.message_time = 2000;40 this.message_time = 4000; 41 41 42 42 this.identifier_expr = new RegExp('[^0-9a-z\-_]', 'gi'); … … 129 129 this.init = function() 130 130 { 131 var p = this;131 var n, p = this; 132 132 this.task = this.env.task; 133 133 … … 139 139 140 140 // find all registered gui containers 141 for ( varn in this.gui_containers)141 for (n in this.gui_containers) 142 142 this.gui_containers[n] = $('#'+this.gui_containers[n]); 143 143 144 144 // find all registered gui objects 145 for ( varn in this.gui_objects)145 for (n in this.gui_objects) 146 146 this.gui_objects[n] = rcube_find_object(this.gui_objects[n]); 147 148 // clickjacking protection 149 if (this.env.x_frame_options) { 150 try { 151 // bust frame if not allowed 152 if (this.env.x_frame_options == 'deny' && top.location.href != self.location.href) 153 top.location.href = self.location.href; 154 else if (top.location.hostname != self.location.hostname) 155 throw 1; 156 } catch (e) { 157 // possible clickjacking attack: disable all form elements 158 $('form').each(function(){ ref.lock_form(this, true); }); 159 this.display_message("Blocked: possible clickjacking attack!", 'error'); 160 return; 161 } 162 } 147 163 148 164 // init registered buttons … … 381 397 382 398 // detect client timezone 383 var tz = new Date().getTimezoneOffset() / -60; 384 var stdtz = new Date().getStdTimezoneOffset() / -60; 399 var dt = new Date(), 400 tz = dt.getTimezoneOffset() / -60, 401 stdtz = dt.getStdTimezoneOffset() / -60; 402 385 403 $('#rcmlogintz').val(stdtz); 386 404 $('#rcmlogindst').val(tz > stdtz ? 1 : 0); … … 443 461 this.command = function(command, props, obj) 444 462 { 445 var ret ;463 var ret, uid, cid, url, flag; 446 464 447 465 if (obj && obj.blur) … … 518 536 519 537 case 'open': 520 var uid;521 538 if (uid = this.get_single_uid()) { 522 539 obj.href = '?_task='+this.env.task+'&_action=show&_mbox='+urlencode(this.env.mailbox)+'&_uid='+uid; … … 587 604 case 'show': 588 605 if (this.task == 'mail') { 589 varuid = this.get_single_uid();606 uid = this.get_single_uid(); 590 607 if (uid && (!this.env.uid || uid != this.env.uid)) { 591 608 if (this.env.mailbox == this.env.drafts_mailbox) … … 596 613 } 597 614 else if (this.task == 'addressbook') { 598 varcid = props ? props : this.get_single_cid();615 cid = props ? props : this.get_single_cid(); 599 616 if (cid && !(this.env.action == 'show' && cid == this.env.cid)) 600 617 this.load_contact(cid, 'show'); … … 612 629 613 630 case 'edit': 614 var cid;615 631 if (this.task=='addressbook' && (cid = this.get_single_cid())) 616 632 this.load_contact(cid, 'edit'); … … 618 634 this.load_identity(props, 'edit-identity'); 619 635 else if (this.task=='mail' && (cid = this.get_single_uid())) { 620 varurl = (this.env.mailbox == this.env.drafts_mailbox) ? '_draft_uid=' : '_uid=';636 url = (this.env.mailbox == this.env.drafts_mailbox) ? '_draft_uid=' : '_uid='; 621 637 this.goto_url('compose', url+cid+'&_mbox='+urlencode(this.env.mailbox), true); 622 638 } … … 696 712 break; 697 713 698 var uid,flag = 'read';714 flag = 'read'; 699 715 700 716 if (props._row.uid) { … … 716 732 break; 717 733 718 var uid,flag = 'flagged';734 flag = 'flagged'; 719 735 720 736 if (props._row.uid) { … … 812 828 813 829 case 'compose': 814 varurl = this.url('mail/compose');830 url = this.url('mail/compose'); 815 831 816 832 if (this.task == 'mail') { … … 922 938 case 'reply-list': 923 939 case 'reply': 924 var uid;925 940 if (uid = this.get_single_uid()) { 926 varurl = '_reply_uid='+uid+'&_mbox='+urlencode(this.env.mailbox);941 url = '_reply_uid='+uid+'&_mbox='+urlencode(this.env.mailbox); 927 942 if (command == 'reply-all') 928 943 // do reply-list, when list is detected and popup menu wasn't used … … 937 952 case 'forward-attachment': 938 953 case 'forward': 939 var uid, url;940 954 if (uid = this.get_single_uid()) { 941 955 url = '_forward_uid='+uid+'&_mbox='+urlencode(this.env.mailbox); … … 947 961 948 962 case 'print': 949 var uid;950 963 if (uid = this.get_single_uid()) { 951 964 ref.printwin = window.open(this.env.comm_path+'&_action=print&_uid='+uid+'&_mbox='+urlencode(this.env.mailbox)+(this.env.safemode ? '&_safe=1' : '')); … … 959 972 960 973 case 'viewsource': 961 var uid;962 974 if (uid = this.get_single_uid()) { 963 975 ref.sourcewin = window.open(this.env.comm_path+'&_action=viewsource&_uid='+uid+'&_mbox='+urlencode(this.env.mailbox)); … … 968 980 969 981 case 'download': 970 var uid;971 982 if (uid = this.get_single_uid()) 972 983 this.goto_url('viewsource', '&_uid='+uid+'&_mbox='+urlencode(this.env.mailbox)+'&_save=1'); … … 1065 1076 this.enable_command = function() 1066 1077 { 1067 var args = Array.prototype.slice.call(arguments),1078 var i, n, args = Array.prototype.slice.call(arguments), 1068 1079 enable = args.pop(), cmd; 1069 1080 1070 for ( varn=0; n<args.length; n++) {1081 for (n=0; n<args.length; n++) { 1071 1082 cmd = args[n]; 1072 1083 // argument of type array … … 1077 1088 // push array elements into commands array 1078 1089 else { 1079 for ( vari in cmd)1090 for (i in cmd) 1080 1091 args.push(cmd[i]); 1081 1092 } … … 1204 1215 }; 1205 1216 1217 this.html_identifier = function(str, encode) 1218 { 1219 str = String(str); 1220 if (encode) 1221 return Base64.encode(str).replace(/=+$/, '').replace(/\+/g, '-').replace(/\//g, '_'); 1222 else 1223 return str.replace(this.identifier_expr, '_'); 1224 }; 1225 1226 this.html_identifier_decode = function(str) 1227 { 1228 str = String(str).replace(/-/g, '+').replace(/_/g, '/'); 1229 1230 while (str.length % 4) str += '='; 1231 1232 return Base64.decode(str); 1233 }; 1234 1206 1235 1207 1236 /*********************************************************/ … … 1250 1279 this.initialListScrollTop = this.gui_objects.folderlist.parentNode.scrollTop; 1251 1280 1252 var li, pos, list, height; 1253 list = $(this.gui_objects.folderlist); 1254 pos = list.offset(); 1281 var k, li, height, 1282 list = $(this.gui_objects.folderlist); 1283 pos = list.offset(); 1284 1255 1285 this.env.folderlist_coords = { x1:pos.left, y1:pos.top, x2:pos.left + list.width(), y2:pos.top + list.height() }; 1256 1286 1257 1287 this.env.folder_coords = []; 1258 for ( vark in model) {1288 for (k in model) { 1259 1289 if (li = this.get_folder_li(k)) { 1260 1290 // only visible folders … … 1292 1322 { 1293 1323 if (this.gui_objects.folderlist && this.env.folder_coords) { 1294 // offsets to compensate for scrolling while dragging a message 1295 var boffset = bw.ie ? -document.documentElement.scrollTop : this.initialBodyScrollTop; 1296 var moffset = this.initialListScrollTop-this.gui_objects.folderlist.parentNode.scrollTop; 1297 var toffset = -moffset-boffset; 1298 var li, div, pos, mouse, check, oldclass, 1299 layerclass = 'draglayernormal'; 1324 var k, li, div, check, oldclass, 1325 layerclass = 'draglayernormal', 1326 mouse = rcube_event.get_mouse_pos(e), 1327 pos = this.env.folderlist_coords, 1328 // offsets to compensate for scrolling while dragging a message 1329 boffset = bw.ie ? -document.documentElement.scrollTop : this.initialBodyScrollTop, 1330 moffset = this.initialListScrollTop-this.gui_objects.folderlist.parentNode.scrollTop; 1300 1331 1301 1332 if (this.contact_list && this.contact_list.draglayer) 1302 1333 oldclass = this.contact_list.draglayer.attr('class'); 1303 1334 1304 mouse = rcube_event.get_mouse_pos(e); 1305 pos = this.env.folderlist_coords; 1306 mouse.y += toffset; 1335 mouse.y += -moffset-boffset; 1307 1336 1308 1337 // if mouse pointer is outside of folderlist … … 1319 1348 1320 1349 // over the folders 1321 for ( vark in this.env.folder_coords) {1350 for (k in this.env.folder_coords) { 1322 1351 pos = this.env.folder_coords[k]; 1323 1352 if (mouse.x >= pos.x1 && mouse.x < pos.x2 && mouse.y >= pos.y1 && mouse.y < pos.y2){ 1324 if ((check = this.check_droptarget(k))) {1353 if ((check = this.check_droptarget(k))) { 1325 1354 li = this.get_folder_li(k); 1326 1355 div = $(li.getElementsByTagName('div')[0]); … … 1333 1362 this.folder_auto_expand = k; 1334 1363 this.folder_auto_timer = window.setTimeout(function() { 1335 rcmail.command('collapse-folder', rcmail.folder_auto_expand);1336 rcmail.drag_start(null);1337 }, 1000);1364 rcmail.command('collapse-folder', rcmail.folder_auto_expand); 1365 rcmail.drag_start(null); 1366 }, 1000); 1338 1367 } else if (this.folder_auto_timer) { 1339 1368 window.clearTimeout(this.folder_auto_timer); … … 1361 1390 }; 1362 1391 1363 this.collapse_folder = function(id) 1364 { 1365 var li = this.get_folder_li(id), 1366 div = $(li.getElementsByTagName('div')[0]); 1367 1368 if (!div || (!div.hasClass('collapsed') && !div.hasClass('expanded'))) 1369 return; 1370 1371 var ul = $(li.getElementsByTagName('ul')[0]); 1392 this.collapse_folder = function(name) 1393 { 1394 var li = this.get_folder_li(name, '', true), 1395 div = $('div:first', li), 1396 ul = $('ul:first', li); 1372 1397 1373 1398 if (div.hasClass('collapsed')) { 1374 1399 ul.show(); 1375 1400 div.removeClass('collapsed').addClass('expanded'); 1376 var reg = new RegExp('&'+urlencode( id)+'&');1401 var reg = new RegExp('&'+urlencode(name)+'&'); 1377 1402 this.env.collapsed_folders = this.env.collapsed_folders.replace(reg, ''); 1378 1403 } 1379 else {1404 else if (div.hasClass('expanded')) { 1380 1405 ul.hide(); 1381 1406 div.removeClass('expanded').addClass('collapsed'); 1382 this.env.collapsed_folders = this.env.collapsed_folders+'&'+urlencode( id)+'&';1407 this.env.collapsed_folders = this.env.collapsed_folders+'&'+urlencode(name)+'&'; 1383 1408 1384 1409 // select parent folder if one of its childs is currently selected 1385 if (this.env.mailbox.indexOf(id + this.env.delimiter) == 0) 1386 this.command('list', id); 1387 } 1410 if (this.env.mailbox.indexOf(name + this.env.delimiter) == 0) 1411 this.command('list', name); 1412 } 1413 else 1414 return; 1388 1415 1389 1416 // Work around a bug in IE6 and IE7, see #1485309 … … 1397 1424 1398 1425 this.command('save-pref', { name: 'collapsed_folders', value: this.env.collapsed_folders }); 1399 this.set_unread_count_display( id, false);1426 this.set_unread_count_display(name, false); 1400 1427 }; 1401 1428 … … 1990 2017 url += '&_refresh=1'; 1991 2018 1992 this.select_folder(mbox );2019 this.select_folder(mbox, '', true); 1993 2020 this.env.mailbox = mbox; 1994 2021 … … 3350 3377 this.remove_from_attachment_list = function(name) 3351 3378 { 3352 if (this.env.attachments[name]) 3353 delete this.env.attachments[name]; 3354 3355 if (!this.gui_objects.attachmentlist) 3356 return false; 3357 3358 var list = this.gui_objects.attachmentlist.getElementsByTagName("li"); 3359 for (i=0; i<list.length; i++) 3360 if (list[i].id == name) 3361 this.gui_objects.attachmentlist.removeChild(list[i]); 3379 delete this.env.attachments[name]; 3380 $('#'+name).remove(); 3362 3381 }; 3363 3382 … … 3696 3715 3697 3716 // display search results 3698 var ul, li, text, init,3717 var i, len, ul, li, text, init, 3699 3718 value = this.ksearch_value, 3700 3719 data = this.ksearch_data, … … 3727 3746 3728 3747 // add each result line to list 3729 if (results && results.length) {3730 for (i=0; i < results.length&& maxlen > 0; i++) {3748 if (results && (len = results.length)) { 3749 for (i=0; i < len && maxlen > 0; i++) { 3731 3750 text = typeof results[i] === 'object' ? results[i].name : results[i]; 3732 3751 li = document.createElement('LI'); … … 3749 3768 } 3750 3769 3751 if ( results && results.length)3770 if (len) 3752 3771 this.env.contacts = this.env.contacts.concat(results); 3753 3772 … … 4032 4051 this.delete_contacts = function() 4033 4052 { 4034 // exit if no mailbox specified or if selection is empty4035 4053 var selection = this.contact_list.get_selection(), 4036 4054 undelete = this.env.address_sources[this.env.source].undelete; 4037 4055 4056 // exit if no mailbox specified or if selection is empty 4038 4057 if (!(selection.length || this.env.cid) || (!undelete && !confirm(this.get_label('deletecontactconfirm')))) 4039 4058 return; … … 4076 4095 var c, row, list = this.contact_list; 4077 4096 4078 cid = String(cid).replace(this.identifier_expr, '_');4097 cid = this.html_identifier(cid); 4079 4098 4080 4099 // when in searching mode, concat cid with the source name … … 4092 4111 // cid change 4093 4112 if (newcid) { 4094 newcid = String(newcid).replace(this.identifier_expr, '_');4113 newcid = this.html_identifier(newcid); 4095 4114 row.id = 'rcmrow' + newcid; 4096 4115 list.remove_row(cid); … … 4111 4130 row = document.createElement('tr'); 4112 4131 4113 row.id = 'rcmrow'+ String(cid).replace(this.identifier_expr, '_');4132 row.id = 'rcmrow'+this.html_identifier(cid); 4114 4133 row.className = 'contact'; 4115 4134 … … 4293 4312 .click(function() { return rcmail.command('listgroup', prop, this); }) 4294 4313 .html(prop.name), 4295 li = $('<li>').attr({id: 'rcmli'+ key.replace(this.identifier_expr, '_'), 'class': 'contactgroup'})4314 li = $('<li>').attr({id: 'rcmli'+this.html_identifier(key), 'class': 'contactgroup'}) 4296 4315 .append(link); 4297 4316 … … 4316 4335 newprop = $.extend({}, prop);; 4317 4336 4318 li.id = String('rcmli'+newkey).replace(this.identifier_expr, '_');4337 li.id = 'rcmli' + this.html_identifier(newkey); 4319 4338 this.env.contactfolders[newkey] = this.env.contactfolders[key]; 4320 4339 this.env.contactfolders[newkey].id = prop.newid; … … 4348 4367 var row, name = prop.name.toUpperCase(), 4349 4368 sibling = this.get_folder_li(prop.source), 4350 prefix = 'rcmliG' +(prop.source).replace(this.identifier_expr, '_');4369 prefix = 'rcmliG' + this.html_identifier(prop.source); 4351 4370 4352 4371 // When renaming groups, we need to remove it from DOM and insert it in the proper place … … 4419 4438 4420 4439 this.init_edit_field(col, input); 4421 4440 4422 4441 if (colprop.type == 'date' && $.datepicker) 4423 4442 input.datepicker(); … … 4581 4600 .click(function() { return rcmail.command('listsearch', id, this); }) 4582 4601 .html(name), 4583 li = $('<li>').attr({id: 'rcmli' +key.replace(this.identifier_expr, '_'), 'class': 'contactsearch'})4602 li = $('<li>').attr({id: 'rcmli' + this.html_identifier(key), 'class': 'contactsearch'}) 4584 4603 .append(link), 4585 4604 prop = {name:name, id:id, li:li[0]}; … … 5152 5171 } 5153 5172 } 5173 5174 // set active task button 5175 this.set_button(this.task, 'sel'); 5154 5176 }; 5155 5177 … … 5157 5179 this.set_button = function(command, state) 5158 5180 { 5159 var button, obj, a_buttons = this.buttons[command]; 5160 5161 if (!a_buttons || !a_buttons.length) 5162 return false; 5163 5164 for (var n=0; n<a_buttons.length; n++) { 5181 var n, button, obj, a_buttons = this.buttons[command], 5182 len = a_buttons ? a_buttons.length : 0; 5183 5184 for (n=0; n<len; n++) { 5165 5185 button = a_buttons[n]; 5166 5186 obj = document.getElementById(button.id); … … 5197 5217 this.set_alttext = function(command, label) 5198 5218 { 5199 if (!this.buttons[command] || !this.buttons[command].length) 5200 return; 5201 5202 var button, obj, link; 5203 for (var n=0; n<this.buttons[command].length; n++) { 5204 button = this.buttons[command][n]; 5219 var n, button, obj, link, a_buttons = this.buttons[command], 5220 len = a_buttons ? a_buttons.length : 0; 5221 5222 for (n=0; n<len; n++) { 5223 button = a_buttons[n]; 5205 5224 obj = document.getElementById(button.id); 5206 5225 5207 if (button.type =='image' && obj) {5226 if (button.type == 'image' && obj) { 5208 5227 obj.setAttribute('alt', this.get_label(label)); 5209 5228 if ((link = obj.parentNode) && link.tagName.toLowerCase() == 'a') … … 5218 5237 this.button_over = function(command, id) 5219 5238 { 5220 var button, elm, a_buttons = this.buttons[command]; 5221 5222 if (!a_buttons || !a_buttons.length) 5223 return false; 5224 5225 for (var n=0; n<a_buttons.length; n++) { 5239 var n, button, obj, a_buttons = this.buttons[command], 5240 len = a_buttons ? a_buttons.length : 0; 5241 5242 for (n=0; n<len; n++) { 5226 5243 button = a_buttons[n]; 5227 5244 if (button.id == id && button.status == 'act') { 5228 elm= document.getElementById(button.id);5229 if ( elm&& button.over) {5245 obj = document.getElementById(button.id); 5246 if (obj && button.over) { 5230 5247 if (button.type == 'image') 5231 elm.src = button.over;5248 obj.src = button.over; 5232 5249 else 5233 elm.className = button.over;5250 obj.className = button.over; 5234 5251 } 5235 5252 } … … 5240 5257 this.button_sel = function(command, id) 5241 5258 { 5242 var button, elm, a_buttons = this.buttons[command]; 5243 5244 if (!a_buttons || !a_buttons.length) 5245 return; 5246 5247 for (var n=0; n<a_buttons.length; n++) { 5259 var n, button, obj, a_buttons = this.buttons[command], 5260 len = a_buttons ? a_buttons.length : 0; 5261 5262 for (n=0; n<len; n++) { 5248 5263 button = a_buttons[n]; 5249 5264 if (button.id == id && button.status == 'act') { 5250 elm= document.getElementById(button.id);5251 if ( elm&& button.sel) {5265 obj = document.getElementById(button.id); 5266 if (obj && button.sel) { 5252 5267 if (button.type == 'image') 5253 elm.src = button.sel;5268 obj.src = button.sel; 5254 5269 else 5255 elm.className = button.sel;5270 obj.className = button.sel; 5256 5271 } 5257 5272 this.buttons_sel[id] = command; … … 5263 5278 this.button_out = function(command, id) 5264 5279 { 5265 var button, elm, a_buttons = this.buttons[command]; 5266 5267 if (!a_buttons || !a_buttons.length) 5268 return; 5269 5270 for (var n=0; n<a_buttons.length; n++) { 5280 var n, button, obj, a_buttons = this.buttons[command], 5281 len = a_buttons ? a_buttons.length : 0; 5282 5283 for (n=0; n<len; n++) { 5271 5284 button = a_buttons[n]; 5272 5285 if (button.id == id && button.status == 'act') { 5273 elm= document.getElementById(button.id);5274 if ( elm&& button.act) {5286 obj = document.getElementById(button.id); 5287 if (obj && button.act) { 5275 5288 if (button.type == 'image') 5276 elm.src = button.act;5289 obj.src = button.act; 5277 5290 else 5278 elm.className = button.act; 5279 } 5280 } 5281 } 5282 }; 5283 5291 obj.className = button.act; 5292 } 5293 } 5294 } 5295 }; 5284 5296 5285 5297 this.focus_textfield = function(elem) … … 5316 5328 // save message in order to display after page loaded 5317 5329 if (type != 'loading') 5318 this.pending_message = new Array(msg, type, timeout);5330 this.pending_message = [msg, type, timeout]; 5319 5331 return false; 5320 5332 } … … 5323 5335 5324 5336 var ref = this, 5325 key = String(msg).replace(this.identifier_expr, '_'),5337 key = this.html_identifier(msg), 5326 5338 date = new Date(), 5327 5339 id = type + date.getTime(); … … 5416 5428 5417 5429 // mark a mailbox as selected and set environment variable 5418 this.select_folder = function(name, prefix )5430 this.select_folder = function(name, prefix, encode) 5419 5431 { 5420 5432 if (this.gui_objects.folderlist) { … … 5424 5436 current_li.removeClass('selected').addClass('unfocused'); 5425 5437 } 5426 if ((target_li = this.get_folder_li(name, prefix ))) {5438 if ((target_li = this.get_folder_li(name, prefix, encode))) { 5427 5439 $(target_li).removeClass('unfocused').addClass('selected'); 5428 5440 } … … 5434 5446 5435 5447 // helper method to find a folder list item 5436 this.get_folder_li = function(name, prefix )5448 this.get_folder_li = function(name, prefix, encode) 5437 5449 { 5438 5450 if (!prefix) … … 5440 5452 5441 5453 if (this.gui_objects.folderlist) { 5442 name = String(name).replace(this.identifier_expr, '_');5454 name = this.html_identifier(name, encode); 5443 5455 return document.getElementById(prefix+name); 5444 5456 } … … 5554 5566 var reg, link, text_obj, item, mycount, childcount, div; 5555 5567 5556 if (item = this.get_folder_li(mbox )) {5568 if (item = this.get_folder_li(mbox, '', true)) { 5557 5569 mycount = this.env.unread_counts[mbox] ? this.env.unread_counts[mbox] : 0; 5558 5570 link = $(item).children('a').eq(0); … … 5566 5578 div.className.match(/collapsed/)) { 5567 5579 // add children's counters 5568 for (var k in this.env.unread_counts) 5580 for (var k in this.env.unread_counts) 5569 5581 if (k.indexOf(mbox + this.env.delimiter) == 0) 5570 5582 childcount += this.env.unread_counts[k]; … … 5607 5619 this.toggle_prefer_html = function(checkbox) 5608 5620 { 5609 var elem; 5610 if (elem = document.getElementById('rcmfd_addrbook_show_images')) 5611 elem.disabled = !checkbox.checked; 5621 $('#rcmfd_show_images').prop('disabled', !checkbox.checked).val(0); 5612 5622 }; 5613 5623 5614 5624 this.toggle_preview_pane = function(checkbox) 5615 5625 { 5616 var elem; 5617 if (elem = document.getElementById('rcmfd_preview_pane_mark_read')) 5618 elem.disabled = !checkbox.checked; 5626 $('#rcmfd_preview_pane_mark_read').prop('disabled', !checkbox.checked); 5619 5627 }; 5620 5628 … … 5732 5740 $.ajax({ type: 'POST', url: url, data: htmlText, contentType: 'application/octet-stream', 5733 5741 error: function(o, status, err) { rcmail.http_error(o, status, err, lock); }, 5734 success: function(data) { rcmail.set_busy(false, null, lock); $( document.getElementById(id)).val(data); rcmail.log(data); }5742 success: function(data) { rcmail.set_busy(false, null, lock); $('#'+id).val(data); rcmail.log(data); } 5735 5743 }); 5736 5744 }; … … 5739 5747 { 5740 5748 var lock = this.set_busy(true, 'converting'); 5741 $( document.getElementById(id)).val(plainText ? '<pre>'+plainText+'</pre>' : '');5749 $('#'+id).val(plainText ? '<pre>'+plainText+'</pre>' : ''); 5742 5750 this.set_busy(false, null, lock); 5743 5751 }; -
branches/release-0.7/program/js/common.js
r5426 r5481 712 712 } 713 713 } 714 715 // This code was written by Tyler Akins and has been placed in the 716 // public domain. It would be nice if you left this header intact. 717 // Base64 code from Tyler Akins -- http://rumkin.com 718 var Base64 = (function () { 719 var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; 720 721 var obj = { 722 /** 723 * Encodes a string in base64 724 * @param {String} input The string to encode in base64. 725 */ 726 encode: function (input) { 727 if (typeof(window.btoa) === 'function') 728 return btoa(input); 729 730 var chr1, chr2, chr3, enc1, enc2, enc3, enc4, i = 0, output = '', len = input.length; 731 732 do { 733 chr1 = input.charCodeAt(i++); 734 chr2 = input.charCodeAt(i++); 735 chr3 = input.charCodeAt(i++); 736 737 enc1 = chr1 >> 2; 738 enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); 739 enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); 740 enc4 = chr3 & 63; 741 742 if (isNaN(chr2)) 743 enc3 = enc4 = 64; 744 else if (isNaN(chr3)) 745 enc4 = 64; 746 747 output = output 748 + keyStr.charAt(enc1) + keyStr.charAt(enc2) 749 + keyStr.charAt(enc3) + keyStr.charAt(enc4); 750 } while (i < len); 751 752 return output; 753 }, 754 755 /** 756 * Decodes a base64 string. 757 * @param {String} input The string to decode. 758 */ 759 decode: function (input) { 760 if (typeof(window.atob) === 'function') 761 return atob(input); 762 763 var chr1, chr2, chr3, enc1, enc2, enc3, enc4, len, i = 0, output = ''; 764 765 // remove all characters that are not A-Z, a-z, 0-9, +, /, or = 766 input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); 767 len = input.length; 768 769 do { 770 enc1 = keyStr.indexOf(input.charAt(i++)); 771 enc2 = keyStr.indexOf(input.charAt(i++)); 772 enc3 = keyStr.indexOf(input.charAt(i++)); 773 enc4 = keyStr.indexOf(input.charAt(i++)); 774 775 chr1 = (enc1 << 2) | (enc2 >> 4); 776 chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); 777 chr3 = ((enc3 & 3) << 6) | enc4; 778 779 output = output + String.fromCharCode(chr1); 780 781 if (enc3 != 64) 782 output = output + String.fromCharCode(chr2); 783 if (enc4 != 64) 784 output = output + String.fromCharCode(chr3); 785 } while (i < len); 786 787 return output; 788 } 789 }; 790 791 return obj; 792 })(); -
branches/release-0.7/program/steps/mail/get.inc
r5274 r5481 23 23 // show loading page 24 24 if (!empty($_GET['_preload'])) { 25 $url = str_replace('&_preload=1', '', $_SERVER['REQUEST_URI']);25 $url = preg_replace('/[&?]+_preload=1/', '', $_SERVER['REQUEST_URI']); 26 26 $message = rcube_label('loadingdata'); 27 27 -
branches/release-0.7/program/steps/settings/func.inc
r5415 r5481 438 438 if (!isset($no_override['show_images'])) { 439 439 $field_id = 'rcmfd_show_images'; 440 $input_show_images = new html_select(array('name' => '_show_images', 'id' => $field_id)); 440 $input_show_images = new html_select(array('name' => '_show_images', 'id' => $field_id, 441 'disabled' => !$config['prefer_html'])); 441 442 $input_show_images->add(rcube_label('never'), 0); 442 443 $input_show_images->add(rcube_label('fromknownsenders'), 1); … … 445 446 $blocks['main']['options']['show_images'] = array( 446 447 'title' => html::label($field_id, Q(rcube_label('showremoteimages'))), 447 'content' => $input_show_images->show($config[' show_images']),448 'content' => $input_show_images->show($config['prefer_html'] ? $config['show_images'] : 0), 448 449 ); 449 450 } -
branches/release-0.7/skins/default/common.css
r5434 r5481 6 6 margin: 8px; 7 7 background-color: #F6F6F6; 8 color: #000000; 8 color: #000; 9 font-size: 12px; 9 10 } 10 11 … … 20 21 } 21 22 22 body,td, th, div, p, select, input, textarea23 td, th, div, p, select, input, textarea 23 24 { 24 25 font-size: 12px; 26 font-family: inherit; 25 27 } 26 28 … … 37 39 a, a:active, a:visited 38 40 { 39 color: #000 000;41 color: #000; 40 42 outline: none; 41 43 } … … 43 45 a.button, a.button:visited, a.tab, a.tab:visited, a.axislist 44 46 { 45 color: #000 000;47 color: #000; 46 48 text-decoration: none; 47 49 } … … 57 59 { 58 60 height: 1px; 59 background-color: #666 666;61 background-color: #666; 60 62 border-style: none; 61 63 } … … 66 68 textarea 67 69 { 68 border: 1px solid #666 666;69 color: #333 333;70 background-color: # ffffff;70 border: 1px solid #666; 71 color: #333; 72 background-color: #FFF; 71 73 } 72 74 -
branches/release-0.7/tests/mailfunc.php
r5415 r5481 56 56 $this->assertNoPattern('/<form [^>]+>/', $html, "No form tags allowed"); 57 57 $this->assertPattern('/Subscription form/', $html, "Include <form> contents"); 58 $this->assertPattern('/<!-- input ignored -->/', $html, "No input elements allowed");59 58 $this->assertPattern('/<!-- link ignored -->/', $html, "No external links allowed"); 60 59 $this->assertPattern('/<a[^>]+ target="_blank">/', $html, "Set target to _blank");
Note: See TracChangeset
for help on using the changeset viewer.
