5
This commit is contained in:
@@ -260,7 +260,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator'], function ($, undefined, U
|
||||
var nums = value === '' ? 0 : value.split(/\,/).length;
|
||||
var files = data.url !== "" ? data.url.split(/\,/) : [];
|
||||
$.each(files, function (i, j) {
|
||||
var url = Config.fullmode ? Fast.api.cdnurl(j) : j;
|
||||
var url = Config.upload_fullmode=="1" ? Fast.api.cdnurl(j) : j;
|
||||
urlArr.push(url);
|
||||
});
|
||||
if (maxcount > 0) {
|
||||
@@ -273,7 +273,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator'], function ($, undefined, U
|
||||
var result = urlArr.join(",");
|
||||
inputObj.val(result).trigger("change").trigger("validate");
|
||||
} else {
|
||||
var url = Config.fullmode ? Fast.api.cdnurl(data.url) : data.url;
|
||||
var url = Config.upload_fullmode=="1" ? Fast.api.cdnurl(data.url) : data.url;
|
||||
$("#" + input_id).val(url).trigger("change").trigger("validate");
|
||||
}
|
||||
}
|
||||
@@ -624,7 +624,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator'], function ($, undefined, U
|
||||
fileUploadMethod: 'POST',
|
||||
|
||||
// Set max file size to 20MB.
|
||||
fileMaxSize: 20 * 1024 * 1024,
|
||||
fileMaxSize: Config.upload_maxsize * 1024 * 1024,
|
||||
|
||||
// Allow to upload any file.
|
||||
fileAllowedTypes: ['*'],
|
||||
@@ -633,35 +633,8 @@ define(['jquery', 'bootstrap', 'upload', 'validator'], function ($, undefined, U
|
||||
'file.beforeUpload': function (files) {
|
||||
// Return false if you want to stop the file upload.
|
||||
},
|
||||
'file.uploaded': function (response) {
|
||||
// File was uploaded to the server.
|
||||
},
|
||||
'file.inserted': function ($file, response) {
|
||||
// File was inserted in the editor.
|
||||
},
|
||||
'file.error': function (error, response) {
|
||||
// Bad link.
|
||||
if (error.code == 1) { }
|
||||
|
||||
// No link in upload response.
|
||||
else if (error.code == 2) {}
|
||||
|
||||
// Error during file upload.
|
||||
else if (error.code == 3) { }
|
||||
|
||||
// Parsing response failed.
|
||||
else if (error.code == 4) { }
|
||||
|
||||
// File too text-large.
|
||||
else if (error.code == 5) {}
|
||||
|
||||
// Invalid file type.
|
||||
else if (error.code == 6) {}
|
||||
|
||||
// File can be uploaded only to same domain in IE 8 and IE 9.
|
||||
else if (error.code == 7) {}
|
||||
|
||||
// Response contains the original server response to the request if available.
|
||||
'image.beforeUpload': function (images) {
|
||||
// Return false if you want to stop the image upload.
|
||||
}
|
||||
},
|
||||
|
||||
@@ -672,58 +645,19 @@ define(['jquery', 'bootstrap', 'upload', 'validator'], function ($, undefined, U
|
||||
imageUploadURL: uploadUrl,
|
||||
|
||||
// Additional upload params.
|
||||
imageUploadParams: {from: 'editor'},
|
||||
imageUploadParams: {save_path: 'editor'},
|
||||
|
||||
// Set request type.
|
||||
imageUploadMethod: 'POST',
|
||||
|
||||
// Set max image size to 5MB.
|
||||
imageMaxSize: 5 * 1024 * 1024,
|
||||
imageMaxSize: Config.upload_maxsize * 1024 * 1024,
|
||||
|
||||
// Allow to upload PNG and JPG.
|
||||
imageAllowedTypes: ['jpeg', 'jpg', 'png'],
|
||||
|
||||
events: {
|
||||
'image.beforeUpload': function (images) {
|
||||
// Return false if you want to stop the image upload.
|
||||
},
|
||||
'image.uploaded': function (response) {
|
||||
// Image was uploaded to the server.
|
||||
},
|
||||
'image.inserted': function ($img, response) {
|
||||
// Image was inserted in the editor.
|
||||
},
|
||||
'image.replaced': function ($img, response) {
|
||||
// Image was replaced in the editor.
|
||||
},
|
||||
'image.error': function (error, response) {
|
||||
// Bad link.
|
||||
if (error.code == 1) { }
|
||||
|
||||
// No link in upload response.
|
||||
else if (error.code == 2) { }
|
||||
|
||||
// Error during image upload.
|
||||
else if (error.code == 3) { }
|
||||
|
||||
// Parsing response failed.
|
||||
else if (error.code == 4) {}
|
||||
|
||||
// Image too text-large.
|
||||
else if (error.code == 5) { }
|
||||
|
||||
// Invalid image type.
|
||||
else if (error.code == 6) { }
|
||||
|
||||
// Image can be uploaded only to same domain in IE 8 and IE 9.
|
||||
else if (error.code == 7) { }
|
||||
|
||||
// Response contains the original server response to the request if available.
|
||||
}
|
||||
},
|
||||
|
||||
// Set a preloader.
|
||||
imageManagerPreloader: "/images/loader.gif",
|
||||
imageManagerPreloader: Config.admin_path+"/images/loading.gif",
|
||||
|
||||
// Set page size.
|
||||
imageManagerPageSize: 20,
|
||||
@@ -732,7 +666,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator'], function ($, undefined, U
|
||||
imageManagerScrollOffset: 10,
|
||||
|
||||
// Set the load images request URL.
|
||||
imageManagerLoadURL: Config.admin_path+"/files/list",
|
||||
imageManagerLoadURL: Config.admin_path+"/files/felist",
|
||||
|
||||
// Set the load images request type.
|
||||
imageManagerLoadMethod: "GET",
|
||||
@@ -744,7 +678,7 @@ define(['jquery', 'bootstrap', 'upload', 'validator'], function ($, undefined, U
|
||||
imageManagerDeleteURL: Config.admin_path+"/files/delete",
|
||||
|
||||
// Set the delete image request type.
|
||||
imageManagerDeleteMethod: "DELETE",
|
||||
imageManagerDeleteMethod: "POST",
|
||||
|
||||
// Additional delete params.
|
||||
imageManagerDeleteParams: {param: 'value'},
|
||||
|
||||
Reference in New Issue
Block a user