From c42074e20f25198b8e4b17eaff8f74c2f0ec89b2 Mon Sep 17 00:00:00 2001 From: Maximillian Laumeister Date: Sun, 12 Jun 2016 12:32:38 -0700 Subject: [PATCH] Commit minified files --- bitlisten.min.js | 2 +- bitlisten.min.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bitlisten.min.js b/bitlisten.min.js index 837dfdc..5b7e9bc 100644 --- a/bitlisten.min.js +++ b/bitlisten.min.js @@ -1,5 +1,5 @@ /*! BitListen Copyright (c) 2016 Maximillian Laumeister, see README.md for license info. */ function surrogateCtor(){}function extend(a,b){surrogateCtor.prototype=a.prototype,b.prototype=new surrogateCtor,b.prototype.constructor=b}function Block(a,b,c,d){if("visible"===document.visibilityState){Floatable.call(this);var e=Math.floor(c/satoshi)+" BTC",f=Math.floor(d/1024)+" KB";this.width=this.height=500,this.addImage(blockImage,this.width,this.height),this.addText("Block #"+a+"
Number of Transactions: "+b+"
Transaction Volume: "+e+"
Block Size: "+f),this.initPosition()}Sound.playRandomSwell()}function Floatable(){this.velocity={x:0,y:-1},this.pageDiv=document.getElementById("bubbleDiv"),this.updateContainerSize(),this.div=document.createElement("div"),this.div.className="floatableDiv",this.pageDiv.appendChild(this.div),this.innerDiv=document.createElement("div"),this.div.appendChild(this.innerDiv),this.innerDiv.className="innerDiv",updateTargets.push(this)}function TransactionSocket(){}function Sound(){}function zeroPad(a,b){var c=b-a.toString().length+1;return Array(+(c>0&&c)).join("0")+a}function StatusBox(){}function Transaction(a,b,c,d){if("visible"===document.visibilityState){Floatable.call(this),this.area=100*a+3e3,this.width=this.height=2*Math.sqrt(this.area/Math.PI),this.addImage(bubbleImage,this.width,this.height);var e,f=a.toFixed(2);e="0.00"===f?"<B0.01":"B"+f,b?this.addText(''+e+'
Donation
Thanks!'):this.addText(e),c&&d&&this.addText("
"+c.toFixed(2)+" "+d),this.initPosition();var g=1e3,h=.3,i=.7,j=a/(g/(i-h))+h;j>i&&(j=i);var k=100,l=1.0715307808111487,m=Math.min(k,Math.log(a+l)/Math.log(l));m=k-m,globalScalePitch?Sound.playPitchAtVolume(j,m):Sound.playRandomAtVolume(j),transaction_count++,5===transaction_count&&(document.getElementById("waitingForTransactions").style.opacity="0")}}var Konami=function(a){var b={addEvent:function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&(a["e"+b+c]=c,a[b+c]=function(){a["e"+b+c](window.event,d)},a.attachEvent("on"+b,a[b+c]))},input:"",pattern:"38384040373937396665",load:function(a){this.addEvent(document,"keydown",function(c,d){return d&&(b=d),b.input+=c?c.keyCode:event.keyCode,b.input.length>b.pattern.length&&(b.input=b.input.substr(b.input.length-b.pattern.length)),b.input==b.pattern?(b.code(a),b.input="",c.preventDefault(),!1):void 0},this),this.iphone.load(a)},code:function(a){window.location=a},iphone:{start_x:0,start_y:0,stop_x:0,stop_y:0,tap:!1,capture:!1,orig_keys:"",keys:["UP","UP","DOWN","DOWN","LEFT","RIGHT","LEFT","RIGHT","TAP","TAP"],code:function(a){b.code(a)},load:function(a){this.orig_keys=this.keys,b.addEvent(document,"touchmove",function(a){if(1==a.touches.length&&1==b.iphone.capture){var c=a.touches[0];b.iphone.stop_x=c.pageX,b.iphone.stop_y=c.pageY,b.iphone.tap=!1,b.iphone.capture=!1,b.iphone.check_direction()}}),b.addEvent(document,"touchend",function(c){1==b.iphone.tap&&b.iphone.check_direction(a)},!1),b.addEvent(document,"touchstart",function(a){b.iphone.start_x=a.changedTouches[0].pageX,b.iphone.start_y=a.changedTouches[0].pageY,b.iphone.tap=!0,b.iphone.capture=!0})},check_direction:function(a){x_magnitude=Math.abs(this.start_x-this.stop_x),y_magnitude=Math.abs(this.start_y-this.stop_y),x=this.start_x-this.stop_x<0?"RIGHT":"LEFT",y=this.start_y-this.stop_y<0?"DOWN":"UP",result=x_magnitude>y_magnitude?x:y,result=1==this.tap?"TAP":result,result==this.keys[0]&&(this.keys=this.keys.slice(1,this.keys.length)),0==this.keys.length&&(this.keys=this.orig_keys,this.code(a))}}};return"string"==typeof a&&b.load(a),"function"==typeof a&&(b.code=a,b.load()),b};!function(){var a={},b=null,c=!0,d=!1;try{"undefined"!=typeof AudioContext?b=new AudioContext:"undefined"!=typeof webkitAudioContext?b=new webkitAudioContext:c=!1}catch(e){c=!1}if(!c)if("undefined"!=typeof Audio)try{new Audio}catch(e){d=!0}else d=!0;if(c){var f="undefined"==typeof b.createGain?b.createGainNode():b.createGain();f.gain.value=1,f.connect(b.destination)}var g=function(a){this._volume=1,this._muted=!1,this.usingWebAudio=c,this.ctx=b,this.noAudio=d,this._howls=[],this._codecs=a,this.iOSAutoEnable=!0};g.prototype={volume:function(a){var b=this;if(a=parseFloat(a),a>=0&&1>=a){b._volume=a,c&&(f.gain.value=a);for(var d in b._howls)if(b._howls.hasOwnProperty(d)&&b._howls[d]._webAudio===!1)for(var e=0;e0?e._pos:d._sprite[a][0]/1e3,g=0;d._webAudio?(g=d._sprite[a][1]/1e3-e._pos,e._pos>0&&(f=d._sprite[a][0]/1e3+f)):g=d._sprite[a][1]/1e3-(f-d._sprite[a][0]/1e3);var h,i=!(!d._loop&&!d._sprite[a][2]),k="string"==typeof c?c:Math.round(Date.now()*Math.random())+"";if(function(){var b={id:k,sprite:a,loop:i};h=setTimeout(function(){!d._webAudio&&i&&d.stop(b.id).play(a,b.id),d._webAudio&&!i&&(d._nodeById(b.id).paused=!0,d._nodeById(b.id)._pos=0,d._clearEndTimer(b.id)),d._webAudio||i||d.stop(b.id),d.on("end",k)},1e3*g),d._onendTimer.push({timer:h,id:b.id})}(),d._webAudio){var l=d._sprite[a][0]/1e3,m=d._sprite[a][1]/1e3;e.id=k,e.paused=!1,o(d,[i,l,m],k),d._playStart=b.currentTime,e.gain.value=d._volume,"undefined"==typeof e.bufferSource.start?e.bufferSource.noteGrainOn(0,f,g):e.bufferSource.start(0,f,g)}else{if(4!==e.readyState&&(e.readyState||!navigator.isCocoonJS))return d._clearEndTimer(k),function(){var b=d,f=a,g=c,h=e,i=function(){b.play(f,g),h.removeEventListener("canplaythrough",i,!1)};h.addEventListener("canplaythrough",i,!1)}(),d;e.readyState=4,e.id=k,e.currentTime=f,e.muted=j._muted||e.muted,e.volume=d._volume*j.volume(),setTimeout(function(){e.play()},0)}return d.on("play"),"function"==typeof c&&c(k),d}),d):("function"==typeof c&&c(),d):(d.on("load",function(){d.play(a,c)}),d)},pause:function(a){var b=this;if(!b._loaded)return b.on("play",function(){b.pause(a)}),b;b._clearEndTimer(a);var c=a?b._nodeById(a):b._activeNode();if(c)if(c._pos=b.pos(null,a),b._webAudio){if(!c.bufferSource||c.paused)return b;c.paused=!0,"undefined"==typeof c.bufferSource.stop?c.bufferSource.noteOff(0):c.bufferSource.stop(0)}else c.pause();return b.on("pause"),b},stop:function(a){var b=this;if(!b._loaded)return b.on("play",function(){b.stop(a)}),b;b._clearEndTimer(a);var c=a?b._nodeById(a):b._activeNode();if(c)if(c._pos=0,b._webAudio){if(!c.bufferSource||c.paused)return b;c.paused=!0,"undefined"==typeof c.bufferSource.stop?c.bufferSource.noteOff(0):c.bufferSource.stop(0)}else isNaN(c.duration)||(c.pause(),c.currentTime=0);return b},mute:function(a){var b=this;if(!b._loaded)return b.on("play",function(){b.mute(a)}),b;var c=a?b._nodeById(a):b._activeNode();return c&&(b._webAudio?c.gain.value=0:c.muted=!0),b},unmute:function(a){var b=this;if(!b._loaded)return b.on("play",function(){b.unmute(a)}),b;var c=a?b._nodeById(a):b._activeNode();return c&&(b._webAudio?c.gain.value=b._volume:c.muted=!1),b},volume:function(a,b){var c=this;if(a=parseFloat(a),a>=0&&1>=a){if(c._volume=a,!c._loaded)return c.on("play",function(){c.volume(a,b)}),c;var d=b?c._nodeById(b):c._activeNode();return d&&(c._webAudio?d.gain.value=a:d.volume=a*j.volume()),c}return c._volume},loop:function(a){var b=this;return"boolean"==typeof a?(b._loop=a,b):b._loop},sprite:function(a){var b=this;return"object"==typeof a?(b._sprite=a,b):b._sprite},pos:function(a,c){var d=this;if(!d._loaded)return d.on("load",function(){d.pos(a)}),"number"==typeof a?d:d._pos||0;a=parseFloat(a);var e=c?d._nodeById(c):d._activeNode();if(e)return a>=0?(d.pause(c),e._pos=a,d.play(e._sprite,c),d):d._webAudio?e._pos+(b.currentTime-d._playStart):e.currentTime;if(a>=0)return d;for(var f=0;f=0||0>a))return e._pos3d;if(e._webAudio){var f=d?e._nodeById(d):e._activeNode();f&&(e._pos3d=[a,b,c],f.panner.setPosition(a,b,c),f.panner.panningModel=e._model||"HRTF")}return e},fade:function(a,b,c,d,e){var f=this,g=Math.abs(a-b),h=a>b?"down":"up",i=g/.01,j=c/i;if(!f._loaded)return f.on("load",function(){f.fade(a,b,c,d,e)}),f;f.volume(a,e);for(var k=1;i>=k;k++)!function(){var a=f._volume+("up"===h?.01:-.01)*k,c=Math.round(1e3*a)/1e3,g=b;setTimeout(function(){f.volume(c,e),c===g&&d&&d()},j*k)}()},fadeIn:function(a,b,c){return this.volume(0).play().fade(0,a,b,c)},fadeOut:function(a,b,c,d){var e=this;return e.fade(e._volume,a,b,function(){c&&c(),e.pause(d),e.on("end")},d)},_nodeById:function(a){for(var b=this,c=b._audioNode[0],d=0;d=0&&!(5>=c);a--)b._audioNode[a].paused&&(b._webAudio&&b._audioNode[a].disconnect(0),c--,b._audioNode.splice(a,1))},_clearEndTimer:function(a){for(var b=this,c=0,d=0;d=0&&j._howls.splice(e,1),delete a[b._src],b=null}},c)var l=function(b,c){if(c in a)return b._duration=a[c].duration,void n(b);if(/^data:[^;]+;base64,/.test(c)){for(var d=atob(c.split(",")[1]),e=new Uint8Array(d.length),f=0;f=a.xVal.slice(-1)[0])return 100;for(var c,d,e,g,h=1;b>=a.xVal[h];)h++;return c=a.xVal[h-1],d=a.xVal[h],e=a.xPct[h-1],g=a.xPct[h],e+m([c,d],b)/f(e,g)}function p(a,b){if(b>=100)return a.xVal.slice(-1)[0];for(var c,d,e,g,h=1;b>=a.xPct[h];)h++;return c=a.xVal[h-1],d=a.xVal[h],e=a.xPct[h-1],g=a.xPct[h],n([c,d],(b-e)*f(e,g))}function q(a,b){for(var c,d,f=1;b>=a.xPct[f];)f++;return a.snap?(c=a.xPct[f-1],d=a.xPct[f],b-c>(d-c)/2?d:c):a.xSteps[f-1]?a.xPct[f-1]+e(b-a.xPct[f-1],a.xSteps[f-1]):b}function r(a){a.preventDefault();var b,c,d=0===a.type.indexOf("touch"),e=0===a.type.indexOf("mouse"),f=0===a.type.indexOf("pointer"),g=a;return 0===a.type.indexOf("MSPointer")&&(f=!0),a.originalEvent&&(a=a.originalEvent),d&&(b=a.changedTouches[0].pageX,c=a.changedTouches[0].pageY),(e||f)&&(f||void 0!==window.pageXOffset||(window.pageXOffset=document.documentElement.scrollLeft,window.pageYOffset=document.documentElement.scrollTop),b=a.clientX+window.pageXOffset,c=a.clientY+window.pageYOffset),g.points=[b,c],g.cursor=e,g}function s(d){void 0===d&&(d={}),"object"!=typeof d&&b("(Format) 'format' option must be an object.");var e={};a(U).each(function(a,c){void 0===d[c]?e[c]=V[a]:g(d[c],V[a])?("decimals"===c&&(d[c]<0||d[c]>7)&&b("(Format) 'format.decimals' option must be between 0 and 7."),e[c]=d[c]):b("(Format) 'format."+c+"' must be a "+typeof V[a]+".")}),c(e,"mark","thousand"),c(e,"prefix","negative"),c(e,"prefix","negativeBefore"),this.settings=e}function t(b,c){if(!(this instanceof t))throw new Error("Link: Don't use Link as a function. Use the 'new' keyword.");if(!b)throw new RangeError("Link: missing parameters.");this.formatting=b.format||{},this.update=!c;var d=this,e=b.target||function(){},f=b.method,g="string"==typeof e&&0===e.indexOf("-tooltip-"),i="string"==typeof e&&0!==e.indexOf("-"),j="function"==typeof e,k=h(e),l=k&&e.is("input, select, textarea"),m=k&&"function"==typeof f,n=k&&"string"==typeof f&&e[f];if(g)return this.method=f||"html",void(this.el=a(e.replace("-tooltip-","")||"
")[0]);if(i)return this.method="val",this.el=document.createElement("input"),this.el.name=e,void(this.el.type="hidden");if(j)return this.target=!1,void(this.method=e);if(k){if(f&&(m||n))return this.target=e,void(this.method=f);if(!f&&l)return this.method="val",this.target=e,void this.target.on("change",function(b){function c(a,b,c){return[c?a:b,c?b:a]}var e=c(null,a(b.target).val(),d.N);d.obj.val(e,{link:d})});if(!f&&!l)return this.method="html",void(this.target=e)}throw new RangeError("Link: Invalid Link.")}function u(a,c){i(c)||b("'step' is not numeric."),a.xSteps[0]=c}function v(c,d){("object"!=typeof d||a.isArray(d))&&b("'range' is not an object."),a.each(d,function(d,e){var f;"number"==typeof e&&(e=[e]),a.isArray(e)||b("'range' contains invalid value."),f="min"===d?0:"max"===d?100:parseFloat(d),i(f)&&i(e[0])||b("'range' value isn't numeric."),c.xPct.push(f),c.xVal.push(e[0]),f?c.xSteps.push(isNaN(e[1])?!1:e[1]):isNaN(e[1])||(c.xSteps[0]=e[1])}),a.each(c.xSteps,function(a,b){return b?void(c.xSteps[a]=l([c.xVal[a],c.xVal[a+1]],b)/f(c.xPct[a],c.xPct[a+1])):!0})}function w(c,d){"number"==typeof d&&(d=[d]),(!a.isArray(d)||!d.length||d.length>2)&&b("'start' option is incorrect."),c.handles=d.length,c.start=d}function x(a,c){a.snap=c,"boolean"!=typeof c&&b("'snap' option must be a boolean.")}function y(a,c){"lower"===c&&1===a.handles?a.connect=1:"upper"===c&&1===a.handles?a.connect=2:c===!0&&2===a.handles?a.connect=3:c===!1?a.connect=0:b("'connect' option was doesn't match handle count.")}function z(a,c){switch(c){case"horizontal":a.ort=0;break;case"vertical":a.ort=1;break;default:b("'orientation' option is invalid.")}}function A(a,c){a.xPct.length>2&&b("'margin' option is only supported on linear sliders."),a.margin=l(a.xVal,c),i(c)||b("'margin' option must be numeric.")}function B(a,c){switch(c){case"ltr":a.dir=0;break;case"rtl":a.dir=1,a.connect=[0,2,1,3][a.connect];break;default:b("'direction' option was not recognized.")}}function C(a,c){"string"!=typeof c&&b("'behaviour' must be a string containing options.");var d=c.indexOf("tap")>=0,e=c.indexOf("extend")>=0,f=c.indexOf("drag")>=0,g=c.indexOf("fixed")>=0,h=c.indexOf("snap")>=0;a.events={tap:d||h,extend:e,drag:f,fixed:g,snap:h}}function D(c,d,e){c.ser=[d.lower,d.upper],c.formatting=new s(d.format),a.each(c.ser,function(c,f){a.isArray(f)||b("'serialization."+(c?"upper":"lower")+"' must be an array."),a.each(f,function(){this instanceof t||b("'serialization."+(c?"upper":"lower")+"' can only contain Link instances."),this.N=c,this.obj=e,this.scope=this.scope||e,this.formatting=new s(a.extend({},d.format,this.formatting))})}),c.dir&&c.handles>1&&c.ser.reverse()}function E(c,d){var e,f={xPct:[],xVal:[],xSteps:[!1],margin:0};return e={step:{r:!1,t:u},range:{r:!0,t:v},start:{r:!0,t:w},snap:{r:!1,t:x},connect:{r:!0,t:y},orientation:{r:!1,t:z},margin:{r:!1,t:A},direction:{r:!0,t:B},behaviour:{r:!0,t:C},serialization:{r:!0,t:D}},c=a.extend({connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal"},c),c.serialization=a.extend({lower:[],upper:[],format:{}},c.serialization),a.each(e,function(a,e){if(void 0===c[a]){if(!e.r)return!0;b("'"+a+"' is required.")}e.t(f,c[a],d)}),f.style=f.ort?"top":"left",f}function F(b,c){var d=a("
").addClass(T[2]),e=["-lower","-upper"];return b.dir&&e.reverse(),d.children().addClass(T[3]+" "+T[3]+e[c]),d}function G(b,c){return c.el&&(c=new t({target:a(c.el).clone().appendTo(b),method:c.method,format:c.formatting},!0)),c}function H(a,b,c){var d,e=[];for(e.push(new t({format:c},!0)),d=0;d").appendTo(c).addClass(T[1])}function M(b,c,e){function f(){return v[["width","height"][c.ort]]()}function g(a){var b,c=[y.val()];for(b=0;b1&&(e=g?Math.max(e,h):Math.min(e,i)),100>e&&(e=q(c,e)),e=d(parseFloat(e.toFixed(7))),e===z[g]?1===x.length?!1:e===h||e===i?0:!1:(b.css(c.style,e+"%"),b.is(":first-child")&&b.toggleClass(T[17],e>50),z[g]=e,c.dir&&(e=100-e),a(w[g]).each(function(){this.write(c,e,b.children(),y)}),!0)}function i(a,b,c){var e=a+b[0],f=a+b[1];return c?(0>e&&(f+=Math.abs(e)),f>100&&(e-=f-100),[d(e),d(f)]):[e,f]}function j(a,b,c){c||k(y,T[14],300),h(a,b,!1),g(["slide","set","change"])}function l(a,b,d,e){return a=a.replace(/\s/g,Q+" ")+Q,b.on(a,function(a){var b=y.attr("disabled");return b=!(void 0===b||null===b),y.hasClass(T[14])||b?!1:(a=r(a),a.calcPoint=a.points[c.ort],void d(a,e))})}function m(a,b){var c,d=b.handles||x,e=!1,j=100*(a.calcPoint-b.start)/f(),k=d[0][0]!==x[0][0]?1:0;c=i(j,b.positions,d.length>1),e=h(d[0],c[k],1===d.length),d.length>1&&(e=h(d[1],c[k?0:1],!1)||e),e&&g(["slide"])}function n(b){a("."+T[15]).removeClass(T[15]),b.cursor&&a("body").css("cursor","").off(Q),P.off(Q),y.removeClass(T[12]),g(["set","change"])}function p(b,c){1===c.handles.length&&c.handles[0].children().addClass(T[15]),b.stopPropagation(),l(S.move,P,m,{start:b.calcPoint,handles:c.handles,positions:[z[0],z[x.length-1]]}),l(S.end,P,n,null),b.cursor&&(a("body").css("cursor",a(b.target).css("cursor")),x.length>1&&y.addClass(T[12]),a("body").on("selectstart"+Q,!1))}function s(b){var d,e=b.calcPoint,g=0;b.stopPropagation(),a.each(x,function(){g+=this.offset()[c.style]}),g=g/2>e||1===x.length?0:1,e-=v.offset()[c.style],d=100*e/f(),j(x[g],d,c.events.snap),c.events.snap&&p(b,{handles:[x[g]]})}function t(a){var b=a.calcPoint1&&b.reverse(),i&&k(y,T[14],300),j=0;j<(x.length>1?3:1);j++)l=e||w[j%2][0],l=l.valueOf(b[j%2]),l!==!1&&(l=o(c,l),c.dir&&(l=100-l),h(x[j%2],l,!0)!==!0&&a(w[j%2]).each(function(){this.write(c,z[j%2],x[j%2].children(),y,f)}));return d===!0&&g(["set"]),this},b.vGet=function(){var a,b=[];for(a=0;a1?b.reverse():b},b.destroy=function(){return a.each(w,function(){a.each(this,function(){this.target&&this.target.off(Q)})}),a(this).off(Q).removeClass(T.join(" ")).empty(),e},y.val(c.start)}function N(a){this.length||b("Can't initialize slider on empty selection.");var c=E(a,this);return this.each(function(){M(this,c,a)})}function O(b){return this.each(function(){var c=a(this).val(),d=this.destroy(),e=a.extend({},d,b);a(this).noUiSlider(e),d.start===e.start&&a(this).val(c)})}var P=a(document),Q=".nui",R=a.fn.val,S=window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"},T=["noUi-target","noUi-base","noUi-origin","noUi-handle","noUi-horizontal","noUi-vertical","noUi-background","noUi-connect","noUi-ltr","noUi-rtl","noUi-dragable","","noUi-state-drag","","noUi-state-tap","noUi-active","noUi-extended","noUi-stacking"],U=["decimals","mark","thousand","prefix","postfix","encoder","decoder","negative","negativeBefore"],V=[2,".","","","",function(a){return a},function(a){return a},"-",""];s.prototype.v=function(a){return this.settings[a]},s.prototype.to=function(a){function b(a){return a.split("").reverse().join("")}a=this.v("encoder")(a);var c="",d="",e="",f="";return 0>a&&(c=this.v("negative"),d=this.v("negativeBefore")),a=Math.abs(a).toFixed(this.v("decimals")).toString(),a=a.split("."),0===parseFloat(a)&&(a[0]="0"),this.v("thousand")?(e=b(a[0]).match(/.{1,3}/g),e=b(e.join(b(this.v("thousand"))))):e=a[0],this.v("mark")&&a.length>1&&(f=this.v("mark")+a[1]),d+this.v("prefix")+c+e+f+this.v("postfix")},s.prototype.from=function(a){function b(a){return a.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g,"\\$&")}var c;return null===a||void 0===a?!1:(a=a.toString(),c=a.replace(new RegExp("^"+b(this.v("negativeBefore"))),""),a!==c?(a=c,c="-"):c="",a=a.replace(new RegExp("^"+b(this.v("prefix"))),""),this.v.negative&&(c="",a=a.replace(new RegExp("^"+b(this.v("negative"))),"-")),a=a.replace(new RegExp(b(this.v("postfix"))+"$"),"").replace(new RegExp(b(this.v("thousand")),"g"),"").replace(this.v("mark"),"."),a=this.v("decoder")(parseFloat(c+a)),isNaN(a)?!1:a)},t.prototype.write=function(a,b,c,d,e){this.update&&e===!1||(b=p(a,b),b=this.format(b),this.saved=b,"function"==typeof this.method?this.method.call(this.target[0]||d[0],b,c,d):this.target[this.method](b,c,d))},t.prototype.format=function(a){return this.formatting.to(a)},t.prototype.valueOf=function(a){return this.formatting.from(a)},a.noUiSlider={Link:t},a.fn.noUiSlider=function(a,b){return(b?O:N).call(this,a)},a.fn.val=function(){var b,c,d,e,f=Array.prototype.slice.call(arguments,0);return f.length?("object"==typeof f[1]?(b=f[1].set,c=f[1].link,d=f[1].update,e=f[1].animate):f[1]===!0&&(b=!0),this.each(function(){a(this).hasClass(T[0])?this.vSet(j(f[0]),b,c,d,e):R.apply(a(this),f)})):this.hasClass(T[0])?this[0].vGet():R.apply(this)}}(window.jQuery||window.Zepto),window.requestAnimationFrame||(window.requestAnimationFrame=function(){return window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a,b){window.setTimeout(a,1e3/60)}}()),function(){window.visibly={b:null,q:document,p:void 0,prefixes:["webkit","ms"],props:["VisibilityState","visibilitychange","Hidden"],m:["focus","blur"],visibleCallbacks:[],hiddenCallbacks:[],_callbacks:[],onVisible:function(a){this.visibleCallbacks.push(a)},onHidden:function(a){this.hiddenCallbacks.push(a)},isSupported:function(){return this._supports(0)||this._supports(1)},_supports:function(a){return this.prefixes[a]+this.props[2]in this.q},runCallbacks:function(a){if(a){this._callbacks=1==a?this.visibleCallbacks:this.hiddenCallbacks;for(var b=0;bb?this.velocity.x=b:this.velocity.x<-b&&(this.velocity.x=-b),this.x<0?this.velocity.x+=.005*c:this.x>this.pageDivWidth-this.width&&(this.velocity.x-=.005*c),this.updateDiv(),this.y<-this.height&&this.removeSelf()},Floatable.prototype.updateDiv=function(){this.div.style["-webkit-transform"]="translate("+this.x+"px,"+this.y+"px)",this.div.style.transform="translate("+this.x+"px,"+this.y+"px)"},Floatable.prototype.removeSelf=function(){this.pageDiv.removeChild(this.div),updateTargets.splice(updateTargets.indexOf(this),1)},Floatable.prototype.addImage=function(a,b,c){this.canvas=document.createElement("canvas"),this.image=a,this.canvas.height=c,this.canvas.width=b,this.canvas.style.position="absolute",this.canvas.style.top="0px",this.canvas.style.left="0px";var d=this.canvas.getContext("2d");d.drawImage(this.image,0,0,b-1,c-1),this.div.appendChild(this.canvas)},Floatable.prototype.addText=function(a){this.innerDiv.innerHTML+=a},Floatable.prototype.initPosition=function(){this.x=Math.random()*(this.pageDivWidth-this.width),this.y=this.pageDivHeight,this.updateDiv(),this.div.style.width=this.width+"px",this.div.style.height=this.height+"px",this.innerDiv.style.top=this.height/2-this.innerDiv.offsetHeight/2+"px"};var easterSuccess=function(){var a=new Floatable;a.width=53,a.height=48,a.image=document.createElement("img"),a.image.src="images/easteregg.gif",a.image.height=a.height,a.image.width=a.width,a.image.style.position="absolute",a.image.style.top="0px",a.image.style.left="0px",a.div.appendChild(a.image),a.initPosition(),a.update=function(b){Floatable.prototype.update.call(a,b),a.velocity.x+=.3*Math.random()-.15,a.velocity.x>.1&&$(a.image).css({"-moz-transform":"scaleX(-1)","-o-transform":"scaleX(-1)","-webkit-transform":"scaleX(-1)",transform:"scaleX(-1)"}),a.velocity.x<-.1&&$(a.image).css({"-moz-transform":"scaleX(1)","-o-transform":"scaleX(1)","-webkit-transform":"scaleX(1)",transform:"scaleX(1)"})}};new Konami(easterSuccess);var DEBUG_MODE=!1,DONATION_ADDRESS,SOUND_DONATION_ADDRESS,globalMute=!1,instanceId=0,pageDivId="pageDiv",last_update=0,updateTargets=[],transaction_count=0,bubbleImage=new Image;bubbleImage.src="images/bubble.png";var blockImage=new Image;blockImage.src="images/block.png";var debugSpawner,updateLayoutWidth=function(){$(".chartMask").css("visibility","visible")},updateLayoutHeight=function(){var a=window.innerHeight;"none"!=$("#header").css("display")&&(a-=$("#header").outerHeight()),$("#pageSplitter").height(a)};$(document).ready(function(){prevChartWidth=$("#pageSplitter").width()/2,$("#chartCell").hide(),DONATION_ADDRESS=$("#donationAddress").html(),$("#noJavascript").css("display","none"),updateLayoutHeight(),StatusBox.init(DEBUG_MODE),$(".clickSuppress").click(function(){$(".clickSuppress").parent().slideUp(300)}),debugSpawner=function(){if(Math.random()<=.1){var a,b=Math.random();a=.6>b?Math.random():.8>b?10*Math.random():.95>b?100*Math.random():1e3*Math.random(),Math.random()<.5?new Transaction(a,!1):new Transaction(a,!1,75*a,"USD")}},switchExchange("bitstamp"),$("#donationAddress").qr()});var toggleInterface=function(){0===$(".interface:hidden").length?($(".interface").fadeOut(500,updateLayoutHeight),$("#hideInterface").html("[ Show Interface ]"),$("#hideInterface").css("opacity","0.5")):($(".interface").fadeIn(500),$("#hideInterface").html("[ Hide Interface ]"),$("#hideInterface").css("opacity","1"),updateLayoutHeight())},globalUpdate=function(a){window.requestAnimationFrame(globalUpdate);var b=a-last_update;last_update=a;for(var c=0;c'),$("#pageSplitter").colResizable({liveDrag:!0,onDrag:updateLayoutWidth,onResize:endResize})};$(window).resize(function(){updateLayoutHeight()}),window.onbeforeunload=function(a){clearInterval(globalUpdate),TransactionSocket.close(),TradeSocket.close()};var rateboxTimeout,currentExchange,ratebox_ms=3e3;rateboxGetRate=function(){if("bitstamp"!=currentExchange)throw"Unrecognized Exchange";var a="https://www.bitstamp.net/api/ticker/",b='//query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D"'+encodeURIComponent(a)+'"&format=json&callback=?';$.getJSON(b,function(a){var b=$.parseJSON(a.query.results.body);b?$("#rate").html(parseFloat(b.last).toFixed(2)):rateboxTimeout=setTimeout(rateboxGetRate,ratebox_ms)})},$(document).ready(function(){var a=new Pusher("de504dc5763aeef9ff52"),b=a.subscribe("live_trades");b.bind("trade",function(a){$("#rate").html(parseFloat(a.price).toFixed(2)),rateboxTimeout&&clearTimeout(rateboxTimeout)})}),switchExchange=function(a){clearTimeout(rateboxTimeout),currentExchange=a,$("#rate").html("---"),"bitstamp"==a?($("#bitstampRate").css("color","white"),$("#mtgoxRate").css("color","gray")):"mtgox"==a&&($("#mtgoxRate").css("color","white"),$("#bitstampRate").css("color","gray")),rateboxGetRate()};var satoshi=1e8,DELAY_CAP=2e4,lastBlockHeight=0,provider_name="blockchain.info";TransactionSocket.init=function(){if(TransactionSocket.connection&&TransactionSocket.connection.close(),"WebSocket"in window){var a=new ReconnectingWebSocket("wss://ws.blockchain.info/inv");TransactionSocket.connection=a,StatusBox.reconnecting("blockchain"),a.onopen=function(){console.log("Blockchain.info: Connection open!"),StatusBox.connected("blockchain");var b={op:"unconfirmed_sub"},c={op:"blocks_sub"};a.send(JSON.stringify(b)),a.send(JSON.stringify(c)),a.send(JSON.stringify({op:"ping_tx"}))},a.onclose=function(){console.log("Blockchain.info: Connection closed"),$("#blockchainCheckBox").prop("checked")?StatusBox.reconnecting("blockchain"):StatusBox.closed("blockchain")},a.onerror=function(a){console.log("Blockchain.info: Connection Error: "+a)},a.onmessage=function(a){var b=JSON.parse(a.data);if("utx"==b.op){for(var c=0,d=0;dlastBlockHeight&&(lastBlockHeight=h,console.log("New Block"),new Block(h,i,j,k))}}}else console.log("No websocket support."),StatusBox.nosupport("blockchain")},TransactionSocket.close=function(){TransactionSocket.connection&&TransactionSocket.connection.disconnect(),StatusBox.closed("blockchain")};var globalVolume=50,globalScalePitch,globalBank;Howler.volume(.01*globalVolume);var soundBank=[];soundBank[0]=["celesta",22],soundBank[1]=["planet",33],soundBank[2]=["wikki",13],Sound.loadup=function(){sound0=[],sound1=[],sound2=[],swells0=[],swells1=[],swells2=[]},Sound.init=function(){$("#volumeControl").click(function(){globalMute?(globalMute=!1,Howler.unmute(),$("#volumeControl").css("background-position","0 -46px")):(globalMute=!0,Howler.mute(),$("#volumeControl").css("background-position","0 0"))}),$("#volumeSlider").noUiSlider({range:{min:0,max:100},start:50,handles:1,step:1,orientation:"vertical"}).on("slide",function(){globalVolume=100-$(this).val(),Howler.volume(.01*globalVolume)}),globalScalePitch=$("#scalePitchCheckBox").attr("checked"),Sound.change(0)},Sound.change=function(a){var b,c="Donate to instrument creator: ";if(0===a){if(0===sound0.length)for(b=1;22>=b;b++)istring=zeroPad(b,3),newSound=new Howl({urls:["sounds/celesta/celesta"+istring+".ogg","sounds/celesta/celesta"+istring+".mp3"],autoplay:!1}),sound0.push(newSound);if(0===swells0.length)for(b=1;3>=b;b++)newSound=new Howl({urls:["sounds/swells0/swell"+b+".ogg","sounds/swells0/swell"+b+".mp3"],autoplay:!1}),swells0.push(newSound);currentSound=sound0,currentSwells=swells0,$("#musicianDonation").text("")}else if(1===a){if(0===sound1.length)for(b=1;33>=b;b++)istring=zeroPad(b,3),newSound=new Howl({urls:["sounds/planet/planet"+istring+".ogg","sounds/planet/planet"+istring+".mp3"],autoplay:!1}),sound1.push(newSound);if(0===swells1.length)for(b=1;3>=b;b++)newSound=new Howl({urls:["sounds/swells1/planetswell"+b+".ogg","sounds/swells1/planetswell"+b+".mp3"],autoplay:!1}),swells1.push(newSound);currentSound=sound1,currentSwells=swells1,SOUND_DONATION_ADDRESS="144b31mmaWQVDQFiUPo6HEzxc2Dm83WXrW",$("#musicianDonation").html(c+""+SOUND_DONATION_ADDRESS+"")}else if(2===a){if(0===sound2.length)for(b=1;13>=b;b++)istring=zeroPad(b,3),newSound=new Howl({urls:["sounds/wikki/wikki"+istring+".ogg","sounds/wikki/wikki"+istring+".mp3"],autoplay:!1}),sound2.push(newSound);if(0===swells2.length)for(b=1;3>=b;b++)newSound=new Howl({urls:["sounds/swells2/wikkiswell"+b+".ogg","sounds/swells2/wikkiswell"+b+".mp3"],autoplay:!1}),swells2.push(newSound);currentSound=sound2,currentSwells=swells2,SOUND_DONATION_ADDRESS="1JFaYRGkDmhpSTbFKwqDWKr2ncvvrgYEAV",$("#musicianDonation").html(c+""+SOUND_DONATION_ADDRESS+"")}};var currentNotes=0,noteTimeout=500;Sound.playRandomAtVolume=function(a){if(!globalMute){var b=Math.floor(100*Math.random());Sound.playPitchAtVolume(a,b)}},Sound.playPitchAtVolume=function(a,b){if(!globalMute){var c=Math.floor(b/100*currentSound.length),d=Math.floor(4*Math.random())-2;c+=d,c=Math.min(currentSound.length-1,c),c=Math.max(0,c),5>currentNotes&&(currentSound[c].volume(a),currentSound[c].play(),currentNotes++,setTimeout(function(){currentNotes--},noteTimeout))}};var lastBlockSound=-1;Sound.playRandomSwell=function(){if(!globalMute){var a;do a=Math.floor(Math.random()*currentSwells.length);while(a==lastBlockSound);lastBlockSound=a,currentSwells[a].play()}};var CONNECTED="Connected.",CONNECTING="Connecting...",NO_SUPPORT="No browser support.",CLOSED="Click to connect.",provider_name="blockchain.info";StatusBox.init=function(a){StatusBox.blockchain=$("#blockchainStatus"),StatusBox.mtgox=$("#mtgoxStatus"),a&&(StatusBox.blockchain.html(""),StatusBox.mtgox.html("Debug mode.")),$("#blockchainCheckBox").is(":checked")?StatusBox.reconnecting("blockchain"):StatusBox.closed("blockchain"),$("#mtgoxCheckBox").is(":checked")?StatusBox.reconnecting("mtgox"):StatusBox.closed("mtgox")},StatusBox.connected=function(a){"blockchain"==a&&StatusBox.blockchain.html("Transactions ("+provider_name+'): '+CONNECTED+""),"mtgox"==a&&StatusBox.mtgox.html('Mt.Gox Trades: '+CONNECTED+"")},StatusBox.reconnecting=function(a){"blockchain"==a&&StatusBox.blockchain.html("Transactions ("+provider_name+'): '+CONNECTING+""),"mtgox"==a&&StatusBox.mtgox.html('Mt.Gox Trades: '+CONNECTING+"")},StatusBox.nosupport=function(a){"blockchain"==a&&StatusBox.blockchain.html("Transactions ("+provider_name+'): '+NO_SUPPORT+""),"mtgox"==a&&StatusBox.mtgox.html('Mt.Gox Trades: '+NO_SUPPORT+"")},StatusBox.closed=function(a){"blockchain"==a&&StatusBox.blockchain.html("Transactions ("+provider_name+'): '+CLOSED+""),"mtgox"==a&&StatusBox.mtgox.html('Mt.Gox Trades: '+CLOSED+"")},extend(Floatable,Transaction); +(f.debug||a.debugAll)&&console.debug("ReconnectingWebSocket","onerror",b,c),f.onerror(c)}}c=c||[],this.debug=!1,this.reconnectInterval=1e3,this.reconnectDecay=1.5,this.reconnectAttempts=0,this.timeoutInterval=2e3;var e,f=this,g=!1,h=!1;this.url=b,this.protocols=c,this.readyState=WebSocket.CONNECTING,this.URL=b,this.onopen=function(a){},this.onclose=function(a){},this.onconnecting=function(a){},this.onmessage=function(a){},this.onerror=function(a){},d(!1),this.send=function(c){if(e)return(f.debug||a.debugAll)&&console.debug("ReconnectingWebSocket","send",b,c),e.send(c);throw"INVALID_STATE_ERR : Pausing to reconnect websocket"},this.close=function(){g=!0,e&&e.close()},this.refresh=function(){e&&e.close()}}return a.debugAll=!1,a}),extend(Floatable,Block),Floatable.prototype.updateContainerSize=function(){this.pageDivWidth=$(this.pageDiv).width(),this.pageDivHeight=$(this.pageDiv).height()},Floatable.prototype.update=function(a){var b=1,c=a/50;this.x+=this.velocity.x*c,this.y+=this.velocity.y*c,this.velocity.x+=(.1*Math.random()-.05)*c,this.velocity.x>b?this.velocity.x=b:this.velocity.x<-b&&(this.velocity.x=-b),this.x<0?this.velocity.x+=.005*c:this.x>this.pageDivWidth-this.width&&(this.velocity.x-=.005*c),this.updateDiv(),this.y<-this.height&&this.removeSelf()},Floatable.prototype.updateDiv=function(){this.div.style["-webkit-transform"]="translate("+this.x+"px,"+this.y+"px)",this.div.style.transform="translate("+this.x+"px,"+this.y+"px)"},Floatable.prototype.removeSelf=function(){this.pageDiv.removeChild(this.div),updateTargets.splice(updateTargets.indexOf(this),1)},Floatable.prototype.addImage=function(a,b,c){this.canvas=document.createElement("canvas"),this.image=a,this.canvas.height=c,this.canvas.width=b,this.canvas.style.position="absolute",this.canvas.style.top="0px",this.canvas.style.left="0px";var d=this.canvas.getContext("2d");d.drawImage(this.image,0,0,b-1,c-1),this.div.appendChild(this.canvas)},Floatable.prototype.addText=function(a){this.innerDiv.innerHTML+=a},Floatable.prototype.initPosition=function(){this.x=Math.random()*(this.pageDivWidth-this.width),this.y=this.pageDivHeight,this.updateDiv(),this.div.style.width=this.width+"px",this.div.style.height=this.height+"px",this.innerDiv.style.top=this.height/2-this.innerDiv.offsetHeight/2+"px"};var easterSuccess=function(){var a=new Floatable;a.width=53,a.height=48,a.image=document.createElement("img"),a.image.src="images/easteregg.gif",a.image.height=a.height,a.image.width=a.width,a.image.style.position="absolute",a.image.style.top="0px",a.image.style.left="0px",a.div.appendChild(a.image),a.initPosition(),a.update=function(b){Floatable.prototype.update.call(a,b),a.velocity.x+=.3*Math.random()-.15,a.velocity.x>.1&&$(a.image).css({"-moz-transform":"scaleX(-1)","-o-transform":"scaleX(-1)","-webkit-transform":"scaleX(-1)",transform:"scaleX(-1)"}),a.velocity.x<-.1&&$(a.image).css({"-moz-transform":"scaleX(1)","-o-transform":"scaleX(1)","-webkit-transform":"scaleX(1)",transform:"scaleX(1)"})}};new Konami(easterSuccess);var DEBUG_MODE=!1,DONATION_ADDRESS,SOUND_DONATION_ADDRESS,globalMute=!1,instanceId=0,pageDivId="pageDiv",last_update=0,updateTargets=[],transaction_count=0,bubbleImage=new Image;bubbleImage.src="images/bubble.png";var blockImage=new Image;blockImage.src="images/block.png";var debugSpawner,updateLayoutWidth=function(){$(".chartMask").css("visibility","visible")},updateLayoutHeight=function(){var a=window.innerHeight;"none"!=$("#header").css("display")&&(a-=$("#header").outerHeight()),$("#pageSplitter").height(a)};$(document).ready(function(){prevChartWidth=$("#pageSplitter").width()/2,$("#chartCell").hide(),DONATION_ADDRESS=$("#donationAddress").html(),$("#noJavascript").css("display","none"),updateLayoutHeight(),StatusBox.init(DEBUG_MODE),$(".clickSuppress").click(function(){$(".clickSuppress").parent().slideUp(300)}),debugSpawner=function(){if(Math.random()<=.1){var a,b=Math.random();a=.6>b?Math.random():.8>b?10*Math.random():.95>b?100*Math.random():1e3*Math.random(),Math.random()<.5?new Transaction(a,!1):new Transaction(a,!1,75*a,"USD")}},switchExchange("bitstamp"),$("#donationAddress").qr()});var toggleInterface=function(){0===$(".interface:hidden").length?($(".interface").fadeOut(500,updateLayoutHeight),$("#hideInterface").html("[ Show Interface ]"),$("#hideInterface").css("opacity","0.5")):($(".interface").fadeIn(500),$("#hideInterface").html("[ Hide Interface ]"),$("#hideInterface").css("opacity","1"),updateLayoutHeight())},globalUpdate=function(a){window.requestAnimationFrame(globalUpdate);var b=a-last_update;last_update=a;for(var c=0;c'),$("#pageSplitter").colResizable({liveDrag:!0,onDrag:updateLayoutWidth,onResize:endResize})};$(window).resize(function(){updateLayoutHeight()}),window.onbeforeunload=function(a){clearInterval(globalUpdate),TransactionSocket.close(),TradeSocket.close()};var rateboxTimeout,currentExchange,ratebox_ms=3e3;rateboxGetRate=function(){},$(document).ready(function(){var a=new Pusher("de504dc5763aeef9ff52"),b=a.subscribe("live_trades");b.bind("trade",function(a){$("#rate").html(parseFloat(a.price).toFixed(2)),rateboxTimeout&&clearTimeout(rateboxTimeout)})}),switchExchange=function(a){clearTimeout(rateboxTimeout),currentExchange=a,$("#rate").html("---"),"bitstamp"==a?($("#bitstampRate").css("color","white"),$("#mtgoxRate").css("color","gray")):"mtgox"==a&&($("#mtgoxRate").css("color","white"),$("#bitstampRate").css("color","gray")),rateboxGetRate()};var satoshi=1e8,DELAY_CAP=2e4,lastBlockHeight=0,provider_name="blockchain.info";TransactionSocket.init=function(){if(TransactionSocket.connection&&TransactionSocket.connection.close(),"WebSocket"in window){var a=new ReconnectingWebSocket("wss://ws.blockchain.info/inv");TransactionSocket.connection=a,StatusBox.reconnecting("blockchain"),a.onopen=function(){console.log("Blockchain.info: Connection open!"),StatusBox.connected("blockchain");var b={op:"unconfirmed_sub"},c={op:"blocks_sub"};a.send(JSON.stringify(b)),a.send(JSON.stringify(c)),a.send(JSON.stringify({op:"ping_tx"}))},a.onclose=function(){console.log("Blockchain.info: Connection closed"),$("#blockchainCheckBox").prop("checked")?StatusBox.reconnecting("blockchain"):StatusBox.closed("blockchain")},a.onerror=function(a){console.log("Blockchain.info: Connection Error: "+a)},a.onmessage=function(a){var b=JSON.parse(a.data);if("utx"==b.op){for(var c=0,d=0;dlastBlockHeight&&(lastBlockHeight=h,console.log("New Block"),new Block(h,i,j,k))}}}else console.log("No websocket support."),StatusBox.nosupport("blockchain")},TransactionSocket.close=function(){TransactionSocket.connection&&TransactionSocket.connection.disconnect(),StatusBox.closed("blockchain")};var globalVolume=50,globalScalePitch,globalBank;Howler.volume(.01*globalVolume);var soundBank=[];soundBank[0]=["celesta",22],soundBank[1]=["planet",33],soundBank[2]=["wikki",13],Sound.loadup=function(){sound0=[],sound1=[],sound2=[],swells0=[],swells1=[],swells2=[]},Sound.init=function(){$("#volumeControl").click(function(){globalMute?(globalMute=!1,Howler.unmute(),$("#volumeControl").css("background-position","0 -46px")):(globalMute=!0,Howler.mute(),$("#volumeControl").css("background-position","0 0"))}),$("#volumeSlider").noUiSlider({range:{min:0,max:100},start:50,handles:1,step:1,orientation:"vertical"}).on("slide",function(){globalVolume=100-$(this).val(),Howler.volume(.01*globalVolume)}),globalScalePitch=$("#scalePitchCheckBox").attr("checked"),Sound.change(0)},Sound.change=function(a){var b,c="Donate to instrument creator: ";if(0===a){if(0===sound0.length)for(b=1;22>=b;b++)istring=zeroPad(b,3),newSound=new Howl({urls:["sounds/celesta/celesta"+istring+".ogg","sounds/celesta/celesta"+istring+".mp3"],autoplay:!1}),sound0.push(newSound);if(0===swells0.length)for(b=1;3>=b;b++)newSound=new Howl({urls:["sounds/swells0/swell"+b+".ogg","sounds/swells0/swell"+b+".mp3"],autoplay:!1}),swells0.push(newSound);currentSound=sound0,currentSwells=swells0,$("#musicianDonation").text("")}else if(1===a){if(0===sound1.length)for(b=1;33>=b;b++)istring=zeroPad(b,3),newSound=new Howl({urls:["sounds/planet/planet"+istring+".ogg","sounds/planet/planet"+istring+".mp3"],autoplay:!1}),sound1.push(newSound);if(0===swells1.length)for(b=1;3>=b;b++)newSound=new Howl({urls:["sounds/swells1/planetswell"+b+".ogg","sounds/swells1/planetswell"+b+".mp3"],autoplay:!1}),swells1.push(newSound);currentSound=sound1,currentSwells=swells1,SOUND_DONATION_ADDRESS="144b31mmaWQVDQFiUPo6HEzxc2Dm83WXrW",$("#musicianDonation").html(c+""+SOUND_DONATION_ADDRESS+"")}else if(2===a){if(0===sound2.length)for(b=1;13>=b;b++)istring=zeroPad(b,3),newSound=new Howl({urls:["sounds/wikki/wikki"+istring+".ogg","sounds/wikki/wikki"+istring+".mp3"],autoplay:!1}),sound2.push(newSound);if(0===swells2.length)for(b=1;3>=b;b++)newSound=new Howl({urls:["sounds/swells2/wikkiswell"+b+".ogg","sounds/swells2/wikkiswell"+b+".mp3"],autoplay:!1}),swells2.push(newSound);currentSound=sound2,currentSwells=swells2,SOUND_DONATION_ADDRESS="1JFaYRGkDmhpSTbFKwqDWKr2ncvvrgYEAV",$("#musicianDonation").html(c+""+SOUND_DONATION_ADDRESS+"")}};var currentNotes=0,noteTimeout=500;Sound.playRandomAtVolume=function(a){if(!globalMute){var b=Math.floor(100*Math.random());Sound.playPitchAtVolume(a,b)}},Sound.playPitchAtVolume=function(a,b){if(!globalMute){var c=Math.floor(b/100*currentSound.length),d=Math.floor(4*Math.random())-2;c+=d,c=Math.min(currentSound.length-1,c),c=Math.max(0,c),5>currentNotes&&(currentSound[c].volume(a),currentSound[c].play(),currentNotes++,setTimeout(function(){currentNotes--},noteTimeout))}};var lastBlockSound=-1;Sound.playRandomSwell=function(){if(!globalMute){var a;do a=Math.floor(Math.random()*currentSwells.length);while(a==lastBlockSound);lastBlockSound=a,currentSwells[a].play()}};var CONNECTED="Connected.",CONNECTING="Connecting...",NO_SUPPORT="No browser support.",CLOSED="Click to connect.",provider_name="blockchain.info";StatusBox.init=function(a){StatusBox.blockchain=$("#blockchainStatus"),StatusBox.mtgox=$("#mtgoxStatus"),a&&(StatusBox.blockchain.html(""),StatusBox.mtgox.html("Debug mode.")),$("#blockchainCheckBox").is(":checked")?StatusBox.reconnecting("blockchain"):StatusBox.closed("blockchain"),$("#mtgoxCheckBox").is(":checked")?StatusBox.reconnecting("mtgox"):StatusBox.closed("mtgox")},StatusBox.connected=function(a){"blockchain"==a&&StatusBox.blockchain.html("Transactions ("+provider_name+'): '+CONNECTED+""),"mtgox"==a&&StatusBox.mtgox.html('Mt.Gox Trades: '+CONNECTED+"")},StatusBox.reconnecting=function(a){"blockchain"==a&&StatusBox.blockchain.html("Transactions ("+provider_name+'): '+CONNECTING+""),"mtgox"==a&&StatusBox.mtgox.html('Mt.Gox Trades: '+CONNECTING+"")},StatusBox.nosupport=function(a){"blockchain"==a&&StatusBox.blockchain.html("Transactions ("+provider_name+'): '+NO_SUPPORT+""),"mtgox"==a&&StatusBox.mtgox.html('Mt.Gox Trades: '+NO_SUPPORT+"")},StatusBox.closed=function(a){"blockchain"==a&&StatusBox.blockchain.html("Transactions ("+provider_name+'): '+CLOSED+""),"mtgox"==a&&StatusBox.mtgox.html('Mt.Gox Trades: '+CLOSED+"")},extend(Floatable,Transaction); //# sourceMappingURL=bitlisten.min.js.map \ No newline at end of file diff --git a/bitlisten.min.js.map b/bitlisten.min.js.map index 46e94b2..f009f7c 100644 --- a/bitlisten.min.js.map +++ b/bitlisten.min.js.map @@ -1 +1 @@ -{"version":3,"file":"bitlisten.min.js","sources":["lib/extend.js","src/block.js","src/floatable.js","src/socket.js","src/sound.js","src/statusbox.js","src/transaction.js","lib/easteregg.js","lib/howler.js","lib/jquery-qr.js","lib/jquery.nouislider.js","lib/polyfills.js","lib/reconnecting-websocket.js","src/main.js","src/ratebox.js"],"names":["surrogateCtor","extend","base","sub","prototype","constructor","Block","height","numTransactions","outputTotal","blockSize","document","visibilityState","Floatable","call","this","outputBTC","Math","floor","satoshi","blockSizeKB","width","addImage","blockImage","addText","initPosition","Sound","playRandomSwell","velocity","x","y","pageDiv","getElementById","updateContainerSize","div","createElement","className","appendChild","innerDiv","updateTargets","push","TransactionSocket","zeroPad","num","places","zero","toString","length","Array","join","StatusBox","Transaction","bitcoins","highlight","currency","currencyName","area","sqrt","PI","bubbleImage","bitcoinString","bitcoinVal","toFixed","maxBitcoins","minVolume","maxVolume","volume","maxPitch","logUsed","pitch","min","log","globalScalePitch","playPitchAtVolume","playRandomAtVolume","transaction_count","style","opacity","Konami","callback","konami","addEvent","obj","type","fn","ref_obj","addEventListener","attachEvent","window","event","input","pattern","load","link","e","keyCode","substr","code","preventDefault","iphone","location","start_x","start_y","stop_x","stop_y","tap","capture","orig_keys","keys","touches","touch","pageX","pageY","check_direction","evt","changedTouches","x_magnitude","abs","y_magnitude","result","slice","cache","ctx","usingWebAudio","noAudio","AudioContext","webkitAudioContext","Audio","masterGain","createGain","createGainNode","gain","value","connect","destination","HowlerGlobal","codecs","_volume","_muted","_howls","_codecs","iOSAutoEnable","vol","self","parseFloat","key","hasOwnProperty","_webAudio","i","_audioNode","mute","_setMuted","unmute","muted","ext","_enableiOSAudio","_iOSEnabled","test","navigator","userAgent","unlock","buffer","createBuffer","source","createBufferSource","start","noteOn","setTimeout","playbackState","PLAYING_STATE","FINISHED_STATE","removeEventListener","audioTest","mp3","canPlayType","replace","opus","ogg","wav","aac","m4a","mp4","weba","Howler","Howl","o","_autoplay","autoplay","_buffer","_duration","duration","_format","format","_loop","loop","_loaded","_sprite","sprite","_src","src","_pos3d","pos3d","undefined","_urls","urls","_rate","rate","_model","model","_onload","onload","_onloaderror","onloaderror","_onend","onend","_onpause","onpause","_onplay","onplay","_onendTimer","_setupAudioNode","url","on","urlItem","exec","split","toLowerCase","loadBuffer","newNode","error","_pos","preload","listener","ceil","Object","getOwnPropertyNames","_default","play","stop","_inactiveNode","node","pos","timerId","soundId","round","Date","now","random","data","id","_nodeById","paused","_clearEndTimer","timer","loopStart","loopEnd","refreshBuffer","_playStart","currentTime","bufferSource","noteGrainOn","readyState","isCocoonJS","sound","playSprite","pause","activeNode","_activeNode","noteOff","isNaN","z","panner","setPosition","panningModel","fade","from","to","len","diff","dir","steps","stepTime","change","toVol","fadeIn","fadeOut","_drainPool","listenerEvent","inactive","disconnect","splice","index","clearTimeout","createPanner","events","off","fnString","unload","nodes","indexOf","loadSound","atob","dataView","Uint8Array","charCodeAt","decodeAudioData","xhr","XMLHttpRequest","open","responseType","response","onerror","_gainNode","send","arraybuffer","err","playbackRate","define","amd","exports","$","qr","options","createQR","href","size","escape","$qr","css","background","display","border-style","border-width","position","z-index","append","each","settings","delay","$this","qr_div","attr","mouseenter","qr_timeout_id","top","left","mouseleave","jQuery","throwError","message","RangeError","throwEqualError","F","a","b","limit","max","closest","subRangeRatio","pa","pb","typeMatch","isInstance","isNumeric","isFinite","asArray","isArray","addClassFor","element","addClass","removeClass","fromPercentage","range","toPercentage","isPercentage","toStepping","xVal","va","vb","j","xPct","fromStepping","getStep","snap","xSteps","fixEvent","mouse","pointer","originalEvent","pageXOffset","documentElement","scrollLeft","pageYOffset","scrollTop","clientX","clientY","points","cursor","Format","Formatting","val","FormatDefaults","Link","entry","update","Error","formatting","that","target","method","isTooltip","isHidden","isMethod","is$","isInput","is","methodIsFunction","methodIsName","el","name","at","c","output","N","testStep","parsed","testRange","percentage","n","testStart","handles","testSnap","testConnect","testOrientation","ort","testMargin","margin","testDirection","testBehaviour","drag","fixed","testSerialization","sliders","ser","scope","reverse","tests","step","r","t","orientation","direction","behaviour","serialization","lower","upper","addHandle","handle","Classes","additions","children","addElement","clone","appendTo","addElements","elements","list","addLinks","links","addConnection","addHandles","addSlider","closure","originalOptions","baseSize","$Base","fireEvents","values","$Target","trigger","setHandle","delimit","$Handles","$Locations","toggleClass","$Serialization","write","getPositions","d","jump","instant","attach","namespace","disabled","hasClass","calcPoint","move","positions","state","proposal","h","end","doc","stopPropagation","actions","total","offset","edge","find","add","not","vSet","animate","valueOf","vGet","retour","saved","destroy","empty","initialize","rebuild","newOptions","noUiSlider","$val","pointerEnabled","msPointerEnabled","v","number","negative","preNegative","mark","match","esc","s","isNeg","RegExp","slider","re","set","args","arguments","apply","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","visibly","q","p","prefixes","props","m","visibleCallbacks","hiddenCallbacks","_callbacks","onVisible","_callback","onHidden","isSupported","_supports","runCallbacks","_visible","_hidden","_nativeSwitch","listen","init","global","factory","module","ReconnectingWebSocket","protocols","reconnectAttempt","ws","WebSocket","onconnecting","debug","debugAll","console","localWs","timeout","timedOut","close","timeoutInterval","onopen","OPEN","reconnectAttempts","onclose","forcedClose","CLOSED","CONNECTING","reconnectInterval","pow","reconnectDecay","onmessage","URL","refresh","pageDivWidth","pageDivHeight","deltatime","HVEL_MAX","updateDiv","removeSelf","transform","removeChild","image","canvas","getContext","drawImage","text","innerHTML","offsetHeight","easterSuccess","derpy","time","-moz-transform","-o-transform","-webkit-transform","DEBUG_MODE","DONATION_ADDRESS","SOUND_DONATION_ADDRESS","globalMute","instanceId","pageDivId","last_update","Image","debugSpawner","updateLayoutWidth","updateLayoutHeight","newHeight","innerHeight","outerHeight","ready","prevChartWidth","hide","html","click","parent","slideUp","order","switchExchange","toggleInterface","globalUpdate","delta","bind","setInterval","prop","TradeSocket","loadup","endResize","hideChart","show","colResizable","disable","showChart","liveDrag","onDrag","onResize","resize","onbeforeunload","clearInterval","rateboxTimeout","currentExchange","ratebox_ms","rateboxGetRate","api_url","yql_url","encodeURIComponent","getJSON","json","ticker","parseJSON","query","results","body","last","pusher","Pusher","channel","subscribe","price","exchangeName","DELAY_CAP","lastBlockHeight","provider_name","connection","reconnecting","connected","newTransactions","op","newBlocks","JSON","stringify","closed","parse","transacted","out","outputs","blockHeight","transactions","nTx","volumeSent","estimatedBTCSent","nosupport","globalVolume","globalBank","soundBank","sound0","sound1","sound2","swells0","swells1","swells2","instrument_number","musicianString","istring","newSound","currentSound","currentSwells","currentNotes","noteTimeout","randomPitch","fuzz","lastBlockSound","randomIndex","CONNECTED","NO_SUPPORT","debugmode","blockchain","mtgox"],"mappings":";;AAAA,QAASA,kBAET,QAASC,QAAOC,EAAMC,G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,IAAIwe,WAAY,aACZvI,WAAa,gBACbwI,WAAa,sBACbzI,OAAS,oBAET+F,cAAgB,iBAMpB1nB,WAAUogB,KAAO,SAASiK,GACzBrqB,UAAUsqB,WAAaxZ,EAAE,qBACzB9Q,UAAUuqB,MAAQzZ,EAAE,gBAEhBuZ,IACHrqB,UAAUsqB,WAAW7F,KAAK,IAC1BzkB,UAAUuqB,MAAM9F,KAAK,gBAGlB3T,EAAE,uBAAuB+F,GAAG,YAC/B7W,UAAU4nB,aAAa,cAEvB5nB,UAAUmoB,OAAO,cAEdrX,EAAE,kBAAkB+F,GAAG,YAC1B7W,UAAU4nB,aAAa,SAEvB5nB,UAAUmoB,OAAO,UAGnBnoB,UAAU6nB,UAAY,SAAS5lB,GAClB,cAARA,GACHjC,UAAUsqB,WAAW7F,KAAK,iBAAmBiD,cAAgB,kCAAoCyC,UAAY,WAClG,SAARloB,GACHjC,UAAUuqB,MAAM9F,KAAK,8CAAgD0F,UAAY,YAGnFnqB,UAAU4nB,aAAe,SAAS3lB,GACrB,cAARA,GACHjC,UAAUsqB,WAAW7F,KAAK,iBAAmBiD,cAAgB,mCAAqC9F,WAAa,WACpG,SAAR3f,GACHjC,UAAUuqB,MAAM9F,KAAK,+CAAiD7C,WAAa,YAGrF5hB,UAAU6oB,UAAY,SAAS5mB,GAClB,cAARA,GACHjC,UAAUsqB,WAAW7F,KAAK,iBAAmBiD,cAAgB,gCAAkC0C,WAAa,WACjG,SAARnoB,GACHjC,UAAUuqB,MAAM9F,KAAK,4CAA8C2F,WAAa,YAGlFpqB,UAAUmoB,OAAS,SAASlmB,GACf,cAARA,GACHjC,UAAUsqB,WAAW7F,KAAK,iBAAmBiD,cAAgB,iCAAmC/F,OAAS,WAC9F,SAAR1f,GACHjC,UAAUuqB,MAAM9F,KAAK,6CAA+C9C,OAAS,YCW/E5kB,OAAOY,UAAWsC","sourcesContent":["function surrogateCtor() {}\r\n\r\nfunction extend(base, sub) {\r\n // Copy the prototype from the base to setup inheritance\r\n surrogateCtor.prototype = base.prototype;\r\n // Tricky huh?\r\n sub.prototype = new surrogateCtor();\r\n // Remember the constructor property was set wrong, let's fix it\r\n sub.prototype.constructor = sub;\r\n}","/** \r\n * @constructor\r\n * @extends Floatable\r\n */\r\nfunction Block(height, numTransactions, outputTotal, blockSize) {\r\n\tif (document.visibilityState === \"visible\") {\r\n\t\tFloatable.call(this);\r\n\r\n\t\tvar outputBTC = Math.floor(outputTotal / satoshi) + \" BTC\";\r\n\t\tvar blockSizeKB = Math.floor(blockSize / 1024) + \" KB\";\r\n\r\n\t\tthis.width = this.height = 500;\r\n\r\n\t\tthis.addImage(blockImage, this.width, this.height);\r\n\t\tthis.addText(\"Block #\" + height + \"
Number of Transactions: \" + numTransactions + \"
Transaction Volume: \" + outputBTC + \"
Block Size: \" + blockSizeKB);\r\n\t\tthis.initPosition();\r\n\t}\r\n\t\r\n\t// Sound\r\n\tSound.playRandomSwell();\r\n}\r\n\r\nextend(Floatable, Block);\r\n","/** @constructor */\nfunction Floatable() {\n\tthis.velocity = {\n\t\tx : 0,\n\t\ty : -1\n\t};\n\t\n\tthis.pageDiv = document.getElementById(\"bubbleDiv\");\n\tthis.updateContainerSize();\n\n\tthis.div = document.createElement(\"div\");\n\tthis.div.className = \"floatableDiv\";\n\tthis.pageDiv.appendChild(this.div);\n\tthis.innerDiv = document.createElement(\"div\");\n\tthis.div.appendChild(this.innerDiv);\n\tthis.innerDiv.className = \"innerDiv\";\n\n\t// Add this object to the update array\n\tupdateTargets.push(this);\n}\n\nFloatable.prototype.updateContainerSize = function() {\n\tthis.pageDivWidth = $(this.pageDiv).width();\n\tthis.pageDivHeight = $(this.pageDiv).height();\n};\n\nFloatable.prototype.update = function(deltatime) {\n\tvar HVEL_MAX = 1;\n\tvar step = deltatime / 50;\n\t\n\tthis.x += this.velocity.x * step;\n\tthis.y += this.velocity.y * step;\n\n\tthis.velocity.x += (Math.random() * 0.1 - 0.05) * step;\n\tif (this.velocity.x > HVEL_MAX) {\n\t\tthis.velocity.x = HVEL_MAX;\n\t} else if (this.velocity.x < -HVEL_MAX) {\n\t\tthis.velocity.x = -HVEL_MAX;\n\t}\n\tif (this.x < 0) {\n\t\tthis.velocity.x += 0.005 * step;\n\t} else if (this.x > this.pageDivWidth - this.width) {\n\t\tthis.velocity.x -= 0.005 * step;\n\t}\n\n\tthis.updateDiv();\n\n\tif (this.y < -this.height)\n\t\tthis.removeSelf();\n};\n\nFloatable.prototype.updateDiv = function() {\n\tthis.div.style[\"-webkit-transform\"] = \"translate(\" + this.x + \"px,\" + this.y + \"px)\";\n\tthis.div.style.transform = \"translate(\" + this.x + \"px,\" + this.y + \"px)\";\n};\n\nFloatable.prototype.removeSelf = function() {\n\tthis.pageDiv.removeChild(this.div);\n\t// Remove self from update array\n\tupdateTargets.splice(updateTargets.indexOf(this), 1);\n};\n\nFloatable.prototype.addImage = function(image, width, height) {\n\tthis.canvas = document.createElement('canvas');\n\tthis.image = image;\n\tthis.canvas.height = height;\n\tthis.canvas.width = width;\n\tthis.canvas.style.position = \"absolute\";\n\tthis.canvas.style.top = \"0px\";\n\tthis.canvas.style.left = \"0px\";\n\tvar ctx = this.canvas.getContext(\"2d\");\n\tctx.drawImage(this.image, 0, 0, width - 1, height - 1);\n\n\tthis.div.appendChild(this.canvas);\n};\n\nFloatable.prototype.addText = function(text) {\n\tthis.innerDiv.innerHTML += text;\n};\n\nFloatable.prototype.initPosition = function() {\n\tthis.x = Math.random() * (this.pageDivWidth - this.width);\n\tthis.y = this.pageDivHeight;\n\tthis.updateDiv();\n\tthis.div.style.width = this.width + \"px\";\n\tthis.div.style.height = this.height + \"px\";\n\tthis.innerDiv.style.top = (this.height / 2 - this.innerDiv.offsetHeight / 2) + 'px';\n\t// Centers the text within the bubble\n};\n\n// Thanks to Myself-Remastered for the image used in this easter egg\n// http://myself-remastered.deviantart.com/art/Derpy-Delivery-251264643\nvar easterSuccess = function() {\n\tvar derpy = new Floatable();\n\tderpy.width = 53;\n\tderpy.height = 48;\n\t\n\tderpy.image = document.createElement('img');\n\tderpy.image.src = \"images/easteregg.gif\";\n\tderpy.image.height = derpy.height;\n\tderpy.image.width = derpy.width;\n\tderpy.image.style.position = \"absolute\";\n\tderpy.image.style.top = \"0px\";\n\tderpy.image.style.left = \"0px\";\n\tderpy.div.appendChild(derpy.image);\n\t\n\tderpy.initPosition();\n\t\n\tderpy.update = function(time) {\n\t\tFloatable.prototype.update.call(derpy, time);\n\t\tderpy.velocity.x += Math.random() * 0.3 - 0.15;\n\t\tif (derpy.velocity.x > 0.1) {\n\t\t\t$(derpy.image).css({\n\t\t\t\t\"-moz-transform\": \"scaleX(-1)\",\n\t\t\t\t\"-o-transform\": \"scaleX(-1)\",\n\t\t\t\t\"-webkit-transform\": \"scaleX(-1)\",\n\t\t\t\t\"transform\": \"scaleX(-1)\"\n\t\t\t});\n\t\t}\n\t\tif (derpy.velocity.x < -0.1) {\n\t\t\t$(derpy.image).css({\n\t\t\t\t\"-moz-transform\": \"scaleX(1)\",\n\t\t\t\t\"-o-transform\": \"scaleX(1)\",\n\t\t\t\t\"-webkit-transform\": \"scaleX(1)\",\n\t\t\t\t\"transform\": \"scaleX(1)\"\n\t\t\t});\n\t\t}\n\t};\n};\nnew Konami(easterSuccess);\n","var satoshi = 100000000;\nvar DELAY_CAP = 20000;\nvar lastBlockHeight = 0;\n\nvar provider_name = \"blockchain.info\";\n\n/** @constructor */\nfunction TransactionSocket() {\n\n}\n\nTransactionSocket.init = function() {\n\t// Terminate previous connection, if any\n\tif (TransactionSocket.connection)\n\t\tTransactionSocket.connection.close();\n\n\tif ('WebSocket' in window) {\n\t\tvar connection = new ReconnectingWebSocket('wss://ws.blockchain.info/inv');\n\t\tTransactionSocket.connection = connection;\n\n\t\tStatusBox.reconnecting(\"blockchain\");\n\n\t\tconnection.onopen = function() {\n\t\t\tconsole.log('Blockchain.info: Connection open!');\n\t\t\tStatusBox.connected(\"blockchain\");\n\t\t\tvar newTransactions = {\n\t\t\t\t\"op\" : \"unconfirmed_sub\"\n\t\t\t};\n\t\t\tvar newBlocks = {\n\t\t\t\t\"op\" : \"blocks_sub\"\n\t\t\t};\n\t\t\tconnection.send(JSON.stringify(newTransactions));\n\t\t\tconnection.send(JSON.stringify(newBlocks));\n\t\t\tconnection.send(JSON.stringify({\n\t\t\t\t\"op\" : \"ping_tx\"\n\t\t\t}));\n\t\t\t// Display the latest transaction so the user sees something.\n\t\t};\n\n\t\tconnection.onclose = function() {\n\t\t\tconsole.log('Blockchain.info: Connection closed');\n\t\t\tif ($(\"#blockchainCheckBox\").prop(\"checked\"))\n\t\t\t\tStatusBox.reconnecting(\"blockchain\");\n\t\t\telse\n\t\t\t\tStatusBox.closed(\"blockchain\");\n\t\t};\n\n\t\tconnection.onerror = function(error) {\n\t\t\tconsole.log('Blockchain.info: Connection Error: ' + error);\n\t\t};\n\n\t\tconnection.onmessage = function(e) {\n\t\t\tvar data = JSON.parse(e.data);\n\n\t\t\t// New Transaction\n\t\t\tif (data.op == \"utx\") {\n\t\t\t\tvar transacted = 0;\n\n\t\t\t\tfor (var i = 0; i < data.x.out.length; i++) {\n\t\t\t\t\ttransacted += data.x.out[i].value;\n\t\t\t\t}\n\n\t\t\t\tvar bitcoins = transacted / satoshi;\n\t\t\t\t//console.log(\"Transaction: \" + bitcoins + \" BTC\");\n\n\t\t\t\tvar donation = false;\n var soundDonation = false;\n\t\t\t\tvar outputs = data.x.out;\n\t\t\t\tfor (var j = 0; j < outputs.length; j++) {\n\t\t\t\t\tif ((outputs[j].addr) == DONATION_ADDRESS) {\n\t\t\t\t\t\tbitcoins = data.x.out[j].value / satoshi;\n\t\t\t\t\t\tnew Transaction(bitcoins, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n if (transaction_count === 0) {\n new Transaction(bitcoins);\n } else {\n\t\t\t\t setTimeout(function() {\n\t\t\t\t\t new Transaction(bitcoins);\n\t\t\t\t }, Math.random() * DELAY_CAP);\n\t\t\t\t}\n\n\t\t\t} else if (data.op == \"block\") {\n\t\t\t\tvar blockHeight = data.x.height;\n\t\t\t\tvar transactions = data.x.nTx;\n\t\t\t\tvar volumeSent = data.x.estimatedBTCSent;\n\t\t\t\tvar blockSize = data.x.size;\n\t\t\t\t// Filter out the orphaned blocks.\n\t\t\t\tif (blockHeight > lastBlockHeight) {\n\t\t\t\t\tlastBlockHeight = blockHeight;\n\t\t\t\t\tconsole.log(\"New Block\");\n\t\t\t\t\tnew Block(blockHeight, transactions, volumeSent, blockSize);\n\t\t\t\t}\n\t\t\t}\n\n\t\t};\n\t} else {\n\t\t//WebSockets are not supported.\n\t\tconsole.log(\"No websocket support.\");\n\t\tStatusBox.nosupport(\"blockchain\");\n\t}\n};\n\nTransactionSocket.close = function() {\n\tif (TransactionSocket.connection)\n\t\tTransactionSocket.connection.disconnect();\n\tStatusBox.closed(\"blockchain\");\n};\n","var globalVolume = 50;\nvar globalScalePitch;\nvar globalBank;\n//init volume at 50%\nHowler.volume(globalVolume * 0.01);\n\nfunction Sound() {\n\n}\n\nvar soundBank = [];\n\t// the second number is the number of sound files available\n\tsoundBank[0] = [\"celesta\", 22];\n\tsoundBank[1] = [\"planet\", 33];\n\tsoundBank[2] = [\"wikki\", 13];\n\nfunction zeroPad(num, places) {\n\tvar zero = places - num.toString().length + 1;\n\treturn Array(+(zero > 0 && zero)).join(\"0\") + num;\n}\n\t\nSound.loadup = function(){\n\tvar newSound;\n\tvar istring;\n\n\t// sound0 = celesta\n\tsound0 = []; \n\n // sound1 = planet\n\tsound1 = []; \n\n // sound2 = celestaB\n\tsound2 = []; \n\n\t// String swells0, for blocks\n\tswells0 = [];\n\t\n\t// String swells1, for blocks\n\tswells1 = [];\n\n // String swells2, for blocks\n\tswells2 = [];\n\t\n\t// These variables are populated (and their sounds loaded) by the Sound.change function below.\n};\n\n\n\nSound.init = function() {\n\n\n\t// Initialize sound toggle button\n\t$(\"#volumeControl\").click(function() {\n\t\tif (!globalMute) {\n\t\t\tglobalMute = true;\n\t\t\tHowler.mute();\n\t\t\t$(\"#volumeControl\").css(\"background-position\", \"0 0\");\n\t\t} else {\n\t\t\tglobalMute = false;\n\t\t\tHowler.unmute();\n\t\t\t$(\"#volumeControl\").css(\"background-position\", \"0 -46px\");\n\t\t}\n\t});\n \n\t// Initialize sound slider\n\t$(\"#volumeSlider\").noUiSlider({\n\t\trange : {\n\t\t\t'min': 0,\n\t\t\t'max': 100\n\t\t},\n\t\tstart : 50,\n\t\thandles : 1,\n\t\tstep : 1,\n\t\torientation : \"vertical\"\n\t}).on('slide', function() {\n\t\t\tglobalVolume = 100 - $(this).val();\n\t\t\tHowler.volume(globalVolume * 0.01);\n\t});\n\t\n\tglobalScalePitch = $(\"#scalePitchCheckBox\").attr(\"checked\");\n\tSound.change(0);\n};\n\nSound.change = function(instrument_number) {\n\tvar musicianString = \"Donate to instrument creator: \";\n\tvar i;\n\t// INSTRUMENT 0\n\tif (instrument_number === 0 ) {\n\t\t// Load sound and swells if not already loaded\n\t\tif (sound0.length === 0) {\n\t\t\tfor (i = 1; i <= 22; i++) {\n\t\t\t\tistring = zeroPad(i, 3);\n\t\t\t\tnewSound = new Howl({\n\t\t\t\t\t\turls: [\"sounds/celesta/\" + \"celesta\" + istring + \".ogg\",\n\t\t\t\t\t\t\t \"sounds/celesta/\" + \"celesta\" + istring + \".mp3\"],\n\t\t\t\t\t\tautoplay: false\n\t\t\t\t});\n\t\t\t\tsound0.push(newSound);\n\t\t\t}\n\t\t}\n\t\tif (swells0.length === 0) {\n\t\t\tfor (i = 1; i <= 3; i++) {\n\t\t\t\tnewSound = new Howl({\n\t\t\t\t\turls: [\"sounds/swells0/swell\" + i +\".ogg\",\n\t\t\t\t\t\t\t\"sounds/swells0/swell\" + i +\".mp3\"],\n\t\t\t\t\tautoplay: false\n\t\t\t\t});\n\t\t\t\tswells0.push(newSound);\n\t\t\t}\n\t\t}\n\t\tcurrentSound = sound0;\n\t\tcurrentSwells = swells0;\n\t\t$('#musicianDonation').text(\"\");\n\t}\n\t// INSTRUMENT 1\n\telse if (instrument_number === 1) {\n\t // Load sound and swells if not already loaded\n\t\tif (sound1.length === 0) {\n\t\t\tfor (i = 1; i <= 33; i++) {\n\t\t\t\tistring = zeroPad(i, 3);\n\t\t\t\tnewSound = new Howl({\n\t\t\t\t\t\turls: [\"sounds/planet/\" + \"planet\" + istring + \".ogg\",\n\t\t\t\t\t\t\t \"sounds/planet/\" + \"planet\" + istring + \".mp3\"],\n\t\t\t\t\t\tautoplay: false\n\t\t\t\t});\n\t\t\t\tsound1.push(newSound);\n\t\t\t}\n\t\t}\n if (swells1.length === 0) {\n\t\t\tfor (i = 1; i <= 3; i++) {\n\t\t\t\tnewSound = new Howl({\n\t\t\t\t\turls: [\"sounds/swells1/planetswell\" + i +\".ogg\",\n\t\t\t\t\t\t\t\"sounds/swells1/planetswell\" + i +\".mp3\"],\n\t\t\t\t\tautoplay: false\n\t\t\t\t});\n\t\t\t\tswells1.push(newSound);\n\t\t\t}\n\t\t}\n\t\tcurrentSound = sound1;\n\t\tcurrentSwells = swells1;\n\t\tSOUND_DONATION_ADDRESS = \"144b31mmaWQVDQFiUPo6HEzxc2Dm83WXrW\";\n\t\t$('#musicianDonation').html(musicianString + \"\" + SOUND_DONATION_ADDRESS + \"\");\n\t}\n // INSTRUMENT 2\n\telse if (instrument_number === 2) {\n\t\t// Load sound and swells if not already loaded\n\t\tif (sound2.length === 0) {\n\t\t\tfor (i = 1; i <= 13; i++) {\n\t\t\t\tistring = zeroPad(i, 3);\n\t\t\t\tnewSound = new Howl({\n\t\t\t\t\t\turls: [\"sounds/wikki/\" + \"wikki\" + istring + \".ogg\",\n\t\t\t\t\t\t\t \"sounds/wikki/\" + \"wikki\" + istring + \".mp3\"],\n\t\t\t\t\t\tautoplay: false\n\t\t\t\t});\n\t\t\t\tsound2.push(newSound);\n\t\t\t}\n\t\t}\n\t\tif (swells2.length === 0) {\n\t\t\tfor (i = 1; i <= 3; i++) {\n\t\t\t\tnewSound = new Howl({\n\t\t\t\t\turls: [\"sounds/swells2/wikkiswell\" + i +\".ogg\",\n\t\t\t\t\t\t\t\"sounds/swells2/wikkiswell\" + i +\".mp3\"],\n\t\t\t\t\tautoplay: false\n\t\t\t\t});\n\t\t\t\tswells2.push(newSound);\n\t\t\t}\n\t\t}\n\t currentSound = sound2;\n\t\tcurrentSwells = swells2;\n\t\tSOUND_DONATION_ADDRESS = \"1JFaYRGkDmhpSTbFKwqDWKr2ncvvrgYEAV\";\n\t\t$('#musicianDonation').html(musicianString + \"\" + SOUND_DONATION_ADDRESS + \"\");\n\t\t}\n};\n\nvar currentNotes = 0;\nvar noteTimeout = 500;\n\nSound.playRandomAtVolume = function(volume) {\n\tif (globalMute)\n\t\treturn;\n\t\t\n\tvar randomPitch = Math.floor(Math.random() * 100);\n\tSound.playPitchAtVolume(volume, randomPitch);\n};\n\nSound.playPitchAtVolume = function(volume, pitch) {\n\tif (globalMute)\n\t\treturn;\n\t// Find the index corresponding to the requested pitch\n\tvar index = Math.floor(pitch / 100.0 * currentSound.length);\n\t//console.log(\"Pitch: \" + pitch);\n\t\n\t// Here we fuzz the index a bit to prevent the same sound\n\t// from being heard over and over again, which gets annoying\n\tvar fuzz = Math.floor(Math.random() * 4) - 2;\n\tindex += fuzz;\n\tindex = Math.min(currentSound.length - 1, index);\n\tindex = Math.max(0, index);\n\t\n\t//console.log(\"Fuzz: \" + fuzz);\n\t//console.log(\"Index: \" + index);\n\t\n\n\t//var readyState = currentSound[index].get(\"readyState\");\n\tif (currentNotes < 5) {\n currentSound[index].volume(volume);\n\t\tcurrentSound[index].play();\n\t\tcurrentNotes++;\n\t\tsetTimeout(function() {\n\t\t\tcurrentNotes--;\n\t\t}, noteTimeout);\n\t}\n};\n\nvar lastBlockSound = -1;\nSound.playRandomSwell = function() {\n\tif (globalMute)\n\t\treturn;\n\n\tvar randomIndex;\n\tdo {\n\t\trandomIndex = Math.floor(Math.random() * currentSwells.length);\n\t} while (randomIndex == lastBlockSound);\n\n\tlastBlockSound = randomIndex;\n\n\t//var readyState = this.swells[randomIndex].get(\"readyState\");\n\t//if (readyState >= 2)\n\tcurrentSwells[randomIndex].play();\n};\n","var CONNECTED = \"Connected.\";\nvar CONNECTING = \"Connecting...\";\nvar NO_SUPPORT = \"No browser support.\";\nvar CLOSED = \"Click to connect.\";\n\nvar provider_name = \"blockchain.info\";\n\nfunction StatusBox() {\n\n}\n\nStatusBox.init = function(debugmode) {\n\tStatusBox.blockchain = $(\"#blockchainStatus\");\n\tStatusBox.mtgox = $(\"#mtgoxStatus\");\n\n\tif (debugmode) {\n\t\tStatusBox.blockchain.html(\"\");\n\t\tStatusBox.mtgox.html(\"Debug mode.\");\n\t}\n\n\tif ($(\"#blockchainCheckBox\").is(\":checked\"))\n\t\tStatusBox.reconnecting(\"blockchain\");\n\telse\n\t\tStatusBox.closed(\"blockchain\");\n\n\tif ($(\"#mtgoxCheckBox\").is(\":checked\"))\n\t\tStatusBox.reconnecting(\"mtgox\");\n\telse\n\t\tStatusBox.closed(\"mtgox\");\n};\n// \"type\" can be either \"blockchain\" or \"mtgox\"\nStatusBox.connected = function(type) {\n\tif (type == \"blockchain\")\n\t\tStatusBox.blockchain.html('Transactions (' + provider_name + '): ' + CONNECTED + '');\n\tif (type == \"mtgox\")\n\t\tStatusBox.mtgox.html('Mt.Gox Trades: ' + CONNECTED + '');\n};\n\nStatusBox.reconnecting = function(type) {\n\tif (type == \"blockchain\")\n\t\tStatusBox.blockchain.html('Transactions (' + provider_name + '): ' + CONNECTING + '');\n\tif (type == \"mtgox\")\n\t\tStatusBox.mtgox.html('Mt.Gox Trades: ' + CONNECTING + '');\n};\n\nStatusBox.nosupport = function(type) {\n\tif (type == \"blockchain\")\n\t\tStatusBox.blockchain.html('Transactions (' + provider_name + '): ' + NO_SUPPORT + '');\n\tif (type == \"mtgox\")\n\t\tStatusBox.mtgox.html('Mt.Gox Trades: ' + NO_SUPPORT + '');\n};\n\nStatusBox.closed = function(type) {\n\tif (type == \"blockchain\")\n\t\tStatusBox.blockchain.html('Transactions (' + provider_name + '): ' + CLOSED + '');\n\tif (type == \"mtgox\")\n\t\tStatusBox.mtgox.html('Mt.Gox Trades: ' + CLOSED + '');\n};\n","/** \n * @constructor\n * @extends Floatable\n */\nfunction Transaction(bitcoins, highlight, currency, currencyName) {\n\tif (document.visibilityState === \"visible\") {\n\t\tFloatable.call(this);\n\n\t\tthis.area = bitcoins * 100 + 3000;\n\t\tthis.width = this.height = Math.sqrt(this.area / Math.PI) * 2;\n\n\t\tthis.addImage(bubbleImage, this.width, this.height);\n\t\n\t var bitcoinVal = bitcoins.toFixed(2);\n\t var bitcoinString;\n\t \n\t if (bitcoinVal === \"0.00\") {\n\t bitcoinString = \"<B0.01\";\n\t } else {\n\t bitcoinString = \"B\" + bitcoinVal;\n\t }\n\t\n\t\tif (!highlight) {\n\t\t\tthis.addText(bitcoinString);\n\t\t} else {\n\t\t\tthis.addText('' + bitcoinString + '
Donation
Thanks!');\n\t\t}\n\t\tif (currency && currencyName) {\n\t\t\tthis.addText('
' + currency.toFixed(2) + ' ' + currencyName);\n\t\t}\n\t\tthis.initPosition();\n\t\t\n\t\t// Sound\n\t var maxBitcoins = 1000;\n\t var minVolume = 0.3;\n\t var maxVolume = 0.7;\n\t var volume = bitcoins / (maxBitcoins / (maxVolume - minVolume)) + minVolume;\n\t if (volume > maxVolume)\n\t\t volume = maxVolume;\n\t\n\t var maxPitch = 100.0;\n\t // We need to use a log that makes it so that maxBitcoins reaches the maximum pitch.\n\t // Well, the opposite of the maximum pitch. Anyway. So we solve:\n\t // maxPitch = log(maxBitcoins + logUsed) / log(logUsed)\n\t // For maxPitch = 100 (for 100%) and maxBitcoins = 1000, that gives us...\n\t var logUsed = 1.0715307808111486871978099;\n\t // So we find the smallest value between log(bitcoins + logUsed) / log(logUsed) and our max pitch...\n\t var pitch = Math.min(maxPitch, Math.log(bitcoins + logUsed) / Math.log(logUsed));\n\t // ...we invert it so that a bigger transaction = a deeper noise...\n\t pitch = maxPitch - pitch;\n\t // ...and we play the sound!\n\t if(globalScalePitch) {\n\t\t Sound.playPitchAtVolume(volume, pitch);\n\t } else {\n\t\t Sound.playRandomAtVolume(volume);\n\t }\n\t \n\t transaction_count++;\n\t \n\t if (transaction_count === 5) {\n\t document.getElementById(\"waitingForTransactions\").style.opacity = \"0\";\n\t }\n\t\t\n\t}\n\n}\n\nextend(Floatable, Transaction);\n","/*\n * Konami-JS ~ \n * :: Now with support for touch events and multiple instances for \n * :: those situations that call for multiple easter eggs!\n * Code: http://konami-js.googlecode.com/\n * Examples: http://www.snaptortoise.com/konami-js\n * Copyright (c) 2009 George Mandis (georgemandis.com, snaptortoise.com)\n * Version: 1.4.2 (9/2/2013)\n * Licensed under the MIT License (http://opensource.org/licenses/MIT)\n * Tested in: Safari 4+, Google Chrome 4+, Firefox 3+, IE7+, Mobile Safari 2.2.1 and Dolphin Browser\n */\n\nvar Konami = function (callback) {\n\tvar konami = {\n\t\taddEvent: function (obj, type, fn, ref_obj) {\n\t\t\tif (obj.addEventListener)\n\t\t\t\tobj.addEventListener(type, fn, false);\n\t\t\telse if (obj.attachEvent) {\n\t\t\t\t// IE\n\t\t\t\tobj[\"e\" + type + fn] = fn;\n\t\t\t\tobj[type + fn] = function () {\n\t\t\t\t\tobj[\"e\" + type + fn](window.event, ref_obj);\n\t\t\t\t}\n\t\t\t\tobj.attachEvent(\"on\" + type, obj[type + fn]);\n\t\t\t}\n\t\t},\n\t\tinput: \"\",\n\t\tpattern: \"38384040373937396665\",\n\t\tload: function (link) {\n\t\t\tthis.addEvent(document, \"keydown\", function (e, ref_obj) {\n\t\t\t\tif (ref_obj) konami = ref_obj; // IE\n\t\t\t\tkonami.input += e ? e.keyCode : event.keyCode;\n\t\t\t\tif (konami.input.length > konami.pattern.length)\n\t\t\t\t\tkonami.input = konami.input.substr((konami.input.length - konami.pattern.length));\n\t\t\t\tif (konami.input == konami.pattern) {\n\t\t\t\t\tkonami.code(link);\n\t\t\t\t\tkonami.input = \"\";\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}, this);\n\t\t\tthis.iphone.load(link);\n\t\t},\n\t\tcode: function (link) {\n\t\t\twindow.location = link\n\t\t},\n\t\tiphone: {\n\t\t\tstart_x: 0,\n\t\t\tstart_y: 0,\n\t\t\tstop_x: 0,\n\t\t\tstop_y: 0,\n\t\t\ttap: false,\n\t\t\tcapture: false,\n\t\t\torig_keys: \"\",\n\t\t\tkeys: [\"UP\", \"UP\", \"DOWN\", \"DOWN\", \"LEFT\", \"RIGHT\", \"LEFT\", \"RIGHT\", \"TAP\", \"TAP\"],\n\t\t\tcode: function (link) {\n\t\t\t\tkonami.code(link);\n\t\t\t},\n\t\t\tload: function (link) {\n\t\t\t\tthis.orig_keys = this.keys;\n\t\t\t\tkonami.addEvent(document, \"touchmove\", function (e) {\n\t\t\t\t\tif (e.touches.length == 1 && konami.iphone.capture == true) {\n\t\t\t\t\t\tvar touch = e.touches[0];\n\t\t\t\t\t\tkonami.iphone.stop_x = touch.pageX;\n\t\t\t\t\t\tkonami.iphone.stop_y = touch.pageY;\n\t\t\t\t\t\tkonami.iphone.tap = false;\n\t\t\t\t\t\tkonami.iphone.capture = false;\n\t\t\t\t\t\tkonami.iphone.check_direction();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tkonami.addEvent(document, \"touchend\", function (evt) {\n\t\t\t\t\tif (konami.iphone.tap == true) konami.iphone.check_direction(link);\n\t\t\t\t}, false);\n\t\t\t\tkonami.addEvent(document, \"touchstart\", function (evt) {\n\t\t\t\t\tkonami.iphone.start_x = evt.changedTouches[0].pageX;\n\t\t\t\t\tkonami.iphone.start_y = evt.changedTouches[0].pageY;\n\t\t\t\t\tkonami.iphone.tap = true;\n\t\t\t\t\tkonami.iphone.capture = true;\n\t\t\t\t});\n\t\t\t},\n\t\t\tcheck_direction: function (link) {\n\t\t\t\tx_magnitude = Math.abs(this.start_x - this.stop_x);\n\t\t\t\ty_magnitude = Math.abs(this.start_y - this.stop_y);\n\t\t\t\tx = ((this.start_x - this.stop_x) < 0) ? \"RIGHT\" : \"LEFT\";\n\t\t\t\ty = ((this.start_y - this.stop_y) < 0) ? \"DOWN\" : \"UP\";\n\t\t\t\tresult = (x_magnitude > y_magnitude) ? x : y;\n\t\t\t\tresult = (this.tap == true) ? \"TAP\" : result;\n\n\t\t\t\tif (result == this.keys[0]) this.keys = this.keys.slice(1, this.keys.length);\n\t\t\t\tif (this.keys.length == 0) {\n\t\t\t\t\tthis.keys = this.orig_keys;\n\t\t\t\t\tthis.code(link);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\ttypeof callback === \"string\" && konami.load(callback);\n\tif (typeof callback === \"function\") {\n\t\tkonami.code = callback;\n\t\tkonami.load();\n\t}\n\n\treturn konami;\n};\n","/*!\n * howler.js v1.1.25\n * howlerjs.com\n *\n * (c) 2013-2014, James Simpson of GoldFire Studios\n * goldfirestudios.com\n *\n * MIT License\n */\n\n(function() {\n // setup\n var cache = {};\n\n // setup the audio context\n var ctx = null,\n usingWebAudio = true,\n noAudio = false;\n try {\n if (typeof AudioContext !== 'undefined') {\n ctx = new AudioContext();\n } else if (typeof webkitAudioContext !== 'undefined') {\n ctx = new webkitAudioContext();\n } else {\n usingWebAudio = false;\n }\n } catch(e) {\n usingWebAudio = false;\n }\n\n if (!usingWebAudio) {\n if (typeof Audio !== 'undefined') {\n try {\n new Audio();\n } catch(e) {\n noAudio = true;\n }\n } else {\n noAudio = true;\n }\n }\n\n // create a master gain node\n if (usingWebAudio) {\n var masterGain = (typeof ctx.createGain === 'undefined') ? ctx.createGainNode() : ctx.createGain();\n masterGain.gain.value = 1;\n masterGain.connect(ctx.destination);\n }\n\n // create global controller\n var HowlerGlobal = function(codecs) {\n this._volume = 1;\n this._muted = false;\n this.usingWebAudio = usingWebAudio;\n this.ctx = ctx;\n this.noAudio = noAudio;\n this._howls = [];\n this._codecs = codecs;\n this.iOSAutoEnable = true;\n };\n HowlerGlobal.prototype = {\n /**\n * Get/set the global volume for all sounds.\n * @param {Float} vol Volume from 0.0 to 1.0.\n * @return {Howler/Float} Returns self or current volume.\n */\n volume: function(vol) {\n var self = this;\n\n // make sure volume is a number\n vol = parseFloat(vol);\n\n if (vol >= 0 && vol <= 1) {\n self._volume = vol;\n\n if (usingWebAudio) {\n masterGain.gain.value = vol;\n }\n\n // loop through cache and change volume of all nodes that are using HTML5 Audio\n for (var key in self._howls) {\n if (self._howls.hasOwnProperty(key) && self._howls[key]._webAudio === false) {\n // loop through the audio nodes\n for (var i=0; i 0) ? node._pos : self._sprite[sprite][0] / 1000;\n\n // determine how long to play for\n var duration = 0;\n if (self._webAudio) {\n duration = self._sprite[sprite][1] / 1000 - node._pos;\n if (node._pos > 0) {\n pos = self._sprite[sprite][0] / 1000 + pos;\n }\n } else {\n duration = self._sprite[sprite][1] / 1000 - (pos - self._sprite[sprite][0] / 1000);\n }\n\n // determine if this sound should be looped\n var loop = !!(self._loop || self._sprite[sprite][2]);\n\n // set timer to fire the 'onend' event\n var soundId = (typeof callback === 'string') ? callback : Math.round(Date.now() * Math.random()) + '',\n timerId;\n (function() {\n var data = {\n id: soundId,\n sprite: sprite,\n loop: loop\n };\n timerId = setTimeout(function() {\n // if looping, restart the track\n if (!self._webAudio && loop) {\n self.stop(data.id).play(sprite, data.id);\n }\n\n // set web audio node to paused at end\n if (self._webAudio && !loop) {\n self._nodeById(data.id).paused = true;\n self._nodeById(data.id)._pos = 0;\n\n // clear the end timer\n self._clearEndTimer(data.id);\n }\n\n // end the track if it is HTML audio and a sprite\n if (!self._webAudio && !loop) {\n self.stop(data.id);\n }\n\n // fire ended event\n self.on('end', soundId);\n }, duration * 1000);\n\n // store the reference to the timer\n self._onendTimer.push({timer: timerId, id: data.id});\n })();\n\n if (self._webAudio) {\n var loopStart = self._sprite[sprite][0] / 1000,\n loopEnd = self._sprite[sprite][1] / 1000;\n\n // set the play id to this node and load into context\n node.id = soundId;\n node.paused = false;\n refreshBuffer(self, [loop, loopStart, loopEnd], soundId);\n self._playStart = ctx.currentTime;\n node.gain.value = self._volume;\n\n if (typeof node.bufferSource.start === 'undefined') {\n node.bufferSource.noteGrainOn(0, pos, duration);\n } else {\n node.bufferSource.start(0, pos, duration);\n }\n } else {\n if (node.readyState === 4 || !node.readyState && navigator.isCocoonJS) {\n node.readyState = 4;\n node.id = soundId;\n node.currentTime = pos;\n node.muted = Howler._muted || node.muted;\n node.volume = self._volume * Howler.volume();\n setTimeout(function() { node.play(); }, 0);\n } else {\n self._clearEndTimer(soundId);\n\n (function(){\n var sound = self,\n playSprite = sprite,\n fn = callback,\n newNode = node;\n var listener = function() {\n sound.play(playSprite, fn);\n\n // clear the event listener\n newNode.removeEventListener('canplaythrough', listener, false);\n };\n newNode.addEventListener('canplaythrough', listener, false);\n })();\n\n return self;\n }\n }\n\n // fire the play event and send the soundId back in the callback\n self.on('play');\n if (typeof callback === 'function') callback(soundId);\n\n return self;\n });\n\n return self;\n },\n\n /**\n * Pause playback and save the current position.\n * @param {String} id (optional) The play instance ID.\n * @return {Howl}\n */\n pause: function(id) {\n var self = this;\n\n // if the sound hasn't been loaded, add it to the event queue\n if (!self._loaded) {\n self.on('play', function() {\n self.pause(id);\n });\n\n return self;\n }\n\n // clear 'onend' timer\n self._clearEndTimer(id);\n\n var activeNode = (id) ? self._nodeById(id) : self._activeNode();\n if (activeNode) {\n activeNode._pos = self.pos(null, id);\n\n if (self._webAudio) {\n // make sure the sound has been created\n if (!activeNode.bufferSource || activeNode.paused) {\n return self;\n }\n\n activeNode.paused = true;\n if (typeof activeNode.bufferSource.stop === 'undefined') {\n activeNode.bufferSource.noteOff(0);\n } else {\n activeNode.bufferSource.stop(0);\n }\n } else {\n activeNode.pause();\n }\n }\n\n self.on('pause');\n\n return self;\n },\n\n /**\n * Stop playback and reset to start.\n * @param {String} id (optional) The play instance ID.\n * @return {Howl}\n */\n stop: function(id) {\n var self = this;\n\n // if the sound hasn't been loaded, add it to the event queue\n if (!self._loaded) {\n self.on('play', function() {\n self.stop(id);\n });\n\n return self;\n }\n\n // clear 'onend' timer\n self._clearEndTimer(id);\n\n var activeNode = (id) ? self._nodeById(id) : self._activeNode();\n if (activeNode) {\n activeNode._pos = 0;\n\n if (self._webAudio) {\n // make sure the sound has been created\n if (!activeNode.bufferSource || activeNode.paused) {\n return self;\n }\n\n activeNode.paused = true;\n\n if (typeof activeNode.bufferSource.stop === 'undefined') {\n activeNode.bufferSource.noteOff(0);\n } else {\n activeNode.bufferSource.stop(0);\n }\n } else if (!isNaN(activeNode.duration)) {\n activeNode.pause();\n activeNode.currentTime = 0;\n }\n }\n\n return self;\n },\n\n /**\n * Mute this sound.\n * @param {String} id (optional) The play instance ID.\n * @return {Howl}\n */\n mute: function(id) {\n var self = this;\n\n // if the sound hasn't been loaded, add it to the event queue\n if (!self._loaded) {\n self.on('play', function() {\n self.mute(id);\n });\n\n return self;\n }\n\n var activeNode = (id) ? self._nodeById(id) : self._activeNode();\n if (activeNode) {\n if (self._webAudio) {\n activeNode.gain.value = 0;\n } else {\n activeNode.muted = true;\n }\n }\n\n return self;\n },\n\n /**\n * Unmute this sound.\n * @param {String} id (optional) The play instance ID.\n * @return {Howl}\n */\n unmute: function(id) {\n var self = this;\n\n // if the sound hasn't been loaded, add it to the event queue\n if (!self._loaded) {\n self.on('play', function() {\n self.unmute(id);\n });\n\n return self;\n }\n\n var activeNode = (id) ? self._nodeById(id) : self._activeNode();\n if (activeNode) {\n if (self._webAudio) {\n activeNode.gain.value = self._volume;\n } else {\n activeNode.muted = false;\n }\n }\n\n return self;\n },\n\n /**\n * Get/set volume of this sound.\n * @param {Float} vol Volume from 0.0 to 1.0.\n * @param {String} id (optional) The play instance ID.\n * @return {Howl/Float} Returns self or current volume.\n */\n volume: function(vol, id) {\n var self = this;\n\n // make sure volume is a number\n vol = parseFloat(vol);\n\n if (vol >= 0 && vol <= 1) {\n self._volume = vol;\n\n // if the sound hasn't been loaded, add it to the event queue\n if (!self._loaded) {\n self.on('play', function() {\n self.volume(vol, id);\n });\n\n return self;\n }\n\n var activeNode = (id) ? self._nodeById(id) : self._activeNode();\n if (activeNode) {\n if (self._webAudio) {\n activeNode.gain.value = vol;\n } else {\n activeNode.volume = vol * Howler.volume();\n }\n }\n\n return self;\n } else {\n return self._volume;\n }\n },\n\n /**\n * Get/set whether to loop the sound.\n * @param {Boolean} loop To loop or not to loop, that is the question.\n * @return {Howl/Boolean} Returns self or current looping value.\n */\n loop: function(loop) {\n var self = this;\n\n if (typeof loop === 'boolean') {\n self._loop = loop;\n\n return self;\n } else {\n return self._loop;\n }\n },\n\n /**\n * Get/set sound sprite definition.\n * @param {Object} sprite Example: {spriteName: [offset, duration, loop]}\n * @param {Integer} offset Where to begin playback in milliseconds\n * @param {Integer} duration How long to play in milliseconds\n * @param {Boolean} loop (optional) Set true to loop this sprite\n * @return {Howl} Returns current sprite sheet or self.\n */\n sprite: function(sprite) {\n var self = this;\n\n if (typeof sprite === 'object') {\n self._sprite = sprite;\n\n return self;\n } else {\n return self._sprite;\n }\n },\n\n /**\n * Get/set the position of playback.\n * @param {Float} pos The position to move current playback to.\n * @param {String} id (optional) The play instance ID.\n * @return {Howl/Float} Returns self or current playback position.\n */\n pos: function(pos, id) {\n var self = this;\n\n // if the sound hasn't been loaded, add it to the event queue\n if (!self._loaded) {\n self.on('load', function() {\n self.pos(pos);\n });\n\n return typeof pos === 'number' ? self : self._pos || 0;\n }\n\n // make sure we are dealing with a number for pos\n pos = parseFloat(pos);\n\n var activeNode = (id) ? self._nodeById(id) : self._activeNode();\n if (activeNode) {\n if (pos >= 0) {\n self.pause(id);\n activeNode._pos = pos;\n self.play(activeNode._sprite, id);\n\n return self;\n } else {\n return self._webAudio ? activeNode._pos + (ctx.currentTime - self._playStart) : activeNode.currentTime;\n }\n } else if (pos >= 0) {\n return self;\n } else {\n // find the first inactive node to return the pos for\n for (var i=0; i= 0 || x < 0) {\n if (self._webAudio) {\n var activeNode = (id) ? self._nodeById(id) : self._activeNode();\n if (activeNode) {\n self._pos3d = [x, y, z];\n activeNode.panner.setPosition(x, y, z);\n activeNode.panner.panningModel = self._model || 'HRTF';\n }\n }\n } else {\n return self._pos3d;\n }\n\n return self;\n },\n\n /**\n * Fade a currently playing sound between two volumes.\n * @param {Number} from The volume to fade from (0.0 to 1.0).\n * @param {Number} to The volume to fade to (0.0 to 1.0).\n * @param {Number} len Time in milliseconds to fade.\n * @param {Function} callback (optional) Fired when the fade is complete.\n * @param {String} id (optional) The play instance ID.\n * @return {Howl}\n */\n fade: function(from, to, len, callback, id) {\n var self = this,\n diff = Math.abs(from - to),\n dir = from > to ? 'down' : 'up',\n steps = diff / 0.01,\n stepTime = len / steps;\n\n // if the sound hasn't been loaded, add it to the event queue\n if (!self._loaded) {\n self.on('load', function() {\n self.fade(from, to, len, callback, id);\n });\n\n return self;\n }\n\n // set the volume to the start position\n self.volume(from, id);\n\n for (var i=1; i<=steps; i++) {\n (function() {\n var change = self._volume + (dir === 'up' ? 0.01 : -0.01) * i,\n vol = Math.round(1000 * change) / 1000,\n toVol = to;\n\n setTimeout(function() {\n self.volume(vol, id);\n\n if (vol === toVol) {\n if (callback) callback();\n }\n }, stepTime * i);\n })();\n }\n },\n\n /**\n * [DEPRECATED] Fade in the current sound.\n * @param {Float} to Volume to fade to (0.0 to 1.0).\n * @param {Number} len Time in milliseconds to fade.\n * @param {Function} callback\n * @return {Howl}\n */\n fadeIn: function(to, len, callback) {\n return this.volume(0).play().fade(0, to, len, callback);\n },\n\n /**\n * [DEPRECATED] Fade out the current sound and pause when finished.\n * @param {Float} to Volume to fade to (0.0 to 1.0).\n * @param {Number} len Time in milliseconds to fade.\n * @param {Function} callback\n * @param {String} id (optional) The play instance ID.\n * @return {Howl}\n */\n fadeOut: function(to, len, callback, id) {\n var self = this;\n\n return self.fade(self._volume, to, len, function() {\n if (callback) callback();\n self.pause(id);\n\n // fire ended event\n self.on('end');\n }, id);\n },\n\n /**\n * Get an audio node by ID.\n * @return {Howl} Audio node.\n */\n _nodeById: function(id) {\n var self = this,\n node = self._audioNode[0];\n\n // find the node with this ID\n for (var i=0; i=0; i--) {\n if (inactive <= 5) {\n break;\n }\n\n if (self._audioNode[i].paused) {\n // disconnect the audio source if using Web Audio\n if (self._webAudio) {\n self._audioNode[i].disconnect(0);\n }\n\n inactive--;\n self._audioNode.splice(i, 1);\n }\n }\n },\n\n /**\n * Clear 'onend' timeout before it ends.\n * @param {String} soundId The play instance ID.\n */\n _clearEndTimer: function(soundId) {\n var self = this,\n index = 0;\n\n // loop through the timers to find the one associated with this sound\n for (var i=0; i= 0) {\n Howler._howls.splice(index, 1);\n }\n\n // delete this sound from the cache\n delete cache[self._src];\n self = null;\n }\n\n };\n\n // only define these functions when using WebAudio\n if (usingWebAudio) {\n\n /**\n * Buffer a sound from URL (or from cache) and decode to audio source (Web Audio API).\n * @param {Object} obj The Howl object for the sound to load.\n * @param {String} url The path to the sound file.\n */\n var loadBuffer = function(obj, url) {\n // check if the buffer has already been cached\n if (url in cache) {\n // set the duration from the cache\n obj._duration = cache[url].duration;\n\n // load the sound into this object\n loadSound(obj);\n return;\n }\n \n if (/^data:[^;]+;base64,/.test(url)) {\n // Decode base64 data-URIs because some browsers cannot load data-URIs with XMLHttpRequest.\n var data = atob(url.split(',')[1]);\n var dataView = new Uint8Array(data.length);\n for (var i=0; i= options.xVal.slice(-1)[0] ){\n\t\t\treturn 100;\n\t\t}\n\n\t\tvar j = 1, va, vb, pa, pb;\n\t\twhile ( value >= options.xVal[j] ){\n\t\t\tj++;\n\t\t}\n\n\t\tva = options.xVal[j-1];\n\t\tvb = options.xVal[j];\n\t\tpa = options.xPct[j-1];\n\t\tpb = options.xPct[j];\n\n\t\treturn pa + (toPercentage([va, vb], value) / subRangeRatio (pa, pb));\n\t}\n\n\t// (value)\n\tfunction fromStepping ( options, value ) {\n\n\t\t// There is no range group that fits 100\n\t\tif ( value >= 100 ){\n\t\t\treturn options.xVal.slice(-1)[0];\n\t\t}\n\n\t\tvar j = 1, va, vb, pa, pb;\n\t\twhile ( value >= options.xPct[j] ){\n\t\t\tj++;\n\t\t}\n\n\t\tva = options.xVal[j-1];\n\t\tvb = options.xVal[j];\n\t\tpa = options.xPct[j-1];\n\t\tpb = options.xPct[j];\n\n\t\treturn isPercentage([va, vb], (value - pa) * subRangeRatio (pa, pb));\n\t}\n\n\t// (percentage) Get the step that applies at a certain value.\n\tfunction getStep ( options, value ){\n\n\t\tvar j = 1, a, b;\n\t\twhile ( value >= options.xPct[j] ){\n\t\t\tj++;\n\t\t}\n\n\t\tif ( options.snap ) {\n\n\t\t\ta = options.xPct[j-1];\n\t\t\tb = options.xPct[j];\n\n\t\t\tif ((value - a) > ((b-a)/2)){\n\t\t\t\treturn b;\n\t\t\t}\n\n\t\t\treturn a;\n\t\t}\n\n\t\tif ( !options.xSteps[j-1] ){\n\t\t\treturn value;\n\t\t}\n\n\t\treturn options.xPct[j-1] + closest(\n\t\t\tvalue - options.xPct[j-1],\n\t\t\toptions.xSteps[j-1]\n\t\t);\n\t}\n\n\n// Event handling\n\n\t// Provide a clean event with standardized offset values.\n\tfunction fixEvent ( e ) {\n\n\t\t// Prevent scrolling and panning on touch events, while\n\t\t// attempting to slide. The tap event also depends on this.\n\t\te.preventDefault();\n\n\t\t// Filter the event to register the type, which can be\n\t\t// touch, mouse or pointer. Offset changes need to be\n\t\t// made on an event specific basis.\n\t\tvar touch = e.type.indexOf('touch') === 0\n\t\t\t,mouse = e.type.indexOf('mouse') === 0\n\t\t\t,pointer = e.type.indexOf('pointer') === 0\n\t\t\t,x,y, event = e;\n\n\t\t// IE10 implemented pointer events with a prefix;\n\t\tif ( e.type.indexOf('MSPointer') === 0 ) {\n\t\t\tpointer = true;\n\t\t}\n\n\t\t// Get the originalEvent, if the event has been wrapped\n\t\t// by jQuery. Zepto doesn't wrap the event.\n\t\tif ( e.originalEvent ) {\n\t\t\te = e.originalEvent;\n\t\t}\n\n\t\tif ( touch ) {\n\t\t\t// noUiSlider supports one movement at a time,\n\t\t\t// so we can select the first 'changedTouch'.\n\t\t\tx = e.changedTouches[0].pageX;\n\t\t\ty = e.changedTouches[0].pageY;\n\t\t}\n\n\t\tif ( mouse || pointer ) {\n\n\t\t\t// Polyfill the pageXOffset and pageYOffset\n\t\t\t// variables for IE7 and IE8;\n\t\t\tif( !pointer && window.pageXOffset === undefined ){\n\t\t\t\twindow.pageXOffset = document.documentElement.scrollLeft;\n\t\t\t\twindow.pageYOffset = document.documentElement.scrollTop;\n\t\t\t}\n\n\t\t\tx = e.clientX + window.pageXOffset;\n\t\t\ty = e.clientY + window.pageYOffset;\n\t\t}\n\n\t\tevent.points = [x, y];\n\t\tevent.cursor = mouse;\n\n\t\treturn event;\n\t}\n\n\n// Organize formatting in an object.\n\n\t/** @constructor */\n\tfunction Format( options ){\n\n\t\t// If no settings where provided, the defaults will be loaded.\n\t\tif ( options === undefined ){\n\t\t\toptions = {};\n\t\t}\n\n\t\tif ( typeof options !== 'object' ){\n\t\t\tthrowError(\"(Format) 'format' option must be an object.\");\n\t\t}\n\n\t\tvar settings = {};\n\n\t\t// Copy all values into a new object.\n\t\t$(Formatting).each(function(i, val){\n\n\t\t\tif ( options[val] === undefined ){\n\n\t\t\t\tsettings[val] = FormatDefaults[i];\n\n\t\t\t// When we aren't loading defaults, validate the entry.\n\t\t\t} else if ( typeMatch(options[val], FormatDefaults[i]) ) {\n\n\t\t\t\t// Support for up to 7 decimals.\n\t\t\t\t// More can't be guaranteed due to floating point issues.\n\t\t\t\tif ( val === 'decimals' ){\n\t\t\t\t\tif ( options[val] < 0 || options[val] > 7 ){\n\t\t\t\t\t\tthrowError(\"(Format) 'format.decimals' option must be between 0 and 7.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tsettings[val] = options[val];\n\n\t\t\t// If the value isn't valid, emit an error.\n\t\t\t} else {\n\t\t\t\tthrowError(\"(Format) 'format.\"+val+\"' must be a \" + typeof FormatDefaults[i] + \".\");\n\t\t\t}\n\t\t});\n\n\t\t// Some values can't be extracted from a\n\t\t// string if certain combinations are present.\n\t\tthrowEqualError(settings, 'mark', 'thousand');\n\t\tthrowEqualError(settings, 'prefix', 'negative');\n\t\tthrowEqualError(settings, 'prefix', 'negativeBefore');\n\n\t\tthis.settings = settings;\n\t}\n\n\t// Shorthand for internal value get\n\tFormat.prototype.v = function ( a ) {\n\t\treturn this.settings[a];\n\t};\n\n\tFormat.prototype.to = function ( number ) {\n\n\t\tfunction reverse ( a ) {\n\t\t\treturn a.split('').reverse().join('');\n\t\t}\n\n\t\tnumber = this.v('encoder')( number );\n\n\t\tvar negative = '', preNegative = '', base = '', mark = '';\n\n\t\tif ( number < 0 ) {\n\t\t\tnegative = this.v('negative');\n\t\t\tpreNegative = this.v('negativeBefore');\n\t\t}\n\n\t\t// Round to proper decimal count\n\t\tnumber = Math.abs(number).toFixed( this.v('decimals') ).toString();\n\t\tnumber = number.split('.');\n\n\t\t// Rounding away decimals might cause a value of -0\n\t\t// when using very small ranges. Remove those cases.\n\t\tif ( parseFloat(number) === 0 ) {\n\t\t\tnumber[0] = '0';\n\t\t}\n\n\t\t// Group numbers in sets of three.\n\t\tif ( this.v('thousand') ) {\n\t\t\tbase = reverse(number[0]).match(/.{1,3}/g);\n\t\t\tbase = reverse(base.join(reverse( this.v('thousand') )));\n\t\t} else {\n\t\t\tbase = number[0];\n\t\t}\n\n\t\t// Ignore the decimal separator if decimals are set to 0.\n\t\tif ( this.v('mark') && number.length > 1 ) {\n\t\t\tmark = this.v('mark') + number[1];\n\t\t}\n\n\t\t// Return the finalized formatted number.\n\t\treturn preNegative +\n\t\t\tthis.v('prefix') +\n\t\t\tnegative +\n\t\t\tbase +\n\t\t\tmark +\n\t\t\tthis.v('postfix');\n\t};\n\n\tFormat.prototype.from = function ( input ) {\n\n\t\tfunction esc(s){\n\t\t\treturn s.replace(/[\\-\\/\\\\\\^$*+?.()|\\[\\]{}]/g, '\\\\$&');\n\t\t}\n\n\t\tvar isNeg;\n\t\t// The set request might want to ignore this handle.\n\t\t// Test for 'undefined' too, as a two-handle slider\n\t\t// can still be set with an integer.\n\t\tif( input === null || input === undefined ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Remove formatting and set period for float parsing.\n\t\tinput = input.toString();\n\n\t\t// Replace the preNegative indicator.\n\t\tisNeg = input.replace(new RegExp('^' + esc( this.v('negativeBefore') )), '');\n\n\t\t// Check if the value changed by removing the negativeBefore symbol.\n\t\tif( input !== isNeg ) {\n\t\t\tinput = isNeg;\n\t\t\tisNeg = '-';\n\t\t} else {\n\t\t\tisNeg = '';\n\t\t}\n\n\t\t// If prefix is set and the number is actually prefixed.\n\t\tinput = input.replace(new RegExp('^'+esc( this.v('prefix') )), '');\n\n\t\t// Only replace if a negative sign is set.\n\t\tif ( this.v['negative'] ) {\n\n\t\t\t// Reset isNeg to prevent double '-' insertion.\n\t\t\tisNeg = '';\n\n\t\t\t// Reset the negative sign to '-'\n\t\t\tinput = input.replace(new RegExp('^'+esc( this.v('negative') )), '-');\n\t\t}\n\n\t\t// Clean the input string\n\t\tinput = input\n\t\t// If postfix is set and the number is postfixed.\n\t\t\t.replace( new RegExp(esc( this.v('postfix') ) + '$'), '')\n\t\t// Remove the separator every three digits.\n\t\t\t.replace( new RegExp(esc( this.v('thousand') ), 'g'), '')\n\t\t// Set the decimal separator back to period.\n\t\t\t.replace( this.v('mark'), '.');\n\n\t\t// Run the user defined decoder. Returns input by default.\n\t\tinput = this.v('decoder')( parseFloat( isNeg + input ) );\n\n\t\t// Ignore invalid input\n\t\tif (isNaN( input )) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn input;\n\t};\n\n\n// Serialization target\n\n/** @constructor */\n\tfunction Link( entry, update ){\n\n\t\t// Make sure Link isn't called as a function, in which case\n\t\t// the 'this' scope would be the window.\n\t\tif ( !(this instanceof Link) ) {\n\t\t\tthrow new Error( \"Link: \" +\n\t\t\t\t\"Don't use Link as a function. \" +\n\t\t\t\t\"Use the 'new' keyword.\");\n\t\t}\n\n\t\tif ( !entry ) {\n\t\t\tthrow new RangeError(\"Link: missing parameters.\");\n\t\t}\n\n\t\t// Write all formatting to this object.\n\t\t// No validation needed, as we'll merge these with the parent\n\t\t// format options first.\n\t\tthis.formatting = entry['format'] || {};\n\n\t\t// Store the update option.\n\t\tthis.update = !update;\n\n\t\t// In IE < 9, .bind() isn't available, need this link in .change().\n\tvar that = this,\n\n\t\t// Get values from the input.\n\t\ttarget = entry['target'] || function(){},\n\t\tmethod = entry['method'],\n\n\t\t// Find the type of this link.\n\t\tisTooltip = ( typeof target === 'string' && target.indexOf('-tooltip-') === 0 ),\n\t\tisHidden = ( typeof target === 'string' && target.indexOf('-') !== 0 ),\n\t\tisMethod = ( typeof target === 'function' ),\n\t\tis$ = ( isInstance(target) ),\n\t\tisInput = ( is$ && target.is('input, select, textarea') ),\n\t\tmethodIsFunction = ( is$ && typeof method === 'function' ),\n\t\tmethodIsName = ( is$ && typeof method === 'string' && target[method] );\n\n\t\t// If target is a string, a new hidden input will be created.\n\t\tif ( isTooltip ) {\n\n\t\t\t// By default, use the 'html' method.\n\t\t\tthis.method = method || 'html';\n\n\t\t\t// Use jQuery to create the element\n\t\t\tthis.el = $( target.replace('-tooltip-', '') || '
' )[0];\n\n\t\t\treturn;\n\t\t}\n\n\t\t// If the string doesn't begin with '-', which is reserved, add a new hidden input.\n\t\tif ( isHidden ) {\n\n\t\t\tthis.method = 'val';\n\n\t\t\tthis.el = document.createElement('input');\n\t\t\tthis.el.name = target;\n\t\t\tthis.el.type = 'hidden';\n\n\t\t\treturn;\n\t\t}\n\n\t\t// The target can also be a function, which will be called.\n\t\tif ( isMethod ) {\n\t\t\tthis.target = false;\n\t\t\tthis.method = target;\n\t\t\treturn;\n\t\t}\n\n\t\t// If the target is and $ element.\n\t\tif ( is$ ) {\n\n\t\t\t// The method must exist on the element.\n\t\t\tif ( method && ( methodIsFunction || methodIsName ) ) {\n\t\t\t\tthis.target = target;\n\t\t\t\tthis.method = method;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a jQuery/Zepto input element is provided, but no method is set,\n\t\t\t// the element can assume it needs to respond to 'change'...\n\t\t\tif ( !method && isInput ) {\n\n\t\t\t\t// Default to .val if this is an input element.\n\t\t\t\tthis.method = 'val';\n\t\t\t\tthis.target = target;\n\n\t\t\t\t// Set the slider to a new value on change.\n\t\t\t\tthis.target.on('change', function( e ){\n\n\t\t\t\t\t// Returns null array.\n\t\t\t\t\tfunction at(a,b,c){\n\t\t\t\t\t\treturn [c?a:b, c?b:a];\n\t\t\t\t\t}\n\n\t\t\t\t\tvar output = at(null, $(e.target).val(), that.N);\n\n\t\t\t\t\tthat.obj.val(output, { 'link': that });\n\t\t\t\t});\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// ... or not.\n\t\t\tif ( !method && !isInput ) {\n\n\t\t\t\t// Default arbitrarily to 'html'.\n\t\t\t\tthis.method = 'html';\n\t\t\t\tthis.target = target;\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tthrow new RangeError(\"Link: Invalid Link.\");\n\t}\n\n\t// Provides external items with the slider value.\n\tLink.prototype.write = function ( options, value, handle, slider, update ) {\n\n\t\t// Don't synchronize this Link.\n\t\tif ( this.update && update === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Convert the value to the slider stepping/range.\n\t\tvalue = fromStepping( options, value );\n\n\t\t// Format values for display.\n\t\tvalue = this.format( value );\n\n\t\t// Store the numerical value.\n\t\tthis.saved = value;\n\n\t\t// Branch between serialization to a function or an object.\n\t\tif ( typeof this.method === 'function' ) {\n\t\t\t// When target is undefined, the target was a function.\n\t\t\t// In that case, provided the slider as the calling scope.\n\t\t\t// Use [0] to get the DOM element, not the $ instance.\n\t\t\tthis.method.call( this.target[0] || slider[0], value, handle, slider );\n\t\t} else {\n\t\t\tthis.target[ this.method ]( value, handle, slider );\n\t\t}\n\t};\n\n\t// Parses slider value to user defined display.\n\tLink.prototype.format = function ( a ) {\n\t\treturn this.formatting.to(a);\n\t};\n\n\t// Converts a formatted value back to a real number.\n\tLink.prototype.valueOf = function ( a ) {\n\t\treturn this.formatting.from(a);\n\t};\n\n\n// Input validation\n\n\tfunction testStep ( parsed, entry ) {\n\n\t\tif ( !isNumeric( entry ) ) {\n\t\t\tthrowError(\"'step' is not numeric.\");\n\t\t}\n\n\t\t// The step option can still be used to set stepping\n\t\t// for linear sliders. Overwritten if set in 'range'.\n\t\tparsed.xSteps[0] = entry;\n\t}\n\n\tfunction testRange ( parsed, entry ) {\n\n\t\t// Filter incorrect input.\n\t\tif ( typeof entry !== 'object' || $.isArray(entry) ) {\n\t\t\tthrowError(\"'range' is not an object.\");\n\t\t}\n\n\t\t// Loop all entries.\n\t\t$.each( entry, function ( index, value ) {\n\n\t\t\tvar percentage;\n\n\t\t\t// Wrap numerical input in an array.\n\t\t\tif ( typeof value === \"number\" ) {\n\t\t\t\tvalue = [value];\n\t\t\t}\n\n\t\t\t// Reject any invalid input.\n\t\t\tif ( !$.isArray( value ) ){\n\t\t\t\tthrowError(\"'range' contains invalid value.\");\n\t\t\t}\n\n\t\t\t// Covert min/max syntax to 0 and 100.\n\t\t\tif ( index === 'min' ) {\n\t\t\t\tpercentage = 0;\n\t\t\t} else if ( index === 'max' ) {\n\t\t\t\tpercentage = 100;\n\t\t\t} else {\n\t\t\t\tpercentage = parseFloat( index );\n\t\t\t}\n\n\t\t\t// Check for correct input.\n\t\t\tif ( !isNumeric( percentage ) || !isNumeric( value[0] ) ) {\n\t\t\t\tthrowError(\"'range' value isn't numeric.\");\n\t\t\t}\n\n\t\t\t// Store values.\n\t\t\tparsed.xPct.push( percentage );\n\t\t\tparsed.xVal.push( value[0] );\n\n\t\t\t// NaN will evaluate to false too, but to keep\n\t\t\t// logging clear, set step explicitly. Make sure\n\t\t\t// not to override the 'step' setting with false.\n\t\t\tif ( !percentage ) {\n\t\t\t\tif ( !isNaN( value[1] ) ) {\n\t\t\t\t\tparsed.xSteps[0] = value[1];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tparsed.xSteps.push( isNaN(value[1]) ? false : value[1] );\n\t\t\t}\n\t\t});\n\n\t\t$.each(parsed.xSteps, function(i,n){\n\n\t\t\t// Ignore 'false' stepping.\n\t\t\tif ( !n ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Check if step fits. Not required, but this might serve some goal.\n\t\t\t// !((parsed.xVal[i+1] - parsed.xVal[i]) % n);\n\n\t\t\t// Factor to range ratio\n\t\t\tparsed.xSteps[i] = fromPercentage([\n\t\t\t\t parsed.xVal[i]\n\t\t\t\t,parsed.xVal[i+1]\n\t\t\t], n) / subRangeRatio (\n\t\t\t\tparsed.xPct[i],\n\t\t\t\tparsed.xPct[i+1] );\n\t\t});\n\t}\n\n\tfunction testStart ( parsed, entry ) {\n\n\t\tif ( typeof entry === \"number\" ) {\n\t\t\tentry = [entry];\n\t\t}\n\n\t\t// Validate input. Values aren't tested, the internal Link will do\n\t\t// that and provide a valid location.\n\t\tif ( !$.isArray( entry ) || !entry.length || entry.length > 2 ) {\n\t\t\tthrowError(\"'start' option is incorrect.\");\n\t\t}\n\n\t\t// Store the number of handles.\n\t\tparsed.handles = entry.length;\n\n\t\t// When the slider is initialized, the .val method will\n\t\t// be called with the start options.\n\t\tparsed.start = entry;\n\t}\n\n\tfunction testSnap ( parsed, entry ) {\n\n\t\t// Enforce 100% stepping within subranges.\n\t\tparsed.snap = entry;\n\n\t\tif ( typeof entry !== 'boolean' ){\n\t\t\tthrowError(\"'snap' option must be a boolean.\");\n\t\t}\n\t}\n\n\tfunction testConnect ( parsed, entry ) {\n\n\t\tif ( entry === 'lower' && parsed.handles === 1 ) {\n\t\t\tparsed.connect = 1;\n\t\t} else if ( entry === 'upper' && parsed.handles === 1 ) {\n\t\t\tparsed.connect = 2;\n\t\t} else if ( entry === true && parsed.handles === 2 ) {\n\t\t\tparsed.connect = 3;\n\t\t} else if ( entry === false ) {\n\t\t\tparsed.connect = 0;\n\t\t} else {\n\t\t\tthrowError(\"'connect' option was doesn't match handle count.\");\n\t\t}\n\t}\n\n\tfunction testOrientation ( parsed, entry ) {\n\n\t\t// Set orientation to an a numerical value for easy\n\t\t// array selection.\n\t\tswitch ( entry ){\n\t\t case 'horizontal':\n\t\t\tparsed.ort = 0;\n\t\t\tbreak;\n\t\t case 'vertical':\n\t\t\tparsed.ort = 1;\n\t\t\tbreak;\n\t\t default:\n\t\t\tthrowError(\"'orientation' option is invalid.\");\n\t\t}\n\t}\n\n\tfunction testMargin ( parsed, entry ) {\n\n\t\tif ( parsed.xPct.length > 2 ) {\n\t\t\tthrowError(\"'margin' option is only supported on linear sliders.\");\n\t\t}\n\n\t\t// Parse value to range and store. As xVal is checked\n\t\t// to be no bigger than 2, use it as range.\n\t\tparsed.margin = fromPercentage(parsed.xVal, entry);\n\n\t\tif ( !isNumeric(entry) ){\n\t\t\tthrowError(\"'margin' option must be numeric.\");\n\t\t}\n\t}\n\n\tfunction testDirection ( parsed, entry ) {\n\n\t\t// Set direction as a numerical value for easy parsing.\n\t\t// Invert connection for RTL sliders, so that the proper\n\t\t// handles get the connect/background classes.\n\t\tswitch ( entry ) {\n\t\t case 'ltr':\n\t\t\tparsed.dir = 0;\n\t\t\tbreak;\n\t\t case 'rtl':\n\t\t\tparsed.dir = 1;\n\t\t\tparsed.connect = [0,2,1,3][parsed.connect];\n\t\t\tbreak;\n\t\t default:\n\t\t\tthrowError(\"'direction' option was not recognized.\");\n\t\t}\n\t}\n\n\tfunction testBehaviour ( parsed, entry ) {\n\n\t\t// Make sure the input is a string.\n\t\tif ( typeof entry !== 'string' ) {\n\t\t\tthrowError(\"'behaviour' must be a string containing options.\");\n\t\t}\n\n\t\t// Check if the string contains any keywords.\n\t\t// None are required.\n\t\tvar tap = entry.indexOf('tap') >= 0,\n\t\t\textend = entry.indexOf('extend') >= 0,\n\t\t\tdrag = entry.indexOf('drag') >= 0,\n\t\t\tfixed = entry.indexOf('fixed') >= 0,\n\t\t\tsnap = entry.indexOf('snap') >= 0;\n\n\t\tparsed.events = {\n\t\t\ttap: tap || snap,\n\t\t\textend: extend,\n\t\t\tdrag: drag,\n\t\t\tfixed: fixed,\n\t\t\tsnap: snap\n\t\t};\n\t}\n\n\tfunction testSerialization ( parsed, entry, sliders ) {\n\n\t\tparsed.ser = [ entry['lower'], entry['upper'] ];\n\t\tparsed.formatting = new Format( entry['format'] );\n\n\t\t$.each( parsed.ser, function( i, a ){\n\n\t\t\t// Check if the provided option is an array.\n\t\t\tif ( !$.isArray(a) ) {\n\t\t\t\tthrowError(\"'serialization.\"+(!i?'lower':'upper')+\"' must be an array.\");\n\t\t\t}\n\n\t\t\t$.each(a, function(){\n\n\t\t\t\t// Check if entry is a Link.\n\t\t\t\tif ( !(this instanceof Link) ) {\n\t\t\t\t\tthrowError(\"'serialization.\"+(!i?'lower':'upper')+\"' can only contain Link instances.\");\n\t\t\t\t}\n\n\t\t\t\t// Assign other properties.\n\t\t\t\tthis.N = i;\n\t\t\t\tthis.obj = sliders;\n\t\t\t\tthis.scope = this.scope || sliders;\n\n\t\t\t\t// Run internal validator.\n\t\t\t\tthis.formatting = new Format($.extend({}\n\t\t\t\t\t,entry['format']\n\t\t\t\t\t,this.formatting\n\t\t\t\t));\n\t\t\t});\n\t\t});\n\n\t\t// If the slider has two handles and is RTL,\n\t\t// reverse the serialization input. For one handle,\n\t\t// lower is still lower.\n\t\tif ( parsed.dir && parsed.handles > 1 ) {\n\t\t\tparsed.ser.reverse();\n\t\t}\n\t}\n\n\t// Test all developer settings and parse to assumption-safe values.\n\tfunction test ( options, sliders ){\n\n\t/*\tEvery input option is tested and parsed. This'll prevent\n\t\tendless validation in internal methods. These tests are\n\t\tstructured with an item for every option available. An\n\t\toption can be marked as required by setting the 'r' flag.\n\t\tThe testing function is provided with three arguments:\n\t\t\t- The provided value for the option;\n\t\t\t- A reference to the options object;\n\t\t\t- The name for the option;\n\n\t\tThe testing function returns false when an error is detected,\n\t\tor true when everything is OK. It can also modify the option\n\t\tobject, to make sure all values can be correctly looped elsewhere. */\n\n\t\tvar parsed = {\n\t\t\t xPct: []\n\t\t\t,xVal: []\n\t\t\t,xSteps: [ false ]\n\t\t\t,margin: 0\n\t\t}, tests;\n\n\t\ttests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'serialization': { r: true, t: testSerialization }\n\t\t};\n\n\t\t// Set defaults where applicable.\n\t\toptions = $.extend({\n\t\t\t 'connect': false\n\t\t\t,'direction': 'ltr'\n\t\t\t,'behaviour': 'tap'\n\t\t\t,'orientation': 'horizontal'\n\t\t}, options);\n\n\t\t// Make sure the test for serialization runs.\n\t\toptions['serialization'] = $.extend({\n\t\t\t 'lower': []\n\t\t\t,'upper': []\n\t\t\t,'format': {}\n\t\t}, options['serialization']);\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\t$.each( tests, function( name, test ){\n\n\t\t\tif ( options[name] === undefined ) {\n\t\t\t\tif ( test.r ) {\n\t\t\t\t\tthrowError(\"'\" + name + \"' is required.\");\n\t\t\t\t} else {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttest.t( parsed, options[name], sliders );\n\t\t});\n\n\t\t// Pre-define the styles.\n\t\tparsed.style = parsed.ort ? 'top' : 'left';\n\n\t\treturn parsed;\n\t}\n\n\n// DOM additions\n\n\t// Append a handle to the base.\n\tfunction addHandle ( options, index ) {\n\n\t\tvar handle = $('
').addClass( Classes[2] ),\n\t\t\tadditions = [ '-lower', '-upper' ];\n\n\t\tif ( options.dir ) {\n\t\t\tadditions.reverse();\n\t\t}\n\n\t\thandle.children().addClass(\n\t\t\tClasses[3] + \" \" + Classes[3]+additions[index]\n\t\t);\n\n\t\treturn handle;\n\t}\n\n\t// Create a copy of an element-creating Link.\n\tfunction addElement ( handle, link ) {\n\n\t\t// If the Link requires creation of a new element,\n\t\t// create this element and return a new Link instance.\n\t\tif ( link.el ) {\n\t\t\tlink = new Link({\n\t\t\t\t'target': $(link.el).clone().appendTo( handle ),\n\t\t\t\t'method': link.method,\n\t\t\t\t'format': link.formatting\n\t\t\t}, true);\n\t\t}\n\n\t\t// Otherwise, return the reference.\n\t\treturn link;\n\t}\n\n\t// Loop all links for a handle.\n\tfunction addElements ( elements, handle, formatting ) {\n\n\t\tvar index, list = [];\n\n\t\t// Use the Link interface to provide unified\n\t\t// formatting for the .val() method.\n\t\tlist.push(\n\t\t\tnew Link({\n\t\t\t\t'format': formatting\n\t\t\t}, true)\n\t\t);\n\n\t\t// Loop all links in either 'lower' or 'upper'.\n\t\tfor ( index = 0; index < elements.length; index++ ) {\n\t\t\tlist.push(addElement(handle, elements[index]));\n\t\t}\n\n\t\treturn list;\n\t}\n\n\t// Go over all Links and assign them to a handle.\n\tfunction addLinks ( options, handles ) {\n\n\t\tvar index, links = [];\n\n\t\t// Copy the links into a new array, instead of modifying\n\t\t// the 'options.ser' list. This allows replacement of the invalid\n\t\t// '.el' Links, while the others are still passed by reference.\n\t\tfor ( index = 0; index < options.handles; index++ ) {\n\n\t\t\t// Append a new array.\n\t\t\tlinks[index] = addElements(\n\t\t\t\toptions.ser[index],\n\t\t\t\thandles[index].children(),\n\t\t\t\toptions.formatting\n\t\t\t);\n\t\t}\n\n\t\treturn links;\n\t}\n\n\t// Add the proper connection classes.\n\tfunction addConnection ( connect, target, handles ) {\n\n\t\t// Apply the required connection classes to the elements\n\t\t// that need them. Some classes are made up for several\n\t\t// segments listed in the class list, to allow easy\n\t\t// renaming and provide a minor compression benefit.\n\t\tswitch ( connect ) {\n\t\t\tcase 1:\ttarget.addClass( Classes[7] );\n\t\t\t\t\thandles[0].addClass( Classes[6] );\n\t\t\t\t\tbreak;\n\t\t\tcase 3: handles[1].addClass( Classes[6] );\n\t\t\t\t\t/* falls through */\n\t\t\tcase 2: handles[0].addClass( Classes[7] );\n\t\t\t\t\t/* falls through */\n\t\t\tcase 0: target.addClass(Classes[6]);\n\t\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Add handles and loop Link elements.\n\tfunction addHandles ( options, base ) {\n\n\t\tvar index, handles = [];\n\n\t\t// Append handles.\n\t\tfor ( index = 0; index < options.handles; index++ ) {\n\n\t\t\t// Keep a list of all added handles.\n\t\t\thandles.push( addHandle( options, index ).appendTo(base) );\n\t\t}\n\n\t\treturn handles;\n\t}\n\n\t// Initialize a single slider.\n\tfunction addSlider ( options, target ) {\n\n\t\t// Apply classes and data to the target.\n\t\ttarget.addClass([\n\t\t\tClasses[0],\n\t\t\tClasses[8 + options.dir],\n\t\t\tClasses[4 + options.ort]\n\t\t].join(' '));\n\n\t\treturn $('
').appendTo(target).addClass( Classes[1] );\n\t}\n\n\n// Slider scope\n\nfunction closure ( target, options, originalOptions ){\n\n// Internal variables\n\n\t// All variables local to 'closure' are marked $.\n\tvar $Target = $(target),\n\t\t$Locations = [-1, -1],\n\t\t$Base,\n\t\t$Serialization,\n\t\t$Handles;\n\n\t// Shorthand for base dimensions.\n\tfunction baseSize ( ) {\n\t\treturn $Base[['width', 'height'][options.ort]]();\n\t}\n\n\n// External event handling\n\n\tfunction fireEvents ( events ) {\n\n\t\t// Use the external api to get the values.\n\t\t// Wrap the values in an array, as .trigger takes\n\t\t// only one additional argument.\n\t\tvar index, values = [ $Target.val() ];\n\n\t\tfor ( index = 0; index < events.length; index++ ){\n\t\t\t$Target.trigger(events[index], values);\n\t\t}\n\t}\n\n\n// Handle placement\n\n\t// Test suggested values and apply margin, step.\n\tfunction setHandle ( handle, to, delimit ) {\n\n\t\tvar n = handle[0] !== $Handles[0][0] ? 1 : 0,\n\t\t\tlower = $Locations[0] + options.margin,\n\t\t\tupper = $Locations[1] - options.margin;\n\n\t\t// Don't delimit range dragging.\n\t\tif ( delimit && $Handles.length > 1 ) {\n\t\t\tto = n ? Math.max( to, lower ) : Math.min( to, upper );\n\t\t}\n\n\t\t// Handle the step option.\n\t\tif ( to < 100 ){\n\t\t\tto = getStep(options, to);\n\t\t}\n\n\t\t// Limit to 0/100 for .val input, trim anything beyond 7 digits, as\n\t\t// JavaScript has some issues in its floating point implementation.\n\t\tto = limit(parseFloat(to.toFixed(7)));\n\n\t\t// Return falsy if handle can't move. False for 0 or 100 limit,\n\t\t// '0' for limiting by another handle.\n\t\tif ( to === $Locations[n] ) {\n\t\t\tif ( $Handles.length === 1 ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn ( to === lower || to === upper ) ? 0 : false;\n\t\t}\n\n\t\t// Set the handle to the new position.\n\t\thandle.css( options.style, to + '%' );\n\n\t\t// Force proper handle stacking\n\t\tif ( handle.is(':first-child') ) {\n\t\t\thandle.toggleClass(Classes[17], to > 50 );\n\t\t}\n\n\t\t// Update locations.\n\t\t$Locations[n] = to;\n\n\t\t// Invert the value if this is a right-to-left slider.\n\t\tif ( options.dir ) {\n\t\t\tto = 100 - to;\n\t\t}\n\n\t\t// Write values to serialization Links.\n\t\t// Convert the value to the correct relative representation.\n\t\t$($Serialization[n]).each(function(){\n\t\t\tthis.write( options, to, handle.children(), $Target );\n\t\t});\n\n\t\treturn true;\n\t}\n\n\t// Delimit proposed values for handle positions.\n\tfunction getPositions ( a, b, delimit ) {\n\n\t\t// Add movement to current position.\n\t\tvar c = a + b[0], d = a + b[1];\n\n\t\t// Only alter the other position on drag,\n\t\t// not on standard sliding.\n\t\tif ( delimit ) {\n\t\t\tif ( c < 0 ) {\n\t\t\t\td += Math.abs(c);\n\t\t\t}\n\t\t\tif ( d > 100 ) {\n\t\t\t\tc -= ( d - 100 );\n\t\t\t}\n\n\t\t\t// Limit values to 0 and 100.\n\t\t\treturn [limit(c), limit(d)];\n\t\t}\n\n\t\treturn [c,d];\n\t}\n\n\t// Handles movement by tapping.\n\tfunction jump ( handle, to, instant ) {\n\n\t\tif ( !instant ) {\n\t\t\t// Flag the slider as it is now in a transitional state.\n\t\t\t// Transition takes 300 ms, so re-enable the slider afterwards.\n\t\t\taddClassFor( $Target, Classes[14], 300 );\n\t\t}\n\n\t\t// Move the handle to the new position.\n\t\tsetHandle( handle, to, false );\n\n\t\tfireEvents(['slide', 'set', 'change']);\n\t}\n\n\n// Events\n\n\t// Handler for attaching events trough a proxy.\n\tfunction attach ( events, element, callback, data ) {\n\n\t\t// Add the noUiSlider namespace to all events.\n\t\tevents = events.replace( /\\s/g, namespace + ' ' ) + namespace;\n\n\t\t// Bind a closure on the target.\n\t\treturn element.on( events, function( e ){\n\n\t\t\t// jQuery and Zepto handle unset attributes differently.\n\t\t\tvar disabled = $Target.attr('disabled');\n\t\t\t\tdisabled = !( disabled === undefined || disabled === null );\n\n\t\t\t// Test if there is anything that should prevent an event\n\t\t\t// from being handled, such as a disabled state or an active\n\t\t\t// 'tap' transition.\n\t\t\tif( $Target.hasClass( Classes[14] ) || disabled ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\te = fixEvent(e);\n\t\t\te.calcPoint = e.points[ options.ort ];\n\n\t\t\t// Call the event handler with the event [ and additional data ].\n\t\t\tcallback ( e, data );\n\t\t});\n\t}\n\n\t// Handle movement on document for handle and range drag.\n\tfunction move ( event, data ) {\n\n\t\tvar handles = data.handles || $Handles, positions, state = false,\n\t\t\tproposal = ((event.calcPoint - data.start) * 100) / baseSize(),\n\t\t\th = handles[0][0] !== $Handles[0][0] ? 1 : 0;\n\n\t\t// Calculate relative positions for the handles.\n\t\tpositions = getPositions( proposal, data.positions, handles.length > 1);\n\n\t\tstate = setHandle ( handles[0], positions[h], handles.length === 1 );\n\n\t\tif ( handles.length > 1 ) {\n\t\t\tstate = setHandle ( handles[1], positions[h?0:1], false ) || state;\n\t\t}\n\n\t\t// Fire the 'slide' event if any handle moved.\n\t\tif ( state ) {\n\t\t\tfireEvents(['slide']);\n\t\t}\n\t}\n\n\t// Unbind move events on document, call callbacks.\n\tfunction end ( event ) {\n\n\t\t// The handle is no longer active, so remove the class.\n\t\t$('.' + Classes[15]).removeClass(Classes[15]);\n\n\t\t// Remove cursor styles and text-selection events bound to the body.\n\t\tif ( event.cursor ) {\n\t\t\t$('body').css('cursor', '').off( namespace );\n\t\t}\n\n\t\t// Unbind the move and end events, which are added on 'start'.\n\t\tdoc.off( namespace );\n\n\t\t// Remove dragging class.\n\t\t$Target.removeClass(Classes[12]);\n\n\t\t// Fire the change and set events.\n\t\tfireEvents(['set', 'change']);\n\t}\n\n\t// Bind move events on document.\n\tfunction start ( event, data ) {\n\n\t\t// Mark the handle as 'active' so it can be styled.\n\t\tif( data.handles.length === 1 ) {\n\t\t\tdata.handles[0].children().addClass(Classes[15]);\n\t\t}\n\n\t\t// A drag should never propagate up to the 'tap' event.\n\t\tevent.stopPropagation();\n\n\t\t// Attach the move event.\n\t\tattach ( actions.move, doc, move, {\n\t\t\tstart: event.calcPoint,\n\t\t\thandles: data.handles,\n\t\t\tpositions: [\n\t\t\t\t$Locations[0],\n\t\t\t\t$Locations[$Handles.length - 1]\n\t\t\t]\n\t\t});\n\n\t\t// Unbind all movement when the drag ends.\n\t\tattach ( actions.end, doc, end, null );\n\n\t\t// Text selection isn't an issue on touch devices,\n\t\t// so adding cursor styles can be skipped.\n\t\tif ( event.cursor ) {\n\n\t\t\t// Prevent the 'I' cursor and extend the range-drag cursor.\n\t\t\t$('body').css('cursor', $(event.target).css('cursor'));\n\n\t\t\t// Mark the target with a dragging state.\n\t\t\tif ( $Handles.length > 1 ) {\n\t\t\t\t$Target.addClass(Classes[12]);\n\t\t\t}\n\n\t\t\t// Prevent text selection when dragging the handles.\n\t\t\t$('body').on('selectstart' + namespace, false);\n\t\t}\n\t}\n\n\t// Move closest handle to tapped location.\n\tfunction tap ( event ) {\n\n\t\tvar location = event.calcPoint, total = 0, to;\n\n\t\t// The tap event shouldn't propagate up and cause 'edge' to run.\n\t\tevent.stopPropagation();\n\n\t\t// Add up the handle offsets.\n\t\t$.each( $Handles, function(){\n\t\t\ttotal += this.offset()[ options.style ];\n\t\t});\n\n\t\t// Find the handle closest to the tapped position.\n\t\ttotal = ( location < total/2 || $Handles.length === 1 ) ? 0 : 1;\n\n\t\tlocation -= $Base.offset()[ options.style ];\n\n\t\t// Calculate the new position.\n\t\tto = ( location * 100 ) / baseSize();\n\n\t\t// Find the closest handle and calculate the tapped point.\n\t\t// The set handle to the new position.\n\t\tjump( $Handles[total], to, options.events.snap );\n\n\t\tif ( options.events.snap ) {\n\t\t\tstart(event, { handles: [$Handles[total]] });\n\t\t}\n\t}\n\n\t// Move handle to edges when target gets tapped.\n\tfunction edge ( event ) {\n\n\t\tvar i = event.calcPoint < $Base.offset()[ options.style ],\n\t\t\tto = i ? 0 : 100;\n\n\t\ti = i ? 0 : $Handles.length - 1;\n\n\t\tjump( $Handles[i], to, false );\n\t}\n\n\t// Attach events to several slider parts.\n\tfunction events ( behaviour ) {\n\n\t\tvar i, drag;\n\n\t\t// Attach the standard drag event to the handles.\n\t\tif ( !behaviour.fixed ) {\n\n\t\t\tfor ( i = 0; i < $Handles.length; i++ ) {\n\n\t\t\t\t// These events are only bound to the visual handle\n\t\t\t\t// element, not the 'real' origin element.\n\t\t\t\tattach ( actions.start, $Handles[i].children(), start, {\n\t\t\t\t\thandles: [ $Handles[i] ]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Attach the tap event to the slider base.\n\t\tif ( behaviour.tap ) {\n\t\t\tattach ( actions.start, $Base, tap, {\n\t\t\t\thandles: $Handles\n\t\t\t});\n\t\t}\n\n\t\t// Extend tapping behaviour to target\n\t\tif ( behaviour.extend ) {\n\n\t\t\t$Target.addClass( Classes[16] );\n\n\t\t\tif ( behaviour.tap ) {\n\t\t\t\tattach ( actions.start, $Target, edge, {\n\t\t\t\t\thandles: $Handles\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Make the range dragable.\n\t\tif ( behaviour.drag ){\n\n\t\t\tdrag = $Base.find( '.' + Classes[7] ).addClass( Classes[10] );\n\n\t\t\t// When the range is fixed, the entire range can\n\t\t\t// be dragged by the handles. The handle in the first\n\t\t\t// origin will propagate the start event upward,\n\t\t\t// but it needs to be bound manually on the other.\n\t\t\tif ( behaviour.fixed ) {\n\t\t\t\tdrag = drag.add($Base.children().not( drag ).children());\n\t\t\t}\n\n\t\t\tattach ( actions.start, drag, start, {\n\t\t\t\thandles: $Handles\n\t\t\t});\n\t\t}\n\t}\n\n\n// Initialize slider\n\n\t// Throw an error if the slider was already initialized.\n\tif ( !$Target.is(':empty') ) {\n\t\tthrow new Error('Slider was already initialized.');\n\t}\n\n\t// Create the base element, initialise HTML and set classes.\n\t// Add handles and links.\n\t$Base = addSlider( options, $Target );\n\t$Handles = addHandles( options, $Base );\n\t$Serialization = addLinks( options, $Handles );\n\n\t// Set the connect classes.\n\taddConnection ( options.connect, $Target, $Handles );\n\n\t// Attach user events.\n\tevents( options.events );\n\n\n// Methods\n\n\t// Set the slider value.\n\ttarget.vSet = function ( values, callback, link, update, animate ){\n\n\t\tvar i, to;\n\n\t\t// The RTL settings is implemented by reversing the front-end,\n\t\t// internal mechanisms are the same.\n\t\tif ( options.dir && options.handles > 1 ) {\n\t\t\tvalues.reverse();\n\t\t}\n\n\t\t// Animation is optional.\n\t\tif ( animate ) {\n\t\t\taddClassFor( $Target, Classes[14], 300 );\n\t\t}\n\n\t\t// If there are multiple handles to be set run the setting\n\t\t// mechanism twice for the first handle, to make sure it\n\t\t// can be bounced of the second one properly.\n\t\tfor ( i = 0; i < ( $Handles.length > 1 ? 3 : 1 ); i++ ) {\n\n\t\t\tto = link || $Serialization[i%2][0];\n\t\t\tto = to.valueOf( values[i%2] );\n\n\t\t\tif ( to === false ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Calculate the new handle position\n\t\t\tto = toStepping( options, to );\n\n\t\t\t// Invert the value if this is a right-to-left slider.\n\t\t\tif ( options.dir ) {\n\t\t\t\tto = 100 - to;\n\t\t\t}\n\n\t\t\t// Force delimitation.\n\t\t\tif ( setHandle( $Handles[i%2], to, true ) === true ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Reset the input if it doesn't match the slider.\n\t\t\t$($Serialization[i%2]).each(function(){\n\t\t\t\tthis.write(\n\t\t\t\t\toptions,\n\t\t\t\t\t$Locations[i%2],\n\t\t\t\t\t$Handles[i%2].children(),\n\t\t\t\t\t$Target,\n\t\t\t\t\tupdate\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\n\t\t// Optionally fire the 'set' event.\n\t\tif( callback === true ) {\n\t\t\tfireEvents(['set']);\n\t\t}\n\n\t\treturn this;\n\t};\n\n\t// Get the slider value.\n\ttarget.vGet = function ( ){\n\n\t\tvar i, retour = [];\n\n\t\t// Get the value from all handles.\n\t\tfor ( i = 0; i < options.handles; i++ ){\n\t\t\tretour[i] = $Serialization[i][0].saved;\n\t\t}\n\n\t\t// If only one handle is used, return a single value.\n\t\tif ( retour.length === 1 ){\n\t\t\treturn retour[0];\n\t\t}\n\n\t\tif ( options.dir && options.handles > 1 ) {\n\t\t\treturn retour.reverse();\n\t\t}\n\n\t\treturn retour;\n\t};\n\n\t// Destroy the slider and unbind all events.\n\ttarget.destroy = function ( ){\n\n\t\t// Loop all linked serialization objects and unbind all\n\t\t// events in the noUiSlider namespace.\n\t\t$.each($Serialization, function(){\n\t\t\t$.each(this, function(){\n\t\t\t\t// Won't remove 'change' when bound implicitly.\n\t\t\t\tif ( this.target ) {\n\t\t\t\t\tthis.target.off( namespace );\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t// Unbind events on the slider, remove all classes and child elements.\n\t\t$(this).off(namespace)\n\t\t\t.removeClass(Classes.join(' '))\n\t\t\t.empty();\n\n\t\t// Return the original options from the closure.\n\t\treturn originalOptions;\n\t};\n\n\n// Value setting\n\n\t// Use the public value method to set the start values.\n\t$Target.val( options.start );\n}\n\n\n// Access points\n\n\t// Run the standard initializer\n\tfunction initialize ( originalOptions ) {\n\n\t\t// Throw error if group is empty.\n\t\tif ( !this.length ){\n\t\t\tthrowError(\"Can't initialize slider on empty selection.\");\n\t\t}\n\n\t\t// Test the options once, not for every slider.\n\t\tvar options = test( originalOptions, this );\n\n\t\t// Loop all items, and provide a new closed-scope environment.\n\t\treturn this.each(function(){\n\t\t\tclosure(this, options, originalOptions);\n\t\t});\n\t}\n\n\t// Destroy the slider, then re-enter initialization.\n\tfunction rebuild ( options ) {\n\n\t\treturn this.each(function(){\n\n\t\t\t// Get the current values from the slider,\n\t\t\t// including the initialization options.\n\t\t\tvar values = $(this).val(),\n\t\t\t\toriginalOptions = this.destroy(),\n\n\t\t\t\t// Extend the previous options with the newly provided ones.\n\t\t\t\tnewOptions = $.extend( {}, originalOptions, options );\n\n\t\t\t// Run the standard initializer.\n\t\t\t$(this).noUiSlider( newOptions );\n\n\t\t\t// If the start option hasn't changed,\n\t\t\t// reset the previous values.\n\t\t\tif ( originalOptions.start === newOptions.start ) {\n\t\t\t\t$(this).val(values);\n\t\t\t}\n\t\t});\n\t}\n\n\n\t// Expose serialization constructor.\n\t/** @expose */\n\t$.noUiSlider = { 'Link': Link };\n\n\t// Extend jQuery/Zepto with the noUiSlider method.\n\t/** @expose */\n\t$.fn.noUiSlider = function ( options, re ) {\n\t\treturn ( re ? rebuild : initialize ).call(this, options);\n\t};\n\n\t$.fn.val = function ( ) {\n\n\t\t// Convert the function arguments to an array.\n\t\tvar args = Array.prototype.slice.call( arguments, 0 ),\n\t\t\tset, link, update, animate;\n\n\t\t// Test if there are arguments, and if not, call the 'get' method.\n\t\tif ( !args.length ) {\n\n\t\t\t// Determine whether to use the native val method.\n\t\t\tif ( this.hasClass(Classes[0]) ) {\n\t\t\t\treturn this[0].vGet();\n\t\t\t}\n\n\t\t\treturn $val.apply( this );\n\t\t}\n\n\t\t// Extract modifiers for value method.\n\t\tif ( typeof args[1] === 'object' ) {\n\t\t\tset = args[1]['set'];\n\t\t\tlink = args[1]['link'];\n\t\t\tupdate = args[1]['update'];\n\t\t\tanimate = args[1]['animate'];\n\n\t\t// Support the 'true' option.\n\t\t} else if ( args[1] === true ) {\n\t\t\tset = true;\n\t\t}\n\n\t\t// Loop all individual items, and handle setting appropriately.\n\t\treturn this.each(function(){\n\n\t\t\tif ( $(this).hasClass(Classes[0]) ) {\n\t\t\t\tthis.vSet( asArray(args[0]), set, link, update, animate );\n\t\t\t} else {\n\t\t\t\t$val.apply( $(this), args );\n\t\t\t}\n\t\t});\n\t};\n\n}( window['jQuery'] || window['Zepto'] ));\n","/**\n * Provides requestAnimationFrame in a cross browser way.\n * @author paulirish / http://paulirish.com/\n */\n \nif ( !window.requestAnimationFrame ) {\n \n\twindow.requestAnimationFrame = ( function() {\n \n\t\treturn window.webkitRequestAnimationFrame ||\n\t\twindow.mozRequestAnimationFrame ||\n\t\twindow.oRequestAnimationFrame ||\n\t\twindow.msRequestAnimationFrame ||\n\t\tfunction( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) {\n \n\t\t\twindow.setTimeout( callback, 1000 / 60 );\n \n\t\t};\n \n\t} )();\n \n}\n\n/*!\n * isVis - v0.5.5 Aug 2011 - Page Visibility API Polyfill\n * Copyright (c) 2011 Addy Osmani\n * Dual licensed under the MIT and GPL licenses.\n */\n(function () {\n\n window.visibly = {\n b: null,\n q: document,\n p: undefined,\n prefixes: ['webkit', 'ms'],\n props: ['VisibilityState', 'visibilitychange', 'Hidden'],\n m: ['focus', 'blur'],\n visibleCallbacks: [],\n hiddenCallbacks: [],\n _callbacks: [],\n\n onVisible: function ( _callback ) {\n this.visibleCallbacks.push(_callback);\n },\n onHidden: function ( _callback ) {\n this.hiddenCallbacks.push(_callback);\n },\n isSupported: function () {\n return (this._supports(0) || this._supports(1));\n },\n _supports: function ( index ) {\n return ((this.prefixes[index] + this.props[2]) in this.q);\n },\n runCallbacks: function ( index ) {\n if ( index ) {\n this._callbacks = (index == 1) ? this.visibleCallbacks : this.hiddenCallbacks;\n for (var i = 0; i < this._callbacks.length; i++) {\n this._callbacks[i]();\n }\n }\n },\n _visible: function () {\n window.visibly.runCallbacks(1);\n },\n _hidden: function () {\n window.visibly.runCallbacks(2);\n },\n _nativeSwitch: function () {\n ((this.q[this.b + this.props[2]]) === true) ? this._hidden() : this._visible();\n },\n listen: function () {\n\n try { /*if no native page visibility support found..*/\n if (!(this.isSupported())) {\n if (document.addEventListener) { /*for browsers without focusin/out support eg. firefox, opera use focus/blur*/\n\t\t\t\t\t\t/*window used instead of doc as Opera complains otherwise*/\n window.addEventListener(this.m[0], this._visible, 1);\n window.addEventListener(this.m[1], this._hidden, 1);\n } else { /*IE <10s most reliable focus events are onfocusin/onfocusout*/\n this.q.attachEvent('onfocusin', this._visible);\n this.q.attachEvent('onfocusout', this._hidden);\n }\n } else { /*switch support based on prefix*/\n this.b = (this._supports(0) == this.p) ? this.prefixes[1] : this.prefixes[0];\n this.q.addEventListener(this.b + this.props[1], function () {\n window.visibly._nativeSwitch.apply(window.visibly, arguments);\n }, 1);\n }\n } catch (e) {}\n },\n init: function () {\n this.listen();\n }\n }\n\n this.visibly.init();\n\n})();\n","// MIT License:\n//\n// Copyright (c) 2010-2012, Joe Walnes\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/**\n * This behaves like a WebSocket in every way, except if it fails to connect,\n * or it gets disconnected, it will repeatedly poll until it succesfully connects\n * again.\n *\n * It is API compatible, so when you have:\n * ws = new WebSocket('ws://....');\n * you can replace with:\n * ws = new ReconnectingWebSocket('ws://....');\n *\n * The event stream will typically look like:\n * onconnecting\n * onopen\n * onmessage\n * onmessage\n * onclose // lost connection\n * onconnecting\n * onopen // sometime later...\n * onmessage\n * onmessage\n * etc... \n *\n * It is API compatible with the standard WebSocket API.\n *\n * Latest version: https://github.com/joewalnes/reconnecting-websocket/\n * - Joe Walnes\n */\n(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define([], factory);\n } else if (typeof module !== 'undefined' && module.exports){\n module.exports = factory();\n } else {\n global.ReconnectingWebSocket = factory();\n }\n})(this, function () {\n\n function ReconnectingWebSocket(url, protocols) {\n protocols = protocols || [];\n\n // These can be altered by calling code.\n this.debug = false;\n this.reconnectInterval = 1000;\n this.reconnectDecay = 1.5;\n this.reconnectAttempts = 0;\n this.timeoutInterval = 2000;\n\n var self = this;\n var ws;\n var forcedClose = false;\n var timedOut = false;\n \n this.url = url;\n this.protocols = protocols;\n this.readyState = WebSocket.CONNECTING;\n this.URL = url; // Public API\n\n this.onopen = function(event) {\n };\n\n this.onclose = function(event) {\n };\n\n this.onconnecting = function(event) {\n };\n\n this.onmessage = function(event) {\n };\n\n this.onerror = function(event) {\n };\n\n function connect(reconnectAttempt) {\n ws = new WebSocket(url, protocols);\n \n self.onconnecting();\n if (self.debug || ReconnectingWebSocket.debugAll) {\n console.debug('ReconnectingWebSocket', 'attempt-connect', url);\n }\n \n var localWs = ws;\n var timeout = setTimeout(function() {\n if (self.debug || ReconnectingWebSocket.debugAll) {\n console.debug('ReconnectingWebSocket', 'connection-timeout', url);\n }\n timedOut = true;\n localWs.close();\n timedOut = false;\n }, self.timeoutInterval);\n \n ws.onopen = function(event) {\n clearTimeout(timeout);\n if (self.debug || ReconnectingWebSocket.debugAll) {\n console.debug('ReconnectingWebSocket', 'onopen', url);\n }\n self.readyState = WebSocket.OPEN;\n reconnectAttempt = false;\n self.reconnectAttempts = 0;\n self.onopen(event);\n };\n \n ws.onclose = function(event) {\n clearTimeout(timeout);\n ws = null;\n if (forcedClose) {\n self.readyState = WebSocket.CLOSED;\n self.onclose(event);\n } else {\n self.readyState = WebSocket.CONNECTING;\n self.onconnecting();\n if (!reconnectAttempt && !timedOut) {\n if (self.debug || ReconnectingWebSocket.debugAll) {\n console.debug('ReconnectingWebSocket', 'onclose', url);\n }\n self.onclose(event);\n }\n setTimeout(function() {\n self.reconnectAttempts++;\n connect(true);\n }, self.reconnectInterval * Math.pow(self.reconnectDecay, self.reconnectAttempts));\n }\n };\n ws.onmessage = function(event) {\n if (self.debug || ReconnectingWebSocket.debugAll) {\n console.debug('ReconnectingWebSocket', 'onmessage', url, event.data);\n }\n self.onmessage(event);\n };\n ws.onerror = function(event) {\n if (self.debug || ReconnectingWebSocket.debugAll) {\n console.debug('ReconnectingWebSocket', 'onerror', url, event);\n }\n self.onerror(event);\n };\n }\n connect(false);\n\n this.send = function(data) {\n if (ws) {\n if (self.debug || ReconnectingWebSocket.debugAll) {\n console.debug('ReconnectingWebSocket', 'send', url, data);\n }\n return ws.send(data);\n } else {\n throw 'INVALID_STATE_ERR : Pausing to reconnect websocket';\n }\n };\n\n this.close = function() {\n forcedClose = true;\n if (ws) {\n ws.close();\n }\n };\n\n /**\n * Additional public API method to refresh the connection if still open (close, re-open).\n * For example, if the app suspects bad data / missed heart beats, it can try to refresh.\n */\n this.refresh = function() {\n if (ws) {\n ws.close();\n }\n };\n }\n\n /**\n * Setting this to true is the equivalent of setting all instances of ReconnectingWebSocket.debug to true.\n */\n ReconnectingWebSocket.debugAll = false;\n\n return ReconnectingWebSocket;\n});\n","// Set debugmode to true and transactions/trades will be\n// randomly generated, and no outside connections will be made.\nvar DEBUG_MODE = false;\n\nvar DONATION_ADDRESS;\nvar SOUND_DONATION_ADDRESS;\n\nvar globalMute = false;\n\nvar instanceId = 0;\nvar pageDivId = \"pageDiv\";\n\nvar last_update = 0;\n\nvar updateTargets = [];\n\nvar transaction_count = 0;\n\n// Preload images\nvar bubbleImage = new Image();\nbubbleImage.src = \"images/bubble.png\";\nvar blockImage = new Image();\nblockImage.src = \"images/block.png\";\n\nvar debugSpawner;\n\nvar updateLayoutWidth = function() {\n\t$(\".chartMask\").css(\"visibility\", \"visible\");\n};\n\nvar updateLayoutHeight = function() {\n\tvar newHeight = window.innerHeight;\n\tif ($(\"#header\").css(\"display\") != \"none\") newHeight -= $(\"#header\").outerHeight();\n\t$(\"#pageSplitter\").height(newHeight);\n};\n\n$(document).ready(function() {\n\n\tprevChartWidth = $(\"#pageSplitter\").width() / 2;\n\t\n\t$(\"#chartCell\").hide();\n\t\n\tDONATION_ADDRESS = $(\"#donationAddress\").html();\n\t// Because the user has javascript running:\n\t$(\"#noJavascript\").css(\"display\", \"none\");\n\n\t// Initialize draggable vertical page splitter\n\tupdateLayoutHeight();\n\t\n\tStatusBox.init(DEBUG_MODE);\n\n\t$(\".clickSuppress\").click(function() {\n\t\t$(\".clickSuppress\").parent().slideUp(300);\n\t});\n\n\t// Create a bubble spawner for testing\n\tdebugSpawner = function() {\n\t\t// Generate some test bubbles\n\t\tif (Math.random() <= 0.1) {\n\t\t\t// Try to simulate the transaction spread\n\t\t\tvar volume;\n\t\t\tvar order = Math.random();\n\t\t\tif (order < 0.6) {\n\t\t\t\tvolume = Math.random();\n\t\t\t} else if (order < 0.8) {\n\t\t\t\tvolume = Math.random() * 10;\n\t\t\t} else if (order < 0.95) {\n\t\t\t\tvolume = Math.random() * 100;\n\t\t\t} else {\n\t\t\t\tvolume = Math.random() * 1000;\n\t\t\t}\n\n\t\t\tif (Math.random() < 0.5)\n\t\t\t\tnew Transaction(volume, false);\n\t\t\telse\n\t\t\t\tnew Transaction(volume, false, volume * 75, 'USD');\n\t\t}\n\t};\n\t// Spam the following line into console, it's kind of fun.\n\t// new Block(228158, 270, 100 * satoshi, 153 * 1024);\n\t\n\tswitchExchange(\"bitstamp\");\n\t\n\t// Attach mouseover qr\n\t$(\"#donationAddress\").qr();\n\t\n});\n\n// Function for handling interface show/hide\nvar toggleInterface = function() {\n\tif ($(\".interface:hidden\").length === 0) {\n\t\t$(\".interface\").fadeOut(500, updateLayoutHeight);\n\t\t$(\"#hideInterface\").html(\"[ Show Interface ]\");\n\t\t$(\"#hideInterface\").css(\"opacity\", \"0.5\");\n\t} else {\n\t\t$(\".interface\").fadeIn(500);\n\t\t$(\"#hideInterface\").html(\"[ Hide Interface ]\");\n\t\t$(\"#hideInterface\").css(\"opacity\", \"1\");\n\t\tupdateLayoutHeight();\n\t}\n};\n\nvar globalUpdate = function(time) {\n\twindow.requestAnimationFrame(globalUpdate);\n\tvar delta = time - last_update;\n\tlast_update = time;\n\tfor (var i = 0; i < updateTargets.length; i++) {\n\t\tupdateTargets[i].update(delta);\n\t}\n};\n\n$(window).bind(\"load\", function() {\n\tif (DEBUG_MODE) {\n\t\tsetInterval(debugSpawner, 100);\n\t} else {\n\t\tif ($(\"#blockchainCheckBox\").prop(\"checked\"))\n\t\t\tTransactionSocket.init();\n\t\tif ($(\"#mtgoxCheckBox\").prop(\"checked\"))\n\t\t\tTradeSocket.init();\n\t}\n\n\twindow.requestAnimationFrame(globalUpdate);\n\t\n\tSound.loadup();\n\tSound.init();\n});\n\nvar endResize = function() {\n $(\".chartMask\").css(\"visibility\", \"hidden\");\n\tfor (var i = 0; i < updateTargets.length; i++) {\n\t\tupdateTargets[i].updateContainerSize();\n\t}\n};\n\nvar hideChart = function() {\n\t$(\"#chartElement\").hide();\n\t$(\"#showChart\").show();\n\tprevChartWidth = $(\"#chartCell\").width();\n\t$(\"#chartCell\").width(0);\n\t$(\"#chartCell\").hide();\n\t$(\"#pageSplitter\").colResizable({\n\t\tdisable: true\n\t});\n};\n\nvar showChart = function() {\n\t$(\"#chartElement\").show();\n\t$(\"#showChart\").hide();\n\t$(\"#chartCell\").width(prevChartWidth);\n\t$(\"#chartCell\").show();\n\t$(window).trigger(\"resize\");\n\tif ($(\"#bitcoinChart\").length === 0) {\n\t\t// Load the iframe\n\t\t$(\"#chartHolder\").html('');\n\t}\n\t$(\"#pageSplitter\").colResizable({\n\t\tliveDrag: true,\n\t\tonDrag: updateLayoutWidth,\n\t\tonResize: endResize\n\t});\n};\n\n$(window).resize(function() {\n updateLayoutHeight();\n});\n\nwindow.onbeforeunload = function(e) {\n\tclearInterval(globalUpdate);\n\tTransactionSocket.close();\n\tTradeSocket.close();\n};\n\n","var rateboxTimeout;\nvar currentExchange;\nvar ratebox_ms = 3000; // 3 second update interval\n\nrateboxGetRate = function() {\n\tif (currentExchange == \"bitstamp\") {\n\t\t// Thanks to nyg for this trick - https://github.com/nyg/bitstamp-ticker/blob/master/bitstamp.js\n\t\tvar api_url = 'https://www.bitstamp.net/api/ticker/';\n\t\tvar yql_url = '//query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D\"' + encodeURIComponent(api_url) + '\"&format=json&callback=?';\n\t\t\n $.getJSON(yql_url, function (json) {\n var ticker = $.parseJSON(json.query.results.body);\n if (ticker) {\n $(\"#rate\").html(parseFloat(ticker.last).toFixed(2));\n } else {\n rateboxTimeout = setTimeout(rateboxGetRate, ratebox_ms);\n }\n });\n \n\t} else {\n\t\tthrow \"Unrecognized Exchange\";\n\t}\n};\n\n$(document).ready(function() {\n\t// Bitstamp websocket API\n\tvar pusher = new Pusher('de504dc5763aeef9ff52');\n\tvar channel = pusher.subscribe('live_trades');\n\tchannel.bind('trade', function(ticker) {\n $(\"#rate\").html(parseFloat(ticker.price).toFixed(2));\n if (rateboxTimeout) clearTimeout(rateboxTimeout);\n\t});\n});\n\nswitchExchange = function(exchangeName) {\n\tclearTimeout(rateboxTimeout);\n\tcurrentExchange = exchangeName;\n\t$(\"#rate\").html(\"---\");\n\t\n\tif (exchangeName == \"bitstamp\") {\n\t\t$(\"#bitstampRate\").css(\"color\", \"white\");\n\t\t$(\"#mtgoxRate\").css(\"color\", \"gray\");\n\t} else if (exchangeName == \"mtgox\") {\n\t\t$(\"#mtgoxRate\").css(\"color\", \"white\");\n\t\t$(\"#bitstampRate\").css(\"color\", \"gray\");\n\t}\n\t\n\trateboxGetRate();\n};\n"]} \ No newline at end of file +{"version":3,"file":"bitlisten.min.js","sources":["lib/extend.js","src/block.js","src/floatable.js","src/socket.js","src/sound.js","src/statusbox.js","src/transaction.js","lib/easteregg.js","lib/howler.js","lib/jquery-qr.js","lib/jquery.nouislider.js","lib/polyfills.js","lib/reconnecting-websocket.js","src/main.js","src/ratebox.js"],"names":["surrogateCtor","extend","base","sub","prototype","constructor","Block","height","numTransactions","outputTotal","blockSize","document","visibilityState","Floatable","call","this","outputBTC","Math","floor","satoshi","blockSizeKB","width","addImage","blockImage","addText","initPosition","Sound","playRandomSwell","velocity","x","y","pageDiv","getElementById","updateContainerSize","div","createElement","className","appendChild","innerDiv","updateTargets","push","TransactionSocket","zeroPad","num","places","zero","toString","length","Array","join","StatusBox","Transaction","bitcoins","highlight","currency","currencyName","area","sqrt","PI","bubbleImage","bitcoinString","bitcoinVal","toFixed","maxBitcoins","minVolume","maxVolume","volume","maxPitch","logUsed","pitch","min","log","globalScalePitch","playPitchAtVolume","playRandomAtVolume","transaction_count","style","opacity","Konami","callback","konami","addEvent","obj","type","fn","ref_obj","addEventListener","attachEvent","window","event","input","pattern","load","link","e","keyCode","substr","code","preventDefault","iphone","location","start_x","start_y","stop_x","stop_y","tap","capture","orig_keys","keys","touches","touch","pageX","pageY","check_direction","evt","changedTouches","x_magnitude","abs","y_magnitude","result","slice","cache","ctx","usingWebAudio","noAudio","AudioContext","webkitAudioContext","Audio","masterGain","createGain","createGainNode","gain","value","connect","destination","HowlerGlobal","codecs","_volume","_muted","_howls","_codecs","iOSAutoEnable","vol","self","parseFloat","key","hasOwnProperty","_webAudio","i","_audioNode","mute","_setMuted","unmute","muted","ext","_enableiOSAudio","_iOSEnabled","test","navigator","userAgent","unlock","buffer","createBuffer","source","createBufferSource","start","noteOn","setTimeout","playbackState","PLAYING_STATE","FINISHED_STATE","removeEventListener","audioTest","mp3","canPlayType","replace","opus","ogg","wav","aac","m4a","mp4","weba","Howler","Howl","o","_autoplay","autoplay","_buffer","_duration","duration","_format","format","_loop","loop","_loaded","_sprite","sprite","_src","src","_pos3d","pos3d","undefined","_urls","urls","_rate","rate","_model","model","_onload","onload","_onloaderror","onloaderror","_onend","onend","_onpause","onpause","_onplay","onplay","_onendTimer","_setupAudioNode","url","on","urlItem","exec","split","toLowerCase","loadBuffer","newNode","error","_pos","preload","listener","ceil","Object","getOwnPropertyNames","_default","play","stop","_inactiveNode","node","pos","timerId","soundId","round","Date","now","random","data","id","_nodeById","paused","_clearEndTimer","timer","loopStart","loopEnd","refreshBuffer","_playStart","currentTime","bufferSource","noteGrainOn","readyState","isCocoonJS","sound","playSprite","pause","activeNode","_activeNode","noteOff","isNaN","z","panner","setPosition","panningModel","fade","from","to","len","diff","dir","steps","stepTime","change","toVol","fadeIn","fadeOut","_drainPool","listenerEvent","inactive","disconnect","splice","index","clearTimeout","createPanner","events","off","fnString","unload","nodes","indexOf","loadSound","atob","dataView","Uint8Array","charCodeAt","decodeAudioData","xhr","XMLHttpRequest","open","responseType","response","onerror","_gainNode","send","arraybuffer","err","playbackRate","define","amd","exports","$","qr","options","createQR","href","size","escape","$qr","css","background","display","border-style","border-width","position","z-index","append","each","settings","delay","$this","qr_div","attr","mouseenter","qr_timeout_id","top","left","mouseleave","jQuery","throwError","message","RangeError","throwEqualError","F","a","b","limit","max","closest","subRangeRatio","pa","pb","typeMatch","isInstance","isNumeric","isFinite","asArray","isArray","addClassFor","element","addClass","removeClass","fromPercentage","range","toPercentage","isPercentage","toStepping","xVal","va","vb","j","xPct","fromStepping","getStep","snap","xSteps","fixEvent","mouse","pointer","originalEvent","pageXOffset","documentElement","scrollLeft","pageYOffset","scrollTop","clientX","clientY","points","cursor","Format","Formatting","val","FormatDefaults","Link","entry","update","Error","formatting","that","target","method","isTooltip","isHidden","isMethod","is$","isInput","is","methodIsFunction","methodIsName","el","name","at","c","output","N","testStep","parsed","testRange","percentage","n","testStart","handles","testSnap","testConnect","testOrientation","ort","testMargin","margin","testDirection","testBehaviour","drag","fixed","testSerialization","sliders","ser","scope","reverse","tests","step","r","t","orientation","direction","behaviour","serialization","lower","upper","addHandle","handle","Classes","additions","children","addElement","clone","appendTo","addElements","elements","list","addLinks","links","addConnection","addHandles","addSlider","closure","originalOptions","baseSize","$Base","fireEvents","values","$Target","trigger","setHandle","delimit","$Handles","$Locations","toggleClass","$Serialization","write","getPositions","d","jump","instant","attach","namespace","disabled","hasClass","calcPoint","move","positions","state","proposal","h","end","doc","stopPropagation","actions","total","offset","edge","find","add","not","vSet","animate","valueOf","vGet","retour","saved","destroy","empty","initialize","rebuild","newOptions","noUiSlider","$val","pointerEnabled","msPointerEnabled","v","number","negative","preNegative","mark","match","esc","s","isNeg","RegExp","slider","re","set","args","arguments","apply","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","visibly","q","p","prefixes","props","m","visibleCallbacks","hiddenCallbacks","_callbacks","onVisible","_callback","onHidden","isSupported","_supports","runCallbacks","_visible","_hidden","_nativeSwitch","listen","init","global","factory","module","ReconnectingWebSocket","protocols","reconnectAttempt","ws","WebSocket","onconnecting","debug","debugAll","console","localWs","timeout","timedOut","close","timeoutInterval","onopen","OPEN","reconnectAttempts","onclose","forcedClose","CLOSED","CONNECTING","reconnectInterval","pow","reconnectDecay","onmessage","URL","refresh","pageDivWidth","pageDivHeight","deltatime","HVEL_MAX","updateDiv","removeSelf","transform","removeChild","image","canvas","getContext","drawImage","text","innerHTML","offsetHeight","easterSuccess","derpy","time","-moz-transform","-o-transform","-webkit-transform","DEBUG_MODE","DONATION_ADDRESS","SOUND_DONATION_ADDRESS","globalMute","instanceId","pageDivId","last_update","Image","debugSpawner","updateLayoutWidth","updateLayoutHeight","newHeight","innerHeight","outerHeight","ready","prevChartWidth","hide","html","click","parent","slideUp","order","switchExchange","toggleInterface","globalUpdate","delta","bind","setInterval","prop","TradeSocket","loadup","endResize","hideChart","show","colResizable","disable","showChart","liveDrag","onDrag","onResize","resize","onbeforeunload","clearInterval","rateboxTimeout","currentExchange","ratebox_ms","rateboxGetRate","pusher","Pusher","channel","subscribe","ticker","price","exchangeName","DELAY_CAP","lastBlockHeight","provider_name","connection","reconnecting","connected","newTransactions","op","newBlocks","JSON","stringify","closed","parse","transacted","out","outputs","blockHeight","transactions","nTx","volumeSent","estimatedBTCSent","nosupport","globalVolume","globalBank","soundBank","sound0","sound1","sound2","swells0","swells1","swells2","instrument_number","musicianString","istring","newSound","currentSound","currentSwells","currentNotes","noteTimeout","randomPitch","fuzz","lastBlockSound","randomIndex","CONNECTED","NO_SUPPORT","debugmode","blockchain","mtgox"],"mappings":";;AAAA,QAASA,kBAET,QAASC,QAAOC,EAAMC,GAEpBH,cAAcI,UAAYF,EAAKE,UAE/BD,EAAIC,UAAY,GAAIJ,eAEpBG,EAAIC,UAAUC,YAAcF,ECJ9B,QAASG,OAAMC,EAAQC,EAAiBC,EAAaC,GACpD,GAAiC,YAA7BC,SAASC,gBAA+B,CAC3CC,UAAUC,KAAKC,KAEf,IAAIC,GAAYC,KAAKC,MAAMT,EAAcU,SAAW,OAChDC,EAAcH,KAAKC,MAAMR,EAAY,MAAQ,KAEjDK,MAAKM,MAAQN,KAAKR,OAAS,IAE3BQ,KAAKO,SAASC,WAAYR,KAAKM,MAAON,KAAKR,QAC3CQ,KAAKS,QAAQ,UAAYjB,EAAS,iCAAmCC,EAAkB,6BAA+BQ,EAAY,qBAAuBI,GAC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iD7C,WAAa,YAGrF5hB,UAAUmoB,UAAY,SAASlmB,GAClB,cAARA,GACHjC,UAAU4pB,WAAWnF,KAAK,iBAAmBuC,cAAgB,gCAAkC0C,WAAa,WACjG,SAARznB,GACHjC,UAAU6pB,MAAMpF,KAAK,4CAA8CiF,WAAa,YAGlF1pB,UAAUynB,OAAS,SAASxlB,GACf,cAARA,GACHjC,UAAU4pB,WAAWnF,KAAK,iBAAmBuC,cAAgB,iCAAmCrF,OAAS,WAC9F,SAAR1f,GACHjC,UAAU6pB,MAAMpF,KAAK,6CAA+C9C,OAAS,YCW/E5kB,OAAOY,UAAWsC","sourcesContent":["function surrogateCtor() {}\r\n\r\nfunction extend(base, sub) {\r\n // Copy the prototype from the base to setup inheritance\r\n surrogateCtor.prototype = base.prototype;\r\n // Tricky huh?\r\n sub.prototype = new surrogateCtor();\r\n // Remember the constructor property was set wrong, let's fix it\r\n sub.prototype.constructor = sub;\r\n}","/** \r\n * @constructor\r\n * @extends Floatable\r\n */\r\nfunction Block(height, numTransactions, outputTotal, blockSize) {\r\n\tif (document.visibilityState === \"visible\") {\r\n\t\tFloatable.call(this);\r\n\r\n\t\tvar outputBTC = Math.floor(outputTotal / satoshi) + \" BTC\";\r\n\t\tvar blockSizeKB = Math.floor(blockSize / 1024) + \" KB\";\r\n\r\n\t\tthis.width = this.height = 500;\r\n\r\n\t\tthis.addImage(blockImage, this.width, this.height);\r\n\t\tthis.addText(\"Block #\" + height + \"
Number of Transactions: \" + numTransactions + \"
Transaction Volume: \" + outputBTC + \"
Block Size: \" + blockSizeKB);\r\n\t\tthis.initPosition();\r\n\t}\r\n\t\r\n\t// Sound\r\n\tSound.playRandomSwell();\r\n}\r\n\r\nextend(Floatable, Block);\r\n","/** @constructor */\nfunction Floatable() {\n\tthis.velocity = {\n\t\tx : 0,\n\t\ty : -1\n\t};\n\t\n\tthis.pageDiv = document.getElementById(\"bubbleDiv\");\n\tthis.updateContainerSize();\n\n\tthis.div = document.createElement(\"div\");\n\tthis.div.className = \"floatableDiv\";\n\tthis.pageDiv.appendChild(this.div);\n\tthis.innerDiv = document.createElement(\"div\");\n\tthis.div.appendChild(this.innerDiv);\n\tthis.innerDiv.className = \"innerDiv\";\n\n\t// Add this object to the update array\n\tupdateTargets.push(this);\n}\n\nFloatable.prototype.updateContainerSize = function() {\n\tthis.pageDivWidth = $(this.pageDiv).width();\n\tthis.pageDivHeight = $(this.pageDiv).height();\n};\n\nFloatable.prototype.update = function(deltatime) {\n\tvar HVEL_MAX = 1;\n\tvar step = deltatime / 50;\n\t\n\tthis.x += this.velocity.x * step;\n\tthis.y += this.velocity.y * step;\n\n\tthis.velocity.x += (Math.random() * 0.1 - 0.05) * step;\n\tif (this.velocity.x > HVEL_MAX) {\n\t\tthis.velocity.x = HVEL_MAX;\n\t} else if (this.velocity.x < -HVEL_MAX) {\n\t\tthis.velocity.x = -HVEL_MAX;\n\t}\n\tif (this.x < 0) {\n\t\tthis.velocity.x += 0.005 * step;\n\t} else if (this.x > this.pageDivWidth - this.width) {\n\t\tthis.velocity.x -= 0.005 * step;\n\t}\n\n\tthis.updateDiv();\n\n\tif (this.y < -this.height)\n\t\tthis.removeSelf();\n};\n\nFloatable.prototype.updateDiv = function() {\n\tthis.div.style[\"-webkit-transform\"] = \"translate(\" + this.x + \"px,\" + this.y + \"px)\";\n\tthis.div.style.transform = \"translate(\" + this.x + \"px,\" + this.y + \"px)\";\n};\n\nFloatable.prototype.removeSelf = function() {\n\tthis.pageDiv.removeChild(this.div);\n\t// Remove self from update array\n\tupdateTargets.splice(updateTargets.indexOf(this), 1);\n};\n\nFloatable.prototype.addImage = function(image, width, height) {\n\tthis.canvas = document.createElement('canvas');\n\tthis.image = image;\n\tthis.canvas.height = height;\n\tthis.canvas.width = width;\n\tthis.canvas.style.position = \"absolute\";\n\tthis.canvas.style.top = \"0px\";\n\tthis.canvas.style.left = \"0px\";\n\tvar ctx = this.canvas.getContext(\"2d\");\n\tctx.drawImage(this.image, 0, 0, width - 1, height - 1);\n\n\tthis.div.appendChild(this.canvas);\n};\n\nFloatable.prototype.addText = function(text) {\n\tthis.innerDiv.innerHTML += text;\n};\n\nFloatable.prototype.initPosition = function() {\n\tthis.x = Math.random() * (this.pageDivWidth - this.width);\n\tthis.y = this.pageDivHeight;\n\tthis.updateDiv();\n\tthis.div.style.width = this.width + \"px\";\n\tthis.div.style.height = this.height + \"px\";\n\tthis.innerDiv.style.top = (this.height / 2 - this.innerDiv.offsetHeight / 2) + 'px';\n\t// Centers the text within the bubble\n};\n\n// Thanks to Myself-Remastered for the image used in this easter egg\n// http://myself-remastered.deviantart.com/art/Derpy-Delivery-251264643\nvar easterSuccess = function() {\n\tvar derpy = new Floatable();\n\tderpy.width = 53;\n\tderpy.height = 48;\n\t\n\tderpy.image = document.createElement('img');\n\tderpy.image.src = \"images/easteregg.gif\";\n\tderpy.image.height = derpy.height;\n\tderpy.image.width = derpy.width;\n\tderpy.image.style.position = \"absolute\";\n\tderpy.image.style.top = \"0px\";\n\tderpy.image.style.left = \"0px\";\n\tderpy.div.appendChild(derpy.image);\n\t\n\tderpy.initPosition();\n\t\n\tderpy.update = function(time) {\n\t\tFloatable.prototype.update.call(derpy, time);\n\t\tderpy.velocity.x += Math.random() * 0.3 - 0.15;\n\t\tif (derpy.velocity.x > 0.1) {\n\t\t\t$(derpy.image).css({\n\t\t\t\t\"-moz-transform\": \"scaleX(-1)\",\n\t\t\t\t\"-o-transform\": \"scaleX(-1)\",\n\t\t\t\t\"-webkit-transform\": \"scaleX(-1)\",\n\t\t\t\t\"transform\": \"scaleX(-1)\"\n\t\t\t});\n\t\t}\n\t\tif (derpy.velocity.x < -0.1) {\n\t\t\t$(derpy.image).css({\n\t\t\t\t\"-moz-transform\": \"scaleX(1)\",\n\t\t\t\t\"-o-transform\": \"scaleX(1)\",\n\t\t\t\t\"-webkit-transform\": \"scaleX(1)\",\n\t\t\t\t\"transform\": \"scaleX(1)\"\n\t\t\t});\n\t\t}\n\t};\n};\nnew Konami(easterSuccess);\n","var satoshi = 100000000;\nvar DELAY_CAP = 20000;\nvar lastBlockHeight = 0;\n\nvar provider_name = \"blockchain.info\";\n\n/** @constructor */\nfunction TransactionSocket() {\n\n}\n\nTransactionSocket.init = function() {\n\t// Terminate previous connection, if any\n\tif (TransactionSocket.connection)\n\t\tTransactionSocket.connection.close();\n\n\tif ('WebSocket' in window) {\n\t\tvar connection = new ReconnectingWebSocket('wss://ws.blockchain.info/inv');\n\t\tTransactionSocket.connection = connection;\n\n\t\tStatusBox.reconnecting(\"blockchain\");\n\n\t\tconnection.onopen = function() {\n\t\t\tconsole.log('Blockchain.info: Connection open!');\n\t\t\tStatusBox.connected(\"blockchain\");\n\t\t\tvar newTransactions = {\n\t\t\t\t\"op\" : \"unconfirmed_sub\"\n\t\t\t};\n\t\t\tvar newBlocks = {\n\t\t\t\t\"op\" : \"blocks_sub\"\n\t\t\t};\n\t\t\tconnection.send(JSON.stringify(newTransactions));\n\t\t\tconnection.send(JSON.stringify(newBlocks));\n\t\t\tconnection.send(JSON.stringify({\n\t\t\t\t\"op\" : \"ping_tx\"\n\t\t\t}));\n\t\t\t// Display the latest transaction so the user sees something.\n\t\t};\n\n\t\tconnection.onclose = function() {\n\t\t\tconsole.log('Blockchain.info: Connection closed');\n\t\t\tif ($(\"#blockchainCheckBox\").prop(\"checked\"))\n\t\t\t\tStatusBox.reconnecting(\"blockchain\");\n\t\t\telse\n\t\t\t\tStatusBox.closed(\"blockchain\");\n\t\t};\n\n\t\tconnection.onerror = function(error) {\n\t\t\tconsole.log('Blockchain.info: Connection Error: ' + error);\n\t\t};\n\n\t\tconnection.onmessage = function(e) {\n\t\t\tvar data = JSON.parse(e.data);\n\n\t\t\t// New Transaction\n\t\t\tif (data.op == \"utx\") {\n\t\t\t\tvar transacted = 0;\n\n\t\t\t\tfor (var i = 0; i < data.x.out.length; i++) {\n\t\t\t\t\ttransacted += data.x.out[i].value;\n\t\t\t\t}\n\n\t\t\t\tvar bitcoins = transacted / satoshi;\n\t\t\t\t//console.log(\"Transaction: \" + bitcoins + \" BTC\");\n\n\t\t\t\tvar donation = false;\n var soundDonation = false;\n\t\t\t\tvar outputs = data.x.out;\n\t\t\t\tfor (var j = 0; j < outputs.length; j++) {\n\t\t\t\t\tif ((outputs[j].addr) == DONATION_ADDRESS) {\n\t\t\t\t\t\tbitcoins = data.x.out[j].value / satoshi;\n\t\t\t\t\t\tnew Transaction(bitcoins, true);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n if (transaction_count === 0) {\n new Transaction(bitcoins);\n } else {\n\t\t\t\t setTimeout(function() {\n\t\t\t\t\t new Transaction(bitcoins);\n\t\t\t\t }, Math.random() * DELAY_CAP);\n\t\t\t\t}\n\n\t\t\t} else if (data.op == \"block\") {\n\t\t\t\tvar blockHeight = data.x.height;\n\t\t\t\tvar transactions = data.x.nTx;\n\t\t\t\tvar volumeSent = data.x.estimatedBTCSent;\n\t\t\t\tvar blockSize = data.x.size;\n\t\t\t\t// Filter out the orphaned blocks.\n\t\t\t\tif (blockHeight > lastBlockHeight) {\n\t\t\t\t\tlastBlockHeight = blockHeight;\n\t\t\t\t\tconsole.log(\"New Block\");\n\t\t\t\t\tnew Block(blockHeight, transactions, volumeSent, blockSize);\n\t\t\t\t}\n\t\t\t}\n\n\t\t};\n\t} else {\n\t\t//WebSockets are not supported.\n\t\tconsole.log(\"No websocket support.\");\n\t\tStatusBox.nosupport(\"blockchain\");\n\t}\n};\n\nTransactionSocket.close = function() {\n\tif (TransactionSocket.connection)\n\t\tTransactionSocket.connection.disconnect();\n\tStatusBox.closed(\"blockchain\");\n};\n","var globalVolume = 50;\nvar globalScalePitch;\nvar globalBank;\n//init volume at 50%\nHowler.volume(globalVolume * 0.01);\n\nfunction Sound() {\n\n}\n\nvar soundBank = [];\n\t// the second number is the number of sound files available\n\tsoundBank[0] = [\"celesta\", 22];\n\tsoundBank[1] = [\"planet\", 33];\n\tsoundBank[2] = [\"wikki\", 13];\n\nfunction zeroPad(num, places) {\n\tvar zero = places - num.toString().length + 1;\n\treturn Array(+(zero > 0 && zero)).join(\"0\") + num;\n}\n\t\nSound.loadup = function(){\n\tvar newSound;\n\tvar istring;\n\n\t// sound0 = celesta\n\tsound0 = []; \n\n // sound1 = planet\n\tsound1 = []; \n\n // sound2 = celestaB\n\tsound2 = []; \n\n\t// String swells0, for blocks\n\tswells0 = [];\n\t\n\t// String swells1, for blocks\n\tswells1 = [];\n\n // String swells2, for blocks\n\tswells2 = [];\n\t\n\t// These variables are populated (and their sounds loaded) by the Sound.change function below.\n};\n\n\n\nSound.init = function() {\n\n\n\t// Initialize sound toggle button\n\t$(\"#volumeControl\").click(function() {\n\t\tif (!globalMute) {\n\t\t\tglobalMute = true;\n\t\t\tHowler.mute();\n\t\t\t$(\"#volumeControl\").css(\"background-position\", \"0 0\");\n\t\t} else {\n\t\t\tglobalMute = false;\n\t\t\tHowler.unmute();\n\t\t\t$(\"#volumeControl\").css(\"background-position\", \"0 -46px\");\n\t\t}\n\t});\n \n\t// Initialize sound slider\n\t$(\"#volumeSlider\").noUiSlider({\n\t\trange : {\n\t\t\t'min': 0,\n\t\t\t'max': 100\n\t\t},\n\t\tstart : 50,\n\t\thandles : 1,\n\t\tstep : 1,\n\t\torientation : \"vertical\"\n\t}).on('slide', function() {\n\t\t\tglobalVolume = 100 - $(this).val();\n\t\t\tHowler.volume(globalVolume * 0.01);\n\t});\n\t\n\tglobalScalePitch = $(\"#scalePitchCheckBox\").attr(\"checked\");\n\tSound.change(0);\n};\n\nSound.change = function(instrument_number) {\n\tvar musicianString = \"Donate to instrument creator: \";\n\tvar i;\n\t// INSTRUMENT 0\n\tif (instrument_number === 0 ) {\n\t\t// Load sound and swells if not already loaded\n\t\tif (sound0.length === 0) {\n\t\t\tfor (i = 1; i <= 22; i++) {\n\t\t\t\tistring = zeroPad(i, 3);\n\t\t\t\tnewSound = new Howl({\n\t\t\t\t\t\turls: [\"sounds/celesta/\" + \"celesta\" + istring + \".ogg\",\n\t\t\t\t\t\t\t \"sounds/celesta/\" + \"celesta\" + istring + \".mp3\"],\n\t\t\t\t\t\tautoplay: false\n\t\t\t\t});\n\t\t\t\tsound0.push(newSound);\n\t\t\t}\n\t\t}\n\t\tif (swells0.length === 0) {\n\t\t\tfor (i = 1; i <= 3; i++) {\n\t\t\t\tnewSound = new Howl({\n\t\t\t\t\turls: [\"sounds/swells0/swell\" + i +\".ogg\",\n\t\t\t\t\t\t\t\"sounds/swells0/swell\" + i +\".mp3\"],\n\t\t\t\t\tautoplay: false\n\t\t\t\t});\n\t\t\t\tswells0.push(newSound);\n\t\t\t}\n\t\t}\n\t\tcurrentSound = sound0;\n\t\tcurrentSwells = swells0;\n\t\t$('#musicianDonation').text(\"\");\n\t}\n\t// INSTRUMENT 1\n\telse if (instrument_number === 1) {\n\t // Load sound and swells if not already loaded\n\t\tif (sound1.length === 0) {\n\t\t\tfor (i = 1; i <= 33; i++) {\n\t\t\t\tistring = zeroPad(i, 3);\n\t\t\t\tnewSound = new Howl({\n\t\t\t\t\t\turls: [\"sounds/planet/\" + \"planet\" + istring + \".ogg\",\n\t\t\t\t\t\t\t \"sounds/planet/\" + \"planet\" + istring + \".mp3\"],\n\t\t\t\t\t\tautoplay: false\n\t\t\t\t});\n\t\t\t\tsound1.push(newSound);\n\t\t\t}\n\t\t}\n if (swells1.length === 0) {\n\t\t\tfor (i = 1; i <= 3; i++) {\n\t\t\t\tnewSound = new Howl({\n\t\t\t\t\turls: [\"sounds/swells1/planetswell\" + i +\".ogg\",\n\t\t\t\t\t\t\t\"sounds/swells1/planetswell\" + i +\".mp3\"],\n\t\t\t\t\tautoplay: false\n\t\t\t\t});\n\t\t\t\tswells1.push(newSound);\n\t\t\t}\n\t\t}\n\t\tcurrentSound = sound1;\n\t\tcurrentSwells = swells1;\n\t\tSOUND_DONATION_ADDRESS = \"144b31mmaWQVDQFiUPo6HEzxc2Dm83WXrW\";\n\t\t$('#musicianDonation').html(musicianString + \"\" + SOUND_DONATION_ADDRESS + \"\");\n\t}\n // INSTRUMENT 2\n\telse if (instrument_number === 2) {\n\t\t// Load sound and swells if not already loaded\n\t\tif (sound2.length === 0) {\n\t\t\tfor (i = 1; i <= 13; i++) {\n\t\t\t\tistring = zeroPad(i, 3);\n\t\t\t\tnewSound = new Howl({\n\t\t\t\t\t\turls: [\"sounds/wikki/\" + \"wikki\" + istring + \".ogg\",\n\t\t\t\t\t\t\t \"sounds/wikki/\" + \"wikki\" + istring + \".mp3\"],\n\t\t\t\t\t\tautoplay: false\n\t\t\t\t});\n\t\t\t\tsound2.push(newSound);\n\t\t\t}\n\t\t}\n\t\tif (swells2.length === 0) {\n\t\t\tfor (i = 1; i <= 3; i++) {\n\t\t\t\tnewSound = new Howl({\n\t\t\t\t\turls: [\"sounds/swells2/wikkiswell\" + i +\".ogg\",\n\t\t\t\t\t\t\t\"sounds/swells2/wikkiswell\" + i +\".mp3\"],\n\t\t\t\t\tautoplay: false\n\t\t\t\t});\n\t\t\t\tswells2.push(newSound);\n\t\t\t}\n\t\t}\n\t currentSound = sound2;\n\t\tcurrentSwells = swells2;\n\t\tSOUND_DONATION_ADDRESS = \"1JFaYRGkDmhpSTbFKwqDWKr2ncvvrgYEAV\";\n\t\t$('#musicianDonation').html(musicianString + \"\" + SOUND_DONATION_ADDRESS + \"\");\n\t\t}\n};\n\nvar currentNotes = 0;\nvar noteTimeout = 500;\n\nSound.playRandomAtVolume = function(volume) {\n\tif (globalMute)\n\t\treturn;\n\t\t\n\tvar randomPitch = Math.floor(Math.random() * 100);\n\tSound.playPitchAtVolume(volume, randomPitch);\n};\n\nSound.playPitchAtVolume = function(volume, pitch) {\n\tif (globalMute)\n\t\treturn;\n\t// Find the index corresponding to the requested pitch\n\tvar index = Math.floor(pitch / 100.0 * currentSound.length);\n\t//console.log(\"Pitch: \" + pitch);\n\t\n\t// Here we fuzz the index a bit to prevent the same sound\n\t// from being heard over and over again, which gets annoying\n\tvar fuzz = Math.floor(Math.random() * 4) - 2;\n\tindex += fuzz;\n\tindex = Math.min(currentSound.length - 1, index);\n\tindex = Math.max(0, index);\n\t\n\t//console.log(\"Fuzz: \" + fuzz);\n\t//console.log(\"Index: \" + index);\n\t\n\n\t//var readyState = currentSound[index].get(\"readyState\");\n\tif (currentNotes < 5) {\n currentSound[index].volume(volume);\n\t\tcurrentSound[index].play();\n\t\tcurrentNotes++;\n\t\tsetTimeout(function() {\n\t\t\tcurrentNotes--;\n\t\t}, noteTimeout);\n\t}\n};\n\nvar lastBlockSound = -1;\nSound.playRandomSwell = function() {\n\tif (globalMute)\n\t\treturn;\n\n\tvar randomIndex;\n\tdo {\n\t\trandomIndex = Math.floor(Math.random() * currentSwells.length);\n\t} while (randomIndex == lastBlockSound);\n\n\tlastBlockSound = randomIndex;\n\n\t//var readyState = this.swells[randomIndex].get(\"readyState\");\n\t//if (readyState >= 2)\n\tcurrentSwells[randomIndex].play();\n};\n","var CONNECTED = \"Connected.\";\nvar CONNECTING = \"Connecting...\";\nvar NO_SUPPORT = \"No browser support.\";\nvar CLOSED = \"Click to connect.\";\n\nvar provider_name = \"blockchain.info\";\n\nfunction StatusBox() {\n\n}\n\nStatusBox.init = function(debugmode) {\n\tStatusBox.blockchain = $(\"#blockchainStatus\");\n\tStatusBox.mtgox = $(\"#mtgoxStatus\");\n\n\tif (debugmode) {\n\t\tStatusBox.blockchain.html(\"\");\n\t\tStatusBox.mtgox.html(\"Debug mode.\");\n\t}\n\n\tif ($(\"#blockchainCheckBox\").is(\":checked\"))\n\t\tStatusBox.reconnecting(\"blockchain\");\n\telse\n\t\tStatusBox.closed(\"blockchain\");\n\n\tif ($(\"#mtgoxCheckBox\").is(\":checked\"))\n\t\tStatusBox.reconnecting(\"mtgox\");\n\telse\n\t\tStatusBox.closed(\"mtgox\");\n};\n// \"type\" can be either \"blockchain\" or \"mtgox\"\nStatusBox.connected = function(type) {\n\tif (type == \"blockchain\")\n\t\tStatusBox.blockchain.html('Transactions (' + provider_name + '): ' + CONNECTED + '');\n\tif (type == \"mtgox\")\n\t\tStatusBox.mtgox.html('Mt.Gox Trades: ' + CONNECTED + '');\n};\n\nStatusBox.reconnecting = function(type) {\n\tif (type == \"blockchain\")\n\t\tStatusBox.blockchain.html('Transactions (' + provider_name + '): ' + CONNECTING + '');\n\tif (type == \"mtgox\")\n\t\tStatusBox.mtgox.html('Mt.Gox Trades: ' + CONNECTING + '');\n};\n\nStatusBox.nosupport = function(type) {\n\tif (type == \"blockchain\")\n\t\tStatusBox.blockchain.html('Transactions (' + provider_name + '): ' + NO_SUPPORT + '');\n\tif (type == \"mtgox\")\n\t\tStatusBox.mtgox.html('Mt.Gox Trades: ' + NO_SUPPORT + '');\n};\n\nStatusBox.closed = function(type) {\n\tif (type == \"blockchain\")\n\t\tStatusBox.blockchain.html('Transactions (' + provider_name + '): ' + CLOSED + '');\n\tif (type == \"mtgox\")\n\t\tStatusBox.mtgox.html('Mt.Gox Trades: ' + CLOSED + '');\n};\n","/** \n * @constructor\n * @extends Floatable\n */\nfunction Transaction(bitcoins, highlight, currency, currencyName) {\n\tif (document.visibilityState === \"visible\") {\n\t\tFloatable.call(this);\n\n\t\tthis.area = bitcoins * 100 + 3000;\n\t\tthis.width = this.height = Math.sqrt(this.area / Math.PI) * 2;\n\n\t\tthis.addImage(bubbleImage, this.width, this.height);\n\t\n\t var bitcoinVal = bitcoins.toFixed(2);\n\t var bitcoinString;\n\t \n\t if (bitcoinVal === \"0.00\") {\n\t bitcoinString = \"<B0.01\";\n\t } else {\n\t bitcoinString = \"B\" + bitcoinVal;\n\t }\n\t\n\t\tif (!highlight) {\n\t\t\tthis.addText(bitcoinString);\n\t\t} else {\n\t\t\tthis.addText('' + bitcoinString + '
Donation
Thanks!');\n\t\t}\n\t\tif (currency && currencyName) {\n\t\t\tthis.addText('
' + currency.toFixed(2) + ' ' + currencyName);\n\t\t}\n\t\tthis.initPosition();\n\t\t\n\t\t// Sound\n\t var maxBitcoins = 1000;\n\t var minVolume = 0.3;\n\t var maxVolume = 0.7;\n\t var volume = bitcoins / (maxBitcoins / (maxVolume - minVolume)) + minVolume;\n\t if (volume > maxVolume)\n\t\t volume = maxVolume;\n\t\n\t var maxPitch = 100.0;\n\t // We need to use a log that makes it so that maxBitcoins reaches the maximum pitch.\n\t // Well, the opposite of the maximum pitch. Anyway. So we solve:\n\t // maxPitch = log(maxBitcoins + logUsed) / log(logUsed)\n\t // For maxPitch = 100 (for 100%) and maxBitcoins = 1000, that gives us...\n\t var logUsed = 1.0715307808111486871978099;\n\t // So we find the smallest value between log(bitcoins + logUsed) / log(logUsed) and our max pitch...\n\t var pitch = Math.min(maxPitch, Math.log(bitcoins + logUsed) / Math.log(logUsed));\n\t // ...we invert it so that a bigger transaction = a deeper noise...\n\t pitch = maxPitch - pitch;\n\t // ...and we play the sound!\n\t if(globalScalePitch) {\n\t\t Sound.playPitchAtVolume(volume, pitch);\n\t } else {\n\t\t Sound.playRandomAtVolume(volume);\n\t }\n\t \n\t transaction_count++;\n\t \n\t if (transaction_count === 5) {\n\t document.getElementById(\"waitingForTransactions\").style.opacity = \"0\";\n\t }\n\t\t\n\t}\n\n}\n\nextend(Floatable, Transaction);\n","/*\n * Konami-JS ~ \n * :: Now with support for touch events and multiple instances for \n * :: those situations that call for multiple easter eggs!\n * Code: http://konami-js.googlecode.com/\n * Examples: http://www.snaptortoise.com/konami-js\n * Copyright (c) 2009 George Mandis (georgemandis.com, snaptortoise.com)\n * Version: 1.4.2 (9/2/2013)\n * Licensed under the MIT License (http://opensource.org/licenses/MIT)\n * Tested in: Safari 4+, Google Chrome 4+, Firefox 3+, IE7+, Mobile Safari 2.2.1 and Dolphin Browser\n */\n\nvar Konami = function (callback) {\n\tvar konami = {\n\t\taddEvent: function (obj, type, fn, ref_obj) {\n\t\t\tif (obj.addEventListener)\n\t\t\t\tobj.addEventListener(type, fn, false);\n\t\t\telse if (obj.attachEvent) {\n\t\t\t\t// IE\n\t\t\t\tobj[\"e\" + type + fn] = fn;\n\t\t\t\tobj[type + fn] = function () {\n\t\t\t\t\tobj[\"e\" + type + fn](window.event, ref_obj);\n\t\t\t\t}\n\t\t\t\tobj.attachEvent(\"on\" + type, obj[type + fn]);\n\t\t\t}\n\t\t},\n\t\tinput: \"\",\n\t\tpattern: \"38384040373937396665\",\n\t\tload: function (link) {\n\t\t\tthis.addEvent(document, \"keydown\", function (e, ref_obj) {\n\t\t\t\tif (ref_obj) konami = ref_obj; // IE\n\t\t\t\tkonami.input += e ? e.keyCode : event.keyCode;\n\t\t\t\tif (konami.input.length > konami.pattern.length)\n\t\t\t\t\tkonami.input = konami.input.substr((konami.input.length - konami.pattern.length));\n\t\t\t\tif (konami.input == konami.pattern) {\n\t\t\t\t\tkonami.code(link);\n\t\t\t\t\tkonami.input = \"\";\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}, this);\n\t\t\tthis.iphone.load(link);\n\t\t},\n\t\tcode: function (link) {\n\t\t\twindow.location = link\n\t\t},\n\t\tiphone: {\n\t\t\tstart_x: 0,\n\t\t\tstart_y: 0,\n\t\t\tstop_x: 0,\n\t\t\tstop_y: 0,\n\t\t\ttap: false,\n\t\t\tcapture: false,\n\t\t\torig_keys: \"\",\n\t\t\tkeys: [\"UP\", \"UP\", \"DOWN\", \"DOWN\", \"LEFT\", \"RIGHT\", \"LEFT\", \"RIGHT\", \"TAP\", \"TAP\"],\n\t\t\tcode: function (link) {\n\t\t\t\tkonami.code(link);\n\t\t\t},\n\t\t\tload: function (link) {\n\t\t\t\tthis.orig_keys = this.keys;\n\t\t\t\tkonami.addEvent(document, \"touchmove\", function (e) {\n\t\t\t\t\tif (e.touches.length == 1 && konami.iphone.capture == true) {\n\t\t\t\t\t\tvar touch = e.touches[0];\n\t\t\t\t\t\tkonami.iphone.stop_x = touch.pageX;\n\t\t\t\t\t\tkonami.iphone.stop_y = touch.pageY;\n\t\t\t\t\t\tkonami.iphone.tap = false;\n\t\t\t\t\t\tkonami.iphone.capture = false;\n\t\t\t\t\t\tkonami.iphone.check_direction();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tkonami.addEvent(document, \"touchend\", function (evt) {\n\t\t\t\t\tif (konami.iphone.tap == true) konami.iphone.check_direction(link);\n\t\t\t\t}, false);\n\t\t\t\tkonami.addEvent(document, \"touchstart\", function (evt) {\n\t\t\t\t\tkonami.iphone.start_x = evt.changedTouches[0].pageX;\n\t\t\t\t\tkonami.iphone.start_y = evt.changedTouches[0].pageY;\n\t\t\t\t\tkonami.iphone.tap = true;\n\t\t\t\t\tkonami.iphone.capture = true;\n\t\t\t\t});\n\t\t\t},\n\t\t\tcheck_direction: function (link) {\n\t\t\t\tx_magnitude = Math.abs(this.start_x - this.stop_x);\n\t\t\t\ty_magnitude = Math.abs(this.start_y - this.stop_y);\n\t\t\t\tx = ((this.start_x - this.stop_x) < 0) ? \"RIGHT\" : \"LEFT\";\n\t\t\t\ty = ((this.start_y - this.stop_y) < 0) ? \"DOWN\" : \"UP\";\n\t\t\t\tresult = (x_magnitude > y_magnitude) ? x : y;\n\t\t\t\tresult = (this.tap == true) ? \"TAP\" : result;\n\n\t\t\t\tif (result == this.keys[0]) this.keys = this.keys.slice(1, this.keys.length);\n\t\t\t\tif (this.keys.length == 0) {\n\t\t\t\t\tthis.keys = this.orig_keys;\n\t\t\t\t\tthis.code(link);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\ttypeof callback === \"string\" && konami.load(callback);\n\tif (typeof callback === \"function\") {\n\t\tkonami.code = callback;\n\t\tkonami.load();\n\t}\n\n\treturn konami;\n};\n","/*!\n * howler.js v1.1.25\n * howlerjs.com\n *\n * (c) 2013-2014, James Simpson of GoldFire Studios\n * goldfirestudios.com\n *\n * MIT License\n */\n\n(function() {\n // setup\n var cache = {};\n\n // setup the audio context\n var ctx = null,\n usingWebAudio = true,\n noAudio = false;\n try {\n if (typeof AudioContext !== 'undefined') {\n ctx = new AudioContext();\n } else if (typeof webkitAudioContext !== 'undefined') {\n ctx = new webkitAudioContext();\n } else {\n usingWebAudio = false;\n }\n } catch(e) {\n usingWebAudio = false;\n }\n\n if (!usingWebAudio) {\n if (typeof Audio !== 'undefined') {\n try {\n new Audio();\n } catch(e) {\n noAudio = true;\n }\n } else {\n noAudio = true;\n }\n }\n\n // create a master gain node\n if (usingWebAudio) {\n var masterGain = (typeof ctx.createGain === 'undefined') ? ctx.createGainNode() : ctx.createGain();\n masterGain.gain.value = 1;\n masterGain.connect(ctx.destination);\n }\n\n // create global controller\n var HowlerGlobal = function(codecs) {\n this._volume = 1;\n this._muted = false;\n this.usingWebAudio = usingWebAudio;\n this.ctx = ctx;\n this.noAudio = noAudio;\n this._howls = [];\n this._codecs = codecs;\n this.iOSAutoEnable = true;\n };\n HowlerGlobal.prototype = {\n /**\n * Get/set the global volume for all sounds.\n * @param {Float} vol Volume from 0.0 to 1.0.\n * @return {Howler/Float} Returns self or current volume.\n */\n volume: function(vol) {\n var self = this;\n\n // make sure volume is a number\n vol = parseFloat(vol);\n\n if (vol >= 0 && vol <= 1) {\n self._volume = vol;\n\n if (usingWebAudio) {\n masterGain.gain.value = vol;\n }\n\n // loop through cache and change volume of all nodes that are using HTML5 Audio\n for (var key in self._howls) {\n if (self._howls.hasOwnProperty(key) && self._howls[key]._webAudio === false) {\n // loop through the audio nodes\n for (var i=0; i 0) ? node._pos : self._sprite[sprite][0] / 1000;\n\n // determine how long to play for\n var duration = 0;\n if (self._webAudio) {\n duration = self._sprite[sprite][1] / 1000 - node._pos;\n if (node._pos > 0) {\n pos = self._sprite[sprite][0] / 1000 + pos;\n }\n } else {\n duration = self._sprite[sprite][1] / 1000 - (pos - self._sprite[sprite][0] / 1000);\n }\n\n // determine if this sound should be looped\n var loop = !!(self._loop || self._sprite[sprite][2]);\n\n // set timer to fire the 'onend' event\n var soundId = (typeof callback === 'string') ? callback : Math.round(Date.now() * Math.random()) + '',\n timerId;\n (function() {\n var data = {\n id: soundId,\n sprite: sprite,\n loop: loop\n };\n timerId = setTimeout(function() {\n // if looping, restart the track\n if (!self._webAudio && loop) {\n self.stop(data.id).play(sprite, data.id);\n }\n\n // set web audio node to paused at end\n if (self._webAudio && !loop) {\n self._nodeById(data.id).paused = true;\n self._nodeById(data.id)._pos = 0;\n\n // clear the end timer\n self._clearEndTimer(data.id);\n }\n\n // end the track if it is HTML audio and a sprite\n if (!self._webAudio && !loop) {\n self.stop(data.id);\n }\n\n // fire ended event\n self.on('end', soundId);\n }, duration * 1000);\n\n // store the reference to the timer\n self._onendTimer.push({timer: timerId, id: data.id});\n })();\n\n if (self._webAudio) {\n var loopStart = self._sprite[sprite][0] / 1000,\n loopEnd = self._sprite[sprite][1] / 1000;\n\n // set the play id to this node and load into context\n node.id = soundId;\n node.paused = false;\n refreshBuffer(self, [loop, loopStart, loopEnd], soundId);\n self._playStart = ctx.currentTime;\n node.gain.value = self._volume;\n\n if (typeof node.bufferSource.start === 'undefined') {\n node.bufferSource.noteGrainOn(0, pos, duration);\n } else {\n node.bufferSource.start(0, pos, duration);\n }\n } else {\n if (node.readyState === 4 || !node.readyState && navigator.isCocoonJS) {\n node.readyState = 4;\n node.id = soundId;\n node.currentTime = pos;\n node.muted = Howler._muted || node.muted;\n node.volume = self._volume * Howler.volume();\n setTimeout(function() { node.play(); }, 0);\n } else {\n self._clearEndTimer(soundId);\n\n (function(){\n var sound = self,\n playSprite = sprite,\n fn = callback,\n newNode = node;\n var listener = function() {\n sound.play(playSprite, fn);\n\n // clear the event listener\n newNode.removeEventListener('canplaythrough', listener, false);\n };\n newNode.addEventListener('canplaythrough', listener, false);\n })();\n\n return self;\n }\n }\n\n // fire the play event and send the soundId back in the callback\n self.on('play');\n if (typeof callback === 'function') callback(soundId);\n\n return self;\n });\n\n return self;\n },\n\n /**\n * Pause playback and save the current position.\n * @param {String} id (optional) The play instance ID.\n * @return {Howl}\n */\n pause: function(id) {\n var self = this;\n\n // if the sound hasn't been loaded, add it to the event queue\n if (!self._loaded) {\n self.on('play', function() {\n self.pause(id);\n });\n\n return self;\n }\n\n // clear 'onend' timer\n self._clearEndTimer(id);\n\n var activeNode = (id) ? self._nodeById(id) : self._activeNode();\n if (activeNode) {\n activeNode._pos = self.pos(null, id);\n\n if (self._webAudio) {\n // make sure the sound has been created\n if (!activeNode.bufferSource || activeNode.paused) {\n return self;\n }\n\n activeNode.paused = true;\n if (typeof activeNode.bufferSource.stop === 'undefined') {\n activeNode.bufferSource.noteOff(0);\n } else {\n activeNode.bufferSource.stop(0);\n }\n } else {\n activeNode.pause();\n }\n }\n\n self.on('pause');\n\n return self;\n },\n\n /**\n * Stop playback and reset to start.\n * @param {String} id (optional) The play instance ID.\n * @return {Howl}\n */\n stop: function(id) {\n var self = this;\n\n // if the sound hasn't been loaded, add it to the event queue\n if (!self._loaded) {\n self.on('play', function() {\n self.stop(id);\n });\n\n return self;\n }\n\n // clear 'onend' timer\n self._clearEndTimer(id);\n\n var activeNode = (id) ? self._nodeById(id) : self._activeNode();\n if (activeNode) {\n activeNode._pos = 0;\n\n if (self._webAudio) {\n // make sure the sound has been created\n if (!activeNode.bufferSource || activeNode.paused) {\n return self;\n }\n\n activeNode.paused = true;\n\n if (typeof activeNode.bufferSource.stop === 'undefined') {\n activeNode.bufferSource.noteOff(0);\n } else {\n activeNode.bufferSource.stop(0);\n }\n } else if (!isNaN(activeNode.duration)) {\n activeNode.pause();\n activeNode.currentTime = 0;\n }\n }\n\n return self;\n },\n\n /**\n * Mute this sound.\n * @param {String} id (optional) The play instance ID.\n * @return {Howl}\n */\n mute: function(id) {\n var self = this;\n\n // if the sound hasn't been loaded, add it to the event queue\n if (!self._loaded) {\n self.on('play', function() {\n self.mute(id);\n });\n\n return self;\n }\n\n var activeNode = (id) ? self._nodeById(id) : self._activeNode();\n if (activeNode) {\n if (self._webAudio) {\n activeNode.gain.value = 0;\n } else {\n activeNode.muted = true;\n }\n }\n\n return self;\n },\n\n /**\n * Unmute this sound.\n * @param {String} id (optional) The play instance ID.\n * @return {Howl}\n */\n unmute: function(id) {\n var self = this;\n\n // if the sound hasn't been loaded, add it to the event queue\n if (!self._loaded) {\n self.on('play', function() {\n self.unmute(id);\n });\n\n return self;\n }\n\n var activeNode = (id) ? self._nodeById(id) : self._activeNode();\n if (activeNode) {\n if (self._webAudio) {\n activeNode.gain.value = self._volume;\n } else {\n activeNode.muted = false;\n }\n }\n\n return self;\n },\n\n /**\n * Get/set volume of this sound.\n * @param {Float} vol Volume from 0.0 to 1.0.\n * @param {String} id (optional) The play instance ID.\n * @return {Howl/Float} Returns self or current volume.\n */\n volume: function(vol, id) {\n var self = this;\n\n // make sure volume is a number\n vol = parseFloat(vol);\n\n if (vol >= 0 && vol <= 1) {\n self._volume = vol;\n\n // if the sound hasn't been loaded, add it to the event queue\n if (!self._loaded) {\n self.on('play', function() {\n self.volume(vol, id);\n });\n\n return self;\n }\n\n var activeNode = (id) ? self._nodeById(id) : self._activeNode();\n if (activeNode) {\n if (self._webAudio) {\n activeNode.gain.value = vol;\n } else {\n activeNode.volume = vol * Howler.volume();\n }\n }\n\n return self;\n } else {\n return self._volume;\n }\n },\n\n /**\n * Get/set whether to loop the sound.\n * @param {Boolean} loop To loop or not to loop, that is the question.\n * @return {Howl/Boolean} Returns self or current looping value.\n */\n loop: function(loop) {\n var self = this;\n\n if (typeof loop === 'boolean') {\n self._loop = loop;\n\n return self;\n } else {\n return self._loop;\n }\n },\n\n /**\n * Get/set sound sprite definition.\n * @param {Object} sprite Example: {spriteName: [offset, duration, loop]}\n * @param {Integer} offset Where to begin playback in milliseconds\n * @param {Integer} duration How long to play in milliseconds\n * @param {Boolean} loop (optional) Set true to loop this sprite\n * @return {Howl} Returns current sprite sheet or self.\n */\n sprite: function(sprite) {\n var self = this;\n\n if (typeof sprite === 'object') {\n self._sprite = sprite;\n\n return self;\n } else {\n return self._sprite;\n }\n },\n\n /**\n * Get/set the position of playback.\n * @param {Float} pos The position to move current playback to.\n * @param {String} id (optional) The play instance ID.\n * @return {Howl/Float} Returns self or current playback position.\n */\n pos: function(pos, id) {\n var self = this;\n\n // if the sound hasn't been loaded, add it to the event queue\n if (!self._loaded) {\n self.on('load', function() {\n self.pos(pos);\n });\n\n return typeof pos === 'number' ? self : self._pos || 0;\n }\n\n // make sure we are dealing with a number for pos\n pos = parseFloat(pos);\n\n var activeNode = (id) ? self._nodeById(id) : self._activeNode();\n if (activeNode) {\n if (pos >= 0) {\n self.pause(id);\n activeNode._pos = pos;\n self.play(activeNode._sprite, id);\n\n return self;\n } else {\n return self._webAudio ? activeNode._pos + (ctx.currentTime - self._playStart) : activeNode.currentTime;\n }\n } else if (pos >= 0) {\n return self;\n } else {\n // find the first inactive node to return the pos for\n for (var i=0; i= 0 || x < 0) {\n if (self._webAudio) {\n var activeNode = (id) ? self._nodeById(id) : self._activeNode();\n if (activeNode) {\n self._pos3d = [x, y, z];\n activeNode.panner.setPosition(x, y, z);\n activeNode.panner.panningModel = self._model || 'HRTF';\n }\n }\n } else {\n return self._pos3d;\n }\n\n return self;\n },\n\n /**\n * Fade a currently playing sound between two volumes.\n * @param {Number} from The volume to fade from (0.0 to 1.0).\n * @param {Number} to The volume to fade to (0.0 to 1.0).\n * @param {Number} len Time in milliseconds to fade.\n * @param {Function} callback (optional) Fired when the fade is complete.\n * @param {String} id (optional) The play instance ID.\n * @return {Howl}\n */\n fade: function(from, to, len, callback, id) {\n var self = this,\n diff = Math.abs(from - to),\n dir = from > to ? 'down' : 'up',\n steps = diff / 0.01,\n stepTime = len / steps;\n\n // if the sound hasn't been loaded, add it to the event queue\n if (!self._loaded) {\n self.on('load', function() {\n self.fade(from, to, len, callback, id);\n });\n\n return self;\n }\n\n // set the volume to the start position\n self.volume(from, id);\n\n for (var i=1; i<=steps; i++) {\n (function() {\n var change = self._volume + (dir === 'up' ? 0.01 : -0.01) * i,\n vol = Math.round(1000 * change) / 1000,\n toVol = to;\n\n setTimeout(function() {\n self.volume(vol, id);\n\n if (vol === toVol) {\n if (callback) callback();\n }\n }, stepTime * i);\n })();\n }\n },\n\n /**\n * [DEPRECATED] Fade in the current sound.\n * @param {Float} to Volume to fade to (0.0 to 1.0).\n * @param {Number} len Time in milliseconds to fade.\n * @param {Function} callback\n * @return {Howl}\n */\n fadeIn: function(to, len, callback) {\n return this.volume(0).play().fade(0, to, len, callback);\n },\n\n /**\n * [DEPRECATED] Fade out the current sound and pause when finished.\n * @param {Float} to Volume to fade to (0.0 to 1.0).\n * @param {Number} len Time in milliseconds to fade.\n * @param {Function} callback\n * @param {String} id (optional) The play instance ID.\n * @return {Howl}\n */\n fadeOut: function(to, len, callback, id) {\n var self = this;\n\n return self.fade(self._volume, to, len, function() {\n if (callback) callback();\n self.pause(id);\n\n // fire ended event\n self.on('end');\n }, id);\n },\n\n /**\n * Get an audio node by ID.\n * @return {Howl} Audio node.\n */\n _nodeById: function(id) {\n var self = this,\n node = self._audioNode[0];\n\n // find the node with this ID\n for (var i=0; i=0; i--) {\n if (inactive <= 5) {\n break;\n }\n\n if (self._audioNode[i].paused) {\n // disconnect the audio source if using Web Audio\n if (self._webAudio) {\n self._audioNode[i].disconnect(0);\n }\n\n inactive--;\n self._audioNode.splice(i, 1);\n }\n }\n },\n\n /**\n * Clear 'onend' timeout before it ends.\n * @param {String} soundId The play instance ID.\n */\n _clearEndTimer: function(soundId) {\n var self = this,\n index = 0;\n\n // loop through the timers to find the one associated with this sound\n for (var i=0; i= 0) {\n Howler._howls.splice(index, 1);\n }\n\n // delete this sound from the cache\n delete cache[self._src];\n self = null;\n }\n\n };\n\n // only define these functions when using WebAudio\n if (usingWebAudio) {\n\n /**\n * Buffer a sound from URL (or from cache) and decode to audio source (Web Audio API).\n * @param {Object} obj The Howl object for the sound to load.\n * @param {String} url The path to the sound file.\n */\n var loadBuffer = function(obj, url) {\n // check if the buffer has already been cached\n if (url in cache) {\n // set the duration from the cache\n obj._duration = cache[url].duration;\n\n // load the sound into this object\n loadSound(obj);\n return;\n }\n \n if (/^data:[^;]+;base64,/.test(url)) {\n // Decode base64 data-URIs because some browsers cannot load data-URIs with XMLHttpRequest.\n var data = atob(url.split(',')[1]);\n var dataView = new Uint8Array(data.length);\n for (var i=0; i= options.xVal.slice(-1)[0] ){\n\t\t\treturn 100;\n\t\t}\n\n\t\tvar j = 1, va, vb, pa, pb;\n\t\twhile ( value >= options.xVal[j] ){\n\t\t\tj++;\n\t\t}\n\n\t\tva = options.xVal[j-1];\n\t\tvb = options.xVal[j];\n\t\tpa = options.xPct[j-1];\n\t\tpb = options.xPct[j];\n\n\t\treturn pa + (toPercentage([va, vb], value) / subRangeRatio (pa, pb));\n\t}\n\n\t// (value)\n\tfunction fromStepping ( options, value ) {\n\n\t\t// There is no range group that fits 100\n\t\tif ( value >= 100 ){\n\t\t\treturn options.xVal.slice(-1)[0];\n\t\t}\n\n\t\tvar j = 1, va, vb, pa, pb;\n\t\twhile ( value >= options.xPct[j] ){\n\t\t\tj++;\n\t\t}\n\n\t\tva = options.xVal[j-1];\n\t\tvb = options.xVal[j];\n\t\tpa = options.xPct[j-1];\n\t\tpb = options.xPct[j];\n\n\t\treturn isPercentage([va, vb], (value - pa) * subRangeRatio (pa, pb));\n\t}\n\n\t// (percentage) Get the step that applies at a certain value.\n\tfunction getStep ( options, value ){\n\n\t\tvar j = 1, a, b;\n\t\twhile ( value >= options.xPct[j] ){\n\t\t\tj++;\n\t\t}\n\n\t\tif ( options.snap ) {\n\n\t\t\ta = options.xPct[j-1];\n\t\t\tb = options.xPct[j];\n\n\t\t\tif ((value - a) > ((b-a)/2)){\n\t\t\t\treturn b;\n\t\t\t}\n\n\t\t\treturn a;\n\t\t}\n\n\t\tif ( !options.xSteps[j-1] ){\n\t\t\treturn value;\n\t\t}\n\n\t\treturn options.xPct[j-1] + closest(\n\t\t\tvalue - options.xPct[j-1],\n\t\t\toptions.xSteps[j-1]\n\t\t);\n\t}\n\n\n// Event handling\n\n\t// Provide a clean event with standardized offset values.\n\tfunction fixEvent ( e ) {\n\n\t\t// Prevent scrolling and panning on touch events, while\n\t\t// attempting to slide. The tap event also depends on this.\n\t\te.preventDefault();\n\n\t\t// Filter the event to register the type, which can be\n\t\t// touch, mouse or pointer. Offset changes need to be\n\t\t// made on an event specific basis.\n\t\tvar touch = e.type.indexOf('touch') === 0\n\t\t\t,mouse = e.type.indexOf('mouse') === 0\n\t\t\t,pointer = e.type.indexOf('pointer') === 0\n\t\t\t,x,y, event = e;\n\n\t\t// IE10 implemented pointer events with a prefix;\n\t\tif ( e.type.indexOf('MSPointer') === 0 ) {\n\t\t\tpointer = true;\n\t\t}\n\n\t\t// Get the originalEvent, if the event has been wrapped\n\t\t// by jQuery. Zepto doesn't wrap the event.\n\t\tif ( e.originalEvent ) {\n\t\t\te = e.originalEvent;\n\t\t}\n\n\t\tif ( touch ) {\n\t\t\t// noUiSlider supports one movement at a time,\n\t\t\t// so we can select the first 'changedTouch'.\n\t\t\tx = e.changedTouches[0].pageX;\n\t\t\ty = e.changedTouches[0].pageY;\n\t\t}\n\n\t\tif ( mouse || pointer ) {\n\n\t\t\t// Polyfill the pageXOffset and pageYOffset\n\t\t\t// variables for IE7 and IE8;\n\t\t\tif( !pointer && window.pageXOffset === undefined ){\n\t\t\t\twindow.pageXOffset = document.documentElement.scrollLeft;\n\t\t\t\twindow.pageYOffset = document.documentElement.scrollTop;\n\t\t\t}\n\n\t\t\tx = e.clientX + window.pageXOffset;\n\t\t\ty = e.clientY + window.pageYOffset;\n\t\t}\n\n\t\tevent.points = [x, y];\n\t\tevent.cursor = mouse;\n\n\t\treturn event;\n\t}\n\n\n// Organize formatting in an object.\n\n\t/** @constructor */\n\tfunction Format( options ){\n\n\t\t// If no settings where provided, the defaults will be loaded.\n\t\tif ( options === undefined ){\n\t\t\toptions = {};\n\t\t}\n\n\t\tif ( typeof options !== 'object' ){\n\t\t\tthrowError(\"(Format) 'format' option must be an object.\");\n\t\t}\n\n\t\tvar settings = {};\n\n\t\t// Copy all values into a new object.\n\t\t$(Formatting).each(function(i, val){\n\n\t\t\tif ( options[val] === undefined ){\n\n\t\t\t\tsettings[val] = FormatDefaults[i];\n\n\t\t\t// When we aren't loading defaults, validate the entry.\n\t\t\t} else if ( typeMatch(options[val], FormatDefaults[i]) ) {\n\n\t\t\t\t// Support for up to 7 decimals.\n\t\t\t\t// More can't be guaranteed due to floating point issues.\n\t\t\t\tif ( val === 'decimals' ){\n\t\t\t\t\tif ( options[val] < 0 || options[val] > 7 ){\n\t\t\t\t\t\tthrowError(\"(Format) 'format.decimals' option must be between 0 and 7.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tsettings[val] = options[val];\n\n\t\t\t// If the value isn't valid, emit an error.\n\t\t\t} else {\n\t\t\t\tthrowError(\"(Format) 'format.\"+val+\"' must be a \" + typeof FormatDefaults[i] + \".\");\n\t\t\t}\n\t\t});\n\n\t\t// Some values can't be extracted from a\n\t\t// string if certain combinations are present.\n\t\tthrowEqualError(settings, 'mark', 'thousand');\n\t\tthrowEqualError(settings, 'prefix', 'negative');\n\t\tthrowEqualError(settings, 'prefix', 'negativeBefore');\n\n\t\tthis.settings = settings;\n\t}\n\n\t// Shorthand for internal value get\n\tFormat.prototype.v = function ( a ) {\n\t\treturn this.settings[a];\n\t};\n\n\tFormat.prototype.to = function ( number ) {\n\n\t\tfunction reverse ( a ) {\n\t\t\treturn a.split('').reverse().join('');\n\t\t}\n\n\t\tnumber = this.v('encoder')( number );\n\n\t\tvar negative = '', preNegative = '', base = '', mark = '';\n\n\t\tif ( number < 0 ) {\n\t\t\tnegative = this.v('negative');\n\t\t\tpreNegative = this.v('negativeBefore');\n\t\t}\n\n\t\t// Round to proper decimal count\n\t\tnumber = Math.abs(number).toFixed( this.v('decimals') ).toString();\n\t\tnumber = number.split('.');\n\n\t\t// Rounding away decimals might cause a value of -0\n\t\t// when using very small ranges. Remove those cases.\n\t\tif ( parseFloat(number) === 0 ) {\n\t\t\tnumber[0] = '0';\n\t\t}\n\n\t\t// Group numbers in sets of three.\n\t\tif ( this.v('thousand') ) {\n\t\t\tbase = reverse(number[0]).match(/.{1,3}/g);\n\t\t\tbase = reverse(base.join(reverse( this.v('thousand') )));\n\t\t} else {\n\t\t\tbase = number[0];\n\t\t}\n\n\t\t// Ignore the decimal separator if decimals are set to 0.\n\t\tif ( this.v('mark') && number.length > 1 ) {\n\t\t\tmark = this.v('mark') + number[1];\n\t\t}\n\n\t\t// Return the finalized formatted number.\n\t\treturn preNegative +\n\t\t\tthis.v('prefix') +\n\t\t\tnegative +\n\t\t\tbase +\n\t\t\tmark +\n\t\t\tthis.v('postfix');\n\t};\n\n\tFormat.prototype.from = function ( input ) {\n\n\t\tfunction esc(s){\n\t\t\treturn s.replace(/[\\-\\/\\\\\\^$*+?.()|\\[\\]{}]/g, '\\\\$&');\n\t\t}\n\n\t\tvar isNeg;\n\t\t// The set request might want to ignore this handle.\n\t\t// Test for 'undefined' too, as a two-handle slider\n\t\t// can still be set with an integer.\n\t\tif( input === null || input === undefined ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Remove formatting and set period for float parsing.\n\t\tinput = input.toString();\n\n\t\t// Replace the preNegative indicator.\n\t\tisNeg = input.replace(new RegExp('^' + esc( this.v('negativeBefore') )), '');\n\n\t\t// Check if the value changed by removing the negativeBefore symbol.\n\t\tif( input !== isNeg ) {\n\t\t\tinput = isNeg;\n\t\t\tisNeg = '-';\n\t\t} else {\n\t\t\tisNeg = '';\n\t\t}\n\n\t\t// If prefix is set and the number is actually prefixed.\n\t\tinput = input.replace(new RegExp('^'+esc( this.v('prefix') )), '');\n\n\t\t// Only replace if a negative sign is set.\n\t\tif ( this.v['negative'] ) {\n\n\t\t\t// Reset isNeg to prevent double '-' insertion.\n\t\t\tisNeg = '';\n\n\t\t\t// Reset the negative sign to '-'\n\t\t\tinput = input.replace(new RegExp('^'+esc( this.v('negative') )), '-');\n\t\t}\n\n\t\t// Clean the input string\n\t\tinput = input\n\t\t// If postfix is set and the number is postfixed.\n\t\t\t.replace( new RegExp(esc( this.v('postfix') ) + '$'), '')\n\t\t// Remove the separator every three digits.\n\t\t\t.replace( new RegExp(esc( this.v('thousand') ), 'g'), '')\n\t\t// Set the decimal separator back to period.\n\t\t\t.replace( this.v('mark'), '.');\n\n\t\t// Run the user defined decoder. Returns input by default.\n\t\tinput = this.v('decoder')( parseFloat( isNeg + input ) );\n\n\t\t// Ignore invalid input\n\t\tif (isNaN( input )) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn input;\n\t};\n\n\n// Serialization target\n\n/** @constructor */\n\tfunction Link( entry, update ){\n\n\t\t// Make sure Link isn't called as a function, in which case\n\t\t// the 'this' scope would be the window.\n\t\tif ( !(this instanceof Link) ) {\n\t\t\tthrow new Error( \"Link: \" +\n\t\t\t\t\"Don't use Link as a function. \" +\n\t\t\t\t\"Use the 'new' keyword.\");\n\t\t}\n\n\t\tif ( !entry ) {\n\t\t\tthrow new RangeError(\"Link: missing parameters.\");\n\t\t}\n\n\t\t// Write all formatting to this object.\n\t\t// No validation needed, as we'll merge these with the parent\n\t\t// format options first.\n\t\tthis.formatting = entry['format'] || {};\n\n\t\t// Store the update option.\n\t\tthis.update = !update;\n\n\t\t// In IE < 9, .bind() isn't available, need this link in .change().\n\tvar that = this,\n\n\t\t// Get values from the input.\n\t\ttarget = entry['target'] || function(){},\n\t\tmethod = entry['method'],\n\n\t\t// Find the type of this link.\n\t\tisTooltip = ( typeof target === 'string' && target.indexOf('-tooltip-') === 0 ),\n\t\tisHidden = ( typeof target === 'string' && target.indexOf('-') !== 0 ),\n\t\tisMethod = ( typeof target === 'function' ),\n\t\tis$ = ( isInstance(target) ),\n\t\tisInput = ( is$ && target.is('input, select, textarea') ),\n\t\tmethodIsFunction = ( is$ && typeof method === 'function' ),\n\t\tmethodIsName = ( is$ && typeof method === 'string' && target[method] );\n\n\t\t// If target is a string, a new hidden input will be created.\n\t\tif ( isTooltip ) {\n\n\t\t\t// By default, use the 'html' method.\n\t\t\tthis.method = method || 'html';\n\n\t\t\t// Use jQuery to create the element\n\t\t\tthis.el = $( target.replace('-tooltip-', '') || '
' )[0];\n\n\t\t\treturn;\n\t\t}\n\n\t\t// If the string doesn't begin with '-', which is reserved, add a new hidden input.\n\t\tif ( isHidden ) {\n\n\t\t\tthis.method = 'val';\n\n\t\t\tthis.el = document.createElement('input');\n\t\t\tthis.el.name = target;\n\t\t\tthis.el.type = 'hidden';\n\n\t\t\treturn;\n\t\t}\n\n\t\t// The target can also be a function, which will be called.\n\t\tif ( isMethod ) {\n\t\t\tthis.target = false;\n\t\t\tthis.method = target;\n\t\t\treturn;\n\t\t}\n\n\t\t// If the target is and $ element.\n\t\tif ( is$ ) {\n\n\t\t\t// The method must exist on the element.\n\t\t\tif ( method && ( methodIsFunction || methodIsName ) ) {\n\t\t\t\tthis.target = target;\n\t\t\t\tthis.method = method;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a jQuery/Zepto input element is provided, but no method is set,\n\t\t\t// the element can assume it needs to respond to 'change'...\n\t\t\tif ( !method && isInput ) {\n\n\t\t\t\t// Default to .val if this is an input element.\n\t\t\t\tthis.method = 'val';\n\t\t\t\tthis.target = target;\n\n\t\t\t\t// Set the slider to a new value on change.\n\t\t\t\tthis.target.on('change', function( e ){\n\n\t\t\t\t\t// Returns null array.\n\t\t\t\t\tfunction at(a,b,c){\n\t\t\t\t\t\treturn [c?a:b, c?b:a];\n\t\t\t\t\t}\n\n\t\t\t\t\tvar output = at(null, $(e.target).val(), that.N);\n\n\t\t\t\t\tthat.obj.val(output, { 'link': that });\n\t\t\t\t});\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// ... or not.\n\t\t\tif ( !method && !isInput ) {\n\n\t\t\t\t// Default arbitrarily to 'html'.\n\t\t\t\tthis.method = 'html';\n\t\t\t\tthis.target = target;\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tthrow new RangeError(\"Link: Invalid Link.\");\n\t}\n\n\t// Provides external items with the slider value.\n\tLink.prototype.write = function ( options, value, handle, slider, update ) {\n\n\t\t// Don't synchronize this Link.\n\t\tif ( this.update && update === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Convert the value to the slider stepping/range.\n\t\tvalue = fromStepping( options, value );\n\n\t\t// Format values for display.\n\t\tvalue = this.format( value );\n\n\t\t// Store the numerical value.\n\t\tthis.saved = value;\n\n\t\t// Branch between serialization to a function or an object.\n\t\tif ( typeof this.method === 'function' ) {\n\t\t\t// When target is undefined, the target was a function.\n\t\t\t// In that case, provided the slider as the calling scope.\n\t\t\t// Use [0] to get the DOM element, not the $ instance.\n\t\t\tthis.method.call( this.target[0] || slider[0], value, handle, slider );\n\t\t} else {\n\t\t\tthis.target[ this.method ]( value, handle, slider );\n\t\t}\n\t};\n\n\t// Parses slider value to user defined display.\n\tLink.prototype.format = function ( a ) {\n\t\treturn this.formatting.to(a);\n\t};\n\n\t// Converts a formatted value back to a real number.\n\tLink.prototype.valueOf = function ( a ) {\n\t\treturn this.formatting.from(a);\n\t};\n\n\n// Input validation\n\n\tfunction testStep ( parsed, entry ) {\n\n\t\tif ( !isNumeric( entry ) ) {\n\t\t\tthrowError(\"'step' is not numeric.\");\n\t\t}\n\n\t\t// The step option can still be used to set stepping\n\t\t// for linear sliders. Overwritten if set in 'range'.\n\t\tparsed.xSteps[0] = entry;\n\t}\n\n\tfunction testRange ( parsed, entry ) {\n\n\t\t// Filter incorrect input.\n\t\tif ( typeof entry !== 'object' || $.isArray(entry) ) {\n\t\t\tthrowError(\"'range' is not an object.\");\n\t\t}\n\n\t\t// Loop all entries.\n\t\t$.each( entry, function ( index, value ) {\n\n\t\t\tvar percentage;\n\n\t\t\t// Wrap numerical input in an array.\n\t\t\tif ( typeof value === \"number\" ) {\n\t\t\t\tvalue = [value];\n\t\t\t}\n\n\t\t\t// Reject any invalid input.\n\t\t\tif ( !$.isArray( value ) ){\n\t\t\t\tthrowError(\"'range' contains invalid value.\");\n\t\t\t}\n\n\t\t\t// Covert min/max syntax to 0 and 100.\n\t\t\tif ( index === 'min' ) {\n\t\t\t\tpercentage = 0;\n\t\t\t} else if ( index === 'max' ) {\n\t\t\t\tpercentage = 100;\n\t\t\t} else {\n\t\t\t\tpercentage = parseFloat( index );\n\t\t\t}\n\n\t\t\t// Check for correct input.\n\t\t\tif ( !isNumeric( percentage ) || !isNumeric( value[0] ) ) {\n\t\t\t\tthrowError(\"'range' value isn't numeric.\");\n\t\t\t}\n\n\t\t\t// Store values.\n\t\t\tparsed.xPct.push( percentage );\n\t\t\tparsed.xVal.push( value[0] );\n\n\t\t\t// NaN will evaluate to false too, but to keep\n\t\t\t// logging clear, set step explicitly. Make sure\n\t\t\t// not to override the 'step' setting with false.\n\t\t\tif ( !percentage ) {\n\t\t\t\tif ( !isNaN( value[1] ) ) {\n\t\t\t\t\tparsed.xSteps[0] = value[1];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tparsed.xSteps.push( isNaN(value[1]) ? false : value[1] );\n\t\t\t}\n\t\t});\n\n\t\t$.each(parsed.xSteps, function(i,n){\n\n\t\t\t// Ignore 'false' stepping.\n\t\t\tif ( !n ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// Check if step fits. Not required, but this might serve some goal.\n\t\t\t// !((parsed.xVal[i+1] - parsed.xVal[i]) % n);\n\n\t\t\t// Factor to range ratio\n\t\t\tparsed.xSteps[i] = fromPercentage([\n\t\t\t\t parsed.xVal[i]\n\t\t\t\t,parsed.xVal[i+1]\n\t\t\t], n) / subRangeRatio (\n\t\t\t\tparsed.xPct[i],\n\t\t\t\tparsed.xPct[i+1] );\n\t\t});\n\t}\n\n\tfunction testStart ( parsed, entry ) {\n\n\t\tif ( typeof entry === \"number\" ) {\n\t\t\tentry = [entry];\n\t\t}\n\n\t\t// Validate input. Values aren't tested, the internal Link will do\n\t\t// that and provide a valid location.\n\t\tif ( !$.isArray( entry ) || !entry.length || entry.length > 2 ) {\n\t\t\tthrowError(\"'start' option is incorrect.\");\n\t\t}\n\n\t\t// Store the number of handles.\n\t\tparsed.handles = entry.length;\n\n\t\t// When the slider is initialized, the .val method will\n\t\t// be called with the start options.\n\t\tparsed.start = entry;\n\t}\n\n\tfunction testSnap ( parsed, entry ) {\n\n\t\t// Enforce 100% stepping within subranges.\n\t\tparsed.snap = entry;\n\n\t\tif ( typeof entry !== 'boolean' ){\n\t\t\tthrowError(\"'snap' option must be a boolean.\");\n\t\t}\n\t}\n\n\tfunction testConnect ( parsed, entry ) {\n\n\t\tif ( entry === 'lower' && parsed.handles === 1 ) {\n\t\t\tparsed.connect = 1;\n\t\t} else if ( entry === 'upper' && parsed.handles === 1 ) {\n\t\t\tparsed.connect = 2;\n\t\t} else if ( entry === true && parsed.handles === 2 ) {\n\t\t\tparsed.connect = 3;\n\t\t} else if ( entry === false ) {\n\t\t\tparsed.connect = 0;\n\t\t} else {\n\t\t\tthrowError(\"'connect' option was doesn't match handle count.\");\n\t\t}\n\t}\n\n\tfunction testOrientation ( parsed, entry ) {\n\n\t\t// Set orientation to an a numerical value for easy\n\t\t// array selection.\n\t\tswitch ( entry ){\n\t\t case 'horizontal':\n\t\t\tparsed.ort = 0;\n\t\t\tbreak;\n\t\t case 'vertical':\n\t\t\tparsed.ort = 1;\n\t\t\tbreak;\n\t\t default:\n\t\t\tthrowError(\"'orientation' option is invalid.\");\n\t\t}\n\t}\n\n\tfunction testMargin ( parsed, entry ) {\n\n\t\tif ( parsed.xPct.length > 2 ) {\n\t\t\tthrowError(\"'margin' option is only supported on linear sliders.\");\n\t\t}\n\n\t\t// Parse value to range and store. As xVal is checked\n\t\t// to be no bigger than 2, use it as range.\n\t\tparsed.margin = fromPercentage(parsed.xVal, entry);\n\n\t\tif ( !isNumeric(entry) ){\n\t\t\tthrowError(\"'margin' option must be numeric.\");\n\t\t}\n\t}\n\n\tfunction testDirection ( parsed, entry ) {\n\n\t\t// Set direction as a numerical value for easy parsing.\n\t\t// Invert connection for RTL sliders, so that the proper\n\t\t// handles get the connect/background classes.\n\t\tswitch ( entry ) {\n\t\t case 'ltr':\n\t\t\tparsed.dir = 0;\n\t\t\tbreak;\n\t\t case 'rtl':\n\t\t\tparsed.dir = 1;\n\t\t\tparsed.connect = [0,2,1,3][parsed.connect];\n\t\t\tbreak;\n\t\t default:\n\t\t\tthrowError(\"'direction' option was not recognized.\");\n\t\t}\n\t}\n\n\tfunction testBehaviour ( parsed, entry ) {\n\n\t\t// Make sure the input is a string.\n\t\tif ( typeof entry !== 'string' ) {\n\t\t\tthrowError(\"'behaviour' must be a string containing options.\");\n\t\t}\n\n\t\t// Check if the string contains any keywords.\n\t\t// None are required.\n\t\tvar tap = entry.indexOf('tap') >= 0,\n\t\t\textend = entry.indexOf('extend') >= 0,\n\t\t\tdrag = entry.indexOf('drag') >= 0,\n\t\t\tfixed = entry.indexOf('fixed') >= 0,\n\t\t\tsnap = entry.indexOf('snap') >= 0;\n\n\t\tparsed.events = {\n\t\t\ttap: tap || snap,\n\t\t\textend: extend,\n\t\t\tdrag: drag,\n\t\t\tfixed: fixed,\n\t\t\tsnap: snap\n\t\t};\n\t}\n\n\tfunction testSerialization ( parsed, entry, sliders ) {\n\n\t\tparsed.ser = [ entry['lower'], entry['upper'] ];\n\t\tparsed.formatting = new Format( entry['format'] );\n\n\t\t$.each( parsed.ser, function( i, a ){\n\n\t\t\t// Check if the provided option is an array.\n\t\t\tif ( !$.isArray(a) ) {\n\t\t\t\tthrowError(\"'serialization.\"+(!i?'lower':'upper')+\"' must be an array.\");\n\t\t\t}\n\n\t\t\t$.each(a, function(){\n\n\t\t\t\t// Check if entry is a Link.\n\t\t\t\tif ( !(this instanceof Link) ) {\n\t\t\t\t\tthrowError(\"'serialization.\"+(!i?'lower':'upper')+\"' can only contain Link instances.\");\n\t\t\t\t}\n\n\t\t\t\t// Assign other properties.\n\t\t\t\tthis.N = i;\n\t\t\t\tthis.obj = sliders;\n\t\t\t\tthis.scope = this.scope || sliders;\n\n\t\t\t\t// Run internal validator.\n\t\t\t\tthis.formatting = new Format($.extend({}\n\t\t\t\t\t,entry['format']\n\t\t\t\t\t,this.formatting\n\t\t\t\t));\n\t\t\t});\n\t\t});\n\n\t\t// If the slider has two handles and is RTL,\n\t\t// reverse the serialization input. For one handle,\n\t\t// lower is still lower.\n\t\tif ( parsed.dir && parsed.handles > 1 ) {\n\t\t\tparsed.ser.reverse();\n\t\t}\n\t}\n\n\t// Test all developer settings and parse to assumption-safe values.\n\tfunction test ( options, sliders ){\n\n\t/*\tEvery input option is tested and parsed. This'll prevent\n\t\tendless validation in internal methods. These tests are\n\t\tstructured with an item for every option available. An\n\t\toption can be marked as required by setting the 'r' flag.\n\t\tThe testing function is provided with three arguments:\n\t\t\t- The provided value for the option;\n\t\t\t- A reference to the options object;\n\t\t\t- The name for the option;\n\n\t\tThe testing function returns false when an error is detected,\n\t\tor true when everything is OK. It can also modify the option\n\t\tobject, to make sure all values can be correctly looped elsewhere. */\n\n\t\tvar parsed = {\n\t\t\t xPct: []\n\t\t\t,xVal: []\n\t\t\t,xSteps: [ false ]\n\t\t\t,margin: 0\n\t\t}, tests;\n\n\t\ttests = {\n\t\t\t'step': { r: false, t: testStep },\n\t\t\t'range': { r: true, t: testRange },\n\t\t\t'start': { r: true, t: testStart },\n\t\t\t'snap': { r: false, t: testSnap },\n\t\t\t'connect': { r: true, t: testConnect },\n\t\t\t'orientation': { r: false, t: testOrientation },\n\t\t\t'margin': { r: false, t: testMargin },\n\t\t\t'direction': { r: true, t: testDirection },\n\t\t\t'behaviour': { r: true, t: testBehaviour },\n\t\t\t'serialization': { r: true, t: testSerialization }\n\t\t};\n\n\t\t// Set defaults where applicable.\n\t\toptions = $.extend({\n\t\t\t 'connect': false\n\t\t\t,'direction': 'ltr'\n\t\t\t,'behaviour': 'tap'\n\t\t\t,'orientation': 'horizontal'\n\t\t}, options);\n\n\t\t// Make sure the test for serialization runs.\n\t\toptions['serialization'] = $.extend({\n\t\t\t 'lower': []\n\t\t\t,'upper': []\n\t\t\t,'format': {}\n\t\t}, options['serialization']);\n\n\t\t// Run all options through a testing mechanism to ensure correct\n\t\t// input. It should be noted that options might get modified to\n\t\t// be handled properly. E.g. wrapping integers in arrays.\n\t\t$.each( tests, function( name, test ){\n\n\t\t\tif ( options[name] === undefined ) {\n\t\t\t\tif ( test.r ) {\n\t\t\t\t\tthrowError(\"'\" + name + \"' is required.\");\n\t\t\t\t} else {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttest.t( parsed, options[name], sliders );\n\t\t});\n\n\t\t// Pre-define the styles.\n\t\tparsed.style = parsed.ort ? 'top' : 'left';\n\n\t\treturn parsed;\n\t}\n\n\n// DOM additions\n\n\t// Append a handle to the base.\n\tfunction addHandle ( options, index ) {\n\n\t\tvar handle = $('
').addClass( Classes[2] ),\n\t\t\tadditions = [ '-lower', '-upper' ];\n\n\t\tif ( options.dir ) {\n\t\t\tadditions.reverse();\n\t\t}\n\n\t\thandle.children().addClass(\n\t\t\tClasses[3] + \" \" + Classes[3]+additions[index]\n\t\t);\n\n\t\treturn handle;\n\t}\n\n\t// Create a copy of an element-creating Link.\n\tfunction addElement ( handle, link ) {\n\n\t\t// If the Link requires creation of a new element,\n\t\t// create this element and return a new Link instance.\n\t\tif ( link.el ) {\n\t\t\tlink = new Link({\n\t\t\t\t'target': $(link.el).clone().appendTo( handle ),\n\t\t\t\t'method': link.method,\n\t\t\t\t'format': link.formatting\n\t\t\t}, true);\n\t\t}\n\n\t\t// Otherwise, return the reference.\n\t\treturn link;\n\t}\n\n\t// Loop all links for a handle.\n\tfunction addElements ( elements, handle, formatting ) {\n\n\t\tvar index, list = [];\n\n\t\t// Use the Link interface to provide unified\n\t\t// formatting for the .val() method.\n\t\tlist.push(\n\t\t\tnew Link({\n\t\t\t\t'format': formatting\n\t\t\t}, true)\n\t\t);\n\n\t\t// Loop all links in either 'lower' or 'upper'.\n\t\tfor ( index = 0; index < elements.length; index++ ) {\n\t\t\tlist.push(addElement(handle, elements[index]));\n\t\t}\n\n\t\treturn list;\n\t}\n\n\t// Go over all Links and assign them to a handle.\n\tfunction addLinks ( options, handles ) {\n\n\t\tvar index, links = [];\n\n\t\t// Copy the links into a new array, instead of modifying\n\t\t// the 'options.ser' list. This allows replacement of the invalid\n\t\t// '.el' Links, while the others are still passed by reference.\n\t\tfor ( index = 0; index < options.handles; index++ ) {\n\n\t\t\t// Append a new array.\n\t\t\tlinks[index] = addElements(\n\t\t\t\toptions.ser[index],\n\t\t\t\thandles[index].children(),\n\t\t\t\toptions.formatting\n\t\t\t);\n\t\t}\n\n\t\treturn links;\n\t}\n\n\t// Add the proper connection classes.\n\tfunction addConnection ( connect, target, handles ) {\n\n\t\t// Apply the required connection classes to the elements\n\t\t// that need them. Some classes are made up for several\n\t\t// segments listed in the class list, to allow easy\n\t\t// renaming and provide a minor compression benefit.\n\t\tswitch ( connect ) {\n\t\t\tcase 1:\ttarget.addClass( Classes[7] );\n\t\t\t\t\thandles[0].addClass( Classes[6] );\n\t\t\t\t\tbreak;\n\t\t\tcase 3: handles[1].addClass( Classes[6] );\n\t\t\t\t\t/* falls through */\n\t\t\tcase 2: handles[0].addClass( Classes[7] );\n\t\t\t\t\t/* falls through */\n\t\t\tcase 0: target.addClass(Classes[6]);\n\t\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Add handles and loop Link elements.\n\tfunction addHandles ( options, base ) {\n\n\t\tvar index, handles = [];\n\n\t\t// Append handles.\n\t\tfor ( index = 0; index < options.handles; index++ ) {\n\n\t\t\t// Keep a list of all added handles.\n\t\t\thandles.push( addHandle( options, index ).appendTo(base) );\n\t\t}\n\n\t\treturn handles;\n\t}\n\n\t// Initialize a single slider.\n\tfunction addSlider ( options, target ) {\n\n\t\t// Apply classes and data to the target.\n\t\ttarget.addClass([\n\t\t\tClasses[0],\n\t\t\tClasses[8 + options.dir],\n\t\t\tClasses[4 + options.ort]\n\t\t].join(' '));\n\n\t\treturn $('
').appendTo(target).addClass( Classes[1] );\n\t}\n\n\n// Slider scope\n\nfunction closure ( target, options, originalOptions ){\n\n// Internal variables\n\n\t// All variables local to 'closure' are marked $.\n\tvar $Target = $(target),\n\t\t$Locations = [-1, -1],\n\t\t$Base,\n\t\t$Serialization,\n\t\t$Handles;\n\n\t// Shorthand for base dimensions.\n\tfunction baseSize ( ) {\n\t\treturn $Base[['width', 'height'][options.ort]]();\n\t}\n\n\n// External event handling\n\n\tfunction fireEvents ( events ) {\n\n\t\t// Use the external api to get the values.\n\t\t// Wrap the values in an array, as .trigger takes\n\t\t// only one additional argument.\n\t\tvar index, values = [ $Target.val() ];\n\n\t\tfor ( index = 0; index < events.length; index++ ){\n\t\t\t$Target.trigger(events[index], values);\n\t\t}\n\t}\n\n\n// Handle placement\n\n\t// Test suggested values and apply margin, step.\n\tfunction setHandle ( handle, to, delimit ) {\n\n\t\tvar n = handle[0] !== $Handles[0][0] ? 1 : 0,\n\t\t\tlower = $Locations[0] + options.margin,\n\t\t\tupper = $Locations[1] - options.margin;\n\n\t\t// Don't delimit range dragging.\n\t\tif ( delimit && $Handles.length > 1 ) {\n\t\t\tto = n ? Math.max( to, lower ) : Math.min( to, upper );\n\t\t}\n\n\t\t// Handle the step option.\n\t\tif ( to < 100 ){\n\t\t\tto = getStep(options, to);\n\t\t}\n\n\t\t// Limit to 0/100 for .val input, trim anything beyond 7 digits, as\n\t\t// JavaScript has some issues in its floating point implementation.\n\t\tto = limit(parseFloat(to.toFixed(7)));\n\n\t\t// Return falsy if handle can't move. False for 0 or 100 limit,\n\t\t// '0' for limiting by another handle.\n\t\tif ( to === $Locations[n] ) {\n\t\t\tif ( $Handles.length === 1 ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn ( to === lower || to === upper ) ? 0 : false;\n\t\t}\n\n\t\t// Set the handle to the new position.\n\t\thandle.css( options.style, to + '%' );\n\n\t\t// Force proper handle stacking\n\t\tif ( handle.is(':first-child') ) {\n\t\t\thandle.toggleClass(Classes[17], to > 50 );\n\t\t}\n\n\t\t// Update locations.\n\t\t$Locations[n] = to;\n\n\t\t// Invert the value if this is a right-to-left slider.\n\t\tif ( options.dir ) {\n\t\t\tto = 100 - to;\n\t\t}\n\n\t\t// Write values to serialization Links.\n\t\t// Convert the value to the correct relative representation.\n\t\t$($Serialization[n]).each(function(){\n\t\t\tthis.write( options, to, handle.children(), $Target );\n\t\t});\n\n\t\treturn true;\n\t}\n\n\t// Delimit proposed values for handle positions.\n\tfunction getPositions ( a, b, delimit ) {\n\n\t\t// Add movement to current position.\n\t\tvar c = a + b[0], d = a + b[1];\n\n\t\t// Only alter the other position on drag,\n\t\t// not on standard sliding.\n\t\tif ( delimit ) {\n\t\t\tif ( c < 0 ) {\n\t\t\t\td += Math.abs(c);\n\t\t\t}\n\t\t\tif ( d > 100 ) {\n\t\t\t\tc -= ( d - 100 );\n\t\t\t}\n\n\t\t\t// Limit values to 0 and 100.\n\t\t\treturn [limit(c), limit(d)];\n\t\t}\n\n\t\treturn [c,d];\n\t}\n\n\t// Handles movement by tapping.\n\tfunction jump ( handle, to, instant ) {\n\n\t\tif ( !instant ) {\n\t\t\t// Flag the slider as it is now in a transitional state.\n\t\t\t// Transition takes 300 ms, so re-enable the slider afterwards.\n\t\t\taddClassFor( $Target, Classes[14], 300 );\n\t\t}\n\n\t\t// Move the handle to the new position.\n\t\tsetHandle( handle, to, false );\n\n\t\tfireEvents(['slide', 'set', 'change']);\n\t}\n\n\n// Events\n\n\t// Handler for attaching events trough a proxy.\n\tfunction attach ( events, element, callback, data ) {\n\n\t\t// Add the noUiSlider namespace to all events.\n\t\tevents = events.replace( /\\s/g, namespace + ' ' ) + namespace;\n\n\t\t// Bind a closure on the target.\n\t\treturn element.on( events, function( e ){\n\n\t\t\t// jQuery and Zepto handle unset attributes differently.\n\t\t\tvar disabled = $Target.attr('disabled');\n\t\t\t\tdisabled = !( disabled === undefined || disabled === null );\n\n\t\t\t// Test if there is anything that should prevent an event\n\t\t\t// from being handled, such as a disabled state or an active\n\t\t\t// 'tap' transition.\n\t\t\tif( $Target.hasClass( Classes[14] ) || disabled ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\te = fixEvent(e);\n\t\t\te.calcPoint = e.points[ options.ort ];\n\n\t\t\t// Call the event handler with the event [ and additional data ].\n\t\t\tcallback ( e, data );\n\t\t});\n\t}\n\n\t// Handle movement on document for handle and range drag.\n\tfunction move ( event, data ) {\n\n\t\tvar handles = data.handles || $Handles, positions, state = false,\n\t\t\tproposal = ((event.calcPoint - data.start) * 100) / baseSize(),\n\t\t\th = handles[0][0] !== $Handles[0][0] ? 1 : 0;\n\n\t\t// Calculate relative positions for the handles.\n\t\tpositions = getPositions( proposal, data.positions, handles.length > 1);\n\n\t\tstate = setHandle ( handles[0], positions[h], handles.length === 1 );\n\n\t\tif ( handles.length > 1 ) {\n\t\t\tstate = setHandle ( handles[1], positions[h?0:1], false ) || state;\n\t\t}\n\n\t\t// Fire the 'slide' event if any handle moved.\n\t\tif ( state ) {\n\t\t\tfireEvents(['slide']);\n\t\t}\n\t}\n\n\t// Unbind move events on document, call callbacks.\n\tfunction end ( event ) {\n\n\t\t// The handle is no longer active, so remove the class.\n\t\t$('.' + Classes[15]).removeClass(Classes[15]);\n\n\t\t// Remove cursor styles and text-selection events bound to the body.\n\t\tif ( event.cursor ) {\n\t\t\t$('body').css('cursor', '').off( namespace );\n\t\t}\n\n\t\t// Unbind the move and end events, which are added on 'start'.\n\t\tdoc.off( namespace );\n\n\t\t// Remove dragging class.\n\t\t$Target.removeClass(Classes[12]);\n\n\t\t// Fire the change and set events.\n\t\tfireEvents(['set', 'change']);\n\t}\n\n\t// Bind move events on document.\n\tfunction start ( event, data ) {\n\n\t\t// Mark the handle as 'active' so it can be styled.\n\t\tif( data.handles.length === 1 ) {\n\t\t\tdata.handles[0].children().addClass(Classes[15]);\n\t\t}\n\n\t\t// A drag should never propagate up to the 'tap' event.\n\t\tevent.stopPropagation();\n\n\t\t// Attach the move event.\n\t\tattach ( actions.move, doc, move, {\n\t\t\tstart: event.calcPoint,\n\t\t\thandles: data.handles,\n\t\t\tpositions: [\n\t\t\t\t$Locations[0],\n\t\t\t\t$Locations[$Handles.length - 1]\n\t\t\t]\n\t\t});\n\n\t\t// Unbind all movement when the drag ends.\n\t\tattach ( actions.end, doc, end, null );\n\n\t\t// Text selection isn't an issue on touch devices,\n\t\t// so adding cursor styles can be skipped.\n\t\tif ( event.cursor ) {\n\n\t\t\t// Prevent the 'I' cursor and extend the range-drag cursor.\n\t\t\t$('body').css('cursor', $(event.target).css('cursor'));\n\n\t\t\t// Mark the target with a dragging state.\n\t\t\tif ( $Handles.length > 1 ) {\n\t\t\t\t$Target.addClass(Classes[12]);\n\t\t\t}\n\n\t\t\t// Prevent text selection when dragging the handles.\n\t\t\t$('body').on('selectstart' + namespace, false);\n\t\t}\n\t}\n\n\t// Move closest handle to tapped location.\n\tfunction tap ( event ) {\n\n\t\tvar location = event.calcPoint, total = 0, to;\n\n\t\t// The tap event shouldn't propagate up and cause 'edge' to run.\n\t\tevent.stopPropagation();\n\n\t\t// Add up the handle offsets.\n\t\t$.each( $Handles, function(){\n\t\t\ttotal += this.offset()[ options.style ];\n\t\t});\n\n\t\t// Find the handle closest to the tapped position.\n\t\ttotal = ( location < total/2 || $Handles.length === 1 ) ? 0 : 1;\n\n\t\tlocation -= $Base.offset()[ options.style ];\n\n\t\t// Calculate the new position.\n\t\tto = ( location * 100 ) / baseSize();\n\n\t\t// Find the closest handle and calculate the tapped point.\n\t\t// The set handle to the new position.\n\t\tjump( $Handles[total], to, options.events.snap );\n\n\t\tif ( options.events.snap ) {\n\t\t\tstart(event, { handles: [$Handles[total]] });\n\t\t}\n\t}\n\n\t// Move handle to edges when target gets tapped.\n\tfunction edge ( event ) {\n\n\t\tvar i = event.calcPoint < $Base.offset()[ options.style ],\n\t\t\tto = i ? 0 : 100;\n\n\t\ti = i ? 0 : $Handles.length - 1;\n\n\t\tjump( $Handles[i], to, false );\n\t}\n\n\t// Attach events to several slider parts.\n\tfunction events ( behaviour ) {\n\n\t\tvar i, drag;\n\n\t\t// Attach the standard drag event to the handles.\n\t\tif ( !behaviour.fixed ) {\n\n\t\t\tfor ( i = 0; i < $Handles.length; i++ ) {\n\n\t\t\t\t// These events are only bound to the visual handle\n\t\t\t\t// element, not the 'real' origin element.\n\t\t\t\tattach ( actions.start, $Handles[i].children(), start, {\n\t\t\t\t\thandles: [ $Handles[i] ]\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Attach the tap event to the slider base.\n\t\tif ( behaviour.tap ) {\n\t\t\tattach ( actions.start, $Base, tap, {\n\t\t\t\thandles: $Handles\n\t\t\t});\n\t\t}\n\n\t\t// Extend tapping behaviour to target\n\t\tif ( behaviour.extend ) {\n\n\t\t\t$Target.addClass( Classes[16] );\n\n\t\t\tif ( behaviour.tap ) {\n\t\t\t\tattach ( actions.start, $Target, edge, {\n\t\t\t\t\thandles: $Handles\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Make the range dragable.\n\t\tif ( behaviour.drag ){\n\n\t\t\tdrag = $Base.find( '.' + Classes[7] ).addClass( Classes[10] );\n\n\t\t\t// When the range is fixed, the entire range can\n\t\t\t// be dragged by the handles. The handle in the first\n\t\t\t// origin will propagate the start event upward,\n\t\t\t// but it needs to be bound manually on the other.\n\t\t\tif ( behaviour.fixed ) {\n\t\t\t\tdrag = drag.add($Base.children().not( drag ).children());\n\t\t\t}\n\n\t\t\tattach ( actions.start, drag, start, {\n\t\t\t\thandles: $Handles\n\t\t\t});\n\t\t}\n\t}\n\n\n// Initialize slider\n\n\t// Throw an error if the slider was already initialized.\n\tif ( !$Target.is(':empty') ) {\n\t\tthrow new Error('Slider was already initialized.');\n\t}\n\n\t// Create the base element, initialise HTML and set classes.\n\t// Add handles and links.\n\t$Base = addSlider( options, $Target );\n\t$Handles = addHandles( options, $Base );\n\t$Serialization = addLinks( options, $Handles );\n\n\t// Set the connect classes.\n\taddConnection ( options.connect, $Target, $Handles );\n\n\t// Attach user events.\n\tevents( options.events );\n\n\n// Methods\n\n\t// Set the slider value.\n\ttarget.vSet = function ( values, callback, link, update, animate ){\n\n\t\tvar i, to;\n\n\t\t// The RTL settings is implemented by reversing the front-end,\n\t\t// internal mechanisms are the same.\n\t\tif ( options.dir && options.handles > 1 ) {\n\t\t\tvalues.reverse();\n\t\t}\n\n\t\t// Animation is optional.\n\t\tif ( animate ) {\n\t\t\taddClassFor( $Target, Classes[14], 300 );\n\t\t}\n\n\t\t// If there are multiple handles to be set run the setting\n\t\t// mechanism twice for the first handle, to make sure it\n\t\t// can be bounced of the second one properly.\n\t\tfor ( i = 0; i < ( $Handles.length > 1 ? 3 : 1 ); i++ ) {\n\n\t\t\tto = link || $Serialization[i%2][0];\n\t\t\tto = to.valueOf( values[i%2] );\n\n\t\t\tif ( to === false ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Calculate the new handle position\n\t\t\tto = toStepping( options, to );\n\n\t\t\t// Invert the value if this is a right-to-left slider.\n\t\t\tif ( options.dir ) {\n\t\t\t\tto = 100 - to;\n\t\t\t}\n\n\t\t\t// Force delimitation.\n\t\t\tif ( setHandle( $Handles[i%2], to, true ) === true ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Reset the input if it doesn't match the slider.\n\t\t\t$($Serialization[i%2]).each(function(){\n\t\t\t\tthis.write(\n\t\t\t\t\toptions,\n\t\t\t\t\t$Locations[i%2],\n\t\t\t\t\t$Handles[i%2].children(),\n\t\t\t\t\t$Target,\n\t\t\t\t\tupdate\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\n\t\t// Optionally fire the 'set' event.\n\t\tif( callback === true ) {\n\t\t\tfireEvents(['set']);\n\t\t}\n\n\t\treturn this;\n\t};\n\n\t// Get the slider value.\n\ttarget.vGet = function ( ){\n\n\t\tvar i, retour = [];\n\n\t\t// Get the value from all handles.\n\t\tfor ( i = 0; i < options.handles; i++ ){\n\t\t\tretour[i] = $Serialization[i][0].saved;\n\t\t}\n\n\t\t// If only one handle is used, return a single value.\n\t\tif ( retour.length === 1 ){\n\t\t\treturn retour[0];\n\t\t}\n\n\t\tif ( options.dir && options.handles > 1 ) {\n\t\t\treturn retour.reverse();\n\t\t}\n\n\t\treturn retour;\n\t};\n\n\t// Destroy the slider and unbind all events.\n\ttarget.destroy = function ( ){\n\n\t\t// Loop all linked serialization objects and unbind all\n\t\t// events in the noUiSlider namespace.\n\t\t$.each($Serialization, function(){\n\t\t\t$.each(this, function(){\n\t\t\t\t// Won't remove 'change' when bound implicitly.\n\t\t\t\tif ( this.target ) {\n\t\t\t\t\tthis.target.off( namespace );\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t// Unbind events on the slider, remove all classes and child elements.\n\t\t$(this).off(namespace)\n\t\t\t.removeClass(Classes.join(' '))\n\t\t\t.empty();\n\n\t\t// Return the original options from the closure.\n\t\treturn originalOptions;\n\t};\n\n\n// Value setting\n\n\t// Use the public value method to set the start values.\n\t$Target.val( options.start );\n}\n\n\n// Access points\n\n\t// Run the standard initializer\n\tfunction initialize ( originalOptions ) {\n\n\t\t// Throw error if group is empty.\n\t\tif ( !this.length ){\n\t\t\tthrowError(\"Can't initialize slider on empty selection.\");\n\t\t}\n\n\t\t// Test the options once, not for every slider.\n\t\tvar options = test( originalOptions, this );\n\n\t\t// Loop all items, and provide a new closed-scope environment.\n\t\treturn this.each(function(){\n\t\t\tclosure(this, options, originalOptions);\n\t\t});\n\t}\n\n\t// Destroy the slider, then re-enter initialization.\n\tfunction rebuild ( options ) {\n\n\t\treturn this.each(function(){\n\n\t\t\t// Get the current values from the slider,\n\t\t\t// including the initialization options.\n\t\t\tvar values = $(this).val(),\n\t\t\t\toriginalOptions = this.destroy(),\n\n\t\t\t\t// Extend the previous options with the newly provided ones.\n\t\t\t\tnewOptions = $.extend( {}, originalOptions, options );\n\n\t\t\t// Run the standard initializer.\n\t\t\t$(this).noUiSlider( newOptions );\n\n\t\t\t// If the start option hasn't changed,\n\t\t\t// reset the previous values.\n\t\t\tif ( originalOptions.start === newOptions.start ) {\n\t\t\t\t$(this).val(values);\n\t\t\t}\n\t\t});\n\t}\n\n\n\t// Expose serialization constructor.\n\t/** @expose */\n\t$.noUiSlider = { 'Link': Link };\n\n\t// Extend jQuery/Zepto with the noUiSlider method.\n\t/** @expose */\n\t$.fn.noUiSlider = function ( options, re ) {\n\t\treturn ( re ? rebuild : initialize ).call(this, options);\n\t};\n\n\t$.fn.val = function ( ) {\n\n\t\t// Convert the function arguments to an array.\n\t\tvar args = Array.prototype.slice.call( arguments, 0 ),\n\t\t\tset, link, update, animate;\n\n\t\t// Test if there are arguments, and if not, call the 'get' method.\n\t\tif ( !args.length ) {\n\n\t\t\t// Determine whether to use the native val method.\n\t\t\tif ( this.hasClass(Classes[0]) ) {\n\t\t\t\treturn this[0].vGet();\n\t\t\t}\n\n\t\t\treturn $val.apply( this );\n\t\t}\n\n\t\t// Extract modifiers for value method.\n\t\tif ( typeof args[1] === 'object' ) {\n\t\t\tset = args[1]['set'];\n\t\t\tlink = args[1]['link'];\n\t\t\tupdate = args[1]['update'];\n\t\t\tanimate = args[1]['animate'];\n\n\t\t// Support the 'true' option.\n\t\t} else if ( args[1] === true ) {\n\t\t\tset = true;\n\t\t}\n\n\t\t// Loop all individual items, and handle setting appropriately.\n\t\treturn this.each(function(){\n\n\t\t\tif ( $(this).hasClass(Classes[0]) ) {\n\t\t\t\tthis.vSet( asArray(args[0]), set, link, update, animate );\n\t\t\t} else {\n\t\t\t\t$val.apply( $(this), args );\n\t\t\t}\n\t\t});\n\t};\n\n}( window['jQuery'] || window['Zepto'] ));\n","/**\n * Provides requestAnimationFrame in a cross browser way.\n * @author paulirish / http://paulirish.com/\n */\n \nif ( !window.requestAnimationFrame ) {\n \n\twindow.requestAnimationFrame = ( function() {\n \n\t\treturn window.webkitRequestAnimationFrame ||\n\t\twindow.mozRequestAnimationFrame ||\n\t\twindow.oRequestAnimationFrame ||\n\t\twindow.msRequestAnimationFrame ||\n\t\tfunction( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) {\n \n\t\t\twindow.setTimeout( callback, 1000 / 60 );\n \n\t\t};\n \n\t} )();\n \n}\n\n/*!\n * isVis - v0.5.5 Aug 2011 - Page Visibility API Polyfill\n * Copyright (c) 2011 Addy Osmani\n * Dual licensed under the MIT and GPL licenses.\n */\n(function () {\n\n window.visibly = {\n b: null,\n q: document,\n p: undefined,\n prefixes: ['webkit', 'ms'],\n props: ['VisibilityState', 'visibilitychange', 'Hidden'],\n m: ['focus', 'blur'],\n visibleCallbacks: [],\n hiddenCallbacks: [],\n _callbacks: [],\n\n onVisible: function ( _callback ) {\n this.visibleCallbacks.push(_callback);\n },\n onHidden: function ( _callback ) {\n this.hiddenCallbacks.push(_callback);\n },\n isSupported: function () {\n return (this._supports(0) || this._supports(1));\n },\n _supports: function ( index ) {\n return ((this.prefixes[index] + this.props[2]) in this.q);\n },\n runCallbacks: function ( index ) {\n if ( index ) {\n this._callbacks = (index == 1) ? this.visibleCallbacks : this.hiddenCallbacks;\n for (var i = 0; i < this._callbacks.length; i++) {\n this._callbacks[i]();\n }\n }\n },\n _visible: function () {\n window.visibly.runCallbacks(1);\n },\n _hidden: function () {\n window.visibly.runCallbacks(2);\n },\n _nativeSwitch: function () {\n ((this.q[this.b + this.props[2]]) === true) ? this._hidden() : this._visible();\n },\n listen: function () {\n\n try { /*if no native page visibility support found..*/\n if (!(this.isSupported())) {\n if (document.addEventListener) { /*for browsers without focusin/out support eg. firefox, opera use focus/blur*/\n\t\t\t\t\t\t/*window used instead of doc as Opera complains otherwise*/\n window.addEventListener(this.m[0], this._visible, 1);\n window.addEventListener(this.m[1], this._hidden, 1);\n } else { /*IE <10s most reliable focus events are onfocusin/onfocusout*/\n this.q.attachEvent('onfocusin', this._visible);\n this.q.attachEvent('onfocusout', this._hidden);\n }\n } else { /*switch support based on prefix*/\n this.b = (this._supports(0) == this.p) ? this.prefixes[1] : this.prefixes[0];\n this.q.addEventListener(this.b + this.props[1], function () {\n window.visibly._nativeSwitch.apply(window.visibly, arguments);\n }, 1);\n }\n } catch (e) {}\n },\n init: function () {\n this.listen();\n }\n }\n\n this.visibly.init();\n\n})();\n","// MIT License:\n//\n// Copyright (c) 2010-2012, Joe Walnes\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/**\n * This behaves like a WebSocket in every way, except if it fails to connect,\n * or it gets disconnected, it will repeatedly poll until it succesfully connects\n * again.\n *\n * It is API compatible, so when you have:\n * ws = new WebSocket('ws://....');\n * you can replace with:\n * ws = new ReconnectingWebSocket('ws://....');\n *\n * The event stream will typically look like:\n * onconnecting\n * onopen\n * onmessage\n * onmessage\n * onclose // lost connection\n * onconnecting\n * onopen // sometime later...\n * onmessage\n * onmessage\n * etc... \n *\n * It is API compatible with the standard WebSocket API.\n *\n * Latest version: https://github.com/joewalnes/reconnecting-websocket/\n * - Joe Walnes\n */\n(function (global, factory) {\n if (typeof define === 'function' && define.amd) {\n define([], factory);\n } else if (typeof module !== 'undefined' && module.exports){\n module.exports = factory();\n } else {\n global.ReconnectingWebSocket = factory();\n }\n})(this, function () {\n\n function ReconnectingWebSocket(url, protocols) {\n protocols = protocols || [];\n\n // These can be altered by calling code.\n this.debug = false;\n this.reconnectInterval = 1000;\n this.reconnectDecay = 1.5;\n this.reconnectAttempts = 0;\n this.timeoutInterval = 2000;\n\n var self = this;\n var ws;\n var forcedClose = false;\n var timedOut = false;\n \n this.url = url;\n this.protocols = protocols;\n this.readyState = WebSocket.CONNECTING;\n this.URL = url; // Public API\n\n this.onopen = function(event) {\n };\n\n this.onclose = function(event) {\n };\n\n this.onconnecting = function(event) {\n };\n\n this.onmessage = function(event) {\n };\n\n this.onerror = function(event) {\n };\n\n function connect(reconnectAttempt) {\n ws = new WebSocket(url, protocols);\n \n self.onconnecting();\n if (self.debug || ReconnectingWebSocket.debugAll) {\n console.debug('ReconnectingWebSocket', 'attempt-connect', url);\n }\n \n var localWs = ws;\n var timeout = setTimeout(function() {\n if (self.debug || ReconnectingWebSocket.debugAll) {\n console.debug('ReconnectingWebSocket', 'connection-timeout', url);\n }\n timedOut = true;\n localWs.close();\n timedOut = false;\n }, self.timeoutInterval);\n \n ws.onopen = function(event) {\n clearTimeout(timeout);\n if (self.debug || ReconnectingWebSocket.debugAll) {\n console.debug('ReconnectingWebSocket', 'onopen', url);\n }\n self.readyState = WebSocket.OPEN;\n reconnectAttempt = false;\n self.reconnectAttempts = 0;\n self.onopen(event);\n };\n \n ws.onclose = function(event) {\n clearTimeout(timeout);\n ws = null;\n if (forcedClose) {\n self.readyState = WebSocket.CLOSED;\n self.onclose(event);\n } else {\n self.readyState = WebSocket.CONNECTING;\n self.onconnecting();\n if (!reconnectAttempt && !timedOut) {\n if (self.debug || ReconnectingWebSocket.debugAll) {\n console.debug('ReconnectingWebSocket', 'onclose', url);\n }\n self.onclose(event);\n }\n setTimeout(function() {\n self.reconnectAttempts++;\n connect(true);\n }, self.reconnectInterval * Math.pow(self.reconnectDecay, self.reconnectAttempts));\n }\n };\n ws.onmessage = function(event) {\n if (self.debug || ReconnectingWebSocket.debugAll) {\n console.debug('ReconnectingWebSocket', 'onmessage', url, event.data);\n }\n self.onmessage(event);\n };\n ws.onerror = function(event) {\n if (self.debug || ReconnectingWebSocket.debugAll) {\n console.debug('ReconnectingWebSocket', 'onerror', url, event);\n }\n self.onerror(event);\n };\n }\n connect(false);\n\n this.send = function(data) {\n if (ws) {\n if (self.debug || ReconnectingWebSocket.debugAll) {\n console.debug('ReconnectingWebSocket', 'send', url, data);\n }\n return ws.send(data);\n } else {\n throw 'INVALID_STATE_ERR : Pausing to reconnect websocket';\n }\n };\n\n this.close = function() {\n forcedClose = true;\n if (ws) {\n ws.close();\n }\n };\n\n /**\n * Additional public API method to refresh the connection if still open (close, re-open).\n * For example, if the app suspects bad data / missed heart beats, it can try to refresh.\n */\n this.refresh = function() {\n if (ws) {\n ws.close();\n }\n };\n }\n\n /**\n * Setting this to true is the equivalent of setting all instances of ReconnectingWebSocket.debug to true.\n */\n ReconnectingWebSocket.debugAll = false;\n\n return ReconnectingWebSocket;\n});\n","// Set debugmode to true and transactions/trades will be\n// randomly generated, and no outside connections will be made.\nvar DEBUG_MODE = false;\n\nvar DONATION_ADDRESS;\nvar SOUND_DONATION_ADDRESS;\n\nvar globalMute = false;\n\nvar instanceId = 0;\nvar pageDivId = \"pageDiv\";\n\nvar last_update = 0;\n\nvar updateTargets = [];\n\nvar transaction_count = 0;\n\n// Preload images\nvar bubbleImage = new Image();\nbubbleImage.src = \"images/bubble.png\";\nvar blockImage = new Image();\nblockImage.src = \"images/block.png\";\n\nvar debugSpawner;\n\nvar updateLayoutWidth = function() {\n\t$(\".chartMask\").css(\"visibility\", \"visible\");\n};\n\nvar updateLayoutHeight = function() {\n\tvar newHeight = window.innerHeight;\n\tif ($(\"#header\").css(\"display\") != \"none\") newHeight -= $(\"#header\").outerHeight();\n\t$(\"#pageSplitter\").height(newHeight);\n};\n\n$(document).ready(function() {\n\n\tprevChartWidth = $(\"#pageSplitter\").width() / 2;\n\t\n\t$(\"#chartCell\").hide();\n\t\n\tDONATION_ADDRESS = $(\"#donationAddress\").html();\n\t// Because the user has javascript running:\n\t$(\"#noJavascript\").css(\"display\", \"none\");\n\n\t// Initialize draggable vertical page splitter\n\tupdateLayoutHeight();\n\t\n\tStatusBox.init(DEBUG_MODE);\n\n\t$(\".clickSuppress\").click(function() {\n\t\t$(\".clickSuppress\").parent().slideUp(300);\n\t});\n\n\t// Create a bubble spawner for testing\n\tdebugSpawner = function() {\n\t\t// Generate some test bubbles\n\t\tif (Math.random() <= 0.1) {\n\t\t\t// Try to simulate the transaction spread\n\t\t\tvar volume;\n\t\t\tvar order = Math.random();\n\t\t\tif (order < 0.6) {\n\t\t\t\tvolume = Math.random();\n\t\t\t} else if (order < 0.8) {\n\t\t\t\tvolume = Math.random() * 10;\n\t\t\t} else if (order < 0.95) {\n\t\t\t\tvolume = Math.random() * 100;\n\t\t\t} else {\n\t\t\t\tvolume = Math.random() * 1000;\n\t\t\t}\n\n\t\t\tif (Math.random() < 0.5)\n\t\t\t\tnew Transaction(volume, false);\n\t\t\telse\n\t\t\t\tnew Transaction(volume, false, volume * 75, 'USD');\n\t\t}\n\t};\n\t// Spam the following line into console, it's kind of fun.\n\t// new Block(228158, 270, 100 * satoshi, 153 * 1024);\n\t\n\tswitchExchange(\"bitstamp\");\n\t\n\t// Attach mouseover qr\n\t$(\"#donationAddress\").qr();\n\t\n});\n\n// Function for handling interface show/hide\nvar toggleInterface = function() {\n\tif ($(\".interface:hidden\").length === 0) {\n\t\t$(\".interface\").fadeOut(500, updateLayoutHeight);\n\t\t$(\"#hideInterface\").html(\"[ Show Interface ]\");\n\t\t$(\"#hideInterface\").css(\"opacity\", \"0.5\");\n\t} else {\n\t\t$(\".interface\").fadeIn(500);\n\t\t$(\"#hideInterface\").html(\"[ Hide Interface ]\");\n\t\t$(\"#hideInterface\").css(\"opacity\", \"1\");\n\t\tupdateLayoutHeight();\n\t}\n};\n\nvar globalUpdate = function(time) {\n\twindow.requestAnimationFrame(globalUpdate);\n\tvar delta = time - last_update;\n\tlast_update = time;\n\tfor (var i = 0; i < updateTargets.length; i++) {\n\t\tupdateTargets[i].update(delta);\n\t}\n};\n\n$(window).bind(\"load\", function() {\n\tif (DEBUG_MODE) {\n\t\tsetInterval(debugSpawner, 100);\n\t} else {\n\t\tif ($(\"#blockchainCheckBox\").prop(\"checked\"))\n\t\t\tTransactionSocket.init();\n\t\tif ($(\"#mtgoxCheckBox\").prop(\"checked\"))\n\t\t\tTradeSocket.init();\n\t}\n\n\twindow.requestAnimationFrame(globalUpdate);\n\t\n\tSound.loadup();\n\tSound.init();\n});\n\nvar endResize = function() {\n $(\".chartMask\").css(\"visibility\", \"hidden\");\n\tfor (var i = 0; i < updateTargets.length; i++) {\n\t\tupdateTargets[i].updateContainerSize();\n\t}\n};\n\nvar hideChart = function() {\n\t$(\"#chartElement\").hide();\n\t$(\"#showChart\").show();\n\tprevChartWidth = $(\"#chartCell\").width();\n\t$(\"#chartCell\").width(0);\n\t$(\"#chartCell\").hide();\n\t$(\"#pageSplitter\").colResizable({\n\t\tdisable: true\n\t});\n};\n\nvar showChart = function() {\n\t$(\"#chartElement\").show();\n\t$(\"#showChart\").hide();\n\t$(\"#chartCell\").width(prevChartWidth);\n\t$(\"#chartCell\").show();\n\t$(window).trigger(\"resize\");\n\tif ($(\"#bitcoinChart\").length === 0) {\n\t\t// Load the iframe\n\t\t$(\"#chartHolder\").html('');\n\t}\n\t$(\"#pageSplitter\").colResizable({\n\t\tliveDrag: true,\n\t\tonDrag: updateLayoutWidth,\n\t\tonResize: endResize\n\t});\n};\n\n$(window).resize(function() {\n updateLayoutHeight();\n});\n\nwindow.onbeforeunload = function(e) {\n\tclearInterval(globalUpdate);\n\tTransactionSocket.close();\n\tTradeSocket.close();\n};\n\n","var rateboxTimeout;\nvar currentExchange;\nvar ratebox_ms = 3000; // 3 second update interval\n\nrateboxGetRate = function() {\n\t// After some testing, the YQL proxy turns out not to be very reliable.\n\t// Instead of that, we will just wait for the BitStamp websocket to update.\n};\n\n$(document).ready(function() {\n\t// Bitstamp websocket API\n\tvar pusher = new Pusher('de504dc5763aeef9ff52');\n\tvar channel = pusher.subscribe('live_trades');\n\tchannel.bind('trade', function(ticker) {\n $(\"#rate\").html(parseFloat(ticker.price).toFixed(2));\n if (rateboxTimeout) clearTimeout(rateboxTimeout);\n\t});\n});\n\nswitchExchange = function(exchangeName) {\n\tclearTimeout(rateboxTimeout);\n\tcurrentExchange = exchangeName;\n\t$(\"#rate\").html(\"---\");\n\t\n\tif (exchangeName == \"bitstamp\") {\n\t\t$(\"#bitstampRate\").css(\"color\", \"white\");\n\t\t$(\"#mtgoxRate\").css(\"color\", \"gray\");\n\t} else if (exchangeName == \"mtgox\") {\n\t\t$(\"#mtgoxRate\").css(\"color\", \"white\");\n\t\t$(\"#bitstampRate\").css(\"color\", \"gray\");\n\t}\n\t\n\trateboxGetRate();\n};\n"]} \ No newline at end of file