From 01e2c53243e7bea9121557f3f10134b60621c6ab Mon Sep 17 00:00:00 2001 From: Daniel Weck Date: Wed, 5 Feb 2014 07:36:32 +0000 Subject: [PATCH 1/6] added the play/pause button state that was removed by mistake when migrating from bitmap spritesheet to scalable icon font. --- css/viewer.css | 7 ++++++ epub_content/epub_library.json | 40 ++++++++++++++++++++++++++++++++++ templates/reader-navbar.html | 3 ++- 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/css/viewer.css b/css/viewer.css index d663dfc7c..c3f89d8c0 100644 --- a/css/viewer.css +++ b/css/viewer.css @@ -156,6 +156,13 @@ opacity: 0.3; } +#btn-toggle-audio:not(.pause-audio) > #icon-pause { + display: none; +} + +#btn-toggle-audio.pause-audio > #icon-play { + display: none; +} #volume-range-slider { position: relative; diff --git a/epub_content/epub_library.json b/epub_content/epub_library.json index 42b0675a0..116990f3a 100644 --- a/epub_content/epub_library.json +++ b/epub_content/epub_library.json @@ -25,6 +25,46 @@ "author" : "Robert A. Beezer", "packagePath" : "EPUB/package.opf", "rootUrl" : "epub_content/linear-algebra" + }, + + { + "title" : "Moby Dick MO", + "author" : "Herman Melville", + "coverHref" : "epub_content/moby-dick-MO-HACKED/OPS/images/9780316000000.jpg", + "packagePath" : "OPS/package.opf", + "rootUrl" : "epub_content/moby-dick-MO-HACKED" + }, + { + "title" : "EPUB3 TEST 120 (MO reflow)", + "author" : "EPUB TEST SUITE", + "packagePath" : "EPUB/package.opf", + "rootUrl" : "epub_content/epub30-test-0120-20131108" + }, + { + "title" : "EPUB3 TEST 220 (MO fixed)", + "author" : "EPUB TEST SUITE", + "packagePath" : "EPUB/package.opf", + "rootUrl" : "epub_content/epub30-test-0220-20131108" + }, + { + "title" : "Ladybug Girl", + "author" : "David Soman and Jacky Davis", + "coverHref" : "epub_content/ladybugg_cbuscepgi034l00e/OEBPS/images/0001.jpg", + "packagePath" : "OEBPS/package.opf", + "rootUrl" : "epub_content/ladybugg_cbuscepgi034l00e" + }, + { + "title" : "Ripple's Effect", + "author" : "KiteReaders", + "coverHref" : "epub_content/ripplese_cbuscekev007pt0h/OEBPS/images/cover.jpg", + "packagePath" : "OEBPS/package.opf", + "rootUrl" : "epub_content/ripplese_cbuscekev007pt0h" + }, + { + "title" : "EPUB3-Sliderizer_epubReadingSystem", + "author" : "Daniel Weck", + "packagePath" : "epub/package.opf", + "rootUrl" : "epub_content/EPUB3-Sliderizer_epubReadingSystem" } ] diff --git a/templates/reader-navbar.html b/templates/reader-navbar.html index aaa1dcee7..43d4ad37f 100644 --- a/templates/reader-navbar.html +++ b/templates/reader-navbar.html @@ -13,7 +13,8 @@ From 3becd5c94d665159b5c0c4265b659f81f8429357 Mon Sep 17 00:00:00 2001 From: Daniel Weck Date: Wed, 5 Feb 2014 07:52:28 +0000 Subject: [PATCH 3/6] mute/unmute control --- lib/EpubReader.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/EpubReader.js b/lib/EpubReader.js index 856e0d6d5..7152b8578 100644 --- a/lib/EpubReader.js +++ b/lib/EpubReader.js @@ -368,8 +368,12 @@ define(['module','jquery', 'bootstrap', 'URIjs', 'Readium', 'Spinner', 'storage/ volumeButtonAppearance($volumeButton, volumeVal); }); + var _lastVolumeBeforeMute = '0'; + $volumeButton.on("click", function() { - var volumeVal = '0'; + var currentVolume = $changeVolumeControl.val(); + var volumeVal = currentVolume === '0' ? _lastVolumeBeforeMute : '0'; + _lastVolumeBeforeMute = currentVolume; //readium.reader.setVolumeMediaOverlay(volumeVal); readium.reader.updateSettings({ From 501a9def997875bbde51e7b029b78979e3793d1f Mon Sep 17 00:00:00 2001 From: Daniel Weck Date: Wed, 5 Feb 2014 08:56:10 +0000 Subject: [PATCH 4/6] accessibility: added missing i18n language strings (Media Overlays control + page previous/next), and added fallback mechanism to en-US (+ console log for missing strings) --- i18n/Strings.js | 13 ++++++++++--- i18n/_locales/en_US/messages.json | 27 +++++++++++++++++++++++++++ i18n/_locales/fr/messages.json | 27 +++++++++++++++++++++++++++ lib/EpubReader.js | 2 +- templates/reader-body.html | 6 +++--- templates/reader-navbar.html | 14 +++++++------- 6 files changed, 75 insertions(+), 14 deletions(-) diff --git a/i18n/Strings.js b/i18n/Strings.js index 76b31be19..9c9e2649b 100644 --- a/i18n/Strings.js +++ b/i18n/Strings.js @@ -23,13 +23,20 @@ function(de, en_US, fr, id, it, ja, ko, pt_BR, zh_CN, zh_TW){ Strings['zh_TW'] = zh_TW; var language = navigator.userLanguage || navigator.language; - + console.log("Language: [" + language + "]"); + + var allowEnglishFallback = true; + var i18nStr = Strings[language] || en_US; var i18nObj = JSON.parse(i18nStr); + var i18nObj_en = i18nStr === en_US ? i18nObj : JSON.parse(en_US); - for(var prop in i18nObj){ - i18nObj[prop] = i18nObj[prop].message; + for(var prop in i18nObj_en){ + var okay = prop in i18nObj; + if (!okay) console.log("Language [" + language + "], missing string: [" + prop + "]"); + + i18nObj[prop] = okay ? i18nObj[prop].message : (allowEnglishFallback ? ("* " + i18nObj_en[prop].message + " *") : ""); } return i18nObj; diff --git a/i18n/_locales/en_US/messages.json b/i18n/_locales/en_US/messages.json index 9ad000cfc..14f34e584 100644 --- a/i18n/_locales/en_US/messages.json +++ b/i18n/_locales/en_US/messages.json @@ -231,6 +231,33 @@ "i18n_html_readium_tm_a_project" : { "message" : "ReadiumTM, a project of the International Digital Publishing Forum (IDPF) and supporters, is an open source reference system and rendering engine for EPUB® publications. To learn more, visit the project homepage. To date, the project development has been lead by Evident Point and Bluefire Productions. To contribute visit the github repository" }, + "i18n_audio_play" : { + "message" : "Play" + }, + "i18n_audio_pause" : { + "message" : "Pause" + }, + "i18n_audio_previous" : { + "message" : "Previous audio phrase" + }, + "i18n_audio_next" : { + "message" : "Next audio phrase" + }, + "i18n_audio_volume" : { + "message" : "Audio volume" + }, + "i18n_audio_mute" : { + "message" : "Mute audio" + }, + "i18n_audio_unmute" : { + "message" : "Unmute audio" + }, + "i18n_page_previous" : { + "message" : "P̲revious Page" + }, + "i18n_page_next" : { + "message" : "N̲ext Page" + }, "chrome_accept_languages": { "message": "$CHROME$ accepts $languages$ languages", "placeholders": { diff --git a/i18n/_locales/fr/messages.json b/i18n/_locales/fr/messages.json index 3c598ed62..7dbadccfc 100644 --- a/i18n/_locales/fr/messages.json +++ b/i18n/_locales/fr/messages.json @@ -149,6 +149,33 @@ "i18n_html_readium_tm_a_project" : { "message" : "ReadiumTM, un projet de l'International Digital Publishing Forum (IDPF) et de ses adhérents, est un système à code-source libre de référence et un moteur de rendu pour les publications EPUB®. Pour en savoir plus, visitez la page du projet. À ce jour, le développement du projet a été menée par Evident Point et par Bluefire Productions. Pour contribuer, visiter le dépôt github." }, + "i18n_audio_play" : { + "message" : "Jouer" + }, + "i18n_audio_pause" : { + "message" : "Pauser" + }, + "i18n_audio_previous" : { + "message" : "Phrase audio précédente" + }, + "i18n_audio_next" : { + "message" : "Phrase audio suivante" + }, + "i18n_audio_volume" : { + "message" : "Contrôle du volume audio" + }, + "i18n_audio_mute" : { + "message" : "Silence audio" + }, + "i18n_audio_unmute" : { + "message" : "Restaurer le volume audio" + }, + "i18n_page_previous" : { + "message" : "Page précédente (P̲)" + }, + "i18n_page_next" : { + "message" : "Page suivante (N̲)" + }, "chrome_accept_languages": { "message": "$CHROME$ accepts $languages$ languages", "placeholders": { diff --git a/lib/EpubReader.js b/lib/EpubReader.js index 7152b8578..c64054c3c 100644 --- a/lib/EpubReader.js +++ b/lib/EpubReader.js @@ -225,7 +225,7 @@ define(['module','jquery', 'bootstrap', 'URIjs', 'Readium', 'Spinner', 'storage/ $('.modal-backdrop').remove(); var $appContainer = $('#app-container'); $appContainer.empty(); - $appContainer.append(ReaderBody({})); + $appContainer.append(ReaderBody({strings: Strings})); $appContainer.append(AboutDialog({strings: Strings})); $('nav').empty(); $('nav').append(ReaderNavbar({strings: Strings})); diff --git a/templates/reader-body.html b/templates/reader-body.html index 98b77ed96..b0acbc927 100644 --- a/templates/reader-body.html +++ b/templates/reader-body.html @@ -1,12 +1,12 @@
- - + + - +
diff --git a/templates/reader-navbar.html b/templates/reader-navbar.html index e050b05a0..67ccc6848 100644 --- a/templates/reader-navbar.html +++ b/templates/reader-navbar.html @@ -9,22 +9,22 @@
- - - +
+ + +