[Mapbender-commits] r5652 - trunk/mapbender/lib
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Feb 25 05:17:58 EST 2010
Author: christoph
Date: 2010-02-25 05:17:57 -0500 (Thu, 25 Feb 2010)
New Revision: 5652
Modified:
trunk/mapbender/lib/event.js
Log:
Modified: trunk/mapbender/lib/event.js
===================================================================
--- trunk/mapbender/lib/event.js 2010-02-25 10:06:20 UTC (rev 5651)
+++ trunk/mapbender/lib/event.js 2010-02-25 10:17:57 UTC (rev 5652)
@@ -18,13 +18,39 @@
* > // trigger the event
* > eventAfterMapRequest.trigger();
*
+ * Files:
+ * - lib/event.js
+ *
+ * Maintainer:
+ * http://www.mapbender.org/Christoph_Baudson
+ *
+ * License:
+ * Copyright (c) 2009, Open Source Geospatial Foundation
+ * This program is dual licensed under the GNU General Public License
+ * and Simplified BSD license.
+ * http://svn.osgeo.org/mapbender/trunk/mapbender/license/license.txt
*/
+
+
+/**
+ * Constructor: Mapbender.Event
+ */
var MapbenderEvent = Mapbender.Event = function () {
// public methods
/**
+ * Method: register
+ *
+ * Description:
* A function that needs to be executed, when the event occurs, has to be
* registered via this function.
+ *
+ * Parameters:
+ * closure - a function (or a string for backwards compatibility) which
+ * is called (evaluated) when the trigger method is called.
+ * scope - *[optional]* if given, the function is not simply executed, but
+ * called with JavaScript's call function
+ * > func.call(scope, argumentObj)
*/
this.register = function(aFunction, scope) {
@@ -34,7 +60,13 @@
};
/**
- * Exclude a previously registered function from the event
+ * Method: unregister
+ *
+ * Description:
+ * Exclude a previously registered function from the event permanently
+ *
+ * Parameters:
+ * closure - a function (or a string for backwards compatibility)
*/
this.unregister = function(aFunction) {
for (var i = 0, len = functionArray.length; i < len; i++) {
@@ -51,7 +83,14 @@
};
/**
- * Checks if a function is already registered with this event
+ * Method: isRegistered
+ *
+ * Description:
+ * Checks if a function is already registered with this event. This
+ * can be used to avoid duplicate registers.
+ *
+ * Parameters:
+ * closure - a function (or a string for backwards compatibility)
*/
this.isRegistered = function (aFunction) {
for (var i = 0, len = functionArray.length; i < len; i++) {
@@ -63,7 +102,19 @@
};
/**
- * This function triggers the event
+ * Method: trigger
+ *
+ * Description:
+ * This function triggers the event.
+ *
+ * Parameters:
+ * properties - an object containing the arguments to be passed to
+ * the registered functions
+ * operator - *[optional]* a string that specifies how the return
+ * values of the individual registered functions shall be
+ * combined. Available operators are "AND", "OR" and "CAT"
+ * (string concatenation). The default return value is the
+ * return value of the last registered function.
*/
this.trigger = function(properties, booleanOperator) {
if (!(functionArray.length > 0)) {
More information about the Mapbender_commits
mailing list