Skip to content
This repository was archived by the owner on Dec 2, 2025. It is now read-only.

Commit 53e2d0d

Browse files
author
dastaple
committed
Fix the variable renaming bug.
1 parent a6a751b commit 53e2d0d

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

app/BlocklyManager.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//Store the blockly manager class, and overrides to fit blockly functionality into Electron/Chrome apps.
2+
'use strict';
3+
goog.require('goog.ui.Prompt');
4+
5+
// Blockly.FieldVariable.prototype._validate_varname = function(newVar) {
6+
// // Merge runs of whitespace. Strip leading and trailing whitespace.
7+
// // Beyond this, all names are legal.
8+
// if (newVar) {
9+
// newVar = newVar.replace(/[\s\xa0]+/g, ' ').replace(/^ | $/g, '');
10+
// if (newVar == Blockly.Msg.RENAME_VARIABLE ||
11+
// newVar == Blockly.Msg.NEW_VARIABLE) {
12+
// // Ok, not ALL names are legal...
13+
// newVar = null;
14+
// }
15+
// }
16+
// return newVar;
17+
// };
18+
19+
Blockly.prompt = function(message, defaultValue, callback) {
20+
prompt = new goog.ui.Prompt(message, defaultValue, callback);
21+
prompt.setModal(true);
22+
prompt.setVisible(true);
23+
};

app/start.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const Blockly = require('node-blockly/browser');
1010
require("google-closure-library");
1111
goog.require('goog.ui.TabPane');
1212

13+
require("./app/BlocklyManager.js");
1314
const BounceConfig=require('./app/BounceConfig.js');
1415
require("./CustomNodeBlocks.js");
1516
const NodeMcu = require("./app/nodemcu.js");

bounce.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,15 @@ html, body {
133133

134134
.modal-dialog-bg {
135135
position: absolute;
136+
z-index: 1000;
136137
top: 0px;
137138
left: 0px;
138139
background-color: #FFF;
139140
}
140141

141142
.modal-dialog {
142143
position: absolute;
144+
z-index: 1001;
143145
top: 0px;
144146
left: 0px;
145147
width: 300px;

bounce_window.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<script>if (window.module) module = window.module;</script>
1313
<script type="text/javascript" src="app/start.js"></script> <!-- Main ui here -->
14-
<link rel="stylesheet" href="node-modules/google-closure-library/closure/goog/css/common.css">
14+
<link rel="stylesheet" href="node_modules/google-closure-library/closure/goog/css/common.css">
1515
<link rel="stylesheet" href="bounce.css">
1616
<link rel="stylesheet" href="font-awesome-4.6.1/css/font-awesome.min.css">
1717
</head>

0 commit comments

Comments
 (0)