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 2011/07/24 09:38:42 UTC
svn commit: r1150288 - in /shindig/trunk/features: ./
src/main/javascript/features/caja/
src/main/javascript/features/container.gadget/
src/main/javascript/features/container.url/
src/main/javascript/features/container.util/ src/main/javascript/feature...
Author: lindner
Date: Sun Jul 24 07:38:35 2011
New Revision: 1150288
URL: http://svn.apache.org/viewvc?rev=1150288&view=rev
Log:
gjslint cleanups, jsdoc report tweaks, part 1
Modified:
shindig/trunk/features/pom.xml
shindig/trunk/features/src/main/javascript/features/caja/taming.js
shindig/trunk/features/src/main/javascript/features/container.gadget/gadget_site.js
shindig/trunk/features/src/main/javascript/features/container.url/url_holder.js
shindig/trunk/features/src/main/javascript/features/container.url/url_site.js
shindig/trunk/features/src/main/javascript/features/container.util/constant.js
shindig/trunk/features/src/main/javascript/features/container.util/util.js
shindig/trunk/features/src/main/javascript/features/container/container.js
shindig/trunk/features/src/main/javascript/features/container/service.js
shindig/trunk/features/src/main/javascript/features/core.config/validators.js
shindig/trunk/features/src/main/javascript/features/core.io/io.js
shindig/trunk/features/src/main/javascript/features/core.json/json-jsimpl.js
shindig/trunk/features/src/main/javascript/features/core.log/log.js
shindig/trunk/features/src/main/javascript/features/core.prefs/prefs.js
shindig/trunk/features/src/main/javascript/features/core.util.base/base.js
shindig/trunk/features/src/main/javascript/features/core.util.dom/dom.js
shindig/trunk/features/src/main/javascript/features/core.util.onload/onload.js
shindig/trunk/features/src/main/javascript/features/core.util.string/string.js
shindig/trunk/features/src/main/javascript/features/core.util.urlparams/urlparams.js
shindig/trunk/features/src/main/javascript/features/core.util/util.js
shindig/trunk/features/src/main/javascript/features/dynamic-height.height/dynamic-height-height.js
shindig/trunk/features/src/main/javascript/features/dynamic-height.util/dynamic-height-util.js
shindig/trunk/features/src/main/javascript/features/embeddedexperiences/constant.js
shindig/trunk/features/src/main/javascript/features/exportjs/exportjs.js
shindig/trunk/features/src/main/javascript/features/flash/flash.js
shindig/trunk/features/src/main/javascript/features/gadgets.json.ext/json-xmltojson.js
shindig/trunk/features/src/main/javascript/features/minimessage/minimessage.js
shindig/trunk/features/src/main/javascript/features/opensearch/opensearch.js
shindig/trunk/features/src/main/javascript/features/opensocial-jsonrpc/jsonrpccontainer.js
shindig/trunk/features/src/main/javascript/features/rpc/wpm.transport.js
shindig/trunk/features/src/main/javascript/features/shindig.container/shindig-container.js
shindig/trunk/features/src/main/javascript/features/tabs/tabs.js
shindig/trunk/features/src/main/javascript/features/xmlutil/xmlutil.js
Modified: shindig/trunk/features/pom.xml
URL: http://svn.apache.org/viewvc/shindig/trunk/features/pom.xml?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/pom.xml (original)
+++ shindig/trunk/features/pom.xml Sun Jul 24 07:38:35 2011
@@ -295,6 +295,10 @@
<recurse>3</recurse><!-- This is the level of recursion, not a boolean -->
<srcDir>${basedir}/src/main/javascript/features</srcDir>
<ext>js</ext>
+ <exclude>
+ <param>.+.opt.js</param>
+ <param>swfobject.js</param>
+ </exclude>
</configuration>
</plugin>
</plugins>
Modified: shindig/trunk/features/src/main/javascript/features/caja/taming.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/caja/taming.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/caja/taming.js (original)
+++ shindig/trunk/features/src/main/javascript/features/caja/taming.js Sun Jul 24 07:38:35 2011
@@ -92,8 +92,8 @@ caja___ = (function() {
schema[2] /* parent */,
schema[1] /* name */);
} else {
- gadgets.warn('Error taming constructor: '
- + schema[0] + '.' + schema[1]);
+ gadgets.warn('Error taming constructor: ' +
+ schema[0] + '.' + schema[1]);
}
}
}
@@ -205,7 +205,7 @@ caja___ = (function() {
new tameWin.HtmlEmitter(gadgetBody, imports.document);
imports.onerror = tame___.tame(
- tame___.markTameAsFunction(function (msg, source, line) {
+ tame___.markTameAsFunction(function(msg, source, line) {
gadgets.log([msg, source, line]);
}));
@@ -221,7 +221,7 @@ caja___ = (function() {
guestWin.plugin_dispatchEvent___ = tameWin.plugin_dispatchEvent___;
guestWin.plugin_dispatchToHandler___ = tameWin.plugin_dispatchToHandler___;
guestWin.___.getNewModuleHandler().setImports(imports);
- guestWin.___.useDebugSymbols = function(){};
+ guestWin.___.useDebugSymbols = function() {};
guestWin.cajaRun(pendingScript);
}
Modified: shindig/trunk/features/src/main/javascript/features/container.gadget/gadget_site.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/container.gadget/gadget_site.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/container.gadget/gadget_site.js (original)
+++ shindig/trunk/features/src/main/javascript/features/container.gadget/gadget_site.js Sun Jul 24 07:38:35 2011
@@ -62,8 +62,8 @@ osapi.container.GadgetSite = function(ar
* @type {string}
* @private
*/
- this.id_ = (this.currentGadgetEl && this.currentGadgetEl_.id) ? this.currentGadgetEl_.id
- : osapi.container.GadgetSite.nextUniqueId_++;
+ this.id_ = (this.currentGadgetEl && this.currentGadgetEl_.id) ? this.currentGadgetEl_.id :
+ osapi.container.GadgetSite.nextUniqueId_++;
/**
* ID of parent gadget.
Modified: shindig/trunk/features/src/main/javascript/features/container.url/url_holder.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/container.url/url_holder.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/container.url/url_holder.js (original)
+++ shindig/trunk/features/src/main/javascript/features/container.url/url_holder.js Sun Jul 24 07:38:35 2011
@@ -19,6 +19,10 @@
/**
* @fileoverview Constructs a new URL holder. This class is similar in
* functionality to GadgetHolder from the common container.
+ */
+
+/**
+ * @constructor
* @param {number} siteId The id of the URL site.
* @param {Element} el The element to contain the URL renders in.
*/
@@ -103,8 +107,8 @@ osapi.container.UrlHolder.prototype.getI
/**
* Renders the embedded experience URL.
- * @param {string} the URL to render.
- * @param {object} rendering params to apply to the iFrame.
+ * @param {string} url the URL to render.
+ * @param {object} renderParams params to apply to the iFrame.
*/
osapi.container.UrlHolder.prototype.render = function(url, renderParams) {
this.iframeId_ = osapi.container.UrlHolder.IFRAME_PREFIX_ + this.siteId_;
@@ -116,7 +120,7 @@ osapi.container.UrlHolder.prototype.rend
/**
* Crates the HTML for the iFrame.
- * @return the HTML for the iFrame.
+ * @return {string} the HTML for the iFrame.
* @private
*/
osapi.container.UrlHolder.prototype.createIframeHtml_ = function() {
Modified: shindig/trunk/features/src/main/javascript/features/container.url/url_site.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/container.url/url_site.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/container.url/url_site.js (original)
+++ shindig/trunk/features/src/main/javascript/features/container.url/url_site.js Sun Jul 24 07:38:35 2011
@@ -19,9 +19,12 @@
/**
* @fileoverview Constructs a new URL site. This class is very similar in functionality to
* the GadgetSite class which is part of the common container.
+ */
+
+/**
+ * @constructor
* @param {Object} args containing DOM element to rende the iFrame in, and URL
* to render in the iFrame.
- * @constructor
*/
osapi.container.UrlSite = function(args) {
/**
@@ -64,7 +67,7 @@ osapi.container.UrlSite.prototype.onCons
/**
* Sets the height of the iFrame.
- * @param {number} the height of the embedded experience.
+ * @param {number} height the height of the embedded experience.
* @return {osapi.container.UrlSite} this gadget site.
*/
osapi.container.UrlSite.prototype.setHeight = function(height) {
@@ -79,7 +82,7 @@ osapi.container.UrlSite.prototype.setHei
/**
* Set the width of the iFrame.
- * @param {number} the width of the embedded experience.
+ * @param {number} width the width of the embedded experience.
* @return {osapi.container.UrlSite} this instance.
*/
osapi.container.UrlSite.prototype.setWidth = function(width) {
@@ -94,7 +97,7 @@ osapi.container.UrlSite.prototype.setWid
/**
* Sets the id of the parent DOM element containing this embedded experience.
- * @param {number} the id of the parent DOM element.
+ * @param {number} parentId the id of the parent DOM element.
* @return {osapi.container.UrlSite} this instance.
*/
osapi.container.UrlSite.prototype.setParentId = function(parentId) {
@@ -142,7 +145,7 @@ osapi.container.UrlSite.prototype.close
/**
* Renders the URL in this site
* @param {string} url to render in the iFrame.
- * @param {object} the parameters to render the site.
+ * @param {object} renderParams the parameters to render the site.
*/
osapi.container.UrlSite.prototype.render = function(url, renderParams) {
this.holder_ = new osapi.container.UrlHolder(this.id_, this.el_);
@@ -157,10 +160,14 @@ osapi.container.UrlSite.prototype.render
/**
* The next unique id for URL sites.
+ * @private
+ * @type {number}
*/
osapi.container.UrlSite.nextUniqueId_ = 0;
/**
* The URL element key
+ * @const
+ * @type {string}
*/
osapi.container.UrlSite.URL_ELEMENT = 'urlEl';
Modified: shindig/trunk/features/src/main/javascript/features/container.util/constant.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/container.util/constant.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/container.util/constant.js (original)
+++ shindig/trunk/features/src/main/javascript/features/container.util/constant.js Sun Jul 24 07:38:35 2011
@@ -142,9 +142,11 @@ osapi.container.ViewParam = {
/**
* Constants to define lifecycle callback
+ * @enum {string}
*/
-osapi.container.CallbackType = {};
-osapi.container.CallbackType.ON_PRELOADED = 'onPreloaded';
-osapi.container.CallbackType.ON_NAVIGATED = 'onNavigated';
-osapi.container.CallbackType.ON_CLOSED = 'onClosed';
-osapi.container.CallbackType.ON_UNLOADED = 'onUnloaded';
+osapi.container.CallbackType = {
+ ON_PRELOADED: 'onPreloaded',
+ ON_NAVIGATED: 'onNavigated',
+ ON_CLOSED: 'onClosed',
+ ON_UNLOADED: 'onUnloaded'
+};
Modified: shindig/trunk/features/src/main/javascript/features/container.util/util.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/container.util/util.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/container.util/util.js (original)
+++ shindig/trunk/features/src/main/javascript/features/container.util/util.js Sun Jul 24 07:38:35 2011
@@ -67,7 +67,7 @@ osapi.container.util.mergeJsons = functi
*/
osapi.container.util.newMetadataRequest = function(gadgetUrls) {
if (!osapi.container.util.isArray(gadgetUrls)) {
- gadgetUrls = [gadgetUrls];
+ gadgetUrls = [gadgetUrls];
}
return {
'container': window.__CONTAINER,
@@ -121,11 +121,11 @@ osapi.container.util.toArrayOfJsonKeys =
/**
* Tests an object to see if it is an array or not.
- * @param {object} ojb Object to test.
+ * @param {object} obj Object to test.
* @return {boolean} If obj is an array.
*/
osapi.container.util.isArray = function(obj) {
- return Object.prototype.toString.call(obj) == '[object Array]';
+ return Object.prototype.toString.call(obj) == '[object Array]';
};
@@ -161,8 +161,8 @@ osapi.container.util.getCurrentTimeMs =
/**
* Crates the HTML for the iFrame
- * @param {iframeParams} iframe Params.
- * @return the HTML for the iFrame.
+ * @param {Object.<string,string>} iframeParams iframe Params.
+ * @return {string} the HTML for the iFrame.
*/
osapi.container.util.createIframeHtml = function(iframeParams) {
Modified: shindig/trunk/features/src/main/javascript/features/container/container.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/container/container.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/container/container.js (original)
+++ shindig/trunk/features/src/main/javascript/features/container/container.js Sun Jul 24 07:38:35 2011
@@ -234,10 +234,16 @@ osapi.container.Container.prototype.clos
/**
- * Add a callback to be called when one or more gadgets are preloaded, navigated to or closed.
- * @param {Object} callback object to call back when a gadget is preloaded, navigated to or closed.
- * called via preloaded, navigated and closed methods.
- * @return true if added successfully, false if a callback with that name is already registered.
+ * Add a callback to be called when one or more gadgets are preloaded,
+ * navigated to or closed.
+ *
+ * @param {string} name name of the lifecycle callback.
+ * @param {Object} lifeCycleCallback callback object to call back when a gadget is
+ * preloaded, navigated to or closed. called via preloaded, navigated
+ * and closed methods.
+ *
+ * @return {boolean} true if added successfully, false if a callback
+ * with that name is already registered.
*/
osapi.container.Container.prototype.addGadgetLifecycleCallback = function(name, lifeCycleCallback) {
if (!this.gadgetLifecycleCallbacks_[name]) {
@@ -249,7 +255,7 @@ osapi.container.Container.prototype.addG
/**
* remove a lifecycle callback previously registered with the container
- * @param {Object} callback object to be removed.
+ * @param {string} name callback object to be removed.
*/
osapi.container.Container.prototype.removeGadgetLifecycleCallback = function(name) {
delete this.gadgetLifecycleCallbacks_[name];
@@ -542,7 +548,7 @@ osapi.container.Container.prototype.refr
/**
* @param {string} iframeId Iframe ID of gadget holder contained in the gadget
- * site to get.
+ * site to get.
* @return {osapi.container.GadgetSite} The gadget site.
* @private
*/
@@ -628,8 +634,8 @@ osapi.container.Container.prototype.regi
if (site && setPrefs) { // Check if site is not already closed.
var data = {};
for (var i = 2, j = arguments.length; i < j; i += 2) {
- data[arguments[i]] = arguments[i + 1];
- }
+ data[arguments[i]] = arguments[i + 1];
+ }
setPrefs(site.getId(), site.getActiveGadgetHolder().getUrl(), data);
}
});
@@ -729,7 +735,7 @@ osapi.container.Container.prototype.refr
/**
* invokes methods on the gadget lifecycle callback registered with the
* container.
- * @param {string} name of the callback method to be called.
+ * @param {string} methodName of the callback method to be called.
* @param {Object} data to be passed to the callback method.
* @private
*/
@@ -746,7 +752,8 @@ osapi.container.Container.prototype.appl
/**
* Creates a new URL site
* @param {Element} element the element to put the site in.
-*/
+ * @return {osapi.container.UrlSite} a new site.
+ */
osapi.container.Container.prototype.newUrlSite = function(element) {
var args = {};
args[osapi.container.UrlSite.URL_ELEMENT] = element;
@@ -757,8 +764,10 @@ osapi.container.Container.prototype.newU
/**
* Navigates to a URL
* @param {osapi.container.UrlSite} site the URL site to render the URL in.
- * @param {String} url the URL to render.
- * @param {object} renderParams params to augment the rendering.
+ * @param {string} url the URL to render.
+ * @param {Object} renderParams params to augment the rendering.
+ * @return {osapi.container.UrlSite} the site you passed in.
+ *
* Valid rendering parameters include osapi.container.RenderParam.CLASS,
* osapi.container.RenderParam.HEIGHT, and osapi.container.RenderParam.WIDTH.
*/
Modified: shindig/trunk/features/src/main/javascript/features/container/service.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/container/service.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/container/service.js (original)
+++ shindig/trunk/features/src/main/javascript/features/container/service.js Sun Jul 24 07:38:35 2011
@@ -338,6 +338,7 @@ osapi.container.Service.prototype.filter
/**
* @return {string} Best-guess locale for current browser.
+ * @private
*/
osapi.container.Service.prototype.getLocale_ = function() {
var nav = window.navigator;
Modified: shindig/trunk/features/src/main/javascript/features/core.config/validators.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.config/validators.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/core.config/validators.js (original)
+++ shindig/trunk/features/src/main/javascript/features/core.config/validators.js Sun Jul 24 07:38:35 2011
@@ -26,10 +26,6 @@
* Also supports argument sytax: EnumValidator("Dog", "Cat", "Fish");
*
* @param {Array.<string>} list The list of valid values.
- *
- * @member gadgets.config
- * @name EnumValidator
- * @function
*/
gadgets.config.EnumValidator = function(list) {
var listItems = [];
@@ -53,8 +49,6 @@
/**
* Tests the value against a regular expression.
* @member gadgets.config
- * @name RegexValidator
- * @function
*/
gadgets.config.RegExValidator = function(re) {
return function(data) {
@@ -65,9 +59,6 @@
/**
* Validates that a value was provided.
* @param {*} data
- * @member gadgets.config
- * @name ExistsValidator
- * @function
*/
gadgets.config.ExistsValidator = function(data) {
return typeof data !== 'undefined';
@@ -76,9 +67,6 @@
/**
* Validates that a value is a non-empty string.
* @param {*} data
- * @member gadgets.config
- * @name NonEmptyStringValidator
- * @function
*/
gadgets.config.NonEmptyStringValidator = function(data) {
return typeof data === 'string' && data.length > 0;
@@ -87,9 +75,6 @@
/**
* Validates that the value is a boolean.
* @param {*} data
- * @member gadgets.config
- * @name BooleanValidator
- * @function
*/
gadgets.config.BooleanValidator = function(data) {
return typeof data === 'boolean';
@@ -112,9 +97,6 @@
*
*
* @param {Object} test The object to test against.
- * @member gadgets.config
- * @name BooleanValidator
- * @function
*/
gadgets.config.LikeValidator = function(test) {
return function(data) {
Modified: shindig/trunk/features/src/main/javascript/features/core.io/io.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.io/io.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/core.io/io.js (original)
+++ shindig/trunk/features/src/main/javascript/features/core.io/io.js Sun Jul 24 07:38:35 2011
@@ -26,9 +26,7 @@
*/
/**
- * @static
* @class Provides remote content retrieval functions.
- * @name gadgets.io
*/
gadgets.io = function() {
@@ -44,6 +42,7 @@ gadgets.io = function() {
/**
* Internal facility to create an xhr request.
+ * @return {XMLHttpRequest}
*/
function makeXhr() {
var x;
@@ -431,8 +430,8 @@ gadgets.io = function() {
if (httpMethod === 'GET' && refreshInterval > 0) {
// this content should be cached
// Add paramData to the URL
- var extraparams = '?refresh=' + refreshInterval + '&'
- + gadgets.io.encodeValues(paramData);
+ var extraparams = '?refresh=' + refreshInterval + '&' +
+ gadgets.io.encodeValues(paramData);
makeXhrRequest(url, proxyUrl + extraparams, callback,
null, 'GET', params, processResponse);
Modified: shindig/trunk/features/src/main/javascript/features/core.json/json-jsimpl.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.json/json-jsimpl.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/core.json/json-jsimpl.js (original)
+++ shindig/trunk/features/src/main/javascript/features/core.json/json-jsimpl.js Sun Jul 24 07:38:35 2011
@@ -48,7 +48,8 @@ if (!(window.JSON && window.JSON.parse &
/**
* Formats integers to 2 digits.
- * @param {number} n
+ * @param {number} n number to format.
+ * @return {string} the formatted number.
* @private
*/
function f(n) {
Modified: shindig/trunk/features/src/main/javascript/features/core.log/log.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.log/log.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/core.log/log.js (original)
+++ shindig/trunk/features/src/main/javascript/features/core.log/log.js Sun Jul 24 07:38:35 2011
@@ -46,13 +46,13 @@ gadgets.log = (function() {
/** @const */
var none_ = 4;
- /**
+/**
* Log an informational message
* @param {Object} message - the message to log.
* @member gadgets
- * @name log
- * @function
- */
+ * @name log
+ * @function
+ */
var log = function(message) {
logAtLevel(info_, message);
};
Modified: shindig/trunk/features/src/main/javascript/features/core.prefs/prefs.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.prefs/prefs.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/core.prefs/prefs.js (original)
+++ shindig/trunk/features/src/main/javascript/features/core.prefs/prefs.js Sun Jul 24 07:38:35 2011
@@ -97,8 +97,6 @@
var name = prefs.getString("name");
var lang = prefs.getLang();</pre>
*
- * @description Creates a new Prefs object.
- *
* Note: this is actually a singleton. All prefs are linked. If you're wondering
* why this is a singleton and not just a collection of package functions, the
* simple answer is that it's how the spec is written. The spec is written this
Modified: shindig/trunk/features/src/main/javascript/features/core.util.base/base.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.util.base/base.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/core.util.base/base.js (original)
+++ shindig/trunk/features/src/main/javascript/features/core.util.base/base.js Sun Jul 24 07:38:35 2011
@@ -21,13 +21,13 @@
* @fileoverview General purpose utilities that gadgets can use.
*/
+
/**
- * @static
* @class Provides general-purpose utility functions.
- * @name gadgets.util
*/
gadgets.util = gadgets.util || {};
+
/**
* Creates a closure that is suitable for passing as a callback.
* Any number of arguments
@@ -37,12 +37,11 @@ gadgets.util = gadgets.util || {};
* @param {Object} scope The execution scope; may be null if there is no
* need to associate a specific instance of an object with this
* callback.
- * @param {function(Object,Object)} callback The callback to invoke when this is run;
- * any arguments passed in will be passed after your initial arguments.
+ * @param {function(Object,Object)} callback The callback to invoke when
+ * this is run; any arguments passed in will be passed after your initial
+ * arguments.
* @param {Object} var_args Initial arguments to be passed to the callback.
- *
- * @member gadgets.util
- * @private Implementation detail.
+ * @return {function()} a callback function.
*/
gadgets.util.makeClosure = function(scope, callback, var_args) {
// arguments isn't a real array, so we copy it into one.
@@ -67,8 +66,6 @@ gadgets.util.makeClosure = function(scop
* @param {Array.<string>} values The values to generate.
* @return {Object.<string,string>} An object with member fields to handle
* the enum.
- *
- * @private Implementation detail.
*/
gadgets.util.makeEnum = function(values) {
var i, v, obj = {};
Modified: shindig/trunk/features/src/main/javascript/features/core.util.dom/dom.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.util.dom/dom.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/core.util.dom/dom.js (original)
+++ shindig/trunk/features/src/main/javascript/features/core.util.dom/dom.js Sun Jul 24 07:38:35 2011
@@ -21,14 +21,13 @@
* @fileoverview General purpose utilities that gadgets can use.
*/
+
/**
- * @static
* @class Provides general-purpose utility functions.
- * @name gadgets.util
*/
gadgets.util = gadgets.util || {};
-(function() {
+(function() {
var XHTML_SPEC = 'http://www.w3.org/1999/xhtml';
@@ -103,7 +102,7 @@ gadgets.util = gadgets.util || {};
}
attachAttributes(frame, opt_attribs);
return frame;
- };
+ };
/**
* Gets the HTML or XHTML body element.
Modified: shindig/trunk/features/src/main/javascript/features/core.util.onload/onload.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.util.onload/onload.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/core.util.onload/onload.js (original)
+++ shindig/trunk/features/src/main/javascript/features/core.util.onload/onload.js Sun Jul 24 07:38:35 2011
@@ -21,10 +21,9 @@
* @fileoverview General purpose utilities that gadgets can use.
*/
+
/**
- * @static
* @class Provides general-purpose utility functions for onload.
- * @name gadgets.util
*/
gadgets.util = gadgets.util || {};
@@ -35,8 +34,6 @@ gadgets.util = gadgets.util || {};
/**
* Registers an onload handler.
* @param {function()} callback The handler to run.
- *
- * @member gadgets.util
*/
gadgets.util.registerOnLoadHandler = function(callback) {
onLoadHandlers.push(callback);
Modified: shindig/trunk/features/src/main/javascript/features/core.util.string/string.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.util.string/string.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/core.util.string/string.js (original)
+++ shindig/trunk/features/src/main/javascript/features/core.util.string/string.js Sun Jul 24 07:38:35 2011
@@ -21,10 +21,9 @@
* @fileoverview General purpose utilities that gadgets can use.
*/
+
/**
- * @static
* @class Provides a thin method for parsing url parameters.
- * @name gadgets.util
*/
gadgets.util = gadgets.util || {};
Modified: shindig/trunk/features/src/main/javascript/features/core.util.urlparams/urlparams.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.util.urlparams/urlparams.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/core.util.urlparams/urlparams.js (original)
+++ shindig/trunk/features/src/main/javascript/features/core.util.urlparams/urlparams.js Sun Jul 24 07:38:35 2011
@@ -21,14 +21,13 @@
* @fileoverview General purpose utilities that gadgets can use.
*/
+
/**
- * @static
* @class Provides a thin method for parsing url parameters.
- * @name gadgets.util
*/
gadgets.util = gadgets.util || {};
-(function() {
+(function() {
var parameters = null;
/**
@@ -58,7 +57,6 @@ gadgets.util = gadgets.util || {};
* @param {string=} opt_url Optional URL whose parameters to parse.
* Defaults to window's current URL.
* @return {Object} Parameters passed into the query string.
- * @member gadgets.util
* @private Implementation detail.
*/
gadgets.util.getUrlParameters = function(opt_url) {
Modified: shindig/trunk/features/src/main/javascript/features/core.util/util.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/core.util/util.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/core.util/util.js (original)
+++ shindig/trunk/features/src/main/javascript/features/core.util/util.js Sun Jul 24 07:38:35 2011
@@ -21,10 +21,9 @@
* @fileoverview General purpose utilities that gadgets can use.
*/
+
/**
- * @static
* @class Provides general-purpose utility functions.
- * @name gadgets.util
*/
gadgets.util = gadgets.util || {};
@@ -48,8 +47,6 @@ gadgets.util = gadgets.util || {};
*
* @param {string} feature The feature to get parameters for.
* @return {Object} The parameters for the given feature, or null.
- *
- * @member gadgets.util
*/
gadgets.util.getFeatureParameters = function(feature) {
return typeof features[feature] === 'undefined' ? null : features[feature];
@@ -60,8 +57,6 @@ gadgets.util = gadgets.util || {};
*
* @param {string} feature The feature to test for.
* @return {boolean} True if the feature is supported.
- *
- * @member gadgets.util
*/
gadgets.util.hasFeature = function(feature) {
return typeof features[feature] !== 'undefined';
@@ -72,8 +67,6 @@ gadgets.util = gadgets.util || {};
* serving this gadget.
*
* @return {Object} List of Services that enumerate their methods.
- *
- * @member gadgets.util
*/
gadgets.util.getServices = function() {
return services;
Modified: shindig/trunk/features/src/main/javascript/features/dynamic-height.height/dynamic-height-height.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/dynamic-height.height/dynamic-height-height.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/dynamic-height.height/dynamic-height-height.js (original)
+++ shindig/trunk/features/src/main/javascript/features/dynamic-height.height/dynamic-height-height.js Sun Jul 24 07:38:35 2011
@@ -110,10 +110,10 @@ gadgets.window = gadgets.window || {};
}
// Add border, padding and margin of the containing body.
- return result
- + parseIntFromElemPxAttribute(document.body, 'border-bottom')
- + parseIntFromElemPxAttribute(document.body, 'margin-bottom')
- + parseIntFromElemPxAttribute(document.body, 'padding-bottom');
+ return result +
+ parseIntFromElemPxAttribute(document.body, 'border-bottom') +
+ parseIntFromElemPxAttribute(document.body, 'margin-bottom') +
+ parseIntFromElemPxAttribute(document.body, 'padding-bottom');
}
/**
@@ -122,7 +122,7 @@ gadgets.window = gadgets.window || {};
* specified, will attempt to fit the gadget to its content.
* @member gadgets.window
*/
-
+
/**
* Calculate inner content height is hard and different between
* browsers rendering in Strict vs. Quirks mode. We use a combination of
@@ -182,7 +182,7 @@ gadgets.window = gadgets.window || {};
}
}
};
-
+
/**
* Parse out the value (specified in px) for a CSS attribute of an element.
*
@@ -262,10 +262,9 @@ gadgets.window = gadgets.window || {};
}
// Add border, padding and margin of the containing body.
- return result
- + parseIntFromElemPxAttribute(document.body, 'border-bottom')
- + parseIntFromElemPxAttribute(document.body, 'margin-bottom')
- + parseIntFromElemPxAttribute(document.body, 'padding-bottom');
- }
-
+ return result +
+ parseIntFromElemPxAttribute(document.body, 'border-bottom') +
+ parseIntFromElemPxAttribute(document.body, 'margin-bottom') +
+ parseIntFromElemPxAttribute(document.body, 'padding-bottom');
+ }
}());
Modified: shindig/trunk/features/src/main/javascript/features/dynamic-height.util/dynamic-height-util.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/dynamic-height.util/dynamic-height-util.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/dynamic-height.util/dynamic-height-util.js (original)
+++ shindig/trunk/features/src/main/javascript/features/dynamic-height.util/dynamic-height-util.js Sun Jul 24 07:38:35 2011
@@ -31,7 +31,6 @@ gadgets.window = gadgets.window || {};
* See: http://www.quirksmode.org/viewport/compatibility.html for more
* information.
* @return {Object} An object with width and height properties.
- * @member gadgets.window
*/
gadgets.window.getViewportDimensions = function() {
var x = 0;
Modified: shindig/trunk/features/src/main/javascript/features/embeddedexperiences/constant.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/embeddedexperiences/constant.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/embeddedexperiences/constant.js (original)
+++ shindig/trunk/features/src/main/javascript/features/embeddedexperiences/constant.js Sun Jul 24 07:38:35 2011
@@ -31,9 +31,10 @@ osapi.container.ee = {};
* Rendering params for an embedded experience
* @enum {string}
*/
-osapi.container.ee.RenderParams = {};
-osapi.container.ee.RenderParams.GADGET_RENDER_PARAMS = 'gadgetRenderParams';
-osapi.container.ee.RenderParams.GADGET_VIEW_PARAMS = 'gadgetViewParams';
-osapi.container.ee.RenderParams.URL_RENDER_PARAMS = 'urlRenderParams';
-osapi.container.ee.RenderParams.DATA_MODEL = 'eeDataModel';
-osapi.container.ee.RenderParams.EMBEDDED = 'embedded';
+osapi.container.ee.RenderParams = {
+ GADGET_RENDER_PARAMS: 'gadgetRenderParams',
+ GADGET_VIEW_PARAMS: 'gadgetViewParams',
+ URL_RENDER_PARAMS: 'urlRenderParams',
+ DATA_MODEL: 'eeDataModel',
+ EMBEDDED: 'embedded'
+};
Modified: shindig/trunk/features/src/main/javascript/features/exportjs/exportjs.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/exportjs/exportjs.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/exportjs/exportjs.js (original)
+++ shindig/trunk/features/src/main/javascript/features/exportjs/exportjs.js Sun Jul 24 07:38:35 2011
@@ -78,7 +78,7 @@ function exportJs(namespace, components,
* The stub enqueues requests that are executed by the real method
* when it is loaded and exported.
*
- * @param root {Object} Base object to which to attach properties.
+ * @param {Object} root Base object to which to attach properties.
*/
function exportProps(root) {
var props = opt_props || {};
Modified: shindig/trunk/features/src/main/javascript/features/flash/flash.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/flash/flash.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/flash/flash.js (original)
+++ shindig/trunk/features/src/main/javascript/features/flash/flash.js Sun Jul 24 07:38:35 2011
@@ -24,9 +24,7 @@
*/
/**
- * @static
* @class Embeds Flash content in gadgets.
- * @name gadgets.flash
*/
gadgets.flash = gadgets.flash || {};
@@ -34,8 +32,6 @@ gadgets.flash = gadgets.flash || {};
* Detects Flash Player and its major version.
* @return {number} The major version of Flash Player
* or 0 if Flash is not supported.
- *
- * @member gadgets.flash
*/
gadgets.flash.getMajorVersion = function() {
var flashMajorVersion = 0;
@@ -60,6 +56,11 @@ gadgets.flash.getMajorVersion = function
return flashMajorVersion;
};
+/**
+ * Used for unique IDs.
+ * @type {number}
+ * @private
+ */
gadgets.flash.swfContainerId_ = 0;
/**
@@ -72,8 +73,6 @@ gadgets.flash.swfContainerId_ = 0;
* parameter. All attributes will be passed through to the flash movie on
* creation.
* @return {boolean} Whether the function call completes successfully.
- *
- * @member gadgets.flash
*/
gadgets.flash.embedFlash = function(swfUrl, swfContainer, swfVersion, opt_params) {
switch (typeof swfContainer) {
Modified: shindig/trunk/features/src/main/javascript/features/gadgets.json.ext/json-xmltojson.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/gadgets.json.ext/json-xmltojson.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/gadgets.json.ext/json-xmltojson.js (original)
+++ shindig/trunk/features/src/main/javascript/features/gadgets.json.ext/json-xmltojson.js Sun Jul 24 07:38:35 2011
@@ -29,109 +29,109 @@
*/
gadgets.json.xml = (function() {
- //Integer which represents a text node
- var TEXT_NODE = 3;
+ //Integer which represents a text node
+ var TEXT_NODE = 3;
/**
* Parses all the child nodes of a specific DOM element and adds them to the JSON object
* passed in.
*
- * @param childNodes an array of DOM nodes.
- * @param json The JSON object to use for the conversion. The DOM nodes will be added to
+ * @param {Array} childNodes an array of DOM nodes.
+ * @param {Object} json The JSON object to use for the conversion. The DOM nodes will be added to
* this JSON object.
*/
- function parseChildNodes(childNodes, json) {
- for (var index = 0; index < childNodes.length; index++) {
- var node = childNodes[index];
- if (node.nodeType == TEXT_NODE) {
- setTextNodeValue(json, node.nodeName, node);
- }
- else {
-
- if (node.childNodes.length == 0) {
- if (node.attributes != null && node.attributes.length != 0) {
- /*
- * If there are no children but there are attributes set the value for
- * this node in the JSON object to the JSON for the attributes. There is nothing
- * left to do since there are no children.
- */
- setAttributes(node, json);
- }
- else {
- /*
- * If there are no children and no attributes set the value to null.
- */
- json[node.nodeName] = null;
- }
- }
- else {
- if (node.childNodes.length == 1 && node.firstChild.nodeType == TEXT_NODE && (node.attributes == null || node.attributes.length == 0)) {
- /*
- * There is only one child node and it is a text node AND we have no attributes so
- * just extract the text value from the text node and set it in the JSON object.
- */
- setTextNodeValue(json, node.nodeName, node.firstChild);
- }
- else {
- /*
- * There are both children and attributes, so recursively call this method until we have
- * reached the end.
- */
- setChildrenValues(json, node);
- }
- }
- }
- }
+ function parseChildNodes(childNodes, json) {
+ for (var index = 0; index < childNodes.length; index++) {
+ var node = childNodes[index];
+ if (node.nodeType == TEXT_NODE) {
+ setTextNodeValue(json, node.nodeName, node);
+ }
+ else {
+
+ if (node.childNodes.length == 0) {
+ if (node.attributes != null && node.attributes.length != 0) {
+ /*
+ * If there are no children but there are attributes set the value for
+ * this node in the JSON object to the JSON for the attributes. There is nothing
+ * left to do since there are no children.
+ */
+ setAttributes(node, json);
+ }
+ else {
+ /*
+ * If there are no children and no attributes set the value to null.
+ */
+ json[node.nodeName] = null;
+ }
+ }
+ else {
+ if (node.childNodes.length == 1 && node.firstChild.nodeType == TEXT_NODE && (node.attributes == null || node.attributes.length == 0)) {
+ /*
+ * There is only one child node and it is a text node AND we have no attributes so
+ * just extract the text value from the text node and set it in the JSON object.
+ */
+ setTextNodeValue(json, node.nodeName, node.firstChild);
+ }
+ else {
+ /*
+ * There are both children and attributes, so recursively call this method until we have
+ * reached the end.
+ */
+ setChildrenValues(json, node);
+ }
+ }
+ }
+ }
};
/**
* Sets the JSON values for the children of a specified DOM element.
- * @param json the JSON object to set the values in.
+ * @param {Object} json the JSON object to set the values in.
* @param node the DOM node containing children.
*/
function setChildrenValues(json, node) {
- var currentValue = json[node.nodeName];
- if (currentValue == null) {
- /*
- * If there is no value for this property (node name) than
- * add the attributes and parse the children.
- */
- json[node.nodeName] = {};
- if (node.attributes != null && node.attributes.length != 0) {
- setAttributesValues(node.attributes, json[node.nodeName]);
- }
- parseChildNodes(node.childNodes, json[node.nodeName]);
- }
- else {
- /*
- * There is a value already for this property (node name) so
- * we need to create an array for the values of this property.
- * First add all the attributes then parse the children and create
- * an array from the result.
- */
- var temp = {};
- if (node.attributes != null && node.attributes.length != 0) {
- setAttributesValues(node.attributes, temp);
- }
- parseChildNodes(node.childNodes, temp);
- json[node.nodeName] = createValue(currentValue, temp);
- }
+ var currentValue = json[node.nodeName];
+ if (currentValue == null) {
+ /*
+ * If there is no value for this property (node name) than
+ * add the attributes and parse the children.
+ */
+ json[node.nodeName] = {};
+ if (node.attributes != null && node.attributes.length != 0) {
+ setAttributesValues(node.attributes, json[node.nodeName]);
+ }
+ parseChildNodes(node.childNodes, json[node.nodeName]);
+ }
+ else {
+ /*
+ * There is a value already for this property (node name) so
+ * we need to create an array for the values of this property.
+ * First add all the attributes then parse the children and create
+ * an array from the result.
+ */
+ var temp = {};
+ if (node.attributes != null && node.attributes.length != 0) {
+ setAttributesValues(node.attributes, temp);
+ }
+ parseChildNodes(node.childNodes, temp);
+ json[node.nodeName] = createValue(currentValue, temp);
+ }
};
/**
* Sets the JSON value for a text node.
- * @param json the JSON object to set the values in.
- * @param nodeName the node name to set the value to.
+ * @param {Object} json the JSON object to set the values in.
+ * @param {string} nodeName the node name to set the value to.
* @param textNode the text node containing the value to set.
*/
function setTextNodeValue(json, nodeName, textNode) {
- var currentValue = json[nodeName];
- if (currentValue != null) {
- json[nodeName] = createValue(currentValue, textNode.nodeValue);
- }
- else {
- json[nodeName] = textNode.nodeValue;
- }
+ var currentValue = json[nodeName];
+ if (currentValue != null) {
+ json[nodeName] = createValue(currentValue, textNode.nodeValue);
+ }
+ else {
+ json[nodeName] = textNode.nodeValue;
+ }
};
/**
@@ -142,13 +142,13 @@ gadgets.json.xml = (function() {
* @param node the text node containing the value.
*/
function createValue(currentValue, value) {
- if (currentValue instanceof Array) {
- currentValue[currentValue.length] = value;
- return currentValue;
- }
- else {
- return new Array(currentValue, value);
- }
+ if (currentValue instanceof Array) {
+ currentValue[currentValue.length] = value;
+ return currentValue;
+ }
+ else {
+ return new Array(currentValue, value);
+ }
};
@@ -173,23 +173,23 @@ gadgets.json.xml = (function() {
/**
* Sets the values from attributes from a DOM node in a JSON object.
* @param attributes the DOM node's attributes.
- * @param json the JSON object to set the values in.
+ * @param {Object} json the JSON object to set the values in.
*/
function setAttributesValues(attributes, json) {
- var attribute = null;
- for (var attrIndex = 0; attrIndex < attributes.length; attrIndex++) {
- attribute = attributes[attrIndex];
- json['@' + attribute.nodeName] = attribute.nodeValue;
- }
+ var attribute = null;
+ for (var attrIndex = 0; attrIndex < attributes.length; attrIndex++) {
+ attribute = attributes[attrIndex];
+ json['@' + attribute.nodeName] = attribute.nodeValue;
+ }
};
return {
- convertXmlToJson: function(xmlDoc) {
- var childNodes = xmlDoc.childNodes;
- var result = {};
- parseChildNodes(childNodes, result);
- return result;
- }
+ convertXmlToJson: function(xmlDoc) {
+ var childNodes = xmlDoc.childNodes;
+ var result = {};
+ parseChildNodes(childNodes, result);
+ return result;
+ }
};
})();
Modified: shindig/trunk/features/src/main/javascript/features/minimessage/minimessage.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/minimessage/minimessage.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/minimessage/minimessage.js (original)
+++ shindig/trunk/features/src/main/javascript/features/minimessage/minimessage.js Sun Jul 24 07:38:35 2011
@@ -31,6 +31,7 @@
*
* @description Used to create messages that will appear to the user within the
* gadget.
+ * @constructor
* @param {string=} opt_moduleId Optional module Id.
* @param {Element=} opt_container Optional HTML container element where
* mini-messages will appear.
Modified: shindig/trunk/features/src/main/javascript/features/opensearch/opensearch.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/opensearch/opensearch.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/opensearch/opensearch.js (original)
+++ shindig/trunk/features/src/main/javascript/features/opensearch/opensearch.js Sun Jul 24 07:38:35 2011
@@ -20,7 +20,7 @@
* @fileoverview This library adds open search support to the container.
*/
-(function(){
+(function() {
// array of opensearch descriptors.
var descriptions = {};
var ids = {};
@@ -29,34 +29,32 @@
/**
* Converts an XML string into a DOM object
- *
- * @param {xmlString}
- * string representation of a valid XML object
+ *
+ * @param {string} xmlString representation of a valid XML object.
* @return DOM Object
*/
- function createDom(xmlString){
+ function createDom(xmlString) {
var xmlDoc;
- if (window.DOMParser){
+ if (window.DOMParser) {
var parser = new DOMParser();
- xmlDoc = parser.parseFromString(xmlString,"text/xml");
- }
- else{
- xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
- xmlDoc.async = "false";
- xmlDoc.loadXML(xmlString);
+ xmlDoc = parser.parseFromString(xmlString, 'text/xml');
+ } else {
+ xmlDoc = new ActiveXObject('Microsoft.XMLDOM');
+ xmlDoc.async = 'false';
+ xmlDoc.loadXML(xmlString);
}
return xmlDoc;
}
/**
- * Extracts OpenSearch descriptions from XML string containing the
- * description and stores them in the internal map If valid
+ * Extracts OpenSearch descriptions from XML string containing the
+ * description and stores them in the internal map If valid
* descriptions are found, notifies all callbacks about changes.
- *
- * @param {domDesc}
- * stringified XML OpenSearch description
- * @param {title}
- * the title of the gadget that the description belongs to
+ *
+ * @param {string} domDesc
+ * stringified XML OpenSearch description.
+ * @param {string} title
+ * the title of the gadget that the description belongs to.
*/
function extractDescriptions(domDesc, url) {
var jsonDesc = gadgets.json.xml.convertXmlToJson(domDesc);
@@ -72,12 +70,10 @@
/**
* Notifies the registered callbacks of changes in the OpenSearch registry.
- *
- * @param added
+ *
+ * @param {boolean} added
* true if added, false if removed.
- * @param description
- * opensearch description
- * @return
+ * @param {string} description opensearch description.
*/
function applyCallbacks(added, description) {
for (var i in callbacks) {
@@ -88,28 +84,27 @@
/**
* Removes an opensearch description from the registry after the containing
* gadget is unloaded or closed.
- *
- * @param url
- * url of the gadget to be removed.
+ *
+ * @param {string} url Url of the gadget to be removed.
*/
function removeDescription(url) {
if (descriptions[url] != null) {
applyCallbacks(false, descriptions[url]);
- delete descriptions[url];
+ delete descriptions[url];
}
}
-
+
/**
* Processes a new gadget definition and checks if it has an opensearch
* feature
- *
- * @param {response}
+ *
+ * @param {Array} response
* Metadata response containing the json representation of the
- * gadget module
+ * gadget module.
*/
function preloaded(response) {
for (item in response) {
- if (!response[item].error) {
+ if (!response[item].error) {
// check for os feature
var feature = response[item].modulePrefs.features['opensearch'];
var title = response[item].modulePrefs.title;
@@ -117,7 +112,7 @@
var params = feature.params;
if (params != null) {
// retrieve the description
- var desc = params["opensearch-description"];
+ var desc = params['opensearch-description'];
// The full description is in the gadget
if (desc != null) {
// convert string to dom object
@@ -126,9 +121,9 @@
extractDescriptions(domDesc, item);
// only the url to the full description is provided.
} else {
- var openSearchUrl = params["opensearch-url"];
+ var openSearchUrl = params['opensearch-url'];
if (openSearchUrl != null) {
- function urlCallback(response){
+ function urlCallback(response) {
if (response.errors.length == 0) {
var domData = response.data;
if (domData != null) {
@@ -137,13 +132,13 @@
}
}
var params = {};
- params[gadgets.io.RequestParameters.CONTENT_TYPE]
- = gadgets.io.ContentType.DOM;
+ params[gadgets.io.RequestParameters.CONTENT_TYPE] =
+ gadgets.io.ContentType.DOM;
gadgets.io.makeRequest(openSearchUrl, urlCallback, params);
}
}
}
- }
+ }
}
}
}
@@ -152,20 +147,20 @@
* When a gadget is closed, checks if it has a corresponding OpenSearch
* definition that needs to be removed, and notifies the appropriate
* callbacks.
- *
+ *
* @param {gadgetSite}
- * site of the gadget being closed
+ * site of the gadget being closed.
*/
function closed(gadgetSite) {
if (gadgetSite != null) {
- url=ids[gadgetSite.getId()];
+ url = ids[gadgetSite.getId()];
removeDescription(url);
}
}
/**
* called when a gadget is navigated to.
- *
+ *
* @param {gadgetInfo}
* json object representing the gadget module.
*/
@@ -173,33 +168,33 @@
if (gadgetSite != null) {
if (gadgetSite.getActiveGadgetHolder() != null) {
url = gadgetSite.getActiveGadgetHolder().getUrl();
- if (descriptions[url]==null) {
+ if (descriptions[url] == null) {
preloaded([gadgetSite.getActiveGadgetHolder().getGadgetInfo()]);
- }
- ids[gadgetSite.getId()]=url;
+ }
+ ids[gadgetSite.getId()] = url;
}
}
}
/**
* called when a gadget is unloaded
- *
+ *
* @param {gadgetURL}
* the gadget url of the unloaded gadget.
*/
function unloaded(gadgetURL) {
// do nothing--this doesn't guarantee the gadget is actually removed.
}
-
+
/**
* finds opensearch descriptions/urls based on the mimetype of the search
* results
- *
+ *
* @param {type}
- * mimeType of the search results
+ * mimeType of the search results.
* @param {isUrl}
* true if looking for template urls, false if looking for full
- * OpenSearch descriptions
+ * OpenSearch descriptions.
*/
var findByType = function(type, isUrl) {
var typedDescriptions = [];
@@ -216,9 +211,9 @@
// entire description is returned. For URLs, only the matching
// template url is returned.
for (var i in searchUrls) {
- var template = searchUrls[i]["@template"];
+ var template = searchUrls[i]['@template'];
if (template != null) {
- var descType = searchUrls[i]["@type"];
+ var descType = searchUrls[i]['@type'];
if (descType == type || type == null) {
if (isUrl) {
typedDescriptions.push(template);
@@ -226,7 +221,7 @@
typedDescriptions.push(descriptions[url]);
break;
}
- }
+ }
}
}
}
@@ -234,66 +229,63 @@
}
var containerCallback = new Object();
- containerCallback[osapi.container.CallbackType.ON_PRELOADED]
- = preloaded;
- containerCallback[osapi.container.CallbackType.ON_CLOSED]
- = closed;
- containerCallback[osapi.container.CallbackType.ON_NAVIGATED]
- = navigated;
-
- osapi.container.Container.addMixin('opensearch',function(context){
+ containerCallback[osapi.container.CallbackType.ON_PRELOADED] =
+ preloaded;
+ containerCallback[osapi.container.CallbackType.ON_CLOSED] =
+ closed;
+ containerCallback[osapi.container.CallbackType.ON_NAVIGATED] =
+ navigated;
+ osapi.container.Container.addMixin('opensearch', function(context) {
context.addGadgetLifecycleCallback('opensearch', containerCallback);
return /** @scope container.opensearch */ {
/**
- * @param {type}
- * type type name, eg search-xml, search-atom, search-hmtl
+ * @param {type} type type name, eg search-xml, search-atom, search-hmtl.
* @return opensearch template URLs of a given type, or all URLs if type
- * was null
+ * was null.
*/
getOpenSearchURLs: function(type) {
return findByType(type, true);
},
-
+
/**
- *
* @param {type}
- * type type name, eg search-xml, search-atom, search-hmtl
+ * type type name, eg search-xml, search-atom, search-html.
* @return Returns OpenSearch descriptions of a given type, or all
- * descriptions if type was null
+ * descriptions if type was null.
*/
getOpenSearchDescriptions: function(type) {
return findByType(type, false);
},
/**
- * Allows other functions to subscribe to changes in the OpenSearch
- * registry
- *
+ * Allows other functions to subscribe to changes in the OpenSearch
+ * registry.
+ *
* @param {callback}
* function(description, boolean added), where description is the
* opensearch description being updated and where added is true
* if the gadget is new, and false if it has been
* closed/unloaded.
- *
+ *
*/
addOpenSearchCallback: function(callback) {
callbacks.push(callback);
},
-
+
/**
* Removes a previously registered callback
- *
+ *
* @param {callback}
- * previously registered callback function
- * @return true if function was present, false otherwise.
- *
+ * previously registered callback function.
+ * @return {boolean} true if function was present, false otherwise.
+ *
*/
removeOpenSearchCallback: function(callback) {
- for (index in callbacks) {
- if(callbacks[index]==callback) {
- callbacks.splice(index,1);
+ for (index in callbacks) {
+ if (callbacks[index] == callback) {
+ callbacks.splice(index, 1);
return true;
}
}
@@ -303,11 +295,12 @@
/*
* Convenience method for unit testing, allowing the test script to set
* internal descriptions. Uncomment for unit testing.
- *
+ *
*/
//setDescriptions_: function(testDescriptions) {
// descriptions=testDescriptions;
//}
- }
+ };
});
-})();
\ No newline at end of file
+})();
+
Modified: shindig/trunk/features/src/main/javascript/features/opensocial-jsonrpc/jsonrpccontainer.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/opensocial-jsonrpc/jsonrpccontainer.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/opensocial-jsonrpc/jsonrpccontainer.js (original)
+++ shindig/trunk/features/src/main/javascript/features/opensocial-jsonrpc/jsonrpccontainer.js Sun Jul 24 07:38:35 2011
@@ -431,7 +431,7 @@ var JsonRpcRequestItem = function(rpc, o
};
JsonRpcContainer.prototype.newAlbum = function(opt_params) {
- return new JsonAlbum(opt_params);
+ return new JsonAlbum(opt_params);
};
JsonRpcContainer.prototype.newMediaItem = function(mimeType, url, opt_params) {
Modified: shindig/trunk/features/src/main/javascript/features/rpc/wpm.transport.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/rpc/wpm.transport.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/rpc/wpm.transport.js (original)
+++ shindig/trunk/features/src/main/javascript/features/rpc/wpm.transport.js Sun Jul 24 07:38:35 2011
@@ -77,7 +77,7 @@ if (!gadgets.rpctx.wpm) { // make lib r
// event.origin does not exist, use event.domain. The other difference is that
// while event.origin looks like <scheme>://<hostname>:<port>, event.domain
// consists only of <hostname>.
- if (forceSecure && (typeof packet.origin !== "undefined"
+ if (forceSecure && (typeof packet.origin !== 'undefined'
? packet.origin !== origin
: packet.domain !== /^.+:\/\/([^:]+).*/.exec(origin)[1])) {
return;
Modified: shindig/trunk/features/src/main/javascript/features/shindig.container/shindig-container.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/shindig.container/shindig-container.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/shindig.container/shindig-container.js (original)
+++ shindig/trunk/features/src/main/javascript/features/shindig.container/shindig-container.js Sun Jul 24 07:38:35 2011
@@ -489,10 +489,10 @@ shindig.Gadget.prototype.getAdditionalPa
shindig.BaseIfrGadget = function(opt_params) {
shindig.Gadget.call(this, opt_params);
- if(!this.serverBase_){
- this.serverBase_ = '/gadgets/'; // default gadget server
- } else if(this.serverBase_.indexOf('/gadgets')<0) {
- this.serverBase_ += '/gadgets/';
+ if (!this.serverBase_){
+ this.serverBase_ = '/gadgets/'; // default gadget server
+ } else if (this.serverBase_.indexOf('/gadgets')<0) {
+ this.serverBase_ += '/gadgets/';
}
this.queryIfrGadgetType_();
};
@@ -971,14 +971,13 @@ shindig.IfrContainer.prototype.renderGad
};
function init(config) {
- var sbase = config["shindig-container"];
+ var sbase = config['shindig-container'];
shindig.Gadget.prototype.setServerBase(sbase.serverBase);
-
-};
+}
// We do run this in the container mode in the new common container
if (gadgets.config) {
- gadgets.config.register("shindig-container", null, init);
+ gadgets.config.register('shindig-container', null, init);
};
/**
Modified: shindig/trunk/features/src/main/javascript/features/tabs/tabs.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/tabs/tabs.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/tabs/tabs.js (original)
+++ shindig/trunk/features/src/main/javascript/features/tabs/tabs.js Sun Jul 24 07:38:35 2011
@@ -97,6 +97,7 @@ gadgets.Tab.prototype.getIndex = functio
* @class A class gadgets can use to make tabs.
* @description Creates a new TabSet object
*
+ * @constructor
* @param {string=} opt_moduleId Optional suffix for the ID of tab container.
* @param {string=} opt_defaultTab Optional tab name that specifies the name of
* of the tab that is selected after initialization.
Modified: shindig/trunk/features/src/main/javascript/features/xmlutil/xmlutil.js
URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/xmlutil/xmlutil.js?rev=1150288&r1=1150287&r2=1150288&view=diff
==============================================================================
--- shindig/trunk/features/src/main/javascript/features/xmlutil/xmlutil.js (original)
+++ shindig/trunk/features/src/main/javascript/features/xmlutil/xmlutil.js Sun Jul 24 07:38:35 2011
@@ -78,10 +78,10 @@ opensocial.xmlutil.getRequiredNamespaces
var namespaces = opt_container ?
opensocial.xmlutil.getNamespaceDeclarations_(opt_container) : {};
for (var prefix in opensocial.xmlutil.NSMAP) {
- if (opensocial.xmlutil.NSMAP.hasOwnProperty(prefix)
- && !namespaces.hasOwnProperty(prefix)
- && xml.indexOf('<' + prefix + ':') >= 0
- && xml.indexOf('xmlns:' + prefix + ':') < 0) {
+ if (opensocial.xmlutil.NSMAP.hasOwnProperty(prefix) &&
+ !namespaces.hasOwnProperty(prefix) &&
+ xml.indexOf('<' + prefix + ':') >= 0 &&
+ xml.indexOf('xmlns:' + prefix + ':') < 0) {
namespaces[prefix] = opensocial.xmlutil.NSMAP[prefix];
}
}
@@ -90,6 +90,7 @@ opensocial.xmlutil.getRequiredNamespaces
/**
* @private
+ * @return {string}
*/
opensocial.xmlutil.serializeNamespaces_ = function(namespaces) {
var buffer = [];