summaryrefslogtreecommitdiff
path: root/assignment1/materials/Environmental Impact Assessment Course Module » 2-5 Principles for a Functio.../sound.js
diff options
context:
space:
mode:
authorrekado <rekado@elephly.net>2013-03-31 22:38:16 +0800
committerrekado <rekado@elephly.net>2013-03-31 22:38:16 +0800
commit2a1c8c643c25db4c4c6c2ded728650071a911b9f (patch)
tree54ffa9b60bd255740c312f245db97c63fa78c86e /assignment1/materials/Environmental Impact Assessment Course Module » 2-5 Principles for a Functional EIA System_files/sound.js
parent46d59cd8cdfc2d86fe4c7a50c2dea85a3752edc9 (diff)
materials
Diffstat (limited to 'assignment1/materials/Environmental Impact Assessment Course Module » 2-5 Principles for a Functional EIA System_files/sound.js')
-rw-r--r--assignment1/materials/Environmental Impact Assessment Course Module » 2-5 Principles for a Functional EIA System_files/sound.js55
1 files changed, 55 insertions, 0 deletions
diff --git a/assignment1/materials/Environmental Impact Assessment Course Module » 2-5 Principles for a Functional EIA System_files/sound.js b/assignment1/materials/Environmental Impact Assessment Course Module » 2-5 Principles for a Functional EIA System_files/sound.js
new file mode 100644
index 0000000..eba3843
--- /dev/null
+++ b/assignment1/materials/Environmental Impact Assessment Course Module » 2-5 Principles for a Functional EIA System_files/sound.js
@@ -0,0 +1,55 @@
+// script.aculo.us sound.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
+
+// Copyright (c) 2005-2007 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(){}
+}