Defenestration

This commit is contained in:
Neil Fraser
2019-05-15 16:47:35 -07:00
committed by Neil Fraser
parent 4161ba0fa7
commit 32631577a4
5 changed files with 14 additions and 11 deletions

View File

@@ -383,7 +383,7 @@ Blockly.getMainWorkspace = function() {
* @param {function()=} opt_callback The callback when the alert is dismissed.
*/
Blockly.alert = function(message, opt_callback) {
window.alert(message);
alert(message);
if (opt_callback) {
opt_callback();
}
@@ -396,7 +396,7 @@ Blockly.alert = function(message, opt_callback) {
* @param {!function(boolean)} callback The callback for handling user response.
*/
Blockly.confirm = function(message, callback) {
callback(window.confirm(message));
callback(confirm(message));
};
/**
@@ -409,7 +409,7 @@ Blockly.confirm = function(message, callback) {
* @param {!function(string)} callback The callback for handling user response.
*/
Blockly.prompt = function(message, defaultValue, callback) {
callback(window.prompt(message, defaultValue));
callback(prompt(message, defaultValue));
};
/**
@@ -498,7 +498,8 @@ Blockly.bindEventWithChecks_ = function(node, name, thisObject, func,
};
var bindData = [];
if (Blockly.utils.global.PointerEvent && (name in Blockly.Touch.TOUCH_MAP)) {
if (Blockly.utils.global['PointerEvent'] &&
(name in Blockly.Touch.TOUCH_MAP)) {
for (var i = 0, type; type = Blockly.Touch.TOUCH_MAP[name][i]; i++) {
node.addEventListener(type, wrapFunc, false);
bindData.push([node, type, wrapFunc]);
@@ -550,8 +551,8 @@ Blockly.bindEvent_ = function(node, name, thisObject, func) {
};
var bindData = [];
var window = Blockly.utils.global['window'];
if (window && window.PointerEvent && (name in Blockly.Touch.TOUCH_MAP)) {
if (Blockly.utils.global['PointerEvent'] &&
(name in Blockly.Touch.TOUCH_MAP)) {
for (var i = 0, type; type = Blockly.Touch.TOUCH_MAP[name][i]; i++) {
node.addEventListener(type, wrapFunc, false);
bindData.push([node, type, wrapFunc]);