From: Vincent Vanwaelscappel Date: Tue, 29 Sep 2020 17:32:18 +0000 (+0200) Subject: wait #3789 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=a2792df9c998b99c2422b1b353877bbdf56e8571;p=fluidbook-html5.git wait #3789 @2 --- diff --git a/images/interface.svg b/images/interface.svg index b97cd6ab..a32ecd3d 100644 --- a/images/interface.svg +++ b/images/interface.svg @@ -152,4 +152,44 @@ C19.5,15.6,19.8,15.5,19.9,15.2z M10.2,20c0,0.4-0.3,0.7-0.7,0.7S8.8,20.4,8.8,20s0.3-0.7,0.7-0.7S10.2,19.6,10.2,20z M17.7,20.7 c-0.4,0-0.7-0.3-0.7-0.7s0.3-0.7,0.7-0.7s0.7,0.3,0.7,0.7S18.1,20.7,17.7,20.7z M8.8,14.1L7.5,8.8h13.2l-2,5.4H8.8V14.1z"/> + + + + + + + + + + + + + + + + diff --git a/images/slick/ajax-loader.gif b/images/slick/ajax-loader.gif deleted file mode 100755 index e0e6e976..00000000 Binary files a/images/slick/ajax-loader.gif and /dev/null differ diff --git a/js/libs/fluidbook/fluidbook.accessibility.js b/js/libs/fluidbook/fluidbook.accessibility.js index cb9b3018..65525eeb 100644 --- a/js/libs/fluidbook/fluidbook.accessibility.js +++ b/js/libs/fluidbook/fluidbook.accessibility.js @@ -24,9 +24,7 @@ FluidbookAccessibility.prototype = { if (Modernizr.audio) { this.audiodescription.setupPages(); } - this.updateTexts(); - }, updateTexts: function () { @@ -81,8 +79,9 @@ FluidbookAccessibility.prototype = { }); add_event_listener('keydown', function (e) { - if(e.keyCode===9) { + if (e.keyCode === 9) { $('body').addClass('keyboard-navigating'); + fluidbook.input.useKeyboard(); set_css(''); } }); diff --git a/js/libs/fluidbook/fluidbook.help.js b/js/libs/fluidbook/fluidbook.help.js index 079ceaf3..acbdc3f8 100644 --- a/js/libs/fluidbook/fluidbook.help.js +++ b/js/libs/fluidbook/fluidbook.help.js @@ -57,11 +57,20 @@ FluidbookHelp.prototype = { } else { var name = 'fingers'; var text = this.fluidbook.l10n.__("tap twice or spread your fingers to zoom in"); - help += '
' + this.fluidbook.loader.getImage('data/images/help-' + name + '.svg', 400 * touchzoom, 200 * touchzoom); + help += '
' + getSpriteIcon('help-touch-zoom', { + width: 180 * touchzoom, + height: 170 * touchzoom + }); help += '

' + text + '

'; help += '
'; } + + help += '
'; + help += '
Ctrl++
Ctrl+-
'; + help += '

' + this.fluidbook.l10n.__('zoom in and zoom out') + '

'; + help += '
' + name = 'mouse'; if (this.fluidbook.mobilefirst.enabled) { text = this.fluidbook.l10n.__('scroll down to read the page content'); @@ -69,7 +78,10 @@ FluidbookHelp.prototype = { text = this.fluidbook.l10n.__('click once to zoom in, click again to zoom out') + '
' + this.fluidbook.l10n.__('roll the mouse wheel to zoom in/out'); } - help += '
' + this.fluidbook.loader.getImage('data/images/help-' + name + '.svg', 100 * mousezoom, 200 * mousezoom); + help += '
' + getSpriteIcon('help-mouse', { + width: 60 * mousezoom, + height: 100 * mousezoom + }); help += '

' + text + '

'; help += '
'; @@ -99,6 +111,13 @@ FluidbookHelp.prototype = { return; } + var shortcuts = $(this).attr('aria-keyshortcuts'); + if (shortcuts === null || shortcuts === undefined || shortcuts === '') { + shortcuts = []; + } else { + shortcuts = shortcuts.split('+'); + } + var icon = $(this).find('.nav-icon:visible:first'); // Must get first visible icon so "toggle" icons work if (icon.length > 0) { var offset = icon.offset(); @@ -119,7 +138,7 @@ FluidbookHelp.prototype = { if ($(this).parents("#afterSearch").length > 0) { c = 'afterSearch'; } - help += '
' + text + '
'; + help += '
' + $this.keyboardShortcut(shortcuts) + text + '
'; h -= hStep; } }); @@ -144,10 +163,10 @@ FluidbookHelp.prototype = { if (this.fluidbook.interface.arrowsEnabled()) { var labels = this.fluidbook.interface.getLabels(); help += '
'; - help += ''; - help += '
' + labels.last + '
'; - help += ''; - help += '
' + labels.first + '
'; + help += ''; + help += '
' + labels.last + this.keyboardShortcut(['End']) + '
'; + help += ''; + help += '
' + this.keyboardShortcut(['Home']) + labels.first + '
'; help += '
'; } if ($("#slider").length > 0) { @@ -466,13 +485,29 @@ FluidbookHelp.prototype = { html += $('
')[0].outerHTML; // Help text label - html += $('
' + this.fluidbook.l10n.__('add / remove bookmark') + '
')[0].outerHTML; + html += $('
' + this.keyboardShortcut(['Ctrl', 'Alt', 'D']) + this.fluidbook.l10n.__('add / remove bookmark') + '
')[0].outerHTML; var wrapper = $('
' + html + '
')[0].outerHTML if (wrapper === undefined || wrapper === 'undefined') { return ''; } return wrapper; - } + }, + + keyboardShortcut: function (keys) { + if (keys.length === 0) { + return ''; + } + var map = {Control: 'Ctrl'}; + var norm = []; + $.each(keys, function (k, v) { + if (map[v] !== undefined) { + norm.push(map[v]); + } else { + norm.push(v); + } + }); + return '
' + norm.join('+') + '
'; + }, } diff --git a/js/libs/fluidbook/fluidbook.input.js b/js/libs/fluidbook/fluidbook.input.js index b5413f8c..b6a6ac62 100644 --- a/js/libs/fluidbook/fluidbook.input.js +++ b/js/libs/fluidbook/fluidbook.input.js @@ -6,6 +6,9 @@ function FluidbookInput(fluidbook) { this.usingTouch = false; this.hasTouch = false; this.forceTouch = false; + this.hasKeyboard = false; + this.usingKeyboard = false; + this.forceKeyboard = false; this.init(); } @@ -16,16 +19,17 @@ FluidbookInput.prototype = { this.hasTouch = true; } else { this.usingMouse = this.hasMouse = this.forceMouse = true; + this.usingKeyboard = this.forceKeyboard = false; + this.hasKeyboard = true; this.usingTouch = this.hasTouch = this.forceTouch = false; this.setMouseClasses(); - return; } if (Modernizr.ios || Modernizr.android) { this.usingTouch = this.hasTouch = this.forceTouch = true; this.usingMouse = this.hasMouse = this.forceMouse = false; + this.usingKeyboard = this.hasKeyboard = this.forceKeyboard = false; this.setTouchClasses(); - return; } this.forceTouch = this.forceMouse = false; @@ -48,32 +52,55 @@ FluidbookInput.prototype = { isUsingMouse: function () { return this.usingMouse; }, + isUsingKeyboard: function () { + return this.usingKeyboard; + }, useTouch: function () { if (!this.usingTouch) { this.hasTouch = this.usingTouch = true; - this.usingMouse = false; + this.usingKeyboard = this.usingMouse = false; this.setTouchClasses(); } }, useMouse: function () { if (!this.usingMouse) { this.hasMouse = this.usingMouse = true; - this.usingTouch = false; + this.usingKeyboard = this.usingTouch = false; this.setMouseClasses(); } }, + useKeyboard: function () { + if (!this.usingKeyboard) { + this.hasKeyboard = this.usingKeyboard = true; + this.usingMouse = this.usingTouch = false; + this.setKeyboardClasses(); + } + }, setTouchClasses: function () { $('html').removeClass('using-mouse') .removeClass('no-using-touch') + .removeClass('using-keyboard') .addClass('no-using-mouse') - .addClass('using-touch'); + .addClass('using-touch') + .addClass('no-using-keyboard'); + }, setMouseClasses: function () { $('html').addClass('using-mouse') .addClass('no-using-touch') + .addClass('no-using-keyboard') .removeClass('no-using-mouse') - .removeClass('using-touch'); + .removeClass('using-touch') + .removeClass('using-keyboard'); + }, + setKeyboardClasses: function () { + $('html').addClass('using-keyboard') + .addClass('no-using-touch') + .addClass('no-using-mouse') + .removeClass('no-using-keyboard') + .removeClass('using-touch') + .removeClass('using-mouse'); } }; \ No newline at end of file diff --git a/js/libs/fluidbook/fluidbook.keyboard.js b/js/libs/fluidbook/fluidbook.keyboard.js index 6920a654..7cfa8fe7 100644 --- a/js/libs/fluidbook/fluidbook.keyboard.js +++ b/js/libs/fluidbook/fluidbook.keyboard.js @@ -121,7 +121,6 @@ FluidbookKeyboard.prototype = { }); this.keyShortcut('up,down', function (e, handler) { - if ($this.fluidbook.search.isHintsNavOpened()) { $this.fluidbook.search.navigateHint(handler.key === 'down' ? 1 : -1); e.preventDefault(); @@ -203,6 +202,7 @@ FluidbookKeyboard.prototype = { } hotkeys(s.shortcuts, s.options, function (e, handler) { func(e, handler); + fluidbook.input.useKeyboard(); if (preventDefault) { e.preventDefault(); } diff --git a/js/libs/slick/slick.min.js b/js/libs/slick/slick.min.js deleted file mode 100644 index 42172c2f..00000000 --- a/js/libs/slick/slick.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";var e=window.Slick||{};(e=function(){var e=0;return function(t,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(t),appendDots:i(t),arrows:!0,asNavFor:null,prevArrow:'',nextArrow:'',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('