diff --git a/core/css/styles.css b/core/css/styles.css
index 8723fe0eaf2..f0dfd1e9b15 100644
--- a/core/css/styles.css
+++ b/core/css/styles.css
@@ -211,6 +211,7 @@ form.searchbox { display:inline; position:fixed; top:2em; right:10em; margin:0;
#plugins a.active, #plugins a:hover, #plugins a:focus, #plugins a.selected { background-color:#ccc; border-top:1px solid #ccc; border-bottom:1px solid #ccc; color:#000; outline:0; }
#plugins a:active { outline:0; }
#plugins .subentry { background-color:#ddd; border-top:1px solid #aaa; border-bottom:1px solid #ccc; color:#000; outline:0; }
+#plugins .subentry.active { background-color:#bbb; border-top:1px solid #aaa; border-bottom:1px solid #ccc; color:#000; outline:0; }
/* CONTENT ------------------------------------------------------------------ */
#content { margin:7em 0 0 16em; }
@@ -224,7 +225,7 @@ table td.date { width:11em; }
table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; }
table td.filename a { display:block; background-image:url('../img/file.png'); text-decoration:none; }
table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:0.5em 0.5em 0.5em 3em; background-position:1em center; background-repeat:no-repeat; }
-table td.filename a:hover, table td.filename a:focus { text-decoration:underline; outline:0; }
+table td.filename a:hover, table td.filename a:focus { outline:0; }
table td.filename a:active { outline:0; }
table em { font-weight:bold; }
table td.filename a.folder-up { background-image:url('../img/back.png'); font-style:italic; }
@@ -248,9 +249,9 @@ table td.delete { background-image:url('../img/delete.png'); }
#fileList tr:hover input[type=checkbox] { display:inline; }
/* NAVIGATION BAR */
-p.nav { margin:1em 0 0 2em; padding:0.8em; line-height:16px; font-weight:bold; }
-p.nav a { padding:0.5em 1.5em 0.5em 0.5em; background-position:right center; background-repeat:no-repeat; background-image:url('../img/arrow.png'); text-decoration:none; }
-p.nav a img { height:16px; vertical-align:text-top; }
+span.nav { margin:1em 0 0 2em; padding:0.8em; line-height:16px; font-weight:bold; display:block}
+span.nav a { padding:0.5em 1.5em 0.5em 0.5em; background-position:right center; background-repeat:no-repeat; background-image:url('../img/arrow.png'); text-decoration:none; }
+span.nav a img { height:16px; vertical-align:text-top; }
/* ACTIONS BAR */
p.actions, div.actions { padding:0; }
diff --git a/core/templates/layout.admin.php b/core/templates/layout.admin.php
index 026e1272237..aa1de65c084 100644
--- a/core/templates/layout.admin.php
+++ b/core/templates/layout.admin.php
@@ -43,7 +43,7 @@
class="active">
- class="active">
+ class="active">
@@ -52,7 +52,7 @@
class="active">
-
+
diff --git a/files/css/files.css b/files/css/files.css
index 9e0361327db..ed67755ab4a 100644
--- a/files/css/files.css
+++ b/files/css/files.css
@@ -75,7 +75,7 @@ table {
width: 90%;
}
-tbody tr:hover, tbody tr:active { background-color:#eee; }
+tbody tr:hover, tbody tr:active, tbody tr.selected { background-color:#eee; }
tbody a { color:#000; }
table td.filesize, table td.date
@@ -110,3 +110,11 @@ table td.filename a
display: inline-block;
background-image:url('../img/drop-arrow.png');
}
+
+span.extention{
+ color:#999;
+}
+
+div.crumb{
+ float:left;
+}
\ No newline at end of file
diff --git a/files/index.php b/files/index.php
index a163895131e..e88f0ef23e5 100644
--- a/files/index.php
+++ b/files/index.php
@@ -47,6 +47,10 @@ $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
$files = array();
foreach( OC_FILES::getdirectorycontent( $dir ) as $i ){
$i["date"] = OC_UTIL::formatDate($i["mtime"] );
+ if($i['type']=='file'){
+ $i['extention']=substr($i['name'],strrpos($i['name'],'.'));
+ $i['basename']=substr($i['name'],0,strrpos($i['name'],'.'));
+ }
if($i['directory']=='/'){
$i['directory']='';
}
diff --git a/files/js/filelist.js b/files/js/filelist.js
index 2d00c642333..290f062dae2 100644
--- a/files/js/filelist.js
+++ b/files/js/filelist.js
@@ -11,6 +11,7 @@ FileList={
html+=' | ';
html+='';
FileList.insertElement(name,'file',$(html));
+ $('tr[data-file="'+name+'"] td.filename').draggable(dragOptions);
},
addDir:function(name,size,lastModified){
var html='';
@@ -22,6 +23,8 @@ FileList={
html+='
';
FileList.insertElement(name,'dir',$(html));
+ $('tr[data-file="'+name+'"] td.filename').draggable(dragOptions);
+ $('tr[data-file="'+name+'"] td.filename').droppable(folderDropOptions);
},
refresh:function(data) {
result = jQuery.parseJSON(data.responseText);
@@ -32,6 +35,7 @@ FileList={
resetFileActionPanel();
},
remove:function(name){
+ $('tr[data-file="'+name+'"] td.filename').draggable('destroy');
$('tr[data-file="'+name+'"]').remove();
},
insertElement:function(name,type,element){
diff --git a/files/js/files.js b/files/js/files.js
index 2434fceff43..431b49131ce 100644
--- a/files/js/files.js
+++ b/files/js/files.js
@@ -1,16 +1,35 @@
$(document).ready(function() {
$('#file_action_panel').attr('activeAction', false);
- // Sets browser table behaviour :
- $('.browser tr').hover(
- function() {
- $(this).addClass('mouseOver');
+ //drag/drop of files
+ $('#fileList tr td.filename').draggable(dragOptions);
+ $('#fileList tr[data-type="dir"] td.filename').droppable(folderDropOptions);
+ $('div.crumb').droppable({
+ drop: function( event, ui ) {
+ var file=ui.draggable.text().trim();
+ var target=$(this).attr('data-dir');
+ var dir=$('#dir').val();
+ while(dir.substr(0,1)=='/'){//remove extra leading /'s
+ dir=dir.substr(1);
+ }
+ dir='/'+dir;
+ if(dir.substr(-1,1)!='/'){
+ dir=dir+'/';
+ }
+ if(target==dir){
+ return;
+ }
+ $.ajax({
+ url: 'ajax/move.php',
+ data: "dir="+dir+"&file="+file+'&target='+target,
+ complete: function(data){boolOperationFinished(data, function(){
+ FileList.remove(file);
+ });}
+ });
},
- function() {
- $(this).removeClass('mouseOver');
- }
- );
-
+ tolerance: 'pointer'
+ });
+
// Sets the file-action buttons behaviour :
$('td.fileaction a').live('click',function(event) {
event.preventDefault();
@@ -31,15 +50,19 @@ $(document).ready(function() {
// Sets the select_all checkbox behaviour :
$('#select_all').click(function() {
- if($(this).attr('checked'))
+ if($(this).attr('checked')){
// Check all
$('td.selection input:checkbox').attr('checked', true);
- else
+ $('td.selection input:checkbox').parent().parent().addClass('selected');
+ }else{
// Uncheck all
$('td.selection input:checkbox').attr('checked', false);
+ $('td.selection input:checkbox').parent().parent().removeClass('selected');
+ }
});
$('td.selection input:checkbox').live('click',function() {
+ $(this).parent().parent().toggleClass('selected');
if(!$(this).attr('checked')){
$('#select_all').attr('checked',false);
}else{
@@ -218,3 +241,28 @@ function formatDate(date){
"July", "August", "September", "October", "November", "December" ];
return monthNames[date.getMonth()]+' '+date.getDate()+', '+date.getFullYear()+', '+((date.getHours()<10)?'0':'')+date.getHours()+':'+date.getMinutes();
}
+
+
+//options for file drag/dropp
+var dragOptions={
+ distance: 20, revert: true, opacity: 0.7,
+ stop: function(event, ui) {
+ $('#fileList tr td.filename').addClass('ui-draggable');
+ }
+};
+var folderDropOptions={
+ drop: function( event, ui ) {
+ var file=ui.draggable.text().trim();
+ var target=$(this).text().trim();
+ var dir=$('#dir').val();
+ $.ajax({
+ url: 'ajax/move.php',
+ data: "dir="+dir+"&file="+file+'&target='+dir+'/'+target,
+ complete: function(data){boolOperationFinished(data, function(){
+ var el=$('#fileList tr[data-file="'+file+'"] td.filename');
+ el.draggable('destroy');
+ FileList.remove(file);
+ });}
+ });
+ }
+}
\ No newline at end of file
diff --git a/files/templates/index.php b/files/templates/index.php
index b9f8c02c93b..a1254eeb423 100644
--- a/files/templates/index.php
+++ b/files/templates/index.php
@@ -23,9 +23,9 @@
-
+
-
+