From 64d6118b96fc07d86bf5d2176ca0b98259d8cc92 Mon Sep 17 00:00:00 2001 From: Juan Corona Date: Wed, 24 Jan 2018 15:07:17 -0800 Subject: [PATCH] Further decouple from readium-cfi-js library by migrating over to references to readium-shared-js --- README.md | 10 +- .../RequireJS_config_multiple-bundles.js | 4 +- ...S_config_multiple-bundles_external-libs.js | 2 +- .../RequireJS_config_single-bundle.js | 2 +- ...S_config_single-bundle_CHROMEAPP-WORKER.js | 2 +- ...equireJS_config_single-bundle_CHROMEAPP.js | 2 +- .../RequireJS_config_single-bundle_LITE.js | 2 +- build-config/versioning.js | 6 +- dev/index_RequireJS_multiple-bundles.html | 6 +- ...index_RequireJS_multiple-bundles_LITE.html | 6 +- dev/index_RequireJS_no-optimize.html | 5 +- dev/index_RequireJS_no-optimize_LITE.html | 5 +- dev/version.json | 4 - package.json | 98 +++++++++---------- readium-js | 2 +- src/js/EpubReader.js | 12 --- src/templates/about-dialog.html | 3 +- 17 files changed, 68 insertions(+), 103 deletions(-) diff --git a/README.md b/README.md index 5f64d2b0e..1a9bdba46 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ See [license.txt](./license.txt). * `git clone --recursive -b BRANCH_NAME https://github.com/readium/readium-js-viewer.git readium-js-viewer` (replace "BRANCH_NAME" with e.g. "develop") * `cd readium-js-viewer` -* `git submodule update --init --recursive` to ensure that the readium-js-viewer chain of dependencies is initialised (readium-js, readium-shared-js and readium-cfi-js) +* `git submodule update --init --recursive` to ensure that the readium-js-viewer chain of dependencies is initialised (readium-js, readium-shared-js) * `git checkout BRANCH_NAME && git submodule foreach --recursive "git checkout BRANCH_NAME"` (or simply `cd` inside each repository / submodule, and manually enter the desired branch name: `git checkout BRANCH_NAME`) Git should automatically track the corresponding branch in the 'origin' remote. @@ -96,7 +96,7 @@ Remark: logs of HTTP requests are preserved in two separate files `http_app.log` ### Forking -Assuming a fork of `https://github.com/readium/readium-js-viewer` is made under `USER` at `https://github.com/USER/readium-js-viewer`, the `.gitmodules` file ( https://github.com/readium/readium-js-viewer/blob/develop/.gitmodules ) will still point to the original submodule URL (at `readium`, instead of `USER`). Thankfully, one can simply modify the `.gitmodules` file by replacing `https://github.com/readium/` with `https://github.com/USER/`, and do this for every submodule (`readium-js-viewer` > `readium-js` > `readium-shared-js` > `readium-cfi-js`). Then the Git command `git submodule sync` can be invoked, for each submodule. +Assuming a fork of `https://github.com/readium/readium-js-viewer` is made under `USER` at `https://github.com/USER/readium-js-viewer`, the `.gitmodules` file ( https://github.com/readium/readium-js-viewer/blob/develop/.gitmodules ) will still point to the original submodule URL (at `readium`, instead of `USER`). Thankfully, one can simply modify the `.gitmodules` file by replacing `https://github.com/readium/` with `https://github.com/USER/`, and do this for every submodule (`readium-js-viewer` > `readium-js` > `readium-shared-js`). Then the Git command `git submodule sync` can be invoked, for each submodule. ### Plugins integration @@ -261,12 +261,6 @@ Usage is demonstrated by the HTML file in the `dev` folder (trimmed for brevity) - - - - - - diff --git a/build-config/RequireJS_config_multiple-bundles.js b/build-config/RequireJS_config_multiple-bundles.js index b99ae290e..40368702d 100644 --- a/build-config/RequireJS_config_multiple-bundles.js +++ b/build-config/RequireJS_config_multiple-bundles.js @@ -24,7 +24,7 @@ require.config({ name: "readium-js-viewer", create: true, include: ["readium_js_viewer/ReadiumViewer"], - exclude: ["readium-js", "readium-external-libs", "readium-shared-js", "readium-cfi-js"], + exclude: ["readium-js", "readium-external-libs", "readium-shared-js"], insertRequire: [ "readium_js_viewer/ReadiumViewer" ] @@ -34,7 +34,7 @@ require.config({ name: "readium-js-viewer_LITE", create: true, include: ["readium_js_viewer/ReadiumViewerLite"], - exclude: ["readium-js", "readium-external-libs", "readium-shared-js", "readium-cfi-js"], + exclude: ["readium-js", "readium-external-libs", "readium-shared-js"], insertRequire: [ "readium_js_viewer/ReadiumViewerLite" ] diff --git a/build-config/RequireJS_config_multiple-bundles_external-libs.js b/build-config/RequireJS_config_multiple-bundles_external-libs.js index e51698695..88250913a 100644 --- a/build-config/RequireJS_config_multiple-bundles_external-libs.js +++ b/build-config/RequireJS_config_multiple-bundles_external-libs.js @@ -25,7 +25,7 @@ require.config({ create: true, include: ["jath", "bootstrap", "bootstrapA11y", "hammerjs", "hogan", "jquery_hammer", "keymaster", "screenfull", "spin", "mime-types", "zip", "zip-ext", "zip-fs", "cryptoJs/sha1", "cryptoJs/core", - 'jquery', + 'jquery', 'readium_cfi_js', 'underscore', 'URIjs', 'punycode', 'SecondLevelDomains', 'IPv6', 'jquerySizes', 'domReady', 'eventEmitter', 'console_shim', 'rangy', 'rangy-core', 'rangy-textrange', 'rangy-highlighter', 'rangy-cssclassapplier', 'rangy-position'] diff --git a/build-config/RequireJS_config_single-bundle.js b/build-config/RequireJS_config_single-bundle.js index eafffbc69..9aa5a960e 100644 --- a/build-config/RequireJS_config_single-bundle.js +++ b/build-config/RequireJS_config_single-bundle.js @@ -37,6 +37,6 @@ require.config({ process._RJS_rootDir(2) + '/build-output/version', "readium-js-viewer_all": - process._RJS_rootDir(2) + '/readium-js/readium-shared-js/readium-cfi-js/node_modules/almond/almond' + process._RJS_rootDir(2) + '/readium-js/readium-shared-js/node_modules/almond/almond' } }); diff --git a/build-config/RequireJS_config_single-bundle_CHROMEAPP-WORKER.js b/build-config/RequireJS_config_single-bundle_CHROMEAPP-WORKER.js index d9271f722..b0a9e2b8c 100644 --- a/build-config/RequireJS_config_single-bundle_CHROMEAPP-WORKER.js +++ b/build-config/RequireJS_config_single-bundle_CHROMEAPP-WORKER.js @@ -34,7 +34,7 @@ require.config({ paths: { "readium-js-viewer_CHROMEAPP-WORKER": - process._RJS_rootDir(2) + '/readium-js/readium-shared-js/readium-cfi-js/node_modules/almond/almond', + process._RJS_rootDir(2) + '/readium-js/readium-shared-js/node_modules/almond/almond', "readium_js_viewer_RJS-CONFIG": process._RJS_rootDir(2) + '/src/chrome-app/requirejs-config', diff --git a/build-config/RequireJS_config_single-bundle_CHROMEAPP.js b/build-config/RequireJS_config_single-bundle_CHROMEAPP.js index fbfd93df3..c5a078c27 100644 --- a/build-config/RequireJS_config_single-bundle_CHROMEAPP.js +++ b/build-config/RequireJS_config_single-bundle_CHROMEAPP.js @@ -37,7 +37,7 @@ require.config({ process._RJS_rootDir(2) + '/build-output/version', "readium-js-viewer_all_CHROMEAPP": - process._RJS_rootDir(2) + '/readium-js/readium-shared-js/readium-cfi-js/node_modules/almond/almond', + process._RJS_rootDir(2) + '/readium-js/readium-shared-js/node_modules/almond/almond', "readium_js_viewer_RJS-CONFIG": process._RJS_rootDir(2) + '/src/chrome-app/requirejs-config', diff --git a/build-config/RequireJS_config_single-bundle_LITE.js b/build-config/RequireJS_config_single-bundle_LITE.js index 60329881b..c01457745 100644 --- a/build-config/RequireJS_config_single-bundle_LITE.js +++ b/build-config/RequireJS_config_single-bundle_LITE.js @@ -37,6 +37,6 @@ require.config({ process._RJS_rootDir(2) + '/build-output/version', "readium-js-viewer_all_LITE": - process._RJS_rootDir(2) + '/readium-js/readium-shared-js/readium-cfi-js/node_modules/almond/almond' + process._RJS_rootDir(2) + '/readium-js/readium-shared-js/node_modules/almond/almond' } }); diff --git a/build-config/versioning.js b/build-config/versioning.js index 08a60bac6..435ca9d33 100644 --- a/build-config/versioning.js +++ b/build-config/versioning.js @@ -4,16 +4,14 @@ var path = require('path'); var path_readiumJSViewer = process.cwd(); var path_readiumJS = path.join(path_readiumJSViewer, '/readium-js'); var path_readiumSharedJS = path.join(path_readiumJS, '/readium-shared-js'); -var path_readiumCfiJS = path.join(path_readiumSharedJS, '/readium-cfi-js'); var repoNamePaths = { "readiumJsViewer": path_readiumJSViewer, "readiumJs": path_readiumJS, - "readiumSharedJs": path_readiumSharedJS, - "readiumCfiJs": path_readiumCfiJS + "readiumSharedJs": path_readiumSharedJS }; -var filePath = path.join(process.cwd(), 'readium-js', 'readium-shared-js', 'readium-cfi-js', 'readium-build-tools', 'versionsMaker.js') +var filePath = path.join(process.cwd(), 'readium-js', 'readium-shared-js', 'readium-build-tools', 'versionsMaker.js') var fs = require("fs"); fs.readFile( diff --git a/dev/index_RequireJS_multiple-bundles.html b/dev/index_RequireJS_multiple-bundles.html index 0b0e00467..f5ad88912 100644 --- a/dev/index_RequireJS_multiple-bundles.html +++ b/dev/index_RequireJS_multiple-bundles.html @@ -51,8 +51,6 @@ - - @@ -69,8 +67,6 @@ - - @@ -92,7 +88,7 @@ - - @@ -58,8 +56,6 @@ - - @@ -81,7 +77,7 @@ + - @@ -55,7 +54,7 @@ + - @@ -42,7 +41,7 @@