Sha256: 6a19e778ae0b4641143b47350463843c4a318d4f8e97bbf3a52fa017cc05eaeb

Contents?: true

Size: 1.23 KB

Versions: 7

Compression:

Stored size: 1.23 KB

Contents

<script src="https://cdn.jsdelivr.net/npm/hotkeys-js/dist/hotkeys.min.js"></script>
<script>
    $(document).ready(function () {
        var previous_url = $("meta[property='og:previous_url']").attr('content');
        var next_url = $("meta[property='og:next_url']").attr('content');

        hotkeys('left', function (event, handler) {
            // Prevent the default refresh event under WINDOWS system
            event.preventDefault();
            if (previous_url) {
                console.log('you pressed left!');
                window.location.href = previous_url;
            } else {
                $("#no-previous").addClass("active");
                setTimeout(function () { $("#no-previous").removeClass("active"); }, 1500);
            }
        });

        hotkeys('right', function (event, handler) {
            // Prevent the default refresh event under WINDOWS system
            event.preventDefault();
            if (next_url) {
                console.log('you pressed right!');
                window.location.href = next_url;
            } else {
                $("#no-next").addClass("active");
                setTimeout(function () { $("#no-next").removeClass("active"); }, 1500);
            }
        });
    });
</script>

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
jekyll-theme-h2o-ac-1.5.1 _includes/plugins/markdown/hotkeys.html
jekyll-theme-h2o-ac-1.5.0 _includes/plugins/markdown/hotkeys.html
jekyll-theme-h2o-ac-1.4.0 _includes/plugins/markdown/hotkeys.html
jekyll-theme-h2o-ac-1.3.6 _includes/plugins/markdown/hotkeys.html
jekyll-theme-h2o-ac-1.3.5 _includes/plugins/markdown/hotkeys.html
jekyll-theme-h2o-ac-1.3.4 _includes/plugins/markdown/hotkeys.html
jekyll-theme-h2o-ac-1.3.1 _includes/plugins/markdown/hotkeys.html