You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-15 23:00:36 +02:00
First pass at linting lib dir
This commit is contained in:
@ -3,14 +3,14 @@ const SyncTargetRegistry = require('lib/SyncTargetRegistry');
|
||||
const ObjectUtils = require('lib/ObjectUtils');
|
||||
const { _ } = require('lib/locale.js');
|
||||
|
||||
const shared = {}
|
||||
const shared = {};
|
||||
|
||||
shared.init = function(comp) {
|
||||
if (!comp.state) comp.state = {};
|
||||
comp.state.checkSyncConfigResult = null;
|
||||
comp.state.settings = {};
|
||||
comp.state.changedSettingKeys = [];
|
||||
}
|
||||
};
|
||||
|
||||
shared.checkSyncConfig = async function(comp, settings) {
|
||||
const syncTargetId = settings['sync.target'];
|
||||
@ -19,7 +19,7 @@ shared.checkSyncConfig = async function(comp, settings) {
|
||||
comp.setState({ checkSyncConfigResult: 'checking' });
|
||||
const result = await SyncTargetClass.checkConfig(ObjectUtils.convertValuesToFunctions(options));
|
||||
comp.setState({ checkSyncConfigResult: result });
|
||||
}
|
||||
};
|
||||
|
||||
shared.checkSyncConfigMessages = function(comp) {
|
||||
const result = comp.state.checkSyncConfigResult;
|
||||
@ -35,7 +35,7 @@ shared.checkSyncConfigMessages = function(comp) {
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
};
|
||||
|
||||
shared.updateSettingValue = function(comp, key, value) {
|
||||
const settings = Object.assign({}, comp.state.settings);
|
||||
@ -47,18 +47,18 @@ shared.updateSettingValue = function(comp, key, value) {
|
||||
settings: settings,
|
||||
changedSettingKeys: changedSettingKeys,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
shared.saveSettings = function(comp) {
|
||||
for (let key in comp.state.settings) {
|
||||
if (!comp.state.settings.hasOwnProperty(key)) continue;
|
||||
if (comp.state.changedSettingKeys.indexOf(key) < 0) continue;
|
||||
console.info("Saving", key, comp.state.settings[key]);
|
||||
console.info('Saving', key, comp.state.settings[key]);
|
||||
Setting.setValue(key, comp.state.settings[key]);
|
||||
}
|
||||
|
||||
comp.setState({ changedSettingKeys: [] });
|
||||
}
|
||||
};
|
||||
|
||||
shared.settingsToComponents = function(comp, device, settings) {
|
||||
const keys = Setting.keys(true, device);
|
||||
@ -76,8 +76,8 @@ shared.settingsToComponents = function(comp, device, settings) {
|
||||
settingComps.push(settingComp);
|
||||
}
|
||||
|
||||
return settingComps
|
||||
}
|
||||
return settingComps;
|
||||
};
|
||||
|
||||
shared.settingsToComponents2 = function(comp, device, settings) {
|
||||
const keys = Setting.keys(true, device);
|
||||
@ -103,7 +103,7 @@ shared.settingsToComponents2 = function(comp, device, settings) {
|
||||
sectionComps.push(sectionComp);
|
||||
}
|
||||
|
||||
return sectionComps
|
||||
}
|
||||
return sectionComps;
|
||||
};
|
||||
|
||||
module.exports = shared;
|
||||
module.exports = shared;
|
||||
|
Reference in New Issue
Block a user