summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/PM/UI/Common
Side-by-side diff
Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Common') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js4
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js34
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js34
3 files changed, 51 insertions, 21 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js
index 2a03fdf..b9d7adf 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js
@@ -385,48 +385,52 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.BaseComponent, /*Ext.Compo
},
//-------------------------------------------------------------------------
'getId': function(aValue) {
var result;
if (typeof(aValue) != 'undefined') {
result = this._ids[aValue];
if (typeof(result) == 'undefined') {
_Clipperz_PM_Components_base_id_ ++;
result = "Clipperz_PM_Components_" + aValue + "_" + _Clipperz_PM_Components_base_id_;
this._ids[aValue] = result;
}
} else {
// result = Clipperz.PM.UI.Common.Components.BaseComponent.superclass.getId.call(this);
throw "call to BaseComponent.getId with an undefined value";
}
return result;
},
+ 'getAnchor': function (aValue) {
+ return '#' + this.getId(aValue);
+ },
+
//-------------------------------------------------------------------------
'getElement': function(aValue) {
return Clipperz.DOM.get(this.getId(aValue));
},
//-------------------------------------------------------------------------
'hideElement': function(anElementName) {
MochiKit.Style.hideElement(this.getElement(anElementName));
},
'showElement': function(anElementName) {
MochiKit.Style.showElement(this.getElement(anElementName));
},
//-------------------------------------------------------------------------
'activate': function () {
this._isActive = true;
},
'deactivate': function () {
this._isActive = false;
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js
index 716d851..1010c9d 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js
@@ -41,65 +41,73 @@ Clipperz.PM.UI.Common.Components.Button = function(args) {
//=============================================================================
Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Button, Clipperz.PM.UI.Common.Components.BaseComponent, {
//-------------------------------------------------------------------------
'toString': function () {
return "Clipperz.PM.UI.Common.Components.Button component";
},
//-------------------------------------------------------------------------
'text': function () {
return this._text;
},
'isDefault': function () {
return this._isDefault;
},
//-------------------------------------------------------------------------
'renderSelf': function () {
- this.append(this.element(), {tag:'div', id:this.getId('wrapper'), cls:'button_wrapper', children:[
+/*
+ this.append(this.element(), {tag:'div', id:this.getId('button'), cls:'button_wrapper', children:[
{tag:'div', id:this.getId('bodyWrapper'), cls:'button_bodyWrapper', children:[
{tag:'div', id:this.getId('body'), cls:'button_body', children:[
{tag:'span', html:this.text()}
]},
{tag:'div', id:this.getId('footer'), cls:'button_footer'}
]}
]});
+*/
+/*
+ this.append(this.element(), {tag:'div', id:this.getId('button'), cls:'button', children:[
+ {tag:'span', html:this.text()}
+ ]});
+*/
+ this.append(this.element(), {tag:'a', id:this.getId('button'), cls:'button', html:this.text()});
if (this.isDefault()) {
- MochiKit.DOM.addElementClass(this.getId('wrapper'), 'default');
+ MochiKit.DOM.addElementClass(this.getId('button'), 'default');
}
- MochiKit.Signal.connect(this.getId('wrapper'), 'onmouseenter', this, 'handleOnMouseEnter');
- MochiKit.Signal.connect(this.getId('wrapper'), 'onmouseleave', this, 'handleOnMouseLeave');
- MochiKit.Signal.connect(this.getId('wrapper'), 'onmousedown', this, 'handleOnMouseDown');
- MochiKit.Signal.connect(this.getId('wrapper'), 'onclick', this, 'handleOnClick');
+// MochiKit.Signal.connect(this.getId('button'), 'onmouseenter', this, 'handleOnMouseEnter');
+// MochiKit.Signal.connect(this.getId('button'), 'onmouseleave', this, 'handleOnMouseLeave');
+// MochiKit.Signal.connect(this.getId('button'), 'onmousedown', this, 'handleOnMouseDown');
+ MochiKit.Signal.connect(this.getId('button'), 'onclick', this, 'handleOnClick');
},
//-------------------------------------------------------------------------
-
+/*
'handleOnMouseEnter': function (anEvent) {
- MochiKit.DOM.addElementClass(this.getId('wrapper'), 'hover');
+ MochiKit.DOM.addElementClass(this.getId('button'), 'hover');
},
'handleOnMouseLeave': function (anEvent) {
- MochiKit.DOM.removeElementClass(this.getId('wrapper'), 'hover');
- MochiKit.DOM.removeElementClass(this.getId('wrapper'), 'clicked');
+ MochiKit.DOM.removeElementClass(this.getId('button'), 'hover');
+ MochiKit.DOM.removeElementClass(this.getId('button'), 'clicked');
},
'handleOnMouseDown': function (anEvent) {
- MochiKit.DOM.addElementClass(this.getId('wrapper'), 'clicked');
+ MochiKit.DOM.addElementClass(this.getId('button'), 'clicked');
},
-
+*/
'handleOnClick': function (anEvent) {
MochiKit.Signal.signal(this, 'onclick', anEvent);
},
-
+
//-------------------------------------------------------------------------
__syntaxFix__: "syntax fix"
});
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
@@ -77,93 +77,111 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.SimpleMessagePanel, Clippe
}
},
//-------------------------------------------------------------------------
'text': function () {
return this._text;
},
'setText': function (aValue) {
this._text = aValue;
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) {
this.renderButtons();
}
},
//.........................................................................
'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;
var buttonComponent;
// element = this.append(this.getElement('buttonArea'), {tag:'div', cls:'button' + (aButton['isDefault'] === true ? ' default' : ''), children:[
// {tag:'a', href:'#'/*, id:this.getId('buttonLink')*/, html:aButton['text']}
// ]});
buttonElement = this.append(this.getElement('buttonArea'), {tag:'div'});
buttonComponent = new Clipperz.PM.UI.Common.Components.Button({'element':buttonElement, 'text':aButton['text'], 'isDefault':aButton['isDefault']});
this.buttonComponents().push(buttonComponent);
MochiKit.Signal.connect(buttonComponent, 'onclick', MochiKit.Base.method(this, 'buttonEventHandler', aButton));
}, this), MochiKit.Iter.reversed(this.buttons()));