mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
make sendFileToServer() and createStatusbar() public, add getMaxFileSize() and getMaxFileSizeMsg()
This commit is contained in:
parent
4483b21d05
commit
218934fea6
|
@ -673,11 +673,20 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
maxFileSize = size;
|
||||
}
|
||||
|
||||
SeedDMSUpload.getMaxFileSize = function() {
|
||||
return maxFileSize;
|
||||
}
|
||||
|
||||
SeedDMSUpload.setMaxFileSizeMsg = function(msg) {
|
||||
maxFileSizeMsg = msg;
|
||||
}
|
||||
|
||||
function sendFileToServer(formData,status,callback) {
|
||||
SeedDMSUpload.getMaxFileSizeMsg = function() {
|
||||
return maxFileSizeMsg;
|
||||
}
|
||||
|
||||
// function sendFileToServer(formData,status,callback) {
|
||||
SeedDMSUpload.sendFileToServer = function(formData,status,callback) {
|
||||
var uploadURL = ajaxurl; //Upload URL
|
||||
var extraData ={}; //Extra Data.
|
||||
var jqXHR=$.ajax({
|
||||
|
@ -736,7 +745,8 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
status.setAbort(jqXHR);
|
||||
}
|
||||
|
||||
function createStatusbar(obj) {
|
||||
//function createStatusbar(obj) {
|
||||
SeedDMSUpload.createStatusbar = function(obj) {
|
||||
rowCount++;
|
||||
var row="odd";
|
||||
this.obj = obj;
|
||||
|
@ -832,9 +842,9 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
// fd.append('path', files[i].webkitRelativePath);
|
||||
|
||||
statusbar.parent().show();
|
||||
var status = new createStatusbar(statusbar);
|
||||
var status = new SeedDMSUpload.createStatusbar(statusbar);
|
||||
status.setFileNameSize(files[i].name,files[i].size);
|
||||
sendFileToServer(fd,status,function(){
|
||||
SeedDMSUpload.sendFileToServer(fd,status,function(){
|
||||
if(target_id == seeddms_folder)
|
||||
$("div.ajax[data-action='folderList']").trigger('update', {folderid: seeddms_folder});
|
||||
});
|
||||
|
@ -860,9 +870,9 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
fd.append('userfile', files[i]);
|
||||
fd.append('command', 'uploaddocument');
|
||||
|
||||
var status = new createStatusbar(statusbar);
|
||||
var status = new SeedDMSUpload.createStatusbar(statusbar);
|
||||
status.setFileNameSize(files[i].name,files[i].size);
|
||||
sendFileToServer(fd,status);
|
||||
SeedDMSUpload.sendFileToServer(fd,status);
|
||||
} else {
|
||||
noty({
|
||||
text: maxFileSizeMsg + '<br /><em>' + files[i].name + ' (' + files[i].size + ' Bytes)</em>',
|
||||
|
@ -885,9 +895,9 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
fd.append('userfile', files[i]);
|
||||
fd.append('command', 'addfile');
|
||||
|
||||
var status = new createStatusbar(statusbar);
|
||||
var status = new SeedDMSUpload.createStatusbar(statusbar);
|
||||
status.setFileNameSize(files[i].name,files[i].size);
|
||||
sendFileToServer(fd,status, function(){
|
||||
SeedDMSUpload.sendFileToServer(fd,status, function(){
|
||||
$("div.ajax[data-action='documentFiles']").trigger('update', {documentid: target_id});
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -704,11 +704,20 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
maxFileSize = size;
|
||||
}
|
||||
|
||||
SeedDMSUpload.getMaxFileSize = function() {
|
||||
return maxFileSize;
|
||||
}
|
||||
|
||||
SeedDMSUpload.setMaxFileSizeMsg = function(msg) {
|
||||
maxFileSizeMsg = msg;
|
||||
}
|
||||
|
||||
function sendFileToServer(formData,status,callback) {
|
||||
SeedDMSUpload.getMaxFileSizeMsg = function() {
|
||||
return maxFileSizeMsg;
|
||||
}
|
||||
|
||||
// function sendFileToServer(formData,status,callback) {
|
||||
SeedDMSUpload.sendFileToServer = function(formData,status,callback) {
|
||||
var uploadURL = ajaxurl; //Upload URL
|
||||
var extraData ={}; //Extra Data.
|
||||
var jqXHR=$.ajax({
|
||||
|
@ -767,7 +776,8 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
status.setAbort(jqXHR);
|
||||
}
|
||||
|
||||
function createStatusbar(obj) {
|
||||
//function createStatusbar(obj) {
|
||||
SeedDMSUpload.createStatusbar = function(obj) {
|
||||
rowCount++;
|
||||
var row="odd";
|
||||
this.obj = obj;
|
||||
|
@ -863,9 +873,9 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
// fd.append('path', files[i].webkitRelativePath);
|
||||
|
||||
statusbar.parent().show();
|
||||
var status = new createStatusbar(statusbar);
|
||||
var status = new SeedDMSUpload.createStatusbar(statusbar);
|
||||
status.setFileNameSize(files[i].name,files[i].size);
|
||||
sendFileToServer(fd,status,function(){
|
||||
SeedDMSUpload.sendFileToServer(fd,status,function(){
|
||||
if(target_id == seeddms_folder)
|
||||
$("div.ajax[data-action='folderList']").trigger('update', {folderid: seeddms_folder});
|
||||
});
|
||||
|
@ -891,9 +901,9 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
fd.append('userfile', files[i]);
|
||||
fd.append('command', 'uploaddocument');
|
||||
|
||||
var status = new createStatusbar(statusbar);
|
||||
var status = new SeedDMSUpload.createStatusbar(statusbar);
|
||||
status.setFileNameSize(files[i].name,files[i].size);
|
||||
sendFileToServer(fd,status);
|
||||
SeedDMSUpload.sendFileToServer(fd,status);
|
||||
} else {
|
||||
noty({
|
||||
text: maxFileSizeMsg + '<br /><em>' + files[i].name + ' (' + files[i].size + ' Bytes)</em>',
|
||||
|
@ -916,9 +926,9 @@ function onAddClipboard(ev) { /* {{{ */
|
|||
fd.append('userfile', files[i]);
|
||||
fd.append('command', 'addfile');
|
||||
|
||||
var status = new createStatusbar(statusbar);
|
||||
var status = new SeedDMSUpload.createStatusbar(statusbar);
|
||||
status.setFileNameSize(files[i].name,files[i].size);
|
||||
sendFileToServer(fd,status, function(){
|
||||
SeedDMSUpload.sendFileToServer(fd,status, function(){
|
||||
$("div.ajax[data-action='documentFiles']").trigger('update', {documentid: target_id});
|
||||
});
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user