Diffstat (limited to 'frontend/beta/js/Clipperz/PM/Components/TabPanel/TabPanelController.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/PM/Components/TabPanel/TabPanelController.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/TabPanel/TabPanelController.js b/frontend/beta/js/Clipperz/PM/Components/TabPanel/TabPanelController.js index c872462..b300ba6 100644 --- a/frontend/beta/js/Clipperz/PM/Components/TabPanel/TabPanelController.js +++ b/frontend/beta/js/Clipperz/PM/Components/TabPanel/TabPanelController.js | |||
@@ -1,120 +1,117 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2011 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz's Javascript Crypto Library. | 5 | This file is part of Clipperz Community Edition. |
6 | Javascript Crypto Library provides web developers with an extensive | 6 | Clipperz Community Edition is an online password manager. |
7 | and efficient set of cryptographic functions. The library aims to | ||
8 | obtain maximum execution speed while preserving modularity and | ||
9 | reusability. | ||
10 | For further information about its features and functionalities please | 7 | For further information about its features and functionalities please |
11 | refer to http://www.clipperz.com | 8 | refer to http://www.clipperz.com. |
12 | 9 | ||
13 | * Javascript Crypto Library is free software: you can redistribute | 10 | * Clipperz Community Edition is free software: you can redistribute |
14 | it and/or modify it under the terms of the GNU Affero General Public | 11 | it and/or modify it under the terms of the GNU Affero General Public |
15 | License as published by the Free Software Foundation, either version | 12 | License as published by the Free Software Foundation, either version |
16 | 3 of the License, or (at your option) any later version. | 13 | 3 of the License, or (at your option) any later version. |
17 | 14 | ||
18 | * Javascript Crypto Library is distributed in the hope that it will | 15 | * Clipperz Community Edition is distributed in the hope that it will |
19 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 16 | be useful, but WITHOUT ANY WARRANTY; without even the implied |
20 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
21 | See the GNU Affero General Public License for more details. | 18 | See the GNU Affero General Public License for more details. |
22 | 19 | ||
23 | * You should have received a copy of the GNU Affero General Public | 20 | * You should have received a copy of the GNU Affero General Public |
24 | License along with Javascript Crypto Library. If not, see | 21 | License along with Clipperz Community Edition. If not, see |
25 | <http://www.gnu.org/licenses/>. | 22 | <http://www.gnu.org/licenses/>. |
26 | 23 | ||
27 | */ | 24 | */ |
28 | 25 | ||
29 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
30 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
31 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } | 28 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } |
32 | if (typeof(Clipperz.PM.Components.TabPanel) == 'undefined') { Clipperz.PM.Components.TabPanel = {}; } | 29 | if (typeof(Clipperz.PM.Components.TabPanel) == 'undefined') { Clipperz.PM.Components.TabPanel = {}; } |
33 | 30 | ||
34 | Clipperz.PM.Components.TabPanel.TabPanelController = function(args) { | 31 | Clipperz.PM.Components.TabPanel.TabPanelController = function(args) { |
35 | args = args || {}; | 32 | args = args || {}; |
36 | 33 | ||
37 | Clipperz.PM.Components.TabPanel.TabPanelController.superclass.constructor.call(this); | 34 | Clipperz.PM.Components.TabPanel.TabPanelController.superclass.constructor.call(this); |
38 | 35 | ||
39 | this._name = args.name || 'undefined'; | 36 | this._name = args.name || 'undefined'; |
40 | this._config = args.config; | 37 | this._config = args.config; |
41 | this._selectedTab = args.selectedTab || ((MochiKit.Base.keys(args.config).length > 0) ? MochiKit.Base.keys(args.config)[0] : null); | 38 | this._selectedTab = args.selectedTab || ((MochiKit.Base.keys(args.config).length > 0) ? MochiKit.Base.keys(args.config)[0] : null); |
42 | 39 | ||
43 | this._tabs = {}; | 40 | this._tabs = {}; |
44 | this._panels = {}; | 41 | this._panels = {}; |
45 | 42 | ||
46 | Clipperz.NotificationCenter.register(null, 'selectTab', this, 'handleSelectTabNotification'); | 43 | Clipperz.NotificationCenter.register(null, 'selectTab', this, 'handleSelectTabNotification'); |
47 | return this; | 44 | return this; |
48 | } | 45 | } |
49 | 46 | ||
50 | //============================================================================= | 47 | //============================================================================= |
51 | 48 | ||
52 | YAHOO.extendX(Clipperz.PM.Components.TabPanel.TabPanelController, YAHOO.ext.util.Observable, { | 49 | YAHOO.extendX(Clipperz.PM.Components.TabPanel.TabPanelController, YAHOO.ext.util.Observable, { |
53 | 50 | ||
54 | //------------------------------------------------------------------------- | 51 | //------------------------------------------------------------------------- |
55 | 52 | ||
56 | 'name': function() { | 53 | 'name': function() { |
57 | return this._name; | 54 | return this._name; |
58 | }, | 55 | }, |
59 | 56 | ||
60 | //------------------------------------------------------------------------- | 57 | //------------------------------------------------------------------------- |
61 | 58 | ||
62 | 'tabs': function() { | 59 | 'tabs': function() { |
63 | return this._tabs; | 60 | return this._tabs; |
64 | }, | 61 | }, |
65 | 62 | ||
66 | //------------------------------------------------------------------------- | 63 | //------------------------------------------------------------------------- |
67 | 64 | ||
68 | 'panels': function() { | 65 | 'panels': function() { |
69 | return this._panels; | 66 | return this._panels; |
70 | }, | 67 | }, |
71 | 68 | ||
72 | //------------------------------------------------------------------------- | 69 | //------------------------------------------------------------------------- |
73 | 70 | ||
74 | 'config': function() { | 71 | 'config': function() { |
75 | return this._config; | 72 | return this._config; |
76 | }, | 73 | }, |
77 | 74 | ||
78 | //------------------------------------------------------------------------- | 75 | //------------------------------------------------------------------------- |
79 | 76 | ||
80 | 'selectedTab': function() { | 77 | 'selectedTab': function() { |
81 | return this._selectedTab; | 78 | return this._selectedTab; |
82 | }, | 79 | }, |
83 | 80 | ||
84 | 'setSelectedTab': function(aValue) { | 81 | 'setSelectedTab': function(aValue) { |
85 | this._selectedTab = aValue; | 82 | this._selectedTab = aValue; |
86 | }, | 83 | }, |
87 | 84 | ||
88 | //------------------------------------------------------------------------- | 85 | //------------------------------------------------------------------------- |
89 | 86 | ||
90 | 'setUp': function() { | 87 | 'setUp': function() { |
91 | vartabId; | 88 | vartabId; |
92 | 89 | ||
93 | //MochiKit.Logging.logDebug(">>> TabPanelController.setUp - config: " + Clipperz.Base.serializeJSON(this.config())); | 90 | //MochiKit.Logging.logDebug(">>> TabPanelController.setUp - config: " + Clipperz.Base.serializeJSON(this.config())); |
94 | for (tabId in this.config()) { | 91 | for (tabId in this.config()) { |
95 | vartabElement; | 92 | vartabElement; |
96 | varpanelElement; | 93 | varpanelElement; |
97 | 94 | ||
98 | //MochiKit.Logging.logDebug("--- TabPanelController.setUp - tabId: " + tabId); | 95 | //MochiKit.Logging.logDebug("--- TabPanelController.setUp - tabId: " + tabId); |
99 | //MochiKit.Logging.logDebug("--- TabPanelController.setUp - panelId: " + this.config()[tabId]); | 96 | //MochiKit.Logging.logDebug("--- TabPanelController.setUp - panelId: " + this.config()[tabId]); |
100 | tabElement = YAHOO.ext.Element.get(tabId); | 97 | tabElement = YAHOO.ext.Element.get(tabId); |
101 | tabElement.addClassOnOver("hover"); | 98 | tabElement.addClassOnOver("hover"); |
102 | MochiKit.Signal.connect(tabId, 'onclick', this, 'selectTabHandler'); | 99 | MochiKit.Signal.connect(tabId, 'onclick', this, 'selectTabHandler'); |
103 | 100 | ||
104 | panelElement = YAHOO.ext.Element.get(this.config()[tabId]); | 101 | panelElement = YAHOO.ext.Element.get(this.config()[tabId]); |
105 | 102 | ||
106 | this._tabs[tabId] = tabElement; | 103 | this._tabs[tabId] = tabElement; |
107 | this._panels[tabId] = panelElement; | 104 | this._panels[tabId] = panelElement; |
108 | 105 | ||
109 | if (tabId == this.selectedTab()) { | 106 | if (tabId == this.selectedTab()) { |
110 | tabElement.addClass('selectedTab'); | 107 | tabElement.addClass('selectedTab'); |
111 | panelElement.addClass('selectedPanel'); | 108 | panelElement.addClass('selectedPanel'); |
112 | } else { | 109 | } else { |
113 | panelElement.addClass('hiddenPanel'); | 110 | panelElement.addClass('hiddenPanel'); |
114 | } | 111 | } |
115 | } | 112 | } |
116 | //MochiKit.Logging.logDebug("<<< TabPanelController.setUp"); | 113 | //MochiKit.Logging.logDebug("<<< TabPanelController.setUp"); |
117 | }, | 114 | }, |
118 | 115 | ||
119 | //------------------------------------------------------------------------- | 116 | //------------------------------------------------------------------------- |
120 | 117 | ||