GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: allow specifying the function to be used for prompting about var… · scratchfoundation/scratch-blocks@4cfe66f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • variables.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/variables.js‎

Copy file name to clipboardExpand all lines: src/variables.js
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ import {
3737
*/
3838
const CLOUD_PREFIX = "☁ ";
3939

40+
let prompt = null;
41+
42+
export function setPromptHandler(handler) {
43+
prompt = handler;
44+
}
45+
4046
/**
4147
* Create a new variable on the given workspace.
4248
* @param {!Blockly.Workspace} workspace The workspace on which to create the
@@ -70,7 +76,7 @@ export function createVariable(workspace, opt_callback, opt_type) {
7076
var validate = nameValidator.bind(null, opt_type);
7177

7278
// Prompt the user to enter a name for the variable
73-
Blockly.dialog.prompt(
79+
prompt(
7480
newMsg,
7581
"",
7682
function (text, additionalVars, variableOptions) {
@@ -309,7 +315,7 @@ export function renameVariable(workspace, variable, opt_callback) {
309315
promptDefaultText = promptDefaultText.substring(CLOUD_PREFIX.length);
310316
}
311317

312-
Blockly.dialog.prompt(
318+
prompt(
313319
promptText,
314320
promptDefaultText,
315321
function (newName, additionalVars) {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.