2018-10-20 17:54:15 +03:00
|
|
|
/**
|
|
|
|
* @typedef {object} pageModuleSettings
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @class Page
|
|
|
|
* @classdesc Class for page module
|
|
|
|
*/
|
|
|
|
export default class Writing {
|
|
|
|
/**
|
|
|
|
* Creates base properties
|
|
|
|
*/
|
|
|
|
constructor() {
|
|
|
|
this.codeStyler = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called by ModuleDispatcher to initialize module from DOM
|
|
|
|
* @param {pageModuleSettings} settings - module settings
|
|
|
|
* @param {HTMLElement} moduleEl - module element
|
|
|
|
*/
|
|
|
|
init(settings = {}, moduleEl) {
|
|
|
|
this.codeStyler = this.createCodeStyling();
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Init code highlighting
|
|
|
|
*/
|
|
|
|
async createCodeStyling() {
|
|
|
|
const {default: CodeStyler} = await import(/* webpackChunkName: "code-styling" */ './../classes/codeStyler');
|
|
|
|
|
|
|
|
return new CodeStyler({
|
2018-12-09 21:45:28 +03:00
|
|
|
selector: '.block-code'
|
2018-10-20 17:54:15 +03:00
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|