X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/7688c6ba71852cd89123b62b2d57683535e4702a..5aa86a9053fb0fa15846bb60aac2fb8fdfff524a:/wp-includes/js/scriptaculous/sound.js diff --git a/wp-includes/js/scriptaculous/sound.js b/wp-includes/js/scriptaculous/sound.js index 164c79a0..a286eb98 100644 --- a/wp-includes/js/scriptaculous/sound.js +++ b/wp-includes/js/scriptaculous/sound.js @@ -1,6 +1,6 @@ -// script.aculo.us sound.js v1.7.1_beta3, Fri May 25 17:19:41 +0200 2007 +// script.aculo.us sound.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009 -// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) // // Based on code created by Jules Gravinese (http://www.webveteran.com/) // @@ -23,38 +23,37 @@ Sound = { 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 } + this.tracks[options.track] = { id: 0 }; else this.tracks[options.track].id++; - + options.id = this.tracks[options.track].id; - if (Prototype.Browser.IE) { - var sound = document.createElement('bgsound'); - sound.setAttribute('id','sound_'+options.track+'_'+options.id); - sound.setAttribute('src',options.url); - sound.setAttribute('loop','1'); - sound.setAttribute('autostart','true'); - $$('body')[0].appendChild(sound); - } - else - new Insertion.Bottom($$('body')[0], Sound.template.evaluate(options)); + $$('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('') + Sound.template = new Template(''); + else if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('Windows Media') != -1 })) + Sound.template = new Template(''); + else if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('RealPlayer') != -1 })) + Sound.template = new Template(''); else - Sound.play = function(){} -} + Sound.play = function(){}; +} \ No newline at end of file