Add project files.
This commit is contained in:
184
assets/js/pages/crud/file-upload/dropzonejs.js
Normal file
184
assets/js/pages/crud/file-upload/dropzonejs.js
Normal file
@ -0,0 +1,184 @@
|
||||
"use strict";
|
||||
// Class definition
|
||||
|
||||
var KTDropzoneDemo = function () {
|
||||
// Private functions
|
||||
var demo1 = function () {
|
||||
// single file upload
|
||||
$('#kt_dropzone_1').dropzone({
|
||||
url: "https://keenthemes.com/scripts/void.php", // Set the url for your upload script location
|
||||
paramName: "file", // The name that will be used to transfer the file
|
||||
maxFiles: 1,
|
||||
maxFilesize: 5, // MB
|
||||
addRemoveLinks: true,
|
||||
accept: function(file, done) {
|
||||
if (file.name == "justinbieber.jpg") {
|
||||
done("Naha, you don't.");
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// multiple file upload
|
||||
$('#kt_dropzone_2').dropzone({
|
||||
url: "https://keenthemes.com/scripts/void.php", // Set the url for your upload script location
|
||||
paramName: "file", // The name that will be used to transfer the file
|
||||
maxFiles: 10,
|
||||
maxFilesize: 10, // MB
|
||||
addRemoveLinks: true,
|
||||
accept: function(file, done) {
|
||||
if (file.name == "justinbieber.jpg") {
|
||||
done("Naha, you don't.");
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// file type validation
|
||||
$('#kt_dropzone_3').dropzone({
|
||||
url: "https://keenthemes.com/scripts/void.php", // Set the url for your upload script location
|
||||
paramName: "file", // The name that will be used to transfer the file
|
||||
maxFiles: 10,
|
||||
maxFilesize: 10, // MB
|
||||
addRemoveLinks: true,
|
||||
acceptedFiles: "image/*,application/pdf,.psd",
|
||||
accept: function(file, done) {
|
||||
if (file.name == "justinbieber.jpg") {
|
||||
done("Naha, you don't.");
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var demo2 = function () {
|
||||
// set the dropzone container id
|
||||
var id = '#kt_dropzone_4';
|
||||
|
||||
// set the preview element template
|
||||
var previewNode = $(id + " .dropzone-item");
|
||||
previewNode.id = "";
|
||||
var previewTemplate = previewNode.parent('.dropzone-items').html();
|
||||
previewNode.remove();
|
||||
|
||||
var myDropzone4 = new Dropzone(id, { // Make the whole body a dropzone
|
||||
url: "https://keenthemes.com/scripts/void.php", // Set the url for your upload script location
|
||||
parallelUploads: 20,
|
||||
previewTemplate: previewTemplate,
|
||||
maxFilesize: 1, // Max filesize in MB
|
||||
autoQueue: false, // Make sure the files aren't queued until manually added
|
||||
previewsContainer: id + " .dropzone-items", // Define the container to display the previews
|
||||
clickable: id + " .dropzone-select" // Define the element that should be used as click trigger to select files.
|
||||
});
|
||||
|
||||
myDropzone4.on("addedfile", function(file) {
|
||||
// Hookup the start button
|
||||
file.previewElement.querySelector(id + " .dropzone-start").onclick = function() { myDropzone4.enqueueFile(file); };
|
||||
$(document).find( id + ' .dropzone-item').css('display', '');
|
||||
$( id + " .dropzone-upload, " + id + " .dropzone-remove-all").css('display', 'inline-block');
|
||||
});
|
||||
|
||||
// Update the total progress bar
|
||||
myDropzone4.on("totaluploadprogress", function(progress) {
|
||||
$(this).find( id + " .progress-bar").css('width', progress + "%");
|
||||
});
|
||||
|
||||
myDropzone4.on("sending", function(file) {
|
||||
// Show the total progress bar when upload starts
|
||||
$( id + " .progress-bar").css('opacity', '1');
|
||||
// And disable the start button
|
||||
file.previewElement.querySelector(id + " .dropzone-start").setAttribute("disabled", "disabled");
|
||||
});
|
||||
|
||||
// Hide the total progress bar when nothing's uploading anymore
|
||||
myDropzone4.on("complete", function(progress) {
|
||||
var thisProgressBar = id + " .dz-complete";
|
||||
setTimeout(function(){
|
||||
$( thisProgressBar + " .progress-bar, " + thisProgressBar + " .progress, " + thisProgressBar + " .dropzone-start").css('opacity', '0');
|
||||
}, 300)
|
||||
|
||||
});
|
||||
|
||||
// Setup the buttons for all transfers
|
||||
document.querySelector( id + " .dropzone-upload").onclick = function() {
|
||||
myDropzone4.enqueueFiles(myDropzone4.getFilesWithStatus(Dropzone.ADDED));
|
||||
};
|
||||
|
||||
// Setup the button for remove all files
|
||||
document.querySelector(id + " .dropzone-remove-all").onclick = function() {
|
||||
$( id + " .dropzone-upload, " + id + " .dropzone-remove-all").css('display', 'none');
|
||||
myDropzone4.removeAllFiles(true);
|
||||
};
|
||||
|
||||
// On all files completed upload
|
||||
myDropzone4.on("queuecomplete", function(progress){
|
||||
$( id + " .dropzone-upload").css('display', 'none');
|
||||
});
|
||||
|
||||
// On all files removed
|
||||
myDropzone4.on("removedfile", function(file){
|
||||
if(myDropzone4.files.length < 1){
|
||||
$( id + " .dropzone-upload, " + id + " .dropzone-remove-all").css('display', 'none');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var demo3 = function () {
|
||||
// set the dropzone container id
|
||||
var id = '#kt_dropzone_5';
|
||||
|
||||
// set the preview element template
|
||||
var previewNode = $(id + " .dropzone-item");
|
||||
previewNode.id = "";
|
||||
var previewTemplate = previewNode.parent('.dropzone-items').html();
|
||||
previewNode.remove();
|
||||
|
||||
var myDropzone5 = new Dropzone(id, { // Make the whole body a dropzone
|
||||
url: "https://keenthemes.com/scripts/void.php", // Set the url for your upload script location
|
||||
parallelUploads: 20,
|
||||
maxFilesize: 1, // Max filesize in MB
|
||||
previewTemplate: previewTemplate,
|
||||
previewsContainer: id + " .dropzone-items", // Define the container to display the previews
|
||||
clickable: id + " .dropzone-select" // Define the element that should be used as click trigger to select files.
|
||||
});
|
||||
|
||||
myDropzone5.on("addedfile", function(file) {
|
||||
// Hookup the start button
|
||||
$(document).find( id + ' .dropzone-item').css('display', '');
|
||||
});
|
||||
|
||||
// Update the total progress bar
|
||||
myDropzone5.on("totaluploadprogress", function(progress) {
|
||||
$( id + " .progress-bar").css('width', progress + "%");
|
||||
});
|
||||
|
||||
myDropzone5.on("sending", function(file) {
|
||||
// Show the total progress bar when upload starts
|
||||
$( id + " .progress-bar").css('opacity', "1");
|
||||
});
|
||||
|
||||
// Hide the total progress bar when nothing's uploading anymore
|
||||
myDropzone5.on("complete", function(progress) {
|
||||
var thisProgressBar = id + " .dz-complete";
|
||||
setTimeout(function(){
|
||||
$( thisProgressBar + " .progress-bar, " + thisProgressBar + " .progress").css('opacity', '0');
|
||||
}, 300)
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
// public functions
|
||||
init: function() {
|
||||
demo1();
|
||||
demo2();
|
||||
demo3();
|
||||
}
|
||||
};
|
||||
}();
|
||||
|
||||
KTUtil.ready(function() {
|
||||
KTDropzoneDemo.init();
|
||||
});
|
||||
93
assets/js/pages/crud/file-upload/image-input.js
Normal file
93
assets/js/pages/crud/file-upload/image-input.js
Normal file
@ -0,0 +1,93 @@
|
||||
'use strict';
|
||||
|
||||
// Class definition
|
||||
var KTImageInputDemo = function () {
|
||||
// Private functions
|
||||
var initDemos = function () {
|
||||
// Example 1
|
||||
var avatar1 = new KTImageInput('kt_image_1');
|
||||
|
||||
// Example 2
|
||||
var avatar2 = new KTImageInput('kt_image_2');
|
||||
|
||||
// Example 3
|
||||
var avatar3 = new KTImageInput('kt_image_3');
|
||||
|
||||
// Example 4
|
||||
var avatar4 = new KTImageInput('kt_image_4');
|
||||
|
||||
avatar4.on('cancel', function(imageInput) {
|
||||
swal.fire({
|
||||
title: 'تصویر با موفقیت لغو شد.',
|
||||
type: 'success',
|
||||
buttonsStyling: false,
|
||||
confirmButtonText: 'عالی!',
|
||||
confirmButtonClass: 'btn btn-primary font-weight-bold'
|
||||
});
|
||||
});
|
||||
|
||||
avatar4.on('change', function(imageInput) {
|
||||
swal.fire({
|
||||
title: 'تصویر با موفقیت تغییر کرد',
|
||||
type: 'success',
|
||||
buttonsStyling: false,
|
||||
confirmButtonText: 'عالی!',
|
||||
confirmButtonClass: 'btn btn-primary font-weight-bold'
|
||||
});
|
||||
});
|
||||
|
||||
avatar4.on('remove', function(imageInput) {
|
||||
swal.fire({
|
||||
title: 'تصویر با موفقیت حذف شد.',
|
||||
type: 'error',
|
||||
buttonsStyling: false,
|
||||
confirmButtonText: 'فهمیدم!',
|
||||
confirmButtonClass: 'btn btn-primary font-weight-bold'
|
||||
});
|
||||
});
|
||||
|
||||
// Example 5
|
||||
var avatar5 = new KTImageInput('kt_image_5');
|
||||
|
||||
avatar5.on('cancel', function(imageInput) {
|
||||
swal.fire({
|
||||
title: 'تصویر با موفقیت تغییر کرد',
|
||||
type: 'success',
|
||||
buttonsStyling: false,
|
||||
confirmButtonText: 'عالی!',
|
||||
confirmButtonClass: 'btn btn-primary font-weight-bold'
|
||||
});
|
||||
});
|
||||
|
||||
avatar5.on('change', function(imageInput) {
|
||||
swal.fire({
|
||||
title: 'تصویر با موفقیت تغییر کرد',
|
||||
type: 'success',
|
||||
buttonsStyling: false,
|
||||
confirmButtonText: 'عالی!',
|
||||
confirmButtonClass: 'btn btn-primary font-weight-bold'
|
||||
});
|
||||
});
|
||||
|
||||
avatar5.on('remove', function(imageInput) {
|
||||
swal.fire({
|
||||
title: 'تصویر با موفقیت حذف شد.',
|
||||
type: 'error',
|
||||
buttonsStyling: false,
|
||||
confirmButtonText: 'فهمیدم!',
|
||||
confirmButtonClass: 'btn btn-primary font-weight-bold'
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
// public functions
|
||||
init: function() {
|
||||
initDemos();
|
||||
}
|
||||
};
|
||||
}();
|
||||
|
||||
KTUtil.ready(function() {
|
||||
KTImageInputDemo.init();
|
||||
});
|
||||
329
assets/js/pages/crud/file-upload/uppy.js
Normal file
329
assets/js/pages/crud/file-upload/uppy.js
Normal file
@ -0,0 +1,329 @@
|
||||
"use strict";
|
||||
|
||||
// Class definition
|
||||
var KTUppy = function () {
|
||||
const Tus = Uppy.Tus;
|
||||
const ProgressBar = Uppy.ProgressBar;
|
||||
const StatusBar = Uppy.StatusBar;
|
||||
const FileInput = Uppy.FileInput;
|
||||
const Informer = Uppy.Informer;
|
||||
|
||||
// to get uppy companions working, please refer to the official documentation here: https://uppy.io/docs/companion/
|
||||
const Dashboard = Uppy.Dashboard;
|
||||
const Dropbox = Uppy.Dropbox;
|
||||
const GoogleDrive = Uppy.GoogleDrive;
|
||||
const Instagram = Uppy.Instagram;
|
||||
const Webcam = Uppy.Webcam;
|
||||
|
||||
// Private functions
|
||||
var initUppy1 = function(){
|
||||
var id = '#kt_uppy_1';
|
||||
|
||||
var options = {
|
||||
proudlyDisplayPoweredByUppy: false,
|
||||
target: id,
|
||||
inline: true,
|
||||
replaceTargetContent: true,
|
||||
showProgressDetails: true,
|
||||
note: 'بدون محدودیت در نوع فایل',
|
||||
height: 470,
|
||||
metaFields: [
|
||||
{ id: 'name', name: 'Name', placeholder: 'file name' },
|
||||
{ id: 'caption', name: 'Caption', placeholder: 'describe what the image is about' }
|
||||
],
|
||||
browserBackButtonClose: true
|
||||
}
|
||||
|
||||
var uppyDashboard = Uppy.Core({
|
||||
autoProceed: true,
|
||||
restrictions: {
|
||||
maxFileSize: 1000000, // 1mb
|
||||
maxNumberOfFiles: 5,
|
||||
minNumberOfFiles: 1
|
||||
}
|
||||
});
|
||||
|
||||
uppyDashboard.use(Dashboard, options);
|
||||
uppyDashboard.use(Tus, { endpoint: 'https://master.tus.io/files/' });
|
||||
uppyDashboard.use(GoogleDrive, { target: Dashboard, companionUrl: 'https://companion.uppy.io' });
|
||||
uppyDashboard.use(Dropbox, { target: Dashboard, companionUrl: 'https://companion.uppy.io' });
|
||||
uppyDashboard.use(Instagram, { target: Dashboard, companionUrl: 'https://companion.uppy.io' });
|
||||
uppyDashboard.use(Webcam, { target: Dashboard });
|
||||
}
|
||||
|
||||
var initUppy2 = function(){
|
||||
var id = '#kt_uppy_2';
|
||||
|
||||
var options = {
|
||||
proudlyDisplayPoweredByUppy: false,
|
||||
target: id,
|
||||
inline: true,
|
||||
replaceTargetContent: true,
|
||||
showProgressDetails: true,
|
||||
note: 'امکان اپلود تصویر و ویدیوحداکثر تا سه فایل ',
|
||||
height: 470,
|
||||
metaFields: [
|
||||
{ id: 'name', name: 'Name', placeholder: 'file name' },
|
||||
{ id: 'caption', name: 'Caption', placeholder: 'describe what the image is about' }
|
||||
],
|
||||
browserBackButtonClose: true
|
||||
}
|
||||
|
||||
var uppyDashboard = Uppy.Core({
|
||||
autoProceed: true,
|
||||
restrictions: {
|
||||
maxFileSize: 1000000, // 1mb
|
||||
maxNumberOfFiles: 5,
|
||||
minNumberOfFiles: 1,
|
||||
allowedFileTypes: ['image/*', 'video/*']
|
||||
}
|
||||
});
|
||||
|
||||
uppyDashboard.use(Dashboard, options);
|
||||
uppyDashboard.use(Tus, { endpoint: 'https://master.tus.io/files/' });
|
||||
}
|
||||
|
||||
var initUppy3 = function(){
|
||||
var id = '#kt_uppy_3';
|
||||
|
||||
var uppyDrag = Uppy.Core({
|
||||
autoProceed: true,
|
||||
restrictions: {
|
||||
maxFileSize: 1000000, // 1mb
|
||||
maxNumberOfFiles: 5,
|
||||
minNumberOfFiles: 1,
|
||||
allowedFileTypes: ['image/*', 'video/*']
|
||||
}
|
||||
});
|
||||
|
||||
uppyDrag.use(Uppy.DragDrop, { target: id + ' .uppy-drag' });
|
||||
uppyDrag.use(ProgressBar, {
|
||||
target: id + ' .uppy-progress',
|
||||
hideUploadButton: false,
|
||||
hideAfterFinish: false
|
||||
});
|
||||
uppyDrag.use(Informer, { target: id + ' .uppy-informer' });
|
||||
uppyDrag.use(Tus, { endpoint: 'https://master.tus.io/files/' });
|
||||
|
||||
uppyDrag.on('complete', function(file) {
|
||||
var imagePreview = "";
|
||||
$.each(file.successful, function(index, value){
|
||||
var imageType = /image/;
|
||||
var thumbnail = "";
|
||||
if (imageType.test(value.type)){
|
||||
thumbnail = '<div class="uppy-thumbnail"><img src="'+value.uploadURL+'"/></div>';
|
||||
}
|
||||
var sizeLabel = "bytes";
|
||||
var filesize = value.size;
|
||||
if (filesize > 1024){
|
||||
filesize = filesize / 1024;
|
||||
sizeLabel = "kb";
|
||||
if(filesize > 1024){
|
||||
filesize = filesize / 1024;
|
||||
sizeLabel = "MB";
|
||||
}
|
||||
}
|
||||
imagePreview += '<div class="uppy-thumbnail-container" data-id="'+value.id+'">'+thumbnail+' <span class="uppy-thumbnail-label">'+value.name+' ('+ Math.round(filesize, 2) +' '+sizeLabel+')</span><span data-id="'+value.id+'" class="uppy-remove-thumbnail"><i class="flaticon2-cancel-music"></i></span></div>';
|
||||
});
|
||||
|
||||
$(id + ' .uppy-thumbnails').append(imagePreview);
|
||||
});
|
||||
|
||||
$(document).on('click', id + ' .uppy-thumbnails .uppy-remove-thumbnail', function(){
|
||||
var imageId = $(this).attr('data-id');
|
||||
uppyDrag.removeFile(imageId);
|
||||
$(id + ' .uppy-thumbnail-container[data-id="'+imageId+'"').remove();
|
||||
});
|
||||
}
|
||||
|
||||
var initUppy4 = function(){
|
||||
var id = '#kt_uppy_4';
|
||||
|
||||
var uppyDrag = Uppy.Core({
|
||||
autoProceed: false,
|
||||
restrictions: {
|
||||
maxFileSize: 1000000, // 1mb
|
||||
maxNumberOfFiles: 5,
|
||||
minNumberOfFiles: 1
|
||||
}
|
||||
});
|
||||
|
||||
uppyDrag.use(Uppy.DragDrop, { target: id + ' .uppy-drag' });
|
||||
uppyDrag.use(ProgressBar, { target: id + ' .uppy-progress' });
|
||||
uppyDrag.use(Informer, { target: id + ' .uppy-informer' });
|
||||
uppyDrag.use(Tus, { endpoint: 'https://master.tus.io/files/' });
|
||||
|
||||
uppyDrag.on('complete', function(file) {
|
||||
var imagePreview = "";
|
||||
$.each(file.successful, function(index, value){
|
||||
var imageType = /image/;
|
||||
var thumbnail = "";
|
||||
if (imageType.test(value.type)){
|
||||
thumbnail = '<div class="uppy-thumbnail"><img src="'+value.uploadURL+'"/></div>';
|
||||
}
|
||||
var sizeLabel = "bytes";
|
||||
var filesize = value.size;
|
||||
if (filesize > 1024){
|
||||
filesize = filesize / 1024;
|
||||
sizeLabel = "kb";
|
||||
if(filesize > 1024){
|
||||
filesize = filesize / 1024;
|
||||
sizeLabel = "MB";
|
||||
}
|
||||
}
|
||||
imagePreview += '<div class="uppy-thumbnail-container" data-id="'+value.id+'">'+thumbnail+' <span class="uppy-thumbnail-label">'+value.name+' ('+ Math.round(filesize, 2) +' '+sizeLabel+')</span><span data-id="'+value.id+'" class="uppy-remove-thumbnail"><i class="flaticon2-cancel-music"></i></span></div>';
|
||||
});
|
||||
|
||||
$(id + ' .uppy-thumbnails').append(imagePreview);
|
||||
});
|
||||
|
||||
var uploadBtn = $(id + ' .uppy-btn');
|
||||
uploadBtn.click(function () {
|
||||
uppyDrag.upload();
|
||||
});
|
||||
|
||||
$(document).on('click', id + ' .uppy-thumbnails .uppy-remove-thumbnail', function(){
|
||||
var imageId = $(this).attr('data-id');
|
||||
uppyDrag.removeFile(imageId);
|
||||
$(id + ' .uppy-thumbnail-container[data-id="'+imageId+'"').remove();
|
||||
});
|
||||
}
|
||||
|
||||
var initUppy5 = function(){
|
||||
// Uppy variables
|
||||
// For more info refer: https://uppy.io/
|
||||
var elemId = 'kt_uppy_5';
|
||||
var id = '#' + elemId;
|
||||
var $statusBar = $(id + ' .uppy-status');
|
||||
var $uploadedList = $(id + ' .uppy-list');
|
||||
var timeout;
|
||||
|
||||
var uppyMin = Uppy.Core({
|
||||
debug: true,
|
||||
autoProceed: true,
|
||||
showProgressDetails: true,
|
||||
restrictions: {
|
||||
maxFileSize: 1000000, // 1mb
|
||||
maxNumberOfFiles: 5,
|
||||
minNumberOfFiles: 1
|
||||
}
|
||||
});
|
||||
|
||||
uppyMin.use(FileInput, { target: id + ' .uppy-wrapper', pretty: false });
|
||||
uppyMin.use(Informer, { target: id + ' .uppy-informer' });
|
||||
|
||||
// demo file upload server
|
||||
uppyMin.use(Tus, { endpoint: 'https://master.tus.io/files/' });
|
||||
uppyMin.use(StatusBar, {
|
||||
target: id + ' .uppy-status',
|
||||
hideUploadButton: true,
|
||||
hideAfterFinish: false
|
||||
});
|
||||
|
||||
$(id + ' .uppy-FileInput-input').addClass('uppy-input-control').attr('id', elemId + '_input_control');
|
||||
$(id + ' .uppy-FileInput-container').append('<label class="uppy-input-label btn btn-light-primary btn-sm btn-bold" for="' + (elemId + '_input_control') + '">ضمیمه کردن فایل</label>');
|
||||
|
||||
var $fileLabel = $(id + ' .uppy-input-label');
|
||||
|
||||
uppyMin.on('upload', function(data) {
|
||||
$fileLabel.text("Uploading...");
|
||||
$statusBar.addClass('uppy-status-ongoing');
|
||||
$statusBar.removeClass('uppy-status-hidden');
|
||||
clearTimeout( timeout );
|
||||
});
|
||||
|
||||
uppyMin.on('complete', function(file) {
|
||||
$.each(file.successful, function(index, value){
|
||||
var sizeLabel = "bytes";
|
||||
var filesize = value.size;
|
||||
if (filesize > 1024){
|
||||
filesize = filesize / 1024;
|
||||
sizeLabel = "kb";
|
||||
|
||||
if(filesize > 1024){
|
||||
filesize = filesize / 1024;
|
||||
sizeLabel = "MB";
|
||||
}
|
||||
}
|
||||
var uploadListHtml = '<div class="uppy-list-item" data-id="'+value.id+'"><div class="uppy-list-label">'+value.name+' ('+ Math.round(filesize, 2) +' '+sizeLabel+')</div><span class="uppy-list-remove" data-id="'+value.id+'"><i class="flaticon2-cancel-music"></i></span></div>';
|
||||
$uploadedList.append(uploadListHtml);
|
||||
});
|
||||
|
||||
$fileLabel.text("Add more files");
|
||||
|
||||
$statusBar.addClass('uppy-status-hidden');
|
||||
$statusBar.removeClass('uppy-status-ongoing');
|
||||
});
|
||||
|
||||
$(document).on('click', id + ' .uppy-list .uppy-list-remove', function(){
|
||||
var itemId = $(this).attr('data-id');
|
||||
uppyMin.removeFile(itemId);
|
||||
$(id + ' .uppy-list-item[data-id="'+itemId+'"').remove();
|
||||
});
|
||||
}
|
||||
|
||||
var initUppy6 = function(){
|
||||
var id = '#kt_uppy_6';
|
||||
var options = {
|
||||
proudlyDisplayPoweredByUppy: false,
|
||||
target: id + ' .uppy-dashboard',
|
||||
inline: false,
|
||||
replaceTargetContent: true,
|
||||
showProgressDetails: true,
|
||||
note: 'بدون محدودیت در نوع فایل',
|
||||
height: 470,
|
||||
metaFields: [
|
||||
{ id: 'name', name: 'Name', placeholder: 'file name' },
|
||||
{ id: 'caption', name: 'Caption', placeholder: 'describe what the image is about' }
|
||||
],
|
||||
browserBackButtonClose: true,
|
||||
trigger: id + ' .uppy-btn'
|
||||
}
|
||||
|
||||
var uppyDashboard = Uppy.Core({
|
||||
autoProceed: true,
|
||||
restrictions: {
|
||||
maxFileSize: 1000000, // 1mb
|
||||
maxNumberOfFiles: 5,
|
||||
minNumberOfFiles: 1
|
||||
}
|
||||
});
|
||||
|
||||
uppyDashboard.use(Dashboard, options);
|
||||
uppyDashboard.use(Tus, { endpoint: 'https://master.tus.io/files/' });
|
||||
uppyDashboard.use(GoogleDrive, { target: Dashboard, companionUrl: 'https://companion.uppy.io' });
|
||||
uppyDashboard.use(Dropbox, { target: Dashboard, companionUrl: 'https://companion.uppy.io' });
|
||||
uppyDashboard.use(Instagram, { target: Dashboard, companionUrl: 'https://companion.uppy.io' });
|
||||
uppyDashboard.use(Webcam, { target: Dashboard });
|
||||
}
|
||||
|
||||
return {
|
||||
// public functions
|
||||
init: function() {
|
||||
initUppy1();
|
||||
initUppy2();
|
||||
initUppy3();
|
||||
initUppy4();
|
||||
initUppy5();
|
||||
initUppy6();
|
||||
|
||||
setTimeout(function() {
|
||||
swal.fire({
|
||||
"title": "توجه",
|
||||
"html": "نسخه های نمایشی Uppy از آدرس های <b> https://master.tus.io/files/ </b> از URL برای نمونه بارگیری مجدد استفاده می کند و پرونده های بارگذاری شده شما به طور موقت در سرورهای <b> tus.io </b> ذخیره می شوند.",
|
||||
"type": "info",
|
||||
"buttonsStyling": false,
|
||||
"confirmButtonClass": "btn btn-primary",
|
||||
"confirmButtonText": "باش ، فهمیدم",
|
||||
"onClose": function(e) {
|
||||
console.log('on close event fired!');
|
||||
}
|
||||
});
|
||||
}, 2000);
|
||||
}
|
||||
};
|
||||
}();
|
||||
|
||||
KTUtil.ready(function() {
|
||||
KTUppy.init();
|
||||
});
|
||||
Reference in New Issue
Block a user