author | Clipperz <info@clipperz.com> | 2013-01-08 15:21:04 (UTC) |
---|---|---|
committer | Clipperz <info@clipperz.com> | 2013-01-08 15:21:04 (UTC) |
commit | 816fc35420a434b1d54ae5833d617608f7456048 (patch) (unidiff) | |
tree | 95b8caf354083593d7775e4dda6f4c556b44a2d9 /frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js | |
parent | 267603e3aa3cf0029411e67ae14018b52344c296 (diff) | |
download | clipperz-816fc35420a434b1d54ae5833d617608f7456048.zip clipperz-816fc35420a434b1d54ae5833d617608f7456048.tar.gz clipperz-816fc35420a434b1d54ae5833d617608f7456048.tar.bz2 |
Updated version of /gamma
Tons of changes, included a new draft of the mobile version (still VERY rough)
Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js index 1992154..1d816a9 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js | |||
@@ -85,77 +85,95 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.SimpleMessagePanel, Clippe | |||
85 | 85 | ||
86 | 'setText': function (aValue) { | 86 | 'setText': function (aValue) { |
87 | this._text = aValue; | 87 | this._text = aValue; |
88 | 88 | ||
89 | if (this.getElement('text') != null) { | 89 | if (this.getElement('text') != null) { |
90 | this.getElement('text').innerHTML = aValue; | 90 | this.getElement('text').innerHTML = aValue; |
91 | } | 91 | } |
92 | }, | 92 | }, |
93 | 93 | ||
94 | //------------------------------------------------------------------------- | 94 | //------------------------------------------------------------------------- |
95 | 95 | ||
96 | 'type': function () { | 96 | 'type': function () { |
97 | return this._type; | 97 | return this._type; |
98 | }, | 98 | }, |
99 | 99 | ||
100 | 'setType': function (aValue) { | 100 | 'setType': function (aValue) { |
101 | if (this.getElement('icon') != null) { | 101 | // if (this.getElement('icon') != null) { |
102 | MochiKit.DOM.removeElementClass(this.getId('icon'), this._type); | 102 | // MochiKit.DOM.removeElementClass(this.getId('icon'), this._type); |
103 | MochiKit.DOM.addElementClass(this.getId('icon'), aValue); | 103 | // MochiKit.DOM.addElementClass(this.getId('icon'), aValue); |
104 | } | 104 | // } |
105 | 105 | ||
106 | this._type = aValue; | 106 | this._type = aValue; |
107 | }, | 107 | }, |
108 | 108 | ||
109 | 'icon': function () { | ||
110 | var type = this.type(); | ||
111 | var result; | ||
112 | |||
113 | if (type == 'ALERT') { | ||
114 | result = '!'; | ||
115 | } else if (type == 'INFO') { | ||
116 | result = 'i'; | ||
117 | } else if (type == 'ERROR') { | ||
118 | result = '!'; | ||
119 | } | ||
120 | |||
121 | return result; | ||
122 | }, | ||
123 | |||
109 | //------------------------------------------------------------------------- | 124 | //------------------------------------------------------------------------- |
110 | 125 | ||
111 | 'buttons': function () { | 126 | 'buttons': function () { |
112 | return this._buttons; | 127 | return this._buttons; |
113 | }, | 128 | }, |
114 | 129 | ||
115 | 'setButtons': function (someValues) { | 130 | 'setButtons': function (someValues) { |
116 | MochiKit.Iter.forEach(this.buttonComponents(), MochiKit.Base.methodcaller('clear')); | 131 | MochiKit.Iter.forEach(this.buttonComponents(), MochiKit.Base.methodcaller('clear')); |
117 | 132 | ||
118 | this._buttons = someValues; | 133 | this._buttons = someValues; |
119 | 134 | ||
120 | if (this.getElement('buttonArea') != null) { | 135 | if (this.getElement('buttonArea') != null) { |
121 | this.renderButtons(); | 136 | this.renderButtons(); |
122 | } | 137 | } |
123 | }, | 138 | }, |
124 | 139 | ||
125 | //......................................................................... | 140 | //......................................................................... |
126 | 141 | ||
127 | 'buttonComponents': function () { | 142 | 'buttonComponents': function () { |
128 | return this._buttonComponents; | 143 | return this._buttonComponents; |
129 | }, | 144 | }, |
130 | 145 | ||
131 | //------------------------------------------------------------------------- | 146 | //------------------------------------------------------------------------- |
132 | 147 | ||
133 | 'renderSelf': function() { | 148 | 'renderSelf': function() { |
134 | this.append(this.element(), {tag:'div', cls:'SimpleMessagePanel', id:this.getId('panel'), children: [ | 149 | this.append(this.element(), {tag:'div', cls:'SimpleMessagePanel', id:this.getId('panel'), children: [ |
135 | {tag:'div', cls:'header', children:[]}, | 150 | // {tag:'div', cls:'header', children:[]}, |
136 | {tag:'div', cls:'body', children:[ | 151 | {tag:'div', cls:'body', children:[ |
137 | {tag:'div', id:this.getId('icon'),cls:'img ' + this.type(), children:[{tag:'div'}]}, | 152 | // {tag:'div', id:this.getId('icon'),cls:'img ' + this.type(), children:[{tag:'div'}]}, |
153 | {tag:'div', /*id:this.getId('icon'),*/cls:'img ' + this.type(), children:[{tag:'canvas', id:this.getId('icon')}]}, | ||
138 | {tag:'h3', id:this.getId('title'),html:this.title()}, | 154 | {tag:'h3', id:this.getId('title'),html:this.title()}, |
139 | {tag:'p', id:this.getId('text'),html:this.text()}, | 155 | {tag:'p', id:this.getId('text'),html:this.text()}, |
140 | {tag:'div', id:this.getId('container')}, | 156 | {tag:'div', id:this.getId('container')}, |
141 | {tag:'div', id:this.getId('buttonArea'), cls:'buttonArea', children:[]} | 157 | {tag:'div', id:this.getId('buttonArea'), cls:'buttonArea', children:[]} |
142 | ]}, | 158 | ]} |
143 | {tag:'div', cls:'footer', children:[]} | 159 | // {tag:'div', cls:'footer', children:[]} |
144 | ]}); | 160 | ]}); |
145 | 161 | ||
162 | Clipperz.PM.UI.Canvas.marks[this.icon()](this.getElement('icon'), "#ffffff"); | ||
163 | |||
146 | MochiKit.Signal.connect(this.getId('panel'), 'onkeydown', this, 'keyDownHandler'); | 164 | MochiKit.Signal.connect(this.getId('panel'), 'onkeydown', this, 'keyDownHandler'); |
147 | 165 | ||
148 | this.renderButtons(); | 166 | this.renderButtons(); |
149 | }, | 167 | }, |
150 | 168 | ||
151 | //------------------------------------------------------------------------- | 169 | //------------------------------------------------------------------------- |
152 | 170 | ||
153 | 'renderButtons': function () { | 171 | 'renderButtons': function () { |
154 | this.getElement('buttonArea').innerHTML = ''; | 172 | this.getElement('buttonArea').innerHTML = ''; |
155 | 173 | ||
156 | MochiKit.Base.map(MochiKit.Base.bind(function (aButton) { | 174 | MochiKit.Base.map(MochiKit.Base.bind(function (aButton) { |
157 | var buttonElement; | 175 | var buttonElement; |
158 | var buttonComponent; | 176 | var buttonComponent; |
159 | 177 | ||
160 | // element = this.append(this.getElement('buttonArea'), {tag:'div', cls:'button' + (aButton['isDefault'] === true ? ' default' : ''), children:[ | 178 | // element = this.append(this.getElement('buttonArea'), {tag:'div', cls:'button' + (aButton['isDefault'] === true ? ' default' : ''), children:[ |
161 | // {tag:'a', href:'#'/*, id:this.getId('buttonLink')*/, html:aButton['text']} | 179 | // {tag:'a', href:'#'/*, id:this.getId('buttonLink')*/, html:aButton['text']} |