@@ -70,6 +70,8 @@ handlers:
|
||||
# Blockly files.
|
||||
- url: /static
|
||||
static_dir: static
|
||||
http_headers:
|
||||
Access-Control-Allow-Origin: "*"
|
||||
secure: always
|
||||
|
||||
# Storage API.
|
||||
|
||||
@@ -467,6 +467,15 @@ export class Gesture {
|
||||
/* opt_noCaptureIdentifier */ true,
|
||||
),
|
||||
);
|
||||
this.boundEvents.push(
|
||||
browserEvents.conditionalBind(
|
||||
document,
|
||||
'pointercancel',
|
||||
null,
|
||||
this.handleUp.bind(this),
|
||||
/* opt_noCaptureIdentifier */ true,
|
||||
),
|
||||
);
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
@@ -46,7 +46,6 @@ export const TOUCH_MAP: {[key: string]: string[]} = {
|
||||
'mouseup': ['pointerup', 'pointercancel'],
|
||||
'touchend': ['pointerup'],
|
||||
'touchcancel': ['pointercancel'],
|
||||
'pointerup': ['pointerup', 'pointercancel'],
|
||||
};
|
||||
|
||||
/** PID of queued long-press task. */
|
||||
|
||||
@@ -112,7 +112,11 @@ export class VariableMap
|
||||
const oldType = variable.getType();
|
||||
if (oldType === newType) return variable;
|
||||
|
||||
this.variableMap.get(variable.getType())?.delete(variable.getId());
|
||||
const oldTypeVariables = this.variableMap.get(oldType);
|
||||
oldTypeVariables?.delete(variable.getId());
|
||||
if (oldTypeVariables?.size === 0) {
|
||||
this.variableMap.delete(oldType);
|
||||
}
|
||||
variable.setType(newType);
|
||||
const newTypeVariables =
|
||||
this.variableMap.get(newType) ??
|
||||
|
||||
|
Before Width: | Height: | Size: 4.1 KiB |
@@ -1,91 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Blockly Demo: Minimap</title>
|
||||
<script src="../../dist/blockly_compressed.js"></script>
|
||||
<script src="../../dist/blocks_compressed.js"></script>
|
||||
<script src="../../build/msg/en.js"></script>
|
||||
<script src="minimap.js"></script>
|
||||
<style>
|
||||
body {
|
||||
background-color: #fff;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
h1 {
|
||||
font-weight: normal;
|
||||
font-size: 140%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1><a href="https://developers.google.com/blockly/">Blockly</a> >
|
||||
<a href="../index.html">Demos</a> > Minimap</h1>
|
||||
|
||||
<p>This is a simple demo showing how a minimap can be implemented.</p>
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td>
|
||||
<div id="masterDiv" style="height: 480px; width: 900px;"></div>
|
||||
</td>
|
||||
<td>
|
||||
<div id="mapDiv" style="height: 480px; width: 200px;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<xml xmlns="https://developers.google.com/blockly/xml" id="toolbox" style="display: none">
|
||||
<block type="controls_if"></block>
|
||||
<block type="logic_compare"></block>
|
||||
<block type="controls_repeat_ext"></block>
|
||||
<block type="math_number">
|
||||
<field name="NUM">123</field>
|
||||
</block>
|
||||
<block type="math_arithmetic"></block>
|
||||
<block type="text"></block>
|
||||
<block type="text_print"></block>
|
||||
<block type="variables_get"><field name="VAR">i</field></block>
|
||||
<block type="variables_get"><field name="VAR">j</field></block>
|
||||
<block type="variables_get"><field name="VAR">k</field></block>
|
||||
</xml>
|
||||
|
||||
<script>
|
||||
// Inject master workspace.
|
||||
var masterWorkspace = Blockly.inject('masterDiv', {
|
||||
media: '../../media/',
|
||||
scrollbars: true,
|
||||
toolbox: document.getElementById('toolbox')
|
||||
});
|
||||
|
||||
// Inject workspace for minimap.
|
||||
var minimapWorkspace = Blockly.inject('mapDiv', {
|
||||
media: '../../media/',
|
||||
readOnly: true,
|
||||
zoom: {
|
||||
controls: false,
|
||||
wheel: true,
|
||||
startScale: 0.1, // Change this according to your needs.
|
||||
maxScale: 0.1,
|
||||
minScale: 0.01
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize the minimap.
|
||||
Minimap.init(masterWorkspace,minimapWorkspace);
|
||||
</script>
|
||||
<style>
|
||||
.minimap{
|
||||
position: absolute;
|
||||
}
|
||||
.mapDragger{
|
||||
cursor: move;
|
||||
fill: rgb(0,0,255);
|
||||
stroke-width: .5;
|
||||
stroke: rgb(0,0,0);
|
||||
fill-opacity: .1;
|
||||
}
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,302 +0,0 @@
|
||||
/**
|
||||
|
||||
* Copyright 2017 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview JavaScript for Blockly's Minimap demo.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Creating a separate namespace for minimap.
|
||||
*/
|
||||
var Minimap = {};
|
||||
|
||||
/**
|
||||
* Initialize the workspace and minimap.
|
||||
* @param {!Workspace} workspace The main workspace of the user.
|
||||
* @param {!Workspace} minimap The workspace that will be used as a minimap.
|
||||
*/
|
||||
Minimap.init = function(workspace, minimap) {
|
||||
this.workspace = workspace;
|
||||
this.minimap = minimap;
|
||||
|
||||
// Adding scroll callback functionality to vScroll and hScroll just for this demo.
|
||||
// IMPORTANT: This should be changed when there is proper UI event handling
|
||||
// API available and should be handled by workspace's event listeners.
|
||||
this.workspace.scrollbar.vScroll.setHandlePosition = function(newPosition) {
|
||||
this.handlePosition_ = newPosition;
|
||||
this.svgHandle_.setAttribute(this.positionAttribute_, this.handlePosition_);
|
||||
|
||||
// Code above is same as the original setHandlePosition function in core/scrollbar.js.
|
||||
// New code starts from here.
|
||||
|
||||
// Get the absolutePosition.
|
||||
var absolutePosition = (this.handlePosition_ / this.ratio);
|
||||
|
||||
// Firing the scroll change listener.
|
||||
Minimap.onScrollChange(absolutePosition, this.horizontal_);
|
||||
};
|
||||
|
||||
// Adding call back for horizontal scroll.
|
||||
this.workspace.scrollbar.hScroll.setHandlePosition = function(newPosition) {
|
||||
this.handlePosition_ = newPosition;
|
||||
this.svgHandle_.setAttribute(this.positionAttribute_, this.handlePosition_);
|
||||
|
||||
// Code above is same as the original setHandlePosition function in core/scrollbar.js.
|
||||
// New code starts from here.
|
||||
|
||||
// Get the absolutePosition.
|
||||
var absolutePosition = (this.handlePosition_ / this.ratio);
|
||||
|
||||
// Firing the scroll change listener.
|
||||
Minimap.onScrollChange(absolutePosition, this.horizontal_);
|
||||
};
|
||||
|
||||
|
||||
// Required to stop a positive feedback loop when user clicks minimap
|
||||
// and the scroll changes, which in turn may change minimap.
|
||||
this.disableScrollChange = false;
|
||||
|
||||
// Listen to events on the main workspace.
|
||||
this.workspace.addChangeListener(Minimap.mirrorEvent);
|
||||
|
||||
//Get rectangle bounding the minimap div.
|
||||
this.rect = document.getElementById('mapDiv').getBoundingClientRect();
|
||||
|
||||
// Create a svg overlay on the top of mapDiv for the minimap.
|
||||
this.svg = Blockly.utils.dom.createSvgElement('svg', {
|
||||
'xmlns': Blockly.utils.dom.SVG_NS,
|
||||
'xmlns:html': Blockly.utils.dom.HTML_NS,
|
||||
'xmlns:xlink': Blockly.utils.dom.XLINK_NS,
|
||||
'version': '1.1',
|
||||
'height': this.rect.bottom-this.rect.top,
|
||||
'width': this.rect.right-this.rect.left,
|
||||
'class': 'minimap',
|
||||
}, document.getElementById('mapDiv'));
|
||||
this.svg.style.top = this.rect.top + 'px';
|
||||
this.svg.style.left = this.rect.left + 'px';
|
||||
|
||||
// Creating a rectangle in the minimap that represents current view.
|
||||
Blockly.utils.dom.createSvgElement('rect', {
|
||||
'width': 100,
|
||||
'height': 100,
|
||||
'class': 'mapDragger'
|
||||
}, this.svg);
|
||||
|
||||
// Rectangle in the minimap that represents current view.
|
||||
this.mapDragger = this.svg.childNodes[0];
|
||||
|
||||
// Adding mouse events to the rectangle, to make it Draggable.
|
||||
// Using Blockly.browserEvents.bind to attach mouse/touch listeners.
|
||||
Blockly.browserEvents.bind(
|
||||
this.mapDragger, 'mousedown', null, Minimap.mousedown);
|
||||
|
||||
//When the window change, we need to resize the minimap window.
|
||||
window.addEventListener('resize', Minimap.repositionMinimap);
|
||||
|
||||
// Mouse up event for the minimap.
|
||||
this.svg.addEventListener('mouseup', Minimap.updateMapDragger);
|
||||
|
||||
//Boolean to check whether I am dragging the surface or not.
|
||||
this.isDragging = false;
|
||||
};
|
||||
|
||||
Minimap.mousedown = function(e) {
|
||||
// Using Blockly.browserEvents.bind to attach mouse/touch listeners.
|
||||
Minimap.mouseMoveBindData = Blockly.browserEvents.bind(
|
||||
document, 'mousemove', null, Minimap.mousemove);
|
||||
Minimap.mouseUpBindData =
|
||||
Blockly.browserEvents.bind(document, 'mouseup', null, Minimap.mouseup);
|
||||
|
||||
Minimap.isDragging = true;
|
||||
e.stopPropagation();
|
||||
};
|
||||
|
||||
Minimap.mouseup = function(e) {
|
||||
Minimap.isDragging = false;
|
||||
// Removing listeners.
|
||||
Blockly.browserEvents.unbind(Minimap.mouseUpBindData);
|
||||
Blockly.browserEvents.unbind(Minimap.mouseMoveBindData);
|
||||
Minimap.updateMapDragger(e);
|
||||
e.stopPropagation();
|
||||
};
|
||||
|
||||
Minimap.mousemove = function(e) {
|
||||
if (Minimap.isDragging) {
|
||||
Minimap.updateMapDragger(e);
|
||||
e.stopPropagation();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Run non-UI events from the main workspace on the minimap.
|
||||
* @param {!Blockly.Events.Abstract} event Event that triggered in the main
|
||||
* workspace.
|
||||
*/
|
||||
Minimap.mirrorEvent = function(event) {
|
||||
if (event.isUiEvent) {
|
||||
return; // Don't mirror UI events.
|
||||
}
|
||||
// Convert event to JSON. This could then be transmitted across the net.
|
||||
var json = event.toJson();
|
||||
// Convert JSON back into an event, then execute it.
|
||||
var minimapEvent = Blockly.Events.fromJson(json, Minimap.minimap);
|
||||
minimapEvent.run(true);
|
||||
Minimap.scaleMinimap();
|
||||
Minimap.setDraggerHeight();
|
||||
Minimap.setDraggerWidth();
|
||||
};
|
||||
|
||||
/**
|
||||
* Called when window is resized. Repositions the minimap overlay.
|
||||
*/
|
||||
Minimap.repositionMinimap = function() {
|
||||
Minimap.rect = document.getElementById('mapDiv').getBoundingClientRect();
|
||||
Minimap.svg.style.top = Minimap.rect.top + 'px';
|
||||
Minimap.svg.style.left = Minimap.rect.left + 'px';
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates the rectangle's height.
|
||||
*/
|
||||
Minimap.setDraggerHeight = function() {
|
||||
var workspaceMetrics = Minimap.workspace.getMetrics();
|
||||
var draggerHeight = (workspaceMetrics.viewHeight / Minimap.workspace.scale) *
|
||||
Minimap.minimap.scale;
|
||||
// It's zero when first block is placed.
|
||||
if (draggerHeight === 0) {
|
||||
return;
|
||||
}
|
||||
Minimap.mapDragger.setAttribute('height', draggerHeight);
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates the rectangle's width.
|
||||
*/
|
||||
Minimap.setDraggerWidth = function() {
|
||||
var workspaceMetrics = Minimap.workspace.getMetrics();
|
||||
var draggerWidth = (workspaceMetrics.viewWidth / Minimap.workspace.scale) *
|
||||
Minimap.minimap.scale;
|
||||
// It's zero when first block is placed.
|
||||
if (draggerWidth === 0) {
|
||||
return;
|
||||
}
|
||||
Minimap.mapDragger.setAttribute('width', draggerWidth);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Updates the overall position of the viewport of the minimap by appropriately
|
||||
* using translate functions.
|
||||
*/
|
||||
Minimap.scaleMinimap = function() {
|
||||
var minimapBoundingBox = Minimap.minimap.getBlocksBoundingBox();
|
||||
var workspaceBoundingBox = Minimap.workspace.getBlocksBoundingBox();
|
||||
var workspaceMetrics = Minimap.workspace.getMetrics();
|
||||
var minimapMetrics = Minimap.minimap.getMetrics();
|
||||
|
||||
// Scaling the minimap such that all the blocks can be seen in the viewport.
|
||||
// This padding is default because this is how to scrollbar(in main workspace)
|
||||
// is implemented.
|
||||
var topPadding = (workspaceMetrics.viewHeight) * Minimap.minimap.scale /
|
||||
(2 * Minimap.workspace.scale);
|
||||
var sidePadding = (workspaceMetrics.viewWidth) * Minimap.minimap.scale /
|
||||
(2 * Minimap.workspace.scale);
|
||||
|
||||
// If actual padding is more than half view ports height,
|
||||
// change it to actual padding.
|
||||
if ((workspaceBoundingBox.y * Minimap.workspace.scale -
|
||||
workspaceMetrics.contentTop) *
|
||||
Minimap.minimap.scale / Minimap.workspace.scale > topPadding) {
|
||||
topPadding = (workspaceBoundingBox.y * Minimap.workspace.scale -
|
||||
workspaceMetrics.contentTop) *
|
||||
Minimap.minimap.scale / Minimap.workspace.scale;
|
||||
}
|
||||
|
||||
// If actual padding is more than half view ports height,
|
||||
// change it to actual padding.
|
||||
if ((workspaceBoundingBox.x * Minimap.workspace.scale -
|
||||
workspaceMetrics.contentLeft) *
|
||||
Minimap.minimap.scale / Minimap.workspace.scale > sidePadding) {
|
||||
sidePadding = (workspaceBoundingBox.x * Minimap.workspace.scale -
|
||||
workspaceMetrics.contentLeft) *
|
||||
Minimap.minimap.scale / Minimap.workspace.scale;
|
||||
}
|
||||
|
||||
var scalex = (minimapMetrics.viewWidth - 2 * sidePadding) /
|
||||
minimapBoundingBox.width;
|
||||
var scaley = (minimapMetrics.viewHeight - 2 * topPadding) /
|
||||
minimapBoundingBox.height;
|
||||
Minimap.minimap.setScale(Math.min(scalex, scaley));
|
||||
|
||||
// Translating the minimap.
|
||||
Minimap.minimap.translate(
|
||||
-minimapMetrics.contentLeft * Minimap.minimap.scale + sidePadding,
|
||||
-minimapMetrics.contentTop * Minimap.minimap.scale + topPadding);
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles the onclick event on the minimapBoundingBox.
|
||||
* Changes mapDraggers position.
|
||||
* @param {!Event} e Event from the mouse click.
|
||||
*/
|
||||
Minimap.updateMapDragger = function(e) {
|
||||
var y = e.clientY;
|
||||
var x = e.clientX;
|
||||
var draggerHeight = Minimap.mapDragger.getAttribute('height');
|
||||
var draggerWidth = Minimap.mapDragger.getAttribute('width');
|
||||
|
||||
var finalY = y - Minimap.rect.top - draggerHeight / 2;
|
||||
var finalX = x - Minimap.rect.left - draggerWidth / 2;
|
||||
|
||||
var maxValidY = (Minimap.workspace.getMetrics().contentHeight -
|
||||
Minimap.workspace.getMetrics().viewHeight) * Minimap.minimap.scale;
|
||||
var maxValidX = (Minimap.workspace.getMetrics().contentWidth -
|
||||
Minimap.workspace.getMetrics().viewWidth) * Minimap.minimap.scale;
|
||||
|
||||
if (y + draggerHeight / 2 > Minimap.rect.bottom) {
|
||||
finalY = Minimap.rect.bottom - Minimap.rect.top - draggerHeight;
|
||||
} else if (y < Minimap.rect.top + draggerHeight / 2) {
|
||||
finalY = 0;
|
||||
}
|
||||
|
||||
if (x + draggerWidth / 2 > Minimap.rect.right) {
|
||||
finalX = Minimap.rect.right - Minimap.rect.left - draggerWidth;
|
||||
} else if (x < Minimap.rect.left + draggerWidth / 2) {
|
||||
finalX = 0;
|
||||
}
|
||||
|
||||
// Do not go below lower bound of scrollbar.
|
||||
if (finalY > maxValidY) {
|
||||
finalY = maxValidY;
|
||||
}
|
||||
if (finalX > maxValidX) {
|
||||
finalX = maxValidX;
|
||||
}
|
||||
Minimap.mapDragger.setAttribute('y', finalY);
|
||||
Minimap.mapDragger.setAttribute('x', finalX);
|
||||
// Required, otherwise creates a feedback loop.
|
||||
Minimap.disableScrollChange = true;
|
||||
Minimap.workspace.scrollbar.vScroll.set((finalY * Minimap.workspace.scale) /
|
||||
Minimap.minimap.scale);
|
||||
Minimap.workspace.scrollbar.hScroll.set((finalX * Minimap.workspace.scale) /
|
||||
Minimap.minimap.scale);
|
||||
Minimap.disableScrollChange = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles the onclick event on the minimapBoundingBox, parameters are passed by
|
||||
* the event handler.
|
||||
* @param {number} position This is the absolute position of the scrollbar.
|
||||
* @param {boolean} horizontal Informs if the change event if for
|
||||
* horizontal (true) or vertical (false) scrollbar.
|
||||
*/
|
||||
Minimap.onScrollChange = function(position, horizontal) {
|
||||
if (!Minimap.disableScrollChange) {
|
||||
Minimap.mapDragger.setAttribute(horizontal ? 'x' : 'y',
|
||||
position * Minimap.minimap.scale / Minimap.workspace.scale);
|
||||
}
|
||||
};
|
||||
@@ -1,53 +0,0 @@
|
||||
# Blockly on Mobile Devices
|
||||
|
||||
This directory contains three examples of running the Blockly library on mobile
|
||||
devices. The `html/` directory is a example of configuring a webpage for touch
|
||||
devices, with a Blockly workspace that fills the screen.
|
||||
|
||||
The `mobile/html/` is also the basis for the Android and iOS demos. Each native
|
||||
app copies this demo into the app's local resources, and required Blockly
|
||||
library files, and hosts them in an embedded WebView.
|
||||
|
||||
Thus, developers can quickly iterate within the `mobile/html/` directory, and
|
||||
see changes in both the Android and iOS native apps.
|
||||
|
||||
## Running the Mobile HTML Demo
|
||||
|
||||
Before running the mobile HTML demo, you need to create some symbolic links
|
||||
in your local file system. Run the `mobile/html/ln_resources.sh` file from
|
||||
the `mobile/html/` directory. This mimics the relative locations of the
|
||||
Blockly files seen when loading the page in a native app's embedded WebView.
|
||||
|
||||
After doing this, opening `mobile/html/index.html` should open normally,
|
||||
filling the page with one large Blockly workspace.
|
||||
|
||||
## The Android App
|
||||
|
||||
### Build and Run
|
||||
|
||||
Open the `demos/mobile/android/` directory in Android Studio. The project
|
||||
files in the directory should be ready to build and run the demo in an emulator
|
||||
or connected device.
|
||||
|
||||
### Android Copy Tasks
|
||||
|
||||
If you edit the `mobile/html/` demo to include new files, you will need to
|
||||
update the native app project files to also copy those files.
|
||||
|
||||
In the Android project, two Gradle tasks are responsible for the copies.
|
||||
In `mobile/android/app/build.gradle`, the tasks `copyBlocklyHtmlFile` and
|
||||
`copyBlocklyMoreFiles` configure the copy actions.
|
||||
|
||||
## The iOS App
|
||||
|
||||
### Build and Run
|
||||
|
||||
Open the `demos/mobile/iOS/` directory in XCode. The project files in the
|
||||
directory should be ready to build and run the demo in a simulator or connected
|
||||
device.
|
||||
|
||||
### iOS Copy Script
|
||||
|
||||
The XCode project call out to `mobile/ios/cp_resources.sh` to copy the required
|
||||
HTML and related files. If you've edited the `mobile/html/` demo to require new
|
||||
files, update this script to copy these files, too.
|
||||
27
demos/mobile/android/.gitignore
vendored
@@ -1,27 +0,0 @@
|
||||
/build
|
||||
/captures
|
||||
/app/src/main/assets/blockly
|
||||
.settings
|
||||
.project
|
||||
|
||||
# Local Settings
|
||||
local.properties
|
||||
|
||||
# Project files
|
||||
*.komodoproject
|
||||
.gradle
|
||||
*.iml
|
||||
.idea
|
||||
|
||||
# Build files
|
||||
*.pyc
|
||||
*.apk
|
||||
*.ap_
|
||||
*.class
|
||||
*.dex
|
||||
|
||||
# OSX Files
|
||||
.DS_Store
|
||||
|
||||
# Windows Files
|
||||
Thumb.db
|
||||
@@ -1,45 +0,0 @@
|
||||
# Blockly in an Android WebView
|
||||
|
||||
This code demonstrates how to get Blockly running in an Android app by
|
||||
embedding it in a WebView.
|
||||
|
||||
### BlocklyWebViewFragment
|
||||
|
||||
Most of the work is done within the fragment class `BlocklyWebViewFragment`.
|
||||
This fragment instantiates the WebView, loads the HTML
|
||||
(`assets/blockly/webview.html`, copied from `demos/mobile/html/index.html`),
|
||||
and provides a few helper methods.
|
||||
|
||||
### Copying web assets with gradle
|
||||
|
||||
This android project copies the necessary files from the main Blockly
|
||||
repository (i.e., parent directory). In `app/build.gradle`, note the
|
||||
`copyBlocklyHtmlFile` and `copyBlocklyMoreFiles` tasks.
|
||||
|
||||
In your own project, the HTML and related files can be placed directly in the
|
||||
`assets/blockly` directory without the copy step. However, using the copy tasks
|
||||
simplifies the synchronization with an iOS app using the same files.
|
||||
|
||||
### Loading Block Definitions and Generator functions
|
||||
|
||||
The `webview.html` loads the block definitions and generator functions directly
|
||||
into the page, without support or coordination with the Android classes. This
|
||||
assumes the app will always utilize the same blocks. This does not mean all
|
||||
blocks are visible to the user all the time; that is controlled by the toolbox
|
||||
and workspace files. This should accommodate almost all applications.
|
||||
|
||||
This does mean loading your own block definitions and generators will involve
|
||||
editing the HTML, adding you own `<script>` tag, and possibly removing
|
||||
the `blocks_compressed.js` if you do not use any standard blocks.
|
||||
|
||||
### Connecting a Developer Console
|
||||
|
||||
While the console output of the WebView will be visible in the Android log
|
||||
(i.e., `logcat`), some times a more intrusive approach is required to isolate
|
||||
a problem. For instructions on connecting the WebView to Chrome's Developer
|
||||
Tools, see this article:
|
||||
|
||||
https://developers.google.com/web/tools/chrome-devtools/remote-debugging/
|
||||
|
||||
The WebView must be visible in the connect device or emulator before the
|
||||
WebView will included in the list of available pages to connect to.
|
||||
7
demos/mobile/android/app/.gitignore
vendored
@@ -1,7 +0,0 @@
|
||||
/build
|
||||
|
||||
# Files copied during build:
|
||||
src/main/assets/blockly/blockly_compressed.js
|
||||
src/main/assets/blockly/blocks_compressed.js
|
||||
src/main/assets/blockly/media
|
||||
src/main/assets/blockly/webview.html
|
||||
@@ -1,64 +0,0 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 27
|
||||
defaultConfig {
|
||||
applicationId 'com.google.blockly.android.webview.demo'
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 27
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
productFlavors {
|
||||
}
|
||||
}
|
||||
|
||||
task copyBlocklyHtmlFile(type: Copy) {
|
||||
from('../../html') {
|
||||
include 'index.html', 'toolbox_standard.js'
|
||||
}
|
||||
into project(':app').file('./src/main/assets/blockly')
|
||||
rename('index.html', 'webview.html')
|
||||
}
|
||||
|
||||
task copyBlocklyDistFiles(type: Copy) {
|
||||
from('../../../../dist') {
|
||||
include 'blockly_compressed.js', 'blocks_compressed.js'
|
||||
}
|
||||
into project(':app').file('./src/main/assets/blockly')
|
||||
}
|
||||
|
||||
task copyBlocklyBuildFiles(type: Copy) {
|
||||
from('../../../../build') {
|
||||
include 'msg/**'
|
||||
}
|
||||
into project(':app').file('./src/main/assets/blockly')
|
||||
}
|
||||
|
||||
task copyBlocklyMediaFiles(type: Copy) {
|
||||
from('../../../..') {
|
||||
include 'media/**'
|
||||
exclude 'media/test_*'
|
||||
}
|
||||
into project(':app').file('./src/main/assets/blockly')
|
||||
}
|
||||
|
||||
project.afterEvaluate {
|
||||
preBuild.dependsOn(copyBlocklyHtmlFile, copyBlocklyBuildFiles, copyBlocklyDistFiles, copyBlocklyMediaFiles)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'com.android.support:appcompat-v7:27.1.1'
|
||||
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||
}
|
||||
21
demos/mobile/android/app/proguard-rules.pro
vendored
@@ -1,21 +0,0 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.example.blocklywebview;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.test.InstrumentationRegistry;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
||||
|
||||
assertEquals("com.example.blocklywebview", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.example.blocklywebview">
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity android:name="com.google.blockly.android.webview.demo.MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.google.blockly.android.webview;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
|
||||
/**
|
||||
* This fragments contains and manages the web view that hosts Blockly.
|
||||
*/
|
||||
public class BlocklyWebViewFragment extends Fragment {
|
||||
protected @Nullable WebView mWebView = null;
|
||||
|
||||
@SuppressLint("SetJavaScriptEnabled")
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
|
||||
@Nullable Bundle savedInstanceState) {
|
||||
mWebView = new WebView(inflater.getContext());
|
||||
mWebView.setWebChromeClient(new WebChromeClient());
|
||||
WebSettings webSettings = mWebView.getSettings();
|
||||
webSettings.setJavaScriptEnabled(true);
|
||||
mWebView.loadUrl("file:///android_asset/blockly/webview.html");
|
||||
return mWebView;
|
||||
}
|
||||
|
||||
// TODO: Method to invoke code generation
|
||||
// TODO: Method to load workspace from string (or InputStream?)
|
||||
// TODO: Method to serialize workspace to string (or OutputStream?)
|
||||
// TODO: Clear / reset workspace
|
||||
// TODO: Load toolbox
|
||||
// TODO: Listener for event JSON
|
||||
// TODO: Method to evaluate JavaScript string in the WebView
|
||||
}
|
||||
@@ -1,150 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.google.blockly.android.webview;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Message;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.webkit.JsPromptResult;
|
||||
import android.webkit.JsResult;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.example.blocklywebview.R;
|
||||
|
||||
/**
|
||||
* Helper class to create JavaScript dialogs.
|
||||
* Adapted from android-9.0.0_r10/core/java/android/webkit/JsDialogHelper.java.
|
||||
* Removes dialog title (page domain) and uses a larger prompt message area than original.
|
||||
*/
|
||||
public class JsDialogHelper {
|
||||
private static final String TAG = "JsDialogHelper";
|
||||
// Dialog types
|
||||
/** An alert dialog, for console.alert(..). */
|
||||
public static final int ALERT = 1;
|
||||
/** An alert dialog, for console.confirm(..). */
|
||||
public static final int CONFIRM = 2;
|
||||
/** An alert dialog, for console.prompt(..). */
|
||||
public static final int PROMPT = 3;
|
||||
|
||||
private final @Nullable String mDefaultValue;
|
||||
private final JsResult mResult;
|
||||
private final String mMessage;
|
||||
private final int mType;
|
||||
private final String mUrl;
|
||||
|
||||
public JsDialogHelper(JsResult result, int type, @Nullable String defaultValue,
|
||||
String message, String url) {
|
||||
if (type == PROMPT && !(result instanceof JsPromptResult)) {
|
||||
throw new IllegalArgumentException("JsDialogHelper PROMPT requires JsPromptResult");
|
||||
}
|
||||
mResult = result;
|
||||
mDefaultValue = defaultValue;
|
||||
mMessage = message;
|
||||
mType = type;
|
||||
mUrl = url;
|
||||
}
|
||||
|
||||
public JsDialogHelper(JsResult result, Message msg) {
|
||||
mResult = result;
|
||||
mDefaultValue = msg.getData().getString("default");
|
||||
mMessage = msg.getData().getString("message");
|
||||
mType = msg.getData().getInt("type");
|
||||
mUrl = msg.getData().getString("url");
|
||||
}
|
||||
|
||||
public boolean invokeCallback(WebChromeClient client, WebView webView) {
|
||||
switch (mType) {
|
||||
case ALERT:
|
||||
return client.onJsAlert(webView, mUrl, mMessage, mResult);
|
||||
case CONFIRM:
|
||||
return client.onJsConfirm(webView, mUrl, mMessage, mResult);
|
||||
case PROMPT:
|
||||
return client.onJsPrompt(webView, mUrl, mMessage, mDefaultValue, (JsPromptResult) mResult);
|
||||
default:
|
||||
throw new IllegalArgumentException("Unexpected type: " + mType);
|
||||
}
|
||||
}
|
||||
|
||||
public void showDialog(Context context) {
|
||||
if (!canShowAlertDialog(context)) {
|
||||
Log.w(TAG, "Cannot create a dialog, the WebView context is not an Activity");
|
||||
mResult.cancel();
|
||||
return;
|
||||
}
|
||||
final EditText edit;
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setOnCancelListener(new CancelListener());
|
||||
if (mType != PROMPT) {
|
||||
edit = null;
|
||||
builder.setMessage(mMessage);
|
||||
builder.setPositiveButton(android.R.string.ok, new PositiveListener(null));
|
||||
} else {
|
||||
final View view = LayoutInflater.from(context).inflate(R.layout.js_prompt, null);
|
||||
edit = view.findViewById(R.id.js_prompt_value);
|
||||
edit.setText(mDefaultValue);
|
||||
builder.setPositiveButton(android.R.string.ok, new PositiveListener(edit));
|
||||
((TextView) view.findViewById(R.id.js_prompt_message)).setText(mMessage);
|
||||
builder.setView(view);
|
||||
|
||||
// TODO: Open keyboard and place text cursor.
|
||||
}
|
||||
if (mType != ALERT) {
|
||||
builder.setNegativeButton(android.R.string.cancel, new CancelListener());
|
||||
}
|
||||
final AlertDialog dialog = builder.show();
|
||||
}
|
||||
|
||||
private class CancelListener implements DialogInterface.OnCancelListener,
|
||||
DialogInterface.OnClickListener {
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
mResult.cancel();
|
||||
}
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
mResult.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
private class PositiveListener implements DialogInterface.OnClickListener {
|
||||
private final EditText mEdit;
|
||||
public PositiveListener(EditText edit) {
|
||||
mEdit = edit;
|
||||
}
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
if (mEdit == null) {
|
||||
mResult.confirm();
|
||||
} else {
|
||||
((JsPromptResult) mResult).confirm(mEdit.getText().toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean canShowAlertDialog(Context context) {
|
||||
return context instanceof Activity;
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.google.blockly.android.webview;
|
||||
|
||||
import android.webkit.JsPromptResult;
|
||||
import android.webkit.JsResult;
|
||||
import android.webkit.WebView;
|
||||
|
||||
/**
|
||||
* Provides native hooks for JavaScript console dialog functions.
|
||||
*/
|
||||
public class WebChromeClient extends android.webkit.WebChromeClient {
|
||||
@Override
|
||||
public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
|
||||
new JsDialogHelper(result, JsDialogHelper.ALERT, null, message, url)
|
||||
.showDialog(view.getContext());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onJsConfirm(WebView view, String url, String message, JsResult result) {
|
||||
new JsDialogHelper(result, JsDialogHelper.CONFIRM, null, message, url)
|
||||
.showDialog(view.getContext());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onJsPrompt(WebView view, String url, String message, String defaultValue,
|
||||
JsPromptResult result) {
|
||||
new JsDialogHelper(result, JsDialogHelper.PROMPT, defaultValue, message, url)
|
||||
.showDialog(view.getContext());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.google.blockly.android.webview.demo;
|
||||
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.example.blocklywebview.R;
|
||||
|
||||
/**
|
||||
* The primary activity of the demo application. The activity embeds the
|
||||
* {@link com.google.blockly.android.webview.BlocklyWebViewFragment}.
|
||||
*/
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108">
|
||||
<path
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
|
||||
android:strokeColor="#00000000"
|
||||
android:strokeWidth="1">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="78.5885"
|
||||
android:endY="90.9159"
|
||||
android:startX="48.7653"
|
||||
android:startY="61.0927"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0"/>
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0"/>
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
|
||||
android:strokeColor="#00000000"
|
||||
android:strokeWidth="1"/>
|
||||
</vector>
|
||||
@@ -1,74 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108">
|
||||
<path android:fillColor="#26A69A"
|
||||
android:pathData="M0,0h108v108h-108z"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
</vector>
|
||||
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.constraint.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="com.google.blockly.android.webview.demo.MainActivity">
|
||||
|
||||
<fragment
|
||||
android:id="@+id/blockly_webview"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:name="com.google.blockly.android.webview.BlocklyWebViewFragment"
|
||||
/>
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
@@ -1,37 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2008 The Android Open Source Project
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
>
|
||||
<TextView android:id="@+id/js_prompt_message"
|
||||
style="?android:attr/textAppearanceMedium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="5dip"
|
||||
/>
|
||||
<EditText android:id="@+id/js_prompt_value"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:inputType="text"
|
||||
android:selectAllOnFocus="true"
|
||||
android:scrollHorizontally="true"
|
||||
android:layout_marginTop="6dip"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#3F51B5</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
</resources>
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<!-- Title for a JavaScript dialog. "The page at <url of current page> says:" -->
|
||||
<string name="js_dialog_title">The page at \"<xliff:g id="title">%s</xliff:g>\" says:</string>
|
||||
<!-- Default title for a javascript dialog -->
|
||||
<string name="js_dialog_title_default">JavaScript</string>
|
||||
</resources>
|
||||
@@ -1,3 +0,0 @@
|
||||
<resources>
|
||||
<string name="app_name">Blockly WebView</string>
|
||||
</resources>
|
||||
@@ -1,11 +0,0 @@
|
||||
<resources>
|
||||
|
||||
<!-- Base application theme. -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.example.blocklywebview;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.2.0'
|
||||
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
# Project-wide Gradle settings.
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
# For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx1536m
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
@@ -1,6 +0,0 @@
|
||||
#Thu Oct 04 16:59:44 PDT 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
|
||||
172
demos/mobile/android/gradlew
vendored
@@ -1,172 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
84
demos/mobile/android/gradlew.bat
vendored
@@ -1,84 +0,0 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -1 +0,0 @@
|
||||
include ':app'
|
||||
4
demos/mobile/html/.gitignore
vendored
@@ -1,4 +0,0 @@
|
||||
/blockly_compressed.js
|
||||
/blocks_compressed.js
|
||||
/media
|
||||
/msg
|
||||
@@ -1,31 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<!-- HTML file to host Blockly in a mobile WebView. -->
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<style type="text/css">
|
||||
html, body, #blocklyDiv {
|
||||
border: 0;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<script src="blockly_compressed.js"></script>
|
||||
<script src="blocks_compressed.js"></script>
|
||||
<!-- TODO: Select msg file based on locale. -->
|
||||
<script src="msg/en.js"></script>
|
||||
<script src="toolbox_standard.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="blocklyDiv"></div>
|
||||
<script type="text/javascript">
|
||||
var workspacePlayground = Blockly.inject('blocklyDiv', {
|
||||
media: 'media/',
|
||||
toolbox: BLOCKLY_TOOLBOX_XML['standard'],
|
||||
zoom: {controls: true}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
#
|
||||
# Create symbolic links in this directory for the
|
||||
# Blockly library files used by this demo's index.html.
|
||||
|
||||
if [[ ! -e ../../../dist/blockly_compressed.js ]]; then
|
||||
echo "ERROR: Could not locate blockly_compressed.js. Run from demos/mobile/html/" 1>&2
|
||||
exit 1 # terminate and indicate error
|
||||
fi
|
||||
|
||||
if [ ! -L blockly_compressed.js ]; then
|
||||
ln -s ../../../dist/blockly_compressed.js blockly_compressed.js
|
||||
fi
|
||||
if [ ! -L blocks_compressed.js ]; then
|
||||
ln -s ../../../dist/blocks_compressed.js blocks_compressed.js
|
||||
fi
|
||||
if [ ! -L media ]; then
|
||||
ln -s ../../../media media
|
||||
fi
|
||||
if [ ! -L msg ]; then
|
||||
ln -s ../../../build/msg msg
|
||||
fi
|
||||
@@ -1,333 +0,0 @@
|
||||
|
||||
var BLOCKLY_TOOLBOX_XML = BLOCKLY_TOOLBOX_XML || Object.create(null);
|
||||
|
||||
/* BEGINNING BLOCKLY_TOOLBOX_XML ASSIGNMENT. DO NOT EDIT. USE BLOCKLY DEVTOOLS. */
|
||||
BLOCKLY_TOOLBOX_XML['standard'] =
|
||||
// From XML string/file, replace ^\s?(\s*)?(<.*>)$ with \+$1'$2'
|
||||
// Tweak first and last line.
|
||||
'<xml xmlns="https://developers.google.com/blockly/xml">'
|
||||
+ '<category name="Logic" colour="%{BKY_LOGIC_HUE}">'
|
||||
+ '<block type="controls_if"></block>'
|
||||
+ '<block type="logic_compare"></block>'
|
||||
+ '<block type="logic_operation"></block>'
|
||||
+ '<block type="logic_negate"></block>'
|
||||
+ '<block type="logic_boolean"></block>'
|
||||
+ '<block type="logic_null" disabled="true"></block>'
|
||||
+ '<block type="logic_ternary"></block>'
|
||||
+ '</category>'
|
||||
+ '<category name="Loops" colour="%{BKY_LOOPS_HUE}">'
|
||||
+ '<block type="controls_repeat_ext">'
|
||||
+ '<value name="TIMES">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">10</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="controls_repeat" disabled="true"></block>'
|
||||
+ '<block type="controls_whileUntil"></block>'
|
||||
+ '<block type="controls_for">'
|
||||
+ '<value name="FROM">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">1</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '<value name="TO">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">10</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '<value name="BY">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">1</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="controls_forEach"></block>'
|
||||
+ '<block type="controls_flow_statements"></block>'
|
||||
+ '</category>'
|
||||
+ '<category name="Math" colour="%{BKY_MATH_HUE}">'
|
||||
+ '<block type="math_number" gap="32">'
|
||||
+ '<field name="NUM">123</field>'
|
||||
+ '</block>'
|
||||
+ '<block type="math_arithmetic">'
|
||||
+ '<value name="A">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">1</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '<value name="B">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">1</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="math_single">'
|
||||
+ '<value name="NUM">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">9</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="math_trig">'
|
||||
+ '<value name="NUM">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">45</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="math_constant"></block>'
|
||||
+ '<block type="math_number_property">'
|
||||
+ '<value name="NUMBER_TO_CHECK">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">0</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="math_round">'
|
||||
+ '<value name="NUM">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">3.1</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="math_on_list"></block>'
|
||||
+ '<block type="math_modulo">'
|
||||
+ '<value name="DIVIDEND">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">64</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '<value name="DIVISOR">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">10</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="math_constrain">'
|
||||
+ '<value name="VALUE">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">50</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '<value name="LOW">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">1</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '<value name="HIGH">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">100</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="math_random_int">'
|
||||
+ '<value name="FROM">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">1</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '<value name="TO">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">100</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="math_random_float"></block>'
|
||||
+ '</category>'
|
||||
+ '<category name="Text" colour="%{BKY_TEXTS_HUE}">'
|
||||
+ '<block type="text"></block>'
|
||||
+ '<block type="text_join"></block>'
|
||||
+ '<block type="text_append">'
|
||||
+ '<value name="TEXT">'
|
||||
+ '<shadow type="text"></shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="text_length">'
|
||||
+ '<value name="VALUE">'
|
||||
+ '<shadow type="text">'
|
||||
+ '<field name="TEXT">abc</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="text_isEmpty">'
|
||||
+ '<value name="VALUE">'
|
||||
+ '<shadow type="text">'
|
||||
+ '<field name="TEXT"></field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="text_indexOf">'
|
||||
+ '<value name="VALUE">'
|
||||
+ '<block type="variables_get">'
|
||||
+ '<field name="VAR">text</field>'
|
||||
+ '</block>'
|
||||
+ '</value>'
|
||||
+ '<value name="FIND">'
|
||||
+ '<shadow type="text">'
|
||||
+ '<field name="TEXT">abc</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="text_charAt">'
|
||||
+ '<value name="VALUE">'
|
||||
+ '<block type="variables_get">'
|
||||
+ '<field name="VAR">text</field>'
|
||||
+ '</block>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="text_getSubstring">'
|
||||
+ '<value name="STRING">'
|
||||
+ '<block type="variables_get">'
|
||||
+ '<field name="VAR">text</field>'
|
||||
+ '</block>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="text_changeCase">'
|
||||
+ '<value name="TEXT">'
|
||||
+ '<shadow type="text">'
|
||||
+ '<field name="TEXT">abc</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="text_trim">'
|
||||
+ '<value name="TEXT">'
|
||||
+ '<shadow type="text">'
|
||||
+ '<field name="TEXT">abc</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="text_count">'
|
||||
+ '<value name="SUB">'
|
||||
+ '<shadow type="text"></shadow>'
|
||||
+ '</value>'
|
||||
+ '<value name="TEXT">'
|
||||
+ '<shadow type="text"></shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="text_replace">'
|
||||
+ '<value name="FROM">'
|
||||
+ '<shadow type="text"></shadow>'
|
||||
+ '</value>'
|
||||
+ '<value name="TO">'
|
||||
+ '<shadow type="text"></shadow>'
|
||||
+ '</value>'
|
||||
+ '<value name="TEXT">'
|
||||
+ '<shadow type="text"></shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="text_reverse">'
|
||||
+ '<value name="TEXT">'
|
||||
+ '<shadow type="text"></shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<label text="Input/Output:" web-class="ioLabel"></label>'
|
||||
+ '<block type="text_print">'
|
||||
+ '<value name="TEXT">'
|
||||
+ '<shadow type="text">'
|
||||
+ '<field name="TEXT">abc</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="text_prompt_ext">'
|
||||
+ '<value name="TEXT">'
|
||||
+ '<shadow type="text">'
|
||||
+ '<field name="TEXT">abc</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '</category>'
|
||||
+ '<category name="Lists" colour="%{BKY_LISTS_HUE}">'
|
||||
+ '<block type="lists_create_with">'
|
||||
+ '<mutation items="0"></mutation>'
|
||||
+ '</block>'
|
||||
+ '<block type="lists_create_with"></block>'
|
||||
+ '<block type="lists_repeat">'
|
||||
+ '<value name="NUM">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">5</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="lists_length"></block>'
|
||||
+ '<block type="lists_isEmpty"></block>'
|
||||
+ '<block type="lists_indexOf">'
|
||||
+ '<value name="VALUE">'
|
||||
+ '<block type="variables_get">'
|
||||
+ '<field name="VAR">list</field>'
|
||||
+ '</block>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="lists_getIndex">'
|
||||
+ '<value name="VALUE">'
|
||||
+ '<block type="variables_get">'
|
||||
+ '<field name="VAR">list</field>'
|
||||
+ '</block>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="lists_setIndex">'
|
||||
+ '<value name="LIST">'
|
||||
+ '<block type="variables_get">'
|
||||
+ '<field name="VAR">list</field>'
|
||||
+ '</block>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="lists_getSublist">'
|
||||
+ '<value name="LIST">'
|
||||
+ '<block type="variables_get">'
|
||||
+ '<field name="VAR">list</field>'
|
||||
+ '</block>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="lists_split">'
|
||||
+ '<value name="DELIM">'
|
||||
+ '<shadow type="text">'
|
||||
+ '<field name="TEXT">,</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="lists_sort"></block>'
|
||||
+ '<block type="lists_reverse"></block>'
|
||||
+ '</category>'
|
||||
+ '<category name="Colour" colour="%{BKY_COLOUR_HUE}">'
|
||||
+ '<block type="colour_picker"></block>'
|
||||
+ '<block type="colour_random"></block>'
|
||||
+ '<block type="colour_rgb">'
|
||||
+ '<value name="RED">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">100</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '<value name="GREEN">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">50</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '<value name="BLUE">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">0</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '<block type="colour_blend">'
|
||||
+ '<value name="COLOUR1">'
|
||||
+ '<shadow type="colour_picker">'
|
||||
+ '<field name="COLOUR">#ff0000</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '<value name="COLOUR2">'
|
||||
+ '<shadow type="colour_picker">'
|
||||
+ '<field name="COLOUR">#3333ff</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '<value name="RATIO">'
|
||||
+ '<shadow type="math_number">'
|
||||
+ '<field name="NUM">0.5</field>'
|
||||
+ '</shadow>'
|
||||
+ '</value>'
|
||||
+ '</block>'
|
||||
+ '</category>'
|
||||
+ '<sep></sep>'
|
||||
+ '<category name="Variables" colour="%{BKY_VARIABLES_HUE}" custom="VARIABLE"></category>'
|
||||
+ '<category name="Functions" colour="%{BKY_PROCEDURES_HUE}" custom="PROCEDURE"></category>'
|
||||
+ '</xml>';
|
||||
/* END BLOCKLY_TOOLBOX_XML ASSIGNMENT. DO NOT EDIT. */
|
||||
25
demos/mobile/ios/.gitignore
vendored
@@ -1,25 +0,0 @@
|
||||
# Files copied by cp_resources.sh
|
||||
/Resources/Non-Localized/Blockly
|
||||
|
||||
|
||||
# Xcode.gitignore
|
||||
|
||||
## User settings
|
||||
xcuserdata/
|
||||
|
||||
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
|
||||
*.xcscmblueprint
|
||||
*.xccheckout
|
||||
|
||||
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
|
||||
build/
|
||||
DerivedData/
|
||||
*.moved-aside
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
@@ -1,390 +0,0 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 50;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
AB036C55211B89D600CCC9D8 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB036C54211B89D600CCC9D8 /* WebKit.framework */; };
|
||||
AB980111211A37B50025AFF2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB980110211A37B50025AFF2 /* AppDelegate.swift */; };
|
||||
AB980113211A37B50025AFF2 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB980112211A37B50025AFF2 /* ViewController.swift */; };
|
||||
AB980116211A37B50025AFF2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AB980114211A37B50025AFF2 /* Main.storyboard */; };
|
||||
AB980118211A37B70025AFF2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AB980117211A37B70025AFF2 /* Assets.xcassets */; };
|
||||
AB98011B211A37B70025AFF2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AB980119211A37B70025AFF2 /* LaunchScreen.storyboard */; };
|
||||
ABA1B7FC212214E7000D3CC5 /* Blockly in Resources */ = {isa = PBXBuildFile; fileRef = ABA1B7FB212214E7000D3CC5 /* Blockly */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
AB036C54211B89D600CCC9D8 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
|
||||
AB98010D211A37B50025AFF2 /* Blockly WebView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Blockly WebView.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
AB980110211A37B50025AFF2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
AB980112211A37B50025AFF2 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||
AB980115211A37B50025AFF2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
AB980117211A37B70025AFF2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
AB98011A211A37B70025AFF2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
AB98011C211A37B70025AFF2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
ABA1B7FB212214E7000D3CC5 /* Blockly */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Blockly; path = "Resources/Non-Localized/Blockly"; sourceTree = SOURCE_ROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
AB98010A211A37B50025AFF2 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
AB036C55211B89D600CCC9D8 /* WebKit.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
AB036C53211B89D500CCC9D8 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AB036C54211B89D600CCC9D8 /* WebKit.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AB980104211A37B50025AFF2 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AB98010F211A37B50025AFF2 /* Blockly WebView */,
|
||||
AB98010E211A37B50025AFF2 /* Products */,
|
||||
AB036C53211B89D500CCC9D8 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AB98010E211A37B50025AFF2 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
AB98010D211A37B50025AFF2 /* Blockly WebView.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AB98010F211A37B50025AFF2 /* Blockly WebView */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
ABA1B7F9212214B9000D3CC5 /* Resources */,
|
||||
AB980110211A37B50025AFF2 /* AppDelegate.swift */,
|
||||
AB980112211A37B50025AFF2 /* ViewController.swift */,
|
||||
AB980114211A37B50025AFF2 /* Main.storyboard */,
|
||||
AB980117211A37B70025AFF2 /* Assets.xcassets */,
|
||||
AB980119211A37B70025AFF2 /* LaunchScreen.storyboard */,
|
||||
AB98011C211A37B70025AFF2 /* Info.plist */,
|
||||
);
|
||||
path = "Blockly WebView";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
ABA1B7F9212214B9000D3CC5 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
ABA1B7FA212214C6000D3CC5 /* Non-Localized */,
|
||||
);
|
||||
path = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
ABA1B7FA212214C6000D3CC5 /* Non-Localized */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
ABA1B7FB212214E7000D3CC5 /* Blockly */,
|
||||
);
|
||||
path = "Non-Localized";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
AB98010C211A37B50025AFF2 /* Blockly WebView */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = AB98011F211A37B70025AFF2 /* Build configuration list for PBXNativeTarget "Blockly WebView" */;
|
||||
buildPhases = (
|
||||
AB980109211A37B50025AFF2 /* Sources */,
|
||||
AB98010A211A37B50025AFF2 /* Frameworks */,
|
||||
ABEDABD1212372E700A66667 /* ShellScript */,
|
||||
AB98010B211A37B50025AFF2 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "Blockly WebView";
|
||||
productName = "Blockly WebView";
|
||||
productReference = AB98010D211A37B50025AFF2 /* Blockly WebView.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
AB980105211A37B50025AFF2 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0940;
|
||||
LastUpgradeCheck = 0940;
|
||||
ORGANIZATIONNAME = Google;
|
||||
TargetAttributes = {
|
||||
AB98010C211A37B50025AFF2 = {
|
||||
CreatedOnToolsVersion = 9.4.1;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = AB980108211A37B50025AFF2 /* Build configuration list for PBXProject "Blockly WebView" */;
|
||||
compatibilityVersion = "Xcode 9.3";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = AB980104211A37B50025AFF2;
|
||||
productRefGroup = AB98010E211A37B50025AFF2 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
AB98010C211A37B50025AFF2 /* Blockly WebView */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
AB98010B211A37B50025AFF2 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
AB98011B211A37B70025AFF2 /* LaunchScreen.storyboard in Resources */,
|
||||
AB980118211A37B70025AFF2 /* Assets.xcassets in Resources */,
|
||||
AB980116211A37B50025AFF2 /* Main.storyboard in Resources */,
|
||||
ABA1B7FC212214E7000D3CC5 /* Blockly in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
ABEDABD1212372E700A66667 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = ./cp_resources.sh;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
AB980109211A37B50025AFF2 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
AB980113211A37B50025AFF2 /* ViewController.swift in Sources */,
|
||||
AB980111211A37B50025AFF2 /* AppDelegate.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
AB980114211A37B50025AFF2 /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
AB980115211A37B50025AFF2 /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
AB980119211A37B70025AFF2 /* LaunchScreen.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
AB98011A211A37B70025AFF2 /* Base */,
|
||||
);
|
||||
name = LaunchScreen.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
AB98011D211A37B70025AFF2 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
AB98011E211A37B70025AFF2 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = iphoneos;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
AB980120211A37B70025AFF2 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 3KZF7Q7Q49;
|
||||
INFOPLIST_FILE = "Blockly WebView/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.google.kidscoding.Blockly-WebView";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 4.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
AB980121211A37B70025AFF2 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 3KZF7Q7Q49;
|
||||
INFOPLIST_FILE = "Blockly WebView/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.google.kidscoding.Blockly-WebView";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 4.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
AB980108211A37B50025AFF2 /* Build configuration list for PBXProject "Blockly WebView" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
AB98011D211A37B70025AFF2 /* Debug */,
|
||||
AB98011E211A37B70025AFF2 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
AB98011F211A37B70025AFF2 /* Build configuration list for PBXNativeTarget "Blockly WebView" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
AB980120211A37B70025AFF2 /* Debug */,
|
||||
AB980121211A37B70025AFF2 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = AB980105211A37B50025AFF2 /* Project object */;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:Blockly WebView.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>Blockly WebView.xcscheme</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
<key>Blockly WebView.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,46 +0,0 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// Blockly WebView
|
||||
//
|
||||
// Created by Andrew Marshall on 8/7/18.
|
||||
// Copyright © 2018 Google. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
return true
|
||||
}
|
||||
|
||||
func applicationWillResignActive(_ application: UIApplication) {
|
||||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
|
||||
}
|
||||
|
||||
func applicationDidEnterBackground(_ application: UIApplication) {
|
||||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||
}
|
||||
|
||||
func applicationWillEnterForeground(_ application: UIApplication) {
|
||||
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
|
||||
}
|
||||
|
||||
func applicationDidBecomeActive(_ application: UIApplication) {
|
||||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ application: UIApplication) {
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "40x40",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "40x40",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "76x76",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ipad",
|
||||
"size" : "83.5x83.5",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "ios-marketing",
|
||||
"size" : "1024x1024",
|
||||
"scale" : "1x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" systemVersion="17A277" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
@@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
|
||||
<device id="retina4_7" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="Blockly_WebView" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<wkWebView multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="HmE-ZW-QKv">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.36078431370000003" green="0.38823529410000002" blue="0.4039215686" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<wkWebViewConfiguration key="configuration" allowsAirPlayForMediaPlayback="NO">
|
||||
<dataDetectorTypes key="dataDetectorTypes"/>
|
||||
<audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
|
||||
<wkPreferences key="preferences"/>
|
||||
</wkWebViewConfiguration>
|
||||
</wkWebView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="webView" destination="HmE-ZW-QKv" id="OGc-PV-TAB"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-10" y="51"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
@@ -1,45 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,110 +0,0 @@
|
||||
// ViewController.swift
|
||||
// Blockly WebView UI controller.
|
||||
//
|
||||
// Created by Andrew Marshall on 8/7/18.
|
||||
// Copyright © 2018 Google. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import WebKit
|
||||
|
||||
|
||||
/// A basic ViewController for a WebView.
|
||||
/// It handles the initial page load, and functions like window.prompt().
|
||||
class ViewController: UIViewController, WKUIDelegate {
|
||||
/// The name used to reference this iOS object when executing callbacks from the JS code.
|
||||
/// If this value is changed, it should also be changed in the `CODE_GENERATOR_BRIDGE_JS` file.
|
||||
fileprivate static let HOST_HTML = "Blockly/webview.html"
|
||||
|
||||
@IBOutlet weak var webView: WKWebView!
|
||||
|
||||
/// Additional setup after loading the UI NIB.
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
webView.uiDelegate = self
|
||||
// Do any additional setup after loading the view, typically from a nib.
|
||||
loadWebContent()
|
||||
}
|
||||
|
||||
/// Load the root HTML page into the webview.
|
||||
func loadWebContent() {
|
||||
if let htmlUrl = Bundle.main.url(forResource: "webview", withExtension: "html",
|
||||
subdirectory: "Blockly") {
|
||||
webView.load(URLRequest.init(url: htmlUrl))
|
||||
} else {
|
||||
NSLog("Failed to load HTML. Could not find resource.")
|
||||
}
|
||||
}
|
||||
|
||||
/// Handle window.alert() with a native dialog.
|
||||
func webView(_ webView: WKWebView,
|
||||
runJavaScriptAlertPanelWithMessage message: String,
|
||||
initiatedByFrame frame: WKFrameInfo,
|
||||
completionHandler: @escaping () -> Void) {
|
||||
|
||||
let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert)
|
||||
let title = NSLocalizedString("OK", comment: "OK Button")
|
||||
let ok = UIAlertAction(title: title, style: .default) { (action: UIAlertAction) -> Void in
|
||||
alert.dismiss(animated: true, completion: nil)
|
||||
}
|
||||
alert.addAction(ok)
|
||||
present(alert, animated: true)
|
||||
completionHandler()
|
||||
}
|
||||
|
||||
/// Handle window.confirm() with a native dialog.
|
||||
func webView(_ webView: WKWebView,
|
||||
runJavaScriptConfirmPanelWithMessage message: String,
|
||||
initiatedByFrame frame: WKFrameInfo,
|
||||
completionHandler: @escaping (Bool) -> Void) {
|
||||
|
||||
let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert)
|
||||
let closeAndHandle = { (okayed: Bool) in
|
||||
alert.dismiss(animated: true, completion: nil)
|
||||
completionHandler(okayed)
|
||||
}
|
||||
|
||||
let okTitle = NSLocalizedString("OK", comment: "OK button title")
|
||||
let ok = UIAlertAction(title: okTitle, style: .default) { (action: UIAlertAction) -> Void in
|
||||
closeAndHandle(true)
|
||||
}
|
||||
alert.addAction(ok)
|
||||
|
||||
let cancelTitle = NSLocalizedString("Cancel", comment: "Cancel button title")
|
||||
let cancel = UIAlertAction(title: cancelTitle, style: .default) {
|
||||
(action: UIAlertAction) -> Void in
|
||||
closeAndHandle(false)
|
||||
}
|
||||
alert.addAction(cancel)
|
||||
present(alert, animated: true)
|
||||
}
|
||||
|
||||
/// Handle window.prompt() with a native dialog.
|
||||
func webView(_ webView: WKWebView,
|
||||
runJavaScriptTextInputPanelWithPrompt prompt: String,
|
||||
defaultText: String?,
|
||||
initiatedByFrame frame: WKFrameInfo,
|
||||
completionHandler: @escaping (String?) -> Void) {
|
||||
|
||||
let alert = UIAlertController(title: prompt, message: nil, preferredStyle: .alert)
|
||||
|
||||
alert.addTextField { (textField) in
|
||||
textField.text = defaultText
|
||||
}
|
||||
|
||||
let okTitle = NSLocalizedString("OK", comment: "OK button title")
|
||||
let okAction = UIAlertAction(title: okTitle, style: .default) { (_) in
|
||||
let textInput = alert.textFields![0] as UITextField
|
||||
completionHandler(textInput.text)
|
||||
}
|
||||
alert.addAction(okAction)
|
||||
|
||||
let cancelTitle = NSLocalizedString("Cancel", comment: "Cancel button title")
|
||||
let cancelAction = UIAlertAction(title: cancelTitle, style: .cancel) { (_) in
|
||||
completionHandler(nil)
|
||||
}
|
||||
alert.addAction(cancelAction)
|
||||
|
||||
present(alert, animated: true)
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
BLOCKLY_ROOT=../../..
|
||||
IOS_RESOURCES=Resources/Non-Localized/Blockly
|
||||
|
||||
MORE_FILES_TO_COPY=(
|
||||
"dist/blockly_compressed.js"
|
||||
"dist/blocks_compressed.js"
|
||||
"media"
|
||||
"build/msg"
|
||||
)
|
||||
|
||||
mkdir -p $IOS_RESOURCES/media
|
||||
mkdir -p $IOS_RESOURCES/msg/js
|
||||
rsync -rp ../html/index.html $IOS_RESOURCES/webview.html
|
||||
rsync -rp ../html/toolbox_standard.js $IOS_RESOURCES/toolbox_standard.js
|
||||
for i in "${MORE_FILES_TO_COPY[@]}"; do # The quotes are necessary here
|
||||
TARGET_DIR=$(dirname $IOS_RESOURCES/$i)
|
||||
rsync -rp $BLOCKLY_ROOT/$i $TARGET_DIR
|
||||
done
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"MATH_HUE": "230",
|
||||
"LOOPS_HUE": "120",
|
||||
"#": "Automatically generated, do not edit this file!",
|
||||
"COLOUR_HUE": "20",
|
||||
"LISTS_HUE": "260",
|
||||
"LOGIC_HUE": "210",
|
||||
"VARIABLES_HUE": "330",
|
||||
"TEXTS_HUE": "160",
|
||||
"LOOPS_HUE": "120",
|
||||
"MATH_HUE": "230",
|
||||
"PROCEDURES_HUE": "290",
|
||||
"COLOUR_HUE": "20",
|
||||
"VARIABLES_DYNAMIC_HUE": "310"
|
||||
}
|
||||
"TEXTS_HUE": "160",
|
||||
"VARIABLES_DYNAMIC_HUE": "310",
|
||||
"VARIABLES_HUE": "330"
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"@metadata": {
|
||||
"author": "Ellen Spertus <ellen.spertus@gmail.com>",
|
||||
"lastupdated": "2025-06-17 15:36:41.845826",
|
||||
"lastupdated": "2025-09-08 16:26:57.642330",
|
||||
"locale": "en",
|
||||
"messagedocumentation" : "qqq"
|
||||
},
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"#": "Automatically generated, do not edit this file!",
|
||||
"CONTROLS_FOREACH_INPUT_DO": "CONTROLS_REPEAT_INPUT_DO",
|
||||
"CONTROLS_FOR_INPUT_DO": "CONTROLS_REPEAT_INPUT_DO",
|
||||
"CONTROLS_IF_ELSEIF_TITLE_ELSEIF": "CONTROLS_IF_MSG_ELSEIF",
|
||||
@@ -7,7 +8,6 @@
|
||||
"CONTROLS_IF_MSG_THEN": "CONTROLS_REPEAT_INPUT_DO",
|
||||
"CONTROLS_WHILEUNTIL_INPUT_DO": "CONTROLS_REPEAT_INPUT_DO",
|
||||
"LISTS_CREATE_WITH_ITEM_TITLE": "VARIABLES_DEFAULT_NAME",
|
||||
"LISTS_GET_INDEX_HELPURL": "LISTS_INDEX_OF_HELPURL",
|
||||
"LISTS_GET_INDEX_INPUT_IN_LIST": "LISTS_INLIST",
|
||||
"LISTS_GET_SUBLIST_INPUT_IN_LIST": "LISTS_INLIST",
|
||||
"LISTS_INDEX_OF_INPUT_IN_LIST": "LISTS_INLIST",
|
||||
@@ -19,4 +19,4 @@
|
||||
"PROCEDURES_DEFRETURN_TITLE": "PROCEDURES_DEFNORETURN_TITLE",
|
||||
"TEXT_APPEND_VARIABLE": "VARIABLES_DEFAULT_NAME",
|
||||
"TEXT_CREATE_JOIN_ITEM_TITLE_ITEM": "VARIABLES_DEFAULT_NAME"
|
||||
}
|
||||
}
|
||||
@@ -85,10 +85,10 @@ Blockly.Msg.REMOVE_COMMENT = 'Remove Comment';
|
||||
/// context menu - Make a copy of the selected workspace comment.\n{{Identical|Duplicate}}
|
||||
Blockly.Msg.DUPLICATE_COMMENT = 'Duplicate Comment';
|
||||
/** @type {string} */
|
||||
/// context menu - Change from 'external' to 'inline' mode for displaying blocks used as inputs to the selected block. See [[Translating:Blockly#context_menus]].
|
||||
/// context menu - Change from 'external' to 'inline' mode for displaying blocks used as inputs to the selected block. See [[Translating:Blockly#context_menus]].\n\nThe opposite of {{msg-blockly|INLINE INPUTS}}.
|
||||
Blockly.Msg.EXTERNAL_INPUTS = 'External Inputs';
|
||||
/** @type {string} */
|
||||
/// context menu - Change from 'internal' to 'external' mode for displaying blocks used as inputs to the selected block. See [[Translating:Blockly#context_menus]].
|
||||
/// context menu - Change from 'internal' to 'external' mode for displaying blocks used as inputs to the selected block. See [[Translating:Blockly#context_menus]].\n\nThe opposite of {{msg-blockly|EXTERNAL INPUTS}}.
|
||||
Blockly.Msg.INLINE_INPUTS = 'Inline Inputs';
|
||||
/** @type {string} */
|
||||
/// context menu - Permanently delete the selected block.
|
||||
|
||||
127
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "blockly",
|
||||
"version": "12.3.0",
|
||||
"version": "12.3.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "blockly",
|
||||
"version": "12.3.0",
|
||||
"version": "12.3.1",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
@@ -15,6 +15,7 @@
|
||||
"devDependencies": {
|
||||
"@blockly/block-test": "^7.0.2",
|
||||
"@blockly/dev-tools": "^9.0.2",
|
||||
"@blockly/keyboard-navigation": "^3.0.1",
|
||||
"@blockly/theme-modern": "^7.0.1",
|
||||
"@hyperjump/browser": "^1.1.4",
|
||||
"@hyperjump/json-schema": "^1.5.0",
|
||||
@@ -199,6 +200,15 @@
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@blockly/keyboard-navigation": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@blockly/keyboard-navigation/-/keyboard-navigation-3.0.1.tgz",
|
||||
"integrity": "sha512-qSOPqsqRgkSLEoUeEZc81PWe558pXqY0e+4jkRODoAD+I1hMpCoD+6ivveRp7Jpb8WE1lj2PrAFOVuIVpphjHA==",
|
||||
"dev": true,
|
||||
"peerDependencies": {
|
||||
"blockly": "^12.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@blockly/theme-dark": {
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@blockly/theme-dark/-/theme-dark-8.0.1.tgz",
|
||||
@@ -404,9 +414,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@eslint-community/eslint-utils": {
|
||||
"version": "4.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz",
|
||||
"integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==",
|
||||
"version": "4.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz",
|
||||
"integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -530,9 +540,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@eslint/js": {
|
||||
"version": "9.34.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.34.0.tgz",
|
||||
"integrity": "sha512-EoyvqQnBNsV1CWaEJ559rxXL4c8V92gxirbawSmVUOWXlsRxxQXl6LmCpdUblgxgSkDIqKnhzba2SjRTI/A5Rw==",
|
||||
"version": "9.36.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.36.0.tgz",
|
||||
"integrity": "sha512-uhCbYtYynH30iZErszX78U+nR3pJU3RHGQ57NXy5QupD4SBVwDeU8TNBy+MjMngc1UyIW9noKqsRqfjQTBU2dw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -1283,9 +1293,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@puppeteer/browsers": {
|
||||
"version": "2.10.7",
|
||||
"resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.10.7.tgz",
|
||||
"integrity": "sha512-wHWLkQWBjHtajZeqCB74nsa/X70KheyOhySYBRmVQDJiNj0zjZR/naPCvdWjMhcG1LmjaMV/9WtTo5mpe8qWLw==",
|
||||
"version": "2.10.9",
|
||||
"resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.10.9.tgz",
|
||||
"integrity": "sha512-kUGHwABarVhvMP+zhW5zvDA7LmGcd4TwrTEBwcTQic5EebUqaK5NjC0UXLJepIFVGsr2N/Z8NJQz2JYGo1ZwxA==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
@@ -3223,19 +3233,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/concurrently": {
|
||||
"version": "9.2.0",
|
||||
"resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.2.0.tgz",
|
||||
"integrity": "sha512-IsB/fiXTupmagMW4MNp2lx2cdSN2FfZq78vF90LBB+zZHArbIQZjQtzXCiXnvTxCZSvXanTqFLWBjw2UkLx1SQ==",
|
||||
"version": "9.2.1",
|
||||
"resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.2.1.tgz",
|
||||
"integrity": "sha512-fsfrO0MxV64Znoy8/l1vVIjjHa29SZyyqPgQBwhiDcaW8wJc2W3XWVOGx4M3oJBnv/zdUZIIp1gDeS98GzP8Ng==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"chalk": "^4.1.2",
|
||||
"lodash": "^4.17.21",
|
||||
"rxjs": "^7.8.1",
|
||||
"shell-quote": "^1.8.1",
|
||||
"supports-color": "^8.1.1",
|
||||
"tree-kill": "^1.2.2",
|
||||
"yargs": "^17.7.2"
|
||||
"chalk": "4.1.2",
|
||||
"rxjs": "7.8.2",
|
||||
"shell-quote": "1.8.3",
|
||||
"supports-color": "8.1.1",
|
||||
"tree-kill": "1.2.2",
|
||||
"yargs": "17.7.2"
|
||||
},
|
||||
"bin": {
|
||||
"conc": "dist/bin/concurrently.js",
|
||||
@@ -3628,9 +3637,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/devtools-protocol": {
|
||||
"version": "0.0.1475386",
|
||||
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1475386.tgz",
|
||||
"integrity": "sha512-RQ809ykTfJ+dgj9bftdeL2vRVxASAuGU+I9LEx9Ij5TXU5HrgAQVmzi72VA+mkzscE12uzlRv5/tWWv9R9J1SA==",
|
||||
"version": "0.0.1495869",
|
||||
"resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1495869.tgz",
|
||||
"integrity": "sha512-i+bkd9UYFis40RcnkW7XrOprCujXRAHg62IVh/Ah3G8MmNXpCGt1m0dTFhSdx/AVs8XEMbdOGRwdkR1Bcta8AA==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
@@ -3985,19 +3994,19 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint": {
|
||||
"version": "9.34.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.34.0.tgz",
|
||||
"integrity": "sha512-RNCHRX5EwdrESy3Jc9o8ie8Bog+PeYvvSR8sDGoZxNFTvZ4dlxUB3WzQ3bQMztFrSRODGrLLj8g6OFuGY/aiQg==",
|
||||
"version": "9.36.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.36.0.tgz",
|
||||
"integrity": "sha512-hB4FIzXovouYzwzECDcUkJ4OcfOEkXTv2zRY6B9bkwjx/cprAq0uvm1nl7zvQ0/TsUk0zQiN4uPfJpB9m+rPMQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.2.0",
|
||||
"@eslint-community/eslint-utils": "^4.8.0",
|
||||
"@eslint-community/regexpp": "^4.12.1",
|
||||
"@eslint/config-array": "^0.21.0",
|
||||
"@eslint/config-helpers": "^0.3.1",
|
||||
"@eslint/core": "^0.15.2",
|
||||
"@eslint/eslintrc": "^3.3.1",
|
||||
"@eslint/js": "9.34.0",
|
||||
"@eslint/js": "9.36.0",
|
||||
"@eslint/plugin-kit": "^0.3.5",
|
||||
"@humanfs/node": "^0.16.6",
|
||||
"@humanwhocodes/module-importer": "^1.0.1",
|
||||
@@ -6937,10 +6946,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/mocha": {
|
||||
"version": "11.7.1",
|
||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.1.tgz",
|
||||
"integrity": "sha512-5EK+Cty6KheMS/YLPPMJC64g5V61gIR25KsRItHw6x4hEKT6Njp1n9LOlH4gpevuwMVS66SXaBBpg+RWZkza4A==",
|
||||
"version": "11.7.2",
|
||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.2.tgz",
|
||||
"integrity": "sha512-lkqVJPmqqG/w5jmmFtiRvtA2jkDyNVUcefFJKb2uyX4dekk8Okgqop3cgbFiaIvj8uCRJVTP5x9dfxGyXm2jvQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"browser-stdout": "^1.3.1",
|
||||
"chokidar": "^4.0.1",
|
||||
@@ -7858,14 +7868,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/prettier-plugin-organize-imports": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.1.0.tgz",
|
||||
"integrity": "sha512-5aWRdCgv645xaa58X8lOxzZoiHAldAPChljr/MT0crXVOWTZ+Svl4hIWlz+niYSlO6ikE5UXkN1JrRvIP2ut0A==",
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.2.0.tgz",
|
||||
"integrity": "sha512-Zdy27UhlmyvATZi67BTnLcKTo8fm6Oik59Sz6H64PgZJVs6NJpPD1mT240mmJn62c98/QaL+r3kx9Q3gRpDajg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"prettier": ">=2.0",
|
||||
"typescript": ">=2.9",
|
||||
"vue-tsc": "^2.1.0"
|
||||
"vue-tsc": "^2.1.0 || 3"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"vue-tsc": {
|
||||
@@ -7955,17 +7966,18 @@
|
||||
}
|
||||
},
|
||||
"node_modules/puppeteer-core": {
|
||||
"version": "24.17.0",
|
||||
"resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-24.17.0.tgz",
|
||||
"integrity": "sha512-RYOBKFiF+3RdwIZTEacqNpD567gaFcBAOKTT7742FdB1icXudrPI7BlZbYTYWK2wgGQUXt9Zi1Yn+D5PmCs4CA==",
|
||||
"version": "24.20.0",
|
||||
"resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-24.20.0.tgz",
|
||||
"integrity": "sha512-n0y/f8EYyZt4yEJkjP3Vrqf9A4qa3uYpKYdsiedIY4bxIfTw1aAJSpSVPmWBPlr1LO4cNq2hGNIBWKPhvBF68w==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@puppeteer/browsers": "2.10.7",
|
||||
"@puppeteer/browsers": "2.10.9",
|
||||
"chromium-bidi": "8.0.0",
|
||||
"debug": "^4.4.1",
|
||||
"devtools-protocol": "0.0.1475386",
|
||||
"devtools-protocol": "0.0.1495869",
|
||||
"typed-query-selector": "^2.12.0",
|
||||
"webdriver-bidi-protocol": "0.2.8",
|
||||
"ws": "^8.18.3"
|
||||
},
|
||||
"engines": {
|
||||
@@ -8406,19 +8418,21 @@
|
||||
}
|
||||
},
|
||||
"node_modules/rxjs": {
|
||||
"version": "7.8.1",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz",
|
||||
"integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==",
|
||||
"version": "7.8.2",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz",
|
||||
"integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/rxjs/node_modules/tslib": {
|
||||
"version": "2.5.3",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz",
|
||||
"integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==",
|
||||
"dev": true
|
||||
"version": "2.8.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
|
||||
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
|
||||
"dev": true,
|
||||
"license": "0BSD"
|
||||
},
|
||||
"node_modules/safaridriver": {
|
||||
"version": "1.0.0",
|
||||
@@ -8537,10 +8551,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/shell-quote": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz",
|
||||
"integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==",
|
||||
"version": "1.8.3",
|
||||
"resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz",
|
||||
"integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
@@ -9664,6 +9682,13 @@
|
||||
"node": ">=18.20.0"
|
||||
}
|
||||
},
|
||||
"node_modules/webdriver-bidi-protocol": {
|
||||
"version": "0.2.8",
|
||||
"resolved": "https://registry.npmjs.org/webdriver-bidi-protocol/-/webdriver-bidi-protocol-0.2.8.tgz",
|
||||
"integrity": "sha512-KPvtVAIX8VHjLZH1KHT5GXoOaPeb0Ju+JlAcdshw6Z/gsmRtLoxt0Hw99PgJwZta7zUQaAUIHHWDRkzrPHsQTQ==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/webdriverio": {
|
||||
"version": "9.14.0",
|
||||
"resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-9.14.0.tgz",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "blockly",
|
||||
"version": "12.3.0",
|
||||
"version": "12.3.1",
|
||||
"description": "Blockly is a library for building visual programming editors.",
|
||||
"keywords": [
|
||||
"blockly"
|
||||
@@ -102,6 +102,7 @@
|
||||
"devDependencies": {
|
||||
"@blockly/block-test": "^7.0.2",
|
||||
"@blockly/dev-tools": "^9.0.2",
|
||||
"@blockly/keyboard-navigation": "^3.0.1",
|
||||
"@blockly/theme-modern": "^7.0.1",
|
||||
"@hyperjump/browser": "^1.1.4",
|
||||
"@hyperjump/json-schema": "^1.5.0",
|
||||
|
||||
@@ -258,6 +258,13 @@ suite('Variable Map', function () {
|
||||
assert.deepEqual(newTypeVariables, [variable]);
|
||||
assert.equal(variable.getType(), '');
|
||||
});
|
||||
|
||||
test('removes the type from the map when the last instance is changed', function () {
|
||||
const var1 = this.variableMap.createVariable('name1', 'type1');
|
||||
const var2 = this.variableMap.createVariable('name2', 'type2');
|
||||
this.variableMap.changeVariableType(var1, 'type2');
|
||||
assert.deepEqual(this.variableMap.getTypes(), ['type2']);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -18,6 +18,11 @@
|
||||
await loadScript(
|
||||
'../../node_modules/@blockly/theme-modern/dist/index.js',
|
||||
);
|
||||
await loadScript(
|
||||
'../../node_modules/@blockly/keyboard-navigation/dist/index.js',
|
||||
);
|
||||
|
||||
let kbNavigation;
|
||||
|
||||
function start() {
|
||||
setBackgroundColour();
|
||||
@@ -47,6 +52,28 @@
|
||||
// Refresh theme.
|
||||
ws.setTheme(ws.getTheme());
|
||||
});
|
||||
|
||||
// Keyboard navigation options.
|
||||
const kbOptions = {
|
||||
'Enable keyboard navigation': false,
|
||||
};
|
||||
gui.remember(kbOptions);
|
||||
gui.add(kbOptions, 'Enable keyboard navigation').onChange((enabled) => {
|
||||
setupKeyboardNav(enabled, playground);
|
||||
});
|
||||
|
||||
// Set up keyboard navigation on page load
|
||||
setupKeyboardNav(kbOptions['Enable keyboard navigation'], playground);
|
||||
}
|
||||
|
||||
function setupKeyboardNav(enabled, playground) {
|
||||
if (enabled) {
|
||||
kbNavigation = new KeyboardNavigation(playground.getWorkspace());
|
||||
} else {
|
||||
if (kbNavigation) {
|
||||
kbNavigation.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function initPlayground() {
|
||||
@@ -101,6 +128,8 @@
|
||||
};
|
||||
|
||||
Blockly.ContextMenuItems.registerCommentOptions();
|
||||
KeyboardNavigation.registerKeyboardNavigationStyles();
|
||||
// TODO: register the navigation-deferring toolbox.
|
||||
|
||||
createPlayground(
|
||||
document.getElementById('root'),
|
||||
@@ -153,6 +182,7 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="shortcuts"></div>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||