From ff744a2c19608bc9a45149ce75fa5cba7c5e1675 Mon Sep 17 00:00:00 2001 From: vonavi Date: Tue, 8 Jul 2014 17:09:24 +0300 Subject: [PATCH] Navigate through game moves by mouse wheel over the chess board. --- _layouts/default.html | 1 + assets/js/custom.js | 14 ++++++++++++++ assets/js/jquery.mousewheel.min.js | 1 + 3 files changed, 16 insertions(+) create mode 120000 assets/js/jquery.mousewheel.min.js diff --git a/_layouts/default.html b/_layouts/default.html index 1372ca6..1d2a730 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -39,6 +39,7 @@ + diff --git a/assets/js/custom.js b/assets/js/custom.js index 474c666..f6d3d02 100644 --- a/assets/js/custom.js +++ b/assets/js/custom.js @@ -17,12 +17,26 @@ $(function() { sortReset : true, sortRestart : true }); + + /* Navigate through game moves by mouse wheel over the chess board */ + $('#GameBoard').mousewheel(function(event) { + if (event.deltaY == -1) { + $('#forwardButton').click(); + } else if (event.deltaY == 1) { + $('#backButton').click(); + } + event.stopPropagation(); + return false; + }); }) /* Stylize pgn4web elements by Bootstrap */ function customFunctionOnPgnGameLoad() { $('#GameSelSelect').addClass('form-control'); $('#autoplayButton').click(refreshButtonset); + + /* No titles for mouse wheel over the chess board */ + $('#GameBoard .pieceImage').removeAttr('title'); } function customFunctionOnMove() { refreshButtonset(); diff --git a/assets/js/jquery.mousewheel.min.js b/assets/js/jquery.mousewheel.min.js new file mode 120000 index 0000000..f31808d --- /dev/null +++ b/assets/js/jquery.mousewheel.min.js @@ -0,0 +1 @@ +../vendor/jquery-mousewheel/jquery.mousewheel.min.js \ No newline at end of file