|
|
@ -13,6 +13,9 @@ import * as Ease from '../tools/effects/Animate';
|
|
|
|
import TextEffects from '../tools/effects/TextEffects';
|
|
|
|
import TextEffects from '../tools/effects/TextEffects';
|
|
|
|
import EntryTasks from '../tasks/EntryTasks';
|
|
|
|
import EntryTasks from '../tasks/EntryTasks';
|
|
|
|
import TextEditor from '../tools/utilities/TextEditor';
|
|
|
|
import TextEditor from '../tools/utilities/TextEditor';
|
|
|
|
|
|
|
|
import TinyDatePicker from 'tiny-date-picker';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Entry {
|
|
|
|
class Entry {
|
|
|
|
//--------------------------
|
|
|
|
//--------------------------
|
|
|
|
// constructor
|
|
|
|
// constructor
|
|
|
@ -22,11 +25,20 @@ class Entry {
|
|
|
|
this.uploadFiles;
|
|
|
|
this.uploadFiles;
|
|
|
|
this.start();
|
|
|
|
this.start();
|
|
|
|
this.editor = new TextEditor();
|
|
|
|
this.editor = new TextEditor();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TinyDatePicker(document.getElementById('entry-date'), {
|
|
|
|
|
|
|
|
mode: 'dp-below',
|
|
|
|
|
|
|
|
format(date) {
|
|
|
|
|
|
|
|
//return date;
|
|
|
|
|
|
|
|
return self.dateUtils.getDate('origin', date);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//--------------------------
|
|
|
|
//--------------------------
|
|
|
|
// methods
|
|
|
|
// methods
|
|
|
|
//--------------------------
|
|
|
|
//--------------------------
|
|
|
|
start() {
|
|
|
|
start() {
|
|
|
|
|
|
|
|
let self = this;
|
|
|
|
new Animate().object({
|
|
|
|
new Animate().object({
|
|
|
|
targets: document.getElementById('loader'),
|
|
|
|
targets: document.getElementById('loader'),
|
|
|
|
duration: 300,
|
|
|
|
duration: 300,
|
|
|
@ -41,14 +53,10 @@ class Entry {
|
|
|
|
opacity: 1,
|
|
|
|
opacity: 1,
|
|
|
|
easing: 'easeInOutQuad',
|
|
|
|
easing: 'easeInOutQuad',
|
|
|
|
complete: function () {
|
|
|
|
complete: function () {
|
|
|
|
new TextEffects().scramble(document.getElementById('the-title'), 50, function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (document.getElementById('the-intro'))
|
|
|
|
if (document.getElementById('the-intro'))
|
|
|
|
document.getElementById('the-intro').style.opacity = 1;
|
|
|
|
document.getElementById('the-intro').style.opacity = 1;
|
|
|
|
if (document.getElementById('blog-entry'))
|
|
|
|
if (document.getElementById('blog-entry'))
|
|
|
|
document.getElementById('blog-entry').style.opacity = 1;
|
|
|
|
document.getElementById('blog-entry').style.opacity = 1;
|
|
|
|
//START SEcTION
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -59,8 +67,7 @@ class Entry {
|
|
|
|
document.getElementById('featured-image-drop').addEventListener('drop', this.handleDrop, false);
|
|
|
|
document.getElementById('featured-image-drop').addEventListener('drop', this.handleDrop, false);
|
|
|
|
document.getElementById('featured-click').addEventListener('change', this.handleClicked, false);
|
|
|
|
document.getElementById('featured-click').addEventListener('change', this.handleClicked, false);
|
|
|
|
|
|
|
|
|
|
|
|
if(document.getElementById('new-upload-link'))
|
|
|
|
if (document.getElementById('new-upload-link')) {
|
|
|
|
{
|
|
|
|
|
|
|
|
document.getElementById('new-upload-link').addEventListener('click', e => {
|
|
|
|
document.getElementById('new-upload-link').addEventListener('click', e => {
|
|
|
|
document.getElementById('featured-click').click();
|
|
|
|
document.getElementById('featured-click').click();
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -70,10 +77,9 @@ class Entry {
|
|
|
|
let edit = false;
|
|
|
|
let edit = false;
|
|
|
|
if (f.target.getAttribute('data-action') == 'blog-update')
|
|
|
|
if (f.target.getAttribute('data-action') == 'blog-update')
|
|
|
|
edit = true;
|
|
|
|
edit = true;
|
|
|
|
console.log('clicked')
|
|
|
|
|
|
|
|
new EntryTasks().submitPost(edit, Entry.uploadFiles).then((response) => {
|
|
|
|
new EntryTasks().submitPost(edit, Entry.uploadFiles).then((response) => {
|
|
|
|
let note = JSON.parse(response['response']['request'].response);
|
|
|
|
let note = JSON.parse(response['response']['request'].response);
|
|
|
|
console.log(note.message);
|
|
|
|
self.editor.notify(note.message);
|
|
|
|
}).catch((err) => {
|
|
|
|
}).catch((err) => {
|
|
|
|
console.log(err)
|
|
|
|
console.log(err)
|
|
|
|
});
|
|
|
|
});
|
|
|
|