From 7fbf010ee63137df2b599019871983d675ab91f7 Mon Sep 17 00:00:00 2001 From: Joshua Simmons Date: Mon, 12 Sep 2011 17:53:47 -0700 Subject: [PATCH 1/2] problem && view: don't search from game root on click --- player/js/all.compressed.js | 2 +- player/js/player.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/player/js/all.compressed.js b/player/js/all.compressed.js index 38ea480..c4d8422 100644 --- a/player/js/all.compressed.js +++ b/player/js/all.compressed.js @@ -1907,7 +1907,7 @@ return; } } } -if(this.mode=="view"){ +if(this.mode=="view"&&!this.problemMode){ var _a7=this.cursor.getGameRoot(),_a8=[0,_a7.getPosition()],mn=0,_aa=_a7._children[0]; while(_aa){ if(_aa.getMove()==_a4){ diff --git a/player/js/player.js b/player/js/player.js index 436bbe5..f281176 100644 --- a/player/js/player.js +++ b/player/js/player.js @@ -1132,7 +1132,7 @@ eidogo.Player.prototype = { } } - if (this.mode == "view") { + if (this.mode == "view" && !this.problemMode) { // Jump to any moved played at the clicked coordinate var root = this.cursor.getGameRoot(), path = [0, root.getPosition()], From 073af0820952673c2228534388858983736e5c24 Mon Sep 17 00:00:00 2001 From: Joshua Simmons Date: Mon, 12 Sep 2011 20:59:24 -0700 Subject: [PATCH 2/2] add a setting to restrict view mode move searching this gives the same behavior in that regard as problemMode, clicking on empty locations won't search for moves there in the entire game tree, just from the current cursor location --- player/js/all.compressed.js | 3 ++- player/js/player.js | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/player/js/all.compressed.js b/player/js/all.compressed.js index c4d8422..451a61c 100644 --- a/player/js/all.compressed.js +++ b/player/js/all.compressed.js @@ -1277,6 +1277,7 @@ this.prefs={}; this.prefs.markCurrent=typeof cfg.markCurrent!="undefined"?!!cfg.markCurrent:true; this.prefs.markNext=typeof cfg.markNext!="undefined"?cfg.markNext:false; this.prefs.markVariations=typeof cfg.markVariations!="undefined"?!!cfg.markVariations:true; +this.prefs.restrictViewMoveSearch=typeof cfg.restrictViewMoveSearch!="undefined"?!!cfg.restrictViewMoveSearch:false; this.prefs.showGameInfo=!!cfg.showGameInfo; this.prefs.showPlayerInfo=!!cfg.showPlayerInfo; this.prefs.showTools=!!cfg.showTools; @@ -1907,7 +1908,7 @@ return; } } } -if(this.mode=="view"&&!this.problemMode){ +if(this.mode=="view"&&!(this.problemMode||this.prefs.restrictViewMoveSearch)){ var _a7=this.cursor.getGameRoot(),_a8=[0,_a7.getPosition()],mn=0,_aa=_a7._children[0]; while(_aa){ if(_aa.getMove()==_a4){ diff --git a/player/js/player.js b/player/js/player.js index f281176..82cbc05 100644 --- a/player/js/player.js +++ b/player/js/player.js @@ -301,6 +301,8 @@ eidogo.Player.prototype = { cfg.markNext : false; this.prefs.markVariations = typeof cfg.markVariations != "undefined" ? !!cfg.markVariations : true; + this.prefs.restrictViewMoveSearch = typeof cfg.restrictViewMoveSearch != "undefined" ? + !!cfg.restrictViewMoveSearch : false; this.prefs.showGameInfo = !!cfg.showGameInfo; this.prefs.showPlayerInfo = !!cfg.showPlayerInfo; this.prefs.showTools = !!cfg.showTools; @@ -1132,7 +1134,8 @@ eidogo.Player.prototype = { } } - if (this.mode == "view" && !this.problemMode) { + if (this.mode == "view" && !(this.problemMode || + this.prefs.restrictViewMoveSearch)) { // Jump to any moved played at the clicked coordinate var root = this.cursor.getGameRoot(), path = [0, root.getPosition()],