Add Flash support detection

pull/11/merge^2
Aleksander Machniak 13 years ago
parent 7c1231a94b
commit b9854b8cbe

@ -1,7 +1,7 @@
CHANGELOG Roundcube Webmail CHANGELOG Roundcube Webmail
=========================== ===========================
- Don't display PDF and TIFF attachments inline without browser support (#1488452, #1487929) - Don't display Pdf/Tiff/Flash attachments inline without browser support (#1488452, #1487929)
- Fix html2text conversion of strong|b|a|th|h tags when used in upper case - Fix html2text conversion of strong|b|a|th|h tags when used in upper case
- Add listcontrols template container in Larry skin (#1488498) - Add listcontrols template container in Larry skin (#1488498)
- Fix host autoselection when default_host is an array (#1488495) - Fix host autoselection when default_host is an array (#1488495)

@ -6384,6 +6384,9 @@ function rcube_webmail()
if (this.env.browser_capabilities.pdf === undefined) if (this.env.browser_capabilities.pdf === undefined)
this.env.browser_capabilities.pdf = this.pdf_support_check(); this.env.browser_capabilities.pdf = this.pdf_support_check();
if (this.env.browser_capabilities.flash === undefined)
this.env.browser_capabilities.flash = this.flash_support_check();
if (this.env.browser_capabilities.tif === undefined) if (this.env.browser_capabilities.tif === undefined)
this.tif_support_check(); this.tif_support_check();
}; };
@ -6447,6 +6450,24 @@ function rcube_webmail()
return 0; return 0;
}; };
this.flash_support_check = function()
{
var plugin = navigator.mimeTypes ? navigator.mimeTypes["application/x-shockwave-flash"] : {};
if (plugin && plugin.enabledPlugin)
return 1;
if (window.ActiveXObject) {
try {
if (axObj = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))
return 1;
}
catch (e) {}
}
return 0;
};
} // end object rcube_webmail } // end object rcube_webmail

@ -69,6 +69,9 @@ if ($uid = get_input_value('_uid', RCUBE_INPUT_GET)) {
if (empty($_SESSION['browser_caps']['pdf']) && ($key = array_search('application/pdf', $mimetypes)) !== false) { if (empty($_SESSION['browser_caps']['pdf']) && ($key = array_search('application/pdf', $mimetypes)) !== false) {
unset($mimetypes[$key]); unset($mimetypes[$key]);
} }
if (empty($_SESSION['browser_caps']['flash']) && ($key = array_search('application/x-shockwave-flash', $mimetypes)) !== false) {
unset($mimetypes[$key]);
}
// @TODO: we could convert TIFF to JPEG and display it // @TODO: we could convert TIFF to JPEG and display it
if (empty($_SESSION['browser_caps']['tif']) && ($key = array_search('image/tiff', $mimetypes)) !== false) { if (empty($_SESSION['browser_caps']['tif']) && ($key = array_search('image/tiff', $mimetypes)) !== false) {
unset($mimetypes[$key]); unset($mimetypes[$key]);

Loading…
Cancel
Save