summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js/public.js
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-08-27 15:46:05 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-08-27 20:37:38 -0400
commit0a9d1ed3a645efda56ae757f45aa7efb5a35ce4f (patch)
treea2fbdc55f42a149c8a5e738763ce731e9c55f6dc /apps/files_sharing/js/public.js
parent8374a49cc19cf43489a415388fd782ba1574ee82 (diff)
downloadnextcloud-server-0a9d1ed3a645efda56ae757f45aa7efb5a35ce4f.tar.gz
nextcloud-server-0a9d1ed3a645efda56ae757f45aa7efb5a35ce4f.zip
Initial previewer for public links
Diffstat (limited to 'apps/files_sharing/js/public.js')
-rw-r--r--apps/files_sharing/js/public.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
new file mode 100644
index 00000000000..755382e0736
--- /dev/null
+++ b/apps/files_sharing/js/public.js
@@ -0,0 +1,18 @@
+// Override download path to files_sharing/public.php
+function fileDownloadPath(dir, file) {
+ return $('#downloadURL').val();
+}
+
+$(document).ready(function() {
+
+ 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') {
+ // Trigger default action if not download TODO
+ var action = FileActions.getDefault(mimetype, 'file', FileActions.PERMISSION_READ);
+ action($('#filename').val());
+ }
+ }
+
+}); \ No newline at end of file