2021-07-07 14:14:20 +01:00
|
|
|
const activate = require('./activate');
|
2019-01-28 22:36:47 +05:30
|
|
|
const themeLoader = require('./loader');
|
2021-07-07 14:14:20 +01:00
|
|
|
const storage = require('./storage');
|
|
|
|
const getJSON = require('./to-json');
|
2019-01-28 22:36:47 +05:30
|
|
|
|
2021-07-07 14:14:20 +01:00
|
|
|
const settingsCache = require('../../../shared/settings-cache');
|
2021-07-06 14:54:02 +01:00
|
|
|
|
2017-02-21 23:26:19 +00:00
|
|
|
module.exports = {
|
2021-07-07 14:14:20 +01:00
|
|
|
/*
|
|
|
|
* Load the currently active theme
|
|
|
|
*/
|
2021-07-07 13:49:40 +01:00
|
|
|
init: async () => {
|
2021-07-07 14:14:20 +01:00
|
|
|
const themeName = settingsCache.get('active_theme');
|
2021-07-07 13:49:40 +01:00
|
|
|
|
2021-07-07 14:14:20 +01:00
|
|
|
return activate.loadAndActivate(themeName);
|
2017-03-13 16:30:35 +00:00
|
|
|
},
|
2021-02-22 17:30:25 +00:00
|
|
|
/**
|
|
|
|
* Load all inactive themes
|
|
|
|
*/
|
2021-07-07 14:14:20 +01:00
|
|
|
loadInactiveThemes: themeLoader.loadAllThemes,
|
|
|
|
/**
|
|
|
|
* Methods used in the API
|
|
|
|
*/
|
|
|
|
api: {
|
|
|
|
getJSON,
|
|
|
|
activate: activate.activate,
|
|
|
|
getZip: storage.getZip,
|
|
|
|
setFromZip: storage.setFromZip,
|
|
|
|
destroy: storage.destroy
|
2021-02-22 17:30:25 +00:00
|
|
|
}
|
2017-02-21 23:26:19 +00:00
|
|
|
};
|