first commit

This commit is contained in:
s.golasch
2023-08-01 13:49:46 +02:00
commit 1fc239fd54
20238 changed files with 3112246 additions and 0 deletions

View File

@@ -0,0 +1,288 @@
/*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview External declarations for common container JS.
*
* TODO(uix-eng): May want a way to conveniently generate this externs to avoid
* manual changes when we merge Shindig.
*
* @externs
*/
google.container = {};
////////////////////////////////////////////////////////////////////////////////
// Externs from container.js
////////////////////////////////////////////////////////////////////////////////
google.container.ContainerConfig = {};
google.container.ContainerRender = {};
/**
* @param {Object} config
* @constructor
*/
google.container.Container = function(config) {};
/**
* @param {Object=} opt_config
*/
google.container.Container.prototype.onConstructed = function(opt_config) {};
/**
* Create a new gadget site.
* @param {Element} gadgetEl
* @param {Element=} opt_bufferEl
* @return {google.container.GadgetSite}
*/
google.container.Container.prototype.newGadgetSite = function(gadgetEl,
opt_bufferEl) {};
/**
* @param {string} id
* @return {google.container.GadgetSite}
* @nosideeffects
*/
google.container.Container.prototype.getGadgetSite = function(id) {};
/**
* @param {string} id
* @return {google.container.GadgetHolder}
* @nosideeffects
*/
google.container.Container.prototype.getGadgetHolder = function(id) {};
/**
* @param {google.container.GadgetSite} site
* @param {string} gadgetUrl
* @param {Object} gadgetParams
* @param {Object} renderParams
* @param {Function=} opt_callback
*/
google.container.Container.prototype.navigateGadget = function(
site, gadgetUrl, gadgetParams, renderParams, opt_callback) {};
/**
* @param {google.container.GadgetSite} site
*/
google.container.Container.prototype.closeGadget = function(site) {};
/**
* @param {Object} request
*/
google.container.Container.prototype.preloadGadgets = function(request) {};
/**
* @param {string} url
* @param {function(Object)=} opt_callback
*/
google.container.Container.prototype.getGadgetMetadata = function(url,
opt_callback) {};
////////////////////////////////////////////////////////////////////////////////
// Externs from gadget_site.js
////////////////////////////////////////////////////////////////////////////////
/**
* @param {google.container.Service} service
* @param {Element} gadgetEl
* @param {Element=} opt_bufferEl
* @constructor
*/
google.container.GadgetSite = function(service, gadgetEl, opt_bufferEl) {};
google.container.GadgetSite.prototype.onConstructed = function() {};
/**
* @param {number} height
*/
google.container.GadgetSite.prototype.setHeight = function(height) {};
/**
* @param {number} width
*/
google.container.GadgetSite.prototype.setWidth = function(width) {};
/**
* @param {number} value
*/
google.container.GadgetSite.prototype.setParentId = function(value) {};
/**
* @return {number}
* @nosideeffects
*/
google.container.GadgetSite.prototype.getId = function() {};
/**
* @return {google.container.GadgetHolder}
* @nosideeffects
*/
google.container.GadgetSite.prototype.getActiveGadgetHolder = function() {};
/**
* @param {string} name
* @param {Object=} opt_gadgetInfo
* @return {Object}
* @nosideeffects
*/
google.container.GadgetSite.prototype.getFeature = function(name,
opt_gadgetInfo) {};
/**
* @param {string} id
* @return {google.container.GadgetHolder}
* @nosideeffects
*/
google.container.GadgetSite.prototype.getGadgetHolder = function(id) {};
/**
* @return {string}
* @nosideeffects
*/
google.container.GadgetSite.prototype.getParentId = function() {};
/**
* @param {string} gadgetUrl
* @param {Object} gadgetParams
* @param {Object} renderParams
* @param {Function=} opt_callback
*/
google.container.GadgetSite.prototype.navigateTo = function(gadgetUrl,
gadgetParams, renderParams, opt_callback) {};
/**
* @param {Object} gadgetInfo
* @param {Object} gadgetParams
* @param {Object} renderParams
*/
google.container.GadgetSite.prototype.render = function(
gadgetInfo, gadgetParams, renderParams) {};
/**
* @param {string} serviceName
* @param {Function} callback
* @param {...number} var_args
*/
google.container.GadgetSite.prototype.rpcCall = function(serviceName, callback,
var_args) {};
google.container.GadgetSite.prototype.close = function() {};
////////////////////////////////////////////////////////////////////////////////
// Externs from gadget_holder.js
////////////////////////////////////////////////////////////////////////////////
/**
* @param {number} siteId
* @param {Element} el
* @constructor
*/
google.container.GadgetHolder = function(siteId, el) {};
google.container.GadgetHolder.prototype.onConstructed = function() {};
/**
* @return {Element}
* @nosideeffects
*/
google.container.GadgetHolder.prototype.getElement = function() {};
/**
* @return {string}
* @nosideeffects
*/
google.container.GadgetHolder.prototype.getIframeId = function() {};
/**
* @return {Object}
* @nosideeffects
*/
google.container.GadgetHolder.prototype.getGadgetInfo = function() {};
google.container.GadgetHolder.prototype.dispose = function() {};
/**
* @return {string}
* @nosideeffects
*/
google.container.GadgetHolder.prototype.getUrl = function() {};
/**
* @return {string}
* @nosideeffects
*/
google.container.GadgetHolder.prototype.getView = function() {};
/**
* @return {Element}
* @nosideeffects
*/
google.container.GadgetHolder.prototype.getIframeElement = function() {};
/**
* @param {string} value
*/
google.container.GadgetHolder.prototype.setSecurityToken = function(value) {};
/**
* @param {Object} gadgetInfo
* @param {Object} gadgetParams
* @param {Object} renderParams
*/
google.container.GadgetHolder.prototype.render = function(gadgetInfo,
gadgetParams, renderParams) {};
////////////////////////////////////////////////////////////////////////////////
// Externs from service.js
////////////////////////////////////////////////////////////////////////////////
google.container.ServiceConfig = {};
/**
* @param {Object=} opt_config
* @constructor
*/
google.container.Service = function(opt_config) {};
/**
* @param {Object} request
* @param {function(Object)=} opt_callback
*/
google.container.Service.prototype.getGadgetMetadata = function(request,
opt_callback) {};
/**
* @param {Object} request
* @param {function(Object)=} opt_callback
*/
google.container.Service.prototype.getGadgetToken = function(request,
opt_callback) {};
/**
* @param {string} url
* @return {Object}
*/
google.container.Service.prototype.getCachedGadgetMetadata = function(url) {};
/**
* @param {string} url
* @return {Object}
*/
google.container.Service.prototype.getCachedGadgetToken = function(url) {};

View File

@@ -0,0 +1,357 @@
/*
* Copyright 2008 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Externs file for the Iframes library.
* @externs
*/
/**
* The namespace for most of the APIs.
* @type {!iframes.Iframes}
* @suppress {checkTypes} In some crazy locations, this is being used as a
* source file. It needs to be assigned to some object so that the
* iframes.Iframes definition doesn't fail.
*/
var iframes = /** @type {!iframes.Iframes} */ ({});
/**
* The type for the Iframes API.
* @constructor
*/
iframes.Iframes = function() {};
/**
* Gets the handler for a given style.
*
* @param {string} style
* @return {Object|Function} The handler for the given style.
*/
iframes.Iframes.prototype.getHandler = function(style) {};
/**
* Sets the handler for a given style.
*
* @param {string} style
* @param {Object|Function} handler The handler for a given style.
* If the style handle is a function, the object returned by this
* function providing the iframe as the parameter is used as the
* actual style handler for every iframe opened in the style it
* handles.
* The follow methods of the handler are significant (note
* that the iframe parameter only presents when the original
* style handler is not a function):
* open(iframe): called to open the iframe.
* call iframe.openInto(el) to perform the open action.
* onready(iframe): called when the iframe is ready.
* close(iframe): called to close the iframe.
*/
iframes.Iframes.prototype.setHandler = function(style, handler) {};
/**
* Gets a deferred-loaded style handler.
* @param {string} style The name of the style.
* @return {?function(function())} The deferred loader, if any.
*/
iframes.Iframes.prototype.getDeferredHandler = function(style) {};
/**
* Sets a deferred-loaded style handler.
* @param {string} style The name of the style.
* @param {function(function())} loader The method to load the new style
* handler, which should call iframes.setHandler for that style.
* It then needs to call the callback method passed in.
*/
iframes.Iframes.prototype.setDeferredHandler = function(style, loader) {};
/**
* This is an internal class to represent an iframe, not the DOM element.
* @constructor
*/
iframes.Iframe = function() {};
/**
* Methods used to pass to the iframe being opened.
* @return {Object}
*/
iframes.Iframe.prototype.getMethods = function() {};
/**
* Parameters used for opening the widget.
* @return {Object}
*/
iframes.Iframe.prototype.getOpenParams = function() {};
/**
* Parameters used to pass to the iframe being opened.
* @return {Object}
*/
iframes.Iframe.prototype.getParams = function() {};
/**
* @type {Element}
* @deprecated
*/
iframes.Iframe.prototype.containerDiv;
/**
* DOM reference to element containing iframe element.
*
* @return {Element}
*/
iframes.Iframe.prototype.getSiteEl = function() {};
/**
* @param {Element} element DOM element containing the iframe element.
*/
iframes.Iframe.prototype.setSiteEl = function(element) {};
/**
* DOM reference to the iframe element containing the widget.
*
* @return {Element}
*/
iframes.Iframe.prototype.getIframeEl = function() {};
/**
* generated ID that will be set on the widget when it is opened
*
* @return {string}
*/
iframes.Iframe.prototype.getId = function() {};
/**
* Iframe class instance that opened our Iframe instance.
*
* @return {iframes.Iframe}
*/
iframes.Iframe.prototype.getOpenerIframe = function() {};
/**
* Exposes the method so it can be called from iframe object.
* This is supposed be called by the style handler while handling 'open'
* before calling 'openInto'.
*
* @param {string} name Name of the method as being called.
* @param {Function} method The method to be exposed.
*/
iframes.Iframe.prototype.exposeMethod = function(name, method) {};
/**
* @param {string|Element} el The DOM element or its ID to open the iframe
* into.
* @param {Object=} opt_iframeAttributes Key-value pairs of iframe attributes.
* @return {iframes.Iframe} This iframe object (not the DOM element).
**/
iframes.Iframe.prototype.openInto = function(el, opt_iframeAttributes) {};
/**
* Close the iframe.
*
* @param {*=} opt_params Data to pass to the callback.
* @return {*} The result from the callback function.
*/
iframes.Iframe.prototype.close = function(opt_params) {};
/**
* Removes the iframe element from the DOM tree.
*/
iframes.Iframe.prototype.remove = function() {};
/**
* Adds a callback method for a given type of event.
*
* @param {string} type The event type: e.g. 'ready' or 'close'.
* @param {Function} callback The callback method.
*/
iframes.Iframe.prototype.addCallback = function(type, callback) {};
/**
* Removes a callback method for a given type of event.
*
* @param {string} type The event type used in 'addCallback'.
* @param {Function} callback The callback method used in 'addCallback'.
*/
iframes.Iframe.prototype.removeCallback = function(type, callback) {};
/**
* Allows a global function for all iframes.
*
* @param {string} name The name of the method for the iframes.
* @param {?function(...*) : *=} opt_func A optional function, by default
* window[name].
*/
iframes.Iframes.prototype.allow = function(name, opt_func) {};
/**
* Opens an iframe.
*
* WARNING: This API takes ownership of all object parameters and will
* modify them. Make a copy if you want to reuse them.
*
* @param {string} url The URL of the iframe to be opened.
* @param {Object} openParams The parameters for opening the iframe.
* style: specify which handler is used.
* For the default handler, the follow attributes are used:
* element: the element which the iframe would be opened into.
* @param {Object} params The data to be passed to the iframe.
* All properties should be string.
* @param {Object|function(...*) : *=} opt_methods: Functions to passed to
* the iframe. All properties should be functions. If no 'callback'
* argument is provided and the argument in this position is a function
* instead of an object, it is considered as the next parameter
* 'callback', not this parameter 'methods'.
* @param {?function(...*) : *=} opt_callback: a callback function called
* when the iframe is closed.
*
* @return {iframes.Iframe} The opened iframe.
*/
iframes.Iframes.prototype.open = function(
url, openParams, params, opt_methods, opt_callback) {};
/**
* Closes this iframe.
*
* @param {*=} opt_params The parameters to pass back to the parent iframe.
* @param {?function(...*) : *=} opt_callback The callback function after
* parent processed the event.
*/
iframes.Iframes.prototype.close = function(opt_params, opt_callback) {};
/**
* Indicates that this iframe is ready. The exactly semantic depends on
* the style handler, but generally it means ready to be displayed and
* it should be called the page is drawn and initial data loaded.
*
* @param {Object=} opt_params The parameters to pass back to the parent iframe.
* @param {Object|function(...*) : *=} opt_methods: Functions to passed to
* the iframe. All properties should be functions. If no 'callback'
* argument is provided and the argument in this position is a function
* instead of an object, it is considered as the next parameter
* 'callback', not this parameter 'methods'.
* @param {?function(...*) : *=} opt_callback The callback function after
* parent processed the event.
*/
iframes.Iframes.prototype.ready = function(
opt_params, opt_methods, opt_callback) {};
/**
* Passes the parent's origin and referer to the callback.
* @param {Function} callback Function
* that will get parent info passed to it.
*/
iframes.Iframes.prototype.getParentInfo = function(callback) {};
/**
* Export browser events to your opener.
* @param {Array<string>} events List of events to export. Currently only
* supports mouseover and mouseout.
*/
iframes.Iframes.prototype.propagate = function(events) {};
/**
* Asks the parent window to change the width and height of this iframe.
*
* @param {Object} params The width and/or height in number of pixels to be
* resized. Use 'height': 'auto' for current window content height.
*/
iframes.Iframes.prototype.resize = function(params) {};
/**
* @param {Object} params
* @deprecated
*/
iframes.Iframes.prototype.resizeMe = function(params) {};
/**
* @return {string} The full URI for the Google Connect JS bundle.
*/
iframes.Iframes.prototype.getGoogleConnectJsUri = function() {};
/**
* Allows client to override the Google Connect JS to use.
* @param {string} version The versioned JS file to use.
*/
iframes.Iframes.prototype.setGoogleConnectJsVersion = function(version) {};
/**
* Allows the client to use a different JS hint.
* @param {string} hint The JS hint to use.
*/
iframes.Iframes.prototype.setJsHint = function(hint) {};
/**
* Allows the client to use a different bootstrap hint.
* @param {string} hint The bootstrap hint to use.
*/
iframes.Iframes.prototype.setBootstrapHint = function(hint) {};
/**
* @param {string} version
* @deprecated
*/
iframes.Iframes.prototype.setVersionOverride = function(version) {};
/**
* Inside an iframe, the properties of the iframer object are the data and
* functions provided in iframes.open.
* @type {!Object|undefined}
*/
iframes.Iframes.prototype.iframer = {};
/**
* Inside an iframe, the properties of the iframer object are the data and
* functions provided in iframes.open.
* @type {!Object}
*/
var iframer = {};
/**
* Send a message to the parent.
* @param {string} message The message name.
* @param {*=} opt_data Optional data to pass.
* @param {Function=} opt_callback Optional callback to handle response.
* @param {Function=} opt_filter Optional iframes filter (not used).
*/
iframer.send = function(message, opt_data, opt_callback, opt_filter) {};
/**
* Send a message to the iframe.
* @param {string} message The message name.
* @param {*=} opt_data Optional data to pass.
* @param {Function=} opt_callback Optional callback to handle response.
* @param {Function=} opt_filter Optional iframes filter (not used).
*/
iframes.Iframe.prototype.send = function(
message, opt_data, opt_callback, opt_filter) {};
/**
* Register an handler for messages from the iframe.
* @param {string} message The message name.
* @param {Function} callback Message handler.
* @param {Function=} opt_filter Optional iframes filter (not used).
*/
iframes.Iframe.prototype.register = function(message, callback, opt_filter) {};
/**
* Filter function to allow cross origin messages.
* @param {Object} iframe Iframe to filter.
*/
iframes.Iframes.prototype.CROSS_ORIGIN_IFRAMES_FILTER = function(iframe) {};

View File

@@ -0,0 +1,55 @@
/*
* Copyright 2009 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Externs file for OAuth specific functionality in the OpenSocial
* gadget libraries. Note this may not be comprehensive.
* @see http://code.google.com/apis/gadgets/docs/oauth.html
* @externs
*/
// Namespace for OAuth
gadgets.oauth = {};
/**
* An OAuth popup for granting one time access to user data.
* @param {string} destination Target URL for the popup window.
* @param {string} windowOptions Options for window.open, used to specify
* look and feel of the window.
* @param {Function} openCallback Function to call when the window is
* opened.
* @param {Function} closeCallback Function to call when the window is
* closed.
* @constructor
*/
gadgets.oauth.Popup = function(destination, windowOptions,
openCallback, closeCallback) {};
/**
* @return {Function} An onclick handler for the "open the approval window"
* link
*/
gadgets.oauth.Popup.prototype.createOpenerOnClick = function() {};
/**
* @return {Function} An onclick handler for the "I've approved" link.
* This may not ever be called. If we successfully detect that the
* window was closed, this link is unnecessary.
*/
gadgets.oauth.Popup.prototype.createApprovedOnClick = function() {};

View File

@@ -0,0 +1,26 @@
/*
* Copyright 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Externs file for OAuth2 specific functionality in OpenSocial
* gadget libraries.
* @externs
*/
// Namespace for OAuth2
var oauth2 = {};

View File

@@ -0,0 +1,609 @@
/*
* Copyright 2008 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Externs file for OpenSocial gadget libraries. Legacy API based
* on the {@code _IG_...} is not supported here.
* Note this may not be comprehensive.
*
* @see http://code.google.com/apis/gadgets/docs/reference/
* @see http://incubator.apache.org/shindig/shindig-1.1.x/shindig-features/jsdoc
* @externs
*/
// Root namespace for gadget related functionality.
var gadgets = {};
// Namespace providing operations for getting information about and modifying
// the window the gadget is placed in.
gadgets.window = {};
/**
* @param {number=} opt_height The new height for the gadget.
*/
gadgets.window.adjustHeight = function(opt_height) {};
/**
* @return {Object} Dimensions for the viewport.
*/
gadgets.window.getViewportDimensions = function() {};
/**
* @param {string} title The new title for the gadget.
*/
gadgets.window.setTitle = function(title) {};
/**
* Calculate inner content height is hard and different between
* browsers rendering in Strict vs. Quirks mode. We use a combination of
* three properties within document.body and document.documentElement:
* - scrollHeight
* - offsetHeight
* - clientHeight
* These values differ significantly between browsers and rendering modes.
* But there are patterns. It just takes a lot of time and persistence
* to figure out.
* @return {number} Height of current window.
*/
gadgets.window.getHeight = function() {};
// Namespace providing operations for making remote procedure calls for
// gadget-to-container, container-to-gadget and gadget-to-gadget communication.
gadgets.rpc = {};
/**
* Exported constant used by transports.
* @type {string}
*/
gadgets.rpc.ACK;
/**
* @param {?string} targetId The id of the target gadget, null for container.
* @param {string} serviceName The RPC service to call.
* @param {!Function=} opt_callback Function called when the RPC
* completes.
* @param {...*} var_args Variable arguments that are passed to the RPC handler.
*/
gadgets.rpc.call = function(targetId, serviceName, opt_callback, var_args) {};
/**
* Force RPC utilities to fallback to secure mechanisms for type=URL gadgets.
*/
gadgets.rpc.forceParentVerifiable = function() {};
/**
* @return {string} The RPC relay mechanism.
*/
gadgets.rpc.getRelayChannel = function() {};
/**
* @param {string} targetId The frame ID to get the relay for.
* @return {string} The relay URL of the given gadget (or container).
*/
gadgets.rpc.getRelayUrl = function(targetId) {};
/**
* Global init for RPC code.
*/
gadgets.rpc.init = function() {};
/**
* Receives and processes an RPC request. (Not to be used directly.)
* Only used by IFPC.
* @param {Array<string>} fragment An RPC request fragment encoded as
* an array. The first 4 elements are target id, source id & call id,
* total packet number, packet id. The last element stores the actual
* JSON-encoded and URI escaped packet data.
*/
gadgets.rpc.receive = function(fragment) {};
/**
* @param {string} serviceName The RPC service to register a handler for.
* @param {!Function} handler Handler for an RPC call, return
* value will be sent back to the caller.
*/
gadgets.rpc.register = function(serviceName, handler) {};
/**
* @param {!Function} handler Handler for unknown RPC calls,
* return value will be sent back to the caller.
*/
gadgets.rpc.registerDefault = function(handler) {};
/**
* Helper method to retrieve the auth token for a given gadget.
* @param {string} targetId Name of the target frame.
* @return {string} The authentication token registered for this
* target id.
*/
gadgets.rpc.getAuthToken = function(targetId) {};
/**
* Helper method returning a canonicalized protocol://host[:port] for
* a given input URL, provided as a string. Used to compute convenient
* relay URLs and to determine whether a call is coming from the same
* domain as its receiver (bypassing the try/catch capability detection
* flow, thereby obviating Firebug and other tools reporting an exception).
* @param {string} url Base URL to canonicalize.
* @return {string} The canonicalized URL.
*/
gadgets.rpc.getOrigin = function(url) {};
/**
* Helper method returning a canonicalized protocol://host[:port] for
* the relay URL of a given target frame.
* @param {string} id Name of the target frame.
* @return {string} The canonicalized URL.
*/
gadgets.rpc.getTargetOrigin = function(id) {};
/**
* Sets the auth token of a target frame.
* @param {string} targetId Name of the target frame.
* @param {string} token The authentication token to use for all calls to or
* from this target id.
*/
gadgets.rpc.setAuthToken = function(targetId, token) {};
/**
* Sets the relay URL of a target frame.
* @param {string} targetId The id of the target gadget.
* @param {string} url Full relay URL of the target frame.
* @param {boolean=} opt_useLegacy True if this relay needs the legacy IFPC
* wire format.
*/
gadgets.rpc.setRelayUrl = function(targetId, url, opt_useLegacy) {};
/**
* Setups the gadgets.rpc library to communicate with the receiver. This method
* replaces setAuthToken and setRelayUrl.
* @param {string} targetId The id of the target gadget.
* @param {string=} opt_receiverUrl Full relay URL of the target frame.
* @param {boolean=} opt_authToken null The authentication token to use for all
* calls to or from this target id.
*/
gadgets.rpc.setupReceiver = function(targetId, opt_receiverUrl, opt_authToken) {};
/**
* Remove relay URL and auth token registration for a target frame.
*
* Note: Does not delete the iframe.
* @param {string} receiverId The id of the target gadget.
*/
gadgets.rpc.removeReceiver = function(receiverId) {};
/**
* @param {string} serviceName The RPC service to unregister the handler for.
*/
gadgets.rpc.unregister = function(serviceName) {};
/**
* Unregisters the default service handler. Future unknown RPC
* calls will fail silently.
*/
gadgets.rpc.unregisterDefault = function() {};
/**
* Class providing access to user preferences, module dimensions, and messages.
* @param {string=} opt_moduleId An optional module ID to get preferences for.
* @constructor
*/
gadgets.Prefs = function(opt_moduleId) {};
/**
* @param {string} key The user preference key.
* @return {Array<string>} The array value of the preference.
*/
gadgets.Prefs.prototype.getArray = function(key) {};
/**
* @param {string} key The user preference key.
* @return {boolean} The boolean value of the preference.
*/
gadgets.Prefs.prototype.getBool = function(key) {};
/**
* @param {string} key The user preference key.
* @return {number} The float value of the preference.
*/
gadgets.Prefs.prototype.getFloat = function(key) {};
/**
* @param {string} key The user preference key.
* @return {number} The int value of the preference.
*/
gadgets.Prefs.prototype.getInt = function(key) {};
/**
* @param {string} key The user preference key.
* @return {string} The string value of the preference.
*/
gadgets.Prefs.prototype.getString = function(key) {};
/**
* @return {string} The country code.
*/
gadgets.Prefs.prototype.getCountry = function() {};
/**
* @return {string} The language code.
*/
gadgets.Prefs.prototype.getLang = function() {};
/**
* @return {number} The module's id.
*/
gadgets.Prefs.prototype.getModuleId = function() {};
/**
* @param {string} key The message key.
* @return {string} The unformatted message.
*/
gadgets.Prefs.prototype.getMsg = function(key) {};
/**
* @param {string} key The preference key.
* @param {string|number} value The preference value.
*/
gadgets.Prefs.prototype.set = function(key, value) {};
/**
* @param {string} key The preference key.
* @param {Array<string>} array The preference array.
*/
gadgets.Prefs.prototype.setArray = function(key, array) {};
// Namespace for embedding flash content in gadgets.
gadgets.flash = {};
/**
* @return {boolean} Injects the cached Flash file into the DOM tree.
*/
gadgets.flash.embedCachedFlash = function() {};
/**
* @return {number} The major version of Flash Player or 0 if Flash is not
* supported.
*/
gadgets.flash.getMajorVersion = function() {};
/**
* @param {string} url The URL of the flash to embed.
* @param {string|Element} container The ID or object reference to the
* existing HTML container.
* @param {number} minVersion The minimum version required.
* @param {Object=} opt_params An optional object that may contain any valid
* HTML parameters that will be passed to the Flash movie.
* @return {boolean} Whether the function call completes successfully.
*/
gadgets.flash.embedFlash = function(
url, container, minVersion, opt_params) {};
// Namespace for retrieving content from remote servers via the gadgets proxy.
gadgets.io = {};
/**
* Gets the proxy version of the passed-in URL.
*
* @param {string} url The URL to get the proxy URL for
* @param {Object=} opt_params Optional Parameter Object.
* The following properties are supported:
* .REFRESH_INTERVAL The number of seconds that this
* content should be cached. Defaults to 3600.
*
* @return {string} The proxied version of the URL
*/
gadgets.io.getProxyUrl = function(url, opt_params) {};
/**
* @param {string} url The URL to request data from.
* @param {Function} callback The callback function.
* @param {Object=} opt_params Optional map of parameters sent on request, see
* gadgets.io.RequestParameters.
*/
gadgets.io.makeRequest = function(url, callback, opt_params) {};
/**
* Converts an input object into a URL-encoded data string. (key=value&...).
* @param {Object} fields The post fields you wish to encode.
* @return {string} The processed post data; this includes a trailing
* ampersand (&).
*/
gadgets.io.encodeValues = function(fields) {};
/**
* Enumeration of request parameters.
* @enum {string}
*/
gadgets.io.RequestParameters = {
AUTHORIZATION: '',
CONTENT_TYPE: '',
GET_SUMMARIES: '',
HEADERS: '',
METHOD: '',
NUM_ENTRIES: '',
OAUTH_REQUEST_TOKEN: '',
OAUTH_REQUEST_TOKEN_SECRET: '',
OAUTH_SERVICE_NAME: '',
OAUTH_TOKEN_NAME: '',
OAUTH_USE_TOKEN: '',
POST_DATA: '',
REFRESH_INTERVAL: ''
};
/**
* Enumeration of content types that can be specified in
* {@link gadgets.io.RequestParameters.AUTHORIZATION}
* @enum {string}
*/
gadgets.io.AuthorizationType = {
NONE: '',
OAUTH: '',
SIGNED: ''
};
/**
* Enumeration of content types that can be specified in
* {@link gadgets.io.RequestParameters.CONTENT_TYPE}
* @enum {string}
*/
gadgets.io.ContentType = {
DOM: '',
FEED: '',
JSON: '',
TEXT: ''
};
/**
* Enumeration of content types that can be specified in
* {@link gadgets.io.RequestParameters.METHOD}
* @enum {string}
*/
gadgets.io.MethodType = {
DELETE: '',
GET: '',
HEAD: '',
POST: '',
PUT: ''
};
/**
* This is the response object that is passed to the callback of
* gadgets.io.makeRequest. It is never explicitly called "ResponseObject" in the
* documentation, but the documentation does refer to an object that is passed
* to the callback. This is that object.
* @see http://wiki.opensocial.org/index.php?title=Gadgets.io_(v0.9)#gadgets.io.makeRequest
*/
gadgets.io.ResponseObject = {};
/**@type {Object}*/ gadgets.io.ResponseObject.data;
/**@type {Array<string>}*/ gadgets.io.ResponseObject.errors;
/**@type {Object}*/ gadgets.io.ResponseObject.headers;
/**@type {number}*/ gadgets.io.ResponseObject.rc;
/**@type {string}*/ gadgets.io.ResponseObject.text;
/**@type {string}*/ gadgets.io.ResponseObject.oauthApprovalUrl;
/**@type {string}*/ gadgets.io.ResponseObject.oauthError;
/**@type {string}*/ gadgets.io.ResponseObject.oauthErrorText;
// Namespace for views
gadgets.views = {};
/**
* Returns the current view.
* @return {gadgets.views.View} The current view.
*/
gadgets.views.getCurrentView = function() {};
/**
* Get parameters passed into the view
* @return {Object} Map string -> string of parameters passed in.
*/
gadgets.views.getParams = function() {};
/**
* @return {Object} Map<gadgets.views.ViewType, String, gadgets.views.View>
* A map of all the supported views. Keys each gadgets.view.View by its name.
*/
gadgets.views.getSupportedViews = function() {};
/**
* @param {gadgets.views.View|string} view The view to navigate to.
* @param {Object=} opt_params Map<String, String>: Parameters to pass to the
* 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.
*/
gadgets.views.requestNavigateTo = function(view, opt_params, opt_ownerId) {};
/**
* @constructor
*/
gadgets.views.View = function() {};
/**
* @return {string} Returns the name of this view.
*/
gadgets.views.View.prototype.getName = function() {}
/**
* @return {boolean} True if the gadget is the only visible gadget; otherwise,
* false.
*/
gadgets.views.View.prototype.isOnlyVisibleGadget = function() {};
// Namespace for utilities.
gadgets.util = {};
/**
* Escapes the input using HTML entities to make it safer.
* @param {string} str The string to escape.
* @return {string} The escaped string.
*/
gadgets.util.escapeString = function(str) {};
/**
* Reverses escapeString
* @param {string} str The string to unescape.
* @return {string} The unescaped string.
*/
gadgets.util.unescapeString = function(str) {};
/**
* Returns the parameters for a feature.
* @param {string} feature The feature name.
* @return {Object} Parameters for the feature or null.
*/
gadgets.util.getFeatureParameters = function(feature) {};
/**
* Returns whether the specified feature is supported.
* @param {string} feature The feature name.
* @return {boolean} Whether the feature is supported.
*/
gadgets.util.hasFeature = function(feature) {};
/**
* Registers a function to be called when the gadget loads.
* @param {function()} fn The function to call.
*/
gadgets.util.registerOnLoadHandler = function(fn) {};
/**
* Parses the current document's location and returns an object representing
* the parameters in the query string.
* @param {string=} opt_url Optional URL whose parameters to parse.
* Defaults to window's current URL.
* @return {Object} Parameters from the query string.
*/
gadgets.util.getUrlParameters = function(opt_url) {};
/**
* Creates a closure that is suitable for passing as a callback.
* Any number of arguments may be passed to the callback;
* they will be received in the order they are passed in.
*
* @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} callback The callback to invoke when this is run;
* any arguments passed in will be passed after your initial arguments
* @param {...*} var_args Initial arguments to be passed to the callback
* @returns {Function} The closure.
*/
gadgets.util.makeClosure = function(scope, callback, var_args) {};
/**
* Attach an event listener to given DOM element (Not a gadget standard)
*
* @param {Object} elem DOM element on which to attach event.
* @param {string} eventName Event type to listen for.
* @param {function()} callback Invoked when specified event occurs.
* @param {boolean} useCapture If true, initiates capture.
*/
gadgets.util.attachBrowserEvent = function(
elem, eventName, callback, useCapture) {};
//Namespace for JSON processing.
gadgets.json = {};
/**
* Convert a JSON object into a string.
* @param {Object} json
* @return {String} The JSON as a string
*/
gadgets.json.stringify = function(json) {};
/**
* Convert a string into a JSON object.
* Uses safe RegEx match before parsing.
* @param {string} s The string
* @return {Object} The JSON
*/
gadgets.json.parse = function(s) {};
//Namespace for config.
gadgets.config = {};
/**
* Registers a configurable component and its configuration parameters.
* Multiple callbacks may be registered for a single component if needed.
*
* @param {string} component The name of the component to register. Should
* be the same as the fully qualified name of the <Require> feature or
* the name of a fully qualified JavaScript object reference
* (e.g. "gadgets.io").
* @param {Object=} opt_validators Mapping of option name to validation
* functions that take the form function(data) {return isValid(data);}
* @param {Function=} opt_callback A function to be invoked when a
* configuration is registered. If passed, this function will be invoked
* immediately after a call to init has been made. Do not assume that
* dependent libraries have been configured until after init is
* complete. If you rely on this, it is better to defer calling
* dependent libraries until you can be sure that configuration is
* complete. Takes the form function(config), where config will be
* all registered config data for all components. This allows your
* component to read configuration from other components.
* @param {boolean=} opt_callOnUpdate Whether the callback shall be call
* on gadgets.config.update() as well.
*/
gadgets.config.register = function(component, opt_validators, opt_callback,
opt_callOnUpdate) {};
/**
* Retrieves configuration data on demand.
*
* @param {string=} opt_component The component to fetch. If not provided
* all configuration will be returned.
* @return {Object} The requested configuration, or an empty object if no
* configuration has been registered for that component.
*/
gadgets.config.get = function(opt_component) {};
/**
* Initializes the configuration.
*
* @param {Object} config The full set of configuration data.
* @param {Boolean=} opt_noValidation True if you want to skip validation.
*/
gadgets.config.init = function(config, opt_noValidation) {};
/**
* Creates an HTML or XHTML element.
* @param {string} tagName The type of element to construct.
* @return {Element} The newly constructed element.
*/
gadgets.util.createElement = function(tagName) {};
/**
* Creates an HTML or XHTML iframe element with attributes.
* @param {Object=} opt_attribs Optional set of attributes to attach. The
* only working attributes are spelled the same way in XHTML attribute
* naming (most strict, all-lower-case), HTML attribute naming (less strict,
* case-insensitive), and JavaScript property naming (some properties named
* incompatibly with XHTML/HTML).
* @return {Element} The DOM node representing body.
*/
gadgets.util.createIframeElement = function(opt_attribs) {};
/**
* Gets the HTML or XHTML body element.
* @return {Element} The DOM node representing body.
*/
gadgets.util.getBodyElement = function() {};

View File

@@ -0,0 +1,64 @@
/*
* Copyright 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Extern declarations for namespaces and functions that the
* plusone widget defines.
*
* Contact sandbar-eng@google.com for any changes.
*
* @see https://code.google.com/apis/+1button/#jsapi
* @externs
*/
/**
* Namespace associated with Google APIs.
* @suppress {duplicate}
*/
var gapi = {};
/**
* Namespace associated with Plusone API.
* @type {Object}
*/
gapi.plusone = {};
/**
* This renders all +1 tags/classes in the specified container, which may be
* either an element (by value) or a string element ID. This function would be
* used only if the <script> tag sets parsetags to explicit, which you might do
* for performance reasons.
* @param {(Element|string)=} opt_container The container for which to render +1 buttons.
* If the container parameter is omitted, all +1 tags and classes on the
* page will be rendered.
*/
gapi.plusone.go = function(opt_container) {};
/**
* This renders a +1 button widget within the specified container element.
* @param {Element|string} id An element by value or a string element ID.
* @param {Object} params +1 tag parameters.
*/
gapi.plusone.render = function(id, params) {};
/**
* Container to define user supplied configuration for the plusone button.
*/
var ___gcfg = {};

View File

@@ -0,0 +1,49 @@
/*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Externs file for OpenSocial shindig libraries.
* Note this may not be comprehensive.
*
* @see http://incubator.apache.org/shindig/shindig-1.1.x/shindig-features/jsdoc
* @externs
*/
// Root namespace for shindig related functionality.
var shindig = {};
/**
* Implements a safer random() method that is seeded from
* screen width/height and (presumably random/unguessable) mouse
* movement, in an effort to create a better seed for random().
* @return {number} The random number.
*/
shindig.random = function() {};
/**
* Implements a SHA1 hasher.
* @return {{reset: function(), update:
* function((Array<number>|string),number=), digest:
* function():Array<number>, digestString: function():string}} SHA1
* hasher object. Methods of the returned object are: reset() which
* resets the internal accumulator, update(bytes, opt_length) which
* adds a byte array or string to the internal accumulator (or
* optionally just a prefix of length opt_length), digest() which
* returns a finalized hash as an array of 20 byte values, and
* digestString() which returns a hex-encoded string containing a
* finalized hash.
*/
shindig.sha1 = function() {};