Diffstat (limited to 'frontend/beta/js/Clipperz/PM/Components/Panels/MainPanel.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/PM/Components/Panels/MainPanel.js | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/Panels/MainPanel.js b/frontend/beta/js/Clipperz/PM/Components/Panels/MainPanel.js index c19a8a3..bab5fba 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Panels/MainPanel.js +++ b/frontend/beta/js/Clipperz/PM/Components/Panels/MainPanel.js | |||
@@ -54,123 +54,153 @@ Clipperz.PM.Components.Panels.MainPanel = function(anElement, args) { | |||
54 | 54 | ||
55 | Clipperz.NotificationCenter.register(null, 'directLoginAdded', this, 'directLoginAddedHandler'); | 55 | Clipperz.NotificationCenter.register(null, 'directLoginAdded', this, 'directLoginAddedHandler'); |
56 | Clipperz.NotificationCenter.register(null, 'directLoginUpdated', this, 'directLoginUpdatedHandler'); | 56 | Clipperz.NotificationCenter.register(null, 'directLoginUpdated', this, 'directLoginUpdatedHandler'); |
57 | Clipperz.NotificationCenter.register(null, 'directLoginRemoved', this, 'directLoginRemovedHandler'); | 57 | Clipperz.NotificationCenter.register(null, 'directLoginRemoved', this, 'directLoginRemovedHandler'); |
58 | 58 | ||
59 | Clipperz.NotificationCenter.register(null, 'accountLocked', this, 'accountLockedHandler'); | 59 | Clipperz.NotificationCenter.register(null, 'accountLocked', this, 'accountLockedHandler'); |
60 | 60 | ||
61 | MochiKit.Signal.connect(MochiKit.DOM.currentWindow(), 'onresize', this, 'resizeModalMask'); | 61 | MochiKit.Signal.connect(MochiKit.DOM.currentWindow(), 'onresize', this, 'resizeModalMask'); |
62 | this.render(); | 62 | this.render(); |
63 | 63 | ||
64 | return this; | 64 | return this; |
65 | } | 65 | } |
66 | 66 | ||
67 | //============================================================================= | 67 | //============================================================================= |
68 | 68 | ||
69 | YAHOO.extendX(Clipperz.PM.Components.Panels.MainPanel, Clipperz.PM.Components.Panels.BasePanel, { | 69 | YAHOO.extendX(Clipperz.PM.Components.Panels.MainPanel, Clipperz.PM.Components.Panels.BasePanel, { |
70 | 70 | ||
71 | 'toString': function() { | 71 | 'toString': function() { |
72 | return "Clipperz.PM.Components.Panels.MainPanel component"; | 72 | return "Clipperz.PM.Components.Panels.MainPanel component"; |
73 | }, | 73 | }, |
74 | 74 | ||
75 | //------------------------------------------------------------------------- | 75 | //------------------------------------------------------------------------- |
76 | 76 | ||
77 | 'render': function() { | 77 | 'render': function() { |
78 | this.element().update(""); | 78 | this.element().update(""); |
79 | Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'table', id:'mainPanelTABLE', border:'0', cellspacing:'0', cellpadding:'0', children:[ | 79 | Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'table', id:'mainPanelTABLE', border:'0', cellspacing:'0', cellpadding:'0', children:[ |
80 | {tag:'tbody', children:[ | 80 | {tag:'tbody', children:[ |
81 | {tag:'tr', children:[ | 81 | {tag:'tr', children:[ |
82 | {tag:'td', width:'15', children:[ | 82 | {tag:'td', width:'15', children:[ |
83 | {tag:'div', cls:'mainPanelMinHeightDiv'} | 83 | {tag:'div', cls:'mainPanelMinHeightDiv'} |
84 | ]}, | 84 | ]}, |
85 | {tag:'td', valign:'top', id:'directLoginsTD', width:'200', children:[ | 85 | {tag:'td', valign:'top', id:'directLoginsTD', width:'200', children:[ |
86 | {tag:'div', id:'accountStatus', children:[ | ||
87 | {tag:'div', cls:'header', children:[{tag:'h5', cls:'title', htmlString:"Account info"}]}, | ||
88 | // {tag:'div', cls:'accountStatus', html:"early adopter"}, | ||
89 | {tag:'div', cls:'accountLevel', children:[ | ||
90 | {tag:'span', cls:'label', html:"status"}, | ||
91 | {tag:'span', cls:'status', html:"early adopter"} | ||
92 | ]}, | ||
93 | {tag:'div', cls:'accountLevel', children:[ | ||
94 | {tag:'span', cls:'label', html:"level"}, | ||
95 | // {tag:'span', cls:'level', html:"★☆☆☆"} | ||
96 | {tag:'span', cls:'level', html:"☆☆☆☆"} | ||
97 | ]}, | ||
98 | {tag:'div', cls:'accountExpiration', children:[ | ||
99 | {tag:'span', cls:'label', html:"expires"}, | ||
100 | // {tag:'span', cls:'expriation', html:"on 26 April 2014"} | ||
101 | {tag:'span', cls:'expriation', html:"never"} | ||
102 | ]}, | ||
103 | // {tag:'div', cls:'payButton', children:[ | ||
104 | // {tag:'a', href:'#', cls:'info', html:"info"} | ||
105 | // ]} | ||
106 | {tag:'div', id:'payButton', cls:'payButton'} | ||
107 | ]}, | ||
86 | {tag:'div', id:'directLoginsBlock', children:[ | 108 | {tag:'div', id:'directLoginsBlock', children:[ |
87 | {tag:'div', cls:'directLoginsBlockHeaderBox', children:[{tag:'h3', id:'directLoginTitle', htmlString:Clipperz.PM.Strings['mainPanelDirectLoginBlockLabel']}]}, | 109 | {tag:'div', cls:'directLoginsBlockHeaderBox', children:[{tag:'h3', id:'directLoginTitle', htmlString:Clipperz.PM.Strings['mainPanelDirectLoginBlockLabel']}]}, |
88 | {tag:'div', id:'directLoginsDescription', htmlString:Clipperz.PM.Strings['mainPanelDirectLoginBlockDescription']}, | 110 | {tag:'div', id:'directLoginsDescription', htmlString:Clipperz.PM.Strings['mainPanelDirectLoginBlockDescription']}, |
89 | {tag:'ul', id:'directLogins'} | 111 | {tag:'ul', id:'directLogins'} |
90 | ]} | 112 | ]} |
91 | ]}, | 113 | ]}, |
92 | {tag:'td', width:'15', children:[ | 114 | {tag:'td', width:'15', children:[ |
93 | {tag:'div', cls:'mainPanelMinHeightDiv'} | 115 | {tag:'div', cls:'mainPanelMinHeightDiv'} |
94 | ]}, | 116 | ]}, |
95 | {tag:'td', valign:'top', children:[ | 117 | {tag:'td', valign:'top', children:[ |
96 | {tag:'div', id:'mainContent', children:[ | 118 | {tag:'div', id:'mainContent', children:[ |
97 | {tag:'div', id:'recordListBlockHeader'}, | 119 | {tag:'div', id:'recordListBlockHeader'}, |
98 | {tag:'div', id:'recordListAndDetailBlock', children:[ | 120 | {tag:'div', id:'recordListAndDetailBlock', children:[ |
99 | {tag:'table', id:'recordListAndDetailBlockTABLE', border:'0', cellspacing:'0', cellpadding:'0', children:[ | 121 | {tag:'table', id:'recordListAndDetailBlockTABLE', border:'0', cellspacing:'0', cellpadding:'0', children:[ |
100 | {tag:'tbody', children:[ | 122 | {tag:'tbody', children:[ |
101 | {tag:'tr', children:[ | 123 | {tag:'tr', children:[ |
102 | {tag:'td', valign:'top', width:'250', children:[ | 124 | {tag:'td', valign:'top', width:'250', children:[ |
103 | {tag:'div', id:'recordListBlock', children:[ | 125 | {tag:'div', id:'recordListBlock', children:[ |
104 | {tag:'div', id:'recordListFilterHeader'}, | 126 | {tag:'div', id:'recordListFilterHeader'}, |
105 | {tag:'ul', id:'records'} | 127 | {tag:'ul', id:'records'} |
106 | ]} | 128 | ]} |
107 | ]}, | 129 | ]}, |
108 | {tag:'td', id:'recordDetailSeparatorTD', rowspan:'2', valign:'top', bgcolor:'#ddddff', html:' '}, | 130 | {tag:'td', id:'recordDetailSeparatorTD', rowspan:'2', valign:'top', bgcolor:'#ddddff', html:' '}, |
109 | {tag:'td', valign:'top', children:[ | 131 | {tag:'td', valign:'top', children:[ |
110 | {tag:'div', id:'recordDetailMainBlock', children:[ | 132 | {tag:'div', id:'recordDetailMainBlock', children:[ |
111 | {tag:'div', id:'recordTitleTopBlock'}, | 133 | {tag:'div', id:'recordTitleTopBlock'}, |
112 | {tag:'div', id:'recordDetailBlock', children:[ | 134 | {tag:'div', id:'recordDetailBlock', children:[ |
113 | {tag:'div', id:'recordDetail'} | 135 | {tag:'div', id:'recordDetail'} |
114 | ]} | 136 | ]} |
115 | ]}, | 137 | ]}, |
116 | {tag:'div', id:'recordCreationWizardMainBlock', children:[ | 138 | {tag:'div', id:'recordCreationWizardMainBlock', children:[ |
117 | {tag:'div', id:'recordCreationWizard', html:"WIZARD"} | 139 | {tag:'div', id:'recordCreationWizard', html:"WIZARD"} |
118 | ]} | 140 | ]} |
119 | ]} | 141 | ]} |
120 | ]}, | 142 | ]}, |
121 | {tag:'tr', children:[ | 143 | {tag:'tr', children:[ |
122 | {tag:'td', id:'cardBoxLowerLeftTD', html:' '}, | 144 | {tag:'td', id:'cardBoxLowerLeftTD', html:' '}, |
123 | {tag:'td', id:'cardBoxLowerRightTD', html:' '} | 145 | {tag:'td', id:'cardBoxLowerRightTD', html:' '} |
124 | ]} | 146 | ]} |
125 | ]} | 147 | ]} |
126 | ]} | 148 | ]} |
127 | ]} | 149 | ]} |
128 | ]} | 150 | ]} |
129 | ]}, | 151 | ]}, |
130 | {tag:'td', width:'15', html:" "} | 152 | {tag:'td', width:'15', html:" "} |
131 | ]} | 153 | ]} |
132 | ]} | 154 | ]} |
133 | ]}); | 155 | ]}); |
134 | 156 | ||
135 | this.renderRecordListBlockHeader(); | 157 | this.renderRecordListBlockHeader(); |
136 | // this.renderRecordListFilterHeader(); | 158 | // this.renderRecordListFilterHeader(); |
137 | 159 | ||
138 | YAHOO.ext.Element.get('directLogins').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); | 160 | YAHOO.ext.Element.get('directLogins').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); |
139 | 161 | //TODO | |
162 | new YAHOO.ext.Button('payButton', {text:"Info", handler:this.payButtonHandler, scope:this}); | ||
163 | |||
140 | this.recordDetailComponent(); | 164 | this.recordDetailComponent(); |
141 | 165 | ||
142 | YAHOO.ext.Element.get('recordDetailMainBlock').setVisibilityMode(YAHOO.ext.Element.DISPLAY).show(); | 166 | YAHOO.ext.Element.get('recordDetailMainBlock').setVisibilityMode(YAHOO.ext.Element.DISPLAY).show(); |
143 | YAHOO.ext.Element.get('recordCreationWizardMainBlock').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); | 167 | YAHOO.ext.Element.get('recordCreationWizardMainBlock').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); |
144 | }, | 168 | }, |
169 | |||
170 | //------------------------------------------------------------------------- | ||
171 | |||
172 | 'payButtonHandler': function(anEvent) { | ||
173 | window.open('https://www.clipperz.com/pricing/', '_blank'); | ||
174 | }, | ||
145 | 175 | ||
146 | //------------------------------------------------------------------------- | 176 | //------------------------------------------------------------------------- |
147 | 177 | ||
148 | 'addNewRecordButton': function() { | 178 | 'addNewRecordButton': function() { |
149 | return this._addNewRecordButton; | 179 | return this._addNewRecordButton; |
150 | }, | 180 | }, |
151 | 181 | ||
152 | 'setAddNewRecordButton': function(aValue) { | 182 | 'setAddNewRecordButton': function(aValue) { |
153 | this._addNewRecordButton = aValue; | 183 | this._addNewRecordButton = aValue; |
154 | }, | 184 | }, |
155 | 185 | ||
156 | 'deleteRecordButton': function() { | 186 | 'deleteRecordButton': function() { |
157 | return this._deleteRecordButton; | 187 | return this._deleteRecordButton; |
158 | }, | 188 | }, |
159 | 189 | ||
160 | 'setDeleteRecordButton': function(aValue) { | 190 | 'setDeleteRecordButton': function(aValue) { |
161 | this._deleteRecordButton = aValue; | 191 | this._deleteRecordButton = aValue; |
162 | }, | 192 | }, |
163 | 193 | ||
164 | //------------------------------------------------------------------------- | 194 | //------------------------------------------------------------------------- |
165 | 195 | ||
166 | 'addNewRecord': function(anEvent) { | 196 | 'addNewRecord': function(anEvent) { |
167 | var deferredResult; | 197 | var deferredResult; |
168 | // var currentNumberOfRecords; | 198 | // var currentNumberOfRecords; |
169 | 199 | ||
170 | deferredResult = new MochiKit.Async.Deferred(); | 200 | deferredResult = new MochiKit.Async.Deferred(); |
171 | 201 | ||
172 | // currentNumberOfRecords = MochiKit.Base.keys(this.user().records()).length; | 202 | // currentNumberOfRecords = MochiKit.Base.keys(this.user().records()).length; |
173 | /* | 203 | /* |
174 | // if ((this.user().preferences().shouldShowDonationPanel()) && (currentNumberOfRecords > 0) && ((currentNumberOfRecords%10) == 0)) { | 204 | // if ((this.user().preferences().shouldShowDonationPanel()) && (currentNumberOfRecords > 0) && ((currentNumberOfRecords%10) == 0)) { |
175 | // if (true) { | 205 | // if (true) { |
176 | if ((this.user().preferences().shouldShowDonationPanel()) && (currentNumberOfRecords >= 5)) { | 206 | if ((this.user().preferences().shouldShowDonationPanel()) && (currentNumberOfRecords >= 5)) { |