Author: pyaschenko
Date: 2010-04-06 11:50:27 -0400 (Tue, 06 Apr 2010)
New Revision: 16733
Modified:
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-event.js
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js
Log:
global jsdoc fixes for using 2.3.0 version
Modified:
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js
===================================================================
---
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-04-06
15:39:42 UTC (rev 16732)
+++
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-base-component.js 2010-04-06
15:50:27 UTC (rev 16733)
@@ -8,7 +8,33 @@
richfaces.blankFunction = function (){}; //TODO: add it to global library
/**
- * @class Base class for all components
+ * @class Base class for all components.
+ * All RichFaces components should use this class as base or another RichFaces class
which based on it.
+ *
+ <pre><code>
+ //Inheritance example:
+ (function (jQuery, richfaces, params) {
+
+ // Constructor definition
+ richfaces.MyComponent = function(componentId) {
+ $super.constructor.call(this, componentId);
+ };
+
+ // Extend component class
+ var $super = richfaces.BaseComponent.extend(richfaces.BaseComponent,
richfaces.MyComponent);
+
+ // Add new properties and methods
+ jQuery.extend(richfaces.MyComponent.prototype, (function (params) {
+ return {
+ name:"MyComponent",
+ f:function (){alert("hello");
+ }
+ };
+ })(params));
+ })(jQuery, RichFaces);
+ </code></pre>
+ *
+ * @memberOf RichFaces
* @name BaseComponent
*
* @constructor
@@ -22,8 +48,8 @@
* Method extends child class prototype with parent prototype
* and return parent's prototype ($super)
*
- * @methodOf
- * @name BaseComponent.extend
+ * @function
+ * @name RichFaces.BaseComponent.extend
*
* @return {object}
* */
@@ -41,7 +67,7 @@
/**
* Component name.
*
- * @name BaseComponent#name
+ * @name RichFaces.BaseComponent#name
* @type String
* */
name: "BaseComponent",
@@ -49,8 +75,8 @@
/**
* Method for converting object to string
*
- * @methodOf
- * @name BaseComponent#toString
+ * @function
+ * @name RichFaces.BaseComponent#toString
*
* @return {String}
* */
@@ -64,10 +90,11 @@
},
/**
- * Method returns enement's id as jQuery selector
+ * Method returns element's id as jQuery selector for event handlers
binding.
+ * Event API calls this method when binding by component object as selector
was used.
*
- * @methodOf
- * @name BaseComponent#getEventElement
+ * @function
+ * @name RichFaces.BaseComponent#getEventElement
*
* @return {String}
* */
@@ -77,20 +104,4 @@
};
})(params));
-})(jQuery, window.RichFaces || (window.RichFaces={}));
-
-
-/*
-(function (jQuery, richfaces, params) {
-
- richfaces.MyComponent = function(componentId) {
- $super.constructor.call(this, componentId);
- };
-
- var $super = richfaces.BaseComponent.extend(richfaces.BaseComponent,
richfaces.MyComponent);
-
- jQuery.extend(richfaces.MyComponent.prototype, (function (params) {
- return {name:"MyComponent", f:function (){alert("hello");}};
- })(params));
-})(jQuery, RichFaces);
-*/
\ No newline at end of file
+})(jQuery, window.RichFaces || (window.RichFaces={}));
\ No newline at end of file
Modified:
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-event.js
===================================================================
---
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-event.js 2010-04-06
15:39:42 UTC (rev 16732)
+++
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-event.js 2010-04-06
15:50:27 UTC (rev 16733)
@@ -5,7 +5,10 @@
(function($, richfaces) {
/**
+ * RichFaces Event API container
* @class
+ * @memberOf RichFaces
+ * @static
* @name Event
* */
richfaces.Event = richfaces.Event || {};
@@ -27,16 +30,16 @@
$.extend(richfaces.Event, {
/**
* @constant
- * @name Event.RICH_NAMESPACE
+ * @name RichFaces.Event.RICH_NAMESPACE
* @type string
* */
RICH_NAMESPACE : "RICH:",
/**
- * Attach an event handler to execute when the DOM is fully loaded
- * @methodOf
- * @name Event.ready
- *
+ * Attach an event handler to execute when the DOM is fully loaded.
+ *
+ * @function
+ * @name RichFaces.Event.ready
* @param {function} fn - event handler
* @return {jQuery} document element wrapped by jQuery
* */
@@ -51,9 +54,9 @@
},
/**
- * Attach a handler to an event for the elements
- * @methodOf
- * @name Event.bind
+ * Attach a handler to an event for the elements.
+ * @function
+ * @name RichFaces.Event.bind
*
* @param {string|DOMElement|jQuery} selector - jQuery elements selector
* @param {string} type - one or more JavaScript event types, such as
"click" or "submit," or custom event names
@@ -72,9 +75,9 @@
},
/**
- * Attach a handler to an event for the element by element id
- * @methodOf
- * @name Event.bindById
+ * Attach a handler to an event for the element by element id.
+ * @function
+ * @name RichFaces.Event.bindById
*
* @param {string} id - DOM element id
* @param {string} type - one or more JavaScript event types, such as
"click" or "submit," or custom event names
@@ -93,10 +96,10 @@
},
/**
- * Attach a handler to an event for the elements
- * The handler will be called only once when event happened
- * @methodOf
- * @name Event.bindOne
+ * Attach a handler to an event for the elements.
+ * The handler will be called only once when event happened.
+ * @function
+ * @name RichFaces.Event.bindOne
*
* @param {string|DOMElement|jQuery} selector - jQuery elements selector
* @param {string} type - one or more JavaScript event types, such as
"click" or "submit," or custom event names
@@ -115,10 +118,10 @@
},
/**
- * Attach a handler to an event for the element by element id
- * The handler will be called only once when event happened
- * @methodOf
- * @name Event.bindOneById
+ * Attach a handler to an event for the element by element id.
+ * The handler will be called only once when event happened.
+ * @function
+ * @name RichFaces.Event.bindOneById
*
* @param {string} id - DOM element id
* @param {string} type - one or more JavaScript event types, such as
"click" or "submit," or custom event names
@@ -137,9 +140,9 @@
},
/**
- * Remove a previously-attached event handler from the elements
- * @methodOf
- * @name Event.unbind
+ * Remove a previously-attached event handler from the elements.
+ * @function
+ * @name RichFaces.Event.unbind
*
* @param {string|DOMElement|jQuery} selector - jQuery elements selector
* @param {string} [type] - one or more JavaScript event types, such as
"click" or "submit," or custom event names
@@ -152,10 +155,10 @@
},
/**
- * Remove a previously-attached event handler from the elements by element id
- * The handler will be called only once when event happened
- * @methodOf
- * @name Event.unbindById
+ * Remove a previously-attached event handler from the elements by element id.
+ * The handler will be called only once when event happened.
+ * @function
+ * @name RichFaces.Event.unbindById
*
* @param {string} id - DOM element id
* @param {string} [type] - one or more JavaScript event types, such as
"click" or "submit," or custom event names
@@ -168,9 +171,9 @@
},
/**
- * Execute all handlers and behaviors attached to the matched elements for the given
event type
- * @methodOf
- * @name Event.fire
+ * Execute all handlers and behaviors attached to the matched elements for the given
event type.
+ * @function
+ * @name RichFaces.Event.fire
*
* @param {string|DOMElement|jQuery} selector - jQuery elements selector
* @param {string} event - event name
@@ -182,9 +185,9 @@
},
/**
- * The same as the fire method, but selects element by id
- * @methodOf
- * @name Event.fireById
+ * The same as the fire method, but selects element by id.
+ * @function
+ * @name RichFaces.Event.fireById
*
* @param {string} id - DOM element id
* @param {string} event - event name
@@ -201,8 +204,8 @@
* - does not bubble up event
* - call handler only for the first founded element
* - returns whatever value that was returned by the handler
- * @methodOf
- * @name Event.callHandler
+ * @function
+ * @name RichFaces.Event.callHandler
*
* @param {string|DOMElement|jQuery} selector - jQuery elements selector
* @param {string} event - event name
@@ -214,9 +217,9 @@
},
/**
- * The same as the callHandler method, but selects element by id
- * @methodOf
- * @name Event.callHandlerById
+ * The same as the callHandler method, but selects element by id.
+ * @function
+ * @name RichFaces.Event.callHandlerById
*
* @param {string} id - DOM element id
* @param {string} event - event name
@@ -228,9 +231,9 @@
},
/**
- * Create an event namespace for the components
- * @methodOf
- * @name Event.createNamespace
+ * Create an event namespace for the components.
+ * @function
+ * @name RichFaces.Event.createNamespace
*
* @param {string} [componentName] - component name
* @param {string} [id] - element id
Modified:
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js
===================================================================
---
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js 2010-04-06
15:39:42 UTC (rev 16732)
+++
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces-queue.js 2010-04-06
15:50:27 UTC (rev 16733)
@@ -1,25 +1,31 @@
+/**
+ * @author Pavel Yaschenko
+ */
+
(function(jQuery, richfaces, jsf) {
- /**
+ /**
+ * RichFaces Ajax container
* @class
+ * @memberOf RichFaces
+ * @static
* @name ajax
- *
* */
richfaces.ajax = richfaces.ajax || {};
/**
* JSF 2.0 original method that sends an asynchronous ajax request to the server
* see jsf.ajax.request method for parameter's description
- * @methodOf
- * @name ajax.request
+ * @function
+ * @name RichFaces.ajax.request
*
* */
richfaces.ajax.request = jsf.ajax.request;
/**
* RichFaces wrapper function of JSF 2.0 original method jsf.ajax.request
- * @methodOf
- * @name jsf_ajax.request
+ * @function
+ * @name jsf.ajax.request
*
* @param {string|DOMElement} source - The DOM element or an id that triggered this
ajax request
* @param {object} [event] - The DOM event that triggered this ajax request
@@ -35,7 +41,10 @@
var defaultQueueOptions = {mode: QUEUE_MODE_PULL, requestDelay:0};
/**
+ * RichFaces Queue API container
* @class
+ * @memberOf RichFaces
+ * @static
* @name queue
* */
richfaces.queue = function(opts){
@@ -207,8 +216,8 @@
/**
* Get current queue size
- * @methodOf
- * @name queue.getSize
+ * @function
+ * @name RichFaces.queue.getSize
*
* @return {number} size of items in the queue
* */
@@ -216,8 +225,8 @@
/**
* Check if queue is empty
- * @methodOf
- * @name queue.isEmpty
+ * @function
+ * @name RichFaces.queue.isEmpty
*
* @return {boolean} returns true if queue is empty
* */
@@ -225,15 +234,15 @@
/**
* Extract and submit first QueueEntry in the queue if QueueEntry is ready to submit
- * @methodOf
- * @name queue.submitFirst
+ * @function
+ * @name RichFaces.queue.submitFirst
* */
submitFirst: submitFirst,
/**
* Create and push QueueEntry to the queue for ajax requests
- * @methodOf
- * @name queue.push
+ * @function
+ * @name RichFaces.queue.push
*
* @param {string|DOMElement} source - The DOM element or an id that triggered this
ajax request
* @param {object} [event] - The DOM event that triggered this ajax request
Modified: root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
---
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js 2010-04-06
15:39:42 UTC (rev 16732)
+++
root/framework/trunk/impl/src/main/resources/META-INF/resources/richfaces.js 2010-04-06
15:50:27 UTC (rev 16733)
@@ -1,9 +1,10 @@
/**
* Global object container for RichFaces API.
- * All classes should be defined here
+ * All classes should be defined here.
* @class
* @name RichFaces
+ * @static
*
* */
window.RichFaces = {};