Skip to content

Commit 2f7263a

Browse files
committed
deleteStr type, update URL
1 parent 33eb7ea commit 2f7263a

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

js/jquery.uploadfile.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* jQuery Upload File Plugin
3-
* version: 4.0.10
3+
* version: 4.0.11
44
* @requires jQuery v1.5 or later & form plugin
55
* Copyright (c) 2013 Ravishanker Kusuma
66
* http://hayageek.com/
@@ -73,7 +73,7 @@
7373
uploadStr:"Upload",
7474
abortStr: "Abort",
7575
cancelStr: "Cancel",
76-
deletelStr: "Delete",
76+
deleteStr: "Delete",
7777
doneStr: "Done",
7878
multiDragErrorStr: "Multiple File Drag & Drop is not allowed.",
7979
extErrorStr: "is not allowed. Allowed extensions: ",
@@ -144,6 +144,7 @@
144144
} else window.setTimeout(checkAjaxFormLoaded, 10);
145145
})();
146146

147+
147148
this.startUpload = function () {
148149
$("form").each(function(i,items)
149150
{
@@ -178,6 +179,17 @@
178179
this.update = function (settings) {
179180
//update new settings
180181
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+
181193
}
182194

183195
this.enqueueFile = function(file){
@@ -664,7 +676,7 @@
664676
this.cancel = $("<div>" + s.cancelStr + "</div>").appendTo(this.statusbar).hide();
665677
this.done = $("<div>" + s.doneStr + "</div>").appendTo(this.statusbar).hide();
666678
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();
668680

669681
this.abort.addClass("ajax-file-upload-red");
670682
this.done.addClass("ajax-file-upload-green");
@@ -718,7 +730,7 @@
718730
if(sData) {
719731
for(var j = 0; j < sData.length; j++) {
720732
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]);
722734
else options.data[sData[j][0]] = sData[j][1];
723735
}
724736
}
@@ -729,7 +741,7 @@
729741
{
730742
$(pd.extraHTML).find("input,select,textarea").each(function(i,items)
731743
{
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());
733745
else options.data[$(this).attr('name')] = $(this).val();
734746
});
735747
}

0 commit comments

Comments
 (0)