From 3f5c97b953a7f68b07e383d7b38d60b6b269043f Mon Sep 17 00:00:00 2001 From: Sebastian Tschan Date: Tue, 28 Feb 2012 12:30:50 +0900 Subject: [PATCH] Added options to define the upload/download template IDs. --- js/jquery.fileupload-ui.js | 13 +++++++++---- package.json | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/js/jquery.fileupload-ui.js b/js/jquery.fileupload-ui.js index a076e8c32..b81df6e82 100644 --- a/js/jquery.fileupload-ui.js +++ b/js/jquery.fileupload-ui.js @@ -1,5 +1,5 @@ /* - * jQuery File Upload User Interface Plugin 6.5.2 + * jQuery File Upload User Interface Plugin 6.5.3 * https://github.com/blueimp/jQuery-File-Upload * * Copyright 2010, Sebastian Tschan @@ -65,6 +65,10 @@ // if supported by the browser. Set the following option to false // to always display preview images as img elements: previewAsCanvas: true, + // The ID of the upload template: + uploadTemplateId: 'template-upload', + // The ID of the download template: + downloadTemplateId: 'template-download', // The expected data type of the upload response, sets the dataType // option of the $.ajax upload requests: dataType: 'json', @@ -559,11 +563,12 @@ }, _initTemplates: function () { - this.options.templateContainer = document.createElement( + var options = this.options; + options.templateContainer = document.createElement( this._files.prop('nodeName') ); - this.options.uploadTemplate = tmpl('template-upload'); - this.options.downloadTemplate = tmpl('template-download'); + options.uploadTemplate = tmpl(options.uploadTemplateId); + options.downloadTemplate = tmpl(options.downloadTemplateId); }, _initFiles: function () { diff --git a/package.json b/package.json index 4f3da9344..6e9cc3aa8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blueimp-file-upload", - "version": "6.5.2", + "version": "6.5.3", "title": "jQuery File Upload", "description": "File Upload widget with multiple file selection, drag&drop support, progress bars and preview images for jQuery. Supports cross-domain, chunked and resumable file uploads and client-side image resizing. Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.", "keywords": [