From: Michael M Slusarz Date: Thu, 25 Jun 2009 17:59:49 +0000 (-0600) Subject: Fix/improve popup image handling X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=2c933722376cb28a4ad22dd2702251de261411be;p=horde.git Fix/improve popup image handling --- diff --git a/imp/lib/Mime/Viewer/Images.php b/imp/lib/Mime/Viewer/Images.php index 18993d294..31cefcd37 100644 --- a/imp/lib/Mime/Viewer/Images.php +++ b/imp/lib/Mime/Viewer/Images.php @@ -60,9 +60,12 @@ class IMP_Horde_Mime_Viewer_Images extends Horde_Mime_Viewer_Images /* The browser can display the image type directly - output the JS * code to render the auto resize popup image window. */ return $this->_popupImageWindow(); - } - return parent::_render(); + default: + return $GLOBALS['browser']->getFeature('dom') + ? $this->_popupImageWindow() + : parent::_render(); + } } /** @@ -163,6 +166,7 @@ class IMP_Horde_Mime_Viewer_Images extends Horde_Mime_Viewer_Images */ protected function _popupImageWindow() { + $loading = _("Loading..."); $self_url = Horde_Util::addParameter(IMP::selfUrl(), array('imp_img_view' => ((Horde_Util::getFormData('imp_img_view') == 'load_convert') ? 'view_convert' : 'data'))); $title = $this->_mimepart->getName(true); @@ -171,17 +175,9 @@ class IMP_Horde_Mime_Viewer_Images extends Horde_Mime_Viewer_Images $title -EOD; - - /* Only use javascript if we are using a DOM capable browser. */ - if ($GLOBALS['browser']->getFeature('dom')) { - /* Javascript display. */ - $loading = _("Loading..."); - $str .= << function resizeWindow() { - var h, img = document.getElementById('disp_image'), w; document.getElementById('splash').style.display = 'none'; img.style.display = 'block'; @@ -194,17 +190,6 @@ function resizeWindow() $loading EOD; - } else { - /* Non-javascript display. */ - $img_txt = _("Image"); - $str .= << - -$img_txt - - -EOD; - } return array( $this->_mimepart->getMimeId() => array(