|
|
@ -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,17 +25,26 @@ 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,
|
|
|
|
opacity: 0,
|
|
|
|
opacity: 0,
|
|
|
|
easing: 'easeInOutQuad',
|
|
|
|
easing: 'easeInOutQuad',
|
|
|
|
complete: function() {
|
|
|
|
complete: function () {
|
|
|
|
document.getElementById('loader').style.display = 'none';
|
|
|
|
document.getElementById('loader').style.display = 'none';
|
|
|
|
document.getElementById('loader').style.visibility = 'hidden';
|
|
|
|
document.getElementById('loader').style.visibility = 'hidden';
|
|
|
|
new Animate().object({
|
|
|
|
new Animate().object({
|
|
|
@ -40,15 +52,11 @@ class Entry {
|
|
|
|
duration: 10,
|
|
|
|
duration: 10,
|
|
|
|
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,9 +67,8 @@ 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)
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -101,8 +107,8 @@ class Entry {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var reader = new FileReader();
|
|
|
|
var reader = new FileReader();
|
|
|
|
// Closure to capture the file information.
|
|
|
|
// Closure to capture the file information.
|
|
|
|
reader.onload = (function(theFile) {
|
|
|
|
reader.onload = (function (theFile) {
|
|
|
|
return function(f) {
|
|
|
|
return function (f) {
|
|
|
|
// Render thumbnail.
|
|
|
|
// Render thumbnail.
|
|
|
|
var span = document.createElement('span');
|
|
|
|
var span = document.createElement('span');
|
|
|
|
span.innerHTML = [
|
|
|
|
span.innerHTML = [
|
|
|
@ -135,8 +141,8 @@ class Entry {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var reader = new FileReader();
|
|
|
|
var reader = new FileReader();
|
|
|
|
// Closure to capture the file information.
|
|
|
|
// Closure to capture the file information.
|
|
|
|
reader.onload = (function(theFile) {
|
|
|
|
reader.onload = (function (theFile) {
|
|
|
|
return function(f) {
|
|
|
|
return function (f) {
|
|
|
|
// Render thumbnail.
|
|
|
|
// Render thumbnail.
|
|
|
|
var span = document.createElement('span');
|
|
|
|
var span = document.createElement('span');
|
|
|
|
span.innerHTML = [
|
|
|
|
span.innerHTML = [
|
|
|
|