You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by ja...@apache.org on 2010/01/16 22:11:10 UTC
svn commit: r900027 - in /incubator/shindig/trunk:
features/src/main/javascript/features/flash/taming.js
javascript/samplecontainer/examples/FlashCajaExample.xml
Author: jasvir
Date: Sat Jan 16 21:11:09 2010
New Revision: 900027
URL: http://svn.apache.org/viewvc?rev=900027&view=rev
Log:
* Adds a simple example of flash being used in a Caja gadget
* Corrects a minor bug in the flash taming
Added:
incubator/shindig/trunk/javascript/samplecontainer/examples/FlashCajaExample.xml
Modified:
incubator/shindig/trunk/features/src/main/javascript/features/flash/taming.js
Modified: 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=900027&r1=900026&r2=900027&view=diff
==============================================================================
--- incubator/shindig/trunk/features/src/main/javascript/features/flash/taming.js (original)
+++ incubator/shindig/trunk/features/src/main/javascript/features/flash/taming.js Sat Jan 16 21:11:09 2010
@@ -23,7 +23,7 @@
*/
var tamings___ = tamings___ || [];
tamings___.push(function(imports) {
- ___.tamesTo(gadgets.flash.embedFlash, function () {
+ ___.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
@@ -121,7 +121,7 @@
})(channel)
});
});
- });
+ })());
var d = document.createElement('div');
d.appendChild(document.createTextNode("bridge"));
Added: incubator/shindig/trunk/javascript/samplecontainer/examples/FlashCajaExample.xml
URL: http://svn.apache.org/viewvc/incubator/shindig/trunk/javascript/samplecontainer/examples/FlashCajaExample.xml?rev=900027&view=auto
==============================================================================
--- incubator/shindig/trunk/javascript/samplecontainer/examples/FlashCajaExample.xml (added)
+++ incubator/shindig/trunk/javascript/samplecontainer/examples/FlashCajaExample.xml Sat Jan 16 21:11:09 2010
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Module>
+ <ModulePrefs title="Flash Caja Demo"
+ height="200"
+ description="Demonstrates the use of caja to protect flash gadgets">
+ <Require feature="caja"></Require>
+ <Require feature="flash"></Require>
+ <Require feature="dynamic-height"></Require>
+ </ModulePrefs>
+ <Content type="html">
+ <![CDATA[
+
+ Caja does not allow <code>object</code> or <code>embed</code> tags
+ in HTML. However, Shindig provides a tamed JavaScript API for
+ embedding flash on a page. To embed a flash file, use
+ <code>Require feature="flash"</code> in your
+ ModulePrefs and <code>gadges.flash.embedFlash</code> in the body of
+ your gadget to embed flash.
+<p>
+For example, here is a YouTube video.
+<p>
+ <div id="ytapiplayer">
+ You need Flash player 10 and JavaScript enabled to view this video.
+ </div>
+ <script type="text/javascript">
+ var success = gadgets.flash.embedFlash(
+ "http://www.youtube.com/v/0AqMb-edXlc", // Flash video
+ "ytapiplayer", // id of div to place flash object
+ "10" // minimum version
+ );
+ </script>
+<script>gadgets.window.adjustHeight();</script>
+ ]]>
+ </Content>
+</Module>