Author: johnh Date: Wed Nov 4 19:09:30 2009 New Revision: 832845 URL: http://svn.apache.org/viewvc?rev=832845&view=rev Log: Re-taming core JS.
Added: incubator/shindig/trunk/features/src/main/javascript/features/core.json/taming.js incubator/shindig/trunk/features/src/main/javascript/features/core.log/taming.js incubator/shindig/trunk/features/src/main/javascript/features/core.prefs/taming.js incubator/shindig/trunk/features/src/main/javascript/features/core.util/taming.js Removed: incubator/shindig/trunk/features/src/main/javascript/features/core/taming.js Modified: incubator/shindig/trunk/features/src/main/javascript/features/core.json/feature.xml incubator/shindig/trunk/features/src/main/javascript/features/core.log/feature.xml incubator/shindig/trunk/features/src/main/javascript/features/core.prefs/feature.xml incubator/shindig/trunk/features/src/main/javascript/features/core.util/feature.xml Modified: incubator/shindig/trunk/features/src/main/javascript/features/core.json/feature.xml URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/core.json/feature.xml?rev=832845&r1=832844&r2=832845&view=diff ============================================================================== --- incubator/shindig/trunk/features/src/main/javascript/features/core.json/feature.xml (original) +++ incubator/shindig/trunk/features/src/main/javascript/features/core.json/feature.xml Wed Nov 4 19:09:30 2009 @@ -20,8 +20,10 @@ <name>core.json</name> <gadget> <script src="json.js"/> + <script src="taming.js"/> </gadget> <container> <script src="json.js"/> + <script src="taming.js"/> </container> </feature> Added: incubator/shindig/trunk/features/src/main/javascript/features/core.json/taming.js URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/core.json/taming.js?rev=832845&view=auto ============================================================================== --- incubator/shindig/trunk/features/src/main/javascript/features/core.json/taming.js (added) +++ incubator/shindig/trunk/features/src/main/javascript/features/core.json/taming.js Wed Nov 4 19:09:30 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 core gadgets.* API to cajoled gadgets + */ +var tamings___ = tamings___ || []; +tamings___.push(function(imports) { + caja___.whitelistFuncs([ + [gadgets.json, 'parse'], + [gadgets.json, 'stringify'] + ]); +}); Modified: incubator/shindig/trunk/features/src/main/javascript/features/core.log/feature.xml URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/core.log/feature.xml?rev=832845&r1=832844&r2=832845&view=diff ============================================================================== --- incubator/shindig/trunk/features/src/main/javascript/features/core.log/feature.xml (original) +++ incubator/shindig/trunk/features/src/main/javascript/features/core.log/feature.xml Wed Nov 4 19:09:30 2009 @@ -20,8 +20,10 @@ <name>core.log</name> <gadget> <script src="log.js"/> + <script src="taming.js"/> </gadget> <container> <script src="log.js"/> + <script src="taming.js"/> </container> </feature> Added: incubator/shindig/trunk/features/src/main/javascript/features/core.log/taming.js URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/core.log/taming.js?rev=832845&view=auto ============================================================================== --- incubator/shindig/trunk/features/src/main/javascript/features/core.log/taming.js (added) +++ incubator/shindig/trunk/features/src/main/javascript/features/core.log/taming.js Wed Nov 4 19:09:30 2009 @@ -0,0 +1,37 @@ +/* + * 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___.whitelistFuncs([ + [gadgets, 'log'], + [gadgets, 'warn'], + [gadgets, 'error'], + [gadgets, 'setLogLevel'], + [gadgets.log, 'logAtLevel'], + ]); +}); Modified: incubator/shindig/trunk/features/src/main/javascript/features/core.prefs/feature.xml URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/core.prefs/feature.xml?rev=832845&r1=832844&r2=832845&view=diff ============================================================================== --- incubator/shindig/trunk/features/src/main/javascript/features/core.prefs/feature.xml (original) +++ incubator/shindig/trunk/features/src/main/javascript/features/core.prefs/feature.xml Wed Nov 4 19:09:30 2009 @@ -21,5 +21,6 @@ <dependency>core.util</dependency> <gadget> <script src="prefs.js"/> + <script src="taming.js"/> </gadget> </feature> Added: incubator/shindig/trunk/features/src/main/javascript/features/core.prefs/taming.js URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/core.prefs/taming.js?rev=832845&view=auto ============================================================================== --- incubator/shindig/trunk/features/src/main/javascript/features/core.prefs/taming.js (added) +++ incubator/shindig/trunk/features/src/main/javascript/features/core.prefs/taming.js Wed Nov 4 19:09:30 2009 @@ -0,0 +1,41 @@ +/* + * 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) { + 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'] + ]); +}); Modified: incubator/shindig/trunk/features/src/main/javascript/features/core.util/feature.xml URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/core.util/feature.xml?rev=832845&r1=832844&r2=832845&view=diff ============================================================================== --- incubator/shindig/trunk/features/src/main/javascript/features/core.util/feature.xml (original) +++ incubator/shindig/trunk/features/src/main/javascript/features/core.util/feature.xml Wed Nov 4 19:09:30 2009 @@ -21,8 +21,10 @@ <dependency>core.config</dependency> <gadget> <script src="util.js"/> + <script src="taming.js"/> </gadget> <container> <script src="util.js"/> + <script src="taming.js"/> </container> </feature> Added: incubator/shindig/trunk/features/src/main/javascript/features/core.util/taming.js URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/features/src/main/javascript/features/core.util/taming.js?rev=832845&view=auto ============================================================================== --- incubator/shindig/trunk/features/src/main/javascript/features/core.util/taming.js (added) +++ incubator/shindig/trunk/features/src/main/javascript/features/core.util/taming.js Wed Nov 4 19:09:30 2009 @@ -0,0 +1,33 @@ +/* + * 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) { + caja___.whitelistFuncs([ + [gadgets.util, 'escapeString'], + [gadgets.util, 'getFeatureParameters'], + [gadgets.util, 'hasFeature'], + [gadgets.util, 'registerOnLoadHandler'], + [gadgets.util, 'unescapeString'] + ]); +});