degnome/Header — pull request #1 by RedDevil01 (2012-02-09 09:53:13+00:00)
Title: Changes and Queries

Changes Done:

- css integrated for other colors(red and blue) as well.
- css structure and naming changed to improve readability.
- option to activate mini version of the header added.
- option to change the default icon set added.
- html demonstrates a configurable Widget.
- reference to the widget container class applied inside the widget creation in jQuery and not in the html (as requested)

Queries:

if you look into line numbers 78 to 87 in the javascript the event handlers for the icon clicks, mouseover mouseout are defined here in the init function as shown below:

($("#" + this.options.Name + " " + '.' + this.css.Icon)).click(function (event) {
------> ClickedIconIndex = this.attributes[1].value;
return _this.IconClicked(ClickedIconIndex);
});
($("#" + this.options.Name + " " + '.' + this.css.Icon)).mouseover(function (event) {
------> return _this.IconMouseOver(this.attributes[1].value, ClickedIconIndex);
});
return ($("#" + this.options.Name + " " + '.' + this.css.Icon)).mouseout(function (event) {
------> return _this.IconMouseOut(this.attributes[1].value, ClickedIconIndex);
});

when converted from coffee script:

($ "#"+this.options.Name+" "+'.' +this.css.Icon).click (event) =>
ClickedIconIndex = this.attributes[1].value # manual changes in javascript!!
@IconClicked(ClickedIconIndex)

($ "#"+this.options.Name+" "+'.' +this.css.Icon).mouseover (event) =>
@IconMouseOver(this.attributes[1].value,ClickedIconIndex) # manual changes in javascript!!

($ "#"+this.options.Name+" "+'.' +this.css.Icon).mouseout (event) =>
@IconMouseOut(this.attributes[1].value,ClickedIconIndex)

we get javascript:

($("#" + this.options.Name + " " + '.' + this.css.Icon)).click(function (event) {
------> ClickedIconIndex = _this.attributes[1].value;
return _this.IconClicked(ClickedIconIndex);
});
($("#" + this.options.Name + " " + '.' + this.css.Icon)).mouseover(function (event) {
------> return _this.IconMouseOver(_this.attributes[1].value, ClickedIconIndex);
});
return ($("#" + this.options.Name + " " + '.' + this.css.Icon)).mouseout(function (event) {
------> return _this.IconMouseOut(_this.attributes[1].value, ClickedIconIndex);
});

this change has been manually made in the javascript . we havent yet figurd out a way to get the required code in java from coffee. Looking forward to you opinion regarding this.