Index: core/admin_templates/js/uploader/uploader.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- core/admin_templates/js/uploader/uploader.js (revision 15733) +++ core/admin_templates/js/uploader/uploader.js (revision ) @@ -25,7 +25,7 @@ this.files = new Array(); this.deleted = new Array(); - this.uploadURL = params.uploadURL; + // because used outside this class this.deleteURL = params.deleteURL; this.enableUploadButton(); @@ -35,8 +35,10 @@ Uploader.prototype._ensureDefaultValues = function() { // Upload backend settings var $defaults = { - baseUrl: '', + baseUrl : '', uploadURL : '', + deleteURL : '', + previewURL : '', useQueryString : false, requeueOnError : false, httpSuccess : '', @@ -45,7 +47,7 @@ allowedFiletypesDescription : 'All Files', allowedFilesize : 0, // Default zero means "unlimited" multiple : 0, - field: '', + field : '', thumb_format: '', fileQueueLimit : 0, buttonImageURL : '', @@ -318,7 +320,7 @@ $ret += '
'; if ($need_preview) { - $ret += ''; + $ret += ''; } else { $ret += ''; @@ -539,7 +541,7 @@ this.files[$file_index].uploaded = 1; this.files[$file_index].progress = 100; this.files[$file_index].temp = 1; - this.files[$file_index].url = this.params.tmp_url.replace('#ID#', file.id).replace('#FILE#', encodeURIComponent(this.files[$file_index].name)).replace('#FIELD#', this.params.field); + this.files[$file_index].url = this.getUrl(this.files[$file_index]); this.updateInfo($file_index); } @@ -552,6 +554,20 @@ else { UploadsManager.UploadQueueComplete(this); } +} + +Uploader.prototype.getUrl = function($file, $preview) { + var $url = this.params.previewURL.replace('#FILE#', encodeURIComponent($file.name)).replace('#FIELD#', this.params.field); + + if ( $file.temp !== undefined && $file.temp ) { + $url += '&tmp=1&id=' + $file.id; + } + + if ( $preview !== undefined && $preview === true ) { + $url += '&thumb=1'; + } + + return $url; } Uploader.prototype.getFileIndex = function(file) { \ No newline at end of file Index: core/admin_templates/incs/form_blocks.tpl IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- core/admin_templates/incs/form_blocks.tpl (revision 15733) +++ core/admin_templates/incs/form_blocks.tpl (revision ) @@ -372,7 +372,7 @@ flashsid : '', uploadURL : '', deleteURL : '', - tmp_url : '', + previewURL : '', // Button settings buttonImageURL: 'img/upload.png', // Relative to the Flash file