Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	build/js/diva.js
#	build/js/diva.js.map
#	build/js/diva.min.js
#	build/js/diva.min.js.map
  • Loading branch information
ahankinson committed Aug 30, 2018
2 parents 39a8c26 + 21154a5 commit 0ea1451
Show file tree
Hide file tree
Showing 529 changed files with 74,798 additions and 39,859 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["env"]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ tags

/node_modules/
/coverage/
/build/
12 changes: 11 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,15 @@
"node": true,
"trailing": true,
"undef": true,
"unused": true
"unused": true,
"esversion": 6,
"browser": true,
"mocha": true,
"globals": {
"define": true,
"expect": true,
"assert": true,
"Diva": true
},
"validthis": true
}
17 changes: 9 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
language: node_js
node_js: 5 # Can't update to 6 until gulp does not depend on vinyl-fs 0.3.0
sudo: false
node_js: 10
sudo: true

cache:
directories:
- node_modules

install:
- npm install --no-spin
Expand All @@ -10,9 +14,6 @@ script:
- npm test

notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/6885fd1dbe70aca78516
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always
email: false
slack:
secure: kTkyLd+WlJE/cm39pm9jAZ11+QA1JKl8/eiOtPc4hkqvucMrBZu6k8V+TBoqgahLeUj/nWSWxJJJYZcElB/eXFgDfPoEAm+zOM3EsCrOBnBY5HhpnlCp95dZAcRlPwuhmB8kYK6Yl8v/qzvofQjbf/Lmk62tvFtlk3+S5WKDXbY=
4 changes: 3 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

Authors of diva.js

Wendy Liu (https://github.com/dellsystem)
Expand All @@ -6,6 +7,7 @@ Andrew Horwitz (https://github.com/ahwitz)
Laurent Pugin (https://github.com/lpugin)
William Bain (https://github.com/wabain)
Jérôme Parent-Lévesque (https://github.com/jeromepl)
Eric Liu (https://github.com/erichanliu)

Project Coordinators:
Andrew Hankinson (andrew.hankinson[at]mail.mcgill.ca)
Expand All @@ -18,4 +20,4 @@ Social Sciences and Humanities Research Council of Canada
Répertoire International des Sources Musicale (RISM) Switzerland
Canadian Foundation for Innovation
Centre for Interdisciplinary Research in Music Media and Technology (CIRMMT)
Schulich School of Music, McGill University
Schulich School of Music, McGill University
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

117 changes: 117 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<p align="center">
<a href="http://ddmal.github.io/diva.js">
<img width="382" height="191" src="https://github.com/DDMAL/diva.js/wiki/img/diva-logo-sm.png" />
</a>
</p>

Diva.js [![Build Status](https://travis-ci.org/DDMAL/diva.js.svg?branch=master)](http://travis-ci.org/DDMAL/diva.js)
=========================================

Diva.js (Document Image Viewer with AJAX) is a JavaScript book image viewer designed to present multi-page documents at multiple resolutions.

Version 6.0 contains many new features and improvements:

- **Compatibility with IIIF Presentation API version 2.1 and 3**.
- **Small footprint, zero dependencies**. Can be deployed with just a JavaScript and a CSS file.
- **Rewritten in ES6** for compatibility with the new JavaScript module system.
- **New plugins**: Metadata, Image Manipulation

## Overview

There are two components to a functioning Diva system:

1. **[A IIIF Manifest](https://iiif.io/)** that will be displayed.
2. **The Diva.js plugin.** The embedded web application that displays the images in a browser.

### Details

#### Using IIIF
Diva.js is an image viewer compatible with IIIF Presentation API versions [2](http://iiif.io/api/presentation/2.0/) and [3](http://iiif.io/api/presentation/3.0/). Simply supply the path to a valid IIIF Manifest and Diva will display the document as described by the metadata (see [Installing](#installing)).

## Installing

### From a CDN (hosted)

If you prefer to use a hosted version of Diva, copy and paste the following into the `<head>` of any webpage to include all the files necessary to use Diva.js.
```html
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/diva.js/6.0.0/css/diva.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/diva.js/6.0.0/js/diva.js"></script>
```
### Locally (release package)

Download the [latest release](https://github.com/DDMAL/diva.js/releases) of Diva. In the `diva.js` directory you can find a pre-compiled version. The `build` directory contains the files necessary to use Diva. Simply include `build/diva.css` and `build/diva.js` in the `<head>` of your webpage, as shown in the HTML source of the example [index page](https://github.com/DDMAL/diva.js/blob/develop/index.html).

### From npm

You can also run `npm install diva.js` in order to install Diva as a node package. Then, Diva will be located under `node_modules/diva.js/`, and you can access the `build` directory the same as above.

## Basic setup
### HTML
After including the necessary files, the most basic Diva viewer is instantiated with one (IIIF) required parameter and several optional settings parameters. Diva must target a parent div, in this case diva-wrapper:
```html
<div id="diva-wrapper"></div>

<script>
let diva = new Diva('diva-wrapper', {
objectData: "http://www.example.com/manifest.json"
// possible settings
});
</script>
```
* `objectData`: The URL (absolute or relative) to the document's `.json` file, or a IIIF Manifest

The `diva-wrapper` selector points to a `div` element within which the document viewer will appear.

### JavaScript
If you wish to include the Diva viewer component into your own JavaScript app, this can be done easily by just importing Diva beforehand.
```javascript
import Diva from './path/to/source/diva.js';

let diva = new Diva('diva-wrapper', {
objectData: "http://www.example.com/manifest.json"
// possible settings
});
```

There are a large number of settings that can be enabled/disabled for this Diva instance. See [Settings](https://github.com/DDMAL/diva.js/wiki/Settings) for a comprehensive list.

See [Installation](https://github.com/DDMAL/diva.js/wiki/Installation) for full instructions.

## Building from source

If you wish to install from source, first you must install [node.js and npm](https://nodejs.org/en/). Then, check out the code from [our GitHub repository](http://github.com/DDMAL/diva.js). Once you've obtained the code, change to the project directory and run `npm install` to fetch all development dependencies.

The full installation gives you access to the un-minified JavaScript source, the plugins, the documentation, and our unit-tests.

```javascript
npm run develop // Runs a server at localhost:9001 and automatically builds and reloads upon changes
npm run build:develop // Compiles the Javascript and SASS source and places it in the build/ directory
npm run lint // Lints the Javascript source with JSHint
npm test // Runs the unit tests and outputs a report to the console
npm run build:production // Builds the release package
```

Run `npm run develop` and navigate to [http://localhost:9001](http://localhost:9001) in your web browser to see a basic Diva instance.

See [Installation](https://github.com/DDMAL/diva.js/wiki/Installation) for more information.

## Getting help

Help for Diva.js is available through this repository's [wiki](https://github.com/DDMAL/diva.js/wiki), in the form of code documentation, installation instructions and usage tips. You can also [submit an issue](https://github.com/DDMAL/diva.js/issues)!

## Cross-site Requests

You may receive an error that looks something like this:

```
XMLHttpRequest cannot load http://example.com/demo/imagefiles.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed access.
```

This is a security precaution that all browsers use to prevent cross-site request forgeries. If you receive this message it is because your `objectData` parameter and the server used to serve the Diva page are not at the same server address.

To fix this you must ensure that the Diva HTML page, and the location pointed to by the `objectData` page are being served by the same server, or you must create an exception using the `Access-Control-Allow-Origin` header on your server to explicitly white-list the `objectData` location.

Let Us Know
-----------

We're developing Diva.js as part of our research in [Distributed Digital Music Libraries](http://ddmal.music.mcgill.ca). If you use it in your project, it would be great if you could [let us know](mailto:[email protected]).
25 changes: 0 additions & 25 deletions audit-diva-css-classes.js

This file was deleted.

Loading

0 comments on commit 0ea1451

Please sign in to comment.