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=997163&r1=997162&r2=997163&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 Wed Sep 15 01:39:49 2010 @@ -17,7 +17,7 @@ */ /** - * @fileoverview Open Gadget Container + * @fileoverview Open Gadget Container. */ shindig.errors = {}; @@ -33,11 +33,11 @@ shindig.errors.TO_BE_DONE = 'to be done' * function(continuation) { * // compute result asynchronously * continuation(result); - * } + * }. * @param {Function} continuation Function to call when all results are in. It - * is pass an array of all results of all functions + * is pass an array of all results of all functions. * @param {Object} opt_this Optional object used as "this" when calling each - * function + * function. */ shindig.callAsyncAndJoin = function(functions, continuation, opt_this) { var pending = functions.length; @@ -71,7 +71,7 @@ shindig.Extensible = function() { /** * Sets the dependencies. * @param {Object} dependencies Object whose properties are set on this - * container as dependencies + * container as dependencies. */ shindig.Extensible.prototype.setDependencies = function(dependencies) { for (var p in dependencies) { @@ -81,8 +81,8 @@ shindig.Extensible.prototype.setDependen /** * Returns a dependency given its name. - * @param {String} name Name of dependency - * @return {Object} Dependency with that name or undefined if not found + * @param {String} name Name of dependency. + * @return {Object} Dependency with that name or undefined if not found. */ shindig.Extensible.prototype.getDependencies = function(name) { return this[name]; @@ -102,8 +102,8 @@ shindig.UserPrefStore = function() { /** * Gets all user preferences of a gadget. - * @param {Object} gadget Gadget object - * @return {Object} All user preference of given gadget + * @param {Object} gadget Gadget object. + * @return {Object} All user preference of given gadget. */ shindig.UserPrefStore.prototype.getPrefs = function(gadget) { throw Error(shindig.errors.SUBCLASS_RESPONSIBILITY); @@ -111,8 +111,8 @@ shindig.UserPrefStore.prototype.getPrefs /** * Saves user preferences of a gadget in the store. - * @param {Object} gadget Gadget object - * @param {Object} prefs User preferences + * @param {Object} gadget Gadget object. + * @param {Object} prefs User preferences. */ shindig.UserPrefStore.prototype.savePrefs = function(gadget) { throw Error(shindig.errors.SUBCLASS_RESPONSIBILITY); @@ -200,9 +200,9 @@ shindig.IfrGadgetService.prototype.setTi /** * Sets one or more user preferences * @param {String} editToken - * @param {String} name Name of user preference + * @param {String} name Name of user preference. * @param {String} value Value of user preference - * More names and values may follow + * More names and values may follow. */ shindig.IfrGadgetService.prototype.setUserPref = function(editToken, name, value) { @@ -218,23 +218,23 @@ shindig.IfrGadgetService.prototype.setUs * Requests the container to send a specific message to the specified users. * @param {Array.<String>, String} recipients An ID, array of IDs, or a group reference; * the supported keys are VIEWER, OWNER, VIEWER_FRIENDS, OWNER_FRIENDS, or a - * single ID within one of those groups - * @param {opensocial.Message} message The message to send to the specified users + * single ID within one of those groups. + * @param {opensocial.Message} message The message to send to the specified users. * @param {Function} opt_callback The function to call once the request has been * processed; either this callback will be called or the gadget will be reloaded - * from scratch + * from scratch. * @param {opensocial.NavigationParameters} opt_params The optional parameters * indicating where to send a user when a request is made, or when a request - * is accepted; options are of type NavigationParameters.DestinationType + * is accepted; options are of type NavigationParameters.DestinationType. */ shindig.IfrGadgetService.prototype.requestSendMessage = function(recipients, message, opt_callback, opt_params) { - if (opt_callback) { - window.setTimeout(function() { - opt_callback(new opensocial.ResponseItem( - null, null, opensocial.ResponseItem.Error.NOT_IMPLEMENTED, null)); - }, 0); - } + if (opt_callback) { + window.setTimeout(function() { + opt_callback(new opensocial.ResponseItem( + null, null, opensocial.ResponseItem.Error.NOT_IMPLEMENTED, null)); + }, 0); + } }; /** @@ -263,7 +263,7 @@ shindig.IfrGadgetService.prototype.reque * real containers. * TODO: Find a better default for this function * - * @param view The view name to get the url for + * @param view The view name to get the url for. */ shindig.IfrGadgetService.prototype.getUrlForView = function( view) { @@ -296,8 +296,8 @@ shindig.LayoutManager = function() { /** * Gets the HTML element that is the chrome of a gadget into which the content * of the gadget can be rendered. - * @param {Object} gadget Gadget instance - * @return {Object} HTML element that is the chrome for the given gadget + * @param {Object} gadget Gadget instance. + * @return {Object} HTML element that is the chrome for the given gadget. */ shindig.LayoutManager.prototype.getGadgetChrome = function(gadget) { throw Error(shindig.errors.SUBCLASS_RESPONSIBILITY); @@ -318,7 +318,7 @@ shindig.StaticLayoutManager.inherits(shi /** * Sets chrome ids, whose indexes are gadget instance ids (starting from 0). - * @param {Array} gadgetChromeIds Gadget id to chrome id map + * @param {Array} gadgetChromeIds Gadget id to chrome id map. */ shindig.StaticLayoutManager.prototype.setGadgetChromeIds = function(gadgetChromeIds) { @@ -386,13 +386,13 @@ shindig.FloatLeftLayoutManager.prototype * "height": height of the gadget * "width": width of the gadget * "debug": send debug=1 to the gadget server, gets us uncompressed - * javascript + * javascript. */ shindig.Gadget = function(params) { this.userPrefs = {}; if (params) { - for (var name in params) if (params.hasOwnProperty(name)) { + for (var name in params) if (params.hasOwnProperty(name)) { this[name] = params[name]; } } @@ -429,16 +429,16 @@ shindig.Gadget.prototype.render = functi shindig.Gadget.prototype.getContent = function(continuation) { shindig.callAsyncAndJoin([ - 'getTitleBarContent', 'getUserPrefsDialogContent', - 'getMainContent'], function(results) { - continuation(results.join('')); - }, this); + 'getTitleBarContent', 'getUserPrefsDialogContent', + 'getMainContent'], function(results) { + continuation(results.join('')); + }, this); }; /** * Gets title bar content asynchronously or synchronously. * @param {Function} continuation Function that handles title bar content as - * the one and only argument + * the one and only argument. */ shindig.Gadget.prototype.getTitleBarContent = function(continuation) { throw Error(shindig.errors.SUBCLASS_RESPONSIBILITY); @@ -447,7 +447,7 @@ shindig.Gadget.prototype.getTitleBarCont /** * Gets user preferences dialog content asynchronously or synchronously. * @param {Function} continuation Function that handles user preferences - * content as the one and only argument + * content as the one and only argument. */ shindig.Gadget.prototype.getUserPrefsDialogContent = function(continuation) { throw Error(shindig.errors.SUBCLASS_RESPONSIBILITY); @@ -456,7 +456,7 @@ shindig.Gadget.prototype.getUserPrefsDia /** * Gets gadget content asynchronously or synchronously. * @param {Function} continuation Function that handles gadget content as - * the one and only argument + * the one and only argument. */ shindig.Gadget.prototype.getMainContent = function(continuation) { throw Error(shindig.errors.SUBCLASS_RESPONSIBILITY); @@ -536,7 +536,7 @@ shindig.BaseIfrGadget.prototype.getServe shindig.BaseIfrGadget.prototype.getMainContent = function(continuation) { // proper sub-class has not been mixed-in yet var gadget = this; - window.setTimeout( function() { + window.setTimeout(function() { gadget.getMainContent(continuation); }, 0); }; @@ -551,7 +551,7 @@ shindig.BaseIfrGadget.prototype.getUserP shindig.BaseIfrGadget.prototype.getUserPrefsParams = function() { var params = ''; - for(var name in this.getUserPrefs()) { + for (var name in this.getUserPrefs()) { params += '&up_' + encodeURIComponent(name) + '=' + encodeURIComponent(this.getUserPrefValue(name)); } @@ -569,7 +569,7 @@ shindig.BaseIfrGadget.prototype.handleTo shindig.BaseIfrGadget.prototype.hasViewablePrefs_ = function() { - for(var name in this.getUserPrefs()) { + for (var name in this.getUserPrefs()) { var pref = this.userPrefs[name]; if (pref.type != 'hidden') { return true; @@ -593,7 +593,7 @@ shindig.BaseIfrGadget.prototype.handleOp var script = document.createElement('script'); script.src = 'http://www.gmodules.com/ig/gadgetsettings?mid=' + this.id + - '&output=js' + this.getUserPrefsParams() + '&url=' + this.specUrl; + '&output=js' + this.getUserPrefsParams() + '&url=' + this.specUrl; document.body.appendChild(script); } }; @@ -603,8 +603,8 @@ shindig.BaseIfrGadget.prototype.buildUse userPrefsDialog.innerHTML = content + '<div class="' + this.cssClassGadgetUserPrefsDialogActionBar + '"><input type="button" value="Save" onclick="shindig.container.getGadget(' + - this.id +').handleSaveUserPrefs()"> <input type="button" value="Cancel" onclick="shindig.container.getGadget(' + - this.id +').handleCancelUserPrefs()"></div>'; + this.id + ').handleSaveUserPrefs()"> <input type="button" value="Cancel" onclick="shindig.container.getGadget(' + + this.id + ').handleCancelUserPrefs()"></div>'; userPrefsDialog.childNodes[0].style.display = ''; }; @@ -650,10 +650,10 @@ shindig.BaseIfrGadget.prototype.queryIfr // the iframe. Otherwise, we create the iframe ourselves. var request = { context: { - country: "default", - language: "default", - view: "default", - container: "default" + country: 'default', + language: 'default', + view: 'default', + container: 'default' }, gadgets: [{ url: this.specUrl, @@ -662,25 +662,25 @@ shindig.BaseIfrGadget.prototype.queryIfr }; var makeRequestParams = { - "CONTENT_TYPE" : "JSON", - "METHOD" : "POST", - "POST_DATA" : gadgets.json.stringify(request) + 'CONTENT_TYPE' : 'JSON', + 'METHOD' : 'POST', + 'POST_DATA' : gadgets.json.stringify(request) }; - var url = this.serverBase_+"metadata?st=" + this.secureToken; + var url = this.serverBase_ + 'metadata?st=' + this.secureToken; gadgets.io.makeNonProxiedRequest(url, - handleJSONResponse, - makeRequestParams, - "application/javascript" + handleJSONResponse, + makeRequestParams, + 'application/javascript' ); - + var gadget = this; function handleJSONResponse(obj) { var requiresPubSub2 = false; var arr = obj.data.gadgets[0].features; - for(var i = 0; i < arr.length; i++) { - if (arr[i] === "pubsub-2") { + for (var i = 0; i < arr.length; i++) { + if (arr[i] === 'pubsub-2') { requiresPubSub2 = true; break; } @@ -708,15 +708,15 @@ shindig.IfrGadget = { (this.width ? ' width="' + this.width + '"' : '') + '></iframe></div>'); }, - + finishRender: function(chrome) { window.frames[this.getIframeId()].location = this.getIframeUrl(); }, - + getIframeUrl: function() { return this.serverBase_ + 'ifr?' + 'container=' + this.CONTAINER + - '&mid=' + this.id + + '&mid=' + this.id + '&nocache=' + shindig.container.nocache_ + '&country=' + shindig.container.country_ + '&lang=' + shindig.container.language_ + @@ -730,7 +730,7 @@ shindig.IfrGadget = { '&url=' + encodeURIComponent(this.specUrl) + '#rpctoken=' + this.rpcToken + (this.viewParams ? - '&view-params=' + encodeURIComponent(gadgets.json.stringify(this.viewParams)) : '') + + '&view-params=' + encodeURIComponent(gadgets.json.stringify(this.viewParams)) : '') + (this.hashData ? '&' + this.hashData : ''); } }; @@ -744,12 +744,12 @@ shindig.OAAIfrGadget = { continuation('<div id="' + this.cssClassGadgetContent + '-' + this.id + '" class="' + this.cssClassGadgetContent + '"></div>'); }, - + finishRender: function(chrome) { var iframeAttrs = { className: this.cssClassGadget, - frameborder: "no", - scrolling: "no" + frameborder: 'no', + scrolling: 'no' }; if (this.height) { iframeAttrs.height = this.height; @@ -757,50 +757,50 @@ shindig.OAAIfrGadget = { if (this.width) { iframeAttrs.width = this.width; } - + new OpenAjax.hub.IframeContainer( - gadgets.pubsub2router.hub, - this.getIframeId(), - { - Container: { - onSecurityAlert: function( source, alertType) { - gadgets.error("Security error for container " + source.getClientID() + " : " + alertType); - source.getIframe().src = "about:blank"; -// for debugging - // }, - // onConnect: function( container ) { - // gadgets.log("++ connected: " + container.getClientID()); + gadgets.pubsub2router.hub, + this.getIframeId(), + { + Container: { + onSecurityAlert: function(source, alertType) { + gadgets.error('Security error for container ' + source.getClientID() + ' : ' + alertType); + source.getIframe().src = 'about:blank'; + // for debugging + // }, + // onConnect: function( container ) { + // gadgets.log("++ connected: " + container.getClientID()); } - }, - IframeContainer: { - parent: document.getElementById(this.cssClassGadgetContent + '-' + this.id), - uri: this.getIframeUrl(), - tunnelURI: shindig.uri(this.serverBase_ + this.rpcRelay).resolve(shindig.uri(window.location.href)), - iframeAttrs: iframeAttrs + }, + IframeContainer: { + parent: document.getElementById(this.cssClassGadgetContent + '-' + this.id), + uri: this.getIframeUrl(), + tunnelURI: shindig.uri(this.serverBase_ + this.rpcRelay).resolve(shindig.uri(window.location.href)), + iframeAttrs: iframeAttrs + } } - } ); }, - + getIframeUrl: function() { return this.serverBase_ + 'ifr?' + 'container=' + this.CONTAINER + - '&mid=' + this.id + + '&mid=' + this.id + '&nocache=' + shindig.container.nocache_ + '&country=' + shindig.container.country_ + '&lang=' + shindig.container.language_ + '&view=' + shindig.container.view_ + (this.specVersion ? '&v=' + this.specVersion : '') + - // (shindig.container.parentUrl_ ? '&parent=' + encodeURIComponent(shindig.container.parentUrl_) : '') + + // (shindig.container.parentUrl_ ? '&parent=' + encodeURIComponent(shindig.container.parentUrl_) : '') + (this.debug ? '&debug=1' : '') + this.getAdditionalParams() + this.getUserPrefsParams() + (this.secureToken ? '&st=' + this.secureToken : '') + '&url=' + encodeURIComponent(this.specUrl) + - // '#rpctoken=' + this.rpcToken + + // '#rpctoken=' + this.rpcToken + (this.viewParams ? - '&view-params=' + encodeURIComponent(gadgets.json.stringify(this.viewParams)) : '') + - // (this.hashData ? '&' + this.hashData : ''); + '&view-params=' + encodeURIComponent(gadgets.json.stringify(this.viewParams)) : '') + + // (this.hashData ? '&' + this.hashData : ''); (this.hashData ? '#' + this.hashData : ''); } }; @@ -902,7 +902,7 @@ shindig.Container.prototype.renderGadget /** * Renders a gadget. Gadgets are rendered inside their chrome element. - * @param {Object} gadget Gadget object + * @param {Object} gadget Gadget object. */ shindig.Container.prototype.renderGadget = function(gadget) { throw Error(shindig.errors.SUBCLASS_RESPONSIBILITY); @@ -951,7 +951,7 @@ shindig.IfrContainer.prototype.setParent /** * Renders a gadget using ifr. - * @param {Object} gadget Gadget object + * @param {Object} gadget Gadget object. */ shindig.IfrContainer.prototype.renderGadget = function(gadget) { var chrome = this.layoutManager.getGadgetChrome(gadget);
Modified: shindig/trunk/features/src/main/javascript/features/shindig.container/util.js URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/shindig.container/util.js?rev=997163&r1=997162&r2=997163&view=diff ============================================================================== --- shindig/trunk/features/src/main/javascript/features/shindig.container/util.js (original) +++ shindig/trunk/features/src/main/javascript/features/shindig.container/util.js Wed Sep 15 01:39:49 2010 @@ -17,7 +17,7 @@ */ /** - * @fileoverview Utility functions for the Open Gadget Container + * @fileoverview Utility functions for the Open Gadget Container. */ Function.prototype.inherits = function(parentCtor) { @@ -26,4 +26,4 @@ Function.prototype.inherits = function(p this.superClass_ = parentCtor.prototype; this.prototype = new tempCtor(); this.prototype.constructor = this; -}; \ No newline at end of file +}; Modified: shindig/trunk/features/src/main/javascript/features/shindig.uri.ext/util.js URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/shindig.uri.ext/util.js?rev=997163&r1=997162&r2=997163&view=diff ============================================================================== --- shindig/trunk/features/src/main/javascript/features/shindig.uri.ext/util.js (original) +++ shindig/trunk/features/src/main/javascript/features/shindig.uri.ext/util.js Wed Sep 15 01:39:49 2010 @@ -40,7 +40,7 @@ shindig.uri = (function() { /** * Fully qualifies this Uri if it is relative, using a given base Uri. - * + * * @param {Uri} self The base Uri. * @param {Uri} base The Uri to resolve. */ @@ -53,7 +53,7 @@ shindig.uri = (function() { } var selfPath = self.getPath(); if (selfPath == '' || selfPath.charAt(0) != '/') { - var basePath = base.getPath(); + var basePath = base.getPath(); var lastSlash = basePath.lastIndexOf('/'); if (lastSlash != -1) { basePath = basePath.substring(0, lastSlash + 1); Modified: shindig/trunk/features/src/main/javascript/features/shindig.uri/uri.js URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/shindig.uri/uri.js?rev=997163&r1=997162&r2=997163&view=diff ============================================================================== --- shindig/trunk/features/src/main/javascript/features/shindig.uri/uri.js (original) +++ shindig/trunk/features/src/main/javascript/features/shindig.uri/uri.js Wed Sep 15 01:39:49 2010 @@ -30,7 +30,7 @@ * Further, only set operations are provided for query/fragment params, * in order to keep the API relatively small, yet sufficiently flexible. Values set to * null are equivalent to being removed, for instance. - * + * * Limitations include, but are not limited to: * + Multiple params with the same key not supported via set APIs. * + Full RPC-compliant parsing not supported. A "highly useful" subset is impl'd. @@ -46,15 +46,15 @@ * alert(other); // Emits "http://other.com/bar?hi=bye" */ shindig.uri = (function() { - var PARSE_REGEX = new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?"); + var PARSE_REGEX = new RegExp('^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?'); return function(opt_in) { - var schema_ = ""; - var authority_ = ""; - var path_ = ""; - var query_ = ""; + var schema_ = ''; + var authority_ = ''; + var path_ = ''; + var query_ = ''; var qparms_ = null; - var fragment_ = ""; + var fragment_ = ''; var fparms_ = null; var unesc = window.decodeURIComponent ? decodeURIComponent : unescape; var esc = window.encodeURIComponent ? encodeURIComponent : escape; @@ -62,7 +62,7 @@ shindig.uri = (function() { function parseFrom(url) { if (url.match(PARSE_REGEX) === null) { - throw "Malformed URL: " + url; + throw 'Malformed URL: ' + url; } schema_ = RegExp.$1; authority_ = RegExp.$2; @@ -79,7 +79,7 @@ shindig.uri = (function() { if (val === undefined) { continue; } - str.push(esc(key) + (val !== null ? '=' + esc(val) : "")); + str.push(esc(key) + (val !== null ? '=' + esc(val) : '')); } return str.join('&'); } @@ -119,19 +119,19 @@ shindig.uri = (function() { fparms_ = setParams(fparms_ || parseParams(fragment_), argOne, argTwo); return bundle; } - + function getOrigin() { return [ - schema_, - schema_ !== "" ? ":" : "", - authority_ !== "" ? "//" : "", - authority_ - ].join(""); + schema_, + schema_ !== '' ? ':' : '', + authority_ !== '' ? '//' : '', + authority_ + ].join(''); } /** * Returns a readable representation of the URL. - * + * * @return {string} A readable URL. */ function toString() { @@ -140,24 +140,24 @@ shindig.uri = (function() { return [ getOrigin(), path_, - query !== "" ? "?" : "", + query !== '' ? '?' : '', query, - fragment !== "" ? "#" : "", + fragment !== '' ? '#' : '', fragment - ].join(""); + ].join(''); } function parseParams(str) { var params = []; - var pairs = str.split("&"); + var pairs = str.split('&'); for (var i = 0, j = pairs.length; i < j; ++i) { var kv = pairs[i].split('='); var key = kv.shift(); var value = null; if (kv.length > 0) { - value = kv.join('').replace(/\+/g, " "); + value = kv.join('').replace(/\+/g, ' '); } - params.push([ key, value != null ? unesc(value) : null ]); + params.push([key, value != null ? unesc(value) : null]); } return params; } @@ -190,14 +190,14 @@ shindig.uri = (function() { } } if (!found) { - pset.push([ key, newParams[key] ]); + pset.push([key, newParams[key]]); } } return pset; } function stripPrefix(str, pfx) { - str = str || ""; + str = str || ''; if (str[0] === pfx) { str = str.substr(pfx.length); } @@ -205,8 +205,8 @@ shindig.uri = (function() { } // CONSTRUCTOR - if (typeof opt_in === "object" && - typeof opt_in.toString === "function") { + if (typeof opt_in === 'object' && + typeof opt_in.toString === 'function') { // Assume it's another shindig.uri, or something that can be parsed from one. parseFrom(opt_in.toString()); } else if (opt_in) { @@ -227,7 +227,7 @@ shindig.uri = (function() { // Setters setSchema: function(schema) { schema_ = schema; return bundle; }, setAuthority: function(authority) { authority_ = authority; return bundle; }, - setPath: function(path) { path_ = (path[0] === "/" ? "" : "/") + path; return bundle; }, + setPath: function(path) { path_ = (path[0] === '/' ? '' : '/') + path; return bundle; }, setQuery: function(query) { qparms_ = null; query_ = stripPrefix(query, '?'); return bundle; }, setFragment: function(fragment) { fparms_ = null; fragment_ = stripPrefix(fragment, '#'); return bundle; }, setQP: setQP, Modified: shindig/trunk/features/src/main/javascript/features/shindig.xhrwrapper/xhrwrapper.js URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/shindig.xhrwrapper/xhrwrapper.js?rev=997163&r1=997162&r2=997163&view=diff ============================================================================== --- shindig/trunk/features/src/main/javascript/features/shindig.xhrwrapper/xhrwrapper.js (original) +++ shindig/trunk/features/src/main/javascript/features/shindig.xhrwrapper/xhrwrapper.js Wed Sep 15 01:39:49 2010 @@ -19,7 +19,7 @@ /** * @fileoverview Emulate XMLHttpRequest using gadgets.io.makeRequest. - * + * * This is not a complete implementation of XMLHttpRequest: * - synchronous send() is unsupported; * - the callback function will not get full header information, as makeRequest @@ -28,7 +28,7 @@ shindig.xhrwrapper = shindig.xhrwrapper || {}; -(function () { +(function() { // Save the browser's XMLHttpRequest and ActiveXObject constructors. var RealXMLHttpRequest = window.XMLHttpRequest; @@ -36,11 +36,11 @@ shindig.xhrwrapper = shindig.xhrwrapper /** * Creates a real XMLHttpRequest object. - * + * * This function is to be used by code that needs access to the browser's * XMLHttpRequest functionality, such as the code that implements * gadgets.io.makeRequest itself. - * + * * @return {Object|undefined} A XMLHttpRequest object, if one could * be created. */ @@ -64,7 +64,7 @@ shindig.xhrwrapper = shindig.xhrwrapper /** * @class XhrWrapper class. - * + * * @constructor * @description Implements the XMLHttpRequest interface, using * gadgets.io.makeRequest to make the actual network accesses. @@ -88,7 +88,7 @@ shindig.xhrwrapper = shindig.xhrwrapper /** * Returns all response headers as a string. - * + * * @return {?string} The text of all response headers, or null if no response * has been received. */ @@ -106,7 +106,7 @@ shindig.xhrwrapper = shindig.xhrwrapper /** * Returns the value of a particular response header. - * + * * @param {string} The name of the header to return. * @return {?string} The value of the header, or null if no response has * been received or the header doesn't exist in the response. @@ -122,7 +122,7 @@ shindig.xhrwrapper = shindig.xhrwrapper /** * Initializes a request. - * + * * @param {string} method The HTTP method to use ('POST' or 'GET'). * @param {string} url The URL to which to send the request. * @param {boolean=} opt_async Whether to perform the operation @@ -161,7 +161,7 @@ shindig.xhrwrapper = shindig.xhrwrapper /** * Sends the request. - * + * * @param {string=} opt_data The data used to populate the body of a POST * request. */ @@ -200,7 +200,7 @@ shindig.xhrwrapper = shindig.xhrwrapper /** * Sets the value of an HTTP request header. - * + * * @param {string} header The name of the header to set. * @param {string} value The value for the header. */ @@ -211,7 +211,7 @@ shindig.xhrwrapper = shindig.xhrwrapper /** * Processes the results from makeRequest and calls onreadystatechange. - * + * * @param {Object} response The response from makeRequest. * @private */ @@ -246,14 +246,14 @@ shindig.xhrwrapper = shindig.xhrwrapper /** * Points the request URL to the correct server. - * + * * If the URL is pointing to the gadget server, this function assumes the * gadget's author wanted to point to the gadget contents location and * changes it so that it points to the right place. - * + * * For example, if the gadget is rendered in https://shindig/gadgets/ifr * and the gadget's contents are at http://foo.com/bar/baz.html: - * + * * - foo.xml gets turned into http://foo.com/bar/foo.xml * - /foo/bar.xml gets turned into http://foo.com/foo/bar.xml * - //foo.com/bar.xml gets turned into http://foo.com/bar.xml @@ -277,18 +277,18 @@ shindig.xhrwrapper = shindig.xhrwrapper /** * @class A class for processing URLs. - * + * * @constructor * @description Pries apart the components of a URL, so it can be sliced * and diced and combined with other URLs as needed. */ function Url(url) { - this.schema = ""; - this.authority = ""; - this.path = ""; - this.filename = ""; - this.query = ""; - this.fragment = ""; + this.schema = ''; + this.authority = ''; + this.path = ''; + this.filename = ''; + this.query = ''; + this.fragment = ''; var parse = url; var sharp = parse.indexOf('#'); @@ -337,7 +337,7 @@ shindig.xhrwrapper = shindig.xhrwrapper /** * Fully qualifies this URL if it is relative, using a given base URL. - * + * * @param {Url} base The base URL. */ Url.prototype.fullyQualify = function(base) { @@ -354,11 +354,11 @@ shindig.xhrwrapper = shindig.xhrwrapper /** * Returns a readable representation of the URL. - * + * * @return {string} A readable URL. */ Url.prototype.toString = function() { - var url = ""; + var url = ''; if (this.schema) { url += this.schema; } @@ -407,12 +407,12 @@ shindig.xhrwrapper = shindig.xhrwrapper * * This is bad because when this code tries to call gadgets.io.makeRequest, * it will call the wrong function, or it might even be undefined. - * + * * Therefore, we save the original namespaces before the gadget has a chance * to overwrite them, then switch between them as necessary. - * + * * This works like this: - * + * * switchOriginalNS_(); * try { * functionThatNeedsTheOriginalNamespaces(); @@ -425,11 +425,11 @@ shindig.xhrwrapper = shindig.xhrwrapper */ var originalNS = {}; var gadgetNS = {}; - var namespaces = ['gadgets', 'opensocial', 'shindig']; + var namespaces = ['gadgets', 'opensocial', 'shindig']; /** * Copies the Shindig namespaces between two objects. - * + * * @param {Object} from Object to copy from, or null for the global object. * @param {Object} to Object to copy to, or null for the global object. * @private @@ -465,7 +465,7 @@ shindig.xhrwrapper = shindig.xhrwrapper // Save the original namespaces. copyNS_(null, originalNS); - + // Replace the browser's XMLHttpRequest and ActiveXObject constructors with // xhrwrapper's. if (window.XMLHttpRequest) { Modified: shindig/trunk/features/src/main/javascript/features/skins/skins.js URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/skins/skins.js?rev=997163&r1=997162&r2=997163&view=diff ============================================================================== --- shindig/trunk/features/src/main/javascript/features/skins/skins.js (original) +++ shindig/trunk/features/src/main/javascript/features/skins/skins.js Wed Sep 15 01:39:49 2010 @@ -30,21 +30,21 @@ gadgets.skins = function() { var skinProperties = {}; var requiredConfig = { - "properties": gadgets.config.ExistsValidator + 'properties': gadgets.config.ExistsValidator }; - gadgets.config.register("skins", requiredConfig, function(config) { - skinProperties = config["skins"].properties; - }); + gadgets.config.register('skins', requiredConfig, function(config) { + skinProperties = config['skins'].properties; + }); return { /** * Override the default properties with a new set of properties. * - * @param {Object} properties The mapping of property names to values + * @param {Object} properties The mapping of property names to values. */ - init : function(properties) { + init: function(properties) { skinProperties = properties; }, @@ -53,13 +53,13 @@ gadgets.skins = function() { * * @param {string} propertyKey The key to get data for; * keys are defined in <a href="gadgets.skins.Property.html"><code> - * gadgets.skins.Property</code></a> - * @return {string} The data + * gadgets.skins.Property.</code></a> + * @return {string} The data. * * @member gadgets.skins */ - getProperty : function(propertyKey) { - return skinProperties[propertyKey] || ""; + getProperty: function(propertyKey) { + return skinProperties[propertyKey] || ''; } }; }(); @@ -72,7 +72,7 @@ gadgets.skins = function() { * method. * @name gadgets.skins.Property */ -gadgets.skins.Property = gadgets.util.makeEnum([ +gadgets.skins.Property = gadgets.util.makeEnum([ /** * An image to use in the background of the gadget. * @member gadgets.skins.Property 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=997163&r1=997162&r2=997163&view=diff ============================================================================== --- shindig/trunk/features/src/main/javascript/features/tabs/tabs.js (original) +++ shindig/trunk/features/src/main/javascript/features/tabs/tabs.js Wed Sep 15 01:39:49 2010 @@ -119,18 +119,18 @@ gadgets.TabSet = function(opt_moduleId, this.tabsContainer_ = null; this.rtl_ = document.body.dir === 'rtl'; this.prefs_ = new gadgets.Prefs(); - this.selectedTabIndex_ = this.prefs_.getString("selectedTab"); + this.selectedTabIndex_ = this.prefs_.getString('selectedTab'); this.mainContainer_ = this.createMainContainer_(opt_container); this.tabTable_ = this.createTabTable_(); this.displayTabs(false); // gadgets.TabSet.addCSS_([ ].join('')); }; -gadgets.config.register("tabset", {}, function (configuration) { - // Injects the default stylesheet for tabs - gadgets.TabSet.addCSS_( configuration.tabs.css.join('')); -}); - +gadgets.config.register('tabset', {}, function(configuration) { + // Injects the default stylesheet for tabs + gadgets.TabSet.addCSS_(configuration.tabs.css.join('')); +}); + /** * Adds a new tab based on the name-value pairs specified in opt_params. @@ -151,7 +151,7 @@ gadgets.config.register("tabset", {}, fu gadgets.TabSet.prototype.addTab = function(tabName, opt_params) { if (typeof opt_params === 'string') { opt_params = {contentContainer: document.getElementById(arguments[1]), - callback: arguments[2]}; + callback: arguments[2]}; } var params = opt_params || {}; @@ -161,9 +161,9 @@ gadgets.TabSet.prototype.addTab = functi tabIndex = params.index; } var tab = this.createTab_(tabName, { - contentContainer: params.contentContainer, - callback: params.callback, - tooltip: params.tooltip + contentContainer: params.contentContainer, + callback: params.callback, + tooltip: params.tooltip }); var tr = this.tabTable_.rows[0]; @@ -216,8 +216,8 @@ gadgets.TabSet.prototype.removeTab = fun var maxIndex = this.tabs_.length - 1; if (maxIndex > 0) { this.selectTab_(tabIndex < maxIndex ? - this.tabs_[tabIndex + 1] : - this.tabs_[tabIndex - 1]); + this.tabs_[tabIndex + 1] : + this.tabs_[tabIndex - 1]); } } var tr = this.tabTable_.rows[0]; @@ -338,15 +338,15 @@ gadgets.TabSet.prototype.createMainConta document.body.insertBefore(container, document.body.firstChild); } - container.className = this.cascade_("tablib_main_container") + ' ' + - container.className; + container.className = this.cascade_('tablib_main_container') + ' ' + + container.className; return container; }; /** * Helper method that expands a class name into two class names. - * @param {string} label CSS class + * @param {string} label CSS class. * @return {string} Expanded class names. * @private */ @@ -448,7 +448,7 @@ gadgets.TabSet.prototype.createTabTable_ var adjustNavigationFn = function() { me.adjustNavigation_(); }; - gadgets.util.attachBrowserEvent(window, "resize", adjustNavigationFn, false); + gadgets.util.attachBrowserEvent(window, 'resize', adjustNavigationFn, false); } this.navTable_ = navTable; @@ -467,7 +467,7 @@ gadgets.TabSet.prototype.adjustNavigatio this.leftNavContainer_.style.display = 'none'; this.rightNavContainer_.style.display = 'none'; if (this.tabsContainer_.scrollWidth <= this.tabsContainer_.offsetWidth) { - if(this.tabsContainer_.scrollLeft) { + if (this.tabsContainer_.scrollLeft) { // to avoid JS error in IE this.tabsContainer_.scrollLeft = 0; } @@ -510,7 +510,7 @@ gadgets.TabSet.prototype.smoothScroll_ = /** * Helper function that dynamically inserts CSS rules to the page. - * @param {string} cssText CSS rules to inject + * @param {string} cssText CSS rules to inject. * @private */ gadgets.TabSet.addCSS_ = function(cssText) { @@ -614,7 +614,7 @@ gadgets.TabSet.prototype.saveSelectedTab var currentTabIndex = this.selectedTab_.getIndex(); if (currentTabIndex >= 0) { this.selectedTabIndex_ = currentTabIndex; - this.prefs_.set("selectedTab", currentTabIndex); + this.prefs_.set('selectedTab', currentTabIndex); } } catch (e) { // ignore. setprefs is optional for tablib. Modified: shindig/trunk/features/src/main/javascript/features/tabs/taming.js URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/tabs/taming.js?rev=997163&r1=997162&r2=997163&view=diff ============================================================================== --- shindig/trunk/features/src/main/javascript/features/tabs/taming.js (original) +++ shindig/trunk/features/src/main/javascript/features/tabs/taming.js Wed Sep 15 01:39:49 2010 @@ -30,7 +30,7 @@ tamings___.push(function(imports) { [gadgets.Tab, 'getIndex'], [gadgets.Tab, 'getName'], [gadgets.Tab, 'getNameContainer'], - + [gadgets.TabSet, 'addTab'], [gadgets.TabSet, 'alignTabs'], [gadgets.TabSet, 'displayTabs'], Modified: shindig/trunk/features/src/main/javascript/features/views/taming.js URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/views/taming.js?rev=997163&r1=997162&r2=997163&view=diff ============================================================================== --- shindig/trunk/features/src/main/javascript/features/views/taming.js (original) +++ shindig/trunk/features/src/main/javascript/features/views/taming.js Wed Sep 15 01:39:49 2010 @@ -24,7 +24,7 @@ var tamings___ = tamings___ || []; tamings___.push(function(imports) { caja___.whitelistCtors([ - [gadgets.views, 'View', Object] + [gadgets.views, 'View', Object] ]); caja___.whitelistMeths([ [gadgets.views.View, 'bind'], Modified: shindig/trunk/features/src/main/javascript/features/views/views.js URL: http://svn.apache.org/viewvc/shindig/trunk/features/src/main/javascript/features/views/views.js?rev=997163&r1=997162&r2=997163&view=diff ============================================================================== --- shindig/trunk/features/src/main/javascript/features/views/views.js (original) +++ shindig/trunk/features/src/main/javascript/features/views/views.js Wed Sep 15 01:39:49 2010 @@ -61,10 +61,10 @@ gadgets.views = function() { target = target.parentNode; } - if (target.nodeName.toLowerCase() === "a") { + if (target.nodeName.toLowerCase() === 'a') { // We use getAttribute() instead of .href to avoid automatic relative path resolution. - var href = target.getAttribute("href"); - if (href && href[0] !== "#" && href.indexOf("://") === -1) { + var href = target.getAttribute('href'); + if (href && href[0] !== '#' && href.indexOf('://') === -1) { gadgets.views.requestNavigateTo(currentView, href); if (e.stopPropagation) { e.stopPropagation(); @@ -93,7 +93,7 @@ gadgets.views = function() { for (var s in conf) { if (conf.hasOwnProperty(s)) { // TODO: Fix this by moving view names / config into a sub property. - if (s != "rewriteLinks") { + if (s != 'rewriteLinks') { var obj = conf[s]; if (!obj) { continue; @@ -109,17 +109,17 @@ gadgets.views = function() { var urlParams = gadgets.util.getUrlParameters(); // View parameters are passed as a single parameter. - if (urlParams["view-params"]) { - params = gadgets.json.parse(urlParams["view-params"]) || params; + if (urlParams['view-params']) { + params = gadgets.json.parse(urlParams['view-params']) || params; } - currentView = supportedViews[urlParams.view] || supportedViews["default"]; + currentView = supportedViews[urlParams.view] || supportedViews['default']; if (conf.rewriteLinks) { - gadgets.util.attachBrowserEvent(document, "click", forceNavigate, false); + gadgets.util.attachBrowserEvent(document, 'click', forceNavigate, false); } } - gadgets.config.register("views", null, init); + gadgets.config.register('views', null, init); return { @@ -134,7 +134,7 @@ gadgets.views = function() { * @param {Object.<string, string>} environment A set of named variables. * @return {string} A URL string with substituted variables. */ - bind : function(urlTemplate, environment) { + bind: function(urlTemplate, environment) { if (typeof urlTemplate !== 'string') { throw new Error('Invalid urlTemplate'); } @@ -144,7 +144,7 @@ gadgets.views = function() { } var varRE = /^([a-zA-Z0-9][a-zA-Z0-9_\.\-]*)(=([a-zA-Z0-9\-\._~]|(%[0-9a-fA-F]{2}))*)?$/, - expansionRE = new RegExp('\\{([^}]*)\\}','g'), + expansionRE = new RegExp('\\{([^}]*)\\}', 'g'), opRE = /^-([a-zA-Z]+)\|([^|]*)\|(.+)$/, result = [], textStart = 0, @@ -209,52 +209,52 @@ gadgets.views = function() { vars = match[3]; flag = 0; switch (op) { - case 'neg': - flag = 1; - case 'opt': - if (matchVars(vars, {flag: flag}, function(j, v) { - if (typeof v !== 'undefined' && !objectIsEmpty(v)) { - j.flag = !j.flag; - return 1; - } - return 0; - }).flag) { - result.push(arg); - } - break; - case 'join': - result.push(matchVars(vars, [], function(j, v, k) { - if (typeof v === 'string') { - j.push(k + '=' + v); - } else if (typeof v === 'object') { - for (var i in v) { - if (v.hasOwnProperty(i)) { - j.push(i + '=' + v[i]); + case 'neg': + flag = 1; + case 'opt': + if (matchVars(vars, {flag: flag}, function(j, v) { + if (typeof v !== 'undefined' && !objectIsEmpty(v)) { + j.flag = !j.flag; + return 1; + } + return 0; + }).flag) { + result.push(arg); + } + break; + case 'join': + result.push(matchVars(vars, [], function(j, v, k) { + if (typeof v === 'string') { + j.push(k + '=' + v); + } else if (typeof v === 'object') { + for (var i in v) { + if (v.hasOwnProperty(i)) { + j.push(i + '=' + v[i]); } } + } + }).join(arg)); + break; + case 'list': + matchVar(vars); + var value = getVar(match[1]); + if (typeof value === 'object' && typeof value.join === 'function') { + result.push(value.join(arg)); + } + break; + case 'prefix': + flag = 1; + case 'suffix': + matchVar(vars); + value = getVar(match[1], match[2] && match[2].substr(1)); + if (typeof value === 'string') { + result.push(flag ? arg + value : value + arg); + } else if (typeof value === 'object' && typeof value.join === 'function') { + result.push(flag ? arg + value.join(arg) : value.join(arg) + arg); } - }).join(arg)); - break; - case 'list': - matchVar(vars); - var value = getVar(match[1]); - if (typeof value === 'object' && typeof value.join === 'function') { - result.push(value.join(arg)); - } - break; - case 'prefix': - flag = 1; - case 'suffix': - matchVar(vars); - value = getVar(match[1], match[2] && match[2].substr(1)); - if (typeof value === 'string') { - result.push(flag ? arg + value : value + arg); - } else if (typeof value === 'object' && typeof value.join === 'function') { - result.push(flag ? arg + value.join(arg) : value.join(arg) + arg); - } - break; - default: - throw new Error('Invalid operator : ' + op); + break; + default: + throw new Error('Invalid operator : ' + op); } } else { throw new Error('Invalid syntax : ' + group[0]); @@ -272,28 +272,28 @@ gadgets.views = function() { * supports parameters will pass the optional parameters along to the gadget * in the new view. * - * @param {string | gadgets.views.View} view The view to navigate to + * @param {string | gadgets.views.View} view The view to navigate to. * @param {Object.<string, string>=} opt_params Parameters to pass to the - * gadget after it has been navigated to on the surface + * gadget after it has been navigated to on the surface. * @param {string=} opt_ownerId The ID of the owner of the page to navigate to; * defaults to the current owner. */ - requestNavigateTo : function(view, opt_params, opt_ownerId) { - if (typeof view !== "string") { + requestNavigateTo: function(view, opt_params, opt_ownerId) { + if (typeof view !== 'string') { view = view.getName(); } // TODO If we want to implement a POPUP view we'll have to do it here, // The parent frame's attempts to use window.open will fail since it's not // directly initiated from the onclick handler - gadgets.rpc.call(null, "requestNavigateTo", null, view, opt_params, opt_ownerId); + gadgets.rpc.call(null, 'requestNavigateTo', null, view, opt_params, opt_ownerId); }, /** * Returns the current view. * - * @return {gadgets.views.View} The current view + * @return {gadgets.views.View} The current view. */ - getCurrentView : function() { + getCurrentView: function() { return currentView; }, @@ -304,7 +304,7 @@ gadgets.views = function() { * @return {Object.<gadgets.views.ViewType | string, gadgets.views.View>} * All supported views, keyed by their name attribute. */ - getSupportedViews : function() { + getSupportedViews: function() { return supportedViews; }, @@ -313,9 +313,9 @@ gadgets.views = function() { * include all url parameters, only the ones passed into * gadgets.views.requestNavigateTo * - * @return {Object.<string, string>} The parameter map + * @return {Object.<string, string>} The parameter map. */ - getParams : function() { + getParams: function() { return params; } }; @@ -331,7 +331,7 @@ gadgets.views = function() { /** * View Representation * @constructor - * @param {string} name - the name of the view + * @param {string} name - the name of the view. * @param {boolean=} opt_isOnlyVisible - is this view devoted to this gadget. */ @@ -378,7 +378,7 @@ gadgets.views.View.prototype.isOnlyVisib }; gadgets.views.ViewType = gadgets.util.makeEnum([ - "CANVAS", "HOME", "PREVIEW", "PROFILE", + 'CANVAS', 'HOME', 'PREVIEW', 'PROFILE', // TODO Deprecate the following ViewTypes. - "FULL_PAGE", "DASHBOARD", "POPUP" + 'FULL_PAGE', 'DASHBOARD', 'POPUP' ]); 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=997163&r1=997162&r2=997163&view=diff ============================================================================== --- shindig/trunk/features/src/main/javascript/features/xmlutil/xmlutil.js (original) +++ shindig/trunk/features/src/main/javascript/features/xmlutil/xmlutil.js Wed Sep 15 01:39:49 2010 @@ -33,15 +33,15 @@ opensocial.xmlutil.parser_ = null; * @return {Document} XML document. */ opensocial.xmlutil.parseXML = function(str) { - if (typeof(DOMParser) != "undefined") { + if (typeof(DOMParser) != 'undefined') { opensocial.xmlutil.parser_ = opensocial.xmlutil.parser_ || new DOMParser(); - var doc = opensocial.xmlutil.parser_.parseFromString(str, "text/xml"); + var doc = opensocial.xmlutil.parser_.parseFromString(str, 'text/xml'); if (doc.firstChild && doc.firstChild.tagName == 'parsererror') { throw Error(doc.firstChild.firstChild.nodeValue); } return doc; - } else if (typeof(ActiveXObject) != "undefined") { - var doc = new ActiveXObject("MSXML2.DomDocument"); + } else if (typeof(ActiveXObject) != 'undefined') { + var doc = new ActiveXObject('MSXML2.DomDocument'); doc.validateOnParse = false; doc.loadXML(str); if (doc.parseError && doc.parseError.errorCode) { @@ -49,16 +49,16 @@ opensocial.xmlutil.parseXML = function(s } return doc; } - throw Error("No XML parser found in this browser."); + throw Error('No XML parser found in this browser.'); }; /** * Map of Namespace prefixes to their respective URLs. - * @type Object.<string,string> + * @type {Object.<string,string>} */ opensocial.xmlutil.NSMAP = { - "os": "http://opensocial.org/" + 'os': 'http://opensocial.org/' }; @@ -74,17 +74,17 @@ opensocial.xmlutil.NSMAP = { * @return {string} A string of xmlns delcarations required for this XML. */ opensocial.xmlutil.getRequiredNamespaces = function(xml, opt_container) { - var namespaces = opt_container ? + 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]; } } - return opensocial.xmlutil.serializeNamespaces_(namespaces); + return opensocial.xmlutil.serializeNamespaces_(namespaces); }; @@ -92,18 +92,18 @@ opensocial.xmlutil.serializeNamespaces_ var buffer = []; for (var prefix in namespaces) { if (namespaces.hasOwnProperty(prefix)) { - buffer.push(" xmlns:", prefix, "=\"", namespaces[prefix], "\""); + buffer.push(' xmlns:', prefix, '=\"', namespaces[prefix], '\"'); } } - return buffer.join(""); + return buffer.join(''); }; /** * Returns a map of XML namespaces declared on an DOM Element. - * @param {Element} el The Element to inspect - * @return {Object.<string, string>} A Map of keyed by prefix of declared - * namespaces. + * @param {Element} el The Element to inspect. + * @return {Object.<string, string>} A Map of keyed by prefix of declared + * namespaces. */ opensocial.xmlutil.getNamespaceDeclarations_ = function(el) { var namespaces = {}; @@ -112,7 +112,7 @@ opensocial.xmlutil.getNamespaceDeclarati if (name.substring(0, 6) != 'xmlns:') { continue; } - namespaces[name.substring(6, name.length)] = el.getAttribute(name); + namespaces[name.substring(6, name.length)] = el.getAttribute(name); } return namespaces; }; @@ -123,7 +123,7 @@ opensocial.xmlutil.getNamespaceDeclarati * * TODO: A better way to do this. */ -opensocial.xmlutil.ENTITIES = "<!ENTITY nbsp \" \">"; +opensocial.xmlutil.ENTITIES = '<!ENTITY nbsp \" \">'; /** @@ -136,7 +136,7 @@ opensocial.xmlutil.ENTITIES = "<!ENTITY */ opensocial.xmlutil.prepareXML = function(xml, opt_container) { var namespaces = opensocial.xmlutil.getRequiredNamespaces(xml, opt_container); - return "<!DOCTYPE root [" + opensocial.xmlutil.ENTITIES + - "]><root xml:space=\"preserve\"" + - namespaces + ">" + xml + "</root>"; + return '<!DOCTYPE root [' + opensocial.xmlutil.ENTITIES + + ']><root xml:space=\"preserve\"' + + namespaces + '>' + xml + '</root>'; };
