diff --git a/src/editor/engine/Page.js b/src/editor/engine/Page.js index a51a17e..60edb18 100644 --- a/src/editor/engine/Page.js +++ b/src/editor/engine/Page.js @@ -131,7 +131,7 @@ export default class Page { var md5 = (MediaLib.keys[name]) ? MediaLib.path + name : name; if (md5.substr(md5.length - 3) == 'png') { - this.setBackgroundImage(url, fcn); + this.setBackgroundImage(window.MabniJuniorBridge ? window.MabniJuniorBridge.mediaUrl(name) : url, fcn); this.svg = null; return; } diff --git a/src/editor/ui/Library.js b/src/editor/ui/Library.js index 2925f51..c613dc3 100644 --- a/src/editor/ui/Library.js +++ b/src/editor/ui/Library.js @@ -239,8 +239,7 @@ export default class Library { img.style.position = 'relative'; // Cached downsized-thumbnails are in pnglibrary - var pngPath = MediaLib.path.replace('svg', 'png'); - img.src = pngPath + IO.getFilename(md5) + '.png'; + img.src = MediaLib.path + md5; // Browser-native SVG thumbnails stay sharp at every size. tb.ontouchstart = function (evt) { fcn(evt, tb); diff --git a/src/entry/home.js b/src/entry/home.js index 0f448c0..33c5bbc 100644 --- a/src/entry/home.js +++ b/src/entry/home.js @@ -15,7 +15,7 @@ export function homeMain () { } function homeGoBack () { - window.location.href = 'index.html?back=yes'; + window.top.location.href = new URL('../../index.html', window.location.href).href; } function homeStrings () { diff --git a/src/tablet/OS.js b/src/tablet/OS.js index 8cde8e0..f28de2a 100644 --- a/src/tablet/OS.js +++ b/src/tablet/OS.js @@ -39,6 +39,10 @@ export default class OS { // Wait for the tablet interface to be injected into the webview static waitForInterface (fcn) { + if (window.MabniJuniorBridge) { + window.MabniJuniorBridge.ready.then(() => { tabletInterface = window.MabniJuniorBridge; if (fcn) fcn(); }); + return; + } // Already loaded the interface if (tabletInterface != null) { fcn();