2021-07-07 16:14:20 +03:00
|
|
|
const activate = require('./activate');
|
2019-01-28 20:06:47 +03:00
|
|
|
const themeLoader = require('./loader');
|
2021-07-07 16:14:20 +03:00
|
|
|
const storage = require('./storage');
|
|
|
|
const getJSON = require('./to-json');
|
2019-01-28 20:06:47 +03:00
|
|
|
|
2021-07-07 16:14:20 +03:00
|
|
|
const settingsCache = require('../../../shared/settings-cache');
|
2021-07-06 16:54:02 +03:00
|
|
|
|
2017-02-22 02:26:19 +03:00
|
|
|
module.exports = {
|
2021-07-07 16:14:20 +03:00
|
|
|
/*
|
|
|
|
* Load the currently active theme
|
|
|
|
*/
|
2021-07-07 15:49:40 +03:00
|
|
|
init: async () => {
|
2021-07-07 16:14:20 +03:00
|
|
|
const themeName = settingsCache.get('active_theme');
|
2021-07-07 15:49:40 +03:00
|
|
|
|
2021-07-07 16:14:20 +03:00
|
|
|
return activate.loadAndActivate(themeName);
|
2017-03-13 19:30:35 +03:00
|
|
|
},
|
2021-02-22 20:30:25 +03:00
|
|
|
/**
|
|
|
|
* Load all inactive themes
|
|
|
|
*/
|
2021-07-07 16:14:20 +03: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 20:30:25 +03:00
|
|
|
}
|
2017-02-22 02:26:19 +03:00
|
|
|
};
|