Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Bricolage: commits

[8460] Added the missing `sound.js` file.

 

 

Bricolage commits RSS feed   Index | Next | Previous | View Threaded


theory at bricolage

Mar 6, 2009, 4:11 PM

Post #1 of 1 (346 views)
Permalink
[8460] Added the missing `sound.js` file.

Revision: 8460
Author: theory
Date: 2009-03-06 16:11:09 -0800 (Fri, 06 Mar 2009)
ViewCVS: http://viewsvn.bricolage.cc/?rev=8460&view=rev

Log Message:
-----------
Added the missing `sound.js` file.

Added Paths:
-----------
bricolage/trunk/comp/media/js/sound.js

Added: bricolage/trunk/comp/media/js/sound.js
===================================================================
--- bricolage/trunk/comp/media/js/sound.js (rev 0)
+++ bricolage/trunk/comp/media/js/sound.js 2009-03-07 00:11:09 UTC (rev 8460)
@@ -0,0 +1,55 @@
+// script.aculo.us sound.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
+
+// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
+//
+// Based on code created by Jules Gravinese (http://www.webveteran.com/)
+//
+// script.aculo.us is freely distributable under the terms of an MIT-style license.
+// For details, see the script.aculo.us web site: http://script.aculo.us/
+
+Sound = {
+ tracks: {},
+ _enabled: true,
+ template:
+ new Template('<embed style="height:0" id="sound_#{track}_#{id}" src="#{url}" loop="false" autostart="true" hidden="true"/>'),
+ enable: function(){
+ Sound._enabled = true;
+ },
+ disable: function(){
+ Sound._enabled = false;
+ },
+ play: function(url){
+ if(!Sound._enabled) return;
+ var options = Object.extend({
+ track: 'global', url: url, replace: false
+ }, arguments[1] || {});
+
+ if(options.replace && this.tracks[options.track]) {
+ $R(0, this.tracks[options.track].id).each(function(id){
+ var sound = $('sound_'+options.track+'_'+id);
+ sound.Stop && sound.Stop();
+ sound.remove();
+ });
+ this.tracks[options.track] = null;
+ }
+
+ if(!this.tracks[options.track])
+ this.tracks[options.track] = { id: 0 };
+ else
+ this.tracks[options.track].id++;
+
+ options.id = this.tracks[options.track].id;
+ $$('body')[0].insert(
+ Prototype.Browser.IE ? new Element('bgsound',{
+ id: 'sound_'+options.track+'_'+options.id,
+ src: options.url, loop: 1, autostart: true
+ }) : Sound.template.evaluate(options));
+ }
+};
+
+if(Prototype.Browser.Gecko && navigator.userAgent.indexOf("Win") > 0){
+ if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('QuickTime') != -1 }))
+ Sound.template = new Template('<object id="sound_#{track}_#{id}" width="0" height="0" type="audio/mpeg" data="#{url}"/>');
+ else
+ Sound.play = function(){};
+}
\ No newline at end of file

Bricolage commits RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.