You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by li...@apache.org on 2010/02/02 23:20:41 UTC
svn commit: r905819 - in /incubator/shindig/trunk/features: ./
src/main/javascript/features/core.config/
src/main/javascript/features/core.io/ src/main/javascript/features/core.json/
src/main/javascript/features/core.legacy/ src/main/javascript/feature...
Author: lindner
Date: Tue Feb 2 22:20:39 2010
New Revision: 905819
URL: http://svn.apache.org/viewvc?rev=905819&view=rev
Log:
numerous jsdoc cleanups
Modified:
incubator/shindig/trunk/features/pom.xml
incubator/shindig/trunk/features/src/main/javascript/features/core.config/config.js
incubator/shindig/trunk/features/src/main/javascript/features/core.io/io.js
incubator/shindig/trunk/features/src/main/javascript/features/core.json/json.js
incubator/shindig/trunk/features/src/main/javascript/features/core.legacy/legacy.js
incubator/shindig/trunk/features/src/main/javascript/features/core.log/log.js
incubator/shindig/trunk/features/src/main/javascript/features/core.prefs/prefs.js
incubator/shindig/trunk/features/src/main/javascript/features/core.util/util.js
incubator/shindig/trunk/features/src/main/javascript/features/opensocial-0.6/opensocial6to7.js
incubator/shindig/trunk/features/src/main/javascript/features/opensocial-base/fieldtranslations.js
incubator/shindig/trunk/features/src/main/javascript/features/opensocial-base/jsonmessage.js
incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data/data.js
incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/collection.js
incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/container.js
incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/mediaitem.js
incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/message.js
incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/phone.js
incubator/shindig/trunk/features/src/main/javascript/features/opensocial-templates/base.js
incubator/shindig/trunk/features/src/main/javascript/features/osapi/batch.js
incubator/shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
incubator/shindig/trunk/features/src/main/javascript/features/osapi/osapi.js
incubator/shindig/trunk/features/src/main/javascript/features/osapi/peoplehelpers.js
incubator/shindig/trunk/features/src/main/javascript/features/pubsub/pubsub-router.js
incubator/shindig/trunk/features/src/main/javascript/features/xmlutil/feature.xml
incubator/shindig/trunk/features/src/test/javascript/features/mocks/window.js
Modified: incubator/shindig/trunk/features/pom.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/pom.xml?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/pom.xml (original)
+++ incubator/shindig/trunk/features/pom.xml Tue Feb 2 22:20:39 2010
@@ -41,12 +41,6 @@
<url>http://svn.apache.org/viewvc/incubator/shindig/trunk/features</url>
</scm>
- <repositories>
- <repository>
- <id>jsdoctk1</id>
- <url>http://jsdoctk-plugin.googlecode.com/svn/repo</url>
- </repository>
- </repositories>
<pluginRepositories>
<pluginRepository>
<id>jsdoctk2</id>
Modified: incubator/shindig/trunk/features/src/main/javascript/features/core.config/config.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/core.config/config.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/core.config/config.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/core.config/config.js Tue Feb 2 22:20:39 2010
@@ -17,19 +17,16 @@
* under the License.
*/
-/*global configuration */
-
/**
- * @fileoverview
+ * @fileoverview Provides unified configuration for all features.
*
- * Provides unified configuration for all features.
*
- * This is a custom shindig library that has not yet been submitted for
+ * <p>This is a custom shindig library that has not yet been submitted for
* standardization. It is designed to make developing of features for the
* opensocial / gadgets platforms easier and is intended as a supplemental
* tool to Shindig's standardized feature loading mechanism.
*
- * Usage:
+ * <p>Usage:
* First, you must register a component that needs configuration:
* <pre>
* var config = {
@@ -39,29 +36,32 @@
* gadgets.config.register("my-feature", config, myCallback);
* </pre>
*
- * This will register a component named "my-feature" that expects input config
+ * <p>This will register a component named "my-feature" that expects input config
* containing a "name" field with a value that is a non-empty string, and a
* "url" field with a value that matches the given regular expression.
*
- * When gadgets.config.init is invoked by the container, it will automatically
+ * <p>When gadgets.config.init is invoked by the container, it will automatically
* validate your registered configuration and will throw an exception if
* the provided configuration does not match what was required.
*
- * Your callback will be invoked by passing all configuration data passed to
+ * <p>Your callback will be invoked by passing all configuration data passed to
* gadgets.config.init, which allows you to optionally inspect configuration
* from other features, if present.
*
- * Note that the container may optionally bypass configuration validation for
+ * <p>Note that the container may optionally bypass configuration validation for
* performance reasons. This does not mean that you should duplicate validation
* code, it simply means that validation will likely only be performed in debug
* builds, and you should assume that production builds always have valid
* configuration.
*/
+/** @namespace */
gadgets.config = function() {
var components = [];
+ var configuration;
return {
+ 'register':
/**
* Registers a configurable component and its configuration parameters.
* Multiple callbacks may be registered for a single component if needed.
@@ -81,8 +81,11 @@
* complete. Takes the form function(config), where config will be
* all registered config data for all components. This allows your
* component to read configuration from other components.
+ * @member gadgets.config
+ * @name register
+ * @function
*/
- register: function(component, opt_validators, opt_callback) {
+ function(component, opt_validators, opt_callback) {
var registered = components[component];
if (!registered) {
registered = [];
@@ -95,6 +98,7 @@
});
},
+ 'get':
/**
* Retrieves configuration data on demand.
*
@@ -102,8 +106,11 @@
* all configuration will be returned.
* @return {Object} The requested configuration, or an empty object if no
* configuration has been registered for that component.
+ * @member gadgets.config
+ * @name get
+ * @function
*/
- get: function(opt_component) {
+ function(opt_component) {
if (opt_component) {
return configuration[opt_component] || {};
}
@@ -116,8 +123,11 @@
* @param {Object} config The full set of configuration data.
* @param {boolean=} opt_noValidation True if you want to skip validation.
* @throws {Error} If there is a configuration error.
+ * @member gadgets.config
+ * @name init
+ * @function
*/
- init: function(config, opt_noValidation) {
+ 'init': function(config, opt_noValidation) {
configuration = config;
for (var name in components) {
if (components.hasOwnProperty(name)) {
@@ -151,10 +161,15 @@
/**
* Ensures that data is one of a fixed set of items.
- * @param {Array.<string>} list The list of valid values.
* Also supports argument sytax: EnumValidator("Dog", "Cat", "Fish");
+ *
+ * @param {Array.<string>} list The list of valid values.
+ *
+ * @member gadgets.config
+ * @name EnumValidator
+ * @function
*/
- EnumValidator: function(list) {
+ 'EnumValidator': function(list) {
var listItems = [];
if (arguments.length > 1) {
for (var i = 0, arg; (arg = arguments[i]); ++i) {
@@ -174,8 +189,11 @@
/**
* Tests the value against a regular expression.
+ * @member gadgets.config
+ * @name RegexValidator
+ * @function
*/
- RegExValidator: function(re) {
+ 'RegExValidator': function(re) {
return function(data) {
return re.test(data);
};
@@ -183,22 +201,34 @@
/**
* Validates that a value was provided.
+ * @param {*} data
+ * @member gadgets.config
+ * @name ExistsValidator
+ * @function
*/
- ExistsValidator: function(data) {
+ 'ExistsValidator': function(data) {
return typeof data !== "undefined";
},
/**
* Validates that a value is a non-empty string.
+ * @param {*} data
+ * @member gadgets.config
+ * @name NonEmptyStringValidator
+ * @function
*/
- NonEmptyStringValidator: function(data) {
+ 'NonEmptyStringValidator': function(data) {
return typeof data === "string" && data.length > 0;
},
/**
* Validates that the value is a boolean.
+ * @param {*} data
+ * @member gadgets.config
+ * @name BooleanValidator
+ * @function
*/
- BooleanValidator: function(data) {
+ 'BooleanValidator': function(data) {
return typeof data === "boolean";
},
@@ -208,18 +238,22 @@
* Doesn't actually do type validation though, but instead relies
* on other validators.
*
- * example:
+ * This can be used recursively as well to validate sub-objects.
+ *
+ * @example
*
* var validator = new gadgets.config.LikeValidator(
* "booleanField" : gadgets.config.BooleanValidator,
* "regexField" : new gadgets.config.RegExValidator(/foo.+/);
* );
*
- * This can be used recursively as well to validate sub-objects.
*
* @param {Object} test The object to test against.
+ * @member gadgets.config
+ * @name BooleanValidator
+ * @function
*/
- LikeValidator : function(test) {
+ 'LikeValidator' : function(test) {
return function(data) {
for (var member in test) {
if (test.hasOwnProperty(member)) {
Modified: incubator/shindig/trunk/features/src/main/javascript/features/core.io/io.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/core.io/io.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/core.io/io.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/core.io/io.js Tue Feb 2 22:20:39 2010
@@ -44,7 +44,6 @@
/**
* Internal facility to create an xhr request.
- * @nosideeffects
*/
function makeXhr() {
var x;
@@ -485,7 +484,6 @@
* content should be cached. Defaults to 3600.
*
* @return {string} The proxied version of the URL
- * @nosideeffects
* @member gadgets.io
*/
getProxyUrl : function (url, opt_params) {
Modified: incubator/shindig/trunk/features/src/main/javascript/features/core.json/json.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/core.json/json.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/core.json/json.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/core.json/json.js Tue Feb 2 22:20:39 2010
@@ -42,15 +42,15 @@
// HTML5 implementation, or already defined.
// Not a direct alias as the opensocial specification disagrees with the HTML5 JSON spec.
// JSON says to throw on parse errors and to support filtering functions. OS does not.
- gadgets.json = {
- parse: function(str) {
+ gadgets['json'] = {
+ 'parse': function(str) {
try {
return window.JSON.parse(str);
} catch (e) {
return false;
}
},
- stringify: function(obj) {
+ 'stringify': function(obj) {
try {
return window.JSON.stringify(obj);
} catch (e) {
@@ -59,11 +59,12 @@
}
};
} else {
- gadgets.json = function () {
+ gadgets['json'] = function () {
/**
* Formats integers to 2 digits.
* @param {number} n
+ * @private
*/
function f(n) {
return n < 10 ? '0' + n : n;
@@ -79,6 +80,10 @@
};
// table of character substitutions
+ /**
+ * @const
+ * @enum {string}
+ */
var m = {
'\b': '\\b',
'\t': '\\t',
@@ -93,6 +98,7 @@
* Converts a json object into a string.
* @param {*} value
* @return {string}
+ * @member gadgets.json
*/
function stringify(value) {
var a, // The array holding the partial texts.
@@ -161,8 +167,8 @@
}
return {
- stringify: stringify,
- parse: function (text) {
+ 'stringify': stringify,
+ 'parse': function (text) {
// Parsing happens in three stages. In the first stage, we run the text against
// regular expressions that look for non-JSON patterns. We are especially
// concerned with '()' and 'new' because they can cause invocation, and '='
Modified: incubator/shindig/trunk/features/src/main/javascript/features/core.legacy/legacy.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/core.legacy/legacy.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/core.legacy/legacy.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/core.legacy/legacy.js Tue Feb 2 22:20:39 2010
@@ -18,33 +18,41 @@
*/
/*global gadgets */
+var gadgets;
-// All functions in this file should be treated as deprecated legacy routines.
-// Gadget authors are explicitly discouraged from using any of them.
+/**
+ * @fileoverview All functions in this file should be treated as deprecated legacy routines.
+ * Gadget authors are explicitly discouraged from using any of them.
+ */
var JSON = window.JSON || gadgets.json;
+/**
+ * @deprecated
+ */
var _IG_Prefs = (function() {
+ var instance = null;
-var instance = null;
-
-var _IG_Prefs = function() {
- if (!instance) {
- instance = new gadgets.Prefs();
- instance.setDontEscape_();
- }
- return instance;
-};
+ var _IG_Prefs = function() {
+ if (!instance) {
+ instance = new gadgets.Prefs();
+ instance.setDontEscape_();
+ }
+ return instance;
+ };
_IG_Prefs._parseURL = gadgets.Prefs.parseUrl;
-return _IG_Prefs;
+ return _IG_Prefs;
})();
function _IG_Fetch_wrapper(callback, obj) {
callback(obj.data ? obj.data : "");
}
+/**
+ * @deprecated
+ */
function _IG_FetchContent(url, callback, opt_params) {
var params = opt_params || {};
// This is really the only legacy parameter documented
@@ -66,6 +74,9 @@
gadgets.io.makeRequest(url, cb, params);
}
+/**
+ * @deprecated
+ */
function _IG_FetchXmlContent(url, callback, opt_params) {
var params = opt_params || {};
if (params.refreshInterval) {
@@ -78,6 +89,10 @@
gadgets.io.makeRequest(url, cb, params);
}
+
+/**
+ * @deprecated
+ */
function _IG_FetchFeedAsJSON(url, callback, numItems, getDescriptions,
opt_params) {
var params = opt_params || {};
@@ -126,6 +141,7 @@
/**
* @param {string} url
* @param {Object=} opt_params
+ * @deprecated
*/
function _IG_GetCachedUrl(url, opt_params) {
var params = opt_params || {};
@@ -138,13 +154,16 @@
/**
* @param {string} url
* @param {Object=} opt_params
+ * @deprecated
*/
function _IG_GetImageUrl(url, opt_params) {
return _IG_GetCachedUrl(url, opt_params);
}
+
/**
* @param {string} url
* @return {Element}
+ * @deprecated
*/
function _IG_GetImage(url) {
var img = document.createElement('img');
@@ -153,13 +172,20 @@
}
+/**
+ * @deprecated
+ */
function _IG_RegisterOnloadHandler(callback) {
gadgets.util.registerOnLoadHandler(callback);
}
-// _IG_Callback takes the arguments in the scope the callback is executed and
-// places them first in the argument array. MakeClosure takes the arguments
-// from the scope at callback construction and pushes them first in the array
+/**
+ * _IG_Callback takes the arguments in the scope the callback is executed and
+ * places them first in the argument array. MakeClosure takes the arguments
+ * from the scope at callback construction and pushes them first in the array
+ *
+ * @deprecated
+ */
function _IG_Callback(handler_func, var_args) {
var orig_args = arguments;
return function() {
@@ -179,6 +205,7 @@
* an object in which allows this to be called regardless of whether or
* not the type of the input is known.
* @return {HTMLElement} The element, if it exists in the document, or null.
+ * @deprecated
*/
function _gel(el) {
return document.getElementById ? document.getElementById(el) : null;
@@ -190,6 +217,7 @@
*
* @param {string} tag The tag to match elements against.
* @return {Array.<HTMLElement>} All elements of this tag type.
+ * @deprecated
*/
function _gelstn(tag) {
if (tag === "*" && document.all) {
@@ -206,6 +234,7 @@
* @param {RegEx} regex The expression to match.
* @return {Array.<HTMLElement>} All elements of this tag type that match
* regex.
+ * @deprecated
*/
function _gelsbyregex(tagName, regex) {
var matchingTags = _gelstn(tagName);
@@ -222,6 +251,7 @@
* URI escapes the given string.
* @param {string} str The string to escape.
* @return {string} The escaped string.
+ * @deprecated
*/
function _esc(str) {
return window.encodeURIComponent ? encodeURIComponent(str) : escape(str);
@@ -231,6 +261,7 @@
* URI unescapes the given string.
* @param {string} str The string to unescape.
* @return {string} The unescaped string.
+ * @deprecated
*/
function _unesc(str) {
return window.decodeURIComponent ? decodeURIComponent(str) : unescape(str);
@@ -241,6 +272,7 @@
*
* @param {string} str The string to escape.
* @return {string} The escaped string.
+ * @deprecated
*/
function _hesc(str) {
return gadgets.util.escapeString(str);
@@ -251,6 +283,7 @@
*
* @param {string} str The string to strip.
* @return {string} The stripped string.
+ * @deprecated
*/
function _striptags(str) {
return str.replace(/<\/?[^>]+>/g, "");
@@ -261,6 +294,7 @@
*
* @param {string} str The string to trim.
* @return {string} The trimmed string.
+ * @deprecated
*/
function _trim(str) {
return str.replace(/^\s+|\s+$/g, "");
@@ -270,6 +304,7 @@
* Toggles the given element between being shown and block-style display.
*
* @param {string | HTMLElement} el The element to toggle.
+ * @deprecated
*/
function _toggle(el) {
el = (typeof el === "string") ? _gel(el) : el;
@@ -282,22 +317,27 @@
}
}
-/**
- * @type {number} A counter used by uniqueId().
- */
-var _global_legacy_uidCounter = 0;
-/**
- * @return {number} a unique number.
- */
-function _uid() {
- return _global_legacy_uidCounter++;
-}
+var _uid = (function() {
+ /**
+ * @type {number} A counter used by uniqueId().
+ */
+ var _legacy_uidCounter = 0;
+
+ /**
+ * @return {number} a unique number.
+ * @deprecated
+ */
+ return function () {
+ return _legacy_uidCounter++;
+ };
+})();
/**
* @param {number} a
* @param {number} b
* @return {number} The lesser of a or b.
+ * @deprecated
*/
function _min(a, b) {
return (a < b ? a : b);
@@ -307,6 +347,7 @@
* @param {number} a
* @param {number} b
* @return {number} The greater of a or b.
+ * @deprecated
*/
function _max(a, b) {
return (a > b ? a : b);
@@ -315,6 +356,7 @@
/**
* @param {string} name
* @param {Array.<string | Object>} sym
+ * @deprecated
*/
function _exportSymbols(name, sym) {
var attach = window;
Modified: incubator/shindig/trunk/features/src/main/javascript/features/core.log/log.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/core.log/log.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/core.log/log.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/core.log/log.js Tue Feb 2 22:20:39 2010
@@ -18,72 +18,91 @@
*/
/**
- * @fileoverview
- * Support for basic logging capability for gadgets, meant to replace
- * alert(msg) and window.console.log(msg).
+ * @fileoverview Support for basic logging capability for gadgets.
*
- * Currently only works on browsers with a console (WebKit based browsers
- * or Firefox with Firebug extension).
+ * This functionality replaces alert(msg) and window.console.log(msg).
*
- * API is designed to be equivalent to existing console.log | warn | error
+ * <p>Currently only works on browsers with a console (WebKit based browsers,
+ * Firefox with Firebug extension, or Opera).
+ *
+ * <p>API is designed to be equivalent to existing console.log | warn | error
* logging APIs supported by Firebug and WebKit based browsers. The only
* addition is the ability to call gadgets.setLogLevel().
*/
/**
+ * @static
+ * @namespace Support for basic logging capability for gadgets.
+ * @name gadgets.log
+ */
+
+gadgets['log'] = (function() {
+ /** @const */
+ var info_=1;
+ /** @const */
+ var warning_=2;
+ /** @const */
+ var error_=3;
+ /** @const */
+ var none_=4;
+
+/**
* Log an informational message
* @param {Object} message - the message to log
+ * @member gadgets
+ * @name log
+ * @function
*/
-gadgets.log = function(message) {
- gadgets.log.logAtLevel(gadgets.log.INFO, message);
+var log = function(message) {
+ logAtLevel(info_, message);
};
-
/**
* Log a warning
* @param {Object} message - the message to log
+ * @static
*/
gadgets.warn = function(message) {
- gadgets.log.logAtLevel(gadgets.log.WARNING, message);
+ logAtLevel(warning_, message);
};
/**
* Log an error
* @param {Object} message - The message to log
+ * @static
*/
gadgets.error = function(message) {
- gadgets.log.logAtLevel(gadgets.log.ERROR, message);
+ logAtLevel(error_, message);
};
/**
* Sets the log level threshold.
* @param {number} logLevel - New log level threshold.
* @static
+ * @member gadgets.log
+ * @name setLogLevel
*/
-gadgets.setLogLevel = function(logLevel) {
- gadgets.log.logLevelThreshold_ = logLevel;
+gadgets['setLogLevel'] = function(logLevel) {
+ logLevelThreshold_ = logLevel;
};
/**
* Logs a log message if output console is available, and log threshold is met.
* @param {number} level - the level to log with. Optional, defaults to gadgets.log.INFO.
* @param {Object} message - The message to log
- * @static
+ * @private
*/
-gadgets.log.logAtLevel = function(level, message) {
- if (level < gadgets.log.logLevelThreshold_ || !gadgets.log._console) {
+ function logAtLevel(level, message) {
+ if (level < logLevelThreshold_ || !_console) {
return;
}
- var logger;
- var gadgetconsole = gadgets.log._console;
-
- if (level == gadgets.log.WARNING && gadgetconsole.warn) {
- gadgetconsole.warn(message)
- } else if (level == gadgets.log.ERROR && gadgetconsole.error) {
- gadgetconsole.error(message);
- } else if (gadgetconsole.log) {
- gadgetconsole.log(message);
+ if (level === warning_ && _console.warn) {
+ _console.warn(message)
+ } else if (level === error_ && _console.error) {
+ _console.error(message);
+ } else if (_console.log) {
+ _console.log(message);
}
};
@@ -91,35 +110,45 @@
* Log level for informational logging.
* @static
* @const
+ * @member gadgets.log
+ * @name INFO
*/
-gadgets.log.INFO = 1;
+log['INFO'] = info_;
/**
* Log level for warning logging.
* @static
* @const
+ * @member gadgets.log
+ * @name WARNING
*/
-gadgets.log.WARNING = 2;
+log['WARNING'] = warning_;
/**
* Log level for no logging
* @static
* @const
+ * @member gadgets.log
+ * @name NONE
*/
-gadgets.log.NONE = 4;
+log['NONE'] = none_;
/**
* Current log level threshold.
- * @type number
+ * @type {number}
* @private
- * @static
*/
-gadgets.log.logLevelThreshold_ = gadgets.log.INFO;
+var logLevelThreshold_ = info_;
+
+
/**
* Console to log to
* @private
* @static
*/
-gadgets.log._console = window.console ? window.console :
+var _console = window.console ? window.console :
window.opera ? window.opera.postError : undefined;
+
+ return log;
+})();
Modified: incubator/shindig/trunk/features/src/main/javascript/features/core.prefs/prefs.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/core.prefs/prefs.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/core.prefs/prefs.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/core.prefs/prefs.js Tue Feb 2 22:20:39 2010
@@ -22,14 +22,16 @@
*
* Provides access to user prefs, module dimensions, and messages.
*
- * Clients can access their preferences by constructing an instance of
+ * <p>Clients can access their preferences by constructing an instance of
* gadgets.Prefs and passing in their module id. Example:
*
+ * <pre>
* var prefs = new gadgets.Prefs();
* var name = prefs.getString("name");
* var lang = prefs.getLang();
+ * </pre>
*
- * Modules with type=url can also use this library to parse arguments passed
+ * <p>Modules with type=url can also use this library to parse arguments passed
* by URL, but this is not the common case:
*
* <script src="http://apache.org/shindig/prefs.js"></script>
@@ -37,7 +39,7 @@
* gadgets.Prefs.parseUrl();
* var prefs = new gadgets.Prefs();
* var name = prefs.getString("name");
- * </script≶
+ * </script>
*/
(function() {
Modified: incubator/shindig/trunk/features/src/main/javascript/features/core.util/util.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/core.util/util.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/core.util/util.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/core.util/util.js Tue Feb 2 22:20:39 2010
@@ -27,12 +27,11 @@
* @name gadgets.util
*/
-gadgets.util = function() {
+gadgets['util'] = function() {
/**
* Parses URL parameters into an object.
* @param {string} url - the url parameters to parse
* @return {Array.<string>} The parameters as an array
- * @nosideeffects
*/
function parseUrlParams(url) {
// Get settings from url, 'hash' takes precedence over 'search' component
@@ -58,6 +57,7 @@
/**
* @enum {boolean}
+ * @const
* @private
* Maps code points to the value to replace them with.
* If the value is "false", the character is removed entirely, otherwise
@@ -93,7 +93,6 @@
* @param {Array} match Ignored
* @param {number} value The codepoint value to convert
* @return {string} The character corresponding to value.
- * @nosideeffects
*/
function unescapeEntity(match, value) {
return String.fromCharCode(value);
@@ -120,7 +119,7 @@
* @member gadgets.util
* @private Implementation detail.
*/
- getUrlParameters : function (opt_url) {
+ 'getUrlParameters' : function (opt_url) {
if (parameters !== null && typeof opt_url === "undefined") {
// "parameters" is a cache of current window params only.
return parameters;
@@ -165,7 +164,7 @@
* @member gadgets.util
* @private Implementation detail.
*/
- makeClosure : function (scope, callback, var_args) {
+ 'makeClosure' : function (scope, callback, var_args) {
// arguments isn't a real array, so we copy it into one.
var baseArgs = [];
for (var i = 2, j = arguments.length; i < j; ++i) {
@@ -189,9 +188,8 @@
* the enum.
*
* @private Implementation detail.
- * @nosideeffects
*/
- makeEnum : function (values) {
+ 'makeEnum' : function (values) {
var obj = {};
for (var i = 0, v; (v = values[i]); ++i) {
obj[v] = v;
@@ -206,9 +204,8 @@
* @return {Object} The parameters for the given feature, or null
*
* @member gadgets.util
- * @nosideeffects
*/
- getFeatureParameters : function (feature) {
+ 'getFeatureParameters' : function (feature) {
return typeof features[feature] === "undefined" ? null : features[feature];
},
@@ -219,9 +216,8 @@
* @return {boolean} True if the feature is supported
*
* @member gadgets.util
- * @nosideeffects
*/
- hasFeature : function (feature) {
+ 'hasFeature' : function (feature) {
return typeof features[feature] !== "undefined";
},
@@ -232,9 +228,8 @@
* @return {Object} List of Services that enumerate their methods
*
* @member gadgets.util
- * @nosideeffects
*/
- getServices : function () {
+ 'getServices' : function () {
return services;
},
@@ -244,7 +239,7 @@
*
* @member gadgets.util
*/
- registerOnLoadHandler : function (callback) {
+ 'registerOnLoadHandler' : function (callback) {
onLoadHandlers.push(callback);
},
@@ -252,7 +247,7 @@
* Runs all functions registered via registerOnLoadHandler.
* @private Only to be used by the container, not gadgets.
*/
- runOnLoadHandlers : function () {
+ 'runOnLoadHandlers' : function () {
for (var i = 0, j = onLoadHandlers.length; i < j; ++i) {
onLoadHandlers[i]();
}
@@ -273,9 +268,8 @@
* @param {boolean=} opt_escapeObjects Whether to escape objects.
* @return {Object} The escaped object
* @private Only to be used by the container, not gadgets.
- * @nosideeffects
*/
- escape : function(input, opt_escapeObjects) {
+ 'escape' : function(input, opt_escapeObjects) {
if (!input) {
return input;
} else if (typeof input === "string") {
@@ -307,9 +301,8 @@
*
* @param {string} str The string to escape
* @return {string} The escaped string
- * @nosideeffects
*/
- escapeString : function(str) {
+ 'escapeString' : function(str) {
if (!str) return str;
var out = [], ch, shouldEscape;
for (var i = 0, j = str.length; i < j; ++i) {
@@ -330,9 +323,8 @@
*
* @param {string} str The string to unescape.
* @return {string}
- * @nosideeffects
*/
- unescapeString : function(str) {
+ 'unescapeString' : function(str) {
if (!str) return str;
return str.replace(/&#([0-9]+);/g, unescapeEntity);
}
@@ -340,5 +332,5 @@
}();
// Initialize url parameters so that hash data is pulled in before it can be
// altered by a click.
-gadgets.util.getUrlParameters();
+gadgets['util'].getUrlParameters();
Modified: incubator/shindig/trunk/features/src/main/javascript/features/opensocial-0.6/opensocial6to7.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/opensocial-0.6/opensocial6to7.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/opensocial-0.6/opensocial6to7.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/opensocial-0.6/opensocial6to7.js Tue Feb 2 22:20:39 2010
@@ -29,6 +29,9 @@
// If using enums, gadgets are ok.
// TODO: Translate hardcoded string params to the new gadgets values
+/**
+ * @deprecated
+ */
opensocial.makeRequest = function() {
return gadgets.io.makeRequest();
};
Modified: incubator/shindig/trunk/features/src/main/javascript/features/opensocial-base/fieldtranslations.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/opensocial-base/fieldtranslations.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/opensocial-base/fieldtranslations.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/opensocial-base/fieldtranslations.js Tue Feb 2 22:20:39 2010
@@ -21,200 +21,210 @@
* (which are unfortunately not the same)
*/
-var FieldTranslations = {};
+window['FieldTranslations'] = (function() {
+ // code that is used internally
+ function translateEnumJson(enumJson) {
+ if (enumJson) {
+ enumJson.key = enumJson.value;
+ }
+ };
+
+ function translateUrlJson(urlJson) {
+ if (urlJson) {
+ urlJson.address = urlJson.value;
+ }
+ };
+
+ return {
+ 'translateEnumJson' : translateEnumJson,
+ 'translateUrlJson' : translateUrlJson,
+ 'translateServerPersonToJsPerson' :
+ function(serverJson, opt_params) {
+ if (serverJson.emails) {
+ for (var i = 0; i < serverJson.emails.length; i++) {
+ serverJson.emails[i].address = serverJson.emails[i].value;
+ }
+ }
-FieldTranslations.translateServerPersonToJsPerson = function(serverJson, opt_params) {
- if (serverJson.emails) {
- for (var i = 0; i < serverJson.emails.length; i++) {
- serverJson.emails[i].address = serverJson.emails[i].value;
- }
- }
+ if (serverJson.phoneNumbers) {
+ for (var p = 0; p < serverJson.phoneNumbers.length; p++) {
+ serverJson.phoneNumbers[p].number = serverJson.phoneNumbers[p].value;
+ }
+ }
- if (serverJson.phoneNumbers) {
- for (var p = 0; p < serverJson.phoneNumbers.length; p++) {
- serverJson.phoneNumbers[p].number = serverJson.phoneNumbers[p].value;
- }
- }
+ if (serverJson.birthday) {
+ serverJson.dateOfBirth = serverJson.birthday;
+ }
- if (serverJson.birthday) {
- serverJson.dateOfBirth = serverJson.birthday;
- }
-
- if (serverJson.utcOffset) {
- serverJson.timeZone = serverJson.utcOffset;
- }
-
- if (serverJson.addresses) {
- for (var j = 0; j < serverJson.addresses.length; j++) {
- serverJson.addresses[j].unstructuredAddress = serverJson.addresses[j].formatted;
- }
- }
+ if (serverJson.utcOffset) {
+ serverJson.timeZone = serverJson.utcOffset;
+ }
- if (serverJson.gender) {
- var key = serverJson.gender == 'male' ? 'MALE' :
- (serverJson.gender == 'female') ? 'FEMALE' :
- null;
- serverJson.gender = {key : key, displayValue : serverJson.gender};
- }
-
- FieldTranslations.translateUrlJson(serverJson.profileSong);
- FieldTranslations.translateUrlJson(serverJson.profileVideo);
-
- if (serverJson.urls) {
- for (var u = 0; u < serverJson.urls.length; u++) {
- FieldTranslations.translateUrlJson(serverJson.urls[u]);
- }
- }
+ if (serverJson.addresses) {
+ for (var j = 0; j < serverJson.addresses.length; j++) {
+ serverJson.addresses[j].unstructuredAddress = serverJson.addresses[j].formatted;
+ }
+ }
- FieldTranslations.translateEnumJson(serverJson.drinker);
- FieldTranslations.translateEnumJson(serverJson.lookingFor);
- FieldTranslations.translateEnumJson(serverJson.networkPresence);
- FieldTranslations.translateEnumJson(serverJson.smoker);
-
- if (serverJson.organizations) {
- serverJson.jobs = [];
- serverJson.schools = [];
-
- for (var o = 0; o < serverJson.organizations.length; o++) {
- var org = serverJson.organizations[o];
- if (org.type == 'job') {
- serverJson.jobs.push(org);
- } else if (org.type == 'school') {
- serverJson.schools.push(org);
+ if (serverJson.gender) {
+ var key = serverJson.gender == 'male' ? 'MALE' :
+ (serverJson.gender == 'female') ? 'FEMALE' :
+ null;
+ serverJson.gender = {key : key, displayValue : serverJson.gender};
}
- }
- }
- if (serverJson.name) {
- serverJson.name.unstructured = serverJson.name.formatted;
- }
-
- if (serverJson.appData) {
- serverJson.appData = opensocial.Container.escape(
- serverJson.appData, opt_params, true);
- }
-
-};
-
-FieldTranslations.translateEnumJson = function(enumJson) {
- if (enumJson) {
- enumJson.key = enumJson.value;
- }
-};
-
-FieldTranslations.translateUrlJson = function(urlJson) {
- if (urlJson) {
- urlJson.address = urlJson.value;
- }
-};
-
-
-FieldTranslations.translateJsPersonFieldsToServerFields = function(fields) {
- for (var i = 0; i < fields.length; i++) {
- if (fields[i] == 'dateOfBirth') {
- fields[i] = 'birthday';
- } else if (fields[i] == 'timeZone') {
- fields[i] = 'utcOffset';
- } else if (fields[i] == 'jobs') {
- fields[i] = 'organizations';
- } else if (fields[i] == 'schools') {
- fields[i] = 'organizations';
- }
- }
+ translateUrlJson(serverJson.profileSong);
+ translateUrlJson(serverJson.profileVideo);
- // displayName and id always need to be requested
- fields.push('id');
- fields.push('displayName');
-};
-
-FieldTranslations.translateIsoStringToDate = function(isoString) {
- // Date parsing code from http://delete.me.uk/2005/03/iso8601.html
- var regexp = '([0-9]{4})(-([0-9]{2})(-([0-9]{2})' +
- '(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?' +
- '(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?';
- var d = isoString.match(new RegExp(regexp));
-
- var offset = 0;
- var date = new Date(d[1], 0, 1);
-
- if (d[3]) { date.setMonth(d[3] - 1); }
- if (d[5]) { date.setDate(d[5]); }
- if (d[7]) { date.setHours(d[7]); }
- if (d[8]) { date.setMinutes(d[8]); }
- if (d[10]) { date.setSeconds(d[10]); }
- if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); }
- if (d[14]) {
- offset = (Number(d[16]) * 60) + Number(d[17]);
- offset *= ((d[15] == '-') ? 1 : -1);
- }
-
- offset -= date.getTimezoneOffset();
- time = (Number(date) + (offset * 60 * 1000));
-
- return new Date(Number(time));
-};
-
-/**
- * AppData is provided by the REST and JSON-RPC protocols using
- * an "appData" or "appData.key" field, but is described by
- * the JS fetchPerson() API in terms of an appData param. Translate
- * between the two.
- */
-FieldTranslations.addAppDataAsProfileFields = function(opt_params) {
- if (opt_params) {
- // Push the appData keys in as profileDetails
- if (opt_params['appData']) {
- var appDataKeys = opt_params['appData'];
- if (typeof appDataKeys === 'string') {
- appDataKeys = [appDataKeys];
+ if (serverJson.urls) {
+ for (var u = 0; u < serverJson.urls.length; u++) {
+ translateUrlJson(serverJson.urls[u]);
+ }
}
- var profileDetail = opt_params['profileDetail'] || [];
- for (var i = 0; i < appDataKeys.length; i++) {
- if (appDataKeys[i] === '*') {
- profileDetail.push('appData');
- } else {
- profileDetail.push('appData.' + appDataKeys[i]);
+ translateEnumJson(serverJson.drinker);
+ translateEnumJson(serverJson.lookingFor);
+ translateEnumJson(serverJson.networkPresence);
+ translateEnumJson(serverJson.smoker);
+
+ if (serverJson.organizations) {
+ serverJson.jobs = [];
+ serverJson.schools = [];
+
+ for (var o = 0; o < serverJson.organizations.length; o++) {
+ var org = serverJson.organizations[o];
+ if (org.type == 'job') {
+ serverJson.jobs.push(org);
+ } else if (org.type == 'school') {
+ serverJson.schools.push(org);
+ }
}
}
- opt_params['appData'] = appDataKeys;
- }
- }
-};
+ if (serverJson.name) {
+ serverJson.name.unstructured = serverJson.name.formatted;
+ }
-/**
- * Translate standard Javascript arguments to JSON-RPC protocol format.
- */
-FieldTranslations.translateStandardArguments = function(opt_params, rpc_params) {
- if (opt_params['first']) {
- rpc_params.startIndex = opt_params['first'];
- }
- if (opt_params['max']) {
- rpc_params.count = opt_params['max'];
- }
- if (opt_params['sortOrder']) {
- rpc_params.sortBy = opt_params['sortOrder'];
- }
- if (opt_params['filter']) {
- rpc_params.filterBy = opt_params['filter'];
- }
- if (opt_params['filterOp']) {
- rpc_params.filterOp = opt_params['filterOp'];
- }
- if (opt_params['filterValue']) {
- rpc_params.filterValue = opt_params['filterValue'];
- }
- if (opt_params['fields']) {
- rpc_params.fields = opt_params['fields'];
- }
-};
+ if (serverJson.appData) {
+ serverJson.appData = opensocial.Container.escape(
+ serverJson.appData, opt_params, true);
+ }
-/**
- * Translate network distance from id spec to JSON-RPC parameters.
- */
-FieldTranslations.translateNetworkDistance = function(idSpec, rpc_params) {
- if (idSpec.getField('networkDistance')) {
- rpc_params.networkDistance = idSpec.getField('networkDistance');
- }
-};
+ },
+
+
+ 'translateJsPersonFieldsToServerFields' :
+ function(fields) {
+ for (var i = 0; i < fields.length; i++) {
+ if (fields[i] == 'dateOfBirth') {
+ fields[i] = 'birthday';
+ } else if (fields[i] == 'timeZone') {
+ fields[i] = 'utcOffset';
+ } else if (fields[i] == 'jobs') {
+ fields[i] = 'organizations';
+ } else if (fields[i] == 'schools') {
+ fields[i] = 'organizations';
+ }
+ }
+
+ // displayName and id always need to be requested
+ fields.push('id');
+ fields.push('displayName');
+ },
+
+ 'translateIsoStringToDate' : function(isoString) {
+ // Date parsing code from http://delete.me.uk/2005/03/iso8601.html
+ var regexp = '([0-9]{4})(-([0-9]{2})(-([0-9]{2})' +
+ '(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?' +
+ '(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?';
+ var d = isoString.match(new RegExp(regexp));
+
+ var offset = 0;
+ var date = new Date(d[1], 0, 1);
+
+ if (d[3]) { date.setMonth(d[3] - 1); }
+ if (d[5]) { date.setDate(d[5]); }
+ if (d[7]) { date.setHours(d[7]); }
+ if (d[8]) { date.setMinutes(d[8]); }
+ if (d[10]) { date.setSeconds(d[10]); }
+ if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); }
+ if (d[14]) {
+ offset = (Number(d[16]) * 60) + Number(d[17]);
+ offset *= ((d[15] == '-') ? 1 : -1);
+ }
+
+ offset -= date.getTimezoneOffset();
+ var time = (Number(date) + (offset * 60 * 1000));
+
+ return new Date(Number(time));
+ },
+
+ /**
+ * AppData is provided by the REST and JSON-RPC protocols using
+ * an "appData" or "appData.key" field, but is described by
+ * the JS fetchPerson() API in terms of an appData param. Translate
+ * between the two.
+ */
+ 'addAppDataAsProfileFields' : function(opt_params) {
+ if (opt_params) {
+ // Push the appData keys in as profileDetails
+ if (opt_params['appData']) {
+ var appDataKeys = opt_params['appData'];
+ if (typeof appDataKeys === 'string') {
+ appDataKeys = [appDataKeys];
+ }
+
+ var profileDetail = opt_params['profileDetail'] || [];
+ for (var i = 0; i < appDataKeys.length; i++) {
+ if (appDataKeys[i] === '*') {
+ profileDetail.push('appData');
+ } else {
+ profileDetail.push('appData.' + appDataKeys[i]);
+ }
+ }
+
+ opt_params['appData'] = appDataKeys;
+ }
+ }
+ },
+
+ /**
+ * Translate standard Javascript arguments to JSON-RPC protocol format.
+ */
+ 'translateStandardArguments' :
+ function(opt_params, rpc_params) {
+ if (opt_params['first']) {
+ rpc_params.startIndex = opt_params['first'];
+ }
+ if (opt_params['max']) {
+ rpc_params.count = opt_params['max'];
+ }
+ if (opt_params['sortOrder']) {
+ rpc_params.sortBy = opt_params['sortOrder'];
+ }
+ if (opt_params['filter']) {
+ rpc_params.filterBy = opt_params['filter'];
+ }
+ if (opt_params['filterOp']) {
+ rpc_params.filterOp = opt_params['filterOp'];
+ }
+ if (opt_params['filterValue']) {
+ rpc_params.filterValue = opt_params['filterValue'];
+ }
+ if (opt_params['fields']) {
+ rpc_params.fields = opt_params['fields'];
+ }
+ },
+
+ /**
+ * Translate network distance from id spec to JSON-RPC parameters.
+ */
+ 'translateNetworkDistance' :
+ function(idSpec, rpc_params) {
+ if (idSpec.getField('networkDistance')) {
+ rpc_params.networkDistance = idSpec.getField('networkDistance');
+ }
+ }
+ // end of returned Object, please no commas
+ };
+})();
Modified: incubator/shindig/trunk/features/src/main/javascript/features/opensocial-base/jsonmessage.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/opensocial-base/jsonmessage.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/opensocial-base/jsonmessage.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/opensocial-base/jsonmessage.js Tue Feb 2 22:20:39 2010
@@ -22,6 +22,8 @@
*
* @private
* @constructor
+ * @param {string} body
+ * @param {Object=} opt_params
*/
var JsonMessage = function(body, opt_params) {
opt_params = opt_params || {};
Modified: incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data/data.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data/data.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data/data.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/opensocial-data/data.js Tue Feb 2 22:20:39 2010
@@ -27,12 +27,14 @@
/**
* @type {string} The key attribute constant.
+ * @const
*/
opensocial.data.ATTR_KEY = "key";
/**
* @type {string} The type of script tags that contain data markup.
+ * @const
*/
opensocial.data.SCRIPT_TYPE = "text/os-data";
@@ -535,7 +537,7 @@
/**
* Parses a string of comma-separated field names and adds the resulting array
* (if any) to the params object.
- * @param {object} params The params object used to construct an Opensocial
+ * @param {Object} params The params object used to construct an Opensocial
* DataRequest
* @param {string} fieldsStr A string containing comma-separated field names
*/
Modified: incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/collection.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/collection.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/collection.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/collection.js Tue Feb 2 22:20:39 2010
@@ -43,6 +43,9 @@
*
* @private
* @constructor
+ * @param {Array} array
+ * @param {number=} opt_offset
+ * @param {number=} opt_totalSize
*/
opensocial.Collection = function(array, opt_offset, opt_totalSize) {
this.array_ = array || [];
@@ -73,6 +76,7 @@
* Gets the size of this collection,
* which is equal to or less than the
* total size of the result.
+ *
* @return {number} The size of this collection
*/
opensocial.Collection.prototype.size = function() {
@@ -84,6 +88,7 @@
* Executes the provided function once per member of the collection,
* with each member in turn as the
* parameter to the function.
+ *
* @param {function(Object)} fn The function to call with each collection entry
*/
opensocial.Collection.prototype.each = function(fn) {
Modified: incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/container.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/container.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/container.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/container.js Tue Feb 2 22:20:39 2010
@@ -124,7 +124,7 @@
* sharing request was sent. If there was an error, you can use the response
* item's getErrorCode method to determine how to proceed. The data on the
* response item will not be set.
- * @param {Object} opt_params TODO
+ * @param {Object=} opt_params TODO
*
* @member opensocial
* @private
Modified: incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/mediaitem.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/mediaitem.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/mediaitem.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/mediaitem.js Tue Feb 2 22:20:39 2010
@@ -66,6 +66,8 @@
* </p>
*
* @name opensocial.MediaItem.Type
+ * @enum {string}
+ * @const
*/
opensocial.MediaItem.Type = {
/** @member opensocial.MediaItem.Type */
Modified: incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/message.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/message.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/message.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/message.js Tue Feb 2 22:20:39 2010
@@ -72,6 +72,8 @@
* </p>
*
* @name opensocial.Message.Field
+ * @enum {string}
+ * @const
*/
opensocial.Message.Field = {
/**
@@ -84,6 +86,7 @@
* The main text of the message. HTML attributes are allowed and are
* sanitized by the container.
* @member opensocial.Message.Field
+ * @const
*/
BODY : 'body',
Modified: incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/phone.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/phone.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/phone.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/phone.js Tue Feb 2 22:20:39 2010
@@ -50,6 +50,8 @@
* <a href="opensocial.Phone.html#getField">Phone.getField()</a> method.
*
* @name opensocial.Phone.Field
+ * @enum {string}
+ * @const
*/
opensocial.Phone.Field = {
/**
Modified: incubator/shindig/trunk/features/src/main/javascript/features/opensocial-templates/base.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/opensocial-templates/base.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/opensocial-templates/base.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/opensocial-templates/base.js Tue Feb 2 22:20:39 2010
@@ -185,7 +185,7 @@
* (including transformed custom tags) are used as keys.
* Where multiple elements share a name, the map value will be an array.
* @param {Element} node The node whose children are to be mapped
- * @return {object} A Map of Element names to Elements.
+ * @return {Object} A Map of Element names to Elements.
*/
os.computeChildMap_ = function(node) {
var map = {};
Modified: incubator/shindig/trunk/features/src/main/javascript/features/osapi/batch.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/osapi/batch.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/osapi/batch.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/osapi/batch.js Tue Feb 2 22:20:39 2010
@@ -38,6 +38,8 @@
// transport : <rpc dispatcher>
// }
// }
+
+ /** @type {Array.<Object>} */
var keyedRequests = [];
/**
@@ -81,6 +83,7 @@
var perTransportBatch = {};
// Break requests into their per-transport batches in call order
+ /** @type {number} */
var latchCount = 0;
var transports = [];
for (var i = 0; i < keyedRequests.length; i++) {
Modified: incubator/shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/osapi/gadgetsrpctransport.js Tue Feb 2 22:20:39 2010
@@ -29,7 +29,7 @@
* Execute the JSON-RPC batch of gadgets.rpc. The container is expected to implement
* the method osapi._handleGadgetRpcMethod(<JSON-RPC batch>)
*
- * @param {object} requests the opensocial JSON-RPC request batch
+ * @param {Object} requests the opensocial JSON-RPC request batch
* @param {function(Object)} callback to the osapi batch with either an error response or
* a JSON-RPC batch result
* @private
Modified: incubator/shindig/trunk/features/src/main/javascript/features/osapi/osapi.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/osapi/osapi.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/osapi/osapi.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/osapi/osapi.js Tue Feb 2 22:20:39 2010
@@ -23,7 +23,7 @@
/**
* Called by the transports for each service method that they expose
* @param {string} method The method to expose e.g. "people.get"
- * @param {Object.<String,Object>} transport The transport used to execute a call for the method
+ * @param {Object.<string,Object>} transport The transport used to execute a call for the method
*/
osapi._registerMethod = function (method, transport) {
var parts = method.split(".");
Modified: incubator/shindig/trunk/features/src/main/javascript/features/osapi/peoplehelpers.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/osapi/peoplehelpers.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/osapi/peoplehelpers.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/osapi/peoplehelpers.js Tue Feb 2 22:20:39 2010
@@ -23,7 +23,7 @@
*/
gadgets.util.registerOnLoadHandler(function() {
- // No point defining these if osapi.people.get doesnt exist
+ // No point defining these if osapi.people.get doesn't exist
if (osapi && osapi.people && osapi.people.get) {
/**
* Helper functions to get People.
Modified: incubator/shindig/trunk/features/src/main/javascript/features/pubsub/pubsub-router.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/pubsub/pubsub-router.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/pubsub/pubsub-router.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/pubsub/pubsub-router.js Tue Feb 2 22:20:39 2010
@@ -78,7 +78,7 @@
* @param {function(number)} gadgetIdToSpecUrlHandler Function that returns the full
* gadget spec URL of a given gadget id. For example:
* function(id) { return idToUrlMap[id]; }
- * @param {object=} opt_callbacks Optional event handlers. Supported handlers:
+ * @param {Object=} opt_callbacks Optional event handlers. Supported handlers:
* opt_callbacks.onSubscribe: function(gadgetId, channel)
* Called when a gadget tries to subscribe to a channel.
* opt_callbacks.onUnsubscribe: function(gadgetId, channel)
Modified: incubator/shindig/trunk/features/src/main/javascript/features/xmlutil/feature.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/xmlutil/feature.xml?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/xmlutil/feature.xml (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/xmlutil/feature.xml Tue Feb 2 22:20:39 2010
@@ -19,6 +19,7 @@
-->
<feature>
<name>xmlutil</name>
+ <dependency>globals</dependency>
<gadget>
<script src="xmlutil.js"></script>
</gadget>
Modified: incubator/shindig/trunk/features/src/test/javascript/features/mocks/window.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/test/javascript/features/mocks/window.js?rev=905819&r1=905818&r2=905819&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/test/javascript/features/mocks/window.js (original)
+++ incubator/shindig/trunk/features/src/test/javascript/features/mocks/window.js Tue Feb 2 22:20:39 2010
@@ -36,9 +36,9 @@
/**
* @constructor
* @description creates a new fake window object.
- * @param {String} url Destination url.
- * @param {String} target Name of window
- * @param {String} options Options for window, such as size.
+ * @param {string} url Destination url.
+ * @param {string} target Name of window
+ * @param {string} options Options for window, such as size.
*/
mocks.FakeWindow = function(url, target, options) {
// Properties passed to window.open