Changeset 284 in subversion
- Timestamp:
- Jul 30, 2006 6:14:19 AM (7 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 5 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/main.inc (modified) (5 diffs)
-
program/js/app.js (modified) (8 diffs)
-
program/steps/mail/func.inc (modified) (4 diffs)
-
skins/default/mail.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r282 r284 1 1 CHANGELOG RoundCube Webmail 2 2 --------------------------- 3 4 2006/07/30 (thomasb) 5 ---------- 6 - Alter links in HTML messages (Bug #1326402) 7 - Added fallback if host not found in 'mail_domain' array 8 - Applied patch of Charles to highlight droptargets (Ticket #1473034) 9 3 10 4 11 2006/07/25 (thomasb) -
trunk/roundcubemail/program/include/main.inc
r277 r284 542 542 if ($user_id = $DB->insert_id(get_sequence_name('users'))) 543 543 { 544 if (is_array($CONFIG['mail_domain']) && isset($CONFIG['mail_domain'][$host])) 545 $mail_domain = $CONFIG['mail_domain'][$host]; 544 $mail_domain = $host; 545 if (is_array($CONFIG['mail_domain'])) 546 { 547 if (isset($CONFIG['mail_domain'][$host])) 548 $mail_domain = $CONFIG['mail_domain'][$host]; 549 } 546 550 else if (!empty($CONFIG['mail_domain'])) 547 551 $mail_domain = $CONFIG['mail_domain']; 548 else549 $mail_domain = $host;550 552 551 553 if ($user_email=='') … … 1126 1128 1127 1129 1128 function rcube_xml_command($command, $str_attrib, $a _attrib=NULL)1130 function rcube_xml_command($command, $str_attrib, $add_attrib=array()) 1129 1131 { 1130 1132 global $IMAP, $CONFIG, $OUTPUT; 1131 1133 1132 $attrib = array();1133 1134 $command = strtolower($command); 1134 1135 preg_match_all('/\s*([-_a-z]+)=["]([^"]+)["]?/i', stripslashes($str_attrib), $regs, PREG_SET_ORDER); 1136 1137 // convert attributes to an associative array (name => value) 1138 if ($regs) 1139 foreach ($regs as $attr) 1140 $attrib[strtolower($attr[1])] = $attr[2]; 1141 else if ($a_attrib) 1142 $attrib = $a_attrib; 1135 $attrib = parse_attrib_string($str_attrib) + $add_attrib; 1143 1136 1144 1137 // execute command … … 1224 1217 'foldersubscription' => 'rcube_subscription_form', 1225 1218 'createfolder' => 'rcube_create_folder_form', 1226 'renamefolder' => 'rcube_rename_folder_form',1219 'renamefolder' => 'rcube_rename_folder_form', 1227 1220 'composebody' => 'rcmail_compose_body' 1228 1221 ); … … 1524 1517 1525 1518 1519 // compose a valid attribute string for HTML tags 1526 1520 function create_attrib_string($attrib, $allowed_attribs=array('id', 'class', 'style')) 1527 1521 { … … 1530 1524 foreach ($allowed_attribs as $a) 1531 1525 if (isset($attrib[$a])) 1532 $attrib_str .= sprintf(' %s="%s"', $a, $attrib[$a]);1526 $attrib_str .= sprintf(' %s="%s"', $a, str_replace('"', '"', $attrib[$a])); 1533 1527 1534 1528 return $attrib_str; 1535 1529 } 1536 1530 1531 1532 // convert a HTML attribute string attributes to an associative array (name => value) 1533 function parse_attrib_string($str) 1534 { 1535 $attrib = array(); 1536 preg_match_all('/\s*([-_a-z]+)=["]([^"]+)["]?/i', stripslashes($str), $regs, PREG_SET_ORDER); 1537 1538 // convert attributes to an associative array (name => value) 1539 if ($regs) 1540 foreach ($regs as $attr) 1541 $attrib[strtolower($attr[1])] = $attr[2]; 1542 1543 return $attrib; 1544 } 1537 1545 1538 1546 -
trunk/roundcubemail/program/js/app.js
r282 r284 288 288 e = window.event; 289 289 290 for (var n=0; n<this.selection.length; n++) { 290 for (var n=0; n<this.selection.length; n++) 291 { 291 292 id = this.selection[n]; 292 if (this.list_rows[id].obj) { 293 if (this.list_rows[id].obj) 294 { 293 295 this.set_classname(this.list_rows[id].obj, 'selected', true); 294 296 this.set_classname(this.list_rows[id].obj, 'unfocused', false); 295 } 296 } 297 297 } 298 } 299 300 var mbox_li; 301 if (mbox_li = this.get_mailbox_li()) 302 this.set_classname(mbox_li, 'unfocused', true); 303 298 304 this.in_message_list = true; 299 305 e.cancelBubble = true; … … 1184 1190 { 1185 1191 if (this.drag_active) 1192 { 1193 this.unfocus_mailbox(mbox); 1186 1194 this.command('moveto', mbox); 1195 } 1187 1196 else 1188 1197 this.command('list', mbox); 1189 1198 1190 1199 return false; 1191 1200 }; … … 1557 1566 add_url += '&_search='+this.env.search_request; 1558 1567 1559 if (this.env.mailbox!=mbox) 1560 this.select_mailbox(mbox); 1568 this.select_mailbox(mbox); 1561 1569 1562 1570 // load message list remotely … … 1668 1676 }; 1669 1677 1670 1678 this.focus_mailbox = function(mbox) 1679 { 1680 var mbox_li; 1681 if (this.drag_active && mbox != this.env.mailbox && (mbox_li = this.get_mailbox_li(mbox))) 1682 this.set_classname(mbox_li, 'droptarget', true); 1683 } 1684 1685 this.unfocus_mailbox = function(mbox) 1686 { 1687 var mbox_li; 1688 if (this.drag_active && (mbox_li = this.get_mailbox_li(mbox))) 1689 this.set_classname(mbox_li, 'droptarget', false); 1690 } 1691 1671 1692 // move selected messages to the specified mailbox 1672 1693 this.move_messages = function(mbox) … … 1931 1952 } 1932 1953 1954 1955 this.get_mailbox_li = function(mbox) 1956 { 1957 if (this.gui_objects.mailboxlist) 1958 { 1959 mbox = String((mbox ? mbox : this.env.mailbox)).toLowerCase().replace(this.mbox_expression, ''); 1960 return document.getElementById('rcmbx'+mbox); 1961 } 1962 1963 return null; 1964 }; 1965 1966 1933 1967 /*********************************************************/ 1934 1968 /********* message compose methods *********/ … … 2238 2272 //highlight.removeAttribute('class'); 2239 2273 this.set_classname(highlight, 'selected', false); 2240 this.set_classname(highlight, 'unfocused', false);2241 2274 } 2242 2275 … … 3153 3186 this.select_mailbox = function(mbox) 3154 3187 { 3155 if (this.gui_objects.mailboxlist) 3156 { 3157 var item, reg, text_obj; 3158 var s_current = this.env.mailbox.toLowerCase().replace(this.mbox_expression, ''); 3159 var s_mbox = String(mbox).toLowerCase().replace(this.mbox_expression, ''); 3160 var s_current = this.env.mailbox.toLowerCase().replace(this.mbox_expression, ''); 3161 3162 var current_li = document.getElementById('rcmbx'+s_current); 3163 var mbox_li = document.getElementById('rcmbx'+s_mbox); 3164 3165 if (current_li) { 3188 if (this.gui_objects.mailboxlist ) 3189 { 3190 var item, reg, text_obj; 3191 var current_li = this.get_mailbox_li(); 3192 var mbox_li = this.get_mailbox_li(mbox); 3193 3194 if (current_li) 3195 { 3166 3196 this.set_classname(current_li, 'selected', false); 3167 3197 this.set_classname(current_li, 'unfocused', false); 3168 3198 } 3169 if (mbox_li) 3199 3200 if (mbox_li || this.env.mailbox == mbox) 3201 { 3202 this.set_classname(mbox_li, 'unfocused', false); 3170 3203 this.set_classname(mbox_li, 'selected', true); 3204 } 3171 3205 } 3172 3206 … … 3285 3319 set_title = true; 3286 3320 3287 var item, reg, text_obj; 3321 var reg, text_obj; 3322 var item = this.get_mailbox_li(mbox); 3288 3323 mbox = String(mbox).toLowerCase().replace(this.mbox_expression, ''); 3289 item = document.getElementById('rcmbx'+mbox);3290 3324 3291 3325 if (item && item.className && item.className.indexOf('mailbox '+mbox)>=0) -
trunk/roundcubemail/program/steps/mail/func.inc
r282 r284 217 217 $out .= sprintf('<li id="rcmbx%s" class="mailbox %s %s%s%s"><a href="%s&_mbox=%s"'. 218 218 ' onclick="return %s.command(\'list\',\'%s\')"'. 219 ' onmouseover="return %s.focus_mailbox(\'%s\')"' . 220 ' onmouseout="return %s.unfocus_mailbox(\'%s\')"' . 219 221 ' onmouseup="return %s.mbox_mouse_up(\'%s\')"%s>%s</a>', 220 222 $folder_css, … … 225 227 $COMM_PATH, 226 228 urlencode($folder['id']), 229 $JS_OBJECT_NAME, 230 addslashes($folder['id']), 231 $JS_OBJECT_NAME, 232 addslashes($folder['id']), 227 233 $JS_OBJECT_NAME, 228 234 addslashes($folder['id']), … … 1171 1177 $body = preg_replace($base_reg, '', $body); 1172 1178 } 1179 1180 // modify HTML links to open a new window if clicked 1181 $body = preg_replace('/<a\s+([^>]+)>/Uie', "rcmail_alter_html_link('\\1');", $body); 1173 1182 1174 1183 // add comments arround html and other tags 1175 1184 $out = preg_replace(array('/(<\/?html[^>]*>)/i', 1176 1185 '/(<\/?head[^>]*>)/i', 1177 '/(<title[^>]*>. +<\/title>)/ui',1186 '/(<title[^>]*>.*<\/title>)/Ui', 1178 1187 '/(<\/?meta[^>]*>)/i'), 1179 1188 '<!--\\1-->', … … 1185 1194 '</div>'), 1186 1195 $out); 1187 1188 1196 1189 1197 return $out; 1190 1198 } 1191 1199 1200 1201 // parse link attributes and set correct target 1202 function rcmail_alter_html_link($in) 1203 { 1204 $attrib = parse_attrib_string($in); 1205 1206 if (stristr((string)$attrib['href'], 'mailto:')) 1207 $attrib['onclick'] = sprintf("return %s.command('compose','%s',this)", 1208 $GLOBALS['JS_OBJECT_NAME'], 1209 substr($attrib['href'], 7)); 1210 else if (!empty($attrib['href']) && $attrib['href']{0}!='#') 1211 $attrib['target'] = '_blank'; 1212 1213 return '<a' . create_attrib_string($attrib, array('href', 'name', 'target', 'onclick', 'id', 'class', 'style', 'title')) . '>'; 1214 } 1192 1215 1193 1216 -
trunk/roundcubemail/skins/default/mail.css
r280 r284 277 277 } 278 278 279 #mailboxlist li.droptarget 280 { 281 background-color: #FFFFA6; 282 } 279 283 280 284 /* styles for nested folders */
Note: See TracChangeset
for help on using the changeset viewer.
