Last active 1481516000

A javascript thing to get guitar tab charts quickly. https://b303.me/guitartabs.html

Steven Smith revised this gist 1481552000. Go to revision

1 file changed, 10 insertions, 1 deletion

guitartabs.html

@@ -6,7 +6,7 @@
6 6 </head>
7 7 <body>
8 8 <form id="form">
9 - <input type="text" id="tabs" style="width:70%" value="G F# Ab B♭">
9 + <input type="text" id="tabs" style="width:70%" value="G F# Ab C">
10 10 <input type="submit">
11 11 </form>
12 12 <div id="display"></div>
@@ -17,6 +17,7 @@ window.chords = {"Fsharp": "http://www.chordie.com/ramimages/i8/Fsharpchord_2443
17 17
18 18 function showtabs() {
19 19 var tabs = $("input#tabs").val().replace(/♭/g, "b").replace(/#/g, "sharp").replace(/\+/g, "plus").replace(/\//g, "slash");
20 + window.location.hash = tabs.replace(/ /g, ",")
20 21 // If multiple chords, support these separators
21 22 $.each(" ,|", function(i,s){
22 23 if (tabs.indexOf(s) != -1 && tabs.split) tabs = tabs.split(s);
@@ -39,6 +40,14 @@ function showtabs() {
39 40 }
40 41 }
41 42
43 + window.onload = function() {
44 + if (window.location.hash) {
45 + tabs = window.location.hash.substr(1)
46 + $("#tabs").val(tabs)
47 + $("#form").submit()
48 + }
49 + }
50 +
42 51 $("#form").bind("submit", function(e){
43 52 e.preventDefault();
44 53 $("#display").empty();

Steven Smith revised this gist 1480978495. Go to revision

1 file changed, 50 insertions

guitartabs.html(file created)

Diff is too large to be shown

Newer Older