c0.524-0.446,1.112-0.53,1.678-0.242c0.565,0.288,0.871,0.919,0.773,1.546l-1.094,7.029l6.313,3.243
C29.863,18.278,30.176,18.903,30.074,19.532z"/>
</symbol>
-
+ <symbol id="icon-article" viewBox="0 0 25 25">
+ <path d="M19.2,11.7H5.8c-0.4,0-0.7-0.3-0.7-0.7V6.1c0-0.4,0.3-0.7,0.7-0.7h13.3c0.4,0,0.7,0.3,0.7,0.7V11
+ C19.9,11.4,19.6,11.7,19.2,11.7z M6.5,10.3h11.9V6.8H6.5V10.3z"/>
+ <path d="M19.2,14.6H5.8c-0.4,0-0.7-0.3-0.7-0.7s0.3-0.7,0.7-0.7h13.3c0.4,0,0.7,0.3,0.7,0.7S19.6,14.6,19.2,14.6z"/>
+ <path d="M19.2,17.2H5.8c-0.4,0-0.7-0.3-0.7-0.7s0.3-0.7,0.7-0.7h13.3c0.4,0,0.7,0.3,0.7,0.7S19.6,17.2,19.2,17.2z"/>
+ <path d="M13.1,19.7H5.8c-0.4,0-0.7-0.3-0.7-0.7s0.3-0.7,0.7-0.7h7.2c0.4,0,0.7,0.3,0.7,0.7S13.5,19.7,13.1,19.7z"/>
+ <path d="M21.1,22.6H3.9c-0.9,0-1.6-0.7-1.6-1.6V4.1c0-0.9,0.7-1.6,1.6-1.6h17.2c0.9,0,1.6,0.7,1.6,1.6v16.9
+ C22.7,21.8,22,22.6,21.1,22.6z M3.9,3.9c-0.1,0-0.2,0.1-0.2,0.2v16.9c0,0.1,0.1,0.2,0.2,0.2h17.2c0.1,0,0.2-0.1,0.2-0.2V4.1
+ c0-0.1-0.1-0.2-0.2-0.2H3.9z"/>
+ </symbol>
</svg>
return res;
},
+ findArticleById: function (id) {
+ return this.fluidbook.settings.articlesList[id];
+ },
+
isEnabled: function () {
return Object.keys(this.fluidbook.settings.articlesList).length > 0;
},
});
$(this.fluidbook).on('fluidbook.zoom.in.end', function () {
- $this.zoomLinkReset(true);
+ $this.zoomLinkReset(false);
return true;
});
}
if (action === 'link') {
- menu += 'href="' + data + '" target="_blank"';
- linkClass += ' ext';
+ var l = $this.getLink(data);
+ if (l !== undefined) {
+ menu += 'href="' + l.url + '" target="' + l.target + '"';
+ linkClass += ' ext';
+ }
} else if (action === 'copy') {
menu += 'data-clipboard-text="' + escapeHtml(data) + '" ';
} else if (action === 'video') {
// Load image before running zoom up animation
$this.fluidbook.displayLoader();
loadImage(zoomImage, function (img) {
-
// Image is set as a background for better scaling / fitting via CSS
z.css('background-image', 'url(' + img.src + ')');
$this.fluidbook.hideLoader();
boxShadow: '0 0 100px rgba(0,0,0,0.3)',
transform: 'translateX(' + zoomX + 'px) translateY(' + zoomY + 'px) scale(1)'
});
-
setTimeout(function () {
$this.resizeZoomLinkBackground(true);
}, 600);
-
}, 50);
-
$this.fluidbook.stats.track(2, $this.fluidbook.currentPage);
});
});
},
+ getLink: function (url) {
+ var e = url.split(':', 2);
+ if (e.length === 1 || e[0] === 'http' || e[1] === 'https') {
+ return {url: url, target: '_blank'};
+ }
+
+ if (e[0] === 'article') {
+ var a = this.fluidbook.articles.findArticleById(e[1]);
+ if (a !== undefined) {
+ return {url: '#/article/' + a.url, target: '_self'};
+ }
+ }
+ },
+
resizeZoomLinkBackground: function (show) {
var top, left, bottom, right, width, height, hpadding, vpadding;
$("#zoomPopupMenuWrapper").css({left: left, top: top + height, width: width, opacity: show ? 1 : 0});
},
- zoomLinkClose: function (immediate) {
- return this.zoomLinkReset(immediate);
- },
-
zoomLinkReset: function (immediate) {
var $this = this;
left: 0;
width: 100%;
height: 100%;
- z-index: 21;
+ z-index: 41;
cursor: pointer; // Needed or click events don't work on iOS (see: https://stackoverflow.com/a/16006333)
.overlayBackground();
}
position: absolute;
top: 0;
left: 0;
- z-index: 22;
+ z-index: 42;
display: none;
overflow: hidden;
background-repeat: no-repeat;
position: absolute;
top: 0px;
left: 0px;
- z-index: 30;
+ z-index: 40;
display: none;
> div {
position: absolute;
top: 0;
left: 0;
- z-index: 40;
+ z-index: 140;
width: 100%;
height: 100%;
left: 0;
width: 100%;
height: 100%;
- z-index: 100;
+ z-index: 30;
display: none;
.overlayBackground();
}
#zoomPopupBackground {
position: absolute;
- z-index: 100;
+ z-index: 30;
opacity: 0;
transition: opacity 150ms;
#zoomPopupMenuWrapper {
position: absolute;
- z-index: 101;
+ z-index: 31;
transition: opacity 150ms;
#zoomPopupMenu {
width: @zoom-close-button-size;
height: @zoom-close-button-size;
padding: unit((@zoom-close-button-size/30)*11, px);
- z-index: 103;
+ z-index: 33;
.button-hover();
color: @menu-text;
opacity: 1;
transition: all 0.5s;
transform-origin: 0 0;
position: absolute;
- z-index: 101;
+ z-index: 31;
img {
position: absolute;
width: 100%;
height: 100%;
display: block;
- z-index: 102;
+ z-index: 32;
}
opacity: 0;
pointer-events: none;
transition: opacity 0.3s ease-in;
- z-index: 30;
+ z-index: 45;
position: absolute;
top: 0;
left: 0;