├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .postcssrc.js ├── .travis.yml ├── AUTHORS.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── build ├── build.js ├── check-versions.js ├── dev-client.js ├── dev-server.js ├── utils.js ├── vue-loader.conf.js ├── webpack.base.conf.js ├── webpack.dev.conf.js └── webpack.prod.conf.js ├── config ├── dev.env.js ├── index.js └── prod.env.js ├── index.html ├── package.json ├── src ├── App.vue ├── cite-services │ ├── components │ │ └── Reader.vue │ └── widgets │ │ └── CtsUrn.vue ├── components │ ├── Homepage.vue │ ├── JsonObject.vue │ ├── Pagination.vue │ ├── Passage.vue │ └── Widget.vue ├── cts │ ├── components │ │ └── Reader.vue │ ├── tei.xsl │ └── widgets │ │ ├── TextGroup.vue │ │ ├── TextInventory.vue │ │ └── Work.vue ├── firebase.js ├── main.js ├── morphgnt │ ├── components │ │ ├── Reader.vue │ │ └── WordAnalysis.vue │ ├── index.js │ └── widgets │ │ ├── BookInfo.vue │ │ ├── BookSelect.vue │ │ ├── Frequency.vue │ │ ├── Interlinear.vue │ │ ├── Kwic.vue │ │ ├── TextColouring.vue │ │ ├── VerseLookup.vue │ │ └── WordInfo.vue ├── router │ └── index.js ├── store │ └── index.js ├── styles │ ├── common.scss │ ├── skeleton.scss │ └── theme.scss ├── utils.js └── widgets │ ├── BookmarkList.vue │ ├── Morpheus.vue │ └── TextFormatting.vue ├── static └── deep-reader-512.png └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { "modules": false }], 4 | "stage-2" 5 | ], 6 | "plugins": [ 7 | "transform-runtime", 8 | "transform-object-rest-spread" 9 | ], 10 | "comments": false, 11 | "env": { 12 | "test": { 13 | "presets": ["env", "stage-2"], 14 | "plugins": ["istanbul"] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | build/*.js 2 | config/*.js 3 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | // http://eslint.org/docs/user-guide/configuring 2 | 3 | module.exports = { 4 | root: true, 5 | parser: 'babel-eslint', 6 | parserOptions: { 7 | sourceType: 'module' 8 | }, 9 | env: { 10 | browser: true, 11 | }, 12 | extends: 'airbnb-base', 13 | // required to lint *.vue files 14 | plugins: [ 15 | 'html' 16 | ], 17 | // check if imports actually resolve 18 | 'settings': { 19 | 'import/resolver': { 20 | 'webpack': { 21 | 'config': 'build/webpack.base.conf.js' 22 | } 23 | } 24 | }, 25 | // add your custom rules here 26 | 'rules': { 27 | // don't require .vue extension when importing 28 | 'import/extensions': ['error', 'always', { 29 | 'js': 'never', 30 | 'vue': 'never' 31 | }], 32 | 'no-param-reassign': 0, 33 | // allow optionalDependencies 34 | 'import/no-extraneous-dependencies': ['error', { 35 | 'optionalDependencies': ['test/unit/index.js'] 36 | }], 37 | // allow debugger during development 38 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | // to edit target browsers: use "browserlist" field in package.json 6 | "autoprefixer": {} 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - "7" 5 | cache: 6 | yarn: true 7 | script: 8 | - yarn run lint 9 | -------------------------------------------------------------------------------- /AUTHORS.md: -------------------------------------------------------------------------------- 1 | # Principal Authors 2 | 3 | - James Tauber 4 | - Brian Rosner 5 | 6 | # Other Contributors 7 | 8 | - John D. Lewis 9 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at jtauber@jtauber.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2012–2017 James Tauber, Brian Rosner, and contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # DeepReader 4 | 5 | [![Join the chat at https://gitter.im/deep-reader/DeepReader](https://badges.gitter.im/deep-reader/DeepReader.svg)](https://gitter.im/deep-reader/DeepReader?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 6 | 7 | DeepReader is a highly modular, Vue.js-based framework designed for building online reading environments for deep reading of texts with rich annotations and integrated learning tools. 8 | 9 | It is particulary intended for the study of classical languages such as Ancient Greek but could be applied to any texts with rich annotations. What is here is an early prototype using the MorphGNT API and the CTS protocol but we plan to support other text services as well including EPUB. 10 | 11 | Reading environments built with the DeepReader framework could be as simple as Kindle-like apps but the real intention is to support deep reading with integrated dictionaries, linguistic annotations, and commentaries, as well as learning tools such as vocabulary flashcards and parsing drills. 12 | 13 | ![](https://files.gitter.im/deep-reader/DeepReader/4IrU/deepreader-intro.001.png) 14 | 15 | Each widget is a separate Vue.js component. We are working to make it as simple as possible to develop new widgets that interact and engage with the current passage, optionally calling out to external APIs. 16 | 17 | We are also experimenting with Firebase for persistence. Offline use is also planned as is packaging DeepReader up as an app for mobile use. 18 | 19 | ## Setup 20 | 21 | To run DeepReader in development mode, clone this repo then: 22 | 23 | npm install 24 | npm run dev 25 | 26 | Presently, there are two readers accessible at these paths: 27 | 28 | * CTS: http://localhost:5066/#/cts 29 | * MorphGNT: http://localhost:5066/#/morphgnt 30 | 31 | If you hover over the reader, you'll see various pluggable widgets on the left and right. Those on the left are used to choose what passage to read, and those on the right are used to present additional information about the passage and its individual words, and to control the appearance of the passage. 32 | 33 | You can expand or collapse any widget by clicking on its title. You can use the arrow keys on your keyboard to pagination between passages in a work. 34 | 35 | ## More Background 36 | 37 | * [Short Term Plans](https://github.com/deep-reader/DeepReader/wiki/Short-Term-Plans) 38 | * [A Reference Model for Capabilities of Online Readers](https://github.com/deep-reader/DeepReader/wiki/A-Reference-Model-for-Capabilities-of-Online-Readers) 39 | * [Widget Framework](https://github.com/deep-reader/DeepReader/wiki/Widget-Framework) 40 | -------------------------------------------------------------------------------- /build/build.js: -------------------------------------------------------------------------------- 1 | require('./check-versions')() 2 | 3 | process.env.NODE_ENV = 'production' 4 | 5 | var ora = require('ora') 6 | var rm = require('rimraf') 7 | var path = require('path') 8 | var chalk = require('chalk') 9 | var webpack = require('webpack') 10 | var config = require('../config') 11 | var webpackConfig = require('./webpack.prod.conf') 12 | 13 | var spinner = ora('building for production...') 14 | spinner.start() 15 | 16 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 17 | if (err) throw err 18 | webpack(webpackConfig, function (err, stats) { 19 | spinner.stop() 20 | if (err) throw err 21 | process.stdout.write(stats.toString({ 22 | colors: true, 23 | modules: false, 24 | children: false, 25 | chunks: false, 26 | chunkModules: false 27 | }) + '\n\n') 28 | 29 | console.log(chalk.cyan(' Build complete.\n')) 30 | console.log(chalk.yellow( 31 | ' Tip: built files are meant to be served over an HTTP server.\n' + 32 | ' Opening index.html over file:// won\'t work.\n' 33 | )) 34 | }) 35 | }) 36 | -------------------------------------------------------------------------------- /build/check-versions.js: -------------------------------------------------------------------------------- 1 | var chalk = require('chalk') 2 | var semver = require('semver') 3 | var packageConfig = require('../package.json') 4 | var shell = require('shelljs') 5 | function exec (cmd) { 6 | return require('child_process').execSync(cmd).toString().trim() 7 | } 8 | 9 | var versionRequirements = [ 10 | { 11 | name: 'node', 12 | currentVersion: semver.clean(process.version), 13 | versionRequirement: packageConfig.engines.node 14 | }, 15 | ] 16 | 17 | if (shell.which('npm')) { 18 | versionRequirements.push({ 19 | name: 'npm', 20 | currentVersion: exec('npm --version'), 21 | versionRequirement: packageConfig.engines.npm 22 | }) 23 | } 24 | 25 | module.exports = function () { 26 | var warnings = [] 27 | for (var i = 0; i < versionRequirements.length; i++) { 28 | var mod = versionRequirements[i] 29 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 30 | warnings.push(mod.name + ': ' + 31 | chalk.red(mod.currentVersion) + ' should be ' + 32 | chalk.green(mod.versionRequirement) 33 | ) 34 | } 35 | } 36 | 37 | if (warnings.length) { 38 | console.log('') 39 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 40 | console.log() 41 | for (var i = 0; i < warnings.length; i++) { 42 | var warning = warnings[i] 43 | console.log(' ' + warning) 44 | } 45 | console.log() 46 | process.exit(1) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /build/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function (event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) 10 | -------------------------------------------------------------------------------- /build/dev-server.js: -------------------------------------------------------------------------------- 1 | require('./check-versions')() 2 | 3 | var config = require('../config') 4 | if (!process.env.NODE_ENV) { 5 | process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV) 6 | } 7 | 8 | var opn = require('opn') 9 | var path = require('path') 10 | var express = require('express') 11 | var webpack = require('webpack') 12 | var proxyMiddleware = require('http-proxy-middleware') 13 | var webpackConfig = require('./webpack.dev.conf') 14 | 15 | // default port where dev server listens for incoming traffic 16 | var port = process.env.PORT || config.dev.port 17 | // automatically open browser, if not set will be false 18 | var autoOpenBrowser = !!config.dev.autoOpenBrowser 19 | // Define HTTP proxies to your custom API backend 20 | // https://github.com/chimurai/http-proxy-middleware 21 | var proxyTable = config.dev.proxyTable 22 | 23 | var app = express() 24 | var compiler = webpack(webpackConfig) 25 | 26 | var devMiddleware = require('webpack-dev-middleware')(compiler, { 27 | publicPath: webpackConfig.output.publicPath, 28 | quiet: true 29 | }) 30 | 31 | var hotMiddleware = require('webpack-hot-middleware')(compiler, { 32 | log: () => {} 33 | }) 34 | // force page reload when html-webpack-plugin template changes 35 | compiler.plugin('compilation', function (compilation) { 36 | compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) { 37 | hotMiddleware.publish({ action: 'reload' }) 38 | cb() 39 | }) 40 | }) 41 | 42 | // proxy api requests 43 | Object.keys(proxyTable).forEach(function (context) { 44 | var options = proxyTable[context] 45 | if (typeof options === 'string') { 46 | options = { target: options } 47 | } 48 | app.use(proxyMiddleware(options.filter || context, options)) 49 | }) 50 | 51 | // handle fallback for HTML5 history API 52 | app.use(require('connect-history-api-fallback')()) 53 | 54 | // serve webpack bundle output 55 | app.use(devMiddleware) 56 | 57 | // enable hot-reload and state-preserving 58 | // compilation error display 59 | app.use(hotMiddleware) 60 | 61 | // serve pure static assets 62 | var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory) 63 | app.use(staticPath, express.static('./static')) 64 | 65 | var uri = 'http://localhost:' + port 66 | 67 | var _resolve 68 | var readyPromise = new Promise(resolve => { 69 | _resolve = resolve 70 | }) 71 | 72 | console.log('> Starting dev server...') 73 | devMiddleware.waitUntilValid(() => { 74 | console.log('> Listening at ' + uri + '\n') 75 | // when env is testing, don't need open it 76 | if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') { 77 | opn(uri) 78 | } 79 | _resolve() 80 | }) 81 | 82 | var server = app.listen(port) 83 | 84 | module.exports = { 85 | ready: readyPromise, 86 | close: () => { 87 | server.close() 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /build/utils.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 4 | 5 | exports.assetsPath = function (_path) { 6 | var assetsSubDirectory = process.env.NODE_ENV === 'production' 7 | ? config.build.assetsSubDirectory 8 | : config.dev.assetsSubDirectory 9 | return path.posix.join(assetsSubDirectory, _path) 10 | } 11 | 12 | exports.cssLoaders = function (options) { 13 | options = options || {} 14 | 15 | var cssLoader = { 16 | loader: 'css-loader', 17 | options: { 18 | minimize: process.env.NODE_ENV === 'production', 19 | sourceMap: options.sourceMap 20 | } 21 | } 22 | 23 | // generate loader string to be used with extract text plugin 24 | function generateLoaders (loader, loaderOptions) { 25 | var loaders = [cssLoader] 26 | if (loader) { 27 | loaders.push({ 28 | loader: loader + '-loader', 29 | options: Object.assign({}, loaderOptions, { 30 | sourceMap: options.sourceMap 31 | }) 32 | }) 33 | } 34 | 35 | // Extract CSS when that option is specified 36 | // (which is the case during production build) 37 | if (options.extract) { 38 | return ExtractTextPlugin.extract({ 39 | use: loaders, 40 | fallback: 'vue-style-loader' 41 | }) 42 | } else { 43 | return ['vue-style-loader'].concat(loaders) 44 | } 45 | } 46 | 47 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html 48 | return { 49 | css: generateLoaders(), 50 | postcss: generateLoaders(), 51 | less: generateLoaders('less'), 52 | sass: generateLoaders('sass', { indentedSyntax: true }), 53 | scss: generateLoaders('sass', { 54 | data: '@import "./src/styles/theme.scss";' 55 | }), 56 | stylus: generateLoaders('stylus'), 57 | styl: generateLoaders('stylus') 58 | } 59 | } 60 | 61 | // Generate loaders for standalone style files (outside of .vue) 62 | exports.styleLoaders = function (options) { 63 | var output = [] 64 | var loaders = exports.cssLoaders(options) 65 | for (var extension in loaders) { 66 | var loader = loaders[extension] 67 | output.push({ 68 | test: new RegExp('\\.' + extension + '$'), 69 | use: loader 70 | }) 71 | } 72 | return output 73 | } 74 | -------------------------------------------------------------------------------- /build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | var utils = require('./utils') 2 | var config = require('../config') 3 | var isProduction = process.env.NODE_ENV === 'production' 4 | 5 | module.exports = { 6 | loaders: utils.cssLoaders({ 7 | sourceMap: isProduction 8 | ? config.build.productionSourceMap 9 | : config.dev.cssSourceMap, 10 | extract: isProduction 11 | }) 12 | } 13 | -------------------------------------------------------------------------------- /build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var utils = require('./utils') 3 | var config = require('../config') 4 | var vueLoaderConfig = require('./vue-loader.conf') 5 | 6 | function resolve (dir) { 7 | return path.join(__dirname, '..', dir) 8 | } 9 | 10 | module.exports = { 11 | entry: { 12 | app: './src/main.js' 13 | }, 14 | output: { 15 | path: config.build.assetsRoot, 16 | filename: '[name].js', 17 | publicPath: process.env.NODE_ENV === 'production' 18 | ? config.build.assetsPublicPath 19 | : config.dev.assetsPublicPath 20 | }, 21 | resolve: { 22 | extensions: ['.js', '.vue', '.json'], 23 | alias: { 24 | 'vue$': 'vue/dist/vue.esm.js', 25 | '@': resolve('src') 26 | } 27 | }, 28 | module: { 29 | rules: [ 30 | { 31 | test: /\.(js|vue)$/, 32 | loader: 'eslint-loader', 33 | enforce: 'pre', 34 | include: [resolve('src'), resolve('test')], 35 | options: { 36 | formatter: require('eslint-friendly-formatter') 37 | } 38 | }, 39 | { 40 | test: /\.vue$/, 41 | loader: 'vue-loader', 42 | options: vueLoaderConfig 43 | }, 44 | { 45 | test: /\.js$/, 46 | loader: 'babel-loader', 47 | include: [resolve('src'), resolve('test')] 48 | }, 49 | { 50 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 51 | loader: 'url-loader', 52 | options: { 53 | limit: 10000, 54 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 55 | } 56 | }, 57 | { 58 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 59 | loader: 'url-loader', 60 | options: { 61 | limit: 10000, 62 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 63 | } 64 | }, 65 | { 66 | test: /\.xsl$/, 67 | loader: 'raw-loader', 68 | } 69 | ] 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | var utils = require('./utils') 2 | var webpack = require('webpack') 3 | var config = require('../config') 4 | var merge = require('webpack-merge') 5 | var baseWebpackConfig = require('./webpack.base.conf') 6 | var HtmlWebpackPlugin = require('html-webpack-plugin') 7 | var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') 8 | 9 | // add hot-reload related code to entry chunks 10 | Object.keys(baseWebpackConfig.entry).forEach(function (name) { 11 | baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) 12 | }) 13 | 14 | module.exports = merge(baseWebpackConfig, { 15 | module: { 16 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) 17 | }, 18 | // cheap-module-eval-source-map is faster for development 19 | devtool: '#cheap-module-eval-source-map', 20 | plugins: [ 21 | new webpack.DefinePlugin({ 22 | 'process.env': config.dev.env 23 | }), 24 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage 25 | new webpack.HotModuleReplacementPlugin(), 26 | new webpack.NoEmitOnErrorsPlugin(), 27 | // https://github.com/ampedandwired/html-webpack-plugin 28 | new HtmlWebpackPlugin({ 29 | filename: 'index.html', 30 | template: 'index.html', 31 | inject: true 32 | }), 33 | new FriendlyErrorsPlugin() 34 | ] 35 | }) 36 | -------------------------------------------------------------------------------- /build/webpack.prod.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var utils = require('./utils') 3 | var webpack = require('webpack') 4 | var config = require('../config') 5 | var merge = require('webpack-merge') 6 | var baseWebpackConfig = require('./webpack.base.conf') 7 | var CopyWebpackPlugin = require('copy-webpack-plugin') 8 | var HtmlWebpackPlugin = require('html-webpack-plugin') 9 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 10 | var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') 11 | 12 | var env = config.build.env 13 | 14 | var webpackConfig = merge(baseWebpackConfig, { 15 | module: { 16 | rules: utils.styleLoaders({ 17 | sourceMap: config.build.productionSourceMap, 18 | extract: true 19 | }) 20 | }, 21 | devtool: config.build.productionSourceMap ? '#source-map' : false, 22 | output: { 23 | path: config.build.assetsRoot, 24 | filename: utils.assetsPath('js/[name].[chunkhash].js'), 25 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') 26 | }, 27 | plugins: [ 28 | // http://vuejs.github.io/vue-loader/en/workflow/production.html 29 | new webpack.DefinePlugin({ 30 | 'process.env': env 31 | }), 32 | new webpack.optimize.UglifyJsPlugin({ 33 | compress: { 34 | warnings: false 35 | }, 36 | sourceMap: true 37 | }), 38 | // extract css into its own file 39 | new ExtractTextPlugin({ 40 | filename: utils.assetsPath('css/[name].[contenthash].css') 41 | }), 42 | // Compress extracted CSS. We are using this plugin so that possible 43 | // duplicated CSS from different components can be deduped. 44 | new OptimizeCSSPlugin({ 45 | cssProcessorOptions: { 46 | safe: true 47 | } 48 | }), 49 | // generate dist index.html with correct asset hash for caching. 50 | // you can customize output by editing /index.html 51 | // see https://github.com/ampedandwired/html-webpack-plugin 52 | new HtmlWebpackPlugin({ 53 | filename: config.build.index, 54 | template: 'index.html', 55 | inject: true, 56 | minify: { 57 | removeComments: true, 58 | collapseWhitespace: true, 59 | removeAttributeQuotes: true 60 | // more options: 61 | // https://github.com/kangax/html-minifier#options-quick-reference 62 | }, 63 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin 64 | chunksSortMode: 'dependency' 65 | }), 66 | // split vendor js into its own file 67 | new webpack.optimize.CommonsChunkPlugin({ 68 | name: 'vendor', 69 | minChunks: function (module, count) { 70 | // any required modules inside node_modules are extracted to vendor 71 | return ( 72 | module.resource && 73 | /\.js$/.test(module.resource) && 74 | module.resource.indexOf( 75 | path.join(__dirname, '../node_modules') 76 | ) === 0 77 | ) 78 | } 79 | }), 80 | // extract webpack runtime and module manifest to its own file in order to 81 | // prevent vendor hash from being updated whenever app bundle is updated 82 | new webpack.optimize.CommonsChunkPlugin({ 83 | name: 'manifest', 84 | chunks: ['vendor'] 85 | }), 86 | // copy custom static assets 87 | new CopyWebpackPlugin([ 88 | { 89 | from: path.resolve(__dirname, '../static'), 90 | to: config.build.assetsSubDirectory, 91 | ignore: ['.*'] 92 | } 93 | ]) 94 | ] 95 | }) 96 | 97 | if (config.build.productionGzip) { 98 | var CompressionWebpackPlugin = require('compression-webpack-plugin') 99 | 100 | webpackConfig.plugins.push( 101 | new CompressionWebpackPlugin({ 102 | asset: '[path].gz[query]', 103 | algorithm: 'gzip', 104 | test: new RegExp( 105 | '\\.(' + 106 | config.build.productionGzipExtensions.join('|') + 107 | ')$' 108 | ), 109 | threshold: 10240, 110 | minRatio: 0.8 111 | }) 112 | ) 113 | } 114 | 115 | if (config.build.bundleAnalyzerReport) { 116 | var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 117 | webpackConfig.plugins.push(new BundleAnalyzerPlugin()) 118 | } 119 | 120 | module.exports = webpackConfig 121 | -------------------------------------------------------------------------------- /config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /config/index.js: -------------------------------------------------------------------------------- 1 | // see http://vuejs-templates.github.io/webpack for documentation. 2 | var path = require('path') 3 | 4 | module.exports = { 5 | build: { 6 | env: require('./prod.env'), 7 | index: path.resolve(__dirname, '../dist/index.html'), 8 | assetsRoot: path.resolve(__dirname, '../dist'), 9 | assetsSubDirectory: 'static', 10 | assetsPublicPath: '/', 11 | productionSourceMap: true, 12 | // Gzip off by default as many popular static hosts such as 13 | // Surge or Netlify already gzip all static assets for you. 14 | // Before setting to `true`, make sure to: 15 | // npm install --save-dev compression-webpack-plugin 16 | productionGzip: false, 17 | productionGzipExtensions: ['js', 'css'], 18 | // Run the build command with an extra argument to 19 | // View the bundle analyzer report after build finishes: 20 | // `npm run build --report` 21 | // Set to `true` or `false` to always turn it on or off 22 | bundleAnalyzerReport: process.env.npm_config_report 23 | }, 24 | dev: { 25 | env: require('./dev.env'), 26 | port: 5066, 27 | autoOpenBrowser: false, 28 | assetsSubDirectory: 'static', 29 | assetsPublicPath: '/', 30 | proxyTable: {}, 31 | // CSS Sourcemaps off by default because relative paths are "buggy" 32 | // with this option, according to the CSS-Loader README 33 | // (https://github.com/webpack/css-loader#sourcemaps) 34 | // In our experience, they generally work as expected, 35 | // just be aware of this issue when enabling this option. 36 | cssSourceMap: false 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DeepReader 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-me", 3 | "version": "1.0.0", 4 | "description": "A Vue.js project", 5 | "author": "Brian Rosner ", 6 | "private": true, 7 | "scripts": { 8 | "dev": "node build/dev-server.js", 9 | "start": "node build/dev-server.js", 10 | "build": "node build/build.js", 11 | "lint": "eslint --ext .js,.vue src" 12 | }, 13 | "dependencies": { 14 | "raw-loader": "^0.5.1", 15 | "universal-fetch": "^1.0.0", 16 | "vue": "^2.3.0", 17 | "vue-router": "^2.5.2", 18 | "vue-spinner": "^1.0.2", 19 | "vuex": "^2.3.1", 20 | "xmldom": "^0.1.27", 21 | "xpath": "^0.0.24" 22 | }, 23 | "devDependencies": { 24 | "autoprefixer": "^7.1.1", 25 | "babel-core": "^6.22.1", 26 | "babel-eslint": "^7.1.1", 27 | "babel-loader": "^7.0.0", 28 | "babel-plugin-transform-object-rest-spread": "^6.23.0", 29 | "babel-plugin-transform-runtime": "^6.22.0", 30 | "babel-preset-env": "^1.3.2", 31 | "babel-preset-stage-2": "^6.22.0", 32 | "babel-register": "^6.22.0", 33 | "chalk": "^1.1.3", 34 | "connect-history-api-fallback": "^1.3.0", 35 | "copy-webpack-plugin": "^4.0.1", 36 | "css-loader": "^0.28.0", 37 | "eslint": "^3.19.0", 38 | "eslint-config-airbnb-base": "^11.1.3", 39 | "eslint-friendly-formatter": "^3.0.0", 40 | "eslint-import-resolver-webpack": "^0.8.1", 41 | "eslint-loader": "^1.7.1", 42 | "eslint-plugin-html": "^2.0.0", 43 | "eslint-plugin-import": "^2.2.0", 44 | "eventsource-polyfill": "^0.9.6", 45 | "express": "^4.14.1", 46 | "extract-text-webpack-plugin": "^2.0.0", 47 | "file-loader": "^0.11.1", 48 | "firebase": "^4.1.1", 49 | "friendly-errors-webpack-plugin": "^1.1.3", 50 | "html-webpack-plugin": "^2.28.0", 51 | "http-proxy-middleware": "^0.17.3", 52 | "node-sass": "^4.5.2", 53 | "opn": "^5.0.0", 54 | "optimize-css-assets-webpack-plugin": "^1.3.0", 55 | "ora": "^1.2.0", 56 | "rimraf": "^2.6.0", 57 | "sass-loader": "^6.0.3", 58 | "semver": "^5.3.0", 59 | "shelljs": "^0.7.6", 60 | "url-loader": "^0.5.8", 61 | "vue-loader": "^12.2.1", 62 | "vue-style-loader": "^3.0.1", 63 | "vue-template-compiler": "^2.2.6", 64 | "vuexfire": "^2.1.0", 65 | "webpack": "^2.3.3", 66 | "webpack-bundle-analyzer": "^2.2.1", 67 | "webpack-dev-middleware": "^1.10.0", 68 | "webpack-hot-middleware": "^2.18.0", 69 | "webpack-merge": "^4.1.0" 70 | }, 71 | "engines": { 72 | "node": ">= 4.0.0", 73 | "npm": ">= 3.0.0" 74 | }, 75 | "browserslist": [ 76 | "> 1%", 77 | "last 2 versions", 78 | "not ie <= 8" 79 | ] 80 | } 81 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 18 | 19 | 25 | -------------------------------------------------------------------------------- /src/cite-services/components/Reader.vue: -------------------------------------------------------------------------------- 1 | 81 | 82 | 162 | -------------------------------------------------------------------------------- /src/cite-services/widgets/CtsUrn.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 19 | -------------------------------------------------------------------------------- /src/components/Homepage.vue: -------------------------------------------------------------------------------- 1 | 60 | 61 | 71 | 72 | 74 | -------------------------------------------------------------------------------- /src/components/JsonObject.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 24 | 25 | 30 | -------------------------------------------------------------------------------- /src/components/Pagination.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 18 | 19 | 60 | -------------------------------------------------------------------------------- /src/components/Passage.vue: -------------------------------------------------------------------------------- 1 | 70 | 71 | 120 | 121 | 151 | -------------------------------------------------------------------------------- /src/components/Widget.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 27 | 28 | 65 | -------------------------------------------------------------------------------- /src/cts/components/Reader.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 106 | 107 | 129 | -------------------------------------------------------------------------------- /src/cts/tei.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
12 | 13 | 14 |
{}
15 |
16 | 17 | 18 |
19 |
20 | 21 | 22 |

23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
35 |
36 | 37 | 38 |
¶ 39 |
40 | 41 | 42 | 43 | 44 | : 45 | 46 | 47 | 48 | 49 | 50 | 51 |
52 | 53 | 54 |
55 |
56 | 57 | 58 |
59 |
60 | 61 | 62 |
63 | 64 |
65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 |
76 |
77 | 78 | 79 |
80 |
81 | 82 | 83 |
84 |
85 | 86 | 87 |
88 |
89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 |
116 |
117 | 118 | 119 |
120 |
121 | 122 | 123 | [ 124 | 125 | 126 | = 127 | ] 128 | 129 | [/] 130 | 131 |
132 | -------------------------------------------------------------------------------- /src/cts/widgets/TextGroup.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 72 | -------------------------------------------------------------------------------- /src/cts/widgets/TextInventory.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 65 | 66 | 71 | -------------------------------------------------------------------------------- /src/cts/widgets/Work.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 81 | -------------------------------------------------------------------------------- /src/firebase.js: -------------------------------------------------------------------------------- 1 | import firebase from 'firebase'; 2 | 3 | const config = { 4 | apiKey: 'AIzaSyAOCV-UXcEChFFw5G2SBigve8hClyJhnk8', 5 | authDomain: 'lore-cb5e2.firebaseapp.com', 6 | databaseURL: 'https://lore-cb5e2.firebaseio.com', 7 | projectId: 'lore-cb5e2', 8 | storageBucket: 'lore-cb5e2.appspot.com', 9 | messagingSenderId: '1072950462053', 10 | }; 11 | 12 | export default firebase.initializeApp(config); 13 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue'; 4 | import App from './App'; 5 | import router from './router'; 6 | 7 | Vue.config.productionTip = false; 8 | 9 | /* eslint-disable no-new */ 10 | new Vue({ 11 | el: '#app', 12 | router, 13 | template: '', 14 | components: { 15 | App, 16 | }, 17 | }); 18 | -------------------------------------------------------------------------------- /src/morphgnt/components/Reader.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 155 | -------------------------------------------------------------------------------- /src/morphgnt/components/WordAnalysis.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 23 | 24 | 29 | -------------------------------------------------------------------------------- /src/morphgnt/index.js: -------------------------------------------------------------------------------- 1 | import fetch from 'universal-fetch'; 2 | 3 | export default { 4 | apiRoot: 'https://api.morphgnt.org', 5 | async resource(path) { 6 | const resp = await fetch(`${this.apiRoot}${path}`); 7 | return resp.json(); 8 | }, 9 | async books() { 10 | const { books } = await this.resource('/v0/root.json'); 11 | return books; 12 | }, 13 | async verseLookup(verse) { 14 | const url = `${this.apiRoot}/v0/verse-lookup/?${verse}`; 15 | const resp = await fetch(url); 16 | const data = await resp.json(); 17 | if (resp.status === 400) { 18 | throw data.message; 19 | } else { 20 | return data.verse_id; 21 | } 22 | }, 23 | async frequency(input) { 24 | const url = `${this.apiRoot}/v0/frequency/`; 25 | const headers = new Headers({ 26 | 'Content-Type': 'application/json', 27 | }); 28 | const body = JSON.stringify({ input }); 29 | const resp = await fetch(url, { method: 'POST', headers, body }); 30 | const data = await resp.json(); 31 | return data.output; 32 | }, 33 | async kwic(word) { 34 | const url = `${this.apiRoot}/v0/kwic/?${word}`; 35 | const resp = await fetch(url); 36 | const data = await resp.json(); 37 | return data.results; 38 | }, 39 | }; 40 | -------------------------------------------------------------------------------- /src/morphgnt/widgets/BookInfo.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 29 | -------------------------------------------------------------------------------- /src/morphgnt/widgets/BookSelect.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 24 | -------------------------------------------------------------------------------- /src/morphgnt/widgets/Frequency.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 40 | 41 | 83 | -------------------------------------------------------------------------------- /src/morphgnt/widgets/Interlinear.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 24 | -------------------------------------------------------------------------------- /src/morphgnt/widgets/Kwic.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 51 | 52 | 70 | -------------------------------------------------------------------------------- /src/morphgnt/widgets/TextColouring.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 33 | 34 | 44 | 45 | 74 | -------------------------------------------------------------------------------- /src/morphgnt/widgets/VerseLookup.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 45 | -------------------------------------------------------------------------------- /src/morphgnt/widgets/WordInfo.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 55 | 56 | 112 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Router from 'vue-router'; 3 | import CTSReader from '@/cts/components/Reader'; 4 | import MorphGNTReader from '@/morphgnt/components/Reader'; 5 | import CiteServicesReader from '@/cite-services/components/Reader'; 6 | import Homepage from '@/components/Homepage'; 7 | 8 | Vue.use(Router); 9 | 10 | export default new Router({ 11 | routes: [ 12 | { 13 | path: '/', 14 | name: 'Homepage', 15 | component: Homepage, 16 | }, 17 | { 18 | path: '/cts', 19 | name: 'CTSReader', 20 | component: CTSReader, 21 | }, 22 | { 23 | path: '/morphgnt', 24 | name: 'MorphGNTReader', 25 | component: MorphGNTReader, 26 | }, 27 | { 28 | path: '/cite-services', 29 | name: 'CiteServicesReader', 30 | component: CiteServicesReader, 31 | }, 32 | ], 33 | }); 34 | -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Vuex from 'vuex'; 3 | import { firebaseMutations, firebaseAction } from 'vuexfire'; 4 | import app from '@/firebase'; 5 | 6 | Vue.use(Vuex); 7 | 8 | /* eslint-disable no-new */ 9 | export default new Vuex.Store({ 10 | modules: { 11 | bookmarkList: { 12 | state: { 13 | bookmarks: [], 14 | }, 15 | getters: { 16 | bookmarks: state => state.bookmarks, 17 | }, 18 | actions: { 19 | setBookmarksRef: firebaseAction(({ bindFirebaseRef }, ref) => { 20 | bindFirebaseRef('bookmarks', ref); 21 | }), 22 | }, 23 | }, 24 | }, 25 | state: { 26 | user: null, 27 | book: null, 28 | interlinear: false, 29 | ctsURL: 'http://cts.perseids.org/api/cts/', 30 | ctsTextGroup: '', 31 | ctsWork: '', 32 | passage: null, 33 | textClasses: {}, 34 | selectedWord: null, 35 | }, 36 | getters: { 37 | textClasses(state) { 38 | return Object.entries(state.textClasses).reduce( 39 | (o, [k, v]) => { 40 | if (typeof v === 'boolean') { 41 | return Object.assign(o, { [k]: v }); 42 | } 43 | return Object.assign(o, { [`${k}-${v}`]: true }); 44 | }, 45 | {}, 46 | ); 47 | }, 48 | }, 49 | mutations: { 50 | setUser(state, user) { 51 | state.user = user; 52 | }, 53 | setCtsTextGroup(state, textGroup) { 54 | state.ctsTextGroup = textGroup; 55 | }, 56 | setCtsWork(state, work) { 57 | state.ctsWork = work; 58 | }, 59 | setReader(state, { book, passage }) { 60 | state.book = book; 61 | state.passage = passage; 62 | }, 63 | setCTSReader(state, { passage }) { 64 | state.book = null; 65 | state.passage = passage; 66 | }, 67 | toggleInterlinear(state) { 68 | state.interlinear = !state.interlinear; 69 | }, 70 | setTextClass(state, classes) { 71 | state.textClasses = { ...state.textClasses, ...classes }; 72 | }, 73 | setSelectedWord(state, word) { 74 | state.selectedWord = word; 75 | }, 76 | ...firebaseMutations, 77 | }, 78 | actions: { 79 | async authenticate({ commit }) { 80 | await app.auth().onAuthStateChanged((user) => { 81 | if (user) { 82 | commit('setUser', user); 83 | } else { 84 | app.auth().signInAnonymously(); 85 | } 86 | }); 87 | }, 88 | }, 89 | }); 90 | -------------------------------------------------------------------------------- /src/styles/common.scss: -------------------------------------------------------------------------------- 1 | .click { 2 | color: inherit; 3 | text-decoration: none; 4 | cursor: pointer; 5 | &:hover { 6 | color: $click-hover-color; 7 | } 8 | } 9 | li.hanging { 10 | text-indent: -1em; 11 | margin-left: 1em; 12 | } 13 | -------------------------------------------------------------------------------- /src/styles/skeleton.scss: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | -webkit-font-smoothing: antialiased; 4 | } 5 | 6 | /* hover opacity */ 7 | 8 | .widget, .root > header, .page-nav-1 { 9 | opacity: 0; 10 | transition: opacity 0.5s ease-in-out; 11 | } 12 | 13 | body:hover { 14 | .widget, .root > header, .page-nav-1 { 15 | opacity: 1; 16 | } 17 | } 18 | 19 | /* grid */ 20 | 21 | .grid-wrapper { 22 | display: grid; 23 | grid-template-columns: 2fr 6fr 4fr; 24 | grid-column-gap: 10px; 25 | margin: 10px; 26 | > * { 27 | min-width: 200px; 28 | } 29 | } 30 | 31 | /* header */ 32 | 33 | .root > header { 34 | background: $header-background; 35 | padding: 10px 20px; 36 | > h1 { 37 | font-size: 24pt; 38 | font-family: $main-font-family; 39 | margin: 0; 40 | font-weight: normal; 41 | color: $header-color; 42 | } 43 | .reader-nav { 44 | float: right; 45 | font-family: $widget-font-family; 46 | color: $header-nav-color; 47 | a { 48 | text-decoration: none; 49 | color: inherit; 50 | cursor: pointer; 51 | &:hover { 52 | color: $header-nav-hover-color; 53 | } 54 | } 55 | } 56 | } 57 | 58 | /* main column */ 59 | 60 | .main { 61 | font-family: $main-font-family; 62 | height: 500px; 63 | margin: 20px 50px; 64 | > p:first-of-type { 65 | margin-top: 0; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/styles/theme.scss: -------------------------------------------------------------------------------- 1 | $main-font-family: "Noto Serif", serif; 2 | $widget-font-family: "Noto Sans", sans-serif; 3 | 4 | $click-hover-color: #666; 5 | 6 | $header-color: #444; 7 | $header-background: #F7F7F7; 8 | $header-nav-color: #999; 9 | $header-nav-hover-color: #000; 10 | 11 | $page-arrow-color: #999; 12 | $page-arrow-hover-color: #000; 13 | 14 | $main-text-color: #333; 15 | 16 | $main-text-small-size: 12pt; 17 | $main-text-normal-size: 15pt; 18 | $main-text-large-size: 18pt; 19 | 20 | $text-milestone-color: #999; 21 | $interlinear-color: gray; 22 | 23 | $widget-color: #666; 24 | $widget-background: #F7F7F7; 25 | $widget-hover-color: #000; 26 | $widget-header-background: #EEE; 27 | $widget-header-hover-background: #DDD; 28 | $widget-rule: #CCC; 29 | $widget-remove: #C00; 30 | -------------------------------------------------------------------------------- /src/utils.js: -------------------------------------------------------------------------------- 1 | 2 | function sortBy(field, reverse, primer) { 3 | const key = x => (primer ? primer(x[field]) : x[field]); 4 | return (a, b) => { 5 | const A = key(a); 6 | const B = key(b); 7 | let ret; 8 | if (A < B) { 9 | ret = -1; 10 | } else if (A > B) { 11 | ret = 1; 12 | } else { 13 | ret = 0; 14 | } 15 | return ret * [-1, 1][+!!reverse]; 16 | }; 17 | } 18 | 19 | module.exports = { 20 | sortBy, 21 | }; 22 | -------------------------------------------------------------------------------- /src/widgets/BookmarkList.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 48 | 49 | 71 | -------------------------------------------------------------------------------- /src/widgets/Morpheus.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 52 | -------------------------------------------------------------------------------- /src/widgets/TextFormatting.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 36 | 37 | 51 | 52 | 65 | -------------------------------------------------------------------------------- /static/deep-reader-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deep-philology/DeepReader/98c948200dc52d55e7edea69af9a7cc2791ee3cb/static/deep-reader-512.png --------------------------------------------------------------------------------