mirror of
https://github.com/google/blockly.git
synced 2026-01-08 09:30:06 +01:00
Defenestration
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user