Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Common') (more/less context) (ignore whitespace changes)
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 @@ -401,16 +401,20 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.BaseComponent, /*Ext.Compo } 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)); }, //------------------------------------------------------------------------- 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 @@ -57,49 +57,57 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Button, Clipperz.PM.UI.Com '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 @@ -93,24 +93,39 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.SimpleMessagePanel, Clippe //------------------------------------------------------------------------- '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')); @@ -127,27 +142,30 @@ 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 () { |