project restructuring

pull/20/head
Ro 5 years ago
parent 18ba90b310
commit 540a9e4129

@ -1,4 +1,4 @@
import * as DataEvent from '../../utils/events/DataEvent'; import * as DataEvent from '../../tools/events/DataEvent';
const express = require('express'); const express = require('express');
const router = express.Router(); const router = express.Router();
const bCrypt = require('bcrypt-nodejs'); const bCrypt = require('bcrypt-nodejs');

@ -1,13 +1,13 @@
import DateUtils from '../../utils/tools/DateUtils'; import DateUtils from '../../../src/utils/DateUtils';
import Pages from '../../utils/content/Pages'; import Pages from '../../content/Pages';
import StringUtils from '../../utils/tools/StringUtils'; import StringUtils from '../../../src/utils/StringUtils';
import * as DataEvent from '../../utils/events/DataEvent'; import * as DataEvent from '../../../src/events/DataEvent';
import sanitize from 'sanitize-html'; import sanitize from 'sanitize-html';
import RightsManager, { import RightsManager, {
TASK_CREATE, TASK_CREATE,
TASK_UPDATE, TASK_UPDATE,
OBJECT_POST OBJECT_POST
} from '../../utils/tools/RightsManager'; } from '../../../src/utils/RightsManager';
const express = require('express'); const express = require('express');
const router = express.Router(); const router = express.Router();
const multer = require('multer'); const multer = require('multer');

@ -1,4 +1,4 @@
import Pages from '../../utils/content/Pages'; import Pages from '../../content/Pages';
const express = require('express'); const express = require('express');
const router = express.Router(); const router = express.Router();
const settings = require('../../../config/site-settings.json'); const settings = require('../../../config/site-settings.json');

@ -1,10 +1,9 @@
import DateUtils from '../../utils/tools/DateUtils'; import DateUtils from '../../../src/utils/DateUtils';
var express = require('express'); var express = require('express');
var router = express.Router(); var router = express.Router();
var hljs = require('highlight.js/lib/highlight'); var hljs = require('highlight.js/lib/highlight');
var hljs_md = require('highlight.js/lib/languages/markdown'); var hljs_md = require('highlight.js/lib/languages/markdown');
hljs.registerLanguage('markdown', hljs_md); hljs.registerLanguage('markdown', hljs_md);
var Sequelize = require('sequelize');
const dateUtils = new DateUtils(); const dateUtils = new DateUtils();
//-------------------------- //--------------------------
// POSTS // POSTS

@ -1,33 +0,0 @@
export const AUTH_STATUS = 'authStatus';
export const REQUEST_GOOD = 'requestGood';
export const REQUEST_LAME = 'requestLame';
export const IMG_REQUEST_GOOD = 'imgRequestGood';
export const IMG_REQUEST_LAME = 'imgRequestLame';
export const SETTINGS_LOADED = 'dataLoaded';
export const HTML_LOADED = 'htmlLoaded';
export const ARCHIVES_JSON_LOADED = 'archivesJSONLoaded';
export const ARCHIVES_PAGE_LOADED = 'archivesPAGELoaded';
export const ARCHIVES_ENTRY_LOADED = 'archivesEntryLoaded';
export const PROJECT_UPDATED = 'projectUpdated';
export const PROJECT_ADDED = 'projectAdded';
export const PROJECTS_SORTED = 'projectsSorted';
export const POST_IMAGE_ADDED = 'postImageAdded';
export const FEATURE_IMAGE_ADDED = 'featureImageAdded';
export const POST_ERROR = 'postError';
export const POST_ADDED = 'postAdded';
export const POST_UPDATED = 'postUpdated';
export const POST_DELETED = 'postImageAdded';
export const POSTS_SYNCED = 'postsSynced';
export const LOCAL_DB_READY = 'localDBReady';
export const SETTINGS_UPDATED = 'settingsUpdated';
export const AVATAR_UPLOADED = 'avatarUploaded';
export const SITE_BACKGROUND_UPLOADED = 'siteBackgroundUploaded';
class DataEvent {
//--------------------------
// methods
//--------------------------
//--------------------------
// event handlers
//--------------------------
}
export default new DataEvent();

@ -1,28 +0,0 @@
export const MEMBER_STATUS = "memberStatus";
export const LOGIN_STATUS = 'loginStatus';
export const SUPPORTER_FOUND = 'SUPPORTER FOUND';
export const SUPPORTER_LISTED = 'SUPPORTER LISTED';
export const SUPPORTER_NOT_FOUND = 'SUPPORTER NOT FOUND';
export const MEMBER_ADDED = 'MEMBER ADDED';
export const MEMBER_NOT_ADDED = 'MEMBER NOT ADDED';
export const MEMBER_LOGIN_GOOD = 'MEMBER LOGIN GOOD';
export const MEMBER_LOGIN_LAME = 'MEMBER LOGIN LAME';
export const MEMBER_EXISTS = 'USER ALREADY EXISTS';
export const MEMBER_LOGIN_MISSING = 'Missing credentials';
class AuthEvent
{
//--------------------------
// methods
//--------------------------
//--------------------------
// event handlers
//--------------------------
}
export default new AuthEvent

@ -1,14 +0,0 @@
export const EDITOR_DELETE = 'editorDelete';
export const EDITOR_UPLOAD_POST_IMAGE = 'editorUploadImage';
export const EDITOR_SAVE = 'editorSave';
export const EDITOR_UPDATE = 'editorUpdate';
class EditorEvent {
//--------------------------
// methods
//--------------------------
//--------------------------
// event handlers
//--------------------------
}
export default new EditorEvent();

@ -1,52 +0,0 @@
class EventEmitter {
//--------------------------
// constructor
//--------------------------
constructor() {
this.listeners = new Map();
}
//--------------------------
// methods
//--------------------------
addListener(label, callback) {
this.listeners.has(label) || this.listeners.set(label, []);
this.listeners.get(label).push(callback);
}
removeListener(label, callback) {
var isFunction = function(obj) {
return typeof obj == 'function' || false;
};
var listeners = this.listeners.get(label),
index;
if (listeners && listeners.length) {
index = listeners.reduce((i, listener, index) => {
return isFunction(listener) && listener === callback ? (i = index) : i;
}, -1);
if (index > -1) {
listeners.splice(index, 1);
this.listeners.set(label, listeners);
return true;
}
}
return false;
}
emitEvent(label, ...args) {
var listeners = this.listeners.get(label);
if (listeners && listeners.length) {
listeners.forEach(listener => {
listener(...args);
});
return true;
}
return false;
}
//--------------------------
// event handlers
//--------------------------
}
export default EventEmitter;

@ -1,6 +1,6 @@
import DataUtils, { REQUEST_TYPE_POST, CONTENT_TYPE_JSON } from '../../brain/utils/tools/DataUtils'; import DataUtils, { REQUEST_TYPE_POST, CONTENT_TYPE_JSON } from '../../brain/utils/tools/DataUtils';
import * as DataEvent from '../../brain/utils/events/DataEvent'; import * as DataEvent from '../../brain/utils/events/DataEvent';
import DashManager from './controllers/DashManager'; //import DashManager from './controllers/DashManager';
//import DBUtils from '../../../../../brain/utils/tools/DBUtils'; //import DBUtils from '../../../../../brain/utils/tools/DBUtils';
const dataUtils = new DataUtils(); const dataUtils = new DataUtils();
@ -22,7 +22,7 @@ export default class Base {
.getElementById('login-btn') .getElementById('login-btn')
.addEventListener('click', e => this.handleLogin(e)); .addEventListener('click', e => this.handleLogin(e));
} else { } else {
let dm = new DashManager(); //let dm = new DashManager();
} }
} }
//-------------------------- //--------------------------

@ -1,8 +1,8 @@
import * as DataEvent from '../events/DataEvent'; import * as DataEvent from '../../../brain/tools/events/DataEvent';
import DateUtils from '../tools/DateUtils'; import DateUtils from '../../../brain/tools/utils/DateUtils';
import { position } from 'caret-pos'; import { position } from 'caret-pos';
import EventEmitter from '../events/EventEmitter'; import EventEmitter from '../../../brain/tools/events/EventEmitter';
import * as EditorEvent from '../events/EditorEvent'; import * as EditorEvent from '../../../brain/tools/events/EditorEvent';
class TextEditor extends EventEmitter { class TextEditor extends EventEmitter {
/** /**
* Text Editor UI Component * Text Editor UI Component
Loading…
Cancel
Save