diff --git a/css/style.css b/css/style.css index b7c02c7..6e811ad 100644 --- a/css/style.css +++ b/css/style.css @@ -37,7 +37,7 @@ #background { background: transparent url(../images/debug-bg.jpg) repeat 0 0; - z-index: 0; + z-index: 0; } #ground { z-index: 30; } @@ -45,7 +45,7 @@ /* The Ship */ -#game #ship { +#game #ship { position: absolute; display: none; top:0; @@ -53,7 +53,7 @@ background: transparent; } -#ship .wing { +#ship .wing { position: absolute; top:33px; left:6px; @@ -240,7 +240,7 @@ #game-over #share-buttons { position: relative; - display: block; + display: block; text-align: center; padding: 10px 0; } @@ -255,7 +255,7 @@ position: relative; display: block; opacity: 0.1; - outline: none; + outline: none; } #game-over #share-buttons a img { border:none; outline: none; } diff --git a/index.html b/index.html index 102bd2d..1edc587 100644 --- a/index.html +++ b/index.html @@ -2,28 +2,28 @@ - - + + - - + + Wyrian - A clone Game of Tyrian in HTML5 - - + + - + - + @@ -31,7 +31,7 @@
Wyrian
Play
- +
GAME OVER
@@ -45,7 +45,7 @@
- +
@@ -68,40 +68,40 @@
FPS : 0
- +
- + - + - + - + - + - + diff --git a/js/GameClass.js b/js/GameClass.js index 15f2f3a..aed17ae 100644 --- a/js/GameClass.js +++ b/js/GameClass.js @@ -8,50 +8,50 @@ var Game = null ; // -- Init scene prototype var app = function(opts) { - + this.name = "Wyrian - A Tyrian Arcade Game Clone" ; this.version = '0.2a' ; - + // Init uniqId this.uniqId = 0 ; - + // Default settings var settings = { libs: {} } ; $.extend(true, settings, opts); this.settings = settings ; - + // Set Scene size this.width = $(document).width() ; this.height = $(document).height() ; - + // Listen for inputs this.input = new this.Input() ; - + // Return object return this; } ; // -- Bind init call app.prototype.init = function() { - + var self = this ; - + require({ baseUrl: "js/", urlArgs: "bust=" + GameVersion }, - + // -- Layout to load self.settings.layers, - + // -- All objects are loaded => can run function() { $(document).trigger('gameLoaded') ; } - ); - + ); + if ( typeof this.settings.init == 'function') { this.settings.init() ; } @@ -65,8 +65,8 @@ app.prototype.log = function(txt) { } // -- Call all canvas updates if declared as 'running' -app.prototype.loopAnimation = function() { - +app.prototype.loopAnimation = function() { + // -- Search for elements that have to be updated Game.activeElements = 0 ; for ( var i in Layouts ) { @@ -75,10 +75,10 @@ app.prototype.loopAnimation = function() { _layout.update() ; } } - + // -- Get level Level = Math.floor((Game.score||0)/1000) ; - + // -- Create ennemies if needed var numEnnemies = 0 ; if ( Layouts.Ennemies ) { @@ -90,10 +90,10 @@ app.prototype.loopAnimation = function() { Layouts.Ennemies.createRandom() ; } } - + // -- Init loops counter Game.loops = Game.loops||0 ; - + // -- Init vars if ( Game.loops == 0 ) { this.frameCount = 0; @@ -101,7 +101,7 @@ app.prototype.loopAnimation = function() { this.maxfps = 1 / (FPS / 1000); this.lastTime = new Date(); } - + // -- Calculate time deltas and find fps value var nowTime = new Date(); var diffTime = Math.ceil((nowTime.getTime() - this.lastTime.getTime())); @@ -111,10 +111,10 @@ app.prototype.loopAnimation = function() { this.lastTime = nowTime; } this.frameCount++; - + // -- Increase loop counter Game.loops++ ; - + // -- Refresh Scores and HUD informations $('#score span').html(Game.score) ; $('#activeElements span').html(Game.activeElements) ; @@ -142,7 +142,7 @@ app.prototype.Input = function() { if(e.keyCode==32) { that.keyboard['space'] = val; e.preventDefault() ; - e.stopPropagation() ; + e.stopPropagation() ; } if(e.keyCode==17) that.keyboard['ctrl'] = val; diff --git a/js/layouts/BgLayer.js b/js/layouts/BgLayer.js index 365d5b7..7a8559e 100644 --- a/js/layouts/BgLayer.js +++ b/js/layouts/BgLayer.js @@ -5,20 +5,20 @@ Layouts.Background = new Layout({ // -- Define elements to draw with options el: [{ id: 'ground', - animate: function(obj) { + animate: function(obj) { obj.y -= obj.parent.settings.speed*obj.parent.settings.direction; obj.parent.settings.dom.css({backgroundPosition: '0 '+obj.y+'px'}) ; obj.nodraw = true ; } }], - + // -- Define current Speed speed: 5, direction: -1, nomove: true, - + // -- Define canvas parent dom: $('div#background') - + }) ; diff --git a/js/layouts/Ennemies.js b/js/layouts/Ennemies.js index a1e619a..bb2b6d3 100644 --- a/js/layouts/Ennemies.js +++ b/js/layouts/Ennemies.js @@ -5,14 +5,14 @@ Layouts.Ennemies = new Layout({ // -- Define elements to draw with options el: [], images: ['images/sprites/alien_1.png?_=1', 'images/sprites/alien_2.png?_=1', 'images/sprites/explosion-sprite.png' ], - + // -- Define current Speed speed: 7, direction: 1, - + // -- Define canvas parent dom: $('div#ground') - + }) ; // -- Restart enemy @@ -28,7 +28,7 @@ Layouts.Ennemies.reinitObj = function(obj) { // -- Create a random ennemy Layouts.Ennemies.createRandom = function(opts) { var self = this ; - + var libsAlien = [ { width: 80, @@ -43,10 +43,10 @@ Layouts.Ennemies.createRandom = function(opts) { sprites: [0] } ] ; - + // Choose one in the lib var alien = libsAlien[Math.floor(Math.random()*libsAlien.length)] ; - + // Construct global properties alien.name = 'ennemy' ; alien.type = 'alien' ; @@ -60,7 +60,7 @@ Layouts.Ennemies.createRandom = function(opts) { obj.explosing = true ; obj.box.hide(0); obj = self.reinitObj(obj); - + Game.score = Game.score || 0 ; Game.score += obj.settings.power ; } ; @@ -84,8 +84,8 @@ Layouts.Ennemies.createExplosion = function(object) { var self = this ; var explosion = { - name: 'explosion', - type: 'neutral', + name: 'explosion', + type: 'neutral', width:330, height:330, imageSrc: self.settings.images[2], @@ -95,19 +95,19 @@ Layouts.Ennemies.createExplosion = function(object) { obj.settings.spriteMod = 5 ; } } - + var newObj = this.createObj(explosion) ; self.els.push(newObj) ; - + if ( timers.playSoundExplode ) clearTimeout(timers.playSoundExplode) ; timers.playSoundExplode = setTimeout(function() { soundManager.play('explode') ; }, 1000/FPS) ; - + setTimeout(function() { newObj.deleteObj() ; - if ( ! Layouts.Player.running ) + if ( ! Layouts.Player.running ) $(document).trigger('gameComplete') ; }, 500) ; - + } ; diff --git a/js/layouts/LayoutClass.js b/js/layouts/LayoutClass.js index 474718f..444a055 100644 --- a/js/layouts/LayoutClass.js +++ b/js/layouts/LayoutClass.js @@ -9,20 +9,20 @@ var Layout = function(opts) { dom: null } ; $.extend(settings, opts) ; - + // -- Set running or not this.running = true ; - + // -- Store settings - this.settings = settings ; - + this.settings = settings ; + // -- Declare Scene here this.dom = this.settings.dom.get(0) ; - + // -- Set width and height shortcuts this.width = this.settings.dom.width() ; this.height = this.settings.dom.height() ; - + // -- Create objects in scene this.els = [] ; if ( typeof settings.el == 'object' ) { @@ -30,9 +30,9 @@ var Layout = function(opts) { this.els.push(this.createObj(settings.el[i])) ; } } - + return this; -}; +}; // -- Update elements into layout Layout.prototype.update = function() { @@ -42,8 +42,8 @@ Layout.prototype.update = function() { if( ! _el.deleteAfter ) { _el.animate() ; } - else { - _el.box.addClass('removed').remove() ; + else { + _el.box.addClass('removed').remove() ; delete this.els[j] ; } } @@ -52,23 +52,23 @@ Layout.prototype.update = function() { // -- Create an object Layout.prototype.createObj = function(opts) { - + var self = this ; // -- Init and build Framebuffer object var Obj = function (optsObj) { - + // -- Parse options var settingsObj = { origin: { x: 0, y: 0}, imageSrc: false, - backgroundColor: 'transparent', - backgroundRepeat: 'no-repeat', - backgroundPosition: '0 0', + backgroundColor: 'transparent', + backgroundRepeat: 'no-repeat', + backgroundPosition: '0 0', imageOrigin: { x:0, y:0 } } ; $.extend(true, settingsObj, optsObj) ; - + // -- Store options this.parent = self ; this.name = settingsObj.name || 'default' ; @@ -76,7 +76,7 @@ Layout.prototype.createObj = function(opts) { this.width = settingsObj.width ? settingsObj.width : self.width ; this.height = settingsObj.height ? settingsObj.height : self.height ; this.settings = settingsObj ; - + // -- Find backgroundImage in CSS if specified if ( ! settingsObj.imageSrc ) { var bgImg = self.settings.dom.css('backgroundImage') ; @@ -84,67 +84,67 @@ Layout.prototype.createObj = function(opts) { settingsObj.imageSrc = bgImg ; } } - + // -- Init position this.init() ; - + // -- Create a DOM object this.box = $('#'+this.id) ; this.dynamic = false ; this.cssObj = {} ; if ( ! this.box.length ) { - + this.box = $('
', { 'class':'sprite '+this.name, 'id': this.id }) ; - + this.cssObj = { - position: 'absolute', + position: 'absolute', top: 0, left: 0, display: 'block', - backgroundColor: settingsObj.backgroundColor, + backgroundColor: settingsObj.backgroundColor, backgroundRepeat: settingsObj.backgroundRepeat, backgroundPosition: settingsObj.backgroundPosition, backgroundImage: settingsObj.imageSrc ? 'url('+settingsObj.imageSrc+')' : '' } ; - + this.dynamic = true ; } - + // -- Apply CSS this.cssObj.width = this.width ; this.cssObj.height = this.height ; - + // -- Move if ( ! this.settings.nomove ) { this.cssObj.translate = this.x+'px, '+this.y+'px' ; } - + // -- Apply CSS Append and display this.box.css(this.cssObj) ; if ( this.dynamic ) this.box.appendTo(self.dom) ; } ; - - // -- Init + + // -- Init Obj.prototype.init = function() { this.x = this.settings.origin.x ; this.y = this.settings.origin.y ; - } ; - + } ; + // -- Return instance Obj.prototype.getInstance = function() { return this; } ; - + // -- Draw object into scene Obj.prototype.draw = function() { if ( (this.y >= -2*this.height) && (this.y <= (Game.height+this.height)) && this.x >= -this.width && this.x <= (Game.width+this.width) ) { - + Game.activeElements++ ; - + // -- Set sprite to display if ( this.settings.sprites ) { this.lastSprite = this.lastSprite || 0 ; @@ -152,7 +152,7 @@ Layout.prototype.createObj = function(opts) { if ( typeof this.settings.sprites[this.lastSprite] == 'undefined' ) this.lastSprite = 0 ; this.box.css({'backgroundPosition': -1*this.settings.sprites[this.lastSprite]*this.settings.width+'px 0'}) ; } - + // -- Move div if ( ! this.settings.nomove ) { if ( this.settings.moveParent ) { @@ -162,30 +162,30 @@ Layout.prototype.createObj = function(opts) { } } } - + } ; - + // -- Animate the Framebuffer into the scene - Obj.prototype.animate = function() { - + Obj.prototype.animate = function() { + // -- Execute custom animate function if specified if ( $.isFunction(this.settings.animate) ) { this.parent = self ; this.settings.animate(this) ; - } - + } + // -- Detect collision this.detectCollision() ; - + // -- Apply effects if ( ! this.nodraw ) this.draw() ; } ; - + // -- Detect collision Obj.prototype.detectCollision = function() { - + var obj = self ; - + // -- Detect collisions for ( var i in Layouts ) { var _layout = Layouts[i] ; @@ -193,53 +193,53 @@ Layout.prototype.createObj = function(opts) { for ( var j in _layout.els ) { var el = _layout.els[j], type = el.name ; - + // -- Detect only defined types - if (! el.deleteAfter && ! el.explosing && type != 'neutral' ) { - + if (! el.deleteAfter && ! el.explosing && type != 'neutral' ) { + if ( (type == 'ennemy' || type == 'bullet' || type == 'ship') ) { - + var A = { x: this.x, y: this.y, xX: this.x+this.width, yY: this.y+this.height } ; - + var B = { x: el.x, y: el.y, xX: el.x + el.width, - yY: el.y + el.height + yY: el.y + el.height } ; - + // -- Test if in viewport if ( (type != this.name) && (this.name != 'default' && this.name != 'explosion') && (el.settings.type != this.settings.type) ) { - - var touchTopRight = ( - ( B.x <= A.xX && B.x >= A.x ) - && - ( B.yY >= A.y) && ( B.yY <= A.yY ) + + var touchTopRight = ( + ( B.x <= A.xX && B.x >= A.x ) + && + ( B.yY >= A.y) && ( B.yY <= A.yY ) ) ? true : false ; - - var touchTopLeft = ( - ( B.x >= A.x && B.x <= A.xX ) - && - ( B.yY >= A.y) && ( B.yY <= A.yY ) + + var touchTopLeft = ( + ( B.x >= A.x && B.x <= A.xX ) + && + ( B.yY >= A.y) && ( B.yY <= A.yY ) ) ? true : false ; - - var touchBottomRight = ( - ( B.x >= A.x && B.x <= A.xX ) - && - ( B.y >= A.yY) && ( B.y <= A.y ) + + var touchBottomRight = ( + ( B.x >= A.x && B.x <= A.xX ) + && + ( B.y >= A.yY) && ( B.y <= A.y ) ) ? true : false ; - - var touchBottomLeft = ( - ( B.xX >= A.x && B.xX <= A.xX ) - && - ( B.y >= A.yY) && ( B.y <= A.y ) - ) ? true : false ; - + + var touchBottomLeft = ( + ( B.xX >= A.x && B.xX <= A.xX ) + && + ( B.y >= A.yY) && ( B.y <= A.y ) + ) ? true : false ; + if ( touchTopRight || touchTopLeft || touchBottomRight || touchBottomLeft ) { if ( typeof el.settings.explode == 'function' ) { el.settings.explode(el) ; @@ -247,24 +247,24 @@ Layout.prototype.createObj = function(opts) { if ( typeof this.settings.explode == 'function' ) { this.settings.explode(this) ; } - + Game.log('█▬█ █ ▀█▀') ; } } - + } } } } } - - + + } ; - + // -- Remove object Obj.prototype.deleteObj = function() { this.deleteAfter = true ; } - + return new Obj(opts) ; -}; +}; diff --git a/js/layouts/PlayerLayer.js b/js/layouts/PlayerLayer.js index bd9ae2b..b9c5349 100644 --- a/js/layouts/PlayerLayer.js +++ b/js/layouts/PlayerLayer.js @@ -15,14 +15,14 @@ Layouts.Player = new Layout({ y: Game.height-220 }, fireInterval: 300, - explode: function(obj) { + explode: function(obj) { if ( ! obj ) return false ; obj.explosing = true ; Layouts.Ennemies.createExplosion(obj) ; Layouts.Player.running = false ; }, - animate: function(obj) { - + animate: function(obj) { + // -- KEY up /down if ( Game.input.keyboard.up ) { if ( obj.y > 0 ) obj.y -= obj.parent.settings.speed ; @@ -30,15 +30,15 @@ Layouts.Player = new Layout({ if ( Game.input.keyboard.down && (obj.y < (Game.height-obj.height) ) ) { obj.y += obj.parent.settings.speed; } - + // -- Left/Right move : choose sprite sequence to display if ( Game.input.keyboard.left && (obj.x > 0)) { obj.x -= obj.parent.settings.speed; - } + } if ( Game.input.keyboard.right && (obj.x < Game.width-obj.width) ) { obj.x += obj.parent.settings.speed; - } - + } + // -- Press Space : fire if ( Game.input.keyboard.space ) { obj.parent.fire(obj) ; @@ -46,7 +46,7 @@ Layouts.Player = new Layout({ } }, { - + id: 'ship_reactor', width: 44, height: 68, @@ -60,21 +60,21 @@ Layouts.Player = new Layout({ obj.settings.sprites = [2,3,4] ; } } - + }], - + // -- Define current Speed speed: 20, direction: 1, - + // -- Define canvas parent dom: $('div#game') - + }) ; // -- Bullets types Layouts.Player.bulletLib = function(obj, bulletType) { - + var bulletConf = { power: 40, imageSrc: 'images/bullet-electric-sprite.png', @@ -83,15 +83,15 @@ Layouts.Player.bulletLib = function(obj, bulletType) { direction: -1, type: 'human', name: 'bullet', - explode: function(obj) { + explode: function(obj) { if ( ! obj ) return false ; obj.explosing = true ; obj.deleteAfter = true ; }, origin: {x:0, y:0} } ; - - // -- Default Left + + // -- Default Left if ( bulletType == 'weapon_pilot' ) { bulletConf.width = 16 ; bulletConf.height = 64 ; @@ -100,7 +100,7 @@ Layouts.Player.bulletLib = function(obj, bulletType) { bulletConf.origin.x = obj.x-6+obj.width/2 ; bulletConf.origin.y = obj.y - bulletConf.height ; } - + // -- Big Left if ( bulletType == 'big_left' ) { bulletConf.width = 60 ; @@ -109,7 +109,7 @@ Layouts.Player.bulletLib = function(obj, bulletType) { bulletConf.origin.x = obj.x+18+obj.width/2 ; bulletConf.origin.y = obj.y + 50 - bulletConf.height ; } - + // -- Big Left if ( bulletType == 'big_right' ) { bulletConf.width = 60 ; @@ -118,12 +118,12 @@ Layouts.Player.bulletLib = function(obj, bulletType) { bulletConf.origin.x = obj.x-75+obj.width/2 ; bulletConf.origin.y = obj.y + 50 - bulletConf.height ; } - + // -- The animate function bulletConf.animate = function(obj) { if ( obj.deleteAfter ) return false; if ( obj.explosing ) { - + Game.log(obj) ; return false ; } @@ -132,25 +132,25 @@ Layouts.Player.bulletLib = function(obj, bulletType) { obj.deleteObj() ; } } ; - + // Add the bullet to display return this.createObj(bulletConf) ; - + } ; // -- Fire bullets on space bar Layouts.Player.fire = function(obj) { - + // Get now time and lastfired this.now = (new Date().getTime()) ; this.lastFired = this.lastFired || this.now ; - + // If firing, wait for next interval if ( (this.now-this.lastFired) < (obj.settings.fireInterval) ) return false; - + // Store now for last fired event this.lastFired = this.now ; - + // Create new bullets var bullets = [] ; bullets.push(this.bulletLib(obj, 'weapon_pilot')) ; @@ -159,7 +159,7 @@ Layouts.Player.fire = function(obj) { for ( var i in bullets ) { this.els.push(bullets[i]) ; } - + // Play sound soundManager.play('shoot') ; } diff --git a/js/libs/jquery-1.5.js b/js/libs/jquery-1.5.js index 5c99a8d..ff2e299 100644 --- a/js/libs/jquery-1.5.js +++ b/js/libs/jquery-1.5.js @@ -2680,7 +2680,7 @@ jQuery.Event = function( src ) { // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false || + this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false || src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse; // Event type @@ -2954,8 +2954,8 @@ if ( document.addEventListener ) { jQuery.event.special[ fix ] = { setup: function() { this.addEventListener( orig, handler, true ); - }, - teardown: function() { + }, + teardown: function() { this.removeEventListener( orig, handler, true ); } }; @@ -3289,7 +3289,7 @@ var Sizzle = function( selector, context, results, seed ) { if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } - + if ( !selector || typeof selector !== "string" ) { return results; } @@ -3299,7 +3299,7 @@ var Sizzle = function( selector, context, results, seed ) { contextXML = Sizzle.isXML( context ), parts = [], soFar = selector; - + // Reset the position of the chunker regexp (start from head) do { chunker.exec( "" ); @@ -3307,9 +3307,9 @@ var Sizzle = function( selector, context, results, seed ) { if ( m ) { soFar = m[3]; - + parts.push( m[1] ); - + if ( m[2] ) { extra = m[3]; break; @@ -3333,7 +3333,7 @@ var Sizzle = function( selector, context, results, seed ) { if ( Expr.relative[ selector ] ) { selector += parts.shift(); } - + set = posProcess( selector, set ); } } @@ -3462,7 +3462,7 @@ Sizzle.find = function( expr, context, isXML ) { for ( var i = 0, l = Expr.order.length; i < l; i++ ) { var match, type = Expr.order[i]; - + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { var left = match[1]; match.splice( 1, 1 ); @@ -3791,7 +3791,7 @@ var Expr = Sizzle.selectors = { ATTR: function( match, curLoop, inplace, result, not, isXML ) { var name = match[1] = match[1].replace(/\\/g, ""); - + if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } @@ -3825,7 +3825,7 @@ var Expr = Sizzle.selectors = { } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } - + return match; }, @@ -3835,7 +3835,7 @@ var Expr = Sizzle.selectors = { return match; } }, - + filters: { enabled: function( elem ) { return elem.disabled === false && elem.type !== "hidden"; @@ -3848,12 +3848,12 @@ var Expr = Sizzle.selectors = { checked: function( elem ) { return elem.checked === true; }, - + selected: function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly elem.parentNode.selectedIndex; - + return elem.selected === true; }, @@ -3979,21 +3979,21 @@ var Expr = Sizzle.selectors = { case "only": case "first": while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } - if ( type === "first" ) { - return true; + if ( type === "first" ) { + return true; } node = elem; case "last": while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; + if ( node.nodeType === 1 ) { + return false; } } @@ -4006,22 +4006,22 @@ var Expr = Sizzle.selectors = { if ( first === 1 && last === 0 ) { return true; } - + var doneName = match[0], parent = elem.parentNode; - + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { var count = 0; - + for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } - } + } parent.sizcache = doneName; } - + var diff = elem.nodeIndex - last; if ( first === 0 ) { @@ -4040,7 +4040,7 @@ var Expr = Sizzle.selectors = { TAG: function( elem, match ) { return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; }, - + CLASS: function( elem, match ) { return (" " + (elem.className || elem.getAttribute("class")) + " ") .indexOf( match ) > -1; @@ -4106,7 +4106,7 @@ var makeArray = function( array, results ) { results.push.apply( results, array ); return results; } - + return array; }; @@ -4353,7 +4353,7 @@ if ( document.querySelectorAll ) { if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } - + Sizzle = function( query, context, extra, seed ) { context = context || document; @@ -4362,24 +4362,24 @@ if ( document.querySelectorAll ) { if ( !seed && !Sizzle.isXML(context) ) { // See if we find a selector to speed up var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); - + if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { // Speed-up: Sizzle("TAG") if ( match[1] ) { return makeArray( context.getElementsByTagName( query ), extra ); - + // Speed-up: Sizzle(".CLASS") } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { return makeArray( context.getElementsByClassName( match[2] ), extra ); } } - + if ( context.nodeType === 9 ) { // Speed-up: Sizzle("body") // The body element only exists once, optimize finding it if ( query === "body" && context.body ) { return makeArray( [ context.body ], extra ); - + // Speed-up: Sizzle("#ID") } else if ( match && match[3] ) { var elem = context.getElementById( match[3] ); @@ -4392,12 +4392,12 @@ if ( document.querySelectorAll ) { if ( elem.id === match[3] ) { return makeArray( [ elem ], extra ); } - + } else { return makeArray( [], extra ); } } - + try { return makeArray( context.querySelectorAll(query), extra ); } catch(qsaError) {} @@ -4434,7 +4434,7 @@ if ( document.querySelectorAll ) { } } } - + return oldSizzle(query, context, extra, seed); }; @@ -4456,7 +4456,7 @@ if ( document.querySelectorAll ) { // This should fail with an exception // Gecko does not error, returns false instead matches.call( document.documentElement, "[test!='']:sizzle" ); - + } catch( pseudoError ) { pseudoWorks = true; } @@ -4467,7 +4467,7 @@ if ( document.querySelectorAll ) { expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); if ( !Sizzle.isXML( node ) ) { - try { + try { if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { return matches.call( node, expr ); } @@ -4496,7 +4496,7 @@ if ( document.querySelectorAll ) { if ( div.getElementsByClassName("e").length === 1 ) { return; } - + Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function( match, context, isXML ) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { @@ -4547,7 +4547,7 @@ function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { if ( elem ) { var match = false; - + elem = elem[dir]; while ( elem ) { @@ -4600,7 +4600,7 @@ if ( document.documentElement.contains ) { Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) + // (such as loading iframes in IE - #4833) var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; @@ -5910,7 +5910,7 @@ if ( document.defaultView && document.defaultView.getComputedStyle ) { if ( document.documentElement.currentStyle ) { currentStyle = function( elem, name ) { - var left, + var left, ret = elem.currentStyle && elem.currentStyle[ name ], rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ], style = elem.style; diff --git a/js/libs/jquery.transform-0.9.3.min.js b/js/libs/jquery.transform-0.9.3.min.js index 9006041..cd619bb 100644 --- a/js/libs/jquery.transform-0.9.3.min.js +++ b/js/libs/jquery.transform-0.9.3.min.js @@ -5,7 +5,7 @@ * Copyright 2010, Grady Kuhnline * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license - * + * * Date: Sat Dec 4 15:46:09 2010 -0800 */ (function(f,g,j,b){var h=/progid:DXImageTransform\.Microsoft\.Matrix\(.*?\)/,c=/^([\+\-]=)?([\d+.\-]+)(.*)$/,q=/%/;var d=j.createElement("modernizr"),e=d.style;function n(s){return parseFloat(s)}function l(){var s={transformProperty:"",MozTransform:"-moz-",WebkitTransform:"-webkit-",OTransform:"-o-",msTransform:"-ms-"};for(var t in s){if(typeof e[t]!="undefined"){return s[t]}}return null}function r(){if(typeof(g.Modernizr)!=="undefined"){return Modernizr.csstransforms}var t=["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"];for(var s in t){if(e[t[s]]!==b){return true}}}var a=l(),i=a!==null?a+"transform":false,k=a!==null?a+"transform-origin":false;f.support.csstransforms=r();if(a=="-ms-"){i="msTransform";k="msTransformOrigin"}f.extend({transform:function(s){s.transform=this;this.$elem=f(s);this.applyingMatrix=false;this.matrix=null;this.height=null;this.width=null;this.outerHeight=null;this.outerWidth=null;this.boxSizingValue=null;this.boxSizingProperty=null;this.attr=null;this.transformProperty=i;this.transformOriginProperty=k}});f.extend(f.transform,{funcs:["matrix","origin","reflect","reflectX","reflectXY","reflectY","rotate","scale","scaleX","scaleY","skew","skewX","skewY","translate","translateX","translateY"]});f.fn.transform=function(s,t){return this.each(function(){var u=this.transform||new f.transform(this);if(s){u.exec(s,t)}})};f.transform.prototype={exec:function(s,t){t=f.extend(true,{forceMatrix:false,preserve:false},t);this.attr=null;if(t.preserve){s=f.extend(true,this.getAttrs(true,true),s)}else{s=f.extend(true,{},s)}this.setAttrs(s);if(f.support.csstransforms&&!t.forceMatrix){return this.execFuncs(s)}else{if(f.browser.msie||(f.support.csstransforms&&t.forceMatrix)){return this.execMatrix(s)}}return false},execFuncs:function(t){var s=[];for(var u in t){if(u=="origin"){this[u].apply(this,f.isArray(t[u])?t[u]:[t[u]])}else{if(f.inArray(u,f.transform.funcs)!==-1){s.push(this.createTransformFunc(u,t[u]))}}}this.$elem.css(i,s.join(" "));return true},execMatrix:function(z){var C,x,t;var F=this.$elem[0],B=this;function A(N,M){if(q.test(N)){return parseFloat(N)/100*B["safeOuter"+(M?"Height":"Width")]()}return o(F,N)}var s=/translate[X|Y]?/,u=[];for(var v in z){switch(f.type(z[v])){case"array":t=z[v];break;case"string":t=f.map(z[v].split(","),f.trim);break;default:t=[z[v]]}if(f.matrix[v]){if(f.cssAngle[v]){t=f.map(t,f.angle.toDegree)}else{if(!f.cssNumber[v]){t=f.map(t,A)}else{t=f.map(t,n)}}x=f.matrix[v].apply(this,t);if(s.test(v)){u.push(x)}else{C=C?C.x(x):x}}else{if(v=="origin"){this[v].apply(this,t)}}}C=C||f.matrix.identity();f.each(u,function(M,N){C=C.x(N)});var K=parseFloat(C.e(1,1).toFixed(6)),I=parseFloat(C.e(2,1).toFixed(6)),H=parseFloat(C.e(1,2).toFixed(6)),G=parseFloat(C.e(2,2).toFixed(6)),L=C.rows===3?parseFloat(C.e(1,3).toFixed(6)):0,J=C.rows===3?parseFloat(C.e(2,3).toFixed(6)):0;if(f.support.csstransforms&&a==="-moz-"){this.$elem.css(i,"matrix("+K+", "+I+", "+H+", "+G+", "+L+"px, "+J+"px)")}else{if(f.support.csstransforms){this.$elem.css(i,"matrix("+K+", "+I+", "+H+", "+G+", "+L+", "+J+")")}else{if(f.browser.msie){var w=", FilterType='nearest neighbor'";var D=this.$elem[0].style;var E="progid:DXImageTransform.Microsoft.Matrix(M11="+K+", M12="+H+", M21="+I+", M22="+G+", sizingMethod='auto expand'"+w+")";var y=D.filter||f.curCSS(this.$elem[0],"filter")||"";D.filter=h.test(y)?y.replace(h,E):y?y+" "+E:E;this.applyingMatrix=true;this.matrix=C;this.fixPosition(C,L,J);this.applyingMatrix=false;this.matrix=null}}}return true},origin:function(s,t){if(f.support.csstransforms){if(typeof t==="undefined"){this.$elem.css(k,s)}else{this.$elem.css(k,s+" "+t)}return true}switch(s){case"left":s="0";break;case"right":s="100%";break;case"center":case b:s="50%"}switch(t){case"top":t="0";break;case"bottom":t="100%";break;case"center":case b:t="50%"}this.setAttr("origin",[q.test(s)?s:o(this.$elem[0],s)+"px",q.test(t)?t:o(this.$elem[0],t)+"px"]);return true},createTransformFunc:function(t,u){if(t.substr(0,7)==="reflect"){var s=u?f.matrix[t]():f.matrix.identity();return"matrix("+s.e(1,1)+", "+s.e(2,1)+", "+s.e(1,2)+", "+s.e(2,2)+", 0, 0)"}if(t=="matrix"){if(a==="-moz-"){u[4]=u[4]?u[4]+"px":0;u[5]=u[5]?u[5]+"px":0}}return t+"("+(f.isArray(u)?u.join(", "):u)+")"},fixPosition:function(B,y,x,D,s){var w=new f.matrix.calc(B,this.safeOuterHeight(),this.safeOuterWidth()),C=this.getAttr("origin");var v=w.originOffset(new f.matrix.V2(q.test(C[0])?parseFloat(C[0])/100*w.outerWidth:parseFloat(C[0]),q.test(C[1])?parseFloat(C[1])/100*w.outerHeight:parseFloat(C[1])));var t=w.sides();var u=this.$elem.css("position");if(u=="static"){u="relative"}var A={top:0,left:0};var z={position:u,top:(v.top+x+t.top+A.top)+"px",left:(v.left+y+t.left+A.left)+"px",zoom:1};this.$elem.css(z)}};function o(s,u){var t=c.exec(f.trim(u));if(t[3]&&t[3]!=="px"){var w="paddingBottom",v=f.style(s,w);f.style(s,w,u);u=p(s,w);f.style(s,w,v);return u}return parseFloat(u)}function p(t,u){if(t[u]!=null&&(!t.style||t.style[u]==null)){return t[u]}var s=parseFloat(f.css(t,u));return s&&s>-10000?s:0}})(jQuery,this,this.document);(function(d,c,a,f){d.extend(d.transform.prototype,{safeOuterHeight:function(){return this.safeOuterLength("height")},safeOuterWidth:function(){return this.safeOuterLength("width")},safeOuterLength:function(l){var p="outer"+(l=="width"?"Width":"Height");if(!d.support.csstransforms&&d.browser.msie){l=l=="width"?"width":"height";if(this.applyingMatrix&&!this[p]&&this.matrix){var k=new d.matrix.calc(this.matrix,1,1),n=k.offset(),g=this.$elem[p]()/n[l];this[p]=g;return g}else{if(this.applyingMatrix&&this[p]){return this[p]}}var o={height:["top","bottom"],width:["left","right"]};var h=this.$elem[0],j=parseFloat(d.curCSS(h,l,true)),q=this.boxSizingProperty,i=this.boxSizingValue;if(!this.boxSizingProperty){q=this.boxSizingProperty=e()||"box-sizing";i=this.boxSizingValue=this.$elem.css(q)||"content-box"}if(this[p]&&this[l]==j){return this[p]}else{this[l]=j}if(q&&(i=="padding-box"||i=="content-box")){j+=parseFloat(d.curCSS(h,"padding-"+o[l][0],true))||0+parseFloat(d.curCSS(h,"padding-"+o[l][1],true))||0}if(q&&i=="content-box"){j+=parseFloat(d.curCSS(h,"border-"+o[l][0]+"-width",true))||0+parseFloat(d.curCSS(h,"border-"+o[l][1]+"-width",true))||0}this[p]=j;return j}return this.$elem[p]()}});var b=null;function e(){if(b){return b}var h={boxSizing:"box-sizing",MozBoxSizing:"-moz-box-sizing",WebkitBoxSizing:"-webkit-box-sizing",OBoxSizing:"-o-box-sizing"},g=a.body;for(var i in h){if(typeof g.style[i]!="undefined"){b=h[i];return b}}return null}})(jQuery,this,this.document);(function(g,f,b,h){var d=/([\w\-]*?)\((.*?)\)/g,a="data-transform",e=/\s/,c=/,\s?/;g.extend(g.transform.prototype,{setAttrs:function(i){var j="",l;for(var k in i){l=i[k];if(g.isArray(l)){l=l.join(", ")}j+=" "+k+"("+l+")"}this.attr=g.trim(j);this.$elem.attr(a,this.attr)},setAttr:function(k,l){if(g.isArray(l)){l=l.join(", ")}var j=this.attr||this.$elem.attr(a);if(!j||j.indexOf(k)==-1){this.attr=g.trim(j+" "+k+"("+l+")");this.$elem.attr(a,this.attr)}else{var i=[],n;d.lastIndex=0;while(n=d.exec(j)){if(k==n[1]){i.push(k+"("+l+")")}else{i.push(n[0])}}this.attr=i.join(" ");this.$elem.attr(a,this.attr)}},getAttrs:function(){var j=this.attr||this.$elem.attr(a);if(!j){return{}}var i={},l,k;d.lastIndex=0;while((l=d.exec(j))!==null){if(l){k=l[2].split(c);i[l[1]]=k.length==1?k[0]:k}}return i},getAttr:function(j){var i=this.getAttrs();if(typeof i[j]!=="undefined"){return i[j]}if(j==="origin"&&g.support.csstransforms){return this.$elem.css(this.transformOriginProperty).split(e)}else{if(j==="origin"){return["50%","50%"]}}return g.cssDefault[j]||0}});if(typeof(g.cssAngle)=="undefined"){g.cssAngle={}}g.extend(g.cssAngle,{rotate:true,skew:true,skewX:true,skewY:true});if(typeof(g.cssDefault)=="undefined"){g.cssDefault={}}g.extend(g.cssDefault,{scale:[1,1],scaleX:1,scaleY:1,matrix:[1,0,0,1,0,0],origin:["50%","50%"],reflect:[1,0,0,1,0,0],reflectX:[1,0,0,1,0,0],reflectXY:[1,0,0,1,0,0],reflectY:[1,0,0,1,0,0]});if(typeof(g.cssMultipleValues)=="undefined"){g.cssMultipleValues={}}g.extend(g.cssMultipleValues,{matrix:6,origin:{length:2,duplicate:true},reflect:6,reflectX:6,reflectXY:6,reflectY:6,scale:{length:2,duplicate:true},skew:2,translate:2});g.extend(g.cssNumber,{matrix:true,reflect:true,reflectX:true,reflectXY:true,reflectY:true,scale:true,scaleX:true,scaleY:true});g.each(g.transform.funcs,function(j,k){g.cssHooks[k]={set:function(n,o){var l=n.transform||new g.transform(n),i={};i[k]=o;l.exec(i,{preserve:true})},get:function(n,l){var i=n.transform||new g.transform(n);return i.getAttr(k)}}});g.each(["reflect","reflectX","reflectXY","reflectY"],function(j,k){g.cssHooks[k].get=function(n,l){var i=n.transform||new g.transform(n);return i.getAttr("matrix")||g.cssDefault[k]}})})(jQuery,this,this.document);(function(e,g,h,c){var d=/^([+\-]=)?([\d+.\-]+)(.*)$/;var a=e.fn.animate;e.fn.animate=function(p,l,o,n){var k=e.speed(l,o,n),j=e.cssMultipleValues;k.complete=k.old;if(!e.isEmptyObject(p)){if(typeof k.original==="undefined"){k.original={}}e.each(p,function(s,u){if(j[s]||e.cssAngle[s]||(!e.cssNumber[s]&&e.inArray(s,e.transform.funcs)!==-1)){var t=null;if(jQuery.isArray(p[s])){var r=1,q=u.length;if(j[s]){r=(typeof j[s].length==="undefined"?j[s]:j[s].length)}if(q>r||(q-10000?j:0}var f=e.fx.prototype.custom;e.fx.prototype.custom=function(u,v,w){var y=e.cssMultipleValues[this.prop],p=e.cssAngle[this.prop];if(y||(!e.cssNumber[this.prop]&&e.inArray(this.prop,e.transform.funcs)!==-1)){this.values=[];if(!y){y=1}var x=this.options.original[this.prop],t=e(this.elem).css(this.prop),j=e.cssDefault[this.prop]||0;if(!e.isArray(t)){t=[t]}if(!e.isArray(x)){if(e.type(x)==="string"){x=x.split(",")}else{x=[x]}}var l=y.length||y,s=0;while(x.lengthi||h>i||k<1||h<1){return 0}return this.elements[(k-1)*j+h-1]},decompose:function(){var v=this.e(1,1),t=this.e(2,1),q=this.e(1,2),p=this.e(2,2),o=this.e(1,3),n=this.e(2,3);if(Math.abs(v*p-t*q)<0.01){return{rotate:0+"deg",skewX:0+"deg",scaleX:1,scaleY:1,translateX:0+"px",translateY:0+"px"}}var l=o,j=n;var u=Math.sqrt(v*v+t*t);v=v/u;t=t/u;var i=v*q+t*p;q-=v*i;p-=t*i;var s=Math.sqrt(q*q+p*p);q=q/s;p=p/s;i=i/s;if((v*p-t*q)<0){v=-v;t=-t;u=-u}var w=f.angle.radianToDegree;var h=w(Math.atan2(t,v));i=w(Math.atan(i));return{rotate:h+"deg",skewX:i+"deg",scaleX:u,scaleY:s,translateX:l+"px",translateY:j+"px"}}};f.extend(d.M2x2.prototype,c,{toM3x3:function(){var h=this.elements;return new d.M3x3(h[0],h[1],0,h[2],h[3],0,0,0,1)},x:function(j){var k=typeof(j.rows)==="undefined";if(!k&&j.rows==3){return this.toM3x3().x(j)}var i=this.elements,h=j.elements;if(k&&h.length==2){return new d.V2(i[0]*h[0]+i[1]*h[1],i[2]*h[0]+i[3]*h[1])}else{if(h.length==i.length){return new d.M2x2(i[0]*h[0]+i[1]*h[2],i[0]*h[1]+i[1]*h[3],i[2]*h[0]+i[3]*h[2],i[2]*h[1]+i[3]*h[3])}}return false},inverse:function(){var i=1/this.determinant(),h=this.elements;return new d.M2x2(i*h[3],i*-h[1],i*-h[2],i*h[0])},determinant:function(){var h=this.elements;return h[0]*h[3]-h[1]*h[2]}});f.extend(d.M3x3.prototype,c,{x:function(j){var k=typeof(j.rows)==="undefined";if(!k&&j.rows<3){j=j.toM3x3()}var i=this.elements,h=j.elements;if(k&&h.length==3){return new d.V3(i[0]*h[0]+i[1]*h[1]+i[2]*h[2],i[3]*h[0]+i[4]*h[1]+i[5]*h[2],i[6]*h[0]+i[7]*h[1]+i[8]*h[2])}else{if(h.length==i.length){return new d.M3x3(i[0]*h[0]+i[1]*h[3]+i[2]*h[6],i[0]*h[1]+i[1]*h[4]+i[2]*h[7],i[0]*h[2]+i[1]*h[5]+i[2]*h[8],i[3]*h[0]+i[4]*h[3]+i[5]*h[6],i[3]*h[1]+i[4]*h[4]+i[5]*h[7],i[3]*h[2]+i[4]*h[5]+i[5]*h[8],i[6]*h[0]+i[7]*h[3]+i[8]*h[6],i[6]*h[1]+i[7]*h[4]+i[8]*h[7],i[6]*h[2]+i[7]*h[5]+i[8]*h[8])}}return false},inverse:function(){var i=1/this.determinant(),h=this.elements;return new d.M3x3(i*(h[8]*h[4]-h[7]*h[5]),i*(-(h[8]*h[1]-h[7]*h[2])),i*(h[5]*h[1]-h[4]*h[2]),i*(-(h[8]*h[3]-h[6]*h[5])),i*(h[8]*h[0]-h[6]*h[2]),i*(-(h[5]*h[0]-h[3]*h[2])),i*(h[7]*h[3]-h[6]*h[4]),i*(-(h[7]*h[0]-h[6]*h[1])),i*(h[4]*h[0]-h[3]*h[1]))},determinant:function(){var h=this.elements;return h[0]*(h[8]*h[4]-h[7]*h[5])-h[3]*(h[8]*h[1]-h[7]*h[2])+h[6]*(h[5]*h[1]-h[4]*h[2])}});var a={e:function(h){return this.elements[h-1]}};f.extend(d.V2.prototype,a);f.extend(d.V3.prototype,a)})(jQuery,this,this.document);(function(c,b,a,d){if(typeof(c.matrix)=="undefined"){c.extend({matrix:{}})}c.extend(c.matrix,{calc:function(e,f,g){this.matrix=e;this.outerHeight=f;this.outerWidth=g}});c.matrix.calc.prototype={coord:function(e,i,h){h=typeof(h)!=="undefined"?h:0;var g=this.matrix,f;switch(g.rows){case 2:f=g.x(new c.matrix.V2(e,i));break;case 3:f=g.x(new c.matrix.V3(e,i,h));break}return f},corners:function(e,h){var f=!(typeof(e)!=="undefined"||typeof(h)!=="undefined"),g;if(!this.c||!f){h=h||this.outerHeight;e=e||this.outerWidth;g={tl:this.coord(0,0),bl:this.coord(0,h),tr:this.coord(e,0),br:this.coord(e,h)}}else{g=this.c}if(f){this.c=g}return g},sides:function(e){var f=e||this.corners();return{top:Math.min(f.tl.e(2),f.tr.e(2),f.br.e(2),f.bl.e(2)),bottom:Math.max(f.tl.e(2),f.tr.e(2),f.br.e(2),f.bl.e(2)),left:Math.min(f.tl.e(1),f.tr.e(1),f.br.e(1),f.bl.e(1)),right:Math.max(f.tl.e(1),f.tr.e(1),f.br.e(1),f.bl.e(1))}},offset:function(e){var f=this.sides(e);return{height:Math.abs(f.bottom-f.top),width:Math.abs(f.right-f.left)}},area:function(e){var h=e||this.corners();var g={x:h.tr.e(1)-h.tl.e(1)+h.br.e(1)-h.bl.e(1),y:h.tr.e(2)-h.tl.e(2)+h.br.e(2)-h.bl.e(2)},f={x:h.bl.e(1)-h.tl.e(1)+h.br.e(1)-h.tr.e(1),y:h.bl.e(2)-h.tl.e(2)+h.br.e(2)-h.tr.e(2)};return 0.25*Math.abs(g.e(1)*f.e(2)-g.e(2)*f.e(1))},nonAffinity:function(){var f=this.sides(),g=f.top-f.bottom,e=f.left-f.right;return parseFloat(parseFloat(Math.abs((Math.pow(g,2)+Math.pow(e,2))/(f.top*f.bottom+f.left*f.right))).toFixed(8))},originOffset:function(h,g){h=h?h:new c.matrix.V2(this.outerWidth*0.5,this.outerHeight*0.5);g=g?g:new c.matrix.V2(0,0);var e=this.coord(h.e(1),h.e(2));var f=this.coord(g.e(1),g.e(2));return{top:(f.e(2)-g.e(2))-(e.e(2)-h.e(2)),left:(f.e(1)-g.e(1))-(e.e(1)-h.e(1))}}}})(jQuery,this,this.document);(function(e,d,a,f){if(typeof(e.matrix)=="undefined"){e.extend({matrix:{}})}var c=e.matrix,g=c.M2x2,b=c.M3x3;e.extend(c,{identity:function(k){k=k||2;var l=k*k,n=new Array(l),j=k+1;for(var h=0;hCanvas-based UI with visualization options. Note: No EQ/spectrum support for IE (too slow.) Data not available in HTML5.

- +
diff --git a/js/libs/soundmanager/demo/360-player/canvas-visualization.html b/js/libs/soundmanager/demo/360-player/canvas-visualization.html index b5635f8..4c51abd 100644 --- a/js/libs/soundmanager/demo/360-player/canvas-visualization.html +++ b/js/libs/soundmanager/demo/360-player/canvas-visualization.html @@ -101,7 +101,7 @@ pre.block { - +

SoundManager 2 / 360° Player Demo: JS + Canvas Visualization

@@ -209,19 +209,19 @@ pre.block { Background ring color:
- +

- +
- +
- +
@@ -253,7 +253,7 @@ pre.block {
20060826 - Armstrong Groove
- +

Artist thank-yous: "Blue Belle Lament" courtesy of Adrian Glynn. "I Tried" and "People Asking" courtesy of SonReal.

Block list

@@ -263,10 +263,10 @@ pre.block {
1-10 Khz Sweep (Warning: LOUD)
Sine, Square, Sawtooth, Wave (Warning: LOUD)
- +
- +

Variant: Annotations/meta-data

@@ -316,15 +316,15 @@ pre.block {
- +

SoundManager 2 project page (not an MP3 link)

- + diff --git a/js/libs/soundmanager/demo/360-player/demo.css b/js/libs/soundmanager/demo/360-player/demo.css index 5f4cbcf..3b02a9f 100644 --- a/js/libs/soundmanager/demo/360-player/demo.css +++ b/js/libs/soundmanager/demo/360-player/demo.css @@ -1,4 +1,4 @@ -/* +/* ------------------------------------------------------------- @@ -28,7 +28,7 @@ h1 { } h1, h2 { - letter-spacing:-1px; /* zomg web x.0! ;) */ + letter-spacing:-1px; /* zomg web x.0! ;) */ } h2 { diff --git a/js/libs/soundmanager/demo/360-player/index.html b/js/libs/soundmanager/demo/360-player/index.html index 97ab1f1..02be373 100644 --- a/js/libs/soundmanager/demo/360-player/index.html +++ b/js/libs/soundmanager/demo/360-player/index.html @@ -70,7 +70,7 @@ pre.block {
- + @@ -96,17 +96,17 @@ pre.block {
- +

How This Works

The script looks for a container element matching div.ui360, and then the first link inside of it.

- +
<div class="ui360">
  <a href="/path/to/an.mp3">
 </div>
- +

When the link is clicked, the script adds a UI template to the block, prepending it in front of the MP3 link:

@@ -115,7 +115,7 @@ pre.block { <-- dynamically-inserted block --> <div class="ui"> <canvas class="sm2-canvas"></canvas> - <img class="sm2-360btn" /> + <img class="sm2-360btn" /> <div class="sm2-timing"></div> <div class="sm2-cover"></div> </div> diff --git a/js/libs/soundmanager/demo/animation-1/css/animation.css b/js/libs/soundmanager/demo/animation-1/css/animation.css index 5da9e5d..3beee15 100644 --- a/js/libs/soundmanager/demo/animation-1/css/animation.css +++ b/js/libs/soundmanager/demo/animation-1/css/animation.css @@ -9,7 +9,7 @@ h1, h2, h3 { } h1, h2 { - letter-spacing:-1px; /* zomg web x.0! ;) */ + letter-spacing:-1px; /* zomg web x.0! ;) */ } h1, h2, h3 { diff --git a/js/libs/soundmanager/demo/animation-1/index.html b/js/libs/soundmanager/demo/animation-1/index.html index d3cb72d..87fa1de 100644 --- a/js/libs/soundmanager/demo/animation-1/index.html +++ b/js/libs/soundmanager/demo/animation-1/index.html @@ -10,7 +10,7 @@
- +

Interval-based animation (with sound)

diff --git a/js/libs/soundmanager/demo/animation-2a/index.html b/js/libs/soundmanager/demo/animation-2a/index.html index 65cbfce..cf9885f 100644 --- a/js/libs/soundmanager/demo/animation-2a/index.html +++ b/js/libs/soundmanager/demo/animation-2a/index.html @@ -28,7 +28,7 @@ h1 { } h1, h2 { - letter-spacing:-1px; /* zomg web x.0! ;) */ + letter-spacing:-1px; /* zomg web x.0! ;) */ } h2 { @@ -226,7 +226,7 @@ function Cursor() { window.onresize = this.refreshCoords; _id('overlay').onmousedown = this.mousedown; - _id('overlay').onmouseup = this.mouseup; + _id('overlay').onmouseup = this.mouseup; document.onmousemove = this.mousemove; } diff --git a/js/libs/soundmanager/demo/animation-2b/css/animation.css b/js/libs/soundmanager/demo/animation-2b/css/animation.css index 4eea63d..51506dc 100644 --- a/js/libs/soundmanager/demo/animation-2b/css/animation.css +++ b/js/libs/soundmanager/demo/animation-2b/css/animation.css @@ -17,7 +17,7 @@ h1 { } h1, h2 { - letter-spacing:-1px; /* zomg web x.0! ;) */ + letter-spacing:-1px; /* zomg web x.0! ;) */ } h2 { diff --git a/js/libs/soundmanager/demo/api/index.html b/js/libs/soundmanager/demo/api/index.html index 3c7ebab..8882c55 100644 --- a/js/libs/soundmanager/demo/api/index.html +++ b/js/libs/soundmanager/demo/api/index.html @@ -97,7 +97,7 @@ soundManager.consoleOnly = false; soundManager.onready(function(oStatus) { if (!oStatus.success) { - return false; + return false; } // soundManager is initialised, ready to use. Create a sound for this demo page. @@ -211,7 +211,7 @@ soundManager.onerror = function() {

SoundManager first processes the onready or ontimeout queue in the order items were added, and then fires soundManager.onload() or onerror(). If you call onready() after SM2 has loaded, your callback will be fired immediately.

A note about initialization

- +

Keep in mind SoundManager's core methods (createSound, etc.) will not be available until soundManager.onload() fires. The initialization time for SM2 can vary across browsers/platforms, and should effectively be assumed to be "asynchronous." Because of this, it is recommended you write your code to handle soundManager.onload() being called either before or after window.onload().

If you wish to have SM2 always wait for window.onload() before calling soundManager.onload()/onerror(), you can apply the following:

soundManager.waitForWindowLoad = true;
@@ -354,7 +354,7 @@ s.play({

onposition() allows you to add an event listener for a given time (in miliseconds, watching the position property); the event fires when that time has been reached while a sound is playing.

Note that for multiShot cases, the listeners will only fire for the original (first) shot because its position is the only one that is tracked within Flash.

- +

Demo 5a: Set sound parameters, then play

var sound = soundManager.getSoundById('chinaCymbal'); // predefined/preloaded sound
 sound.setPosition(500); // 500 msec into sound
diff --git a/js/libs/soundmanager/demo/flashblock/basic.html b/js/libs/soundmanager/demo/flashblock/basic.html
index 3238d81..af42294 100644
--- a/js/libs/soundmanager/demo/flashblock/basic.html
+++ b/js/libs/soundmanager/demo/flashblock/basic.html
@@ -24,7 +24,7 @@ soundManager.url = '../../swf/';
 
 
 
- +

SoundManager 2: Flashblock / "click to flash" handling: Basic Demo

diff --git a/js/libs/soundmanager/demo/flashblock/flashblock.css b/js/libs/soundmanager/demo/flashblock/flashblock.css index 2dbdd22..b015dd1 100644 --- a/js/libs/soundmanager/demo/flashblock/flashblock.css +++ b/js/libs/soundmanager/demo/flashblock/flashblock.css @@ -30,7 +30,7 @@ #sm2-container.swf_timedout, #sm2-container.swf_timedout object, #sm2-container.swf_timedout embed { - /* + /* when SM2 didn't start normally, time-out case. flash blocked, missing SWF, no flash? 48px square flash placeholder is typically used by blockers. */ diff --git a/js/libs/soundmanager/demo/flashblock/index.html b/js/libs/soundmanager/demo/flashblock/index.html index 8ce4250..29c2d60 100644 --- a/js/libs/soundmanager/demo/flashblock/index.html +++ b/js/libs/soundmanager/demo/flashblock/index.html @@ -49,7 +49,7 @@ soundManager.onready(function(){
- +

SoundManager 2: Flashblock / "click to flash" handling demos

Show SWF inline, wait indefinitely for load (click-to-run or whitelist)

@@ -83,9 +83,9 @@ soundManager.onready(function(){
- +

Flash Block-related CSS

- +

When soundManager.useFlashBlock is enabled, CSS is applied to #sm2-container depending on the progress of SM2's start-up.

This page + demos use the rules below, fully-defined and commented in flashblock.css. Use it as a base for your own SM2 + flash block implementations.

@@ -116,7 +116,7 @@ soundManager.onready(function(){ }

Basic Demo

- +

For a more minimal example, see the basic flashblock demo.

- +
diff --git a/js/libs/soundmanager/demo/flashblock/method1/index.html b/js/libs/soundmanager/demo/flashblock/method1/index.html index 3ac7c9e..ed64d77 100644 --- a/js/libs/soundmanager/demo/flashblock/method1/index.html +++ b/js/libs/soundmanager/demo/flashblock/method1/index.html @@ -46,7 +46,7 @@ soundManager.ontimeout(function(){
- +

SoundManager 2: Flashblock / "click to flash" handling demos

Show SWF inline, wait indefinitely for load

@@ -64,13 +64,13 @@ soundManager.ontimeout(function(){ #sm2-container.high_performance {/* Additional modifier for "high performance" mode, should apply position:fixed and left/bottom 0 to stay on-screen at all times (better flash performance) */} #sm2-container.flash_debug {/* Additional modifier for flash debug output mode, should use width/height 100% so you can read debug messages */} #sm2-container.swf_error {/* Additional modifier, "something really broke" (fatal: security, missing SWF etc.) */} - +

SoundManager 2 load status: Loading...

- +

Take a look at flashblock.css for implementation details.

- +
diff --git a/js/libs/soundmanager/demo/index.css b/js/libs/soundmanager/demo/index.css index abd7dd8..5842fa7 100644 --- a/js/libs/soundmanager/demo/index.css +++ b/js/libs/soundmanager/demo/index.css @@ -204,7 +204,7 @@ pre { pre span, code span, dt span { - color:#339933; + color:#339933; } pre span span, @@ -742,7 +742,7 @@ ul.standard ul { } .c3 h2 .l.flat, -.wedge .l.flat, +.wedge .l.flat, .c3 h2 .r.flat, .wedge .r.flat { background-image:none; @@ -810,7 +810,7 @@ ul.standard ul { height:1.67em; padding:0.25em 0.5em; padding:0px; - + } .c3 h4 { diff --git a/js/libs/soundmanager/demo/mp3-player-button/basic.html b/js/libs/soundmanager/demo/mp3-player-button/basic.html index 856377f..b705745 100644 --- a/js/libs/soundmanager/demo/mp3-player-button/basic.html +++ b/js/libs/soundmanager/demo/mp3-player-button/basic.html @@ -5,7 +5,7 @@ SoundManager 2 Demo: Basic MP3 Play Button (Simple Demo)