diff options
Diffstat (limited to 'js/dojo-1.6/dojox/embed')
| -rw-r--r-- | js/dojo-1.6/dojox/embed/Flash.js | 552 | ||||
| -rw-r--r-- | js/dojo-1.6/dojox/embed/Flash.xd.js | 556 | ||||
| -rw-r--r-- | js/dojo-1.6/dojox/embed/IE/flash.js | 26 | ||||
| -rw-r--r-- | js/dojo-1.6/dojox/embed/IE/flash.xd.js | 30 | ||||
| -rw-r--r-- | js/dojo-1.6/dojox/embed/Object.js | 116 | ||||
| -rw-r--r-- | js/dojo-1.6/dojox/embed/Object.xd.js | 123 | ||||
| -rw-r--r-- | js/dojo-1.6/dojox/embed/Quicktime.js | 274 | ||||
| -rw-r--r-- | js/dojo-1.6/dojox/embed/Quicktime.xd.js | 278 | ||||
| -rw-r--r-- | js/dojo-1.6/dojox/embed/README | 44 | ||||
| -rw-r--r-- | js/dojo-1.6/dojox/embed/flashVars.js | 66 | ||||
| -rw-r--r-- | js/dojo-1.6/dojox/embed/flashVars.xd.js | 70 | ||||
| -rw-r--r-- | js/dojo-1.6/dojox/embed/resources/version.mov | bin | 0 -> 1667 bytes |
12 files changed, 2135 insertions, 0 deletions
diff --git a/js/dojo-1.6/dojox/embed/Flash.js b/js/dojo-1.6/dojox/embed/Flash.js new file mode 100644 index 0000000..97a34ab --- /dev/null +++ b/js/dojo-1.6/dojox/embed/Flash.js @@ -0,0 +1,552 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.embed.Flash"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.embed.Flash"] = true;
+dojo.provide("dojox.embed.Flash");
+
+(function(){
+ /*******************************************************
+ dojox.embed.Flash
+
+ Base functionality to insert a flash movie into
+ a document on the fly.
+
+ Usage:
+ var movie=new dojox.embed.Flash({ args }, containerNode);
+ ******************************************************/
+ var fMarkup, fVersion;
+ var minimumVersion = 9; // anything below this will throw an error (may overwrite)
+ var keyBase = "dojox-embed-flash-", keyCount=0;
+ var _baseKwArgs = {
+ expressInstall: false,
+ width: 320,
+ height: 240,
+ swLiveConnect: "true",
+ allowScriptAccess: "sameDomain",
+ allowNetworking:"all",
+ style: null,
+ redirect: null
+ };
+
+ function prep(kwArgs){
+ // console.warn("KWARGS:", kwArgs)
+ kwArgs = dojo.delegate(_baseKwArgs, kwArgs);
+
+ if(!("path" in kwArgs)){
+ console.error("dojox.embed.Flash(ctor):: no path reference to a Flash movie was provided.");
+ return null;
+ }
+
+ if(!("id" in kwArgs)){
+ kwArgs.id = (keyBase + keyCount++);
+ }
+ return kwArgs;
+ }
+
+ if(dojo.isIE){
+ fMarkup = function(kwArgs){
+ kwArgs = prep(kwArgs);
+ if(!kwArgs){ return null; }
+
+ var p;
+ var path = kwArgs.path;
+ if(kwArgs.vars){
+ var a = [];
+ for(p in kwArgs.vars){
+ a.push(p + '=' + kwArgs.vars[p]);
+ }
+ kwArgs.params.FlashVars = a.join("&");
+ delete kwArgs.vars;
+ }
+ // FIXME: really? +'s?
+ var s = '<object id="' + kwArgs.id + '" '
+ + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
+ + 'width="' + kwArgs.width + '" '
+ + 'height="' + kwArgs.height + '"'
+ + ((kwArgs.style)?' style="' + kwArgs.style + '"':'')
+ + '>'
+ + '<param name="movie" value="' + path + '" />';
+ if(kwArgs.params){
+ for(p in kwArgs.params){
+ s += '<param name="' + p + '" value="' + kwArgs.params[p] + '" />';
+ }
+ }
+ s += '</object>';
+ return { id: kwArgs.id, markup: s };
+ };
+
+ fVersion = (function(){
+ var testVersion = 10, testObj = null;
+ while(!testObj && testVersion > 7){
+ try {
+ testObj = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + testVersion--);
+ }catch(e){ }
+ }
+ if(testObj){
+ var v = testObj.GetVariable("$version").split(" ")[1].split(",");
+ return {
+ major: (v[0]!=null) ? parseInt(v[0]) : 0,
+ minor: (v[1]!=null) ? parseInt(v[1]) : 0,
+ rev: (v[2]!=null) ? parseInt(v[2]) : 0
+ };
+ }
+ return { major: 0, minor: 0, rev: 0 };
+ })();
+
+ // attach some cleanup for IE, thanks to deconcept :)
+ dojo.addOnUnload(function(){
+ var dummy = function(){};
+ var objs = dojo.query("object").
+ reverse().
+ style("display", "none").
+ forEach(function(i){
+ for(var p in i){
+ if((p != "FlashVars") && dojo.isFunction(i[p])){
+ try{
+ i[p] = dummy;
+ }catch(e){}
+ }
+ }
+ });
+ });
+
+ // TODO: ...and double check this fix; is IE really firing onbeforeunload with any kind of href="#" link?
+ /*
+ var beforeUnloadHandle = dojo.connect(dojo.global, "onbeforeunload", function(){
+ try{
+ if(__flash_unloadHandler){ __flash_unloadHandler=function(){ }; }
+ if(__flash_savedUnloadHandler){ __flash_savedUnloadHandler=function(){ }; }
+ } catch(e){ }
+ dojo.disconnect(beforeUnloadHandle);
+ });
+ */
+ } else {
+ // *** Sane browsers branch ******************************************************************
+ fMarkup = function(kwArgs){
+ kwArgs = prep(kwArgs);
+ if(!kwArgs){ return null; }
+
+ var p;
+ var path = kwArgs.path;
+ if(kwArgs.vars){
+ var a = [];
+ for(p in kwArgs.vars){
+ a.push(p + '=' + kwArgs.vars[p]);
+ }
+ kwArgs.params.flashVars = a.join("&");
+ delete kwArgs.vars;
+ }
+ var s = '<embed type="application/x-shockwave-flash" '
+ + 'src="' + path + '" '
+ + 'id="' + kwArgs.id + '" '
+ + 'width="' + kwArgs.width + '" '
+ + 'height="' + kwArgs.height + '"'
+ + ((kwArgs.style)?' style="' + kwArgs.style + '" ':'')
+
+ + 'pluginspage="' + window.location.protocol + '//www.adobe.com/go/getflashplayer" ';
+ if(kwArgs.params){
+ for(p in kwArgs.params){
+ s += ' ' + p + '="' + kwArgs.params[p] + '"';
+ }
+ }
+ s += ' />';
+ return { id: kwArgs.id, markup: s };
+ };
+
+ fVersion=(function(){
+ var plugin = navigator.plugins["Shockwave Flash"];
+ if(plugin && plugin.description){
+ var v = plugin.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".");
+ return {
+ major: (v[0]!=null) ? parseInt(v[0]) : 0,
+ minor: (v[1]!=null) ? parseInt(v[1]) : 0,
+ rev: (v[2]!=null) ? parseInt(v[2]) : 0
+ };
+ }
+ return { major: 0, minor: 0, rev: 0 };
+ })();
+ }
+
+
+/*=====
+dojox.embed.__flashArgs = function(path, id, width, height, style, params, vars, expressInstall, redirect){
+ // path: String
+ // The URL of the movie to embed.
+ // id: String?
+ // A unique key that will be used as the id of the created markup. If you don't
+ // provide this, a unique key will be generated.
+ // width: Number?
+ // The width of the embedded movie; the default value is 320px.
+ // height: Number?
+ // The height of the embedded movie; the default value is 240px
+ // minimumVersion: Number ?
+ // The minimum targeted version of the Flash Player (defaults to 9)
+ // style: String?
+ // Any CSS style information (i.e. style="background-color:transparent") you want
+ // to define on the markup.
+ // params: Object?
+ // A set of key/value pairs that you want to define in the resultant markup.
+ // vars: Object?
+ // A set of key/value pairs that the Flash movie will interpret as FlashVars.
+ // expressInstall: Boolean?
+ // Whether or not to include any kind of expressInstall info. Default is false.
+ // redirect: String?
+ // A url to redirect the browser to if the current Flash version is not supported.
+ this.id=id;
+ this.path=path;
+ this.width=width;
+ this.minimumVersion=minimumVersion;
+ this.height=height;
+ this.style=style;
+ this.params=params;
+ this.vars=vars;
+ this.expressInstall=expressInstall;
+ this.redirect=redirect;
+}
+=====*/
+
+ // the main entry point
+ dojox.embed.Flash = function(/*dojox.embed.__flashArgs*/ kwArgs, /*DOMNode*/ node){
+ // summary:
+ // Create a wrapper object around a Flash movie; this is the DojoX equivilent
+ // to SWFObject.
+ //
+ // description:
+ // Creates a wrapper object around a Flash movie. Wrapper object will
+ // insert the movie reference in node; when the browser first starts
+ // grabbing the movie, onReady will be fired; when the movie has finished
+ // loading, it will fire onLoad.
+ //
+ // If your movie uses ExternalInterface, you should use the onLoad event
+ // to do any kind of proxy setup (see dojox.embed.Flash.proxy); this seems
+ // to be the only consistent time calling EI methods are stable (since the
+ // Flash movie will shoot several methods into the window object before
+ // EI callbacks can be used properly).
+ //
+ // *Important note*: this code includes a workaround for the Eolas "fix" from
+ // Microsoft; in order to work around the "click to activate this control" message
+ // on any embedded Flash movie, this code will load a separate, non-dojo.require
+ // javascript file in order to write the Flash movie into the document. As such
+ // it cannot be used with Dojo's scope map techniques for working with multiple
+ // versions of Dojo on the same page.
+ //
+ // kwArgs: dojox.embed.__flashArgs
+ // The various arguments that will be used to help define the Flash movie.
+ // node: DomNode
+ // The node where the embed object will be placed
+ //
+ // example:
+ // Embed a flash movie in a document using the new operator, and get a reference to it.
+ // | var movie = new dojox.embed.Flash({
+ // | path: "path/to/my/movie.swf",
+ // | width: 400,
+ // | height: 300
+ // | }, myWrapperNode, "testLoaded");
+ //
+ // example:
+ // Embed a flash movie in a document without using the new operator.
+ // | var movie = dojox.embed.Flash({
+ // | path: "path/to/my/movie.swf",
+ // | width: 400,
+ // | height: 300,
+ // | style: "position:absolute;top:0;left:0"
+ // | }, myWrapperNode, "testLoaded");
+ //
+ // File can only be run from a server, due to SWF dependency.
+ if(location.href.toLowerCase().indexOf("file://")>-1){
+ throw new Error("dojox.embed.Flash can't be run directly from a file. To instatiate the required SWF correctly it must be run from a server, like localHost.");
+ }
+
+ // available: Number
+ // If there is a flash player available, and if so what version.
+ this.available = dojox.embed.Flash.available;
+
+ // minimumVersion: Number
+ // The minimum version of Flash required to run this movie.
+ this.minimumVersion = kwArgs.minimumVersion || minimumVersion;
+ //console.log("AVAILABLE:", this);
+
+ // id: String
+ // The id of the DOMNode to be used for this movie. Can be used with dojo.byId to get a reference.
+ this.id = null;
+
+ // movie: FlashObject
+ // A reference to the movie itself.
+ this.movie = null;
+
+ // domNode: DOMNode
+ // A reference to the DOMNode that contains this movie.
+ this.domNode = null;
+ if(node){
+ node = dojo.byId(node);
+ }
+ // setTimeout Fixes #8743 - creating double SWFs
+ // also allows time for code to attach to onError
+ setTimeout(dojo.hitch(this, function(){
+ if(kwArgs.expressInstall || this.available && this.available >= this.minimumVersion){
+ if(kwArgs && node){
+ this.init(kwArgs, node);
+ }else{
+ this.onError("embed.Flash was not provided with the proper arguments.");
+ }
+ }else{
+ if(!this.available){
+ this.onError("Flash is not installed.");
+ }else{
+ this.onError("Flash version detected: "+this.available+" is out of date. Minimum required: "+this.minimumVersion);
+ }
+ }
+ }), 100);
+ };
+
+ dojo.extend(dojox.embed.Flash, {
+ onReady: function(/*HTMLObject*/ movie){
+ console.warn("embed.Flash.movie.onReady:", movie)
+ // summary:
+ // Stub function for you to attach to when the movie reference is first
+ // pushed into the document.
+ },
+ onLoad: function(/*HTMLObject*/ movie){
+ console.warn("embed.Flash.movie.onLoad:", movie)
+ // summary:
+ // Stub function for you to attach to when the movie has finished downloading
+ // and is ready to be manipulated.
+ },
+ onError: function(msg){
+
+ },
+ _onload: function(){
+ // summary:
+ // Internal. Cleans up before calling onLoad.
+ clearInterval(this._poller);
+ delete this._poller;
+ delete this._pollCount;
+ delete this._pollMax;
+ this.onLoad(this.movie);
+ },
+ init: function(/*dojox.embed.__flashArgs*/ kwArgs, /*DOMNode?*/ node){
+ console.log("embed.Flash.movie.init")
+ // summary
+ // Initialize (i.e. place and load) the movie based on kwArgs.
+ this.destroy(); // ensure we are clean first.
+ node = dojo.byId(node || this.domNode);
+ if(!node){ throw new Error("dojox.embed.Flash: no domNode reference has been passed."); }
+
+ // vars to help determine load status
+ var p = 0, testLoaded=false;
+ this._poller = null; this._pollCount = 0; this._pollMax = 15; this.pollTime = 100;
+
+ if(dojox.embed.Flash.initialized){
+
+ this.id = dojox.embed.Flash.place(kwArgs, node);
+ this.domNode = node;
+
+ setTimeout(dojo.hitch(this, function(){
+ this.movie = this.byId(this.id, kwArgs.doc);
+ this.onReady(this.movie);
+
+ this._poller = setInterval(dojo.hitch(this, function(){
+
+ // catch errors if not quite ready.
+ try{
+ p = this.movie.PercentLoaded();
+ }catch(e){
+ /* squelch */
+ console.warn("this.movie.PercentLoaded() failed");
+ }
+
+ if(p == 100){
+ // if percent = 100, movie is fully loaded and we're communicating
+ this._onload();
+
+ }else if(p==0 && this._pollCount++ > this._pollMax){
+ // after several attempts, we're not past zero.
+ // FIXME: What if we get stuck on 33% or something?
+ clearInterval(this._poller);
+ throw new Error("Building SWF failed.");
+ }
+ }), this.pollTime);
+ }), 1);
+ }
+ },
+ _destroy: function(){
+ // summary
+ // Kill the movie and reset all the properties of this object.
+ try{
+ this.domNode.removeChild(this.movie);
+ }catch(e){}
+ this.id = this.movie = this.domNode = null;
+ },
+ destroy: function(){
+ // summary
+ // Public interface for destroying all the properties in this object.
+ // Will also clean all proxied methods.
+ if(!this.movie){ return; }
+
+ // remove any proxy functions
+ var test = dojo.delegate({
+ id: true,
+ movie: true,
+ domNode: true,
+ onReady: true,
+ onLoad: true
+ });
+ for(var p in this){
+ if(!test[p]){
+ delete this[p];
+ }
+ }
+
+ // poll the movie
+ if(this._poller){
+ // wait until onLoad to destroy
+ dojo.connect(this, "onLoad", this, "_destroy");
+ } else {
+ this._destroy();
+ }
+ },
+ byId: function (movieName, doc){
+ // summary:
+ // Gets Flash movie by id.
+ // description:
+ // Probably includes methods for outdated
+ // browsers, but this should catch all cases.
+ // arguments:
+ // movieName: String
+ // The name of the SWF
+ // doc: Object
+ // The document, if not current window
+ // (not fully supported)
+ // example:
+ // | var movie = dojox.embed.Flash.byId("myId");
+ //
+ doc = doc || document;
+ if(doc.embeds[movieName]){
+ return doc.embeds[movieName];
+ }
+ if(doc[movieName]){
+ return doc[movieName];
+ }
+ if(window[movieName]){
+ return window[movieName];
+ }
+ if(document[movieName]){
+ return document[movieName];
+ }
+ return null;
+ }
+ });
+
+ // expose information through the constructor function itself.
+ dojo.mixin(dojox.embed.Flash, {
+ // summary:
+ // A singleton object used internally to get information
+ // about the Flash player available in a browser, and
+ // as the factory for generating and placing markup in a
+ // document.
+ //
+ // minSupported: Number
+ // The minimum supported version of the Flash Player, defaults to 8.
+ // available: Number
+ // Used as both a detection (i.e. if(dojox.embed.Flash.available){ })
+ // and as a variable holding the major version of the player installed.
+ // supported: Boolean
+ // Whether or not the Flash Player installed is supported by dojox.embed.
+ // version: Object
+ // The version of the installed Flash Player; takes the form of
+ // { major, minor, rev }. To get the major version, you'd do this:
+ // var v=dojox.embed.Flash.version.major;
+ // initialized: Boolean
+ // Whether or not the Flash engine is available for use.
+ // onInitialize: Function
+ // A stub you can connect to if you are looking to fire code when the
+ // engine becomes available. A note: DO NOT use this event to
+ // place a movie in a document; it will usually fire before DOMContentLoaded
+ // is fired, and you will get an error. Use dojo.addOnLoad instead.
+ minSupported : 8,
+ available: fVersion.major,
+ supported: (fVersion.major >= fVersion.required),
+ minimumRequired: fVersion.required,
+ version: fVersion,
+ initialized: false,
+ onInitialize: function(){
+ dojox.embed.Flash.initialized = true;
+ },
+ __ie_markup__: function(kwArgs){
+ return fMarkup(kwArgs);
+ },
+ proxy: function(/*dojox.embed.Flash*/ obj, /*Array|String*/ methods){
+ // summary:
+ // Create the set of passed methods on the dojox.embed.Flash object
+ // so that you can call that object directly, as opposed to having to
+ // delve into the internal movie to do this. Intended to make working
+ // with Flash movies that use ExternalInterface much easier to use.
+ //
+ // example:
+ // Create "setMessage" and "getMessage" methods on foo.
+ // | var foo = new dojox.embed.Flash(args, someNode);
+ // | dojo.connect(foo, "onLoad", dojo.hitch(foo, function(){
+ // | dojox.embed.Flash.proxy(this, [ "setMessage", "getMessage" ]);
+ // | this.setMessage("dojox.embed.Flash.proxy is pretty cool...");
+ // | console.log(this.getMessage());
+ // | }));
+ dojo.forEach((dojo.isArray(methods) ? methods : [ methods ]), function(item){
+ this[item] = dojo.hitch(this, function(){
+ return (function(){
+ return eval(this.movie.CallFunction(
+ '<invoke name="' + item + '" returntype="javascript">'
+ + '<arguments>'
+ + dojo.map(arguments, function(item){
+ // FIXME:
+ // investigate if __flash__toXML will
+ // accept direct application via map()
+ // (e.g., does it ignore args past the
+ // first? or does it blow up?)
+ return __flash__toXML(item);
+ }).join("")
+ + '</arguments>'
+ + '</invoke>'
+ ));
+ }).apply(this, arguments||[]);
+ });
+ }, obj);
+ }
+ });
+
+ /*if(dojo.isIE){
+ // Ugh!
+ if(dojo._initFired){
+ var e = document.createElement("script");
+ e.type = "text/javascript";
+ e.src = dojo.moduleUrl("dojox", "embed/IE/flash.js");
+ document.getElementsByTagName("head")[0].appendChild(e);
+ }else{
+ // we can use document.write. What a kludge.
+ document.write('<scr'+'ipt type="text/javascript" src="' + dojo.moduleUrl("dojox", "embed/IE/flash.js") + '">'
+ + '</scr'+'ipt>');
+ }
+ }else{*/
+ dojox.embed.Flash.place = function(kwArgs, node){
+ var o = fMarkup(kwArgs);
+ node = dojo.byId(node);
+ if(!node){
+ node = dojo.doc.createElement("div");
+ node.id = o.id+"-container";
+ dojo.body().appendChild(node);
+ }
+ if(o){
+ node.innerHTML = o.markup;
+ return o.id;
+ }
+ return null;
+ }
+ dojox.embed.Flash.onInitialize();
+ //}
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/embed/Flash.xd.js b/js/dojo-1.6/dojox/embed/Flash.xd.js new file mode 100644 index 0000000..cdce229 --- /dev/null +++ b/js/dojo-1.6/dojox/embed/Flash.xd.js @@ -0,0 +1,556 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.embed.Flash"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.embed.Flash"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.embed.Flash"] = true;
+dojo.provide("dojox.embed.Flash");
+
+(function(){
+ /*******************************************************
+ dojox.embed.Flash
+
+ Base functionality to insert a flash movie into
+ a document on the fly.
+
+ Usage:
+ var movie=new dojox.embed.Flash({ args }, containerNode);
+ ******************************************************/
+ var fMarkup, fVersion;
+ var minimumVersion = 9; // anything below this will throw an error (may overwrite)
+ var keyBase = "dojox-embed-flash-", keyCount=0;
+ var _baseKwArgs = {
+ expressInstall: false,
+ width: 320,
+ height: 240,
+ swLiveConnect: "true",
+ allowScriptAccess: "sameDomain",
+ allowNetworking:"all",
+ style: null,
+ redirect: null
+ };
+
+ function prep(kwArgs){
+ // console.warn("KWARGS:", kwArgs)
+ kwArgs = dojo.delegate(_baseKwArgs, kwArgs);
+
+ if(!("path" in kwArgs)){
+ console.error("dojox.embed.Flash(ctor):: no path reference to a Flash movie was provided.");
+ return null;
+ }
+
+ if(!("id" in kwArgs)){
+ kwArgs.id = (keyBase + keyCount++);
+ }
+ return kwArgs;
+ }
+
+ if(dojo.isIE){
+ fMarkup = function(kwArgs){
+ kwArgs = prep(kwArgs);
+ if(!kwArgs){ return null; }
+
+ var p;
+ var path = kwArgs.path;
+ if(kwArgs.vars){
+ var a = [];
+ for(p in kwArgs.vars){
+ a.push(p + '=' + kwArgs.vars[p]);
+ }
+ kwArgs.params.FlashVars = a.join("&");
+ delete kwArgs.vars;
+ }
+ // FIXME: really? +'s?
+ var s = '<object id="' + kwArgs.id + '" '
+ + 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
+ + 'width="' + kwArgs.width + '" '
+ + 'height="' + kwArgs.height + '"'
+ + ((kwArgs.style)?' style="' + kwArgs.style + '"':'')
+ + '>'
+ + '<param name="movie" value="' + path + '" />';
+ if(kwArgs.params){
+ for(p in kwArgs.params){
+ s += '<param name="' + p + '" value="' + kwArgs.params[p] + '" />';
+ }
+ }
+ s += '</object>';
+ return { id: kwArgs.id, markup: s };
+ };
+
+ fVersion = (function(){
+ var testVersion = 10, testObj = null;
+ while(!testObj && testVersion > 7){
+ try {
+ testObj = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + testVersion--);
+ }catch(e){ }
+ }
+ if(testObj){
+ var v = testObj.GetVariable("$version").split(" ")[1].split(",");
+ return {
+ major: (v[0]!=null) ? parseInt(v[0]) : 0,
+ minor: (v[1]!=null) ? parseInt(v[1]) : 0,
+ rev: (v[2]!=null) ? parseInt(v[2]) : 0
+ };
+ }
+ return { major: 0, minor: 0, rev: 0 };
+ })();
+
+ // attach some cleanup for IE, thanks to deconcept :)
+ dojo.addOnUnload(function(){
+ var dummy = function(){};
+ var objs = dojo.query("object").
+ reverse().
+ style("display", "none").
+ forEach(function(i){
+ for(var p in i){
+ if((p != "FlashVars") && dojo.isFunction(i[p])){
+ try{
+ i[p] = dummy;
+ }catch(e){}
+ }
+ }
+ });
+ });
+
+ // TODO: ...and double check this fix; is IE really firing onbeforeunload with any kind of href="#" link?
+ /*
+ var beforeUnloadHandle = dojo.connect(dojo.global, "onbeforeunload", function(){
+ try{
+ if(__flash_unloadHandler){ __flash_unloadHandler=function(){ }; }
+ if(__flash_savedUnloadHandler){ __flash_savedUnloadHandler=function(){ }; }
+ } catch(e){ }
+ dojo.disconnect(beforeUnloadHandle);
+ });
+ */
+ } else {
+ // *** Sane browsers branch ******************************************************************
+ fMarkup = function(kwArgs){
+ kwArgs = prep(kwArgs);
+ if(!kwArgs){ return null; }
+
+ var p;
+ var path = kwArgs.path;
+ if(kwArgs.vars){
+ var a = [];
+ for(p in kwArgs.vars){
+ a.push(p + '=' + kwArgs.vars[p]);
+ }
+ kwArgs.params.flashVars = a.join("&");
+ delete kwArgs.vars;
+ }
+ var s = '<embed type="application/x-shockwave-flash" '
+ + 'src="' + path + '" '
+ + 'id="' + kwArgs.id + '" '
+ + 'width="' + kwArgs.width + '" '
+ + 'height="' + kwArgs.height + '"'
+ + ((kwArgs.style)?' style="' + kwArgs.style + '" ':'')
+
+ + 'pluginspage="' + window.location.protocol + '//www.adobe.com/go/getflashplayer" ';
+ if(kwArgs.params){
+ for(p in kwArgs.params){
+ s += ' ' + p + '="' + kwArgs.params[p] + '"';
+ }
+ }
+ s += ' />';
+ return { id: kwArgs.id, markup: s };
+ };
+
+ fVersion=(function(){
+ var plugin = navigator.plugins["Shockwave Flash"];
+ if(plugin && plugin.description){
+ var v = plugin.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".");
+ return {
+ major: (v[0]!=null) ? parseInt(v[0]) : 0,
+ minor: (v[1]!=null) ? parseInt(v[1]) : 0,
+ rev: (v[2]!=null) ? parseInt(v[2]) : 0
+ };
+ }
+ return { major: 0, minor: 0, rev: 0 };
+ })();
+ }
+
+
+/*=====
+dojox.embed.__flashArgs = function(path, id, width, height, style, params, vars, expressInstall, redirect){
+ // path: String
+ // The URL of the movie to embed.
+ // id: String?
+ // A unique key that will be used as the id of the created markup. If you don't
+ // provide this, a unique key will be generated.
+ // width: Number?
+ // The width of the embedded movie; the default value is 320px.
+ // height: Number?
+ // The height of the embedded movie; the default value is 240px
+ // minimumVersion: Number ?
+ // The minimum targeted version of the Flash Player (defaults to 9)
+ // style: String?
+ // Any CSS style information (i.e. style="background-color:transparent") you want
+ // to define on the markup.
+ // params: Object?
+ // A set of key/value pairs that you want to define in the resultant markup.
+ // vars: Object?
+ // A set of key/value pairs that the Flash movie will interpret as FlashVars.
+ // expressInstall: Boolean?
+ // Whether or not to include any kind of expressInstall info. Default is false.
+ // redirect: String?
+ // A url to redirect the browser to if the current Flash version is not supported.
+ this.id=id;
+ this.path=path;
+ this.width=width;
+ this.minimumVersion=minimumVersion;
+ this.height=height;
+ this.style=style;
+ this.params=params;
+ this.vars=vars;
+ this.expressInstall=expressInstall;
+ this.redirect=redirect;
+}
+=====*/
+
+ // the main entry point
+ dojox.embed.Flash = function(/*dojox.embed.__flashArgs*/ kwArgs, /*DOMNode*/ node){
+ // summary:
+ // Create a wrapper object around a Flash movie; this is the DojoX equivilent
+ // to SWFObject.
+ //
+ // description:
+ // Creates a wrapper object around a Flash movie. Wrapper object will
+ // insert the movie reference in node; when the browser first starts
+ // grabbing the movie, onReady will be fired; when the movie has finished
+ // loading, it will fire onLoad.
+ //
+ // If your movie uses ExternalInterface, you should use the onLoad event
+ // to do any kind of proxy setup (see dojox.embed.Flash.proxy); this seems
+ // to be the only consistent time calling EI methods are stable (since the
+ // Flash movie will shoot several methods into the window object before
+ // EI callbacks can be used properly).
+ //
+ // *Important note*: this code includes a workaround for the Eolas "fix" from
+ // Microsoft; in order to work around the "click to activate this control" message
+ // on any embedded Flash movie, this code will load a separate, non-dojo.require
+ // javascript file in order to write the Flash movie into the document. As such
+ // it cannot be used with Dojo's scope map techniques for working with multiple
+ // versions of Dojo on the same page.
+ //
+ // kwArgs: dojox.embed.__flashArgs
+ // The various arguments that will be used to help define the Flash movie.
+ // node: DomNode
+ // The node where the embed object will be placed
+ //
+ // example:
+ // Embed a flash movie in a document using the new operator, and get a reference to it.
+ // | var movie = new dojox.embed.Flash({
+ // | path: "path/to/my/movie.swf",
+ // | width: 400,
+ // | height: 300
+ // | }, myWrapperNode, "testLoaded");
+ //
+ // example:
+ // Embed a flash movie in a document without using the new operator.
+ // | var movie = dojox.embed.Flash({
+ // | path: "path/to/my/movie.swf",
+ // | width: 400,
+ // | height: 300,
+ // | style: "position:absolute;top:0;left:0"
+ // | }, myWrapperNode, "testLoaded");
+ //
+ // File can only be run from a server, due to SWF dependency.
+ if(location.href.toLowerCase().indexOf("file://")>-1){
+ throw new Error("dojox.embed.Flash can't be run directly from a file. To instatiate the required SWF correctly it must be run from a server, like localHost.");
+ }
+
+ // available: Number
+ // If there is a flash player available, and if so what version.
+ this.available = dojox.embed.Flash.available;
+
+ // minimumVersion: Number
+ // The minimum version of Flash required to run this movie.
+ this.minimumVersion = kwArgs.minimumVersion || minimumVersion;
+ //console.log("AVAILABLE:", this);
+
+ // id: String
+ // The id of the DOMNode to be used for this movie. Can be used with dojo.byId to get a reference.
+ this.id = null;
+
+ // movie: FlashObject
+ // A reference to the movie itself.
+ this.movie = null;
+
+ // domNode: DOMNode
+ // A reference to the DOMNode that contains this movie.
+ this.domNode = null;
+ if(node){
+ node = dojo.byId(node);
+ }
+ // setTimeout Fixes #8743 - creating double SWFs
+ // also allows time for code to attach to onError
+ setTimeout(dojo.hitch(this, function(){
+ if(kwArgs.expressInstall || this.available && this.available >= this.minimumVersion){
+ if(kwArgs && node){
+ this.init(kwArgs, node);
+ }else{
+ this.onError("embed.Flash was not provided with the proper arguments.");
+ }
+ }else{
+ if(!this.available){
+ this.onError("Flash is not installed.");
+ }else{
+ this.onError("Flash version detected: "+this.available+" is out of date. Minimum required: "+this.minimumVersion);
+ }
+ }
+ }), 100);
+ };
+
+ dojo.extend(dojox.embed.Flash, {
+ onReady: function(/*HTMLObject*/ movie){
+ console.warn("embed.Flash.movie.onReady:", movie)
+ // summary:
+ // Stub function for you to attach to when the movie reference is first
+ // pushed into the document.
+ },
+ onLoad: function(/*HTMLObject*/ movie){
+ console.warn("embed.Flash.movie.onLoad:", movie)
+ // summary:
+ // Stub function for you to attach to when the movie has finished downloading
+ // and is ready to be manipulated.
+ },
+ onError: function(msg){
+
+ },
+ _onload: function(){
+ // summary:
+ // Internal. Cleans up before calling onLoad.
+ clearInterval(this._poller);
+ delete this._poller;
+ delete this._pollCount;
+ delete this._pollMax;
+ this.onLoad(this.movie);
+ },
+ init: function(/*dojox.embed.__flashArgs*/ kwArgs, /*DOMNode?*/ node){
+ console.log("embed.Flash.movie.init")
+ // summary
+ // Initialize (i.e. place and load) the movie based on kwArgs.
+ this.destroy(); // ensure we are clean first.
+ node = dojo.byId(node || this.domNode);
+ if(!node){ throw new Error("dojox.embed.Flash: no domNode reference has been passed."); }
+
+ // vars to help determine load status
+ var p = 0, testLoaded=false;
+ this._poller = null; this._pollCount = 0; this._pollMax = 15; this.pollTime = 100;
+
+ if(dojox.embed.Flash.initialized){
+
+ this.id = dojox.embed.Flash.place(kwArgs, node);
+ this.domNode = node;
+
+ setTimeout(dojo.hitch(this, function(){
+ this.movie = this.byId(this.id, kwArgs.doc);
+ this.onReady(this.movie);
+
+ this._poller = setInterval(dojo.hitch(this, function(){
+
+ // catch errors if not quite ready.
+ try{
+ p = this.movie.PercentLoaded();
+ }catch(e){
+ /* squelch */
+ console.warn("this.movie.PercentLoaded() failed");
+ }
+
+ if(p == 100){
+ // if percent = 100, movie is fully loaded and we're communicating
+ this._onload();
+
+ }else if(p==0 && this._pollCount++ > this._pollMax){
+ // after several attempts, we're not past zero.
+ // FIXME: What if we get stuck on 33% or something?
+ clearInterval(this._poller);
+ throw new Error("Building SWF failed.");
+ }
+ }), this.pollTime);
+ }), 1);
+ }
+ },
+ _destroy: function(){
+ // summary
+ // Kill the movie and reset all the properties of this object.
+ try{
+ this.domNode.removeChild(this.movie);
+ }catch(e){}
+ this.id = this.movie = this.domNode = null;
+ },
+ destroy: function(){
+ // summary
+ // Public interface for destroying all the properties in this object.
+ // Will also clean all proxied methods.
+ if(!this.movie){ return; }
+
+ // remove any proxy functions
+ var test = dojo.delegate({
+ id: true,
+ movie: true,
+ domNode: true,
+ onReady: true,
+ onLoad: true
+ });
+ for(var p in this){
+ if(!test[p]){
+ delete this[p];
+ }
+ }
+
+ // poll the movie
+ if(this._poller){
+ // wait until onLoad to destroy
+ dojo.connect(this, "onLoad", this, "_destroy");
+ } else {
+ this._destroy();
+ }
+ },
+ byId: function (movieName, doc){
+ // summary:
+ // Gets Flash movie by id.
+ // description:
+ // Probably includes methods for outdated
+ // browsers, but this should catch all cases.
+ // arguments:
+ // movieName: String
+ // The name of the SWF
+ // doc: Object
+ // The document, if not current window
+ // (not fully supported)
+ // example:
+ // | var movie = dojox.embed.Flash.byId("myId");
+ //
+ doc = doc || document;
+ if(doc.embeds[movieName]){
+ return doc.embeds[movieName];
+ }
+ if(doc[movieName]){
+ return doc[movieName];
+ }
+ if(window[movieName]){
+ return window[movieName];
+ }
+ if(document[movieName]){
+ return document[movieName];
+ }
+ return null;
+ }
+ });
+
+ // expose information through the constructor function itself.
+ dojo.mixin(dojox.embed.Flash, {
+ // summary:
+ // A singleton object used internally to get information
+ // about the Flash player available in a browser, and
+ // as the factory for generating and placing markup in a
+ // document.
+ //
+ // minSupported: Number
+ // The minimum supported version of the Flash Player, defaults to 8.
+ // available: Number
+ // Used as both a detection (i.e. if(dojox.embed.Flash.available){ })
+ // and as a variable holding the major version of the player installed.
+ // supported: Boolean
+ // Whether or not the Flash Player installed is supported by dojox.embed.
+ // version: Object
+ // The version of the installed Flash Player; takes the form of
+ // { major, minor, rev }. To get the major version, you'd do this:
+ // var v=dojox.embed.Flash.version.major;
+ // initialized: Boolean
+ // Whether or not the Flash engine is available for use.
+ // onInitialize: Function
+ // A stub you can connect to if you are looking to fire code when the
+ // engine becomes available. A note: DO NOT use this event to
+ // place a movie in a document; it will usually fire before DOMContentLoaded
+ // is fired, and you will get an error. Use dojo.addOnLoad instead.
+ minSupported : 8,
+ available: fVersion.major,
+ supported: (fVersion.major >= fVersion.required),
+ minimumRequired: fVersion.required,
+ version: fVersion,
+ initialized: false,
+ onInitialize: function(){
+ dojox.embed.Flash.initialized = true;
+ },
+ __ie_markup__: function(kwArgs){
+ return fMarkup(kwArgs);
+ },
+ proxy: function(/*dojox.embed.Flash*/ obj, /*Array|String*/ methods){
+ // summary:
+ // Create the set of passed methods on the dojox.embed.Flash object
+ // so that you can call that object directly, as opposed to having to
+ // delve into the internal movie to do this. Intended to make working
+ // with Flash movies that use ExternalInterface much easier to use.
+ //
+ // example:
+ // Create "setMessage" and "getMessage" methods on foo.
+ // | var foo = new dojox.embed.Flash(args, someNode);
+ // | dojo.connect(foo, "onLoad", dojo.hitch(foo, function(){
+ // | dojox.embed.Flash.proxy(this, [ "setMessage", "getMessage" ]);
+ // | this.setMessage("dojox.embed.Flash.proxy is pretty cool...");
+ // | console.log(this.getMessage());
+ // | }));
+ dojo.forEach((dojo.isArray(methods) ? methods : [ methods ]), function(item){
+ this[item] = dojo.hitch(this, function(){
+ return (function(){
+ return eval(this.movie.CallFunction(
+ '<invoke name="' + item + '" returntype="javascript">'
+ + '<arguments>'
+ + dojo.map(arguments, function(item){
+ // FIXME:
+ // investigate if __flash__toXML will
+ // accept direct application via map()
+ // (e.g., does it ignore args past the
+ // first? or does it blow up?)
+ return __flash__toXML(item);
+ }).join("")
+ + '</arguments>'
+ + '</invoke>'
+ ));
+ }).apply(this, arguments||[]);
+ });
+ }, obj);
+ }
+ });
+
+ /*if(dojo.isIE){
+ // Ugh!
+ if(dojo._initFired){
+ var e = document.createElement("script");
+ e.type = "text/javascript";
+ e.src = dojo.moduleUrl("dojox", "embed/IE/flash.js");
+ document.getElementsByTagName("head")[0].appendChild(e);
+ }else{
+ // we can use document.write. What a kludge.
+ document.write('<scr'+'ipt type="text/javascript" src="' + dojo.moduleUrl("dojox", "embed/IE/flash.js") + '">'
+ + '</scr'+'ipt>');
+ }
+ }else{*/
+ dojox.embed.Flash.place = function(kwArgs, node){
+ var o = fMarkup(kwArgs);
+ node = dojo.byId(node);
+ if(!node){
+ node = dojo.doc.createElement("div");
+ node.id = o.id+"-container";
+ dojo.body().appendChild(node);
+ }
+ if(o){
+ node.innerHTML = o.markup;
+ return o.id;
+ }
+ return null;
+ }
+ dojox.embed.Flash.onInitialize();
+ //}
+})();
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/embed/IE/flash.js b/js/dojo-1.6/dojox/embed/IE/flash.js new file mode 100644 index 0000000..471fc44 --- /dev/null +++ b/js/dojo-1.6/dojox/embed/IE/flash.js @@ -0,0 +1,26 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+// *** Fricking Eolas. This is here to get around the Eolas issue. Sigh. ***************
+dojox.embed.Flash.place = function(kwArgs, node){
+ var o = dojox.embed.Flash.__ie_markup__(kwArgs);
+ node=dojo.byId(node);
+
+ if(!node){
+ node=dojo.doc.createElement("div");
+ node.id=o.id+"-container";
+ dojo.body().appendChild(node);
+ }
+
+ if(o){
+ node.innerHTML = o.markup;
+ //return window[o.id];
+ return o.id;
+ }
+ return null;
+}
+dojox.embed.Flash.onInitialize();
diff --git a/js/dojo-1.6/dojox/embed/IE/flash.xd.js b/js/dojo-1.6/dojox/embed/IE/flash.xd.js new file mode 100644 index 0000000..47c8924 --- /dev/null +++ b/js/dojo-1.6/dojox/embed/IE/flash.xd.js @@ -0,0 +1,30 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {
+defineResource: function(dojo, dijit, dojox){// *** Fricking Eolas. This is here to get around the Eolas issue. Sigh. ***************
+dojox.embed.Flash.place = function(kwArgs, node){
+ var o = dojox.embed.Flash.__ie_markup__(kwArgs);
+ node=dojo.byId(node);
+
+ if(!node){
+ node=dojo.doc.createElement("div");
+ node.id=o.id+"-container";
+ dojo.body().appendChild(node);
+ }
+
+ if(o){
+ node.innerHTML = o.markup;
+ //return window[o.id];
+ return o.id;
+ }
+ return null;
+}
+dojox.embed.Flash.onInitialize();
+
+}};});
diff --git a/js/dojo-1.6/dojox/embed/Object.js b/js/dojo-1.6/dojox/embed/Object.js new file mode 100644 index 0000000..4136215 --- /dev/null +++ b/js/dojo-1.6/dojox/embed/Object.js @@ -0,0 +1,116 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.embed.Object"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.embed.Object"] = true;
+dojo.provide("dojox.embed.Object");
+dojo.experimental("dojox.embed.Object");
+
+dojo.require("dijit._Widget");
+dojo.require("dojox.embed.Flash");
+dojo.require("dojox.embed.Quicktime");
+
+dojo.declare("dojox.embed.Object", dijit._Widget, {
+ // summary:
+ // A widget you can use to embed either a Flash or Quicktime
+ // movie.
+ //
+ // example:
+ // From markup:
+ // | <div dojoType="dojox.embed.Object" src="path/to/movie.swf"></div>
+ //
+ // example:
+ // Programmatic:
+ // | var mov=new dojox.embed.Object({
+ // | src: "path/to/movie.swf"
+ // | }, node);
+ //
+ // width: Number?
+ // The width of the movie. If not provided, the width of this.domNode is used.
+ // height: Number?
+ // The height of the movie. If not provided, the height of this.domNode is used.
+ // src: String
+ // The URL of the movie to embed.
+ // movie: HTMLEmbed
+ // The eventual reference to the movie embedded. If you are looking to script
+ // control over the movie, you'd access it this way.
+ // params: Object
+ // A property bag that is created postCreate. Any additional attributes you
+ // define on your domNode will be collected and placed into this, which will
+ // then be passed to the movie constructor.
+ // reFlash: RegExp
+ // Expression used on the src property to determine if this is Flash or Quicktime.
+ // reQtMovie: RegExp
+ // Expression used on the src property to determine if this is Flash or Quicktime.
+ // reQtAudio: RegExp
+ // Expression used on the src property to determine if this is Flash or Quicktime.
+
+ width: 0,
+ height: 0,
+ src: "",
+ movie: null,
+ params: null,
+
+ reFlash: /\.swf|\.flv/gi,
+ reQtMovie: /\.3gp|\.avi|\.m4v|\.mov|\.mp4|\.mpg|\.mpeg|\.qt/gi,
+ reQtAudio:/\.aiff|\.aif|\.m4a|\.m4b|\.m4p|\.midi|\.mid|\.mp3|\.mpa|\.wav/gi,
+
+ postCreate: function(){
+ // summary
+ // Constructs the movie and places it in the document.
+ if(!this.width || !this.height){
+ // get the width and height from the domNode
+ var box=dojo.marginBox(this.domNode);
+ this.width=box.w, this.height=box.h;
+ }
+
+ // the default embed constructor.
+ var em=dojox.embed.Flash;
+
+ // figure out what kind of movie this is.
+ if(this.src.match(this.reQtMovie) || this.src.match(this.reQtAudio)){
+ em=dojox.embed.Quicktime;
+ }
+
+ // loop through any attributes and set up our params object.
+ if(!this.params){
+ this.params={};
+ if(this.domNode.hasAttributes()){
+ // ignore list
+ var ignore = {
+ dojoType: "",
+ width: "",
+ height: "",
+ "class": "",
+ style: "",
+ id: "",
+ src: ""
+ };
+
+ var attrs=this.domNode.attributes;
+ for(var i=0, l=attrs.length; i<l; i++){
+ if(!ignore[attrs[i].name]){
+ this.params[attrs[i].name]=attrs[i].value;
+ }
+ }
+ }
+ }
+
+ // set up our arguments.
+ var kwArgs={
+ path: this.src,
+ width: this.width,
+ height: this.height,
+ params: this.params
+ };
+
+ // set up the movie.
+ this.movie=new (em)(kwArgs, this.domNode);
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/embed/Object.xd.js b/js/dojo-1.6/dojox/embed/Object.xd.js new file mode 100644 index 0000000..479ebe7 --- /dev/null +++ b/js/dojo-1.6/dojox/embed/Object.xd.js @@ -0,0 +1,123 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.embed.Object"],
+["require", "dijit._Widget"],
+["require", "dojox.embed.Flash"],
+["require", "dojox.embed.Quicktime"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.embed.Object"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.embed.Object"] = true;
+dojo.provide("dojox.embed.Object");
+dojo.experimental("dojox.embed.Object");
+
+dojo.require("dijit._Widget");
+dojo.require("dojox.embed.Flash");
+dojo.require("dojox.embed.Quicktime");
+
+dojo.declare("dojox.embed.Object", dijit._Widget, {
+ // summary:
+ // A widget you can use to embed either a Flash or Quicktime
+ // movie.
+ //
+ // example:
+ // From markup:
+ // | <div dojoType="dojox.embed.Object" src="path/to/movie.swf"></div>
+ //
+ // example:
+ // Programmatic:
+ // | var mov=new dojox.embed.Object({
+ // | src: "path/to/movie.swf"
+ // | }, node);
+ //
+ // width: Number?
+ // The width of the movie. If not provided, the width of this.domNode is used.
+ // height: Number?
+ // The height of the movie. If not provided, the height of this.domNode is used.
+ // src: String
+ // The URL of the movie to embed.
+ // movie: HTMLEmbed
+ // The eventual reference to the movie embedded. If you are looking to script
+ // control over the movie, you'd access it this way.
+ // params: Object
+ // A property bag that is created postCreate. Any additional attributes you
+ // define on your domNode will be collected and placed into this, which will
+ // then be passed to the movie constructor.
+ // reFlash: RegExp
+ // Expression used on the src property to determine if this is Flash or Quicktime.
+ // reQtMovie: RegExp
+ // Expression used on the src property to determine if this is Flash or Quicktime.
+ // reQtAudio: RegExp
+ // Expression used on the src property to determine if this is Flash or Quicktime.
+
+ width: 0,
+ height: 0,
+ src: "",
+ movie: null,
+ params: null,
+
+ reFlash: /\.swf|\.flv/gi,
+ reQtMovie: /\.3gp|\.avi|\.m4v|\.mov|\.mp4|\.mpg|\.mpeg|\.qt/gi,
+ reQtAudio:/\.aiff|\.aif|\.m4a|\.m4b|\.m4p|\.midi|\.mid|\.mp3|\.mpa|\.wav/gi,
+
+ postCreate: function(){
+ // summary
+ // Constructs the movie and places it in the document.
+ if(!this.width || !this.height){
+ // get the width and height from the domNode
+ var box=dojo.marginBox(this.domNode);
+ this.width=box.w, this.height=box.h;
+ }
+
+ // the default embed constructor.
+ var em=dojox.embed.Flash;
+
+ // figure out what kind of movie this is.
+ if(this.src.match(this.reQtMovie) || this.src.match(this.reQtAudio)){
+ em=dojox.embed.Quicktime;
+ }
+
+ // loop through any attributes and set up our params object.
+ if(!this.params){
+ this.params={};
+ if(this.domNode.hasAttributes()){
+ // ignore list
+ var ignore = {
+ dojoType: "",
+ width: "",
+ height: "",
+ "class": "",
+ style: "",
+ id: "",
+ src: ""
+ };
+
+ var attrs=this.domNode.attributes;
+ for(var i=0, l=attrs.length; i<l; i++){
+ if(!ignore[attrs[i].name]){
+ this.params[attrs[i].name]=attrs[i].value;
+ }
+ }
+ }
+ }
+
+ // set up our arguments.
+ var kwArgs={
+ path: this.src,
+ width: this.width,
+ height: this.height,
+ params: this.params
+ };
+
+ // set up the movie.
+ this.movie=new (em)(kwArgs, this.domNode);
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/embed/Quicktime.js b/js/dojo-1.6/dojox/embed/Quicktime.js new file mode 100644 index 0000000..1c277fb --- /dev/null +++ b/js/dojo-1.6/dojox/embed/Quicktime.js @@ -0,0 +1,274 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.embed.Quicktime"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.embed.Quicktime"] = true;
+dojo.provide("dojox.embed.Quicktime");
+
+(function(d){
+ /*******************************************************
+ dojox.embed.Quicktime
+
+ Base functionality to insert a QuickTime movie
+ into a document on the fly.
+ ******************************************************/
+
+ var qtMarkup,
+ qtVersion = { major: 0, minor: 0, rev: 0 },
+ installed,
+ __def__ = {
+ width: 320,
+ height: 240,
+ redirect: null
+ },
+ keyBase = "dojox-embed-quicktime-",
+ keyCount = 0,
+ getQTMarkup = 'This content requires the <a href="http://www.apple.com/quicktime/download/" title="Download and install QuickTime.">QuickTime plugin</a>.';
+
+ // *** private methods *********************************************************
+ function prep(kwArgs){
+ kwArgs = d.mixin(d.clone(__def__), kwArgs || {});
+ if(!("path" in kwArgs) && !kwArgs.testing){
+ console.error("dojox.embed.Quicktime(ctor):: no path reference to a QuickTime movie was provided.");
+ return null;
+ }
+ if(kwArgs.testing){
+ kwArgs.path = "";
+ }
+ if(!("id" in kwArgs)){
+ kwArgs.id = keyBase + keyCount++;
+ }
+ return kwArgs;
+ }
+
+ if(d.isIE){
+ installed = (function(){
+ try{
+ var o = new ActiveXObject("QuickTimeCheckObject.QuickTimeCheck.1");
+ if(o!==undefined){
+ // pull the qt version too
+ var v = o.QuickTimeVersion.toString(16);
+ function p(i){ return (v.substring(i, i+1)-0) || 0; }
+ qtVersion = {
+ major: p(0),
+ minor: p(1),
+ rev: p(2)
+ };
+ return o.IsQuickTimeAvailable(0);
+ }
+ } catch(e){ }
+ return false;
+ })();
+
+ qtMarkup = function(kwArgs){
+ if(!installed){ return { id: null, markup: getQTMarkup }; }
+
+ kwArgs = prep(kwArgs);
+ if(!kwArgs){ return null; }
+ var s = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" '
+ + 'codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" '
+ + 'id="' + kwArgs.id + '" '
+ + 'width="' + kwArgs.width + '" '
+ + 'height="' + kwArgs.height + '">'
+ + '<param name="src" value="' + kwArgs.path + '"/>';
+ for(var p in kwArgs.params||{}){
+ s += '<param name="' + p + '" value="' + kwArgs.params[p] + '"/>';
+ }
+ s += '</object>';
+ return { id: kwArgs.id, markup: s };
+ }
+ } else {
+ installed = (function(){
+ for(var i=0, p=navigator.plugins, l=p.length; i<l; i++){
+ if(p[i].name.indexOf("QuickTime")>-1){
+ return true;
+ }
+ }
+ return false;
+ })();
+
+ qtMarkup = function(kwArgs){
+ if(!installed){ return { id: null, markup: getQTMarkup }; }
+
+ kwArgs = prep(kwArgs);
+ if(!kwArgs){ return null; }
+ var s = '<embed type="video/quicktime" src="' + kwArgs.path + '" '
+ + 'id="' + kwArgs.id + '" '
+ + 'name="' + kwArgs.id + '" '
+ + 'pluginspage="www.apple.com/quicktime/download" '
+ + 'enablejavascript="true" '
+ + 'width="' + kwArgs.width + '" '
+ + 'height="' + kwArgs.height + '"';
+ for(var p in kwArgs.params||{}){
+ s += ' ' + p + '="' + kwArgs.params[p] + '"';
+ }
+ s += '></embed>';
+ return { id: kwArgs.id, markup: s };
+ }
+ }
+
+ /*=====
+ dojox.embed.__QTArgs = function(path, id, width, height, params, redirect){
+ // path: String
+ // The URL of the movie to embed.
+ // id: String?
+ // A unique key that will be used as the id of the created markup. If you don't
+ // provide this, a unique key will be generated.
+ // width: Number?
+ // The width of the embedded movie; the default value is 320px.
+ // height: Number?
+ // The height of the embedded movie; the default value is 240px
+ // params: Object?
+ // A set of key/value pairs that you want to define in the resultant markup.
+ // redirect: String?
+ // A url to redirect the browser to if the current QuickTime version is not supported.
+ this.id=id;
+ this.path=path;
+ this.width=width;
+ this.height=height;
+ this.params=params;
+ this.redirect=redirect;
+ }
+ =====*/
+
+ dojox.embed.Quicktime=function(/* dojox.embed.__QTArgs */kwArgs, /* DOMNode */node){
+ // summary:
+ // Returns a reference to the HTMLObject/HTMLEmbed that is created to
+ // place the movie in the document. You can use this either with or
+ // without the new operator. Note that with any other DOM manipulation,
+ // you must wait until the document is finished loading before trying
+ // to use this.
+ //
+ // example:
+ // Embed a QuickTime movie in a document using the new operator, and get a reference to it.
+ // | var movie = new dojox.embed.Quicktime({
+ // | path: "path/to/my/movie.mov",
+ // | width: 400,
+ // | height: 300
+ // | }, myWrapperNode);
+ //
+ // example:
+ // Embed a movie in a document without using the new operator.
+ // | var movie = dojox.embed.Quicktime({
+ // | path: "path/to/my/movie.mov",
+ // | width: 400,
+ // | height: 300
+ // | }, myWrapperNode);
+
+ return dojox.embed.Quicktime.place(kwArgs, node); // HTMLObject
+ };
+
+ d.mixin(dojox.embed.Quicktime, {
+ // summary:
+ // A singleton object used internally to get information
+ // about the QuickTime player available in a browser, and
+ // as the factory for generating and placing markup in a
+ // document.
+ //
+ // minSupported: Number
+ // The minimum supported version of the QuickTime Player, defaults to
+ // 6.
+ // available: Boolean
+ // Whether or not QuickTime is available.
+ // supported: Boolean
+ // Whether or not the QuickTime Player installed is supported by
+ // dojox.embed.
+ // version: Object
+ // The version of the installed QuickTime Player; takes the form of
+ // { major, minor, rev }. To get the major version, you'd do this:
+ // var v=dojox.embed.Quicktime.version.major;
+ // initialized: Boolean
+ // Whether or not the QuickTime engine is available for use.
+ // onInitialize: Function
+ // A stub you can connect to if you are looking to fire code when the
+ // engine becomes available. A note: do NOT use this stub to embed
+ // a movie in your document; this WILL be fired before DOMContentLoaded
+ // is fired, and you will get an error. You should use dojo.addOnLoad
+ // to place your movie instead.
+
+ minSupported: 6,
+ available: installed,
+ supported: installed,
+ version: qtVersion,
+ initialized: false,
+ onInitialize: function(){
+ dojox.embed.Quicktime.initialized = true;
+ }, // stub function to let you know when this is ready
+
+ place: function(kwArgs, node){
+ var o = qtMarkup(kwArgs);
+
+ if(!(node = d.byId(node))){
+ node=d.create("div", { id:o.id+"-container" }, d.body());
+ }
+
+ if(o){
+ node.innerHTML = o.markup;
+ if(o.id){
+ return d.isIE? d.byId(o.id) : document[o.id]; // QuickTimeObject
+ }
+ }
+ return null; // QuickTimeObject
+ }
+ });
+
+ // go get the info
+ if(!d.isIE){
+ var id = "-qt-version-test",
+ o = qtMarkup({ testing:true , width:4, height:4 }),
+ c = 10, // counter to prevent infinite looping
+ top = "-1000px",
+ widthHeight = "1px";
+
+ function getVer(){
+ setTimeout(function(){
+ var qt = document[o.id],
+ n = d.byId(id);
+
+ if(qt){
+ try{
+ var v = qt.GetQuickTimeVersion().split(".");
+ dojox.embed.Quicktime.version = { major: parseInt(v[0]||0), minor: parseInt(v[1]||0), rev: parseInt(v[2]||0) };
+ if(dojox.embed.Quicktime.supported = v[0]){
+ dojox.embed.Quicktime.onInitialize();
+ }
+ c = 0;
+ } catch(e){
+ if(c--){
+ getVer();
+ }
+ }
+ }
+
+ if(!c && n){ d.destroy(n); }
+ }, 20);
+ }
+
+ if(d._initFired){
+ // if onload has already fired, then body is available and we can create a new node
+ d.create("div", {
+ innerHTML: o.markup,
+ id: id,
+ style: { top:top, left:0, width:widthHeight, height:widthHeight, overflow:"hidden", position:"absolute" }
+ }, d.body());
+ }else{
+ // body isn't loaded yet, so we need to document.write the QuickTime markup
+ document.write(
+ '<div style="top:'+top+';left:0;width:'+widthHeight+';height:'+widthHeight+';overflow:hidden;position:absolute" id="' + id + '">'
+ + o.markup
+ + '</div>');
+ }
+ getVer();
+ }else if(d.isIE && installed){
+ // we already know if IE has QuickTime installed, but we need this to seem like a callback.
+ setTimeout(function(){
+ dojox.embed.Quicktime.onInitialize();
+ }, 10);
+ }
+})(dojo);
+
+}
diff --git a/js/dojo-1.6/dojox/embed/Quicktime.xd.js b/js/dojo-1.6/dojox/embed/Quicktime.xd.js new file mode 100644 index 0000000..f7c5e20 --- /dev/null +++ b/js/dojo-1.6/dojox/embed/Quicktime.xd.js @@ -0,0 +1,278 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.embed.Quicktime"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.embed.Quicktime"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.embed.Quicktime"] = true;
+dojo.provide("dojox.embed.Quicktime");
+
+(function(d){
+ /*******************************************************
+ dojox.embed.Quicktime
+
+ Base functionality to insert a QuickTime movie
+ into a document on the fly.
+ ******************************************************/
+
+ var qtMarkup,
+ qtVersion = { major: 0, minor: 0, rev: 0 },
+ installed,
+ __def__ = {
+ width: 320,
+ height: 240,
+ redirect: null
+ },
+ keyBase = "dojox-embed-quicktime-",
+ keyCount = 0,
+ getQTMarkup = 'This content requires the <a href="http://www.apple.com/quicktime/download/" title="Download and install QuickTime.">QuickTime plugin</a>.';
+
+ // *** private methods *********************************************************
+ function prep(kwArgs){
+ kwArgs = d.mixin(d.clone(__def__), kwArgs || {});
+ if(!("path" in kwArgs) && !kwArgs.testing){
+ console.error("dojox.embed.Quicktime(ctor):: no path reference to a QuickTime movie was provided.");
+ return null;
+ }
+ if(kwArgs.testing){
+ kwArgs.path = "";
+ }
+ if(!("id" in kwArgs)){
+ kwArgs.id = keyBase + keyCount++;
+ }
+ return kwArgs;
+ }
+
+ if(d.isIE){
+ installed = (function(){
+ try{
+ var o = new ActiveXObject("QuickTimeCheckObject.QuickTimeCheck.1");
+ if(o!==undefined){
+ // pull the qt version too
+ var v = o.QuickTimeVersion.toString(16);
+ function p(i){ return (v.substring(i, i+1)-0) || 0; }
+ qtVersion = {
+ major: p(0),
+ minor: p(1),
+ rev: p(2)
+ };
+ return o.IsQuickTimeAvailable(0);
+ }
+ } catch(e){ }
+ return false;
+ })();
+
+ qtMarkup = function(kwArgs){
+ if(!installed){ return { id: null, markup: getQTMarkup }; }
+
+ kwArgs = prep(kwArgs);
+ if(!kwArgs){ return null; }
+ var s = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" '
+ + 'codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" '
+ + 'id="' + kwArgs.id + '" '
+ + 'width="' + kwArgs.width + '" '
+ + 'height="' + kwArgs.height + '">'
+ + '<param name="src" value="' + kwArgs.path + '"/>';
+ for(var p in kwArgs.params||{}){
+ s += '<param name="' + p + '" value="' + kwArgs.params[p] + '"/>';
+ }
+ s += '</object>';
+ return { id: kwArgs.id, markup: s };
+ }
+ } else {
+ installed = (function(){
+ for(var i=0, p=navigator.plugins, l=p.length; i<l; i++){
+ if(p[i].name.indexOf("QuickTime")>-1){
+ return true;
+ }
+ }
+ return false;
+ })();
+
+ qtMarkup = function(kwArgs){
+ if(!installed){ return { id: null, markup: getQTMarkup }; }
+
+ kwArgs = prep(kwArgs);
+ if(!kwArgs){ return null; }
+ var s = '<embed type="video/quicktime" src="' + kwArgs.path + '" '
+ + 'id="' + kwArgs.id + '" '
+ + 'name="' + kwArgs.id + '" '
+ + 'pluginspage="www.apple.com/quicktime/download" '
+ + 'enablejavascript="true" '
+ + 'width="' + kwArgs.width + '" '
+ + 'height="' + kwArgs.height + '"';
+ for(var p in kwArgs.params||{}){
+ s += ' ' + p + '="' + kwArgs.params[p] + '"';
+ }
+ s += '></embed>';
+ return { id: kwArgs.id, markup: s };
+ }
+ }
+
+ /*=====
+ dojox.embed.__QTArgs = function(path, id, width, height, params, redirect){
+ // path: String
+ // The URL of the movie to embed.
+ // id: String?
+ // A unique key that will be used as the id of the created markup. If you don't
+ // provide this, a unique key will be generated.
+ // width: Number?
+ // The width of the embedded movie; the default value is 320px.
+ // height: Number?
+ // The height of the embedded movie; the default value is 240px
+ // params: Object?
+ // A set of key/value pairs that you want to define in the resultant markup.
+ // redirect: String?
+ // A url to redirect the browser to if the current QuickTime version is not supported.
+ this.id=id;
+ this.path=path;
+ this.width=width;
+ this.height=height;
+ this.params=params;
+ this.redirect=redirect;
+ }
+ =====*/
+
+ dojox.embed.Quicktime=function(/* dojox.embed.__QTArgs */kwArgs, /* DOMNode */node){
+ // summary:
+ // Returns a reference to the HTMLObject/HTMLEmbed that is created to
+ // place the movie in the document. You can use this either with or
+ // without the new operator. Note that with any other DOM manipulation,
+ // you must wait until the document is finished loading before trying
+ // to use this.
+ //
+ // example:
+ // Embed a QuickTime movie in a document using the new operator, and get a reference to it.
+ // | var movie = new dojox.embed.Quicktime({
+ // | path: "path/to/my/movie.mov",
+ // | width: 400,
+ // | height: 300
+ // | }, myWrapperNode);
+ //
+ // example:
+ // Embed a movie in a document without using the new operator.
+ // | var movie = dojox.embed.Quicktime({
+ // | path: "path/to/my/movie.mov",
+ // | width: 400,
+ // | height: 300
+ // | }, myWrapperNode);
+
+ return dojox.embed.Quicktime.place(kwArgs, node); // HTMLObject
+ };
+
+ d.mixin(dojox.embed.Quicktime, {
+ // summary:
+ // A singleton object used internally to get information
+ // about the QuickTime player available in a browser, and
+ // as the factory for generating and placing markup in a
+ // document.
+ //
+ // minSupported: Number
+ // The minimum supported version of the QuickTime Player, defaults to
+ // 6.
+ // available: Boolean
+ // Whether or not QuickTime is available.
+ // supported: Boolean
+ // Whether or not the QuickTime Player installed is supported by
+ // dojox.embed.
+ // version: Object
+ // The version of the installed QuickTime Player; takes the form of
+ // { major, minor, rev }. To get the major version, you'd do this:
+ // var v=dojox.embed.Quicktime.version.major;
+ // initialized: Boolean
+ // Whether or not the QuickTime engine is available for use.
+ // onInitialize: Function
+ // A stub you can connect to if you are looking to fire code when the
+ // engine becomes available. A note: do NOT use this stub to embed
+ // a movie in your document; this WILL be fired before DOMContentLoaded
+ // is fired, and you will get an error. You should use dojo.addOnLoad
+ // to place your movie instead.
+
+ minSupported: 6,
+ available: installed,
+ supported: installed,
+ version: qtVersion,
+ initialized: false,
+ onInitialize: function(){
+ dojox.embed.Quicktime.initialized = true;
+ }, // stub function to let you know when this is ready
+
+ place: function(kwArgs, node){
+ var o = qtMarkup(kwArgs);
+
+ if(!(node = d.byId(node))){
+ node=d.create("div", { id:o.id+"-container" }, d.body());
+ }
+
+ if(o){
+ node.innerHTML = o.markup;
+ if(o.id){
+ return d.isIE? d.byId(o.id) : document[o.id]; // QuickTimeObject
+ }
+ }
+ return null; // QuickTimeObject
+ }
+ });
+
+ // go get the info
+ if(!d.isIE){
+ var id = "-qt-version-test",
+ o = qtMarkup({ testing:true , width:4, height:4 }),
+ c = 10, // counter to prevent infinite looping
+ top = "-1000px",
+ widthHeight = "1px";
+
+ function getVer(){
+ setTimeout(function(){
+ var qt = document[o.id],
+ n = d.byId(id);
+
+ if(qt){
+ try{
+ var v = qt.GetQuickTimeVersion().split(".");
+ dojox.embed.Quicktime.version = { major: parseInt(v[0]||0), minor: parseInt(v[1]||0), rev: parseInt(v[2]||0) };
+ if(dojox.embed.Quicktime.supported = v[0]){
+ dojox.embed.Quicktime.onInitialize();
+ }
+ c = 0;
+ } catch(e){
+ if(c--){
+ getVer();
+ }
+ }
+ }
+
+ if(!c && n){ d.destroy(n); }
+ }, 20);
+ }
+
+ if(d._initFired){
+ // if onload has already fired, then body is available and we can create a new node
+ d.create("div", {
+ innerHTML: o.markup,
+ id: id,
+ style: { top:top, left:0, width:widthHeight, height:widthHeight, overflow:"hidden", position:"absolute" }
+ }, d.body());
+ }else{
+ // body isn't loaded yet, so we need to document.write the QuickTime markup
+ document.write(
+ '<div style="top:'+top+';left:0;width:'+widthHeight+';height:'+widthHeight+';overflow:hidden;position:absolute" id="' + id + '">'
+ + o.markup
+ + '</div>');
+ }
+ getVer();
+ }else if(d.isIE && installed){
+ // we already know if IE has QuickTime installed, but we need this to seem like a callback.
+ setTimeout(function(){
+ dojox.embed.Quicktime.onInitialize();
+ }, 10);
+ }
+})(dojo);
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/embed/README b/js/dojo-1.6/dojox/embed/README new file mode 100644 index 0000000..1f5cb00 --- /dev/null +++ b/js/dojo-1.6/dojox/embed/README @@ -0,0 +1,44 @@ +------------------------------------------------------------------------------- +dojox.embed +------------------------------------------------------------------------------- +Version 0.1 +Release date: 4/7/2008 +------------------------------------------------------------------------------- +Project state: +beta +------------------------------------------------------------------------------- +Credits + Tom Trenka (ttrenka AT gmail.com) +------------------------------------------------------------------------------- +Project description + +A move/port of what was in dojox.av._base; the nominal purpose is to provide +easy ways of including external objects that would normally require the use +of either an OBJECT or an EMBED tag. + +The following constructors are considered beta (working tests and docs) as of +2008-06-04: + +dojox.embed.Flash +dojox.embed.FlashProxy +dojox.embed.Quicktime +dojox.embed.Object (a Dijit that can load anything there is an embed for here) +------------------------------------------------------------------------------- +Dependencies: + +dojox.embed has no dependencies, other than the Dojo base. +------------------------------------------------------------------------------- +Documentation + +TBD +------------------------------------------------------------------------------- +Installation instructions + +Grab the following from the Dojo SVN Repository: +http://svn.dojotoolkit.org/dojox/trunk/embed/* + +Install into the following directory structure: +/dojox/embed/ + +...which should be at the same level as your Dojo checkout. +------------------------------------------------------------------------------- diff --git a/js/dojo-1.6/dojox/embed/flashVars.js b/js/dojo-1.6/dojox/embed/flashVars.js new file mode 100644 index 0000000..6787b7b --- /dev/null +++ b/js/dojo-1.6/dojox/embed/flashVars.js @@ -0,0 +1,66 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.embed.flashVars"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.embed.flashVars"] = true;
+dojo.provide("dojox.embed.flashVars");
+
+dojo.mixin(dojox.embed.flashVars, {
+ // summary
+ // Handles flashvar serialization
+ // Converting complex objects into a simple, clear string that can be appended
+ // to the swf as a query: myMovie.swf?flashvars=foo.
+ // Note this needs to work with the SWF, which must know what variables to expect.
+ // Therefore this is something of an "internal" class - unless you know how to
+ // modify or create SWFs.
+ //
+ // description:
+ // JSON could be done, but Deft does not yet have a JSON parser, and quotes are
+ // very problematic since Flash cannot use eval(); JSON parsing was successful
+ // when it was fully escaped, but that made it very large anyway. flashvar
+ // serialization at most is 200% larger than JSON.
+ //
+ // See:
+ // Deft/common/flashVars.as
+ //
+ serialize: function(/* String */n, /*Object*/o){
+ // summary:
+ // Key method. Serializes an object.
+ // n:String
+ // The name for the object, such as: "button"
+ // o:Object
+ // The object to serialize
+ //
+ var esc = function(val){
+ // have to encode certain characters that indicate an object
+ if(typeof val=="string"){
+ val = val.replace(/;/g,"_sc_");
+ val = val.replace(/\./g,"_pr_");
+ val = val.replace(/\:/g,"_cl_");
+ //val = escape(val);
+ }
+ return val;
+ };
+ var df = dojox.embed.flashVars.serialize;
+ var txt = "";
+ if(dojo.isArray(o)){
+ for(var i=0;i<o.length;i++){
+ txt += df(n+"."+i, esc(o[i]))+";";
+ }
+ return txt.replace(/;{2,}/g,";");
+ }else if(dojo.isObject(o)){
+ for(var nm in o){
+ txt += df(n+"."+nm, esc(o[nm]))+";";
+ }
+ return txt.replace(/;{2,}/g,";");
+ }
+ // Dev note: important that there is no double semi-colons
+ return n+":"+o; // String
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/embed/flashVars.xd.js b/js/dojo-1.6/dojox/embed/flashVars.xd.js new file mode 100644 index 0000000..b449504 --- /dev/null +++ b/js/dojo-1.6/dojox/embed/flashVars.xd.js @@ -0,0 +1,70 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.embed.flashVars"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.embed.flashVars"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.embed.flashVars"] = true;
+dojo.provide("dojox.embed.flashVars");
+
+dojo.mixin(dojox.embed.flashVars, {
+ // summary
+ // Handles flashvar serialization
+ // Converting complex objects into a simple, clear string that can be appended
+ // to the swf as a query: myMovie.swf?flashvars=foo.
+ // Note this needs to work with the SWF, which must know what variables to expect.
+ // Therefore this is something of an "internal" class - unless you know how to
+ // modify or create SWFs.
+ //
+ // description:
+ // JSON could be done, but Deft does not yet have a JSON parser, and quotes are
+ // very problematic since Flash cannot use eval(); JSON parsing was successful
+ // when it was fully escaped, but that made it very large anyway. flashvar
+ // serialization at most is 200% larger than JSON.
+ //
+ // See:
+ // Deft/common/flashVars.as
+ //
+ serialize: function(/* String */n, /*Object*/o){
+ // summary:
+ // Key method. Serializes an object.
+ // n:String
+ // The name for the object, such as: "button"
+ // o:Object
+ // The object to serialize
+ //
+ var esc = function(val){
+ // have to encode certain characters that indicate an object
+ if(typeof val=="string"){
+ val = val.replace(/;/g,"_sc_");
+ val = val.replace(/\./g,"_pr_");
+ val = val.replace(/\:/g,"_cl_");
+ //val = escape(val);
+ }
+ return val;
+ };
+ var df = dojox.embed.flashVars.serialize;
+ var txt = "";
+ if(dojo.isArray(o)){
+ for(var i=0;i<o.length;i++){
+ txt += df(n+"."+i, esc(o[i]))+";";
+ }
+ return txt.replace(/;{2,}/g,";");
+ }else if(dojo.isObject(o)){
+ for(var nm in o){
+ txt += df(n+"."+nm, esc(o[nm]))+";";
+ }
+ return txt.replace(/;{2,}/g,";");
+ }
+ // Dev note: important that there is no double semi-colons
+ return n+":"+o; // String
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/embed/resources/version.mov b/js/dojo-1.6/dojox/embed/resources/version.mov Binary files differnew file mode 100644 index 0000000..4f2cb73 --- /dev/null +++ b/js/dojo-1.6/dojox/embed/resources/version.mov |
