Skip to content

Commit

Permalink
added presentation 3 paging tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edsilv committed Sep 20, 2018
1 parent 23199c8 commit a60faba
Show file tree
Hide file tree
Showing 13 changed files with 4,622 additions and 35 deletions.
8 changes: 8 additions & 0 deletions dist/client/manifesto.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,12 @@ var Manifesto;
Behavior.prototype.nonav = function () {
return new Behavior(Behavior.NONAV.toString());
};
Behavior.prototype.paged = function () {
return new Behavior(Behavior.PAGED.toString());
};
Behavior.AUTOADVANCE = new Behavior("auto-advance");
Behavior.NONAV = new Behavior("no-nav");
Behavior.PAGED = new Behavior("paged");
return Behavior;
}(Manifesto.StringValue));
Manifesto.Behavior = Behavior;
Expand Down Expand Up @@ -1495,6 +1499,10 @@ var Manifesto;
if (viewingHint) {
return viewingHint.toString() === Manifesto.ViewingHint.PAGED.toString();
}
var behavior = this.getBehavior();
if (behavior) {
return behavior.toString() === Manifesto.Behavior.PAGED.toString();
}
return false;
};
Manifest.prototype.getViewingDirection = function () {
Expand Down
10 changes: 9 additions & 1 deletion dist/client/manifesto.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// manifesto v3.0.6 https://github.com/iiif-commons/manifesto
// manifesto v3.0.7 https://github.com/iiif-commons/manifesto
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.manifesto = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
(function (global){

Expand Down Expand Up @@ -143,8 +143,12 @@ var Manifesto;
Behavior.prototype.nonav = function () {
return new Behavior(Behavior.NONAV.toString());
};
Behavior.prototype.paged = function () {
return new Behavior(Behavior.PAGED.toString());
};
Behavior.AUTOADVANCE = new Behavior("auto-advance");
Behavior.NONAV = new Behavior("no-nav");
Behavior.PAGED = new Behavior("paged");
return Behavior;
}(Manifesto.StringValue));
Manifesto.Behavior = Behavior;
Expand Down Expand Up @@ -1423,6 +1427,10 @@ var Manifesto;
if (viewingHint) {
return viewingHint.toString() === Manifesto.ViewingHint.PAGED.toString();
}
var behavior = this.getBehavior();
if (behavior) {
return behavior.toString() === Manifesto.Behavior.PAGED.toString();
}
return false;
};
Manifest.prototype.getViewingDirection = function () {
Expand Down
4 changes: 3 additions & 1 deletion dist/manifesto.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// manifesto v3.0.6 https://github.com/iiif-commons/manifesto
// manifesto v3.0.7 https://github.com/iiif-commons/manifesto

declare namespace Manifesto {
class StringValue {
Expand Down Expand Up @@ -54,8 +54,10 @@ declare namespace Manifesto {
class Behavior extends StringValue {
static AUTOADVANCE: Behavior;
static NONAV: Behavior;
static PAGED: Behavior;
autoadvance(): Behavior;
nonav(): Behavior;
paged(): Behavior;
}
}

Expand Down
10 changes: 9 additions & 1 deletion dist/server/manifesto.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "manifesto.js",
"version": "3.0.6",
"version": "3.0.7",
"description": "IIIF Presentation API utility library for client and server",
"main": "./dist/server/manifesto.js",
"types": "./dist/manifesto.d.ts",
Expand Down
5 changes: 5 additions & 0 deletions src/Behavior.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ namespace Manifesto {
export class Behavior extends StringValue{
public static AUTOADVANCE = new Behavior("auto-advance");
public static NONAV = new Behavior("no-nav");
public static PAGED = new Behavior("paged");

// todo: use getters when ES3 target is no longer required.

Expand All @@ -12,5 +13,9 @@ namespace Manifesto {
nonav(): Behavior {
return new Behavior(Behavior.NONAV.toString());
}

paged(): Behavior {
return new Behavior(Behavior.PAGED.toString());
}
}
}
6 changes: 6 additions & 0 deletions src/Manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@ namespace Manifesto {
return viewingHint.toString() === Manifesto.ViewingHint.PAGED.toString();
}

const behavior: Behavior | null = this.getBehavior();

if (behavior) {
return behavior.toString() === Manifesto.Behavior.PAGED.toString();
}

return false;
}

Expand Down
3 changes: 2 additions & 1 deletion test/fixtures/manifests.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ module.exports = {
"scroll": "http://localhost:3001/scroll.json",
"storyofwellcome": "http://localhost:3001/storyofwellcome.json",
"tankeryshouse": "http://localhost:3001/tankeryshouse.json",
"theprincipleofrelativity": "http://localhost:3001/theprincipleofrelativity.json",
"presentation2Paging": "http://localhost:3001/presentation2-paging.json",
"presentation3Paging": "http://localhost:3001/presentation3-paging.json",
"translations": "http://localhost:3001/translations.json",
"wellcomeapocalypse": "http://localhost:3001/wellcomeapocalypse.json",
"witnesstopeter": "http://localhost:3001/witnesstopeter.json",
Expand Down
File renamed without changes.
Loading

0 comments on commit a60faba

Please sign in to comment.