aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-11-07 17:18:56 +0100
committerRobin Appelman <icewind@owncloud.com>2012-11-07 17:18:56 +0100
commit961ff01a93dd69cb12196a1b8507cce925e74fbc (patch)
tree4956c9a42d6286b0851ca73641439e5c002f6a9a /apps/files
parent4b940955ddb3266f625eae83da412a655efef319 (diff)
parent5cad2d7ccc3d2b4ccd9e1b090e28787f1c28b6ca (diff)
downloadnextcloud-server-961ff01a93dd69cb12196a1b8507cce925e74fbc.tar.gz
nextcloud-server-961ff01a93dd69cb12196a1b8507cce925e74fbc.zip
merge master into filesystem
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/appinfo/update.php4
-rw-r--r--apps/files/js/fileactions.js26
-rw-r--r--apps/files/js/files.js23
-rw-r--r--apps/files/l10n/pl.php1
-rw-r--r--apps/files/l10n/pt_PT.php1
-rw-r--r--apps/files/l10n/ta_LK.php1
6 files changed, 16 insertions, 40 deletions
diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php
index 738864d7cff..29782ec643e 100644
--- a/apps/files/appinfo/update.php
+++ b/apps/files/appinfo/update.php
@@ -5,10 +5,10 @@ $installedVersion=OCP\Config::getAppValue('files', 'installed_version');
if (version_compare($installedVersion, '1.1.6', '<')) {
$query = OC_DB::prepare( "SELECT `propertyname`, `propertypath`, `userid` FROM `*PREFIX*properties`" );
$result = $query->execute();
+ $updateQuery = OC_DB::prepare('UPDATE `*PREFIX*properties` SET `propertyname` = ? WHERE `userid` = ? AND `propertypath` = ?');
while( $row = $result->fetchRow()) {
if ( $row["propertyname"][0] != '{' ) {
- $query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertyname` = ? WHERE `userid` = ? AND `propertypath` = ?' );
- $query->execute( array( '{DAV:}' + $row["propertyname"], $row["userid"], $row["propertypath"] ));
+ $updateQuery->execute(array('{DAV:}' + $row["propertyname"], $row["userid"], $row["propertypath"]));
}
}
}
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 82d990bf780..40dd9f14a69 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -70,6 +70,13 @@ var FileActions = {
}
parent.children('a.name').append('<span class="fileactions" />');
var defaultAction = FileActions.getDefault(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions());
+ var actionHandler = function (parent, action, event) {
+ event.stopPropagation();
+ event.preventDefault();
+ FileActions.currentFile = parent;
+ file = FileActions.getCurrentFile();
+ action(file);
+ };
for (name in actions) {
// NOTE: Temporary fix to prevent rename action in root of Shared directory
if (name === 'Rename' && $('#dir').val() === '/Shared') {
@@ -87,14 +94,7 @@ var FileActions = {
html += t('files', name) + '</a>';
var element = $(html);
element.data('action', name);
- element.click(function (event) {
- FileActions.currentFile = $(this).parent().parent().parent();
- event.stopPropagation();
- event.preventDefault();
- var action = actions[$(this).data('action')];
- var currentFile = FileActions.getCurrentFile();
- action(currentFile);
- });
+ element.click(actionHandler.bind(null, parent, actions[name]));
parent.find('a.name>span.fileactions').append(element);
}
}
@@ -113,14 +113,8 @@ var FileActions = {
if (img) {
element.append($('<img class ="svg" src="' + img + '"/>'));
}
- element.data('action', 'Delete');
- element.click(function (event) {
- event.stopPropagation();
- event.preventDefault();
- var action = actions[$(this).data('action')];
- var currentFile = FileActions.getCurrentFile();
- action(currentFile);
- });
+ element.data('action', actions['Delete']);
+ element.click(actionHandler.bind(null, parent, actions['Delete']));
parent.parent().children().last().append(element);
}
},
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 2d9ccba424a..16f7c966067 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -722,7 +722,7 @@ var folderDropOptions={
}
var crumbDropOptions={
drop: function( event, ui ) {
- var file=ui.draggable.text().trim();
+ var file=ui.draggable.parent().data('file');
var target=$(this).data('dir');
var dir=$('#dir').val();
while(dir.substr(0,1)=='/'){//remove extra leading /'s
@@ -829,27 +829,6 @@ function getSelectedFiles(property){
return files;
}
-function relative_modified_date(timestamp) {
- var timediff = Math.round((new Date()).getTime() / 1000) - timestamp;
- var diffminutes = Math.round(timediff/60);
- var diffhours = Math.round(diffminutes/60);
- var diffdays = Math.round(diffhours/24);
- var diffmonths = Math.round(diffdays/31);
- if(timediff < 60) { return t('files','seconds ago'); }
- else if(timediff < 120) { return t('files','1 minute ago'); }
- else if(timediff < 3600) { return t('files','{minutes} minutes ago',{minutes: diffminutes}); }
- //else if($timediff < 7200) { return '1 hour ago'; }
- //else if($timediff < 86400) { return $diffhours.' hours ago'; }
- else if(timediff < 86400) { return t('files','today'); }
- else if(timediff < 172800) { return t('files','yesterday'); }
- else if(timediff < 2678400) { return t('files','{days} days ago',{days: diffdays}); }
- else if(timediff < 5184000) { return t('files','last month'); }
- //else if($timediff < 31556926) { return $diffmonths.' months ago'; }
- else if(timediff < 31556926) { return t('files','months ago'); }
- else if(timediff < 63113852) { return t('files','last year'); }
- else { return t('files','years ago'); }
-}
-
function getMimeIcon(mime, ready){
if(getMimeIcon.cache[mime]){
ready(getMimeIcon.cache[mime]);
diff --git a/apps/files/l10n/pl.php b/apps/files/l10n/pl.php
index f2460562087..3f71e35a7fd 100644
--- a/apps/files/l10n/pl.php
+++ b/apps/files/l10n/pl.php
@@ -58,6 +58,7 @@
"New" => "Nowy",
"Text file" => "Plik tekstowy",
"Folder" => "Katalog",
+"From link" => "Z linku",
"Upload" => "Prześlij",
"Cancel upload" => "Przestań wysyłać",
"Nothing in here. Upload something!" => "Brak zawartości. Proszę wysłać pliki!",
diff --git a/apps/files/l10n/pt_PT.php b/apps/files/l10n/pt_PT.php
index 33bfee5b2d2..048c6be8350 100644
--- a/apps/files/l10n/pt_PT.php
+++ b/apps/files/l10n/pt_PT.php
@@ -58,6 +58,7 @@
"New" => "Novo",
"Text file" => "Ficheiro de texto",
"Folder" => "Pasta",
+"From link" => "Da ligação",
"Upload" => "Enviar",
"Cancel upload" => "Cancelar envio",
"Nothing in here. Upload something!" => "Vazio. Envie alguma coisa!",
diff --git a/apps/files/l10n/ta_LK.php b/apps/files/l10n/ta_LK.php
index 27c408cdf3a..6d295628139 100644
--- a/apps/files/l10n/ta_LK.php
+++ b/apps/files/l10n/ta_LK.php
@@ -58,6 +58,7 @@
"New" => "புதிய",
"Text file" => "கோப்பு உரை",
"Folder" => "கோப்புறை",
+"From link" => "இணைப்பிலிருந்து",
"Upload" => "பதிவேற்றுக",
"Cancel upload" => "பதிவேற்றலை இரத்து செய்க",
"Nothing in here. Upload something!" => "இங்கு ஒன்றும் இல்லை. ஏதாவது பதிவேற்றுக!",