break;
case 'iframe':
case 'freeiframe':
- w = ww * 0.8;
+ iframe = $("#view .iframeHolder iframe");
if (parseInt(this.fluidbook.settings.iframePopupMaxWidth) > 0) {
- w = Math.min(w, parseInt(this.fluidbook.settings.iframePopupMaxWidth));
+ maxWidth = parseInt(this.fluidbook.settings.iframePopupMaxWidth);
+ }
+ maxWidth = this.getMetaIframeNumber(iframe, 'max-width', maxWidth);
+ $(iframe).closest('.iframeContainer').css('background-color', this.getMetaIframe(iframe, 'background-color', '#fff'));
+ w = ww * 0.8;
+ if (maxWidth > 0) {
+ console.log(maxWidth, w);
+ w = Math.min(w, maxWidth)
}
+
h = hh * 0.8;
if (ww < 800) {
w = ww;
}
forceHeight = true;
- w = Math.min(w, maxWidth);
-
- var iframe = $("#view .iframeHolder iframe");
+ if (maxWidth > 0) {
+ w = Math.min(w, maxWidth);
+ }
iframe.css('width', w);
try {
var doc = getIframeDocument(iframe);
ih = -1;
}
+
if (ih > 0) {
h = Math.min(ih, h);
}
+ let minHeight = this.getMetaIframeNumber(iframe, 'min-height', 0);
+ if (minHeight > 0) {
+ h = Math.max(h, minHeight);
+ }
}
break;
case 'cart':
captionHeight += $(this).outerHeight();
});
- w = Math.min(maxWidth, w);
+ if (maxWidth > 0) {
+ w = Math.min(maxWidth, w);
+ }
css = {};
var ccss = {};
}
},
+ getMetaIframe: function (iframe, name, defaultValue) {
+ try {
+ var res = iframe.get(0).contentWindow.document.querySelector('meta[name="' + name + '"]').content;
+ if (res === undefined || res === null) {
+ return defaultValue;
+ }
+ return res;
+ } catch (e) {
+ return defaultValue;
+ }
+ },
+
+ getMetaIframeNumber: function (iframe, name, defaultValue) {
+ try {
+ var res = this.getMetaIframe(iframe, name, defaultValue);
+ if (isNaN(res)) {
+ return defaultValue;
+ }
+ return res;
+ } catch (e) {
+ return defaultValue;
+ }
+ },
+
resizePopupAudios: function () {
$(".mview audio").each(function () {
var w = $(window).width() - 200;