|
|
|
@ -1810,7 +1810,7 @@ class PostActions {
|
|
|
|
|
pageInfo.append('form_token', document.getElementById('form_token').value);
|
|
|
|
|
if (files.length > 0 && files != null) for(var i = 0; i < files.length; i++){
|
|
|
|
|
var file = files[i];
|
|
|
|
|
if (file.type.match('image.*') || file.type.match('video.mp4')) pageInfo.append('page_files[]', file, file.name);
|
|
|
|
|
if (file.type.match('image.*') || file.type.match('video.mp4') || file.type.match('audio.mpeg') || file.type.match('application.pdf') || file.type.match('text.plain') || file.type.match('text.rtf')) pageInfo.append('page_files[]', file, file.name);
|
|
|
|
|
else reject('Not an image file');
|
|
|
|
|
}
|
|
|
|
|
else //check to see if image exists
|
|
|
|
@ -5417,7 +5417,10 @@ class FileManager {
|
|
|
|
|
'image/png',
|
|
|
|
|
'image/svg',
|
|
|
|
|
'audio/mpeg',
|
|
|
|
|
'video/mp4'
|
|
|
|
|
'video/mp4',
|
|
|
|
|
'application/pdf',
|
|
|
|
|
'text/plain',
|
|
|
|
|
'text/rtf'
|
|
|
|
|
];
|
|
|
|
|
this.files = [];
|
|
|
|
|
this.sortedFiles = [];
|
|
|
|
@ -5444,7 +5447,21 @@ class FileManager {
|
|
|
|
|
if (item.className == 'img-item') url = item.style.backgroundImage.slice(4, -1).replace(/"/g, '');
|
|
|
|
|
else url = item.getAttribute('data-source');
|
|
|
|
|
currentFiles.push({
|
|
|
|
|
id: item.getAttribute('id'),
|
|
|
|
|
earl: url
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
this.reindexFiles(currentFiles, 0);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
_sortablejsDefault.default.create(this.fileList, {
|
|
|
|
|
onUpdate: (e)=>{
|
|
|
|
|
notify.alert('REINDEXING FILES', null);
|
|
|
|
|
let currentFiles = [];
|
|
|
|
|
let items = e.target.children;
|
|
|
|
|
for(let index = 0; index < items.length; index++){
|
|
|
|
|
var item = items[index];
|
|
|
|
|
let url = item.getAttribute('data-source');
|
|
|
|
|
currentFiles.push({
|
|
|
|
|
earl: url
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -5476,7 +5493,8 @@ class FileManager {
|
|
|
|
|
var self = this;
|
|
|
|
|
this.files = []; //clear files array
|
|
|
|
|
this.imageList.innerHTML = '';
|
|
|
|
|
for(var i = 0, file; file = files[i]; i++){
|
|
|
|
|
this.fileList.innerHTML = '';
|
|
|
|
|
for(var i = 0, file1; file1 = files[i]; i++){
|
|
|
|
|
var reader = new FileReader(); // Closure to capture the file information
|
|
|
|
|
reader.onload = ((theFile)=>{
|
|
|
|
|
return function(f) {
|
|
|
|
@ -5516,12 +5534,23 @@ class FileManager {
|
|
|
|
|
case 'audio/mpeg':
|
|
|
|
|
var sound = document.createElement('div');
|
|
|
|
|
sound.className = 'audio-item';
|
|
|
|
|
sound.setAttribute('data-source', f.target.result);
|
|
|
|
|
self.fileList.appendChild(sound);
|
|
|
|
|
self.files.push(theFile);
|
|
|
|
|
break;
|
|
|
|
|
case 'application/pdf':
|
|
|
|
|
case 'text/plain':
|
|
|
|
|
case 'text/rtf':
|
|
|
|
|
var file = document.createElement('div');
|
|
|
|
|
file.className = 'file-item';
|
|
|
|
|
file.setAttribute('data-source', f.target.result);
|
|
|
|
|
self.fileList.appendChild(file);
|
|
|
|
|
self.files.push(theFile);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
})(file); // Read in the image file as a data URL.
|
|
|
|
|
reader.readAsDataURL(file);
|
|
|
|
|
})(file1); // Read in the image file as a data URL.
|
|
|
|
|
reader.readAsDataURL(file1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// event handlers
|
|
|
|
|