2015-11-19 01:32:29 +08:00
|
|
|
import ko from 'ko';
|
2020-07-15 20:25:51 +08:00
|
|
|
import { $htmlCL, bMobileDevice } from 'Common/Globals';
|
2016-06-16 07:36:44 +08:00
|
|
|
import * as Settings from 'Storage/Settings';
|
2015-02-03 07:58:58 +08:00
|
|
|
|
2019-07-05 03:19:24 +08:00
|
|
|
class AbstractAppStore {
|
2016-07-16 05:29:42 +08:00
|
|
|
constructor() {
|
2015-02-03 07:58:58 +08:00
|
|
|
this.allowLanguagesOnSettings = ko.observable(true);
|
|
|
|
this.allowLanguagesOnLogin = ko.observable(true);
|
2017-02-09 01:48:53 +08:00
|
|
|
this.newMoveToFolder = ko.observable(true);
|
2015-02-03 07:58:58 +08:00
|
|
|
|
|
|
|
this.interfaceAnimation = ko.observable(true);
|
|
|
|
|
2016-08-17 06:01:20 +08:00
|
|
|
this.interfaceAnimation.subscribe((value) => {
|
|
|
|
const anim = bMobileDevice || !value;
|
2020-07-15 20:25:51 +08:00
|
|
|
$htmlCL.toggle('rl-anim', !anim);
|
|
|
|
$htmlCL.toggle('no-rl-anim', anim);
|
2015-02-03 07:58:58 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
this.interfaceAnimation.valueHasMutated();
|
2015-02-03 18:42:06 +08:00
|
|
|
|
|
|
|
this.prem = ko.observable(false);
|
2015-05-03 04:22:32 +08:00
|
|
|
this.community = ko.observable(true);
|
2015-02-03 07:58:58 +08:00
|
|
|
}
|
|
|
|
|
2015-11-19 01:32:29 +08:00
|
|
|
populate() {
|
2015-02-03 07:58:58 +08:00
|
|
|
this.allowLanguagesOnLogin(!!Settings.settingsGet('AllowLanguagesOnLogin'));
|
|
|
|
this.allowLanguagesOnSettings(!!Settings.settingsGet('AllowLanguagesOnSettings'));
|
2017-02-09 01:48:53 +08:00
|
|
|
this.newMoveToFolder(!!Settings.settingsGet('NewMoveToFolder'));
|
2015-02-03 07:58:58 +08:00
|
|
|
|
|
|
|
this.interfaceAnimation(!!Settings.settingsGet('InterfaceAnimation'));
|
2015-02-03 18:42:06 +08:00
|
|
|
|
|
|
|
this.prem(!!Settings.settingsGet('PremType'));
|
2015-05-03 04:22:32 +08:00
|
|
|
this.community(!!Settings.settingsGet('Community'));
|
2015-11-19 01:32:29 +08:00
|
|
|
}
|
|
|
|
}
|
2015-02-03 07:58:58 +08:00
|
|
|
|
2019-07-05 03:19:24 +08:00
|
|
|
export { AbstractAppStore, AbstractAppStore as default };
|