ro
1e37580869
dropped in js from the old site to begin the process of wiring up the API, but this time around, scripts will be served directly in browswer rather than being transpiled through NPM/Babel, eliminating the need for NPM. also scripting will new modularized and served specifically for the requirements of the page loading it. no more front loading everything. only script that is needed for that page will be retrieved. if no scripting is needed, none will be loaded. The only casualty so far has been syntax highlighting due to prismjs still being a common js module, but either this will be replaced with another library or a custom syntax enginge will be created at a later date
31 lines
649 B
JavaScript
31 lines
649 B
JavaScript
import PageEditor from "./PageEditor";
|
|
export default class PostIndex {
|
|
//--------------------------
|
|
// constructor
|
|
//--------------------------
|
|
constructor(page) {
|
|
this.currentPage = null;
|
|
this.choosePage(page);
|
|
this.start();
|
|
}
|
|
//--------------------------
|
|
// methods
|
|
//--------------------------
|
|
start() {}
|
|
choosePage(page) {
|
|
this.currentPage = "";
|
|
switch (page) {
|
|
case "edit":
|
|
case "add":
|
|
this.currentPage = new PageEditor();
|
|
break;
|
|
default:
|
|
//just chill
|
|
break;
|
|
}
|
|
}
|
|
//--------------------------
|
|
// event handlers
|
|
//--------------------------
|
|
}
|