Changeset 280 for albumembed

Show
Ignore:
Timestamp:
06.04.2007 14:59:13 (21 months ago)
Author:
m
Message:

IE6 Layout fixes.

Location:
albumembed
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • albumembed/AlbumEmbed.php

    r269 r280  
    5151            'lifeTime' => 86400, 
    5252            'automaticSerialization' => true, 
     53            'errorHandlingAPIBreak' => true, 
    5354        ); 
    5455 
     
    9798        { 
    9899            $this->rss_url = $rss_url; 
    99             if (empty(self::$location)) self::$location = basename(__FILE__); 
     100            if (empty(self::$location)) self::$location = ((isset($_SERVER['HTTPS']) and strtolower($_SERVER['HTTPS']) == 'on') ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/' . basename(__FILE__); 
    100101        } 
    101102 
     
    134135                } 
    135136            } 
    136  
    137             $Cache->save($images, $this->rss_url, 'images'); 
    138137            if (empty($images)) throw new AlbumEmbed_Exception('No images found.'); 
     138            $result = $Cache->save($images, $this->rss_url, 'images'); 
     139            if ($result !== true) { 
     140                throw new AlbumEmbed_Exception('Cache error: ' . $result->getMessage()); 
     141            } 
    139142            return $images; 
    140143        } 
     
    174177                $return = ''; 
    175178                if ($static) $return = '<div class="' . $class. '" id="' . $id . '">'; 
    176                 $return .= '    <dl class="' . $image['orientation'] . '">' 
    177                 . '        <dt>'; 
    178                 $return .= '    <span class="prev" id="' . $this->getId(self::ID_PREV) . '">'; 
     179                $return .= '<div class="box ' . $image['orientation'] . '"><ul><li class="prev" id="' . $this->getId(self::ID_PREV) . '">'; 
    179180                if ($current_item > 0) { 
    180181                    $return .= ($static) ? '<a href="' . $req . ($current_item - 1) . '#' . $id . '">' : ''; 
     
    182183                    $return .= ($static) ? '</a>' : ''; 
    183184                } 
    184                 $return .= '</span>'; 
    185                 $return .= '<a href="' . $image['link'] . '">' . (($image['img_html']) ? $image['img_html'] : 'No image.') . '</a>'; 
    186                 $return .= '    <span class="next" id="' . $this->getId(self::ID_NEXT) . '">'; 
     185                $return .= '</li>' 
     186                . '<li class="foto"><a href="' . $image['link'] . '">' . (($image['img_html']) ? $image['img_html'] : 'No image.') . '</a></li>' 
     187                . '<li class="next" id="' . $this->getId(self::ID_NEXT) . '">'; 
    187188                if ($current_item < $n_items - 1) { 
    188189                    $return .= ($static) ? '<a href="' . $req . ($current_item + 1) . '#' . $id . '">' : ''; 
     
    190191                    $return .= ($static) ? '</a>' : ''; 
    191192                } 
    192                 $return .= '</span>'; 
    193                 $return .= '</dt>' 
    194                 . '        <dd>' . (($image['title']) ? htmlspecialchars($image['title']) : '&nbsp;') . '</dd>' 
    195                 . '    </dl>'; 
    196                 $return .= '    <p class="info">' . ($current_item + 1) . ' / ' . $n_items . '</p>'; 
    197                 if ($static) $return .= '</div>'; 
    198                  
     193                $return .= '</li></ul>' 
     194                . '<p class="caption">' . (($image['title']) ? htmlspecialchars($image['title']) : '&nbsp;') . '</p><p class="info">' . ($current_item + 1) . ' / ' . $n_items . '</p>' 
     195                . '</div>'; 
     196                if ($static) $return .= "</div>\n"; 
    199197                return $return; 
    200198            } catch (AlbumEmbed_Exception $E) { 
     
    234232                $return = '<script type="text/javascript"><!--//--><![CDATA[//><!--' . "\n" 
    235233                . 'function ' . $this->getId(self::ID_RESPONSE) . " (originalRequest) {" 
    236                 . "    try {" 
    237                 . "        eval(originalRequest.responseText);" 
    238                 . "    } catch(e) {" 
    239                 . '        $(\'' . $this->getId() . "').innerHTML = originalRequest.responseText;" 
    240                 . "    };" 
     234                . '    $(\'' . $this->getId() . "').innerHTML = originalRequest.responseText;" 
    241235                . "    if (\$('". $this->getId(self::ID_NEXT) . "')) { \$('". $this->getId(self::ID_NEXT) . "').onclick = function () {" 
    242236                . $this->getActionJs('+') 
     
    273267        protected function getActionJs($item = 0) 
    274268        { 
    275             return "eval('var request= { albumembed__rss_url: \'" . $this->rss_url . "\',albumembed__item: \'" . $item . "\',albumembed__location: \'" . self::$location . "\'}');" 
     269            return "var request= { albumembed__rss_url: '" . $this->rss_url . "',albumembed__item: '" . $item . "',albumembed__location: '" . self::$location . "'}; " 
    276270            . "var query = \$H(request);" 
    277271            . "var GridRequest = new Ajax.Request(" 
     
    280274            . "        method: 'get'," 
    281275            . "        parameters: query.toQueryString()," 
     276            . "        onFailure: function() { alert(msg); }," 
    282277            . "        onComplete: function(originalResponse){" . $this->getId(self::ID_RESPONSE) . "(originalResponse);}" 
    283278            . "    }" 
  • albumembed/example.php

    r146 r280  
    4343        a { color: #ff0033; } 
    4444        /* The AlbumEmbed code is plain. You may easily apply your own styles. */ 
    45         div.picasaembed { float: right; margin: 0 0 10px 10px; text-align: center; border: 1px solid #aaa; } 
    46         div.picasaembed dl { margin: 12px 12px 0 12px; } 
    47         div.picasaembed dd { margin: 0; font-style: italic; } 
    48         div.picasaembed img { border: 1px solid #666666; width: 288px; background-color: #000; } 
    49         div.picasaembed p { margin: 0 0 12px 0; } 
    50         div.picasaembed span.prev, div.picasaembed span.next { color: #ff0033; text-decoration: underline; cursor: pointer; } 
    51         div.picasaembed span { display: block; width: 33%; float: left; height: 24px; } 
     45        div.albumembed { float: right; clear: right; margin: 0 0 10px 10px; text-align: center; border: 1px solid #aaa; } 
     46        div.albumembed div.box { margin: 12px 0 0 0; } 
     47        div.albumembed img { border: 1px solid #666666; background-color: #000; padding: 0; margin: 0; } 
     48        div.albumembed p { margin: 0 0 12px 0; clear: both; } 
     49        div.albumembed p.caption { margin: 12px 12px 0 12px; font-style: italic; clear: both; } 
     50        div.albumembed ul { list-style: none; margin: 0; padding: 0; } 
     51        div.albumembed li { margin: 0; padding: 0; float: left; } 
     52        div.albumembed li.prev, div.albumembed li.next { color: #A00000; cursor: pointer; font-weight: bold; width: 12px; margin: 0; padding: 0;  } 
     53        div.albumembed li.prev:hover, div.albumembed li.next:hover { background-color: #f0f0f0; } 
     54        div.albumembed-gallery2 div.portrait { width: 214px; } 
     55        div.albumembed-gallery2 div.portrait li.prev { height: 252px; line-height: 252px; } 
     56        div.albumembed-gallery2 div.portrait li.next { height: 252px; line-height: 252px; } 
     57        div.albumembed-gallery2 div.portrait img { width: 188px; height: 250px; } 
     58        div.albumembed-gallery2 div.landscape { width: 276px; } 
     59        div.albumembed-gallery2 div.landscape li.prev { height: 190px; line-height: 190px; } 
     60        div.albumembed-gallery2 div.landscape li.next { height: 190px; line-height: 190px; } 
     61        div.albumembed-gallery2 div.landscape img { width: 250px; height: 188px; } 
     62        div.albumembed-picasa div.portrait { width: 214px; } 
     63        div.albumembed-picasa div.portrait li.prev { height: 252px; line-height: 252px; } 
     64        div.albumembed-picasa div.portrait li.next { height: 252px; line-height: 252px; } 
     65        div.albumembed-picasa div.portrait img { width: 188px; height: 250px; } 
     66        div.albumembed-picasa div.landscape { width: 314px; } 
     67        div.albumembed-picasa div.landscape li.prev { height: 218px; line-height: 218px; } 
     68        div.albumembed-picasa div.landscape li.next { height: 218px; line-height: 218px; } 
     69        div.albumembed-picasa div.landscape img { width: 288px; height: 216px; } 
    5270    '); 
    5371