From edf1c34e34906e48df9e36dfa6d33d5f0da26d92 Mon Sep 17 00:00:00 2001 From: Stuart Memo Date: Tue, 4 Feb 2014 14:27:19 +0000 Subject: [PATCH] minified js --- qwerty-hancock.min.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qwerty-hancock.min.js b/qwerty-hancock.min.js index a1117f1..ef61b54 100644 --- a/qwerty-hancock.min.js +++ b/qwerty-hancock.min.js @@ -1,2 +1,2 @@ -/* Qwerty Hancock 0.2.0 (c) 2013 Stuart Memo */ -!function(a){var b=function(b){var c={};c.version="0.3";var d=b.id||"keyboard",e=b.element||document.getElementById(d),f=b.octaves||3,g=7*f,h=b.width||600,i=b.height||150,j=b.startNote||"A3",k=j.charAt(1),l=b.whiteKeyColour||"#FFF",m=b.blackKeyColour||"#000",n=b.hoverColour||"#076cf0",o=1,p=Math.floor((h-g*o)/g),q=b.blackKeyWidth||Math.floor(p/2),r=b.blackKeyHeight||i/1.5,s=b.keyboardLayout||"en",t=["C","D","E","F","G","A","B"],u=["A","C","D","F","G"],v=u.length*f,w=j.charAt(0),x=0,y=k,z={},A=[],B=!1,C=0,b={};c.keyDown=function(){},c.keyUp=function(){};var D=function(a){var b,c,d=["A","A#","B","C","C#","D","D#","E","F","F#","G","G#"];return c=3===a.length?a.charAt(2):a.charAt(1),b=d.indexOf(a.slice(0,-1)),b=3>b?b+12+12*(c-1)+1:b+12*(c-1)+1,440*Math.pow(2,(b-49)/12)};!function(){for(C=0;7>C;C++)if(w===t[C]){keyOffset=C;break}for(C=0;7>C;C++)A[C]=C+keyOffset>6?t[C+keyOffset-7]:t[C+keyOffset]}();var E=function(){this.style.backgroundColor=n},F=function(){this.style.backgroundColor="white"===this.getAttribute("data-note-type")?l:m},G=function(){B=!0,E.call(this),c.keyDown(this.title,D(this.title))},H=function(){B=!1,F.call(this),c.keyUp(this.title,D(this.title))},I=function(){B&&(E.call(this),c.keyDown(this.title,D(this.title)))},J=function(){B&&(F.call(this),c.keyUp(this.title,D(this.title)))},K=function(a){a.addEventListener("mousedown",G),a.addEventListener("mouseup",H),a.addEventListener("mouseover",I),a.addEventListener("mouseout",J)},L=function(){var a=document.createElement("ul"),b=0,c=0;a.style.height=i+"px",a.style.width=h+"px",a.style.padding=0,a.style.position="relative",a.style.cursor="default",a.style["-webkit-user-select"]="none";var d=function(){for(b=0,x=k,C=0;g>C;C++){var d=document.createElement("li");C%t.length===0&&(b=0),d.style.backgroundColor=l,d.style.display="inline-block",d.style.height=i+"px",d.style.width=p+"px",d.style.border="1px solid black",d.style.borderRight=0,d.style["-webkit-user-select"]="none",d.setAttribute("data-note-type","white"),C%t.length===0&&(b=0),c=A[b],"C"===c&&x++,d.id=A[b]+(x-1),d.title=A[b]+(x-1),K(d),a.appendChild(d),b++}},f=function(){for(b=0,x=k,C=0;g>C;C++){C%t.length===0&&(b=0);for(var d=0;v>d;d++)if(A[b]===u[d]&&(c=A[b]+"#","C#"===c&&x++,h-p>(p+1)*(C+1))){var e=document.createElement("li");e.style.backgroundColor=m,e.style.display="inline-block",e.style.position="absolute",e.style.left=Math.floor((p+1)*(C+1)-q/2)+"px",e.style.border="1px solid black",e.style.width=q+"px",e.style.height=r+"px",e.id=A[b]+"#"+(x-1),e.title=A[b]+"#"+(x-1),e.setAttribute("data-note-type","black"),K(e),a.appendChild(e)}b++}};d(),f(),e.style.fontSize="0px",e.appendChild(a)};if(L(),"en"==s)var M={65:"Cl",87:"C#l",83:"Dl",69:"D#l",68:"El",70:"Fl",84:"F#l",71:"Gl",89:"G#l",72:"Al",85:"A#l",74:"Bl",75:"Cu",79:"C#u",76:"Du",80:"D#u",59:"Eu",186:"Eu",222:"Fu",221:"F#u",220:"Gu"};else if("de"==s)var M={65:"Cl",87:"C#l",83:"Dl",69:"D#l",68:"El",70:"Fl",84:"F#l",71:"Gl",90:"G#l",72:"Al",85:"A#l",74:"Bl",75:"Cu",79:"C#u",76:"Du",80:"D#u",186:"Eu",222:"Fu",221:"F#u",220:"Gu"};var N=function(a){var b,d;a.keyCode in z||(z[a.keyCode]=!0,"undefined"!=typeof M[a.keyCode]&&(d=M[a.keyCode].replace("l",y).replace("u",(parseInt(y,10)+1).toString()),c.keyDown(d,D(d)),b=document.getElementById(d),E.call(b)))},O=function(a){var b,d;delete z[a.keyCode],"undefined"!=typeof M[a.keyCode]&&(d=M[a.keyCode].replace("l",y).replace("u",(parseInt(y,10)+1).toString()),c.keyUp(d,D(d)),b=document.getElementById(d),F.call(b))};return a.onkeydown=N,a.onkeyup=O,c};a.QwertyHancock=b}(window); \ No newline at end of file +/* Qwerty Hancock 0.2.1 (c) 2013-14 Stuart Memo */ +!function(a){var b=function(b){var c={};c.version="0.3";var d=b.id||"keyboard",e=b.element||document.getElementById(d),f=b.octaves||3,g=7*f,h=b.width||600,i=b.height||150,j=b.startNote||"A3",k=j.charAt(1),l=b.whiteKeyColour||"#FFF",m=b.blackKeyColour||"#000",n=b.hoverColour||"#076cf0",o=1,p=Math.floor((h-g*o)/g),q=b.blackKeyWidth||Math.floor(p/2),r=b.blackKeyHeight||i/1.5,s=b.keyboardLayout||"en",t=["C","D","E","F","G","A","B"],u=["A","C","D","F","G"],v=u.length*f,w=j.charAt(0),x=0,y=k,z={},A=[],B=!1,C=0,b={};c.keyDown=function(){},c.keyUp=function(){};var D=function(a){var b,c,d=["A","A#","B","C","C#","D","D#","E","F","F#","G","G#"];return c=a.charAt(3===a.length?2:1),b=d.indexOf(a.slice(0,-1)),b=3>b?b+12+12*(c-1)+1:b+12*(c-1)+1,440*Math.pow(2,(b-49)/12)};!function(){for(C=0;7>C;C++)if(w===t[C]){keyOffset=C;break}for(C=0;7>C;C++)A[C]=C+keyOffset>6?t[C+keyOffset-7]:t[C+keyOffset]}();var E=function(){this.style.backgroundColor=n},F=function(){this.style.backgroundColor="white"===this.getAttribute("data-note-type")?l:m},G=function(){B=!0,E.call(this),c.keyDown(this.title,D(this.title))},H=function(){B=!1,F.call(this),c.keyUp(this.title,D(this.title))},I=function(){B&&(E.call(this),c.keyDown(this.title,D(this.title)))},J=function(){B&&(F.call(this),c.keyUp(this.title,D(this.title)))},K=function(a){a.addEventListener("mousedown",G),a.addEventListener("mouseup",H),a.addEventListener("mouseover",I),a.addEventListener("mouseout",J)},L=function(){var a=document.createElement("ul"),b=0,c=0;a.style.height=i+"px",a.style.width=h+"px",a.style.padding=0,a.style.position="relative",a.style.cursor="default",a.style["-webkit-user-select"]="none";var d=function(){for(b=0,x=k,C=0;g>C;C++){var d=document.createElement("li");C%t.length===0&&(b=0),d.style.backgroundColor=l,d.style.display="inline-block",d.style.height=i+"px",d.style.width=p+"px",d.style.border="1px solid black",d.style.borderRight=0,d.style["-webkit-user-select"]="none",d.setAttribute("data-note-type","white"),C%t.length===0&&(b=0),c=A[b],"C"===c&&x++,d.id=A[b]+(x-1),d.title=A[b]+(x-1),K(d),a.appendChild(d),b++}},f=function(){for(b=0,x=k,C=0;g>C;C++){C%t.length===0&&(b=0);for(var d=0;v>d;d++)if(A[b]===u[d]&&(c=A[b]+"#","C#"===c&&x++,h-p>(p+1)*(C+1))){var e=document.createElement("li");e.style.backgroundColor=m,e.style.display="inline-block",e.style.position="absolute",e.style.left=Math.floor((p+1)*(C+1)-q/2)+"px",e.style.border="1px solid black",e.style.width=q+"px",e.style.height=r+"px",e.id=A[b]+"#"+(x-1),e.title=A[b]+"#"+(x-1),e.setAttribute("data-note-type","black"),K(e),a.appendChild(e)}b++}};d(),f(),e.style.fontSize="0px",e.appendChild(a)};if(L(),"en"==s)var M={65:"Cl",87:"C#l",83:"Dl",69:"D#l",68:"El",70:"Fl",84:"F#l",71:"Gl",89:"G#l",72:"Al",85:"A#l",74:"Bl",75:"Cu",79:"C#u",76:"Du",80:"D#u",59:"Eu",186:"Eu",222:"Fu",221:"F#u",220:"Gu"};else if("de"==s)var M={65:"Cl",87:"C#l",83:"Dl",69:"D#l",68:"El",70:"Fl",84:"F#l",71:"Gl",90:"G#l",72:"Al",85:"A#l",74:"Bl",75:"Cu",79:"C#u",76:"Du",80:"D#u",186:"Eu",222:"Fu",221:"F#u",220:"Gu"};var N=function(a){var b,d;a.keyCode in z||(z[a.keyCode]=!0,"undefined"!=typeof M[a.keyCode]&&(d=M[a.keyCode].replace("l",y).replace("u",(parseInt(y,10)+1).toString()),c.keyDown(d,D(d)),b=document.getElementById(d),E.call(b)))},O=function(a){var b,d;delete z[a.keyCode],"undefined"!=typeof M[a.keyCode]&&(d=M[a.keyCode].replace("l",y).replace("u",(parseInt(y,10)+1).toString()),c.keyUp(d,D(d)),b=document.getElementById(d),F.call(b))};return a.onkeydown=N,a.onkeyup=O,c};a.QwertyHancock=b}(window); \ No newline at end of file