1
0
Fork 0
mirror of https://github.com/SunRed/haste-server.git synced 2024-11-23 17:50:19 +01:00

fixed eslint formatting

This commit is contained in:
zneix 2020-08-28 23:57:50 +02:00
parent 9255094ec4
commit d303416dba
5 changed files with 36 additions and 35 deletions

1
.gitignore vendored
View file

@ -1,6 +1,7 @@
node_modules node_modules
.vscode .vscode
data data
data-test
*.swp *.swp
*.swo *.swo

View file

@ -10,6 +10,11 @@ const HasteUtils = require('./lib/util');
const utils = new HasteUtils(); const utils = new HasteUtils();
//load config and set some defaults
const config = require('./config');
config.port = config.port || 7777;
config.host = config.host || '127.0.0.1';
//set up logger //set up logger
winston.add(new winston.transports.Console({ winston.add(new winston.transports.Console({
level: config.logging.level, level: config.logging.level,
@ -19,11 +24,6 @@ winston.add(new winston.transports.Console({
), ),
})); }));
//load config and set some defaults
const config = require('./config');
config.port = config.port || 7777;
config.host = config.host || '127.0.0.1';
//defaulting storage type to file //defaulting storage type to file
if (!config.storage){ if (!config.storage){
config.storage = { config.storage = {

View file

@ -130,7 +130,7 @@ haste.prototype.configureKey = enable => {
let $this; let $this;
$('#box2 .function').each(function(){ $('#box2 .function').each(function(){
$this = $(this); $this = $(this);
for (el of enable){ for (const el of enable){
if ($this.hasClass(el)){ if ($this.hasClass(el)){
$this.addClass('enabled'); $this.addClass('enabled');
return true; return true;
@ -315,7 +315,7 @@ haste.prototype.configureButtons = function(){
} }
} }
]; ];
for (button of this.buttons){ for (const button of this.buttons){
this.configureButton(button); this.configureButton(button);
} }
}; };
@ -346,7 +346,7 @@ haste.prototype.configureButton = function(options){
haste.prototype.configureShortcuts = function(){ haste.prototype.configureShortcuts = function(){
let _this = this; let _this = this;
$(document.body).keydown(function(evt){ $(document.body).keydown(function(evt){
for (button of _this.buttons){ for (const button of _this.buttons){
if (button.shortcut && button.shortcut(evt)){ if (button.shortcut && button.shortcut(evt)){
evt.preventDefault(); evt.preventDefault();
button.action(); button.action();