Skip to content

Commit

Permalink
BuildVu 2021.11 (1.13.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonatherton committed Nov 3, 2021
1 parent cb6e1c6 commit 0447da2
Show file tree
Hide file tree
Showing 10 changed files with 198 additions and 94 deletions.
68 changes: 33 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "idrviewer",
"version": "1.12.2",
"version": "1.13.0",
"description": "The IDRViewer is a viewer designed for documents converted using BuildVu",
"keywords": [
"idrsolutions",
Expand Down Expand Up @@ -31,8 +31,8 @@
"devDependencies": {
"grunt": "^1.4.1",
"grunt-cli": "^1.4.3",
"grunt-contrib-jshint": "^3.0.0",
"grunt-contrib-qunit": "^5.1.0",
"grunt-contrib-jshint": "^3.1.1",
"grunt-contrib-qunit": "^5.1.1",
"grunt-contrib-uglify": "^5.0.1",
"qunit": "^2.17.2"
}
Expand Down
5 changes: 5 additions & 0 deletions src/examples/complete/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Complete UI Changelog
---------------------

2.2.0 (02 Nov 2021)
- Updated thumbnail sidebar to support loading from external URL
- Added keyboard and mouse wheel shortcuts for zoom
- Improved keyboard shortcuts for search

2.1.0 (21 Sep 2021)
- Added search result highlighting

Expand Down
59 changes: 54 additions & 5 deletions src/examples/complete/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<!-- v2.1.0 -->
<!-- v2.2.0 -->
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
Expand Down Expand Up @@ -221,13 +221,29 @@
searchInputEle.value = LanguageHelper.getTranslation('search.loading') || 'Loading';
searchInputEle.disabled = 'disabled';
searchInputEle.addEventListener('input', doSearch);
searchInputEle.addEventListener('keydown', function (event) {
switch (event.key) {
case "Esc": // IE/Edge specific value
case "Escape":
if (searchInputEle.value !== "") {
searchInputEle.value = "";
doSearch();
} else {
searchInputEle.blur();
Sidebar.toggleSidebar();
}
break;
}
});
matchCaseCheckbox.addEventListener('click', doSearch);
limitResultsCheckbox.addEventListener('click', doSearch);

document.addEventListener('keydown', function (event) {
if (event.keyCode === 70 && (event.ctrlKey || event.metaKey)) {
if (event.key === 'f' && (event.ctrlKey || event.metaKey)) {
Sidebar.openSidebar();
Sidebar.switchTo('search');
searchInputEle.focus();
searchInputEle.select();
event.preventDefault();
}
});
Expand Down Expand Up @@ -291,6 +307,7 @@
searchInputEle.value = (LanguageHelper.getTranslation('search.loading') || 'Loading') + ' (' + percentageLoaded + '%)';
};
if (!isSearchLoaded) {
isSearchLoaded = true;
IDRViewer.loadSearch(loadListener, progressListener);
}
searchInputEle.focus();
Expand All @@ -315,6 +332,7 @@
imageType,
pgCount,
curPg,
baseUrl,
scrollSidebar = true,
thumbnailTimeout,
spinnerInterval;
Expand All @@ -331,6 +349,7 @@
curPg = data.page;
pgCount = data.pagecount;
imageType = data.thumbnailType;
baseUrl = data.url || "";

loadThumbnailFrames(data.bounds);
// Initialise loaded array
Expand Down Expand Up @@ -415,7 +434,7 @@
break;
}
if (curThumb.offsetTop + curThumb.clientHeight > thumbnailPanel.scrollTop) {
curThumb.innerHTML = '<img src="thumbnails/' + (thumbIndex + 1) + '.' + imageType + '" />';
curThumb.innerHTML = '<img src="' + baseUrl + 'thumbnails/' + (thumbIndex + 1) + '.' + imageType + '" />';
loadedThumbsArray[thumbIndex] = true;
}
}
Expand Down Expand Up @@ -564,6 +583,9 @@
};

const keyDownHandler = function (e) {
if (document.activeElement != null && document.activeElement.tagName === "INPUT") {
return;
}
switch (e.keyCode) {
case 33: // Page Up
IDRViewer.prev();
Expand Down Expand Up @@ -687,6 +709,33 @@
zoomInBtn.addEventListener('click', function (e) { IDRViewer.zoomIn(); e.preventDefault(); });
zoomOutBtn.addEventListener('click', function (e) { IDRViewer.zoomOut(); e.preventDefault(); });

document.addEventListener('keydown', function (event) {
if (event.ctrlKey || event.metaKey) {
if (event.key === '0') {
IDRViewer.setZoom(IDRViewer.ZOOM_AUTO);
event.preventDefault();
} else if (event.key === '-') {
IDRViewer.zoomOut();
event.preventDefault();
} else if (event.key === '+' || event.key === '=') {
IDRViewer.zoomIn();
event.preventDefault();
}
}
});

document.addEventListener('wheel', function (event) {
if (event.ctrlKey || event.metaKey) {
if (event.deltaY > 0) {
IDRViewer.zoomOut();
event.preventDefault();
} else if (event.deltaY < 0) {
IDRViewer.zoomIn();
event.preventDefault();
}
}
}, { passive: false });

zoomBtn.value = IDRViewer.ZOOM_AUTO;

IDRViewer.on('zoomchange', handleZoomUpdate);
Expand Down Expand Up @@ -861,7 +910,7 @@
right: 0;
position: absolute;
}

#controls select {
height: 25px;
margin-top: 10px;
Expand All @@ -887,7 +936,7 @@
#controls select {
color: white;
}

#btnSelect, #btnZoomOut, #btnView {
margin-left: 20px;
}
Expand Down
8 changes: 8 additions & 0 deletions src/js/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
IDRViewer Changelog
-------------------

1.13.0 (02 Nov 2021)
- Add console message when loading from the file: protocol to explain that search/annotations functionality will not be available and that HTML pages will fallback to displaying in iframes as browsers do not support AJAX over the file: protocol
- Update idrviewer.annotations.js and idrviewer.search.js to support loading from external url
- Update idrviewer.querystring-navigation.js to allow other parameters in the URL
- Update idrviewer.annotations.js to handle the updated attachments format in annotations.json
- Update dev dependencies

1.12.2 (21 Sep 2021)
- Add search result highlighting (to Complete UI)
- Add support for audio Rendition actions
Expand Down
Loading

0 comments on commit 0447da2

Please sign in to comment.