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:
parent
9255094ec4
commit
d303416dba
5 changed files with 36 additions and 35 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,6 +1,7 @@
|
|||
node_modules
|
||||
.vscode
|
||||
data
|
||||
data-test
|
||||
|
||||
*.swp
|
||||
*.swo
|
||||
|
|
10
server.js
10
server.js
|
@ -10,6 +10,11 @@ const HasteUtils = require('./lib/util');
|
|||
|
||||
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
|
||||
winston.add(new winston.transports.Console({
|
||||
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
|
||||
if (!config.storage){
|
||||
config.storage = {
|
||||
|
|
|
@ -130,7 +130,7 @@ haste.prototype.configureKey = enable => {
|
|||
let $this;
|
||||
$('#box2 .function').each(function(){
|
||||
$this = $(this);
|
||||
for (el of enable){
|
||||
for (const el of enable){
|
||||
if ($this.hasClass(el)){
|
||||
$this.addClass('enabled');
|
||||
return true;
|
||||
|
@ -315,7 +315,7 @@ haste.prototype.configureButtons = function(){
|
|||
}
|
||||
}
|
||||
];
|
||||
for (button of this.buttons){
|
||||
for (const button of this.buttons){
|
||||
this.configureButton(button);
|
||||
}
|
||||
};
|
||||
|
@ -346,7 +346,7 @@ haste.prototype.configureButton = function(options){
|
|||
haste.prototype.configureShortcuts = function(){
|
||||
let _this = this;
|
||||
$(document.body).keydown(function(evt){
|
||||
for (button of _this.buttons){
|
||||
for (const button of _this.buttons){
|
||||
if (button.shortcut && button.shortcut(evt)){
|
||||
evt.preventDefault();
|
||||
button.action();
|
||||
|
|
Loading…
Reference in a new issue