From b01ba1efa0bd5510e56b25a2edaeefea7f68418e Mon Sep 17 00:00:00 2001 From: Tim Mickel Date: Wed, 13 Jan 2016 19:38:43 -0500 Subject: [PATCH] Fixing iOS.js exports --- src/editor/engine/Sprite.js | 2 +- src/iPad/iOS.js | 29 +++++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/editor/engine/Sprite.js b/src/editor/engine/Sprite.js index 7b0bb28..70d5c23 100755 --- a/src/editor/engine/Sprite.js +++ b/src/editor/engine/Sprite.js @@ -66,7 +66,7 @@ Sprite.prototype.getAsset = function (whenDone) { function doNext (str) { str = str.replace(/>\s*<'); spr.setSVG(str); - if ((str.indexOf('xlink:href') < 0) && iOS.path) { + if ((str.indexOf('xlink:href') < 0) && iOS.path { whenDone(url); // does not have embedded images } else { var base64 = IO.getImageDataURL(spr.md5, btoa(str)); diff --git a/src/iPad/iOS.js b/src/iPad/iOS.js index 04bc962..f6bea17 100644 --- a/src/iPad/iOS.js +++ b/src/iPad/iOS.js @@ -1,4 +1,7 @@ import {isiOS, gn} from '../utils/lib'; +import IO from './IO'; +import Lobby from '../lobby/Lobby'; +import Alert from '../editor/ui/Alert'; ////////////////////////////////////////////////// // Tablet interface functions @@ -8,13 +11,31 @@ import {isiOS, gn} from '../utils/lib'; // But, it is also used for the AndroidInterface. All function calls here // are mapped to Android/iOS native calls. -export let path; -export let camera; -export let database = 'projects'; +let path; +let camera; +let database = 'projects'; let mediacounter = 0; let tabletInterface = null; export default class iOS { + // Getters/setters for properties used in other classes + static get path () { + return path; + } + + static set path (newPath) { + path = newPath; + } + + static get camera () { + return camera; + } + + static get database () { + return database; + } + + // Wait for the tablet interface to be injected into the webview static waitForInterface (fcn) { // Already loaded the interface if (tabletInterface != null) { @@ -211,7 +232,7 @@ export default class iOS { // camera functions static hascamera () { - iOS.camera = tabletInterface.scratchjr_cameracheck(); + camera = tabletInterface.scratchjr_cameracheck(); } static startfeed (data, fcn) {