Commit 3450d77d authored by carlosperate's avatar carlosperate

Merge branch 'master' of https://github.com/google/blockly into blockly-original

parents a4b18b6b 7da8998d
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -127,11 +127,11 @@ delete window.BLOCKLY_BOOT;
};
// Delete any existing Closure (e.g. Soy's nogoog_shim).
document.write('<script type="text/javascript">var goog = undefined;</script>');
document.write('<script>var goog = undefined;</script>');
// Load fresh Closure Library.
document.write('<script type="text/javascript" src="' + window.BLOCKLY_DIR +
document.write('<script src="' + window.BLOCKLY_DIR +
'/../closure-library/closure/goog/base.js"></script>');
document.write('<script type="text/javascript">window.BLOCKLY_BOOT()</script>');
document.write('<script>window.BLOCKLY_BOOT()</script>');
""")
f.close()
print('SUCCESS: ' + target_filename)
......@@ -261,10 +261,11 @@ class Gen_compressed(threading.Thread):
for error in errors:
print('FATAL ERROR')
print(error['error'])
print('%s at line %d:' % (
file_lookup(error['file']), error['lineno']))
print(error['line'])
print((' ' * error['charno']) + '^')
if error['file']:
print('%s at line %d:' % (
file_lookup(error['file']), error['lineno']))
print(error['line'])
print((' ' * error['charno']) + '^')
sys.exit(1)
else:
if json_data.has_key('warnings'):
......@@ -272,10 +273,11 @@ class Gen_compressed(threading.Thread):
for warning in warnings:
print('WARNING')
print(warning['warning'])
print('%s at line %d:' % (
file_lookup(warning['file']), warning['lineno']))
print(warning['line'])
print((' ' * warning['charno']) + '^')
if warning['file']:
print('%s at line %d:' % (
file_lookup(warning['file']), warning['lineno']))
print(warning['line'])
print((' ' * warning['charno']) + '^')
print()
if not json_data.has_key('compiledCode'):
......
......@@ -300,6 +300,7 @@ Blockly.Block.terminateDrag_ = function() {
selected.workspace.fireChangeEvent();
}
Blockly.Block.dragMode_ = 0;
Blockly.Css.setCursor(Blockly.Css.Cursor.OPEN);
};
/**
......@@ -572,13 +573,15 @@ Blockly.Block.prototype.onMouseUp_ = function(e) {
}
inferiorConnection.sourceBlock_.svg_.connectionUiEffect();
}
if (this_.workspace.trashcan && this_.workspace.trashcan.isOpen) {
if (this_.workspace.trashcan) {
// Don't throw an object in the trash can if it just got connected.
this_.workspace.trashcan.close();
}
} else if (this_.workspace.trashcan && this_.workspace.trashcan.isOpen) {
} else if (this_.workspace.isDeleteArea(e)) {
var trashcan = this_.workspace.trashcan;
goog.Timer.callOnce(trashcan.close, 100, trashcan);
if (trashcan) {
goog.Timer.callOnce(trashcan.close, 100, trashcan);
}
Blockly.selected.dispose(false, true);
// Dropping a block on the trash can will usually cause the workspace to
// resize to contain the newly positioned block. Force a second resize
......@@ -589,6 +592,7 @@ Blockly.Block.prototype.onMouseUp_ = function(e) {
Blockly.highlightedConnection_.unhighlight();
Blockly.highlightedConnection_ = null;
}
Blockly.Css.setCursor(Blockly.Css.Cursor.OPEN);
});
};
......@@ -862,6 +866,7 @@ Blockly.Block.prototype.onMouseMove_ = function(e) {
// Push this block to the very top of the stack.
this_.setParent(null);
this_.setDragging_(true);
this_.workspace.recordDeleteAreas();
}
}
if (Blockly.Block.dragMode_ == 2) {
......@@ -907,9 +912,10 @@ Blockly.Block.prototype.onMouseMove_ = function(e) {
Blockly.highlightedConnection_ = closestConnection;
Blockly.localConnection_ = localConnection;
}
// Flip the trash can lid if needed.
if (this_.workspace.trashcan && this_.isDeletable()) {
this_.workspace.trashcan.onMouseMove(e);
// Provide visual indication of whether the block will be deleted if
// dropped here.
if (this_.isDeletable()) {
this_.workspace.isDeleteArea(e);
}
}
// This event has been handled. No need to bubble up to the document.
......
......@@ -868,19 +868,20 @@ Blockly.BlockSvg.prototype.renderDrawRight_ = function(steps, highlightSteps,
highlightInlineSteps.push('h',
input.renderWidth - Blockly.BlockSvg.TAB_WIDTH + 1);
} else {
// Highlight right edge, bottom, and glint at bottom of tab.
// Highlight right edge, bottom.
highlightInlineSteps.push('M',
(cursorX - Blockly.BlockSvg.SEP_SPACE_X + 1) + ',' +
(cursorY + Blockly.BlockSvg.INLINE_PADDING_Y + 1));
highlightInlineSteps.push('v', input.renderHeight + 1);
highlightInlineSteps.push('h', Blockly.BlockSvg.TAB_WIDTH - 2 -
input.renderWidth);
// Short highlight glint at bottom of tab.
highlightInlineSteps.push('M',
(cursorX - input.renderWidth - Blockly.BlockSvg.SEP_SPACE_X +
0.8) + ',' + (cursorY + Blockly.BlockSvg.INLINE_PADDING_Y +
1.8) + ',' + (cursorY + Blockly.BlockSvg.INLINE_PADDING_Y +
Blockly.BlockSvg.TAB_HEIGHT - 0.4));
highlightInlineSteps.push('l',
(Blockly.BlockSvg.TAB_WIDTH * 0.42) + ',-1.8');
(Blockly.BlockSvg.TAB_WIDTH * 0.38) + ',-1.8');
}
// Create inline input connection.
if (Blockly.RTL) {
......@@ -935,7 +936,7 @@ Blockly.BlockSvg.prototype.renderDrawRight_ = function(steps, highlightSteps,
// Short highlight glint at bottom of tab.
highlightSteps.push('M', (inputRows.rightEdge - 4.2) + ',' +
(cursorY + Blockly.BlockSvg.TAB_HEIGHT - 0.4));
highlightSteps.push('l', (Blockly.BlockSvg.TAB_WIDTH * 0.42) +
highlightSteps.push('l', (Blockly.BlockSvg.TAB_WIDTH * 0.38) +
',-1.8');
}
// Create external input connection.
......
......@@ -101,7 +101,7 @@ Blockly.SPRITE = {
*/
Blockly.makeColour = function(hue) {
return goog.color.hsvToHex(hue, Blockly.HSV_SATURATION,
Blockly.HSV_VALUE * 256);
Blockly.HSV_VALUE * 255);
};
/**
......@@ -512,8 +512,10 @@ Blockly.hideChaff = function(opt_allowToolbox) {
Blockly.Tooltip.hide();
Blockly.WidgetDiv.hide();
if (!opt_allowToolbox &&
Blockly.Toolbox.flyout_ && Blockly.Toolbox.flyout_.autoClose) {
Blockly.Toolbox.clearSelection();
Blockly.mainWorkspace.toolbox_ &&
Blockly.mainWorkspace.toolbox_.flyout_ &&
Blockly.mainWorkspace.toolbox_.flyout_.autoClose) {
Blockly.mainWorkspace.toolbox_.clearSelection();
}
};
......@@ -638,7 +640,9 @@ Blockly.playAudio = function(name, opt_volume) {
*/
Blockly.getMainWorkspaceMetrics_ = function() {
var svgSize = Blockly.svgSize();
svgSize.width -= Blockly.Toolbox.width; // Zero if no Toolbox.
if (Blockly.mainWorkspace.toolbox_) {
svgSize.width -= Blockly.mainWorkspace.toolbox_.width;
}
var viewWidth = svgSize.width - Blockly.Scrollbar.scrollbarThickness;
var viewHeight = svgSize.height - Blockly.Scrollbar.scrollbarThickness;
try {
......@@ -664,7 +668,10 @@ Blockly.getMainWorkspaceMetrics_ = function() {
var topEdge = blockBox.y;
var bottomEdge = topEdge + blockBox.height;
}
var absoluteLeft = Blockly.RTL ? 0 : Blockly.Toolbox.width;
var absoluteLeft = 0;
if (!Blockly.RTL && Blockly.mainWorkspace.toolbox_) {
absoluteLeft = Blockly.mainWorkspace.toolbox_.width;
}
var metrics = {
viewHeight: svgSize.height,
viewWidth: svgSize.width,
......
......@@ -28,6 +28,7 @@ goog.provide('Blockly.Connection');
goog.provide('Blockly.ConnectionDB');
goog.require('Blockly.Workspace');
goog.require('Blockly.BlockSvg');
/**
......@@ -348,9 +349,9 @@ Blockly.Connection.prototype.highlight = function() {
tabWidth + ',-2.5 ' + tabWidth + ',7.5 v 5';
} else {
if (Blockly.RTL) {
steps = 'm 20,0 h -5 l -6,4 -3,0 -6,-4 h -5';
steps = 'm 20,0 h -5 ' + Blockly.BlockSvg.NOTCH_PATH_RIGHT + ' h -5';
} else {
steps = 'm -20,0 h 5 l 6,4 3,0 6,-4 h 5';
steps = 'm -20,0 h 5 ' + Blockly.BlockSvg.NOTCH_PATH_LEFT + ' h 5';
}
}
var xy = this.sourceBlock_.getRelativeToSurfaceXY();
......
......@@ -28,6 +28,7 @@ goog.provide('Blockly.Css');
goog.require('goog.cssom');
/**
* List of cursors.
* @enum {string}
......@@ -38,6 +39,12 @@ Blockly.Css.Cursor = {
DELETE: 'handdelete'
};
/**
* Current cursor (cached value).
* @type string
*/
Blockly.Css.currentCursor_ = '';
/**
* Large stylesheet added by Blockly.Css.inject.
* @type Element
......@@ -64,10 +71,8 @@ Blockly.Css.inject = function() {
// Strip off any trailing slash (either Unix or Windows).
Blockly.Css.mediaPath_ = Blockly.pathToMedia.replace(/[\\\/]$/, '');
text = text.replace(/<<<PATH>>>/g, Blockly.Css.mediaPath_);
goog.cssom.addCssText(text);
var sheets = goog.cssom.getAllCssStyleSheets();
Blockly.Css.styleSheet_ = sheets[sheets.length - 1];
Blockly.Css.setCursor('handopen');
Blockly.Css.styleSheet_ = goog.cssom.addCssText(text).sheet;
Blockly.Css.setCursor(Blockly.Css.Cursor.OPEN);
};
/**
......@@ -75,9 +80,10 @@ Blockly.Css.inject = function() {
* @param {Blockly.Cursor} cursor Enum.
*/
Blockly.Css.setCursor = function(cursor) {
if (Blockly.readOnly) {
if (Blockly.readOnly || Blockly.Css.currentCursor_ == cursor) {
return;
}
Blockly.Css.currentCursor_ = cursor;
/*
Hotspot coordinates are baked into the CUR file, but they are still
required in the CSS due to a Chrome bug.
......@@ -88,10 +94,30 @@ Blockly.Css.setCursor = function(cursor) {
} else {
var xy = '7 3';
}
var rule = '.blocklyDraggable {\n' +
' cursor: url(' + Blockly.Css.mediaPath_ + '/' + cursor + '.cur)' +
' ' + xy + ', auto;\n}\n';
var url = 'url(' + Blockly.Css.mediaPath_ + '/' + cursor +
'.cur) ' + xy + ', auto';
// There are potentially hundreds of draggable objects. Changing their style
// properties individually is too slow, so change the CSS rule instead.
var rule = '.blocklyDraggable {\n cursor: ' + url + ';\n}\n';
goog.cssom.replaceCssRule('', rule, Blockly.Css.styleSheet_, 0);
// There is probably only one toolbox, so just change its style property.
var toolboxen = document.getElementsByClassName('blocklyToolboxDiv');
for (var i = 0, toolbox; toolbox = toolboxen[i]; i++) {
if (cursor == Blockly.Css.Cursor.OPEN) {
toolbox.style.cursor = '';
} else {
toolbox.style.cursor = url;
}
}
// Set cursor on the SVG surface as well, so that rapid movements
// don't result in cursor changing to an arrow momentarily.
if (Blockly.svg) {
if (cursor == Blockly.Css.Cursor.OPEN) {
Blockly.svg.style.cursor = '';
} else {
Blockly.svg.style.cursor = url;
}
}
};
/**
......
......@@ -253,6 +253,9 @@ Blockly.FieldTextInput.prototype.widgetDispose_ = function() {
* @return {?string} A string representing a valid number, or null if invalid.
*/
Blockly.FieldTextInput.numberValidator = function(text) {
if(text === null) {
return null;
}
// TODO: Handle cases like 'ten', '1.203,14', etc.
// 'O' is sometimes mistaken for '0' by inexperienced users.
text = text.replace(/O/ig, '0');
......
......@@ -29,6 +29,7 @@ goog.provide('Blockly.Flyout');
goog.require('Blockly.Block');
goog.require('Blockly.Comment');
goog.require('goog.userAgent');
goog.require('goog.math.Rect');
/**
......@@ -670,3 +671,20 @@ Blockly.Flyout.terminateDrag_ = function() {
Blockly.Flyout.startBlock_ = null;
Blockly.Flyout.startFlyout_ = null;
};
/**
* Return the deletion rectangle for this flyout.
* @return {goog.math.Rect} Rectangle in which to delete.
*/
Blockly.Flyout.prototype.getRect = function() {
// BIG_NUM is offscreen padding so that blocks dragged beyond the shown flyout
// area are still deleted. Must be smaller than Infinity, but larger than
// the largest screen size.
var BIG_NUM = 10000000;
var x = Blockly.getSvgXY_(this.svgGroup_).x;
if (!Blockly.RTL) {
x -= BIG_NUM;
}
return new goog.math.Rect(x, -BIG_NUM,
BIG_NUM + this.width_, this.height_ + 2 * BIG_NUM);
};
......@@ -117,14 +117,9 @@ Blockly.parseOptions_ = function(options) {
hasDisable = hasCategories;
}
}
if (tree && !hasCategories) {
// Scrollbars are not compatible with a non-flyout toolbox.
var hasScrollbars = false;
} else {
var hasScrollbars = options['scrollbars'];
if (hasScrollbars === undefined) {
hasScrollbars = true;
}
var hasScrollbars = options['scrollbars'];
if (hasScrollbars === undefined) {
hasScrollbars = hasCategories;
}
var hasSounds = options['sounds'];
if (hasSounds === undefined) {
......@@ -275,7 +270,7 @@ Blockly.createDom_ = function(container) {
// Determine if there needs to be a category tree, or a simple list of
// blocks. This cannot be changed later, since the UI is very different.
if (Blockly.hasCategories) {
Blockly.Toolbox.createDom(svg, container);
Blockly.mainWorkspace.toolbox_ = new Blockly.Toolbox(svg, container);
} else {
/**
* @type {!Blockly.Flyout}
......@@ -287,51 +282,48 @@ Blockly.createDom_ = function(container) {
flyout.autoClose = false;
// Insert the flyout behind the workspace so that blocks appear on top.
goog.dom.insertSiblingBefore(flyoutSvg, Blockly.mainWorkspace.svgGroup_);
}
if (!Blockly.hasScrollbars) {
var workspaceChanged = function() {
if (Blockly.Block.dragMode_ == 0) {
var metrics = Blockly.mainWorkspace.getMetrics();
if (metrics.contentTop < 0 ||
var edgeLeft = metrics.viewLeft + metrics.absoluteLeft;
var edgeTop = metrics.viewTop + metrics.absoluteTop;
if (metrics.contentTop < edgeTop ||
metrics.contentTop + metrics.contentHeight >
metrics.viewHeight + metrics.viewTop ||
metrics.contentLeft < (Blockly.RTL ? metrics.viewLeft : 0) ||
metrics.viewHeight + edgeTop ||
metrics.contentLeft <
(Blockly.RTL ? metrics.viewLeft : edgeLeft) ||
metrics.contentLeft + metrics.contentWidth > (Blockly.RTL ?
metrics.viewWidth :
metrics.viewWidth + metrics.viewLeft)) {
// One or more blocks is out of bounds. Bump them back in.
metrics.viewWidth : metrics.viewWidth + edgeLeft)) {
// One or more blocks may be out of bounds. Bump them back in.
var MARGIN = 25;
var blocks = Blockly.mainWorkspace.getTopBlocks(false);
for (var b = 0, block; block = blocks[b]; b++) {
var blockXY = block.getRelativeToSurfaceXY();
var blockHW = block.getHeightWidth();
// Bump any block that's above the top back inside.
var overflow = metrics.viewTop + MARGIN - blockHW.height -
blockXY.y;
var overflow = edgeTop + MARGIN - blockHW.height - blockXY.y;
if (overflow > 0) {
block.moveBy(0, overflow);
}
// Bump any block that's below the bottom back inside.
var overflow = metrics.viewTop + metrics.viewHeight - MARGIN -
blockXY.y;
var overflow = edgeTop + metrics.viewHeight - MARGIN - blockXY.y;
if (overflow < 0) {
block.moveBy(0, overflow);
}
// Bump any block that's off the left back inside.
var overflow = MARGIN + metrics.viewLeft - blockXY.x -
(Blockly.RTL ? 0 : blockHW.width);
var overflow = MARGIN + edgeLeft -
blockXY.x - (Blockly.RTL ? 0 : blockHW.width);
if (overflow > 0) {
block.moveBy(overflow, 0);
}
// Bump any block that's off the right back inside.
var overflow = metrics.viewLeft + metrics.viewWidth - MARGIN -
var overflow = edgeLeft + metrics.viewWidth - MARGIN -
blockXY.x + (Blockly.RTL ? blockHW.width : 0);
if (overflow < 0) {
block.moveBy(overflow, 0);
}
// Delete any block that's sitting on top of the flyout.
if (block.isDeletable() && (Blockly.RTL ?
blockXY.x - metrics.viewWidth : -blockXY.x) > MARGIN * 2) {
block.dispose(false, true);
}
}
}
}
......@@ -389,9 +381,9 @@ Blockly.init_ = function() {
}
if (Blockly.languageTree) {
if (Blockly.hasCategories) {
Blockly.Toolbox.init();
} else {
if (Blockly.mainWorkspace.toolbox_) {
Blockly.mainWorkspace.toolbox_.init();
} else if (Blockly.mainWorkspace.flyout_) {
// Build a fixed flyout with the root blocks.
Blockly.mainWorkspace.flyout_.init(Blockly.mainWorkspace);
Blockly.mainWorkspace.flyout_.show(Blockly.languageTree.childNodes);
......@@ -463,7 +455,7 @@ Blockly.updateToolbox = function(tree) {
throw 'Existing toolbox has no categories. Can\'t change mode.';
}
Blockly.languageTree = tree;
Blockly.Toolbox.populate_();
Blockly.mainWorkspace.toolbox_.populate_();
} else {
if (Blockly.hasCategories) {
throw 'Existing toolbox has categories. Can\'t change mode.';
......
......@@ -118,9 +118,9 @@ Blockly.Mutator.prototype.createEditor_ = function() {
var mutator = this;
this.workspace_ = new Blockly.Workspace(
function() {return mutator.getFlyoutMetrics_();}, null);
this.flyout_ = new Blockly.Flyout();
this.flyout_.autoClose = false;
this.svgDialog_.appendChild(this.flyout_.createDom());
this.workspace_.flyout_ = new Blockly.Flyout();
this.workspace_.flyout_.autoClose = false;
this.svgDialog_.appendChild(this.workspace_.flyout_.createDom());
this.svgDialog_.appendChild(this.workspace_.createDom());
return this.svgDialog_;
};
......@@ -148,7 +148,7 @@ Blockly.Mutator.prototype.updateEditable = function() {
Blockly.Mutator.prototype.resizeBubble_ = function() {
var doubleBorderWidth = 2 * Blockly.Bubble.BORDER_WIDTH;
var workspaceSize = this.workspace_.getCanvas().getBBox();
var flyoutMetrics = this.flyout_.getMetrics_();
var flyoutMetrics = this.workspace_.flyout_.getMetrics_();
var width;
if (Blockly.RTL) {
width = -workspaceSize.x;
......@@ -193,8 +193,8 @@ Blockly.Mutator.prototype.setVisible = function(visible) {
this.createEditor_(), this.block_.svg_.svgPath_,
this.iconX_, this.iconY_, null, null);
var thisObj = this;
this.flyout_.init(this.workspace_);
this.flyout_.show(this.quarkXml_);
this.workspace_.flyout_.init(this.workspace_);
this.workspace_.flyout_.show(this.quarkXml_);
this.rootBlock_ = this.block_.decompose(this.workspace_);
var blocks = this.rootBlock_.getDescendants();
......@@ -204,8 +204,8 @@ Blockly.Mutator.prototype.setVisible = function(visible) {
// The root block should not be dragable or deletable.
this.rootBlock_.setMovable(false);
this.rootBlock_.setDeletable(false);
var margin = this.flyout_.CORNER_RADIUS * 2;
var x = this.flyout_.width_ + margin;
var margin = this.workspace_.flyout_.CORNER_RADIUS * 2;
var x = this.workspace_.flyout_.width_ + margin;
if (Blockly.RTL) {
x = -x;
}
......@@ -226,8 +226,6 @@ Blockly.Mutator.prototype.setVisible = function(visible) {
} else {
// Dispose of the bubble.
this.svgDialog_ = null;
this.flyout_.dispose();
this.flyout_ = null;
this.workspace_.dispose();
this.workspace_ = null;
this.rootBlock_ = null;
......@@ -244,7 +242,7 @@ Blockly.Mutator.prototype.setVisible = function(visible) {
/**
* Update the source block when the mutator's blocks are changed.
* Delete or bump any block that's out of bounds.
* Bump down any block that's too high.
* Fired whenever a change is made to the mutator's workspace.
* @private
*/
......@@ -255,12 +253,7 @@ Blockly.Mutator.prototype.workspaceChanged_ = function() {
for (var b = 0, block; block = blocks[b]; b++) {
var blockXY = block.getRelativeToSurfaceXY();
var blockHW = block.getHeightWidth();
if (block.isDeletable() && (Blockly.RTL ?
blockXY.x > -this.flyout_.width_ + MARGIN :
blockXY.x < this.flyout_.width_ - MARGIN)) {
// Delete any block that's sitting on top of the flyout.
block.dispose(false, true);
} else if (blockXY.y + blockHW.height < MARGIN) {
if (blockXY.y + blockHW.height < MARGIN) {
// Bump any block that's above the top back inside.
block.moveBy(0, MARGIN - blockHW.height - blockXY.y);
}
......
......@@ -221,7 +221,7 @@ Blockly.Realtime.getBlockById = function(id) {
};
/**
* Log the event for debugging purposses.
* Log the event for debugging purposes.
* @param {gapi.drive.realtime.BaseModelEvent} evt The event that occurred.
* @private
*/
......@@ -263,9 +263,9 @@ Blockly.Realtime.onObjectChange_ = function(evt) {
event.property == 'relativeY') {
Blockly.Realtime.doWithinSync_(function() {
if (!block.svg_) {
// If this is a move of a newly disconnected (i.e newly top
// If this is a move of a newly disconnected (i.e. newly top
// level) block it will not have any svg (because it has been
// disposed of by it's parent), so we need to handle that here.
// disposed of by its parent), so we need to handle that here.
Blockly.Realtime.placeBlockOnWorkspace_(block, false);
}
Blockly.Realtime.moveBlock_(block);
......@@ -715,7 +715,7 @@ Blockly.Realtime.startRealtime = function(uiInitialize, uiContainer, options) {
Blockly.Realtime.enabled_ = true;
// Note that we need to setup the UI for realtime authorization before
// loading the realtime code (which, in turn, will handle initializing the
// rest of the Blockly UI.
// rest of the Blockly UI).
var authDiv = Blockly.Realtime.addAuthUi_(uiContainer);
Blockly.Realtime.initUi_ = function() {
uiInitialize();
......@@ -739,7 +739,7 @@ Blockly.Realtime.startRealtime = function(uiInitialize, uiContainer, options) {
* @private
*/
Blockly.Realtime.addAuthUi_ = function(uiContainer) {
// Add progess indicator to the UI container.
// Add progress indicator to the UI container.
uiContainer.style.background = 'url(' + Blockly.pathToMedia +
Blockly.Realtime.PROGRESS_URL_ + ') no-repeat center center';
// Setup authorization button
......@@ -817,7 +817,7 @@ Blockly.Realtime.onCollaboratorLeft_ = function(event) {
/**
* Execute a command. Generally, a command is the result of a user action
* e.g., a click, drag or context menu selection.
* e.g. a click, drag or context menu selection.
* @param {function()} cmdThunk A function representing the command execution.
*/
Blockly.Realtime.doCommand = function(cmdThunk) {
......
This diff is collapsed.
......@@ -27,6 +27,7 @@
goog.provide('Blockly.Trashcan');
goog.require('goog.math');
goog.require('goog.math.Rect');
goog.require('goog.Timer');
......@@ -238,32 +239,16 @@ Blockly.Trashcan.prototype.position_ = function() {
};
/**
* Determines if the mouse is currently over the trash can.
* Opens/closes the lid and sets the isOpen flag.
* @param {!Event} e Mouse move event.
* Return the deletion rectangle for this trashcan.
* @return {goog.math.Rect} Rectangle in which to delete.
*/
Blockly.Trashcan.prototype.onMouseMove = function(e) {
/*
An alternative approach would be to use onMouseOver and onMouseOut events.
However the selected block will be between the mouse and the trash can,
thus these events won't fire.
Another approach is to use HTML5's drag & drop API, but it's widely hated.
Instead, we'll just have the block's drag_ function call us.
*/
if (!this.svgGroup_) {
return;
}
var mouseXY = Blockly.mouseToSvg(e);
Blockly.Trashcan.prototype.getRect = function() {
var trashXY = Blockly.getSvgXY_(this.svgGroup_);
var over = (mouseXY.x > trashXY.x - this.MARGIN_HOTSPOT_) &&
(mouseXY.x < trashXY.x + this.WIDTH_ + this.MARGIN_HOTSPOT_) &&
(mouseXY.y > trashXY.y - this.MARGIN_HOTSPOT_) &&
(mouseXY.y < trashXY.y + this.BODY_HEIGHT_ + this.LID_HEIGHT_ +
this.MARGIN_HOTSPOT_);
// For bonus points we might want to match the trapezoidal outline.
if (this.isOpen != over) {
this.setOpen_(over);
}
return new goog.math.Rect(
trashXY.x - this.MARGIN_HOTSPOT_,
trashXY.y - this.MARGIN_HOTSPOT_,
this.WIDTH_ + 2 * this.MARGIN_HOTSPOT_,
this.BODY_HEIGHT_ + this.LID_HEIGHT_ + 2 * this.MARGIN_HOTSPOT_);
};
/**
......@@ -278,8 +263,6 @@ Blockly.Trashcan.prototype.setOpen_ = function(state) {
goog.Timer.clear(this.lidTask_);
this.isOpen = state;
this.animateLid_();
Blockly.Css.setCursor(state ? Blockly.Css.Cursor.DELETE :
Blockly.Css.Cursor.CLOSED);
};
/**
......
......@@ -30,7 +30,6 @@ goog.provide('Blockly.Variables');
// TODO(scr): Fix circular dependencies
// goog.require('Blockly.Block');
goog.require('Blockly.Toolbox');
goog.require('Blockly.Workspace');
......
......@@ -32,6 +32,7 @@ goog.require('Blockly.ScrollbarPair');
goog.require('Blockly.Trashcan');
goog.require('Blockly.Xml');
goog.require('goog.math');
goog.require('goog.math.Coordinate');
/**
......@@ -134,6 +135,10 @@ Blockly.Workspace.prototype.dispose = function() {
}
this.svgBlockCanvas_ = null;
this.svgBubbleCanvas_ = null;
if (this.flyout_) {
this.flyout_.dispose();
this.flyout_ = null;
}
if (this.trashcan) {
this.trashcan.dispose();
this.trashcan = null;
......@@ -396,5 +401,51 @@ Blockly.Workspace.prototype.remainingCapacity = function() {
return this.maxBlocks - this.getAllBlocks().length;
};
/**
* Make a list of all the delete areas for this workspace.
*/
Blockly.Workspace.prototype.recordDeleteAreas = function() {
if (this.trashcan) {
this.deleteAreaTrash_ = this.trashcan.getRect();
} else {
this.deleteAreaTrash_ = null;
}
if (this.flyout_) {
this.deleteAreaToolbox_ = this.flyout_.getRect();
} else if (this.toolbox_) {
this.deleteAreaToolbox_ = this.toolbox_.getRect();
} else {
this.deleteAreaToolbox_ = null;
}
};
/**
* Is the mouse event over a delete area (toolbar or non-closing flyout)?
* Opens or closes the trashcan and sets the cursor as a side effect.
* @param {!Event} e Mouse move event.
* @return {boolean} True if event is in a delete area.
*/
Blockly.Workspace.prototype.isDeleteArea = function(e) {
var isDelete = false;
var mouseXY = Blockly.mouseToSvg(e);
var xy = new goog.math.Coordinate(mouseXY.x, mouseXY.y);
if (this.deleteAreaTrash_) {
if (this.deleteAreaTrash_.contains(xy)) {
this.trashcan.setOpen_(true);
Blockly.Css.setCursor(Blockly.Css.Cursor.DELETE);
return true;
}
this.trashcan.setOpen_(false);
}
if (this.deleteAreaToolbox_) {
if (this.deleteAreaToolbox_.contains(xy)) {
Blockly.Css.setCursor(Blockly.Css.Cursor.DELETE);
return true;
}
}
Blockly.Css.setCursor(Blockly.Css.Cursor.CLOSED);
return false;
};
// Export symbols that would otherwise be renamed by Closure compiler.
Blockly.Workspace.prototype['clear'] = Blockly.Workspace.prototype.clear;
......@@ -4,11 +4,11 @@
<meta charset="utf-8">
<meta name="viewport" content="target-densitydpi=device-dpi, height=660, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Blockly Demo: Block Factory</title>
<script type="text/javascript" src="/storage.js"></script>
<script type="text/javascript" src="factory.js"></script>
<script type="text/javascript" src="../../blockly_compressed.js"></script>
<script type="text/javascript" src="../../msg/messages.js"></script>
<script type="text/javascript" src="blocks.js"></script>
<script src="/storage.js"></script>
<script src="factory.js"></script>
<script src="../../blockly_compressed.js"></script>
<script src="../../msg/messages.js"></script>
<script src="blocks.js"></script>
<style>
html, body {
height: 100%;
......@@ -74,8 +74,8 @@
display: none;
}
</style>
<link rel="stylesheet" type="text/css" href="../prettify.css">
<script type="text/javascript" src="../prettify.js"></script>
<link rel="stylesheet" href="../prettify.css">
<script src="../prettify.js"></script>
</head>
<body>
<table>
......
......@@ -4,9 +4,9 @@
<meta charset="utf-8">
<meta name="google" value="notranslate">
<title>Block Factory Preview</title>
<script type="text/javascript" src="../../blockly_compressed.js"></script>
<script type="text/javascript" src="../../msg/messages.js"></script>
<script type="text/javascript" src="preview.js"></script>
<script src="../../blockly_compressed.js"></script>
<script src="../../msg/messages.js"></script>
<script src="preview.js"></script>
<style>
html, body {
background-color: #fff;
......
......@@ -192,15 +192,13 @@ Code.bindClick = function(el, func) {
* Load the Prettify CSS and JavaScript.
*/
Code.importPrettify = function() {
//<link rel="stylesheet" type="text/css" href="../prettify.css">
//<script type="text/javascript" src="../prettify.js"></script>
//<link rel="stylesheet" href="../prettify.css">
//<script src="../prettify.js"></script>
var link = document.createElement('link');
link.setAttribute('rel', 'stylesheet');
link.setAttribute('type', 'text/css');
link.setAttribute('href', '../prettify.css');
document.head.appendChild(link);
var script = document.createElement('script');
script.setAttribute('type', 'text/javascript');
script.setAttribute('src', '../prettify.js');
document.head.appendChild(script);
};
......@@ -496,10 +494,8 @@ Code.discard = function() {
};
// Load the Code demo's language strings.
document.write('<script type="text/javascript" src="msg/' +
Code.LANG + '.js"></script>\n');
document.write('<script src="msg/' + Code.LANG + '.js"></script>\n');
// Load Blockly's language strings.
document.write('<script type="text/javascript" src="../../msg/js/' +
Code.LANG + '.js"></script>\n');
document.write('<script src="../../msg/js/' + Code.LANG + '.js"></script>\n');
window.addEventListener('load', Code.init);
......@@ -4,14 +4,14 @@
<meta charset="utf-8">
<meta name="google" value="notranslate">
<title>Blockly Demo:</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="/storage.js"></script>
<script type="text/javascript" src="../../blockly_compressed.js"></script>
<script type="text/javascript" src="../../blocks_compressed.js"></script>
<script type="text/javascript" src="../../javascript_compressed.js"></script>
<script type="text/javascript" src="../../python_compressed.js"></script>
<script type="text/javascript" src="../../dart_compressed.js"></script>
<script type="text/javascript" src="code.js"></script>
<link rel="stylesheet" href="style.css">
<script src="/storage.js"></script>
<script src="../../blockly_compressed.js"></script>
<script src="../../blocks_compressed.js"></script>
<script src="../../javascript_compressed.js"></script>
<script src="../../python_compressed.js"></script>
<script src="../../dart_compressed.js"></script>
<script src="code.js"></script>
</head>
<body>
<table width="100%" height="100%">
......
......@@ -3,9 +3,9 @@
<head>
<meta charset="utf-8">
<title>Blockly Demo: Fixed Blockly</title>
<script type="text/javascript" src="../../blockly_compressed.js"></script>
<script type="text/javascript" src="../../blocks_compressed.js"></script>
<script type="text/javascript" src="../../msg/js/en.js"></script>
<script src="../../blockly_compressed.js"></script>
<script src="../../blocks_compressed.js"></script>
<script src="../../msg/js/en.js"></script>
<style>
body {
background-color: #fff;
......
......@@ -3,10 +3,10 @@
<head>
<meta charset="utf-8">
<title>Blockly Demo: Generating JavaScript</title>
<script type="text/javascript" src="../../blockly_compressed.js"></script>
<script type="text/javascript" src="../../blocks_compressed.js"></script>
<script type="text/javascript" src="../../javascript_compressed.js"></script>
<script type="text/javascript" src="../../msg/js/en.js"></script>
<script src="../../blockly_compressed.js"></script>
<script src="../../blocks_compressed.js"></script>
<script src="../../javascript_compressed.js"></script>
<script src="../../msg/js/en.js"></script>
<style>
body {
background-color: #fff;
......
......@@ -3,11 +3,11 @@
<head>
<meta charset="utf-8">
<title>Blockly Demo: Graph</title>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="../../blockly_compressed.js"></script>
<script type="text/javascript" src="../../blocks_compressed.js"></script>
<script type="text/javascript" src="../../javascript_compressed.js"></script>
<script type="text/javascript" src="../../msg/js/en.js"></script>
<script src="https://www.google.com/jsapi"></script>
<script src="../../blockly_compressed.js"></script>
<script src="../../blocks_compressed.js"></script>
<script src="../../javascript_compressed.js"></script>
<script src="../../msg/js/en.js"></script>
<style>
body {
background-color: #fff;
......
......@@ -2,9 +2,9 @@
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript" src="../../blockly_compressed.js"></script>
<script type="text/javascript" src="../../blocks_compressed.js"></script>
<script type="text/javascript" src="../../msg/js/en.js"></script>
<script src="../../blockly_compressed.js"></script>
<script src="../../blocks_compressed.js"></script>
<script src="../../msg/js/en.js"></script>
<style>
html, body {
background-color: #fff;
......
......@@ -3,11 +3,11 @@
<head>
<meta charset="utf-8">
<title>Blockly Demo: JS Interpreter</title>
<script type="text/javascript" src="acorn_interpreter.js"></script>
<script type="text/javascript" src="../../blockly_compressed.js"></script>
<script type="text/javascript" src="../../blocks_compressed.js"></script>
<script type="text/javascript" src="../../javascript_compressed.js"></script>
<script type="text/javascript" src="../../msg/js/en.js"></script>
<script src="acorn_interpreter.js"></script>
<script src="../../blockly_compressed.js"></script>
<script src="../../blocks_compressed.js"></script>
<script src="../../javascript_compressed.js"></script>
<script src="../../msg/js/en.js"></script>
<style>
body {
background-color: #fff;
......
......@@ -3,9 +3,9 @@
<head>
<meta charset="utf-8">
<title>Blockly Demo: Maximum Block Limit</title>
<script type="text/javascript" src="../../blockly_compressed.js"></script>
<script type="text/javascript" src="../../blocks_compressed.js"></script>
<script type="text/javascript" src="../../msg/js/en.js"></script>
<script src="../../blockly_compressed.js"></script>
<script src="../../blocks_compressed.js"></script>
<script src="../../msg/js/en.js"></script>
<style>
body {
background-color: #fff;
......
......@@ -4,12 +4,12 @@
<meta charset="utf-8">
<meta name="google" value="notranslate">
<title>Blockly Demo:</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="soy/soyutils.js"></script>
<script type="text/javascript" src="plane.js"></script>
<link rel="stylesheet" href="style.css">
<script src="soy/soyutils.js"></script>
<script src="plane.js"></script>
</head>
<body>
<script type="text/javascript">
<script>
document.write(planepage.start({}, null,
{lang: Plane.LANG,
level: Plane.LEVEL,
......
......@@ -387,8 +387,7 @@ Plane.redraw = function(newRows) {
}
while (newRows > rows1st) {
rows1st++;
var row = document.createElementNS('http://www.w3.org/2000/svg',
'use');
var row = document.createElementNS('http://www.w3.org/2000/svg', 'use');
row.setAttribute('id', 'row1st' + rows1st);
// Row of 4 seats.
row.setAttribute('x', (rows1st - 1) * 20);
......@@ -435,5 +434,4 @@ Plane.redraw = function(newRows) {
window.addEventListener('load', Plane.init);
// Load the user's language pack.
document.write('<script type="text/javascript" src="generated/' +
Plane.LANG + '.js"></script>\n');
document.write('<script src="generated/' + Plane.LANG + '.js"></script>\n');
......@@ -61,7 +61,7 @@
</tr>
</table>
<script type="text/javascript" src="slider.js"></script>
<script src="slider.js"></script>
<svg
id="plane"
xmlns="http://www.w3.org/2000/svg"
......@@ -175,11 +175,11 @@
{msg meaning="Plane.instructions" desc="page text - This text appears below the airplane graphic and above the space for the user to create the formula. The number of rows an the graphic may be changed by the user with a slider. See [http://blockly-share.appspot.com/static/apps/plane/plane.html?lang=en&level=1] for a picture."}Build a formula (below) that calculates the total number of seats on the airplane as the rows are changed (above).{/msg}
</p>
<script type="text/javascript" src="../../blockly_compressed.js"></script>
<script type="text/javascript" src="../../blocks_compressed.js"></script>
<script type="text/javascript" src="../../javascript_compressed.js"></script>
<script type="text/javascript" src="../../msg/js/{$ij.lang}.js"></script>
<script type="text/javascript" src="blocks.js"></script>
<script src="../../blockly_compressed.js"></script>
<script src="../../blocks_compressed.js"></script>
<script src="../../javascript_compressed.js"></script>
<script src="../../msg/js/{$ij.lang}.js"></script>
<script src="blocks.js"></script>
{call .toolbox /}
<div id="blockly"></div>
{/template}
......
......@@ -3,10 +3,10 @@
<head>
<meta charset="utf-8">
<title>Blockly Demo: Realtime Collaboration</title>
<script type="text/javascript" src="../../blockly_compressed.js"></script>
<script type="text/javascript" src="../../blocks_compressed.js"></script>
<script type="text/javascript" src="../../msg/js/en.js"></script>
<script type="text/javascript" src="https://apis.google.com/js/api.js"></script>
<script src="../../blockly_compressed.js"></script>
<script src="../../blocks_compressed.js"></script>
<script src="../../msg/js/en.js"></script>
<script src="https://apis.google.com/js/api.js"></script>
<style>
body {
background-color: #fff;
......
......@@ -4,9 +4,9 @@
<meta charset="utf-8">
<meta name="google" value="notranslate">
<title>Blockly Demo: RTL</title>
<script type="text/javascript" src="../../blockly_compressed.js"></script>
<script type="text/javascript" src="../../blocks_compressed.js"></script>
<script type="text/javascript" src="../../msg/js/ar.js"></script>
<script src="../../blockly_compressed.js"></script>
<script src="../../blocks_compressed.js"></script>
<script src="../../msg/js/ar.js"></script>
<style>
body {
background-color: #fff;
......
......@@ -3,10 +3,10 @@
<head>
<meta charset="utf-8">
<title>Blockly Demo: Cloud Storage</title>
<script type="text/javascript" src="/storage.js"></script>
<script type="text/javascript" src="../../blockly_compressed.js"></script>
<script type="text/javascript" src="../../blocks_compressed.js"></script>
<script type="text/javascript" src="../../msg/js/en.js"></script>
<script src="/storage.js"></script>
<script src="../../blockly_compressed.js"></script>
<script src="../../blocks_compressed.js"></script>
<script src="../../msg/js/en.js"></script>
<style>
body {
background-color: #fff;
......
......@@ -3,9 +3,9 @@
<head>
<meta charset="utf-8">
<title>Blockly Demo: Toolbox</title>
<script type="text/javascript" src="../../blockly_compressed.js"></script>
<script type="text/javascript" src="../../blocks_compressed.js"></script>
<script type="text/javascript" src="../../msg/js/en.js"></script>
<script src="../../blockly_compressed.js"></script>
<script src="../../blocks_compressed.js"></script>
<script src="../../msg/js/en.js"></script>
<style>
body {
background-color: #fff;
......
No preview for this file type
......@@ -3,48 +3,48 @@
<head>
<meta charset="utf-8">
<title>Blockly Generator Tests</title>
<script type="text/javascript" src="../../blockly_uncompressed.js"></script>
<script type="text/javascript" src="../../generators/javascript.js"></script>
<script type="text/javascript" src="unittest_javascript.js"></script>
<script type="text/javascript" src="../../generators/javascript/logic.js"></script>
<script type="text/javascript" src="../../generators/javascript/loops.js"></script>
<script type="text/javascript" src="../../generators/javascript/math.js"></script>
<script type="text/javascript" src="../../generators/javascript/text.js"></script>
<script type="text/javascript" src="../../generators/javascript/lists.js"></script>
<script type="text/javascript" src="../../generators/javascript/colour.js"></script>
<script type="text/javascript" src="../../generators/javascript/variables.js"></script>
<script type="text/javascript" src="../../generators/javascript/procedures.js"></script>
<script type="text/javascript" src="../../generators/python.js"></script>
<script type="text/javascript" src="unittest_python.js"></script>
<script type="text/javascript" src="../../generators/python/logic.js"></script>
<script type="text/javascript" src="../../generators/python/loops.js"></script>
<script type="text/javascript" src="../../generators/python/math.js"></script>
<script type="text/javascript" src="../../generators/python/text.js"></script>
<script type="text/javascript" src="../../generators/python/lists.js"></script>
<script type="text/javascript" src="../../generators/python/colour.js"></script>
<script type="text/javascript" src="../../generators/python/variables.js"></script>
<script type="text/javascript" src="../../generators/python/procedures.js"></script>
<script type="text/javascript" src="../../generators/dart.js"></script>
<script type="text/javascript" src="unittest_dart.js"></script>
<script type="text/javascript" src="../../generators/dart/logic.js"></script>
<script type="text/javascript" src="../../generators/dart/loops.js"></script>
<script type="text/javascript" src="../../generators/dart/math.js"></script>
<script type="text/javascript" src="../../generators/dart/text.js"></script>
<script type="text/javascript" src="../../generators/dart/lists.js"></script>
<script type="text/javascript" src="../../generators/dart/colour.js"></script>
<script type="text/javascript" src="../../generators/dart/variables.js"></script>
<script type="text/javascript" src="../../generators/dart/procedures.js"></script>
<script type="text/javascript" src="unittest.js"></script>
<script type="text/javascript" src="../../msg/messages.js"></script>
<script type="text/javascript" src="../../blocks/logic.js"></script>
<script type="text/javascript" src="../../blocks/loops.js"></script>
<script type="text/javascript" src="../../blocks/math.js"></script>
<script type="text/javascript" src="../../blocks/text.js"></script>
<script type="text/javascript" src="../../blocks/lists.js"></script>
<script type="text/javascript" src="../../blocks/colour.js"></script>
<script type="text/javascript" src="../../blocks/variables.js"></script>
<script type="text/javascript" src="../../blocks/procedures.js"></script>
<script type="text/javascript">
<script src="../../blockly_uncompressed.js"></script>
<script src="../../generators/javascript.js"></script>
<script src="unittest_javascript.js"></script>
<script src="../../generators/javascript/logic.js"></script>
<script src="../../generators/javascript/loops.js"></script>
<script src="../../generators/javascript/math.js"></script>
<script src="../../generators/javascript/text.js"></script>
<script src="../../generators/javascript/lists.js"></script>
<script src="../../generators/javascript/colour.js"></script>
<script src="../../generators/javascript/variables.js"></script>
<script src="../../generators/javascript/procedures.js"></script>
<script src="../../generators/python.js"></script>
<script src="unittest_python.js"></script>
<script src="../../generators/python/logic.js"></script>
<script src="../../generators/python/loops.js"></script>
<script src="../../generators/python/math.js"></script>
<script src="../../generators/python/text.js"></script>
<script src="../../generators/python/lists.js"></script>
<script src="../../generators/python/colour.js"></script>
<script src="../../generators/python/variables.js"></script>
<script src="../../generators/python/procedures.js"></script>
<script src="../../generators/dart.js"></script>
<script src="unittest_dart.js"></script>
<script src="../../generators/dart/logic.js"></script>
<script src="../../generators/dart/loops.js"></script>
<script src="../../generators/dart/math.js"></script>
<script src="../../generators/dart/text.js"></script>
<script src="../../generators/dart/lists.js"></script>
<script src="../../generators/dart/colour.js"></script>
<script src="../../generators/dart/variables.js"></script>
<script src="../../generators/dart/procedures.js"></script>
<script src="unittest.js"></script>
<script src="../../msg/messages.js"></script>
<script src="../../blocks/logic.js"></script>
<script src="../../blocks/loops.js"></script>
<script src="../../blocks/math.js"></script>
<script src="../../blocks/text.js"></script>
<script src="../../blocks/lists.js"></script>
<script src="../../blocks/colour.js"></script>
<script src="../../blocks/variables.js"></script>
<script src="../../blocks/procedures.js"></script>
<script>
'use strict';
function start() {
......
......@@ -3,13 +3,13 @@
<head>
<meta charset="utf-8">
<title>Unit Tests for Blockly</title>
<script type="text/javascript" src="../../blockly_uncompressed.js"></script>
<script type="text/javascript">goog.require('goog.testing.jsunit');</script>
<script src="../../blockly_uncompressed.js"></script>
<script>goog.require('goog.testing.jsunit');</script>
</head>
<body>
<script type="text/javascript" src="blockly_test.js"></script>
<script type="text/javascript" src="generator_test.js"></script>
<script type="text/javascript" src="names_test.js"></script>
<script type="text/javascript" src="xml_test.js"></script>
<script src="blockly_test.js"></script>
<script src="generator_test.js"></script>
<script src="names_test.js"></script>
<script src="xml_test.js"></script>
</body>
</html>
......@@ -3,46 +3,46 @@
<head>
<meta charset="utf-8">
<title>Blockly Playground</title>
<script type="text/javascript" src="../blockly_uncompressed.js"></script>
<script type="text/javascript" src="../generators/javascript.js"></script>
<script type="text/javascript" src="../generators/javascript/logic.js"></script>
<script type="text/javascript" src="../generators/javascript/loops.js"></script>
<script type="text/javascript" src="../generators/javascript/math.js"></script>
<script type="text/javascript" src="../generators/javascript/text.js"></script>
<script type="text/javascript" src="../generators/javascript/lists.js"></script>
<script type="text/javascript" src="../generators/javascript/colour.js"></script>
<script type="text/javascript" src="../generators/javascript/variables.js"></script>
<script type="text/javascript" src="../generators/javascript/procedures.js"></script>
<script type="text/javascript" src="../generators/python.js"></script>
<script type="text/javascript" src="../generators/python/logic.js"></script>
<script type="text/javascript" src="../generators/python/loops.js"></script>
<script type="text/javascript" src="../generators/python/math.js"></script>
<script type="text/javascript" src="../generators/python/text.js"></script>
<script type="text/javascript" src="../generators/python/lists.js"></script>
<script type="text/javascript" src="../generators/python/colour.js"></script>
<script type="text/javascript" src="../generators/python/variables.js"></script>
<script type="text/javascript" src="../generators/python/procedures.js"></script>
<script type="text/javascript" src="../generators/dart.js"></script>
<script type="text/javascript" src="../generators/dart/logic.js"></script>
<script type="text/javascript" src="../generators/dart/loops.js"></script>
<script type="text/javascript" src="../generators/dart/math.js"></script>
<script type="text/javascript" src="../generators/dart/text.js"></script>
<script type="text/javascript" src="../generators/dart/lists.js"></script>
<script type="text/javascript" src="../generators/dart/colour.js"></script>
<script type="text/javascript" src="../generators/dart/variables.js"></script>
<script type="text/javascript" src="../generators/dart/procedures.js"></script>
<script type="text/javascript" src="../msg/messages.js"></script>
<script type="text/javascript" src="../blocks/logic.js"></script>
<script type="text/javascript" src="../blocks/loops.js"></script>
<script type="text/javascript" src="../blocks/math.js"></script>
<script type="text/javascript" src="../blocks/text.js"></script>
<script type="text/javascript" src="../blocks/lists.js"></script>
<script type="text/javascript" src="../blocks/colour.js"></script>
<script type="text/javascript" src="../blocks/variables.js"></script>
<script type="text/javascript" src="../blocks/procedures.js"></script>
<script src="../blockly_uncompressed.js"></script>
<script src="../generators/javascript.js"></script>
<script src="../generators/javascript/logic.js"></script>
<script src="../generators/javascript/loops.js"></script>
<script src="../generators/javascript/math.js"></script>
<script src="../generators/javascript/text.js"></script>
<script src="../generators/javascript/lists.js"></script>
<script src="../generators/javascript/colour.js"></script>
<script src="../generators/javascript/variables.js"></script>
<script src="../generators/javascript/procedures.js"></script>
<script src="../generators/python.js"></script>
<script src="../generators/python/logic.js"></script>
<script src="../generators/python/loops.js"></script>
<script src="../generators/python/math.js"></script>
<script src="../generators/python/text.js"></script>
<script src="../generators/python/lists.js"></script>
<script src="../generators/python/colour.js"></script>
<script src="../generators/python/variables.js"></script>
<script src="../generators/python/procedures.js"></script>
<script src="../generators/dart.js"></script>
<script src="../generators/dart/logic.js"></script>
<script src="../generators/dart/loops.js"></script>
<script src="../generators/dart/math.js"></script>
<script src="../generators/dart/text.js"></script>
<script src="../generators/dart/lists.js"></script>
<script src="../generators/dart/colour.js"></script>
<script src="../generators/dart/variables.js"></script>
<script src="../generators/dart/procedures.js"></script>
<script src="../msg/messages.js"></script>
<script src="../blocks/logic.js"></script>
<script src="../blocks/loops.js"></script>
<script src="../blocks/math.js"></script>
<script src="../blocks/text.js"></script>
<script src="../blocks/lists.js"></script>
<script src="../blocks/colour.js"></script>
<script src="../blocks/variables.js"></script>
<script src="../blocks/procedures.js"></script>
<!-- Load the Google Drive SDK Realtime libraries. -->
<script type="text/javascript" src="https://apis.google.com/js/api.js"></script>
<script type="text/javascript">
<script src="https://apis.google.com/js/api.js"></script>
<script>
'use strict';
// Depending on the URL argument, render as LTR or RTL.
var rtl = (document.location.search == '?rtl');
......@@ -362,7 +362,7 @@ h1 {
<p><a href="javascript:void([document.getElementById('blocklyDiv').style.display = 'block', Blockly.mainWorkspace.render()])">Show</a>
- <a href="javascript:void(document.getElementById('blocklyDiv').style.display = 'none')">Hide</a></p>
<script type="text/javascript">
<script>
if (rtl) {
document.write('[ &larr; RTL. Switch to <A HREF="?ltr">LTR</A>. ]');
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment