From e44a7e37b6c7b5961adaffc62b9042b8d442938e Mon Sep 17 00:00:00 2001 From: mensonge Date: Thu, 13 Nov 2008 09:49:11 +0000 Subject: New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f --- includes/js/dojox/av/_base/quicktime.js | 161 ++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 includes/js/dojox/av/_base/quicktime.js (limited to 'includes/js/dojox/av/_base/quicktime.js') diff --git a/includes/js/dojox/av/_base/quicktime.js b/includes/js/dojox/av/_base/quicktime.js new file mode 100644 index 0000000..0c23a9e --- /dev/null +++ b/includes/js/dojox/av/_base/quicktime.js @@ -0,0 +1,161 @@ +if(!dojo._hasResource["dojox.av._base.quicktime"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.av._base.quicktime"] = true; +dojo.provide("dojox.av._base.quicktime"); + +(function(){ + /******************************************************* + dojox.av.quicktime + + Base functionality to insert a QuickTime movie + into a document on the fly. + ******************************************************/ + + var qtMarkup, qtVersion, installed, __def__={ + width: 320, + height: 240, + redirect: null, + params: [] + }; + var keyBase="dojox-av-quicktime-", keyCount=0; + + // reference to the test movie we will use for getting QT info from the browser. + var testMovieUrl=dojo.moduleUrl("dojox", "av/resources/version.mov"); + + // *** private methods ********************************************************* + function prep(kwArgs){ + kwArgs = dojo.mixin(dojo.clone(__def__), kwArgs || {}); + if(!("path" in kwArgs)){ + console.error("dojox.av._base.quicktime(ctor):: no path reference to a QuickTime movie was provided."); + return null; + } + if(!("id" in kwArgs)){ + kwArgs.id=(keyBase + keyCount++); + } + return kwArgs; + } + + var getQTMarkup = 'This content requires the QuickTime plugin.'; + if(dojo.isIE){ + installed = (function(){ + try{ + var o = new ActiveXObject("QuickTimeCheckObject.QuickTimeCheck.1"); + if(o!==undefined){ + 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 = '' + + ''; + for(var i=0, l=kwArgs.params.length; i'; + } + s += ''; + return { id: kwArgs.id, markup: s }; + } + } else { + installed = (function(){ + for(var i=0, l=navigator.plugins.length; i-1){ + return true; + } + } + return false; + })(); + + qtMarkup = function(kwArgs){ + if(!installed){ return { id: null, markup: getQTMarkup }; } + + kwArgs = prep(kwArgs); + if(!kwArgs){ return null; } + var s = '