about summary refs log tree commit diff
path: root/laravel
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@gmail.com>2019-01-29 18:39:45 -0500
committerZach DeCook <zachdecook@gmail.com>2019-01-29 18:39:45 -0500
commit29faf211114624ab724cfde5707649f9ae856ada (patch)
tree2f820aa3e26750ac0c56b174ba6d1205808bb304 /laravel
parent0f15c4810b72dfde7c6c4c039e27a71e2bc6dd31 (diff)
downloadprosongsa-29faf211114624ab724cfde5707649f9ae856ada.tar.gz
* Transposing: Transpose transposed to keys
Diffstat (limited to 'laravel')
-rw-r--r--laravel/public/js/jsonly.js10
-rw-r--r--laravel/resources/views/song.blade.php2
2 files changed, 5 insertions, 7 deletions
diff --git a/laravel/public/js/jsonly.js b/laravel/public/js/jsonly.js
index ae1ceb1..4f5d6c8 100644
--- a/laravel/public/js/jsonly.js
+++ b/laravel/public/js/jsonly.js
@@ -42,20 +42,18 @@ function do_transpose()
 		$(this).removeClass("chord"+old);
 		$(this).addClass("chord"+neww);
 	});
-	$(".btn[data-key]").each(function(){
+	$(".but[data-key]").each(function(){
 		console.log($(this));
 		var oldKey = $(this).attr('data-key');
 		var newKey = transpadd(oldKey, transp - lastTransp);
 		if ( typeof newKey !== 'undefined' )
 		{
-			$(this).removeClass('btn-'+oldKey);
-			$(this).addClass('btn-'+newKey);
+			//$(this).removeClass('btn-'+oldKey);
+			//$(this).addClass('btn-'+newKey);
 			$(this).attr('data-key', newKey);
 			$(this).text( $(this).attr('data-words') + newKey );
 		}
-		var tt = parseInt($(this).attr('href').match(/transp=(.+)/)[1]);
-		tt = ( transp - lastTransp + 24 + tt)%12;
-		var newhref = $(this).attr('href').match(/(.*?&transp=).+/)[1] + tt;
+		var newhref = $(this).attr('href').match(/(.*?key=).+/)[1] + newKey;
 		$(this).attr('href', newhref);
 	})
 	lastTransp = transp;
diff --git a/laravel/resources/views/song.blade.php b/laravel/resources/views/song.blade.php
index 0a7a757..6fed78b 100644
--- a/laravel/resources/views/song.blade.php
+++ b/laravel/resources/views/song.blade.php
@@ -66,7 +66,7 @@
         <div class='controlArea'>
             <a class='but' href='{{route('song.suggested', ['song' => $sug, 'from' => $song])}}'>{{$sug->name}}</a>
             @if ($key && $sug->key)
-            <a class='but' href='{{route('song.suggested', ['song' => $sug, 'from' => $song, 'key' => $key])}}'>
+            <a class='but' data-words='transposed to ' data-key='{{$key}}' href='{{route('song.suggested', ['song' => $sug, 'from' => $song, 'key' => $key])}}'>
                 transposed to {{$key}}
             </a>
             @endif