# Conflicts:
#	blocks_vertical/default_toolbox.js
#	blocks_vertical/sound.js
This commit is contained in:
Eric Rosenbaum 2017-01-04 15:40:32 -05:00
commit 9f114aa92c
16 changed files with 129 additions and 67 deletions

View file

@ -10,4 +10,5 @@
/appengine/*
/shim/*
/dist/*
/gh-pages/*
/webpack.config.js

4
.gitignore vendored
View file

@ -30,3 +30,7 @@ python_compressed.js
/blocks_compressed_horizontal.js
/blocks_compressed_vertical.js
/blocks_compressed.js
/gh-pages/playgrounds
/gh-pages/Gemfile.lock
/gh-pages/closure-library
/gh-pages/_site

View file

@ -28,4 +28,8 @@ after_script:
# Set version to timestamp
npm --no-git-tag-version version $($(npm bin)/json -f package.json version)-prerelease.$(date +%s)
npm publish
# Publish to gh-pages as most recent committer
git config --global user.email $(git log --pretty=format:"%ae" -n1)
git config --global user.name $(git log --pretty=format:"%an" -n1)
npm run --silent deploy -- -x -r https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
fi

View file

@ -256,11 +256,9 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
'</block>'+
'<block type="sound_stopallsounds"></block>'+
'<block type="sound_playdrumforbeats">'+
'<value name="DRUMTYPE">'+
'<shadow type="math_number">'+
'<field name="NUM">1</field>'+
'</shadow>'+
'</value>'+
'<value name="DRUM">' +
'<shadow type="sound_drums_menu"></shadow>' +
'</value>' +
'<value name="BEATS">'+
'<shadow type="math_number">'+
'<field name="NUM">0.25</field>'+
@ -287,11 +285,9 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
'</value>'+
'</block>'+
'<block type="sound_setinstrumentto">'+
'<value name="INSTRUMENT">'+
'<shadow type="math_number">'+
'<field name="NUM">1</field>'+
'</shadow>'+
'</value>'+
'<value name="INSTRUMENT">' +
'<shadow type="sound_instruments_menu"></shadow>' +
'</value>' +
'</block>'+
'<block type="sound_seteffectto">' +
'<value name="EFFECT">' +

View file

@ -29,7 +29,7 @@ goog.require('Blockly.constants');
Blockly.Blocks['sound_sounds_menu'] = {
/**
* Sounds drop-down menu.
* Sound effects drop-down menu.
* @this Blockly.Block
*/
init: function() {
@ -131,9 +131,9 @@ Blockly.Blocks['sound_stopallsounds'] = {
}
};
Blockly.Blocks['sound_beats_menu'] = {
Blockly.Blocks['sound_drums_menu'] = {
/**
* Sound beats drop-down menu.
* Drums drop-down menu.
* @this Blockly.Block
*/
init: function() {
@ -143,14 +143,26 @@ Blockly.Blocks['sound_beats_menu'] = {
"args0": [
{
"type": "field_dropdown",
"name": "BEATS",
"name": "DRUM",
"options": [
['1/8', '0.125'],
['1/4', '0.25'],
['1/2', '0.5'],
['1', '1'],
['2', '2'],
['4', '4']
['(1) Snare Drum', '1'],
['(2) Bass Drum', '2'],
['(3) Side Stick', '3'],
['(4) Crash Cymbal', '4'],
['(5) Open Hi-Hat', '5'],
['(6) Closed Hi-Hat', '6'],
['(7) Tambourine', '7'],
['(8) Hand Clap', '8'],
['(9) Claves', '9'],
['(10) Wood Block', '10'],
['(11) Cowbell', '11'],
['(12) Triangle', '12'],
['(13) Bongo', '13'],
['(14) Conga', '14'],
['(15) Cabasa', '15'],
['(16) Guiro', '16'],
['(17) Vibraslap', '17'],
['(18) Open Cuica', '18']
]
}
],
@ -164,33 +176,9 @@ Blockly.Blocks['sound_beats_menu'] = {
}
};
Blockly.Blocks['sound_playdrum'] = {
/**
* Block to play a certain drum
* @this Blockly.Block
*/
init: function() {
this.jsonInit({
"message0": "play drum %1",
"args0": [
{
"type": "input_value",
"name": "DRUMTYPE"
}
],
"previousStatement": null,
"nextStatement": null,
"colour": Blockly.Colours.sounds.primary,
"colourSecondary": Blockly.Colours.sounds.secondary,
"colourTertiary": Blockly.Colours.sounds.tertiary
});
}
};
Blockly.Blocks['sound_playdrumforbeats'] = {
/**
* Block to play a certain drum for certain beats
* Block to play a drum for some number of beats
* @this Blockly.Block
*/
init: function() {
@ -199,7 +187,7 @@ Blockly.Blocks['sound_playdrumforbeats'] = {
"args0": [
{
"type": "input_value",
"name": "DRUMTYPE"
"name": "DRUM"
},
{
"type": "input_value",
@ -218,7 +206,7 @@ Blockly.Blocks['sound_playdrumforbeats'] = {
Blockly.Blocks['sound_restforbeats'] = {
/**
* Block to rest for certain beats
* Block to rest for some number of beats
* @this Blockly.Block
*/
init: function() {
@ -242,7 +230,7 @@ Blockly.Blocks['sound_restforbeats'] = {
Blockly.Blocks['sound_playnoteforbeats'] = {
/**
* Block to play a certain note for certain beats
* Block to play a certain note for some number of beats
* @this Blockly.Block
*/
init: function() {
@ -286,9 +274,8 @@ Blockly.Blocks['sound_effects_menu'] = {
['pan left/right', 'PAN'],
['echo', 'ECHO'],
['reverb', 'REVERB'],
['fuzz', 'FUZZ'],
['wobble', 'WOBBLE'],
['robotic', 'ROBOTIC']
['fuzz', 'DISTORTION'],
['robot', 'ROBOTIC']
]
}
],
@ -424,7 +411,7 @@ Blockly.Blocks['sound_instruments_menu'] = {
Blockly.Blocks['sound_setinstrumentto'] = {
/**
* Block to set the sprite's instrument to a certain value
* Block to set the sprite's instrument
* @this Blockly.Block
*/
init: function() {

View file

@ -622,10 +622,12 @@ Blockly.Block.prototype.setInsertionMarker = function(insertionMarker) {
return; // No change.
}
this.isInsertionMarker_ = insertionMarker;
// TODO: handle removing insertion marker status.
if (this.isInsertionMarker_) {
this.setColour(Blockly.Colours.insertionMarker);
this.setOpacity(Blockly.Colours.insertionMarkerOpacity);
this.svgGroup_.classList.add('blocklyInsertionMarker');
Blockly.addClass_(/** @type {!Element} */ (this.svgGroup_),
'blocklyInsertionMarker');
}
};

View file

@ -336,10 +336,12 @@ Blockly.BlockSvg.prototype.updateColour = function() {
Blockly.BlockSvg.prototype.highlightForReplacement = function(add) {
if (add) {
this.svgPath_.setAttribute('filter', 'url(#blocklyReplacementGlowFilter)');
this.svgGroup_.classList.add('blocklyReplaceable');
Blockly.addClass_(/** @type {!Element} */ (this.svgGroup_),
'blocklyReplaceable');
} else {
this.svgPath_.removeAttribute('filter');
this.svgGroup_.classList.remove('blocklyReplaceable');
Blockly.removeClass_(/** @type {!Element} */ (this.svgGroup_),
'blocklyReplaceable');
}
};
@ -614,7 +616,7 @@ Blockly.BlockSvg.prototype.renderDraw_ = function(metrics) {
*/
Blockly.BlockSvg.prototype.renderClassify_ = function(metrics) {
var shapes = [];
if (this.isShadow_) {
shapes.push('argument');
} else {
@ -630,9 +632,9 @@ Blockly.BlockSvg.prototype.renderClassify_ = function(metrics) {
shapes.push('end');
}
}
this.svgGroup_.setAttribute('data-shapes', shapes.join(' '));
if (this.getCategory()) {
this.svgGroup_.setAttribute('data-category', this.getCategory());
}

View file

@ -510,10 +510,12 @@ Blockly.BlockSvg.prototype.updateColour = function() {
Blockly.BlockSvg.prototype.highlightForReplacement = function(add) {
if (add) {
this.svgPath_.setAttribute('filter', 'url(#blocklyReplacementGlowFilter)');
this.svgGroup_.classList.add('blocklyReplaceable');
Blockly.addClass_(/** @type {!Element} */ (this.svgGroup_),
'blocklyReplaceable');
} else {
this.svgPath_.removeAttribute('filter');
this.svgGroup_.classList.remove('blocklyReplaceable');
Blockly.removeClass_(/** @type {!Element} */ (this.svgGroup_),
'blocklyReplaceable');
}
};
@ -531,10 +533,12 @@ Blockly.BlockSvg.prototype.highlightShapeForInput = function(conn, add) {
var inputShape = this.inputShapes_[input.name];
if (add) {
inputShape.setAttribute('filter', 'url(#blocklyReplacementGlowFilter)');
inputShape.classList.add('blocklyReplaceable');
Blockly.addClass_(/** @type {!Element} */ (this.svgGroup_),
'blocklyReplaceable');
} else {
inputShape.removeAttribute('filter');
inputShape.classList.remove('blocklyReplaceable');
Blockly.removeClass_(/** @type {!Element} */ (this.svgGroup_),
'blocklyReplaceable');
}
};

View file

@ -114,7 +114,7 @@ Blockly.createDom_ = function(container, options) {
// Set all gaussian blur pixels to 1 opacity before applying flood
var componentTransfer = Blockly.createSvgElement('feComponentTransfer', {'result': 'outBlur'}, stackGlowFilter);
Blockly.createSvgElement('feFuncA',
{'type': 'table', 'tableValues': '0' + ' 1'.repeat(16)}, componentTransfer);
{'type': 'table', 'tableValues': '0' + goog.string.repeat(' 1', 16)}, componentTransfer);
// Color the highlight
Blockly.createSvgElement('feFlood',
{'flood-color': Blockly.Colours.stackGlow,
@ -135,7 +135,7 @@ Blockly.createDom_ = function(container, options) {
// Set all gaussian blur pixels to 1 opacity before applying flood
var componentTransfer = Blockly.createSvgElement('feComponentTransfer', {'result': 'outBlur'}, replacementGlowFilter);
Blockly.createSvgElement('feFuncA',
{'type': 'table', 'tableValues': '0' + ' 1'.repeat(16)}, componentTransfer);
{'type': 'table', 'tableValues': '0' + goog.string.repeat(' 1', 16)}, componentTransfer);
// Color the highlight
Blockly.createSvgElement('feFlood',
{'flood-color': Blockly.Colours.replacementGlow,

15
gh-pages/Gemfile Normal file
View file

@ -0,0 +1,15 @@
source "https://rubygems.org"
ruby RUBY_VERSION
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "jekyll-theme-architect"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
gem "github-pages", group: :jekyll_plugins

2
gh-pages/_config.yml Normal file
View file

@ -0,0 +1,2 @@
theme: jekyll-theme-architect
show_downloads: false

2
gh-pages/index.md Normal file
View file

@ -0,0 +1,2 @@
* [Vertical Playground](playgrounds/tests/vertical_playground.html)
* [Horizontal Playground](playgrounds/tests/horizontal_playground.html)

View file

@ -40,6 +40,7 @@ Blockly.Msg.CONTROLS_FOREACH_TOOLTIP = "For each item in a list, set the variabl
Blockly.Msg.CONTROLS_FOR_HELPURL = "https://github.com/google/blockly/wiki/Loops#count-with";
Blockly.Msg.CONTROLS_FOR_TITLE = "count with %1 from %2 to %3 by %4";
Blockly.Msg.CONTROLS_FOR_TOOLTIP = "Have the variable '%1' take on the values from the start number to the end number, counting by the specified interval, and do the specified blocks.";
Blockly.Msg.CONTROLS_IFELSE_TITLE = "if %1 do %2 else %3";
Blockly.Msg.CONTROLS_IF_ELSEIF_TOOLTIP = "Add a condition to the if block.";
Blockly.Msg.CONTROLS_IF_ELSE_TOOLTIP = "Add a final, catch-all condition to the if block.";
Blockly.Msg.CONTROLS_IF_HELPURL = "https://github.com/google/blockly/wiki/IfElse";

View file

@ -1,7 +1,7 @@
{
"@metadata": {
"author": "Ellen Spertus <ellen.spertus@gmail.com>",
"lastupdated": "2016-10-17 17:31:08.256258",
"lastupdated": "2017-01-02 12:17:41.695529",
"locale": "en",
"messagedocumentation" : "qqq"
},
@ -82,6 +82,7 @@
"CONTROLS_IF_IF_TOOLTIP": "Add, remove, or reorder sections to reconfigure this if block.",
"CONTROLS_IF_ELSEIF_TOOLTIP": "Add a condition to the if block.",
"CONTROLS_IF_ELSE_TOOLTIP": "Add a final, catch-all condition to the if block.",
"CONTROLS_IFELSE_TITLE": "if %1 do %2 else %3",
"LOGIC_COMPARE_HELPURL": "https://en.wikipedia.org/wiki/Inequality_(mathematics)",
"LOGIC_COMPARE_TOOLTIP_EQ": "Return true if both inputs equal each other.",
"LOGIC_COMPARE_TOOLTIP_NEQ": "Return true if both inputs are not equal to each other.",

View file

@ -11,13 +11,16 @@
},
"main": "./dist/vertical.js",
"scripts": {
"deploy": "gh-pages -t -d gh-pages -m \"Build for $(git log --pretty=format:%H -n1)\"",
"prepublish": "python build.py && webpack",
"test": "eslint .",
"version": "json -f package.json -I -e \"this.repository.sha = '$(git log -n1 --pretty=format:%H)'\""
},
"devDependencies": {
"copy-webpack-plugin": "4.0.1",
"eslint": "2.9.0",
"exports-loader": "0.6.3",
"gh-pages": "0.12.0",
"google-closure-library": "20160911.0.0",
"imports-loader": "0.6.5",
"json": "9.0.4",

View file

@ -1,5 +1,7 @@
var CopyWebpackPlugin = require('copy-webpack-plugin');
var path = require('path');
module.exports = {
module.exports = [{
entry: {
horizontal: './shim/horizontal.js',
vertical: './shim/vertical.js'
@ -10,4 +12,40 @@ module.exports = {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js'
}
};
}, {
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'gh-pages')
},
plugins: [
new CopyWebpackPlugin([{
from: 'node_modules/google-closure-library',
to: 'closure-library'
}, {
from: 'blocks_common',
to: 'playgrounds/blocks_common',
}, {
from: 'blocks_horizontal',
to: 'playgrounds/blocks_horizontal',
}, {
from: 'blocks_vertical',
to: 'playgrounds/blocks_vertical',
}, {
from: 'core',
to: 'playgrounds/core'
}, {
from: 'media',
to: 'playgrounds/media'
}, {
from: 'msg',
to: 'playgrounds/msg'
}, {
from: 'tests',
to: 'playgrounds/tests'
}, {
from: '*.js',
ignore: 'webpack.config.js',
to: 'playgrounds'
}])
]
}];