2015-02-03 07:58:58 +08:00
|
|
|
|
2015-11-19 01:32:29 +08:00
|
|
|
import ko from 'ko';
|
2016-06-07 05:57:52 +08:00
|
|
|
import {$html, 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
|
|
|
|
2015-11-19 01:32:29 +08:00
|
|
|
class AbstractAppStore
|
|
|
|
{
|
|
|
|
constructor()
|
2015-02-03 07:58:58 +08:00
|
|
|
{
|
|
|
|
this.allowLanguagesOnSettings = ko.observable(true);
|
|
|
|
this.allowLanguagesOnLogin = ko.observable(true);
|
|
|
|
|
|
|
|
this.interfaceAnimation = ko.observable(true);
|
|
|
|
|
|
|
|
this.interfaceAnimation.subscribe(function (bValue) {
|
2016-06-07 05:57:52 +08:00
|
|
|
const bAnim = bMobileDevice || !bValue;
|
|
|
|
$html.toggleClass('rl-anim', !bAnim).toggleClass('no-rl-anim', bAnim);
|
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'));
|
|
|
|
|
|
|
|
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
|
|
|
|
2015-11-19 01:32:29 +08:00
|
|
|
export {AbstractAppStore, AbstractAppStore as default};
|