From dc7be636fa7ea86a24fd66141febb08bfd1752d6 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Thu, 5 Sep 2013 01:46:26 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E7=9A=84=E7=94=B3=E8=AF=B7=E8=A1=A8=E4=B8=8A=E4=BC=A0=E5=92=8C?= =?UTF-8?q?=E5=89=8D=E5=8F=B0=E7=94=B3=E8=AF=B7=E8=A1=A8=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E7=9A=84=E9=80=9A=E7=94=A8=E6=93=8D=E4=BD=9C?= =?UTF-8?q?JS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom/models/admin-down-offlineapps.js | 37 ++++++++++++++++++ .../lib/custom/models/offlineapp-uploader.js | 38 +++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 htdocs/js/lib/custom/models/admin-down-offlineapps.js create mode 100644 htdocs/js/lib/custom/models/offlineapp-uploader.js diff --git a/htdocs/js/lib/custom/models/admin-down-offlineapps.js b/htdocs/js/lib/custom/models/admin-down-offlineapps.js new file mode 100644 index 00000000..716a0538 --- /dev/null +++ b/htdocs/js/lib/custom/models/admin-down-offlineapps.js @@ -0,0 +1,37 @@ +var uploader; +var param; +$(function() { + $('#file_upload').uploadify({ + 'swf' : '/js/lib/uploadify/uploadify.swf', + 'uploader' : '/admin/down/uploadapplicationform', + 'multi' : false, + 'auto' : true, + 'fileTypeExts' : '*.pdf', + 'onUploadSuccess' : function(file, data, response) { + upload.onsuccess(file, data, response); + }, + 'onUploadStart' : function(file) { + $('#file_upload').uploadify('settings','formData',param); + } + }); +}); + +var upload = { + onsuccess : function(file, data, response){ + _data = $.parseJSON(data); + if(!$.isEmptyObject(_data.error)) + { + alert(_data.error); + }else{ + $('#upload-form').modal('hide'); + window.location = window.location; + } + }, + showUploadForm : function(id){ + $('#upload-form').modal('show'); + param = { + "PHPSESSID" : _this.SessionID, + 'orderid' : id + }; + } +}; \ No newline at end of file diff --git a/htdocs/js/lib/custom/models/offlineapp-uploader.js b/htdocs/js/lib/custom/models/offlineapp-uploader.js new file mode 100644 index 00000000..74b630e1 --- /dev/null +++ b/htdocs/js/lib/custom/models/offlineapp-uploader.js @@ -0,0 +1,38 @@ +var uploader; +var param; +$(function() { + $('#file_upload').uploadify({ + 'swf' : '/js/lib/uploadify/uploadify.swf', + 'uploader' : '/service/uploadapplicationform', + 'multi' : false, + 'auto' : true, + 'fileTypeExts' : '*.pdf', + 'fileSizeLimit' : '20MB', + 'onUploadSuccess' : function(file, data, response) { + upload.onsuccess(file, data, response); + }, + 'onUploadStart' : function(file) { + $('#file_upload').uploadify('settings','formData',param); + } + }); +}); + +var upload = { + onsuccess : function(file, data, response){ + _data = $.parseJSON(data); + if(!$.isEmptyObject(_data.error)) + { + alert(_data.error); + }else{ + $('#upload-form').modal('hide'); + window.location = window.location; + } + }, + showUploadForm : function(id){ + $('#upload-form').modal('show'); + param = { + "PHPSESSID" : _this.SessionID, + 'offlineappid' : id + }; + } +}; \ No newline at end of file