Skip to content

Commit

Permalink
deleteStr type, update URL
Browse files Browse the repository at this point in the history
  • Loading branch information
rakusumapp committed Sep 7, 2017
1 parent 33eb7ea commit 2f7263a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
22 changes: 17 additions & 5 deletions js/jquery.uploadfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* jQuery Upload File Plugin
* version: 4.0.10
* version: 4.0.11
* @requires jQuery v1.5 or later & form plugin
* Copyright (c) 2013 Ravishanker Kusuma
* http://hayageek.com/
Expand Down Expand Up @@ -73,7 +73,7 @@
uploadStr:"Upload",
abortStr: "Abort",
cancelStr: "Cancel",
deletelStr: "Delete",
deleteStr: "Delete",
doneStr: "Done",
multiDragErrorStr: "Multiple File Drag & Drop is not allowed.",
extErrorStr: "is not allowed. Allowed extensions: ",
Expand Down Expand Up @@ -144,6 +144,7 @@
} else window.setTimeout(checkAjaxFormLoaded, 10);
})();


this.startUpload = function () {
$("form").each(function(i,items)
{
Expand Down Expand Up @@ -178,6 +179,17 @@
this.update = function (settings) {
//update new settings
s = $.extend(s, settings);

//We need to update action for already created Form.
if(settings.hasOwnProperty('url'))
{
$("form").each(function(i,items)
{
$(this).attr('action',settings['url']);
});
}


}

this.enqueueFile = function(file){
Expand Down Expand Up @@ -664,7 +676,7 @@
this.cancel = $("<div>" + s.cancelStr + "</div>").appendTo(this.statusbar).hide();
this.done = $("<div>" + s.doneStr + "</div>").appendTo(this.statusbar).hide();
this.download = $("<div>" + s.downloadStr + "</div>").appendTo(this.statusbar).hide();
this.del = $("<div>" + s.deletelStr + "</div>").appendTo(this.statusbar).hide();
this.del = $("<div>" + s.deleteStr + "</div>").appendTo(this.statusbar).hide();

this.abort.addClass("ajax-file-upload-red");
this.done.addClass("ajax-file-upload-green");
Expand Down Expand Up @@ -718,7 +730,7 @@
if(sData) {
for(var j = 0; j < sData.length; j++) {
if(sData[j]) {
if(s.fileData != undefined) options.formData.append(sData[j][0], sData[j][1]);
if(s.serialize && s.fileData != undefined) options.formData.append(sData[j][0], sData[j][1]);
else options.data[sData[j][0]] = sData[j][1];
}
}
Expand All @@ -729,7 +741,7 @@
{
$(pd.extraHTML).find("input,select,textarea").each(function(i,items)
{
if(s.fileData != undefined) options.formData.append($(this).attr('name'),$(this).val());
if(s.serialize && s.fileData != undefined) options.formData.append($(this).attr('name'),$(this).val());
else options.data[$(this).attr('name')] = $(this).val();
});
}
Expand Down
Loading

0 comments on commit 2f7263a

Please sign in to comment.