diff --git a/src/editor/engine/Page.js b/src/editor/engine/Page.js index f1d9045..7f5da2e 100644 --- a/src/editor/engine/Page.js +++ b/src/editor/engine/Page.js @@ -147,14 +147,10 @@ export default class Page { function doNext (str) { str = str.replace(/>\s*<'); me.setSVG(str); - if ((str.indexOf('xlink:href') < 0) && OS.path) { - me.setBackgroundImage(url, fcn); // does not have embedded images - } else { + IO.getImagesInSVG(str, function () { var base64 = IO.getImageDataURL(me.md5, btoa(str)); - IO.getImagesInSVG(str, function () { - me.setBackgroundImage(base64, fcn); - }); - } + me.setBackgroundImage(base64, fcn); + }); } } diff --git a/src/editor/engine/Sprite.js b/src/editor/engine/Sprite.js index 75b2312..7f03243 100755 --- a/src/editor/engine/Sprite.js +++ b/src/editor/engine/Sprite.js @@ -77,9 +77,6 @@ export default class Sprite { getAsset (whenDone) { var md5 = this.md5; var spr = this; - var url = (MediaLib.keys[md5]) ? - MediaLib.path + md5 : - (md5.indexOf('/') < 0) ? OS.path + md5 : md5; md5 = (MediaLib.keys[md5]) ? MediaLib.path + md5 : md5; if (md5.indexOf('/') > -1) { IO.requestFromServer(md5, doNext); @@ -92,14 +89,10 @@ export default class Sprite { function doNext (str) { str = str.replace(/>\s*<'); spr.setSVG(str); - if ((str.indexOf('xlink:href') < 0) && OS.path) { - whenDone(url); // does not have embedded images - } else { + IO.getImagesInSVG(str, function () { var base64 = IO.getImageDataURL(spr.md5, btoa(str)); - IO.getImagesInSVG(str, function () { - whenDone(base64); - }); - } + whenDone(base64); + }); } } diff --git a/src/tablet/IO.js b/src/tablet/IO.js index b54ec2c..ef767c3 100644 --- a/src/tablet/IO.js +++ b/src/tablet/IO.js @@ -90,11 +90,8 @@ export default class IO { IO.requestFromServer(md5, gotit); // get url contents return; } - if ((IO.getExtension(md5) == 'png') && OS.path) { - fcn(OS.path + md5); // only if it is not in debug mode - } else { - OS.getmedia(md5, nextStep); - } // get url contents + + OS.getmedia(md5, nextStep); function gotit (str) { var base64 = IO.getImageDataURL(md5, btoa(str));