project restructuring
parent
18ba90b310
commit
540a9e4129
@ -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,8 +1,8 @@
|
||||
import * as DataEvent from '../events/DataEvent';
|
||||
import DateUtils from '../tools/DateUtils';
|
||||
import * as DataEvent from '../../../brain/tools/events/DataEvent';
|
||||
import DateUtils from '../../../brain/tools/utils/DateUtils';
|
||||
import { position } from 'caret-pos';
|
||||
import EventEmitter from '../events/EventEmitter';
|
||||
import * as EditorEvent from '../events/EditorEvent';
|
||||
import EventEmitter from '../../../brain/tools/events/EventEmitter';
|
||||
import * as EditorEvent from '../../../brain/tools/events/EditorEvent';
|
||||
class TextEditor extends EventEmitter {
|
||||
/**
|
||||
* Text Editor UI Component
|
Loading…
Reference in New Issue