partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 62c43d4396e501b61af23bd1c98a7bcbf065b769
parent 2e496985dec654425f2a289c2de70200ff67cb2a
Author: felicitus <felicitus@felicitus-MS-7369.(none)>
Date:   Wed,  7 Sep 2011 03:30:18 +0200

Added tip of the day preferences

Diffstat:
Afrontend/js/Components/User/TipOfTheDayPreferences.js | 28++++++++++++++++++++++++++++
Mfrontend/js/Components/User/UserPreferences.js | 5+++--
2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/frontend/js/Components/User/TipOfTheDayPreferences.js b/frontend/js/Components/User/TipOfTheDayPreferences.js @@ -0,0 +1,27 @@ +Ext.define('PartKeepr.TipOfTheDayPreferencesPanel', { + extend: 'Ext.form.FormPanel', + title: i18n("Tip of the Day"), + bodyStyle: 'background:#DBDBDB;padding: 10px;', + initComponent: function () { + this.displayTipsOnLoginCheckbox = Ext.create("Ext.form.field.Checkbox", { + boxLabel: i18n("Display tips on login"), + handler: Ext.bind(this.showTipsHandler, this) + }); + + this.resetTipsButton = Ext.create("Ext.button.Button", { + text: i18n("Mark Tips at ") + }); + + this.items = [ this.displayTipsOnLoginCheckbox, + this.resetTipsButton ]; + + this.callParent(); + }, + /** + * Handler when the "show tips" checkbox was clicked. + */ + showTipsHandler: function (checkbox, checked) { + PartKeepr.getApplication().setUserPreference("partkeepr.tipoftheday.showtips", checked); + } +}); + + \ No newline at end of file diff --git a/frontend/js/Components/User/UserPreferences.js b/frontend/js/Components/User/UserPreferences.js @@ -6,8 +6,9 @@ Ext.define('PartKeepr.UserPreferencePanel', { initComponent: function () { this.passwordChangePanel = Ext.create("PartKeepr.UserPasswordChangePanel"); - - this.items = [ this.passwordChangePanel ]; + this.tipsPanel = Ext.create("PartKeepr.TipOfTheDayPreferencesPanel"); + + this.items = [ this.tipsPanel, this.passwordChangePanel ]; this.callParent(); } }); \ No newline at end of file