aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js/public.js
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-02-05 13:36:55 +0100
committerRobin Appelman <icewind@owncloud.com>2014-02-05 13:36:55 +0100
commit1e79369338e8435952e2eda60a2cfc49bb6c4882 (patch)
tree12d3ac88978887f16e795c54873bbd6b99bb8ee5 /apps/files_sharing/js/public.js
parent3c1ab66edac1ba2f1b398c859cd933c410ea3d8d (diff)
parent3d88b10f201b7979f250b49b10360b3581030ec7 (diff)
downloadnextcloud-server-1e79369338e8435952e2eda60a2cfc49bb6c4882.tar.gz
nextcloud-server-1e79369338e8435952e2eda60a2cfc49bb6c4882.zip
merge master into storagestatistics-reuse
Diffstat (limited to 'apps/files_sharing/js/public.js')
-rw-r--r--apps/files_sharing/js/public.js40
1 files changed, 11 insertions, 29 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 4c0b0ad9d48..c1b7eee3fb7 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -9,22 +9,13 @@ function fileDownloadPath(dir, file) {
$(document).ready(function() {
- $('#data-upload-form').tipsy({gravity:'ne', fade:true});
-
if (typeof FileActions !== 'undefined') {
var mimetype = $('#mimetype').val();
// Show file preview if previewer is available, images are already handled by the template
if (mimetype.substr(0, mimetype.indexOf('/')) != 'image' && $('.publicpreview').length === 0) {
// Trigger default action if not download TODO
var action = FileActions.getDefault(mimetype, 'file', OC.PERMISSION_READ);
- if (typeof action === 'undefined') {
- $('#noPreview').show();
- if (mimetype != 'httpd/unix-directory') {
- // NOTE: Remove when a better file previewer solution exists
- $('#content').remove();
- $('table').remove();
- }
- } else {
+ if (typeof action !== 'undefined') {
action($('#filename').val());
}
}
@@ -34,18 +25,16 @@ $(document).ready(function() {
window.location = $(tr).find('a.name').attr('href');
}
});
- FileActions.register('file', 'Download', OC.PERMISSION_READ, '', function(filename) {
- var tr = FileList.findFileEl(filename);
- if (tr.length > 0) {
- window.location = $(tr).find('a.name').attr('href');
- }
- });
- FileActions.register('dir', 'Download', OC.PERMISSION_READ, '', function(filename) {
+
+ // override since the format is different
+ FileList.getDownloadUrl = function(filename, dir) {
+ // we use this because we need the service and token attributes
var tr = FileList.findFileEl(filename);
if (tr.length > 0) {
- window.location = $(tr).find('a.name').attr('href')+'&download';
+ return $(tr).find('a.name').attr('href') + '&download';
}
- });
+ return null;
+ };
}
var file_upload_start = $('#file_upload_start');
@@ -58,16 +47,9 @@ $(document).ready(function() {
};
});
- // Add Uploadprogress Wrapper to controls bar
- $('#controls').append($('#controls .actions div#uploadprogresswrapper'));
- $('#uploadprogresswrapper').addClass('public_actions');
-
- // Cancel upload trigger
- $('#cancel_upload_button').click(function() {
- OC.Upload.cancelUploads();
- procesSelection();
+ $(document).on('click', '#directLink', function() {
+ $(this).focus();
+ $(this).select();
});
- $('#directLink').focus();
-
});