]> source.dussan.org Git - nextcloud-server.git/commitdiff
automatically replace svg images with png for browsers that dont support svg
authorRobin Appelman <icewind1991@gmail.com>
Fri, 29 Jul 2011 14:52:09 +0000 (16:52 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Fri, 29 Jul 2011 15:51:38 +0000 (17:51 +0200)
core/js/js.js
core/templates/layout.admin.php
core/templates/layout.user.php
files/templates/index.php

index 407c5708701d6df859747f1bd711ed4ec06963b3..db96a1adb3e4d34994b8c2858013099f9a0c1799 100644 (file)
@@ -103,3 +103,13 @@ if (!Array.prototype.indexOf){
 function SVGSupport() {
        return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") || document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Shape", "1.0");
 }
+
+$(document).ready(function(){
+       if(!SVGSupport()){//replace all svg images with png images for browser that dont support svg
+               $('img.svg').each(function(index,element){
+                       element=$(element);
+                       var src=element.attr('src');
+                       element.attr('src',src.substr(0,src.length-3)+'png');
+               });
+       };
+});
index 78ccf877221f6923007ce73d0263e7f7aace6bc9..8077fd304f34378a3341caa048174dcba1358f40 100644 (file)
@@ -30,8 +30,8 @@
                <div id="header">
                        <a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img src="<?php echo image_path('', 'owncloud-logo-small-white.png'); ?>" alt="ownCloud" /></a>
                        <ul id="metanav">
-                               <li><a href="<?php echo link_to('', 'index.php'); ?>" title="Back to files"><img src="<?php echo image_path('', 'actions/back.svg'); ?>"></a></li>
-                               <li><a href="<?php echo link_to('', 'index.php?logout=true'); ?>" title="Log out"><img src="<?php echo image_path('', 'actions/logout.svg'); ?>"></a></li>
+                               <li><a href="<?php echo link_to('', 'index.php'); ?>" title="Back to files"><img class='svg' src="<?php echo image_path('', 'actions/back.svg'); ?>"></a></li>
+                               <li><a href="<?php echo link_to('', 'index.php?logout=true'); ?>" title="Log out"><img class='svg' src="<?php echo image_path('', 'actions/logout.svg'); ?>"></a></li>
                        </ul>
                </div>
 
index f8beb79e81e23bb27dae66a0d226d9e155a159d2..a100eed96b15eabd90a692eb52b8419ff958fb17 100644 (file)
@@ -31,8 +31,8 @@
                        <a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img src="<?php echo image_path('', 'owncloud-logo-small-white.png'); ?>" alt="ownCloud" /></a>
                        <?php echo $_['searchbox']?>
                        <ul id="metanav">
-                               <li><a href="<?php echo link_to('settings', 'index.php'); ?>" title="Settings"><img src="<?php echo image_path('', 'actions/settings.svg'); ?>"></a></li>
-                               <li><a href="<?php echo link_to('', 'index.php'); ?>?logout=true" title="Log out"><img src="<?php echo image_path('', 'actions/logout.svg'); ?>"></a></li>
+                               <li><a href="<?php echo link_to('settings', 'index.php'); ?>" title="Settings"><img class='svg' src="<?php echo image_path('', 'actions/settings.svg'); ?>"></a></li>
+                               <li><a href="<?php echo link_to('', 'index.php'); ?>?logout=true" title="Log out"><img class='svg' src="<?php echo image_path('', 'actions/logout.svg'); ?>"></a></li>
                        </ul>
                </div>
 
index 9bc939ee90a84804087bf04cbfcafc1ade807423..df78cf0bb2d5dd3277c0e453e1d42e193fcf308b 100644 (file)
                                <input type="checkbox" id="select_all" />
                                <span class='name'><?php echo $l->t( 'Name' ); ?></span>
                                <span class='selectedActions'>
-                                       <a href="" title="Download" class="download"><img alt="Download" src="../core/img/actions/download.svg" /></a>
+                                       <a href="" title="Download" class="download"><img class='svg' alt="Download" src="../core/img/actions/download.svg" /></a>
                                        <!--<a href="" title="" class="share">Share</a>-->
                                </span>
                        </th>
                        <th id='headerSize'><?php echo $l->t( 'Size MB' ); ?></th>
-                       <th id='headerDate'><span id="modified"><?php echo $l->t( 'Modified' ); ?></span><span class='selectedActions'><a href="" title="Delete" class="delete"><img alt="Delete" src="../core/img/actions/delete.svg" /></a></span></th>
+                       <th id='headerDate'><span id="modified"><?php echo $l->t( 'Modified' ); ?></span><span class='selectedActions'><a href="" title="Delete" class="delete"><img class='svg' alt="Delete" src="../core/img/actions/delete.svg" /></a></span></th>
                </tr>
        </thead>
        <tbody id="fileList">