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() {
|
Authentication (#22)
* Authorization added
* added secret to password, md5 hashing, removed promise from verifyToken, deleted links when not authorized
* added dbinsert script
* turned verifyToken to middleware, added description for dbinsert, added hidden csrf field in auth form
* added middlewares, user model and controller
* JSDoc fix
* wrong password processing fix
* added comments to dbinsert script, moved salt and passHash to singe db doc
* Moved salt to .env, upgradedscript for generating password was, fixed comments and JSDoc
* Deleted using salt (now user is only one), changed verifying password to bcrypt.compare, added httpyOnly property to jwt cookie
2019-03-06 13:22:57 +03:00
|
|
|
const { default: CodeStyler } = await import(/* webpackChunkName: "code-styling" */ './../classes/codeStyler');
|
2018-10-20 17:54:15 +03:00
|
|
|
|
|
|
|
return new CodeStyler({
|
2019-03-13 12:25:43 +03:00
|
|
|
selector: '.block-code__content'
|
2018-10-20 17:54:15 +03:00
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|