From 763e9b938f2642946511996016c90c87d75b67c7 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Mon, 23 May 2016 17:34:46 -0700 Subject: [PATCH] Cleanup accessible Blockly. --- accessible/README | 4 +- accessible/messages.js | 68 ++++ demos/accessible/boot.js | 27 -- demos/accessible/icon.png | Bin 0 -> 939 bytes demos/accessible/index.html | 633 ++++++++++++++++++------------------ demos/index.html | 36 +- msg/messages.js | 42 --- package.json | 2 +- 8 files changed, 404 insertions(+), 408 deletions(-) create mode 100644 accessible/messages.js delete mode 100644 demos/accessible/boot.js create mode 100644 demos/accessible/icon.png diff --git a/accessible/README b/accessible/README index 88f2d4dc9..ab6003f89 100644 --- a/accessible/README +++ b/accessible/README @@ -14,6 +14,6 @@ Use Accessible Blockly in Your Web App ----------- 1. see the basic demo under blockly/demos/accessible. This covers the absolute minimum required to import Accessible Blockly into your own web app. 2. You will need to import the files in the same order as in the demo: utils.service.js will need to be the first Angular file imported. -3. You will need a boot.js file. If you aren't creating any extra Angular components, your boot.js file will look identical to that in the demo. If you are creating a different Angular component that should be loaded first, change line 26 accordingly. +3. When the DOMContentLoaded event fires, call ng.platform.browser.bootstrap() on the main component to be loaded. This will usually be blocklyApp.AppView, but if you have another component that wraps it, use that one instead. 4. You will need to implement a runCode() function in the global scope. This function will be called when the user presses the Run Code button in the Accessible Blockly app. -5. Note that we do not support having multiple Accessible Blockly apps in a single webpage. \ No newline at end of file +5. Note that we do not support having multiple Accessible Blockly apps in a single webpage. diff --git a/accessible/messages.js b/accessible/messages.js new file mode 100644 index 000000000..8014beee2 --- /dev/null +++ b/accessible/messages.js @@ -0,0 +1,68 @@ +/** + * @license + * Visual Blocks Language + * + * Copyright 2016 Google Inc. + * https://developers.google.com/blockly/ + * + * 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 Accessible strings. + * @author madeeha@google.com (Madeeha Ghori) + */ +'use strict'; + +// The following are all Accessible Blockly strings. +// None of the alert messages have periods on them. This is because the user +// will have their punctuation setting set to 'all', which will result in any +// punctuation being read out to them. +Blockly.Msg.RUN_CODE = 'Run Code'; +Blockly.Msg.CLEAR_WORKSPACE = 'Clear Workspace'; +Blockly.Msg.BLOCK_ACTION_LIST = 'block action list'; +Blockly.Msg.CUT_BLOCK = 'cut block'; +Blockly.Msg.COPY_BLOCK = 'copy block'; +Blockly.Msg.PASTE_BELOW = 'paste below'; +Blockly.Msg.PASTE_ABOVE = 'paste above'; +Blockly.Msg.MARK_SPOT_BELOW = 'mark spot below'; +Blockly.Msg.MARK_SPOT_ABOVE = 'mark spot above'; +Blockly.Msg.MOVE_TO_MARKED_SPOT = 'move to marked spot'; +Blockly.Msg.DELETE = 'delete'; +Blockly.Msg.MARK_THIS_SPOT = 'mark this spot'; +Blockly.Msg.PASTE = 'paste'; +Blockly.Msg.TOOLBOX_LOAD_MSG = 'Loading Toolbox…'; +Blockly.Msg.WORKSPACE_LOAD_MSG = 'Loading Workspace…'; +Blockly.Msg.BLOCK_SUMMARY = 'block summary'; +Blockly.Msg.OPTION_LIST = 'option list'; +Blockly.Msg.ARGUMENT_OPTIONS_LIST = 'argument options list'; +Blockly.Msg.ARGUMENT_INPUT = 'argument input'; +Blockly.Msg.ARGUMENT_BLOCK_ACTION_LIST = 'argument block action list'; +Blockly.Msg.TEXT = 'text'; +Blockly.Msg.BUTTON = 'button'; +Blockly.Msg.UNAVAILABLE = 'unavailable'; +Blockly.Msg.CURRENT_ARGUMENT_VALUE = 'current argument value:'; +Blockly.Msg.COPY_TO_WORKSPACE = 'copy to workspace'; +Blockly.Msg.COPY_TO_CLIPBOARD = 'copy to clipboard'; +Blockly.Msg.COPY_TO_MARKED_SPOT = 'copy to marked spot'; +Blockly.Msg.TOOLBOX = 'Toolbox'; +Blockly.Msg.WORKSPACE = 'Workspace'; +Blockly.Msg.ANY = 'any'; +Blockly.Msg.STATEMENT = 'statement'; +Blockly.Msg.VALUE = 'value'; +Blockly.Msg.CUT_BLOCK_MSG = 'Cut block: '; +Blockly.Msg.COPIED_BLOCK_MSG = 'Copied block to clipboard: '; +Blockly.Msg.PASTED_BLOCK_FROM_CLIPBOARD_MSG = 'Pasted block from clipboard: '; +Blockly.Msg.PASTED_BLOCK_TO_MARKED_SPOT_MSG = 'Pasted block to marked spot: '; +Blockly.Msg.MARKED_SPOT_MSG = 'Marked spot'; +Blockly.Msg.BLOCK_MOVED_TO_MARKED_SPOT_MSB = 'Block moved to marked spot: '; diff --git a/demos/accessible/boot.js b/demos/accessible/boot.js deleted file mode 100644 index 94c4da7ed..000000000 --- a/demos/accessible/boot.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Blockly Demos: AccessibleBlockly - * - * Copyright 2016 Google Inc. - * https://developers.google.com/blockly/ - * - * 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 Starts up Angular app. - * @author madeeha@google.com (Madeeha Ghori) - */ - -document.addEventListener('DOMContentLoaded', function() { - ng.platform.browser.bootstrap(blocklyApp.AppView); -}); diff --git a/demos/accessible/icon.png b/demos/accessible/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..449981f95958dda94a3a4742c652c8fc6bc6a8f5 GIT binary patch literal 939 zcmV;c162HpP)4Tx02q~HU|_6BEGWof5@2A+%_}K#4|0r*h>TKTzskVQz{mgwiOIzUjsXEa z3^>8JYY?@UbwOs~R)-a^q@)%n1L-Y5T$)@^RKmc(r~_oHmzNZP*dai+NOnk&GmxDD zWb;AQgMhSiVoqjKQDRAIih_GlVx@v}eolT-aY15oDv7Qj0+ggylz?dG{DR7&%=C;B z1xKK7Q-OBo7L=Bx7U?K><|XSfFo41jqT_QQI9wRT&Lo!>l|hYRWHM%8000qPG{qfx z(~$rG00Lr5M??VshmXv^00009a7bBm000XU000XU0RWnu7ytkO2XskIMF-#o7yt$e zF;Wk@0007BNklk273j%xM|pDrdr_0nI?`4E+ z&rJ9>`gs$vu)%_Ze5JViIZ&YgWNavOhEYlpRi5;xh)WS?lARiLd{01p>WA7yE&Wk* zRU$-p!KIu)h+Ze}CPKUp-b(f^ox*)Ab|E%+Ud-C574{;;`JDE7xoK-8?bFhN3s@)V zkQO`fm68@{dGL9Zs8rH=CqDoBW=Y$%DEW8GYDrtQL?zlLX>Ih-9SjD1&&gPO#Q&w6 z+5JC;Y4<+k<9y_&ccf0fku9>$Ie*oSF~%5Uj4{R-V~jDz7-P); - - accessibleBlockly Basic Demo + + Accessible Blockly Demo - - - - - + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - + + +

Blockly > + Demos > Accessible Blockly

+ +

This is a simple demo of a version of Blockly designed for screen readers.

+ + - + -