Author: pyaschenko
Date: 2010-12-03 10:23:12 -0500 (Fri, 03 Dec 2010)
New Revision: 20360
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Accordion.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/AccordionItem.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenu.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuGroup.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuItem.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanel.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanelItem.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tooltip.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js
Log:
http://jira.jboss.com/jira/browse/RF-9858
output components code refactoring
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Accordion.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Accordion.js 2010-12-03
15:19:27 UTC (rev 20359)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Accordion.js 2010-12-03
15:23:12 UTC (rev 20360)
@@ -37,7 +37,7 @@
* @param {Hash} options - params
* */
init : function (componentId, options) {
- rf.ui.TogglePanel.call(this, componentId, options);
+ $super.constructor.call(this, componentId, options);
this.items = [];
this.isKeepHeight = options["isKeepHeight"] || false
@@ -66,8 +66,10 @@
destroy: function () {
rf.Event.unbindById(this.id, "." + this.namespace);
-
- this.$super.destroy.call(this);
+ $super.destroy.call(this);
}
});
+
+ // define super class link
+ var $super = rf.ui.Accordion.$super;
})(jQuery, RichFaces);
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/AccordionItem.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/AccordionItem.js 2010-12-03
15:19:27 UTC (rev 20359)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/AccordionItem.js 2010-12-03
15:23:12 UTC (rev 20360)
@@ -37,7 +37,7 @@
* @param {Hash} options - params
* */
init : function (componentId, options) {
- rf.ui.TogglePanelItem.call(this, componentId, options);
+ $super.constructor.call(this, componentId, options);
this.index = options["index"];
this.getTogglePanel().getItems()[this.index] = this;
@@ -149,7 +149,10 @@
rf.Event.unbindById(this.id, "."+this.namespace);
- this.$super.destroy.call(this);
+ $super.destroy.call(this);
}
});
+
+ // define super class link
+ var $super = rf.ui.AccordionItem.$super;
})(jQuery, RichFaces);
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenu.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenu.js 2010-12-03
15:19:27 UTC (rev 20359)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenu.js 2010-12-03
15:23:12 UTC (rev 20360)
@@ -42,11 +42,11 @@
* @param {Hash} options - params
* */
init : function (componentId, options) {
- this.id = componentId;
+ $super.constructor.call(this, componentId);
this.items = [];
- this.attachToDom(componentId);
+ this.attachToDom();
- this.options = $.extend({}, __DEFAULT_OPTIONS, options || {});
+ this.options = $.extend(this.options, __DEFAULT_OPTIONS, options || {});
this.activeItem = this.__getValueInput().value;
this.nestingLevel = 0;
@@ -201,8 +201,12 @@
destroy: function () {
rf.Event.unbindById(this.id, "."+this.namespace);
-
- this.$super.destroy.call(this);
+ this.detach();
+ $super.destroy.call(this);
}
});
+
+ // define super class link
+ var $super = rf.ui.PanelMenu.$super;
+
})(jQuery, RichFaces);
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuGroup.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuGroup.js 2010-12-03
15:19:27 UTC (rev 20359)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuGroup.js 2010-12-03
15:23:12 UTC (rev 20360)
@@ -120,10 +120,9 @@
* @param {Hash} options - params
* */
init : function (componentId, options) {
- this.options = $.extend({}, __DEFAULT_OPTIONS, options || {});
+ $super.constructor.call(this, componentId);
+ this.options = $.extend(this.options, __DEFAULT_OPTIONS, options || {});
- rf.ui.PanelMenuItem.call(this, componentId);
-
if (!this.options.disabled) {
var menuGroup = this;
@@ -357,7 +356,10 @@
destroy: function () {
rf.Event.unbindById(this.id, "."+this.namespace);
- this.$super.destroy.call(this);
+ $super.destroy.call(this);
}
});
+
+ // define super class link
+ var $super = rf.ui.PanelMenuGroup.$super;
})(jQuery, RichFaces);
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuItem.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuItem.js 2010-12-03
15:19:27 UTC (rev 20359)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/PanelMenuItem.js 2010-12-03
15:23:12 UTC (rev 20360)
@@ -119,10 +119,10 @@
* @param {Hash} options - params
* */
init : function (componentId, options) {
- this.id = componentId;
- this.attachToDom(componentId);
+ $super.constructor.call(this, componentId);
+ this.attachToDom();
- this.options = $.extend({}, __DEFAULT_OPTIONS, this.options || {}, options ||
{});
+ this.options = $.extend(this.options, __DEFAULT_OPTIONS, options || {});
this.mode = this.options.mode
this.itemName = this.options.name
@@ -312,8 +312,11 @@
destroy: function () {
delete this.__rfPanelMenu().getItems()[this.itemName];
-
- rf.ui.PanelMenuItem.$super.destroy.call(this);
+ this.detach();
+ $super.destroy.call(this);
}
});
+
+ // define super class link
+ var $super = rf.ui.PanelMenuItem.$super;
})(jQuery, RichFaces);
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab.js 2010-12-03
15:19:27 UTC (rev 20359)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tab.js 2010-12-03
15:23:12 UTC (rev 20360)
@@ -37,7 +37,7 @@
* @param {Hash} options - params
* */
init : function (componentId, options) {
- rf.ui.TogglePanelItem.call(this, componentId, options);
+ $super.constructor.call(this, componentId, options);
this.index = options["index"];
this.getTogglePanel().getItems()[this.index] = this;
@@ -130,7 +130,10 @@
rf.Event.unbindById(this.id + ":header:active");
rf.Event.unbindById(this.id + ":header:inactive");
- this.$super.destroy.call(this);
+ $super.destroy.call(this);
}
});
+
+ // define super class link
+ var $super = rf.ui.Tab.$super;
})(jQuery, RichFaces);
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanel.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanel.js 2010-12-03
15:19:27 UTC (rev 20359)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanel.js 2010-12-03
15:23:12 UTC (rev 20360)
@@ -153,10 +153,10 @@
name:"TogglePanel",
init : function (componentId, options) {
- rf.BaseComponent.call(this, componentId);
- this.attachToDom(componentId);
+ $super.constructor.call(this, componentId);
+ this.attachToDom();
- this.options = options;
+ this.options = $.extend(this.options, options || {});
this.activeItem = this.options.activeItem;
this.items = this.options.items;
@@ -424,7 +424,11 @@
},
destroy: function () {
- rf.BaseComponent.prototype.destroy.call(this);
+ this.detach();
+ $super.destroy.call(this);
}
});
+
+ // define super class link
+ var $super = rf.ui.TogglePanel.$super;
})(jQuery, RichFaces);
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanelItem.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanelItem.js 2010-12-03
15:19:27 UTC (rev 20359)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanelItem.js 2010-12-03
15:23:12 UTC (rev 20360)
@@ -31,10 +31,10 @@
init : function (componentId, options) {
// call constructor of parent class
- rf.BaseComponent.call(this, componentId);
- this.attachToDom(componentId);
+ $super.constructor.call(this, componentId);
+ this.attachToDom();
- this.options = options;
+ this.options = $.extend(this.options, options || {});
this.name = this.options.name;
this.togglePanelId = this.options.togglePanelId;
this.switchMode = this.options.switchMode;
@@ -111,7 +111,11 @@
// class stuff
destroy: function () {
- rf.BaseComponent.prototype.destroy.call(this);
+ this.detach();
+ $super.destroy.call(this);
}
});
+
+ // define super class link
+ var $super = rf.ui.TogglePanelItem.$super;
})(jQuery, RichFaces);
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tooltip.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tooltip.js 2010-12-03
15:19:27 UTC (rev 20359)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/Tooltip.js 2010-12-03
15:23:12 UTC (rev 20360)
@@ -116,9 +116,9 @@
* @param {Hash} options - params
* */
init : function (componentId, options) {
- this.id = componentId
- this.options = $.extend({}, DEFAULT_OPTIONS, this.options || {}, options ||
{});
- this.attachToDom.call(this, componentId);
+ $super.constructor.call(this, componentId);
+ this.options = $.extend(this.options, DEFAULT_OPTIONS, options || {});
+ this.attachToDom();
this.mode = this.options.mode;
this.target = this.options.target;
@@ -286,7 +286,11 @@
},
destroy: function () {
- rf.ui.Tooltip.$super.destroy.call(this);
+ this.detach();
+ $super.destroy.call(this);
}
});
+
+ // define super class link
+ var $super = rf.ui.Tooltip.$super;
})(jQuery, RichFaces);
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2010-12-03
15:19:27 UTC (rev 20359)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2010-12-03
15:23:12 UTC (rev 20360)
@@ -53,10 +53,10 @@
$super.constructor.call(this,id);
this.markerId = id;
- this.attachToDom(id);
- this.options = $.extend(this.options, defaultOptions, options);
+ this.attachToDom(this.markerId);
+ this.options = $.extend(this.options, defaultOptions, options || {});
- this.id = $(richfaces.getDomElement(id));
+ this.id = $(richfaces.getDomElement(id)); // Should be component Id string // NOT AN
OBJECT
this.minWidth = this.getMinimumSize(this.options.minWidth);
this.minHeight = this.getMinimumSize(this.options.minHeight);
this.maxWidth = this.options.maxWidth;
@@ -93,14 +93,13 @@
};
- var $super = richfaces.BaseComponent.extend(richfaces.ui.PopupPanel);
- var $p = richfaces.BaseComponent.extend(richfaces.ui.PopupPanel, {});
+ richfaces.BaseComponent.extend(richfaces.ui.PopupPanel);
var $super = richfaces.ui.PopupPanel.$super;
- $.extend(richfaces.ui.PopupPanel.prototype, (function (options) {
+ $.extend(richfaces.ui.PopupPanel.prototype, (function (options) {
return {
- name: "RichFaces.ui.PopupPanel",
+ name: "PopupPanel",
saveInputValues: function(element) {
/* Fix for RF-3856 - Checkboxes in modal panel does not hold their states after modal
was closed and opened again */
if ($.browser.msie /* reproducible for checkbox/radio in IE6, radio in IE 7/8 beta 2
*/) {
@@ -154,7 +153,7 @@
this.firstOutside = null;
this.lastOutside = null;
this.firstHref = null;
- this.parent = null;
+ this.parent = null;
if (this.header) {
this.header.destroy();
this.header=null;
@@ -184,6 +183,9 @@
this.scrollerDiv = null;
this.userOptions = null;
this.eIframe= null;
+
+ this.detach(this.markerId);
+ $super.destroy.call(this);
},
@@ -747,39 +749,6 @@
});
return true;
- },
-
- invokeEvent: function(eventName, event, value, element) {
-
- var eventFunction = eval(this.options['on'+eventName]);
- var result;
-
- if (eventFunction) {
- var eventObj;
- if (event) {
- eventObj = event;
- }
- else if(document.createEventObject) {
- eventObj = document.createEventObject();
- }
- else if( document.createEvent ) {
- eventObj = document.createEvent('Events');
- eventObj.initEvent( eventName, true, false );
- }
-
- eventObj.rich = {component:this};
- eventObj.rich.value = value;
-
- try {
- result = eventFunction.call(element, eventObj);
- }
- catch (e) { LOG.warn("Exception: "+e.Message + "\n[on"+eventName
+ "]"); }
- }
-
- if (result!=false) {
- result = true;
- }
- return result;
}
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js 2010-12-03
15:19:27 UTC (rev 20359)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/progressBar.js 2010-12-03
15:23:12 UTC (rev 20360)
@@ -18,9 +18,8 @@
rf.ui.ProgressBar = function(componentId, options) {
// call constructor of parent class
$super.constructor.call(this, componentId);
- this.id = componentId;
- this.__elt = this.attachToDom(this.id);
- this.options = $.extend({}, defaultOptions, options);
+ this.__elt = this.attachToDom();
+ this.options = $.extend(this.options, defaultOptions, options || {});
this.enabled = this.options.enabled;
this.minValue = this.options.minValue;
this.maxValue = this.options.maxValue;
@@ -193,6 +192,7 @@
destroy: function() {
this.disable();
this.__elt = null;
+ this.detach();
$super.destroy.call(this);
}
}