summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js
Side-by-side diff
Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js') (more/less context) (show whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js34
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
@@ -89,32 +89,47 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.SimpleMessagePanel, Clippe
if (this.getElement('text') != null) {
this.getElement('text').innerHTML = aValue;
}
},
//-------------------------------------------------------------------------
'type': function () {
return this._type;
},
'setType': function (aValue) {
- if (this.getElement('icon') != null) {
- MochiKit.DOM.removeElementClass(this.getId('icon'), this._type);
- MochiKit.DOM.addElementClass(this.getId('icon'), aValue);
- }
+// if (this.getElement('icon') != null) {
+// MochiKit.DOM.removeElementClass(this.getId('icon'), this._type);
+// MochiKit.DOM.addElementClass(this.getId('icon'), aValue);
+// }
this._type = aValue;
},
+ 'icon': function () {
+ var type = this.type();
+ var result;
+
+ if (type == 'ALERT') {
+ result = '!';
+ } else if (type == 'INFO') {
+ result = 'i';
+ } else if (type == 'ERROR') {
+ result = '!';
+ }
+
+ return result;
+ },
+
//-------------------------------------------------------------------------
'buttons': function () {
return this._buttons;
},
'setButtons': function (someValues) {
MochiKit.Iter.forEach(this.buttonComponents(), MochiKit.Base.methodcaller('clear'));
this._buttons = someValues;
if (this.getElement('buttonArea') != null) {
@@ -123,35 +138,38 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.SimpleMessagePanel, Clippe
},
//.........................................................................
'buttonComponents': function () {
return this._buttonComponents;
},
//-------------------------------------------------------------------------
'renderSelf': function() {
this.append(this.element(), {tag:'div', cls:'SimpleMessagePanel', id:this.getId('panel'), children: [
- {tag:'div', cls:'header', children:[]},
+// {tag:'div', cls:'header', children:[]},
{tag:'div', cls:'body', children:[
- {tag:'div', id:this.getId('icon'), cls:'img ' + this.type(), children:[{tag:'div'}]},
+// {tag:'div', id:this.getId('icon'), cls:'img ' + this.type(), children:[{tag:'div'}]},
+ {tag:'div', /*id:this.getId('icon'),*/ cls:'img ' + this.type(), children:[{tag:'canvas', id:this.getId('icon')}]},
{tag:'h3', id:this.getId('title'), html:this.title()},
{tag:'p', id:this.getId('text'), html:this.text()},
{tag:'div', id:this.getId('container')},
{tag:'div', id:this.getId('buttonArea'), cls:'buttonArea', children:[]}
- ]},
- {tag:'div', cls:'footer', children:[]}
+ ]}
+// {tag:'div', cls:'footer', children:[]}
]});
+ Clipperz.PM.UI.Canvas.marks[this.icon()](this.getElement('icon'), "#ffffff");
+
MochiKit.Signal.connect(this.getId('panel'), 'onkeydown', this, 'keyDownHandler');
this.renderButtons();
},
//-------------------------------------------------------------------------
'renderButtons': function () {
this.getElement('buttonArea').innerHTML = '';
MochiKit.Base.map(MochiKit.Base.bind(function (aButton) {
var buttonElement;