Changeset e349a8c in github
- Timestamp:
- May 28, 2012 8:17:57 AM (12 months ago)
- Branches:
- master, HEAD, dev-browser-capabilities, pdo
- Children:
- 7c1231a
- Parents:
- 2d7b4ff
- Location:
- program
- Files:
-
- 1 added
- 3 edited
-
blank.tif (added)
-
js/app.js (modified) (4 diffs)
-
steps/mail/func.inc (modified) (2 diffs)
-
steps/mail/show.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
program/js/app.js
r041c93c re349a8c 307 307 this.http_post(postact, postdata); 308 308 } 309 310 // detect browser capabilities 311 if (!this.is_framed()) 312 this.browser_capabilities_check(); 309 313 310 314 break; … … 1944 1948 url += '&_search='+this.env.search_request; 1945 1949 1946 if (action == 'preview' && String(target.location.href).indexOf(url) >= 0) 1950 // add browser capabilities, so we can properly handle attachments 1951 url += '&_caps='+urlencode(this.browser_capabilities()); 1952 1953 if (preview && String(target.location.href).indexOf(url) >= 0) 1947 1954 this.show_contentframe(true); 1948 1955 else { … … 1950 1957 1951 1958 // mark as read and change mbox unread counter 1952 if ( action == 'preview'&& this.message_list && this.message_list.rows[id] && this.message_list.rows[id].unread && this.env.preview_pane_mark_read >= 0) {1959 if (preview && this.message_list && this.message_list.rows[id] && this.message_list.rows[id].unread && this.env.preview_pane_mark_read >= 0) { 1953 1960 this.preview_read_timer = setTimeout(function() { 1954 1961 ref.set_message(id, 'unread', false); … … 6369 6376 }; 6370 6377 6378 // Checks browser capabilities eg. PDF support, TIF support 6379 this.browser_capabilities_check = function() 6380 { 6381 if (!this.env.browser_capabilities) 6382 this.env.browser_capabilities = {}; 6383 6384 if (this.env.browser_capabilities.pdf === undefined) 6385 this.env.browser_capabilities.pdf = this.pdf_support_check(); 6386 6387 if (this.env.browser_capabilities.tif === undefined) 6388 this.tif_support_check(); 6389 }; 6390 6391 // Returns browser capabilities string 6392 this.browser_capabilities = function() 6393 { 6394 if (!this.env.browser_capabilities) 6395 return ''; 6396 6397 var n, ret = []; 6398 6399 for (n in this.env.browser_capabilities) 6400 ret.push(n + '=' + this.env.browser_capabilities[n]); 6401 6402 return ret.join(); 6403 }; 6404 6405 this.tif_support_check = function() 6406 { 6407 var img = new Image(); 6408 6409 img.onload = function() { rcmail.env.browser_capabilities.tif = 1; }; 6410 img.onerror = function() { rcmail.env.browser_capabilities.tif = 0; }; 6411 img.src = 'program/blank.tif'; 6412 }; 6413 6414 this.pdf_support_check = function() 6415 { 6416 var plugin = navigator.mimeTypes ? navigator.mimeTypes["application/pdf"] : {}, 6417 plugins = navigator.plugins, 6418 len = plugins.length, 6419 regex = /Adobe Reader|PDF|Acrobat/i; 6420 6421 if (plugin && plugin.enabledPlugin) 6422 return 1; 6423 6424 if (window.ActiveXObject) { 6425 try { 6426 if (axObj = new ActiveXObject("AcroPDF.PDF")) 6427 return 1; 6428 } 6429 catch (e) {} 6430 try { 6431 if (axObj = new ActiveXObject("PDF.PdfCtrl")) 6432 return 1; 6433 } 6434 catch (e) {} 6435 } 6436 6437 for (i=0; i<len; i++) { 6438 plugin = plugins[i]; 6439 if (typeof plugin === 'String') { 6440 if (regex.test(plugin)) 6441 return 1; 6442 } 6443 else if (plugin.name && regex.test(plugin.name)) 6444 return 1; 6445 } 6446 6447 return 0; 6448 }; 6449 6371 6450 } // end object rcube_webmail 6372 6451 -
program/steps/mail/func.inc
r041c93c re349a8c 82 82 } 83 83 84 $search_mods = $RCMAIL->config->get('search_mods', $SEARCH_MODS_DEFAULT);85 $OUTPUT->set_env('search_mods', $search_mods);84 $search_mods = $RCMAIL->config->get('search_mods', $SEARCH_MODS_DEFAULT); 85 $OUTPUT->set_env('search_mods', $search_mods); 86 86 } 87 87 … … 115 115 if ($CONFIG['junk_mbox']) 116 116 $OUTPUT->set_env('junk_mailbox', $CONFIG['junk_mbox']); 117 118 if (!empty($_SESSION['browser_caps'])) 119 $OUTPUT->set_env('browser_capabilities', $_SESSION['browser_caps']); 117 120 118 121 if (!$OUTPUT->ajax_call) -
program/steps/mail/show.inc
r041c93c re349a8c 21 21 22 22 $PRINT_MODE = $RCMAIL->action=='print' ? TRUE : FALSE; 23 24 // Read browser capabilities and store them in session 25 if ($caps = get_input_value('_caps', RCUBE_INPUT_GET)) { 26 $browser_caps = array(); 27 foreach (explode(',', $caps) as $cap) { 28 $cap = explode('=', $cap); 29 $browser_caps[$cap[0]] = $cap[1]; 30 } 31 $_SESSION['browser_caps'] = $browser_caps; 32 } 23 33 24 34 // similar code as in program/steps/mail/get.inc
Note: See TracChangeset
for help on using the changeset viewer.
