From dfb923f34e71075ad06588ae4fabb3c51366e469 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 11 Aug 2011 20:35:20 +0200 Subject: [PATCH] automatically set background images to png when needed --- core/js/js.js | 16 ++++++++++++++++ files/templates/index.php | 4 ++-- files/templates/part.list.php | 4 ++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/core/js/js.js b/core/js/js.js index dd3f3b2ac3..30cf01d0b2 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -202,6 +202,22 @@ $(document).ready(function(){ var src=element.attr('src'); element.attr('src',src.substr(0,src.length-3)+'png'); }); + $('.svg').each(function(index,element){ + element=$(element); + var background=element.css('background-image'); + if(background && background!='none'){ + background=background.substr(0,background.length-4)+'png)'; + element.css('background-image',background); + } + element.find('*').each(function(index,element) { + element=$(element); + var background=element.css('background-image'); + if(background && background!='none'){ + background=background.substr(0,background.length-4)+'png)'; + element.css('background-image',background); + } + }); + }); }; $('form.searchbox').submit(function(event){ event.preventDefault(); diff --git a/files/templates/index.php b/files/templates/index.php index 3951787a25..083322174e 100644 --- a/files/templates/index.php +++ b/files/templates/index.php @@ -5,14 +5,14 @@ -
+
- +
diff --git a/files/templates/part.list.php b/files/templates/part.list.php index 34d727dde2..942f749c82 100644 --- a/files/templates/part.list.php +++ b/files/templates/part.list.php @@ -7,9 +7,9 @@ $relative_date_color = round((time()-$file['mtime'])/60/60/24*14); // the older the file, the brighter the shade of grey; days*14 if($relative_date_color>200) $relative_date_color = 200; ?> '> - + - +