summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js/public.js
blob: 755382e073648c503117b77546734b5a5110404d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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());
		}
	}

});