2016-01-27 14:12:37 -05:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Visual Blocks Editor
|
|
|
|
*
|
|
|
|
* Copyright 2016 MIT
|
|
|
|
* https://github.com/lkjashdflkjahsdf
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @fileoverview Control blocks for Scratch (Horizontal)
|
|
|
|
* @author ascii@media.mit.edu <Andrew Sliwinski>
|
|
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
goog.provide('Blockly.Blocks.event');
|
|
|
|
|
|
|
|
goog.require('Blockly.Blocks');
|
|
|
|
|
2016-03-01 13:52:19 -05:00
|
|
|
goog.require('Blockly.Colours');
|
|
|
|
|
2016-01-27 14:12:37 -05:00
|
|
|
Blockly.Blocks['event_whenflagclicked'] = {
|
|
|
|
/**
|
|
|
|
* Block for repeat n times (external number).
|
|
|
|
* @this Blockly.Block
|
|
|
|
*/
|
|
|
|
init: function() {
|
|
|
|
this.jsonInit({
|
|
|
|
"id": "event_whenflagclicked",
|
|
|
|
"message0": "%1",
|
|
|
|
"args0": [
|
|
|
|
{
|
|
|
|
"type": "field_image",
|
2016-02-18 18:28:34 -05:00
|
|
|
"src": Blockly.mainWorkspace.options.pathToMedia + "icons/event_whenflagclicked.svg",
|
2016-01-28 20:30:35 -05:00
|
|
|
"width": 40,
|
|
|
|
"height": 40,
|
2016-03-03 17:32:35 -05:00
|
|
|
"alt": "flag",
|
|
|
|
"flip_rtl": true
|
2016-01-27 14:12:37 -05:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"inputsInline": true,
|
|
|
|
"nextStatement": null,
|
2016-03-01 13:52:19 -05:00
|
|
|
"colour": Blockly.Colours.event.primary,
|
2016-03-01 13:55:56 -05:00
|
|
|
"colourSecondary": Blockly.Colours.event.secondary,
|
|
|
|
"colourTertiary": Blockly.Colours.event.tertiary,
|
2016-01-27 14:12:37 -05:00
|
|
|
"tooltip": "Do stuff!"
|
|
|
|
});
|
|
|
|
|
|
|
|
this.setHelpUrl(function () {
|
|
|
|
return 'halp me plz. k thx bye.';
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|