automatically set background images to png when needed

This commit is contained in:
Robin Appelman 2011-08-11 20:35:20 +02:00
parent 8aac43c12b
commit dfb923f34e
3 changed files with 20 additions and 4 deletions

View File

@ -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();

View File

@ -5,14 +5,14 @@
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload">
<input type="hidden" class="max_human_file_size" value="(max <?php echo $_['uploadMaxHumanFilesize']; ?>)">
<input type="hidden" name="dir" value="<?php echo $_['dir'] ?>" id="dir">
<div class="file_upload_wrapper">
<div class="file_upload_wrapper" class="svg">
<input type="submit" class="file_upload_filename" value="<?php echo $l->t('Upload');?> (max. <?php echo $_['uploadMaxHumanFilesize'];?>)"/>
<input class="file_upload_start" type="file" name='files[]'/>
</div>
<iframe name="file_upload_target_1" class='file_upload_target' src=""></iframe>
</form>
<form id="file_newfolder_form">
<input type="text" name="file_newfolder_name" id="file_newfolder_name" value="" placeholder="<?php echo $l->t('New Folder')?>" />
<input class="svg" type="text" name="file_newfolder_name" id="file_newfolder_name" value="" placeholder="<?php echo $l->t('New Folder')?>" />
</form>
</div>
<div id="file_action_panel">

View File

@ -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; ?>
<tr data-file="<?php echo $file['name'];?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mime']?>" data-size='<?php echo $file['size'];?>'>
<td class="filename" style="background-image:url(<?php if($file['type'] == 'dir') echo mimetype_icon('dir'); else echo mimetype_icon($file['mime']); ?>)">
<td class="filename svg" style="background-image:url(<?php if($file['type'] == 'dir') echo mimetype_icon('dir'); else echo mimetype_icon($file['mime']); ?>)">
<input type="checkbox" />
<a class="name svg" href="<?php if($file['type'] == 'dir') echo link_to('files', 'index.php?dir='.$file['directory'].'/'.$file['name']); else echo link_to('files', 'download.php?file='.$file['directory'].'/'.$file['name']); ?>" title="">
<a class="name" href="<?php if($file['type'] == 'dir') echo link_to('files', 'index.php?dir='.$file['directory'].'/'.$file['name']); else echo link_to('files', 'download.php?file='.$file['directory'].'/'.$file['name']); ?>" title="">
<span class="nametext">
<?php if($file['type'] == 'dir'):?>
<?php echo htmlspecialchars($file['name']);?>