Commit Graph

79 Commits

Author SHA1 Message Date
Tom
a6245f4c6e Compile messages with externs and demo with advanced optimizations (#1259)
* Revert "Fix synonyms when compiled. (#1248)"

This reverts commit f08afbb351.

* Revert "Compatibility for Closure Compiler. (#1240)" [fc8d4c9]

* Adding exports to all messages.

* Fixed missing dependency to Blockly.defineBlocksWithJsonArray()

* Adding a fully compiled demo draft (still simple optimizations).

* Demo optimizations switched to advanced and enabled exports (for Blockly.Msg).

* Message interpolation updated to use the exported (global) Blockly.Msg array.

* Adding some debug compilation options to the build script.

* Adding SVG externs.

* Fixed Blockly.inject's config array to work with compilation.

* Reverting all compiled code.

This fixes commit b307ba1151.
This fixes commit dec6910b67.

* Reverting all compiled code.

This fixes commit 824c806ec3.

* Removing old todo

* Merge commit 'fe96bec765f0eb58c5321101965100c2716760ed' into compile-messages-with-externs

* commit 'fe96bec765f0eb58c5321101965100c2716760ed':
  Fixes positional index for Czech translation (#1264)
  Missed one use of string instead of .property in extensions.js (#1262)
  Update extensions.js to be compatible with ADVANCED_OPTIMIZATIONS (#1253)
  Fix type tags and todo placement.
  Procedure block renames variable in mutator if there is a case change.

* Fixes based on review by @NeilFraser
- 80 cols
- using goog.global instead of window
- @export on the same line as messages

* BF: Moving the msg dependency earlier, since Blockly.Msg.en is filling the Blockly.Msg object, which is empty without Blockly.Msg.en (and the rest of the code is using it as Blockly.Msg).

* Updating some texts in the demo's html file to be more descriptive.

* Commenting the debug options in the build, to maximize the optimizations. They are not removed, to allow anybody to turn them on if needed (since they are not documented on the Closure Compiler's REST API pages).

* BF: fixed blocks_compressed.js compilation, as it now requires Blockly namespace to exist.

* SVG externs file updated based on the one in https://github.com/google/closure-compiler/blob/master/contrib/externs/svg.js (eliminating 2 warnings)
2017-08-08 11:16:49 -07:00
Neil Fraser
fc8d4c90b4 Compatibility for Closure Compiler. (#1240) 2017-07-31 09:07:41 -07:00
Rachel Fenichel
92f3880008 RemoveAttribute doesn't work on SVG elements in IE 10. Use setAttribute to null instead. 2017-03-27 17:25:41 -07:00
Andrew n marshall
b32136d81f Clarification update.
Unraveling nested ternaries in Blockly.utils.tokenizeInterpolation_()
2017-02-14 15:51:24 -08:00
Andrew n marshall
afd1fdeb15 .utils.replaceMessageReferences(..) now gracefully returns non-string arguments. 2017-02-14 11:00:34 -08:00
Andrew n marshall
6b692a0802 Initial text block, with a mixin to generate quote image fields. (#923)
Text block now uses the extension "text_quotes", supported by Blockly.Constants.Text.QUOTE_IMAGE_MIXIN.quoteField_(fieldName), so that each platform can use the best platform appropriate image (size, density, etc.) for the quotes.
2017-02-13 15:00:02 -08:00
Rachel Fenichel
4152542c2f Fix some lint errors 2017-02-03 14:01:18 -08:00
Andrew n marshall
e95991cba8 Adding @namespace annotations for JSDoc. (#900) 2017-02-01 09:10:35 -08:00
Tim Dawborn
39731c6ddc Change CSS transforms to work with older browsers (#879)
* Change the setting of the CSS transform properties on SVG nodes to set both the unprefixed version and the `-webkit-` prefixed version so that Blockly correctly renders in order browsers, such as Safari < 9 and iOS Safari < 9.2. For discussion of this issue, see https://groups.google.com/forum/#!topic/blockly/o3pERaRQhSg

* Correct the separation between the CSS transform property and the rest of the CSS that was in the variable misleadingly called "transform".
2017-01-27 09:19:58 -08:00
Andrew n marshall
624afeee94 Blockly.Extensions.buildTooltipForDropdown(..): Deferred validation. (#870)
Defer tooltip message string check until after load, when all Blockly.Msg should be loaded.
Avoids validation in headless mode, due to lack of document.readyState.
2017-01-26 15:12:32 -08:00
Andrew n marshall
7b0275cd70 Porting math.js blocks to JSON (#846)
Moving all `math.js` definitions into a single JSON array, complete with i18n syntax for all messages, dropdowns, and tooltips.

Adding Blockly.Extensions.buildTooltipForDropdown(..) to facilitate the creation and error-checking of tooltips that update based on the value of a dropdown.

Now warn on raw string in JSON 'extensions'.
2017-01-23 10:23:55 -08:00
Andrew n marshall
ac3df2759c PR #818: Adding support for string table lookups in dropdown field labels
Adding support for string table lookups in dropdown field labels specified in JSON.

Adds Blockly.utils.replaceMessageReferences() method to handle string replacement without interpolation tokens.  Effectively uses the same old code, now moved into tokenizeInterpolation_(), which takes a parseInterpolationTokens option.

Replaces the direct JavaScript references (not pure JSON, and thus not portable).

Demonstrating this behavior in the logic_boolean dropdown.
2017-01-11 15:47:56 -08:00
picklesrus
6aee3ed2da Fixes #786 by checking if getComputedStyle is null in is3dSupported. We do not cache the value in this case and try again later. is3dSupported is only called while users are interacting with blockly which they cannot do while hidden so the performance implications of running the check again are minimal. (#787) 2016-12-16 09:52:19 -08:00
picklesrus
e1cd21842a Add a workspace drag surface that blocks and bubble get moved to duri… (#778)
* Add a workspace drag surface that blocks and bubble get moved to during a workspace drag.
The surface is translated using translate3d instead of svg's translate attribute so that
the browser does not have to repaint the entire workspace on every mouse move.
This is very similar to the block drag surface.

* Address code review comments

* add back hasClass_ utility removed in #748 and stop using contains since it is not supported in IE
2016-12-15 11:02:49 -08:00
picklesrus
a82bd49d7e Split the scrollbar and flyout out into their own SVG elements. They (#771)
* Split the scrollbar and flyout out into their own SVG elements. They
are siblings of the workpsace SVG.  This paves the way to make performance
improvements to workspace dragging.
2016-12-09 16:19:19 -08:00
Neil Fraser
c27841f8df Fix compiler errors. 2016-11-15 16:41:11 -08:00
Andrew n marshall
e5d25bb686 String reference in JSON string messages (#741)
* Adds message references to message string interpolation, in the form of %{BKY_STRING}.
 * Re-adding CONTROLS_IFELSE block using the new syntax, referencing to CONTROL_IF equivalents.
2016-11-15 15:51:51 -08:00
Neil Fraser
f6aef459fc API-breaking cleanup. But doubtful anyone will be affected. (#748)
* Make add/removeClass return whether they did anything.
* Move more functions onto utils.
* Move bind functions to Blockly.
* Routine recompile.
2016-11-15 13:54:33 -08:00
picklesrus
7f02c19bfe Improve performance of block dragging. This is a backport of the blo… (#732)
Improve performance of block dragging.  This is a backport of the block drag surface from scratch-blocks.  At the beginning of a block drag, blocks get moved to a drag surface which then translates using translate3d to avoid repainting the entire svg on every mouse move.  At the end of the drag, the blocks are dropped back in the svg in their new position.
2016-11-15 13:19:49 -08:00
Neil Fraser
32713726dc Don't split dropdown text if there is an image. 2016-11-11 04:27:54 -08:00
Neil Fraser
5b033e2f7b Misc cleanup. 2016-11-05 00:15:39 -07:00
Neil Fraser
415c6ed65e Add $ back into the ID soup. Issue #251. 2016-10-06 18:52:25 -07:00
Rachel Fenichel
63410dd719 rebuild 2016-09-23 13:49:15 -07:00
Rachel Fenichel
ed983333eb bindEventWithChecks_ for internal use, and bindEvent_ with old behaviour but deprecated 2016-09-23 13:46:11 -07:00
Rachel Fenichel
7d435bdb99 Review cleanup 2016-09-21 13:44:55 -07:00
Rachel Fenichel
109e4bb352 Move code to touch.js 2016-09-07 17:42:09 -07:00
Rachel Fenichel
717bb1e660 Use different touch event constructor 2016-09-07 15:57:05 -07:00
Rachel Fenichel
c373d6d091 Make context menus work again; fix dragging from the toolbox with variables. 2016-09-07 15:49:20 -07:00
Rachel Fenichel
2774cc1663 Fix longpress in flyout; leave debug messages in 2016-09-01 13:08:59 -07:00
Rachel Fenichel
1c025672b3 Clear touch identifier at the ends of more drags. Includes flyout background, right-clicks on blocks, and loading sounds. 2016-08-31 15:56:37 -07:00
Rachel Fenichel
b77c080678 Fix bugs with missing mouseUp events on mutators. Also stop filtering out key presses. 2016-08-25 15:18:53 -07:00
Rachel Fenichel
7a7932acc7 No longer drops mouseUps; fixed lint per neil's comments 2016-08-18 14:46:28 -07:00
Rachel Fenichel
e8ebc5441f Handle each changed touch as a separate touch event 2016-07-21 14:07:03 -07:00
Rachel Fenichel
6b7965a727 Ignore everything but the first touch stream 2016-07-20 17:03:24 -07:00
Neil Fraser
98617d8ddc Move tokenizeIntepolation into Blockly.utils namespace. 2016-06-22 13:01:37 -07:00
Rachel Fenichel
42f620daa2 Check if matrix is null in mouseToSvg 2016-06-21 15:56:00 -07:00
Rachel Fenichel
c4cad3c6e4 Cache screen CTM for performance improvement. 2016-06-17 14:26:04 -07:00
Neil Fraser
3012d52808 Line wrap comments in generated code. 2016-06-08 00:12:58 -07:00
Rachel Fenichel
32eed0d2f8 Merge branch 'develop' into cleanup/lint 2016-05-10 14:43:09 -07:00
Rachel Fenichel
3605dfb9c0 Undo decimation of variable redeclarations 2016-05-10 14:40:48 -07:00
Rachel Fenichel
640b38f38e lint 2016-05-05 13:13:48 -07:00
Katelyn Mann
ca16d1fefe An alternate (and less expensive) way to keep stuff outside of the blockly div
from getting selected. Use e.preventDefault instead of adding and removing
classes on mousedown and mouseup.  This keeps the browser from having to
potentially recacluate style on mousedown and mouseup events.
2016-05-04 19:12:38 -07:00
Neil Fraser
217c681b86 Use direct call to svg resize rather than event. Also fix issue #296. 2016-05-04 15:00:57 -07:00
Katelyn Mann
b11bd4fb71 Remove Blockly.removeAllRanges and replace it with calls to add/remove
css to mark text as unselectable instead.  I can't prove this is
significantly faster with numbers since the call to setup the time out
costs ~.1ms and the call when the timer fires is ~.05.  This happens on almost
every mouse event though.  Plus, it seems to remove a flicker of highlighting when
frames are skipped and keeps scrolling via the scrollbar from highlighting.
2016-03-28 10:06:43 -07:00
Neil Fraser
39fbd24659 Remove setProcedureParameters from API (use domToMutation instead). 2016-03-22 10:48:13 -07:00
Neil Fraser
aeabf0ec6f Fix issue 251, $ in ID. 2016-02-16 22:16:36 -08:00
Neil Fraser
5297344a8b Fix RTL XML. 2016-02-16 13:04:47 -08:00
Neil Fraser
4b0ed0d372 Add custom event file. 2016-01-12 16:47:18 -08:00
Neil Fraser
3bce368115 Simplify workspace options by removing svg property. 2016-01-07 17:01:01 -08:00
Neil Fraser
e5dfdf4658 Improve randomness of UUIDs. 2015-11-24 19:16:01 -08:00