2012-08-27 23:46:05 +04:00
|
|
|
// 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
|
2012-08-31 03:05:36 +04:00
|
|
|
var action = FileActions.getDefault(mimetype, 'file', OC.PERMISSION_READ);
|
2012-08-30 05:12:10 +04:00
|
|
|
if (typeof action === 'undefined') {
|
|
|
|
$('#noPreview').show();
|
|
|
|
} else {
|
|
|
|
action($('#filename').val());
|
|
|
|
}
|
2012-08-27 23:46:05 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|