mirror of
https://github.com/scratchfoundation/scratchx.git
synced 2024-11-25 09:08:28 -05:00
Use non-caveman event handlers
This commit is contained in:
parent
15daacc8e9
commit
78764b539e
1 changed files with 7 additions and 6 deletions
|
@ -24,7 +24,7 @@ function JSthrowError(e) {
|
||||||
function JSeditorReady() {
|
function JSeditorReady() {
|
||||||
try {
|
try {
|
||||||
handleParameters();
|
handleParameters();
|
||||||
JSeditorReadyCallback();
|
$("#editor").trigger("editorReady");
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error.message, "\n", error.stack);
|
console.error(error.message, "\n", error.stack);
|
||||||
|
@ -107,7 +107,6 @@ swfobject.embedSWF('Scratch.swf', 'editor', '100%', '100%', '11.7.0', 'libs/expr
|
||||||
|
|
||||||
|
|
||||||
/* File uploads */
|
/* File uploads */
|
||||||
var JSeditorReadyCallback = function(){};
|
|
||||||
function sendFileToFlash(file) {
|
function sendFileToFlash(file) {
|
||||||
var fileReader = new FileReader();
|
var fileReader = new FileReader();
|
||||||
fileReader.onload = function (e) {
|
fileReader.onload = function (e) {
|
||||||
|
@ -116,9 +115,10 @@ function sendFileToFlash(file) {
|
||||||
if (Scratch.FlashApp.ASobj.ASloadBase64SBX !== undefined) {
|
if (Scratch.FlashApp.ASobj.ASloadBase64SBX !== undefined) {
|
||||||
Scratch.FlashApp.ASobj.ASloadBase64SBX(fileAsB64);
|
Scratch.FlashApp.ASobj.ASloadBase64SBX(fileAsB64);
|
||||||
} else {
|
} else {
|
||||||
JSeditorReadyCallback = function() {
|
$(document).on("editorReady", function(e) {
|
||||||
Scratch.FlashApp.ASobj.ASloadBase64SBX(fileAsB64);
|
Scratch.FlashApp.ASobj.ASloadBase64SBX(fileAsB64);
|
||||||
}
|
$(this).off(e);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -133,9 +133,10 @@ function sendURLtoFlash(url) {
|
||||||
if (Scratch.FlashApp.ASobj.ASloadGithubURL !== undefined) {
|
if (Scratch.FlashApp.ASobj.ASloadGithubURL !== undefined) {
|
||||||
Scratch.FlashApp.ASobj.ASloadGithubURL(url);
|
Scratch.FlashApp.ASobj.ASloadGithubURL(url);
|
||||||
} else {
|
} else {
|
||||||
JSeditorReadyCallback = function() {
|
$(document).on("editorReady", function(e) {
|
||||||
Scratch.FlashApp.ASobj.ASloadGithubURL(url);
|
Scratch.FlashApp.ASobj.ASloadGithubURL(url);
|
||||||
}
|
$(this).off(e);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue