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 000000000..449981f95 Binary files /dev/null and b/demos/accessible/icon.png differ diff --git a/demos/accessible/index.html b/demos/accessible/index.html index 135b4c10e..f1727be3a 100644 --- a/demos/accessible/index.html +++ b/demos/accessible/index.html @@ -1,341 +1,326 @@
- -This is a simple demo of a version of Blockly designed for screen readers.
+ +