From 7f7bf7b7a9c61fd85e77f2e87d86fb464105ca13 Mon Sep 17 00:00:00 2001 From: jeremy Date: Thu, 14 Aug 2014 10:46:52 -0400 Subject: [PATCH] link fix, timer, cleanup removed excess jquery file set pause on change speed updated demo links reset link goes to fretboard.html --- PlayerModel.js | 10 ++- boxfrets.js | 12 ++-- fretboard.html | 15 +++- jquery-1.4.4.min.js | 167 -------------------------------------------- 4 files changed, 29 insertions(+), 175 deletions(-) delete mode 100644 jquery-1.4.4.min.js diff --git a/PlayerModel.js b/PlayerModel.js index 56353f2..cc4c6a7 100644 --- a/PlayerModel.js +++ b/PlayerModel.js @@ -61,8 +61,11 @@ var PlayerModel = { "setPlaySpeed" : function(speed){ this["playSpeed"] = Number(speed); if(this["playState"] == PS_PLAYING){ + this.setPlaystate(PS_PAUSED); clearInterval(this["looper"]); - this["looper"] = setInterval(function(){animateNotegroups();},Number(speed)); + this.setLooper(setInterval(function(){animateNotegroups(true);},Number(speed))); + //this["looper"] = setInterval(function(){animateNotegroups();},Number(speed)); + this.setPlaystate(PS_PLAYING); } } , @@ -96,7 +99,10 @@ var PlayerModel = { } - +var ctl_changeSpeed = function(){ + var timerSpeed = Math.round(1000 * 60 / $('#dashSpeed').val() ); + mPlayer.setPlaySpeed(timerSpeed); + } var ctl_stopPlayer = function(){ mPlayer.setPlaystate(PS_STOPPED); diff --git a/boxfrets.js b/boxfrets.js index 7906922..4e418f5 100644 --- a/boxfrets.js +++ b/boxfrets.js @@ -432,8 +432,13 @@ var ctrl_addDashNotegroups = function(idStr){ $("#ngDashboard").append($abDiv); // add dragged notegroup to Dashboard $("#ngDashboard").sortable({ - stop: function( event, ui ) {mPlayer.reloadNotegroups($("#ngDashboard"))}, - start: function( event, ui ) {ctl_stopPlayer();} + stop: function( event, ui ) { + mPlayer.reloadNotegroups($("#ngDashboard")); + update_link(); + }, + start: function( event, ui ) { + ctl_stopPlayer(); + } }); mPlayer.reloadNotegroups($("#ngDashboard")); update_link(); @@ -976,8 +981,7 @@ jQuery(document).ready(function() { $('#dashSpeed').change(function(){ - var timerSpeed = Math.round(1000 * 60 / $('#dashSpeed').val() ); - mPlayer.setPlaySpeed(timerSpeed); + ctl_changeSpeed(); }); // removed from view diff --git a/fretboard.html b/fretboard.html index 3962d80..c19c0d9 100644 --- a/fretboard.html +++ b/fretboard.html @@ -164,13 +164,24 @@ Link | - Quiz link | Refresh
+ Quiz link | + Reset +
Examples: