Skip to content

Commit 59d3ee2

Browse files
committed
Merge branch 'master' into release-2.12
2 parents 3c823ff + 7cac2e3 commit 59d3ee2

File tree

2 files changed

+27
-31
lines changed

2 files changed

+27
-31
lines changed

frontend-jquery/src/main/webapp/jquery/jquery.digilib.js

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* #%L
33
* digilib-webapp
44
* %%
5-
* Copyright (C) 2011 - 2017 MPIWG Berlin, Bibliotheca Hertziana
5+
* Copyright (C) 2011 - 2023 MPIWG Berlin, Bibliotheca Hertziana
66
* %%
77
* This program is free software: you can redistribute it and/or modify
88
* it under the terms of the GNU Lesser General Public License as
@@ -94,8 +94,8 @@ function($) {
9494
// save digilib state in cookie for embedded mode
9595
'saveStateInCookie' : true,
9696
// default size of preview image for drag-scroll (preferrably same as Bird's Eye View image)
97-
'previewImgWidth' : 200,
98-
'previewImgHeight' : 200,
97+
'previewImgWidth' : 400,
98+
'previewImgHeight' : 400,
9999
// maximum width or height of preview background image for drag-scroll
100100
'maxBgSize' : 10000,
101101
// parameters used by background image
@@ -202,14 +202,7 @@ function($) {
202202
unpackParams(data);
203203
// list of current insets (dynamic for buttons etc.)
204204
data.currentInsets = {'static' : elemSettings.scalerInsets};
205-
// check if browser knows *background-size
206-
for (var bs in {'':1, '-moz-':1, '-webkit-':1, '-o-':1}) {
207-
if ($elem.css(bs+'background-size')) {
208-
data.hasBgSize = true;
209-
data.bgSizeName = bs+'background-size';
210-
break;
211-
}
212-
}
205+
// background as preview using background-size
213206
data.hasPreviewBg = false;
214207
// check if browser supports AJAX-like URL-replace without reload
215208
data.hasAsyncReload = (typeof history.replaceState === 'function');
@@ -1492,6 +1485,12 @@ function($) {
14921485
*/
14931486
var setPreviewBg = function(data, newZoomArea) {
14941487
var $scaler = data.$scaler;
1488+
if (data.settings.rot % 90 != 0) {
1489+
// remove background for oblique angle rotations
1490+
$scaler.css({'background-image': 'none'});
1491+
data.hasPreviewBg = false;
1492+
return;
1493+
}
14951494
var imgTrafo = data.imgTrafo;
14961495
var scalerPos = geom.position($scaler);
14971496
var bgRect = null;
@@ -1524,26 +1523,23 @@ function($) {
15241523
// position background
15251524
scalerCss['background-position'] = Math.round(bgRect.x) + 'px '+ Math.round(bgRect.y) + 'px';
15261525
}
1527-
if (data.hasBgSize) {
1528-
// scale background using CSS3-background-size
1529-
if (bgRect != null && (bgRect.height < data.settings.maxBgSize && bgRect.width < data.settings.maxBgSize)) {
1530-
scalerCss[data.bgSizeName] = Math.round(bgRect.width) + 'px ' + Math.round(bgRect.height) + 'px';
1531-
} else {
1532-
scalerCss[data.bgSizeName] = 'auto';
1533-
}
1534-
// additional full-size background using CSS3
1535-
fullRect = imgTrafo.transform(FULL_AREA);
1536-
if (fullRect.height < data.settings.maxBgSize && fullRect.width < data.settings.maxBgSize) {
1537-
// correct offset because background is relative
1538-
fullRect.addPosition(scalerPos.neg());
1539-
var url = getPreviewImgUrl(data);
1540-
// add second background url, size and position
1541-
scalerCss['background-image'] += ', url(' + url + ')';
1542-
scalerCss[data.bgSizeName] += ', ' + Math.round(fullRect.width) + 'px ' + Math.round(fullRect.height) + 'px';
1543-
scalerCss['background-position'] += ', ' + Math.round(fullRect.x) + 'px '+ Math.round(fullRect.y) + 'px';
1544-
}
1526+
// scale background using CSS3-background-size
1527+
if (bgRect != null && (bgRect.height < data.settings.maxBgSize && bgRect.width < data.settings.maxBgSize)) {
1528+
scalerCss['background-size'] = Math.round(bgRect.width) + 'px ' + Math.round(bgRect.height) + 'px';
1529+
} else {
1530+
scalerCss['background-size'] = 'auto';
1531+
}
1532+
// additional full-size background using CSS3
1533+
fullRect = imgTrafo.transform(FULL_AREA);
1534+
if (fullRect.height < data.settings.maxBgSize && fullRect.width < data.settings.maxBgSize) {
1535+
// correct offset because background is relative
1536+
fullRect.addPosition(scalerPos.neg());
1537+
var url = getPreviewImgUrl(data);
1538+
// add second background url, size and position
1539+
scalerCss['background-image'] += ', url(' + url + ')';
1540+
scalerCss['background-size'] += ', ' + Math.round(fullRect.width) + 'px ' + Math.round(fullRect.height) + 'px';
1541+
scalerCss['background-position'] += ', ' + Math.round(fullRect.x) + 'px '+ Math.round(fullRect.y) + 'px';
15451542
}
1546-
// console.debug('* setPreviewBg', scalerCss[data.bgSizeName], 'pos', scalerCss['background-position']);
15471543
$scaler.css(scalerCss);
15481544
data.hasPreviewBg = true;
15491545
};

servlet/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<dependency>
3232
<groupId>org.bitbucket.b_c</groupId>
3333
<artifactId>jose4j</artifactId>
34-
<version>0.9.2</version>
34+
<version>0.9.3</version>
3535
</dependency>
3636
<!-- JSON-API -->
3737
<dependency>

0 commit comments

Comments
 (0)