diff options
author | Sem <sembrestels@riseup.net> | 2013-11-09 16:13:46 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2013-11-09 16:13:46 +0100 |
commit | e2a2fbdccaf0f48878903f448428cab5852d0870 (patch) | |
tree | 9cbe6b74c8e2e191ec65fba78d7435af35506f82 /mod/dokuwiki/vendors/dokuwiki/lib/plugins/s5reloaded/ui/effects_support/sound.js | |
parent | 59448d8a9864573c05477a63a6dda404c455fdb6 (diff) | |
parent | b603da53e13005c67d05efac67b70023dfffc450 (diff) | |
download | elgg-e2a2fbdccaf0f48878903f448428cab5852d0870.tar.gz elgg-e2a2fbdccaf0f48878903f448428cab5852d0870.tar.bz2 |
Add 'mod/dokuwiki/' from commit 'b603da53e13005c67d05efac67b70023dfffc450'
git-subtree-dir: mod/dokuwiki
git-subtree-mainline: 59448d8a9864573c05477a63a6dda404c455fdb6
git-subtree-split: b603da53e13005c67d05efac67b70023dfffc450
Diffstat (limited to 'mod/dokuwiki/vendors/dokuwiki/lib/plugins/s5reloaded/ui/effects_support/sound.js')
-rw-r--r-- | mod/dokuwiki/vendors/dokuwiki/lib/plugins/s5reloaded/ui/effects_support/sound.js | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/mod/dokuwiki/vendors/dokuwiki/lib/plugins/s5reloaded/ui/effects_support/sound.js b/mod/dokuwiki/vendors/dokuwiki/lib/plugins/s5reloaded/ui/effects_support/sound.js new file mode 100644 index 000000000..edacf4101 --- /dev/null +++ b/mod/dokuwiki/vendors/dokuwiki/lib/plugins/s5reloaded/ui/effects_support/sound.js @@ -0,0 +1,59 @@ +// script.aculo.us sound.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009 + +// 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/) +// +// 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 = DOKUid('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 if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('Windows Media') != -1 })) + Sound.template = new Template('<object id="sound_#{track}_#{id}" type="application/x-mplayer2" data="#{url}"></object>'); + else if(navigator.plugins && $A(navigator.plugins).detect(function(p){ return p.name.indexOf('RealPlayer') != -1 })) + Sound.template = new Template('<embed type="audio/x-pn-realaudio-plugin" style="height:0" id="sound_#{track}_#{id}" src="#{url}" loop="false" autostart="true" hidden="true"/>'); + else + Sound.play = function(){}; +}
\ No newline at end of file |