You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by jo...@apache.org on 2009/10/29 22:48:57 UTC
svn commit: r831107 - in
/incubator/shindig/trunk/features/src/main/javascript/features: core.io/
core/ dynamic-height/ flash/ minimessage/ opensocial-reference/ osapi/
pubsub/ settitle/ skins/ tabs/ views/
Author: johnh
Date: Thu Oct 29 21:48:56 2009
New Revision: 831107
URL: http://svn.apache.org/viewvc?rev=831107&view=rev
Log:
Adding taming.js files missed from earlier patch.
Added:
incubator/shindig/trunk/features/src/main/javascript/features/core.io/taming.js
incubator/shindig/trunk/features/src/main/javascript/features/core/taming.js
incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/taming.js
incubator/shindig/trunk/features/src/main/javascript/features/flash/taming.js
incubator/shindig/trunk/features/src/main/javascript/features/minimessage/taming.js
incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/taming.js
incubator/shindig/trunk/features/src/main/javascript/features/osapi/taming.js
incubator/shindig/trunk/features/src/main/javascript/features/pubsub/taming.js
incubator/shindig/trunk/features/src/main/javascript/features/settitle/taming.js
incubator/shindig/trunk/features/src/main/javascript/features/skins/taming.js
incubator/shindig/trunk/features/src/main/javascript/features/tabs/taming.js
incubator/shindig/trunk/features/src/main/javascript/features/views/taming.js
Added: incubator/shindig/trunk/features/src/main/javascript/features/core.io/taming.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/core.io/taming.js?rev=831107&view=auto
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/core.io/taming.js (added)
+++ incubator/shindig/trunk/features/src/main/javascript/features/core.io/taming.js Thu Oct 29 21:48:56 2009
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * @class
+ * Tame and expose core gadgets.io.* API to cajoled gadgets
+ */
+var tamings___ = tamings___ || [];
+tamings___.push(function(imports) {
+ caja___.whitelistFuncs([
+ [gadgets.io, 'encodeValues'],
+ [gadgets.io, 'getProxyUrl'],
+ [gadgets.io, 'makeRequest']
+ ]);
+});
Added: incubator/shindig/trunk/features/src/main/javascript/features/core/taming.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/core/taming.js?rev=831107&view=auto
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/core/taming.js (added)
+++ incubator/shindig/trunk/features/src/main/javascript/features/core/taming.js Thu Oct 29 21:48:56 2009
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * @class
+ * Tame and expose core gadgets.* API to cajoled gadgets
+ */
+var tamings___ = tamings___ || [];
+tamings___.push(function(imports) {
+ ___.grantRead(gadgets.log, 'INFO');
+ ___.grantRead(gadgets.log, 'WARNING');
+ ___.grantRead(gadgets.log, 'ERROR');
+ ___.grantRead(gadgets.log, 'NONE');
+
+ caja___.whitelistCtors([
+ [gadgets, 'Prefs', Object]
+ ]);
+ caja___.whitelistMeths([
+ [gadgets.Prefs, 'getArray'],
+ [gadgets.Prefs, 'getBool'],
+ [gadgets.Prefs, 'getCountry'],
+ [gadgets.Prefs, 'getFloat'],
+ [gadgets.Prefs, 'getInt'],
+ [gadgets.Prefs, 'getLang'],
+ [gadgets.Prefs, 'getMsg'],
+ [gadgets.Prefs, 'getString'],
+ [gadgets.Prefs, 'set'],
+ [gadgets.Prefs, 'setArray']
+ ]);
+ caja___.whitelistFuncs([
+ [gadgets, 'log'],
+ [gadgets, 'warn'],
+ [gadgets, 'error'],
+ [gadgets, 'setLogLevel'],
+ [gadgets.log, 'logAtLevel'],
+ [gadgets.util, 'escapeString'],
+ [gadgets.util, 'getFeatureParameters'],
+ [gadgets.util, 'hasFeature'],
+ [gadgets.util, 'registerOnLoadHandler'],
+ [gadgets.util, 'unescapeString'],
+ [gadgets.json, 'parse'],
+ [gadgets.json, 'stringify']
+ ]);
+});
Added: incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/taming.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/taming.js?rev=831107&view=auto
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/taming.js (added)
+++ incubator/shindig/trunk/features/src/main/javascript/features/dynamic-height/taming.js Thu Oct 29 21:48:56 2009
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * @class
+ * Tame and expose core gadgets.window.* API to cajoled gadgets
+ */
+var tamings___ = tamings___ || [];
+tamings___.push(function(imports) {
+ caja___.whitelistFuncs([
+ [gadgets.window, 'adjustHeight'],
+ [gadgets.window, 'getViewportDimensions'],
+ ]);
+});
+
Added: incubator/shindig/trunk/features/src/main/javascript/features/flash/taming.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/flash/taming.js?rev=831107&view=auto
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/flash/taming.js (added)
+++ incubator/shindig/trunk/features/src/main/javascript/features/flash/taming.js Thu Oct 29 21:48:56 2009
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * @class
+ * Tame and expose core gadgets.flash.* API to cajoled gadgets
+ */
+var tamings___ = tamings___ || [];
+tamings___.push(function(imports) {
+ ___.tamesTo(gadgets.flash.embedFlash, function () {
+ var cleanse = (function () {
+ // Gets a fresh Array and Object constructor that
+ // doesn't have the caja properties on it. This is
+ // important for passing objects across the boundary
+ // to flash code.
+ var ifr = document.createElement("iframe");
+ ifr.width = 1; ifr.height = 1; ifr.border = 0;
+ document.body.appendChild(ifr);
+ var A = ifr.contentWindow.Array;
+ var O = ifr.contentWindow.Object;
+ document.body.removeChild(ifr);
+
+ var c = function(obj) {
+ var t = typeof obj, i;
+ if (t === 'number' || t === 'boolean' || t === 'string') {
+ return obj;
+ }
+ if (t === 'object') {
+ var o;
+ if (obj instanceof Array) { o = new A; }
+ else if (obj instanceof Object) { o = new O; }
+ for (i in obj) {
+ if (/__$/.test(i)) { continue; }
+ o[i] = c(obj[i]);
+ }
+ return o;
+ }
+ return (void 0);
+ };
+ return c;
+ })();
+
+ return ___.frozenFunc(function tamedEmbedFlash(
+ swfUrl,
+ swfContainer,
+ swfVersion,
+ opt_params) {
+ // Check that swfContainer is a wrapped node
+ if (typeof swfContainer === "string") {
+ // This assumes that there's only one gadget in the frame.
+ var $v = ___.getNewModuleHandler().getImports().$v;
+ swfContainer = $v.cm(
+ $v.ro("document"),
+ "getElementById",
+ [swfContainer]);
+ } else if (typeof swfContainer !== "object" || !swfContainer.node___) {
+ return false;
+ }
+
+ // Generate a random number for use as the channel name
+ // for communication between the bridge and the contained
+ // flash object.
+ // TODO: Use true randomness.
+ var channel = "_flash" + ("" + Math.random()).substring(2);
+
+ // Strip out allowNetworking and allowScriptAccess,
+ // as well as any caja-specific properties.
+ var new_params = {};
+ for (i in opt_params) {
+ if (i.match(/___$/)) { continue; }
+ var ilc = i.toLowerCase();
+ if (ilc === "allownetworking" || ilc === "allowscriptaccess") {
+ continue;
+ }
+ var topi = typeof opt_params[i];
+ if (topi !== "string" && topi !== "number") { continue; }
+ new_params[i] = opt_params[i];
+ }
+ new_params.allowNetworking = "never";
+ new_params.allowScriptAccess = "none";
+ if (!new_params.flashVars) { new_params.flashVars = ""; }
+ new_params.flashVars += "&channel=" + channel;
+
+ // Load the flash.
+ gadgets.flash.embedFlash(swfUrl, swfContainer.node___, 10, new_params);
+
+ if (bridge___.channels) {
+ // If the bridge hasn't loaded, queue up the channel names
+ // for later registration
+ bridge___.channels.push(channel);
+ } else {
+ // Otherwise, register the channel immediately.
+ bridge___.registerChannel(channel);
+ }
+
+ // Return the ability to talk to the boxed swf.
+ return ___.primFreeze({
+ callSWF: (function (channel) {
+ return ___.func(function (methodName, argv) {
+ return bridge___.callSWF(
+ "" + channel,
+ "" + methodName,
+ cleanse(argv));
+ });
+ })(channel)
+ });
+ });
+ });
+
+ var d = document.createElement('div');
+ d.appendChild(document.createTextNode("bridge"));
+ document.body.appendChild(d);
+
+ gadgets.flash.embedFlash(
+ "/gadgets/files/container/Bridge.swf",
+ d,
+ 10,
+ {
+ allowNetworking: "always",
+ allowScriptAccess: "all",
+ width: 0,
+ height: 0,
+ flashvars: "logging=true"
+ });
+ bridge___ = d.childNodes[0];
+ bridge___.channels = [];
+
+ callJS = function (functionName, argv) {
+ // This assumes that there's a single gadget in the frame.
+ var $v = ___.getNewModuleHandler().getImports().$v;
+ return $v.cf($v.ro(functionName), [argv]);
+ };
+
+ onFlashBridgeReady = function () {
+ var len = bridge___.channels.length;
+ for(var i = 0; i < len; ++i) {
+ bridge___.registerChannel(bridge___.channels[i]);
+ }
+ delete bridge___.channels;
+ var outers = ___.getNewModuleHandler().getImports().$v.getOuters();
+ if (outers.onFlashBridgeReady) {
+ callJS("onFlashBridgeReady");
+ }
+ };
+});
Added: incubator/shindig/trunk/features/src/main/javascript/features/minimessage/taming.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/minimessage/taming.js?rev=831107&view=auto
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/minimessage/taming.js (added)
+++ incubator/shindig/trunk/features/src/main/javascript/features/minimessage/taming.js Thu Oct 29 21:48:56 2009
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * @class
+ * Tame and expose gadgets.MiniMessage.* API to cajoled gadgets
+ */
+
+var tamings___ = tamings___ || [];
+tamings___.push(function(imports) {
+ caja___.whitelistCtors([
+ [gadgets, 'MiniMessage', Object],
+ ]);
+ caja___.whitelistMeths([
+ [gadgets.MiniMessage, 'createDismissibleMessage'],
+ [gadgets.MiniMessage, 'createStaticMessage'],
+ [gadgets.MiniMessage, 'createTimerMessage'],
+ [gadgets.MiniMessage, 'dismissMessage']
+ ]);
+});
Added: incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/taming.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/taming.js?rev=831107&view=auto
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/taming.js (added)
+++ incubator/shindig/trunk/features/src/main/javascript/features/opensocial-reference/taming.js Thu Oct 29 21:48:56 2009
@@ -0,0 +1,154 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * @class
+ * Tame and expose opensocial.* API to cajoled gadgets
+ */
+var tamings___ = tamings___ || [];
+tamings___.push(function(imports) {
+ ___.grantRead(opensocial.IdSpec, 'PersonId');
+ ___.grantRead(opensocial.DataRequest, 'PeopleRequestFields');
+ // TODO(jasvir): The following object *is* exposed to gadget
+ // code because its returned by opensocial.DataRequest.*
+ // but isn't documented in gadget API.
+ ___.grantRead(JsonRpcRequestItem, 'rpc');
+ ___.grantRead(JsonRpcRequestItem, 'processData');
+ ___.grantRead(JsonRpcRequestItem, 'processResponse');
+ ___.grantRead(JsonRpcRequestItem, 'errors');
+
+ caja___.whitelistCtors([
+ [window, 'JsonRpcRequestItem', Object],
+ [opensocial, 'Activity', Object],
+ [opensocial, 'Address', Object],
+ [opensocial, 'BodyType', Object],
+ [opensocial, 'Container', Object],
+ [opensocial, 'Collection', Object],
+ [opensocial, 'DataRequest', Object],
+ [opensocial, 'DataResponse', Object],
+ [opensocial, 'Email', Object],
+ [opensocial, 'Enum', Object],
+ [opensocial, 'Environment', Object],
+ [opensocial, 'IdSpec', Object],
+ [opensocial, 'MediaItem', Object],
+ [opensocial, 'Message', Object],
+ [opensocial, 'Name', Object],
+ [opensocial, 'NavigationParameters', Object],
+ [opensocial, 'Organization', Object],
+ [opensocial, 'Person', Object],
+ [opensocial, 'Phone', Object],
+ [opensocial, 'ResponseItem', Object],
+ [opensocial, 'Url', Object]
+ ]);
+ caja___.whitelistMeths([
+ [opensocial.Activity, 'getField'],
+ [opensocial.Activity, 'getId'],
+ [opensocial.Activity, 'setField'],
+ [opensocial.Address, 'getField'],
+ [opensocial.BodyType, 'getField'],
+ [opensocial.Container, 'getEnvironment'],
+ [opensocial.Container, 'requestSendMessage'],
+ [opensocial.Container, 'requestShareApp'],
+ [opensocial.Container, 'requestCreateActivity'],
+ [opensocial.Container, 'hasPermission'],
+ [opensocial.Container, 'requestPermission'],
+ [opensocial.Container, 'requestData'],
+ [opensocial.Container, 'newFetchPersonRequest'],
+ [opensocial.Container, 'newFetchPeopleRequest'],
+ [opensocial.Container, 'newFetchPersonAppDataRequest'],
+ [opensocial.Container, 'newUpdatePersonAppDataRequest'],
+ [opensocial.Container, 'newRemovePersonAppDataRequest'],
+ [opensocial.Container, 'newFetchActivitiesRequest'],
+ [opensocial.Container, 'newFetchMessageCollectionsRequest'],
+ [opensocial.Container, 'newFetchMessagesRequest'],
+ [opensocial.Container, 'newCollection'],
+ [opensocial.Container, 'newPerson'],
+ [opensocial.Container, 'newActivity'],
+ [opensocial.Container, 'newMediaItem'],
+ [opensocial.Container, 'newMessage'],
+ [opensocial.Container, 'newIdSpec'],
+ [opensocial.Container, 'newNavigationParameters'],
+ [opensocial.Container, 'newResponseItem'],
+ [opensocial.Container, 'newDataResponse'],
+ [opensocial.Container, 'newDataRequest'],
+ [opensocial.Container, 'newEnvironment'],
+ [opensocial.Container, 'invalidateCache'],
+ [opensocial.Collection, 'asArray'],
+ [opensocial.Collection, 'each'],
+ [opensocial.Collection, 'getById'],
+ [opensocial.Collection, 'getOffset'],
+ [opensocial.Collection, 'getTotalSize'],
+ [opensocial.Collection, 'size'],
+ [opensocial.DataRequest, 'add'],
+ [opensocial.DataRequest, 'newFetchActivitiesRequest'],
+ [opensocial.DataRequest, 'newFetchPeopleRequest'],
+ [opensocial.DataRequest, 'newFetchPersonAppDataRequest'],
+ [opensocial.DataRequest, 'newFetchPersonRequest'],
+ [opensocial.DataRequest, 'newRemovePersonAppDataRequest'],
+ [opensocial.DataRequest, 'newUpdatePersonAppDataRequest'],
+ [opensocial.DataRequest, 'send'],
+ [opensocial.DataResponse, 'get'],
+ [opensocial.DataResponse, 'getErrorMessage'],
+ [opensocial.DataResponse, 'hadError'],
+ [opensocial.Email, 'getField'],
+ [opensocial.Enum, 'getDisplayValue'],
+ [opensocial.Enum, 'getKey'],
+ [opensocial.Environment, 'getDomain'],
+ [opensocial.Environment, 'supportsField'],
+ [opensocial.IdSpec, 'getField'],
+ [opensocial.IdSpec, 'setField'],
+ [opensocial.MediaItem, 'getField'],
+ [opensocial.MediaItem, 'setField'],
+ [opensocial.Message, 'getField'],
+ [opensocial.Message, 'setField'],
+ [opensocial.Name, 'getField'],
+ [opensocial.NavigationParameters, 'getField'],
+ [opensocial.NavigationParameters, 'setField'],
+ [opensocial.Organization, 'getField'],
+ [opensocial.Person, 'getDisplayName'],
+ [opensocial.Person, 'getField'],
+ [opensocial.Person, 'getId'],
+ [opensocial.Person, 'isOwner'],
+ [opensocial.Person, 'isViewer'],
+ [opensocial.Phone, 'getField'],
+ [opensocial.ResponseItem, 'getData'],
+ [opensocial.ResponseItem, 'getErrorCode'],
+ [opensocial.ResponseItem, 'getErrorMessage'],
+ [opensocial.ResponseItem, 'getOriginalDataRequest'],
+ [opensocial.ResponseItem, 'hadError'],
+ [opensocial.Url, 'getField']
+ ]);
+ caja___.whitelistFuncs([
+ [opensocial.Container, 'setContainer'],
+ [opensocial.Container, 'get'],
+ [opensocial.Container, 'getField'],
+ [opensocial, 'getEnvironment'],
+ [opensocial, 'hasPermission'],
+ [opensocial, 'newActivity'],
+ [opensocial, 'newDataRequest'],
+ [opensocial, 'newIdSpec'],
+ [opensocial, 'newMediaItem'],
+ [opensocial, 'newMessage'],
+ [opensocial, 'newNavigationParameters'],
+ [opensocial, 'requestCreateActivity'],
+ [opensocial, 'requestPermission'],
+ [opensocial, 'requestSendMessage'],
+ [opensocial, 'requestShareApp']
+ ]);
+});
Added: incubator/shindig/trunk/features/src/main/javascript/features/osapi/taming.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/osapi/taming.js?rev=831107&view=auto
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/osapi/taming.js (added)
+++ incubator/shindig/trunk/features/src/main/javascript/features/osapi/taming.js Thu Oct 29 21:48:56 2009
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * @class
+ * Tame and expose core osapi.* API to cajoled gadgets
+ */
+var tamings___ = tamings___ || [];
+tamings___.push(function(imports) {
+
+ ___.tamesTo(osapi.newBatch, ___.markFuncFreeze(function () {
+ var result = osapi.newBatch();
+ ___.markInnocent(result['add'], 'add');
+ ___.markInnocent(result['execute'], 'execute');
+ return ___.tame(result);
+ }));
+
+ // OSAPI functions are marked as simple funcs as they are registered
+ imports.outers.osapi = ___.tame(osapi);
+ ___.grantRead(imports.outers, 'osapi');
+
+ // Forced to tame in an onload handler because peoplehelpers does
+ // not define some functions till runOnLoadHandlers runs
+ var savedImports = imports;
+ gadgets.util.registerOnLoadHandler(function() {
+ if (osapi && osapi.people && osapi.people.get) {
+ caja___.whitelistFuncs([
+ [osapi.people, 'getViewer'],
+ [osapi.people, 'getViewerFriends'],
+ [osapi.people, 'getOwner'],
+ [osapi.people, 'getOwnerFriends']
+ ]);
+ // Careful not to clobber osapi.people which already has tamed functions on it
+ savedImports.outers.osapi.people.getViewer = ___.tame(osapi.people.getViewer);
+ savedImports.outers.osapi.people.getViewerFriends = ___.tame(osapi.people.getViewerFriends);
+ savedImports.outers.osapi.people.getOwner = ___.tame(osapi.people.getOwner);
+ savedImports.outers.osapi.people.getOwnerFriends = ___.tame(osapi.people.getOwnerFriends);
+ }
+ });
+
+});
Added: incubator/shindig/trunk/features/src/main/javascript/features/pubsub/taming.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/pubsub/taming.js?rev=831107&view=auto
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/pubsub/taming.js (added)
+++ incubator/shindig/trunk/features/src/main/javascript/features/pubsub/taming.js Thu Oct 29 21:48:56 2009
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * @class
+ * Tame and expose core gadgets.pubsub.* API to cajoled gadgets
+ */
+var tamings___ = tamings___ || [];
+tamings___.push(function(imports) {
+ caja___.whitelistFuncs([
+ [gadgets.pubsub, 'publish'],
+ [gadgets.pubsub, 'subscribe'],
+ [gadgets.pubsub, 'unsubscribe']
+ ]);
+});
Added: incubator/shindig/trunk/features/src/main/javascript/features/settitle/taming.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/settitle/taming.js?rev=831107&view=auto
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/settitle/taming.js (added)
+++ incubator/shindig/trunk/features/src/main/javascript/features/settitle/taming.js Thu Oct 29 21:48:56 2009
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * @class
+ * Tame and expose gadgets.window.setTitle to cajoled gadgets
+ */
+
+var tamings___ = tamings___ || [];
+tamings___.push(function(imports) {
+ caja___.whitelistFuncs([
+ [gadgets.window, 'setTitle']
+ ]);
+});
Added: incubator/shindig/trunk/features/src/main/javascript/features/skins/taming.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/skins/taming.js?rev=831107&view=auto
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/skins/taming.js (added)
+++ incubator/shindig/trunk/features/src/main/javascript/features/skins/taming.js Thu Oct 29 21:48:56 2009
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * @class
+ * Tame and expose core gadgets.skin.* API to cajoled gadgets
+ */
+var tamings___ = tamings___ || [];
+tamings___.push(function(imports) {
+ caja___.whitelistFuncs([
+ [gadgets.skins, 'getProperty']
+ ]);
+});
Added: incubator/shindig/trunk/features/src/main/javascript/features/tabs/taming.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/tabs/taming.js?rev=831107&view=auto
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/tabs/taming.js (added)
+++ incubator/shindig/trunk/features/src/main/javascript/features/tabs/taming.js Thu Oct 29 21:48:56 2009
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * @class
+ * Tame and expose gadgets.Tabs and gadgets.TabSet API to cajoled gadgets
+ */
+
+var tamings___ = tamings___ || [];
+tamings___.push(function(imports) {
+ caja___.whitelistMeths([
+ [gadgets.Tab, 'getCallback'],
+ [gadgets.Tab, 'getContentContainer'],
+ [gadgets.Tab, 'getIndex'],
+ [gadgets.Tab, 'getName'],
+ [gadgets.Tab, 'getNameContainer'],
+
+ [gadgets.TabSet, 'addTab'],
+ [gadgets.TabSet, 'alignTabs'],
+ [gadgets.TabSet, 'displayTabs'],
+ [gadgets.TabSet, 'getHeaderContainer'],
+ [gadgets.TabSet, 'getSelectedTab'],
+ [gadgets.TabSet, 'getTabs'],
+ [gadgets.TabSet, 'removeTab'],
+ [gadgets.TabSet, 'setSelectedTab'],
+ [gadgets.TabSet, 'swapTabs']
+ ]);
+ caja___.whitelistCtors([
+ [gadgets, 'TabSet'],
+ ]);
+});
Added: incubator/shindig/trunk/features/src/main/javascript/features/views/taming.js
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/views/taming.js?rev=831107&view=auto
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/views/taming.js (added)
+++ incubator/shindig/trunk/features/src/main/javascript/features/views/taming.js Thu Oct 29 21:48:56 2009
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * @class
+ * Tame and expose core gadgets.views.* API to cajoled gadgets
+ */
+var tamings___ = tamings___ || [];
+tamings___.push(function(imports) {
+ caja___.whitelistCtors([
+ [gadgets.views, 'View', Object]
+ ]);
+ caja___.whitelistMeths([
+ [gadgets.views.View, 'bind'],
+ [gadgets.views.View, 'getUrlTemplate'],
+ [gadgets.views.View, 'isOnlyVisibleGadget'],
+ [gadgets.views.View, 'getName']
+ ]);
+ caja___.whitelistFuncs([
+ [gadgets.views, 'getCurrentView'],
+ [gadgets.views, 'getParams'],
+ [gadgets.views, 'requestNavigateTo']
+ ]);
+});