2018-09-07 19:24:09 +03:00
|
|
|
// No inspection for unused var `css` because it's used for css bundle
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
2022-03-06 11:38:59 +04:00
|
|
|
import '../styles/main.pcss';
|
2018-09-07 19:24:09 +03:00
|
|
|
|
2018-09-19 01:47:32 +03:00
|
|
|
/**
|
|
|
|
* Module Dispatcher
|
2022-03-06 11:38:59 +04:00
|
|
|
*
|
2018-09-19 01:47:32 +03:00
|
|
|
* @see {@link https://github.com/codex-team/moduleDispatcher}
|
|
|
|
* @author CodeX
|
|
|
|
*/
|
|
|
|
import ModuleDispatcher from 'module-dispatcher';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Import modules
|
|
|
|
*/
|
|
|
|
import Writing from './modules/writing';
|
2018-10-20 17:54:15 +03:00
|
|
|
import Page from './modules/page';
|
2019-03-14 08:19:37 +03:00
|
|
|
import Extensions from './modules/extensions';
|
2022-06-16 21:37:37 +08:00
|
|
|
import Sidebar from './modules/sidebar';
|
2022-07-26 09:56:20 +05:30
|
|
|
import HawkCatcher from '@hawk.so/javascript';
|
2018-09-19 01:47:32 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Main app class
|
|
|
|
*/
|
|
|
|
class Docs {
|
2018-09-07 19:24:09 +03:00
|
|
|
/**
|
2022-03-06 11:38:59 +04:00
|
|
|
* @class
|
2018-09-07 19:24:09 +03:00
|
|
|
*/
|
|
|
|
constructor() {
|
2018-09-19 01:47:32 +03:00
|
|
|
this.writing = new Writing();
|
2018-10-20 17:54:15 +03:00
|
|
|
this.page = new Page();
|
2019-03-14 08:19:37 +03:00
|
|
|
this.extensions = new Extensions();
|
2022-06-16 21:37:37 +08:00
|
|
|
this.sidebar = new Sidebar();
|
2022-07-26 09:56:20 +05:30
|
|
|
if (window.config.hawkClientToken) {
|
|
|
|
this.hawk = new HawkCatcher(window.config.hawkClientToken);
|
|
|
|
}
|
2018-09-19 01:47:32 +03:00
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', (event) => {
|
|
|
|
this.docReady();
|
|
|
|
});
|
2019-02-15 17:56:56 +03:00
|
|
|
|
|
|
|
console.log('CodeX Docs initialized');
|
2018-09-19 01:47:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Document is ready
|
|
|
|
*/
|
|
|
|
docReady() {
|
|
|
|
this.moduleDispatcher = new ModuleDispatcher({
|
2022-03-06 11:38:59 +04:00
|
|
|
Library: this,
|
2018-09-19 01:47:32 +03:00
|
|
|
});
|
2018-09-07 19:24:09 +03:00
|
|
|
}
|
2018-09-19 01:47:32 +03:00
|
|
|
}
|
|
|
|
|
2018-10-03 12:26:41 +03:00
|
|
|
export default new Docs();
|