|
1 | 1 | /*!
|
2 | 2 | * jQuery Upload File Plugin
|
3 |
| - * version: 4.0.10 |
| 3 | + * version: 4.0.11 |
4 | 4 | * @requires jQuery v1.5 or later & form plugin
|
5 | 5 | * Copyright (c) 2013 Ravishanker Kusuma
|
6 | 6 | * http://hayageek.com/
|
|
73 | 73 | uploadStr:"Upload",
|
74 | 74 | abortStr: "Abort",
|
75 | 75 | cancelStr: "Cancel",
|
76 |
| - deletelStr: "Delete", |
| 76 | + deleteStr: "Delete", |
77 | 77 | doneStr: "Done",
|
78 | 78 | multiDragErrorStr: "Multiple File Drag & Drop is not allowed.",
|
79 | 79 | extErrorStr: "is not allowed. Allowed extensions: ",
|
|
144 | 144 | } else window.setTimeout(checkAjaxFormLoaded, 10);
|
145 | 145 | })();
|
146 | 146 |
|
| 147 | + |
147 | 148 | this.startUpload = function () {
|
148 | 149 | $("form").each(function(i,items)
|
149 | 150 | {
|
|
178 | 179 | this.update = function (settings) {
|
179 | 180 | //update new settings
|
180 | 181 | s = $.extend(s, settings);
|
| 182 | + |
| 183 | + //We need to update action for already created Form. |
| 184 | + if(settings.hasOwnProperty('url')) |
| 185 | + { |
| 186 | + $("form").each(function(i,items) |
| 187 | + { |
| 188 | + $(this).attr('action',settings['url']); |
| 189 | + }); |
| 190 | + } |
| 191 | + |
| 192 | + |
181 | 193 | }
|
182 | 194 |
|
183 | 195 | this.enqueueFile = function(file){
|
|
664 | 676 | this.cancel = $("<div>" + s.cancelStr + "</div>").appendTo(this.statusbar).hide();
|
665 | 677 | this.done = $("<div>" + s.doneStr + "</div>").appendTo(this.statusbar).hide();
|
666 | 678 | this.download = $("<div>" + s.downloadStr + "</div>").appendTo(this.statusbar).hide();
|
667 |
| - this.del = $("<div>" + s.deletelStr + "</div>").appendTo(this.statusbar).hide(); |
| 679 | + this.del = $("<div>" + s.deleteStr + "</div>").appendTo(this.statusbar).hide(); |
668 | 680 |
|
669 | 681 | this.abort.addClass("ajax-file-upload-red");
|
670 | 682 | this.done.addClass("ajax-file-upload-green");
|
|
718 | 730 | if(sData) {
|
719 | 731 | for(var j = 0; j < sData.length; j++) {
|
720 | 732 | if(sData[j]) {
|
721 |
| - if(s.fileData != undefined) options.formData.append(sData[j][0], sData[j][1]); |
| 733 | + if(s.serialize && s.fileData != undefined) options.formData.append(sData[j][0], sData[j][1]); |
722 | 734 | else options.data[sData[j][0]] = sData[j][1];
|
723 | 735 | }
|
724 | 736 | }
|
|
729 | 741 | {
|
730 | 742 | $(pd.extraHTML).find("input,select,textarea").each(function(i,items)
|
731 | 743 | {
|
732 |
| - if(s.fileData != undefined) options.formData.append($(this).attr('name'),$(this).val()); |
| 744 | + if(s.serialize && s.fileData != undefined) options.formData.append($(this).attr('name'),$(this).val()); |
733 | 745 | else options.data[$(this).attr('name')] = $(this).val();
|
734 | 746 | });
|
735 | 747 | }
|
|
0 commit comments