mirror of
https://github.com/scratchfoundation/scratchjr.git
synced 2024-11-28 18:15:37 -05:00
Fixing iOS.js exports
This commit is contained in:
parent
b22973207a
commit
b01ba1efa0
2 changed files with 26 additions and 5 deletions
|
@ -66,7 +66,7 @@ Sprite.prototype.getAsset = function (whenDone) {
|
|||
function doNext (str) {
|
||||
str = str.replace(/>\s*</g, '><');
|
||||
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));
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue