diff options
author | Jakob Sack <kde@jakobsack.de> | 2011-04-18 11:49:23 +0200 |
---|---|---|
committer | Jakob Sack <kde@jakobsack.de> | 2011-04-18 11:49:23 +0200 |
commit | dd0eb9dd8dbc0d0eff559775d346b5fe04705554 (patch) | |
tree | 3b0ee44ee8fab49179dd0d038c709d888b5eb257 /files | |
parent | f22c05deab263129c7d278d5e4d097cd9ec5573a (diff) | |
parent | b4a74f895efdcc949731abf70c44580461c5c864 (diff) | |
download | nextcloud-server-dd0eb9dd8dbc0d0eff559775d346b5fe04705554.tar.gz nextcloud-server-dd0eb9dd8dbc0d0eff559775d346b5fe04705554.zip |
Merge branch 'refactoring' of git://anongit.kde.org/owncloud into refactoring
Diffstat (limited to 'files')
-rw-r--r-- | files/appinfo/app.php | 2 | ||||
-rw-r--r-- | files/img/file.png | bin | 0 -> 391 bytes | |||
-rw-r--r-- | files/img/folder.png | bin | 436 -> 386 bytes | |||
-rw-r--r-- | files/img/home.png | bin | 0 -> 416 bytes | |||
-rw-r--r-- | files/img/navicon.png | bin | 397 -> 0 bytes | |||
-rw-r--r-- | files/index.php | 3 | ||||
-rw-r--r-- | files/js/files.js | 39 | ||||
-rw-r--r-- | files/templates/index.php | 2 | ||||
-rw-r--r-- | files/templates/part.breadcrumb.php | 2 | ||||
-rw-r--r-- | files/templates/part.list.php | 4 |
10 files changed, 39 insertions, 13 deletions
diff --git a/files/appinfo/app.php b/files/appinfo/app.php index c542f47b24f..bf67812cf38 100644 --- a/files/appinfo/app.php +++ b/files/appinfo/app.php @@ -2,7 +2,7 @@ OC_APP::register( array( "order" => 2, "id" => "files", "name" => "Files" )); -OC_APP::addNavigationEntry( array( "id" => "files_index", "order" => 1, "href" => OC_HELPER::linkTo( "files", "index.php" ), "icon" => OC_HELPER::imagePath( "files", "navicon.png" ), "name" => "Files" )); +OC_APP::addNavigationEntry( array( "id" => "files_index", "order" => 1, "href" => OC_HELPER::linkTo( "files", "index.php" ), "icon" => OC_HELPER::imagePath( "files", "home.png" ), "name" => "Files" )); OC_APP::addSettingsPage( array( "id" => "files_administration", "order" => 1, "href" => OC_HELPER::linkTo( "files", "admin.php" ), "name" => "Files", "icon" => OC_HELPER::imagePath( "files", "folder.png" ))); diff --git a/files/img/file.png b/files/img/file.png Binary files differnew file mode 100644 index 00000000000..49790448897 --- /dev/null +++ b/files/img/file.png diff --git a/files/img/folder.png b/files/img/folder.png Binary files differindex 3e7a3ba8cfe..3edbe257a34 100644 --- a/files/img/folder.png +++ b/files/img/folder.png diff --git a/files/img/home.png b/files/img/home.png Binary files differnew file mode 100644 index 00000000000..b3fb9bbaf6f --- /dev/null +++ b/files/img/home.png diff --git a/files/img/navicon.png b/files/img/navicon.png Binary files differdeleted file mode 100644 index 3802c98fc46..00000000000 --- a/files/img/navicon.png +++ /dev/null diff --git a/files/index.php b/files/index.php index 2a78e8a438e..7ac3bce6051 100644 --- a/files/index.php +++ b/files/index.php @@ -42,6 +42,9 @@ $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : ''; $files = array(); foreach( OC_FILES::getdirectorycontent( $dir ) as $i ){ $i["date"] = OC_UTIL::formatDate($i["mtime"] ); + if($i['directory']=='/'){ + $i['directory']=''; + } $files[] = $i; } diff --git a/files/js/files.js b/files/js/files.js index 5c11bddeb56..019758dc497 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -39,6 +39,19 @@ $(document).ready(function() { $('.browser input:checkbox').attr('checked', false); }); + // Delete current file + $('#delete_single_file').click(function() { + filename = $('#file_menu').parents('tr:first').find('.filename:first').children('a:first').text(); + $.ajax({ + url: 'ajax/delete.php', + data: "dir="+$('#dir').val()+"&file="+filename, + complete: function(data){ + boolOperationFinished(data, true, $('#file_menu').parents('tr:first')); + } + }); + return false; + }); + $('#file_upload_start').click(function() { $('#file_upload_target').load(uploadFinished); }); @@ -47,7 +60,7 @@ $(document).ready(function() { $.ajax({ url: 'ajax/newfolder.php', data: "dir="+$('#dir').val()+"&foldername="+$('#file_new_dir_name').val(), - complete: boolOpFinished + complete: function(data){boolOperationFinished(data, false);} }); }); @@ -98,14 +111,20 @@ function resetFileActionPanel() { $('#file_action_panel').attr('activeAction', false); } -function boolOpFinished(data) { +function boolOperationFinished(data, single, el) { result = eval("("+data.responseText+");"); if(result.status == 'success'){ - $.ajax({ - url: 'ajax/list.php', - data: "dir="+$('#dir').val(), - complete: refreshContents - }); + if(single) { + $('#file_menu').slideToggle(0); + $('body').append($('#file_menu')); + $(el).remove(); + } else { + $.ajax({ + url: 'ajax/list.php', + data: "dir="+$('#dir').val(), + complete: refreshContents + }); + } } else { alert(result.data.message); } @@ -117,7 +136,11 @@ function refreshContents(data) { updateBreadcrumb(result.data.breadcrumb); } updateFileList(result.data.files); - $('#file_upload_button').click(); + $('td.fileaction a').click(function() { + $(this).parent().append($('#file_menu')); + $('#file_menu').slideToggle(250); + return false; + }); resetFileActionPanel(); } diff --git a/files/templates/index.php b/files/templates/index.php index 75eef0d16e4..d38e771c2e1 100644 --- a/files/templates/index.php +++ b/files/templates/index.php @@ -40,6 +40,6 @@ name="file_upload_target" src=""></iframe></form> <ul> <li><a href="" title="">Download</a></li> <li><a href="" title="">Share</a></li> - <li><a href="" title="">Delete</a></li> + <li><a href="" title="" id="delete_single_file">Delete</a></li> </ul> </div> diff --git a/files/templates/part.breadcrumb.php b/files/templates/part.breadcrumb.php index 4d11edb984a..da9544008b9 100644 --- a/files/templates/part.breadcrumb.php +++ b/files/templates/part.breadcrumb.php @@ -1,4 +1,4 @@ <a href="<?php echo link_to("files", "index.php?dir=/"); ?>"><img src="<?php echo image_path("", "actions/go-home.png"); ?>" alt="Root" /></a> <?php foreach($_["breadcrumb"] as $crumb): ?> - <a href="<?php echo link_to("files", "index.php?dir=".$crumb["dir"]); ?>"><?php echo $crumb["name"]; ?></a> + <a href="<?php echo link_to("files", "index.php?dir=".$crumb["dir"]); ?>"><?php echo htmlspecialchars($crumb["name"]); ?></a> <?php endforeach; ?>
\ No newline at end of file diff --git a/files/templates/part.list.php b/files/templates/part.list.php index 76d938326b6..0d4fcc75489 100644 --- a/files/templates/part.list.php +++ b/files/templates/part.list.php @@ -1,9 +1,9 @@ <?php foreach($_["files"] as $file): ?> <tr> <td class="selection"><input type="checkbox" /></td> - <td class="filename"><a style="background-image:url(<?php if($file["type"] == "dir") echo mimetype_icon("dir"); else echo mimetype_icon($file["mime"]); ?>)" 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=""><?php echo $file["name"]; ?></a></td> + <td class="filename"><a style="background-image:url(<?php if($file["type"] == "dir") echo mimetype_icon("dir"); else echo mimetype_icon($file["mime"]); ?>)" 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=""><?php echo htmlspecialchars($file["name"]); ?></a></td> <td class="filesize"><?php echo human_file_size($file["size"]); ?></td> - <td class="date"><?php if($file["type"] != "dir") echo $file["date"]; ?></td> + <td class="date"><?php echo $file["date"]; ?></td> <td class="fileaction"><a href="" title=""><img src="images/drop-arrow.png" alt="+" /></a></td> </tr> <?php endforeach; ?>
\ No newline at end of file |