app.component.js 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. * AccessibleBlockly
  3. *
  4. * Copyright 2016 Google Inc.
  5. * https://developers.google.com/blockly/
  6. *
  7. * Licensed under the Apache License, Version 2.0 (the 'License');
  8. * you may not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an 'AS IS' BASIS,
  15. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. */
  19. /**
  20. * @fileoverview Angular2 Component that details how the AccessibleBlockly
  21. * app is rendered on the page.
  22. * @author madeeha@google.com (Madeeha Ghori)
  23. */
  24. blocklyApp.workspace = new Blockly.Workspace();
  25. blocklyApp.AppView = ng.core
  26. .Component({
  27. selector: 'blockly-app',
  28. template: `
  29. <table>
  30. <tr>
  31. <td class="blocklyTable">
  32. <blockly-toolbox>{{'TOOLBOX_LOAD'|translate}}</blockly-toolbox>
  33. </td>
  34. <td class="blocklyTable">
  35. <blockly-workspace>{{'WORKSPACE_LOAD'|translate}}</blockly-workspace>
  36. </td>
  37. </tr>
  38. </table>
  39. <label aria-hidden="true" hidden id="blockly-argument-block-menu">{{'ARGUMENT_BLOCK_ACTION_LIST'|translate}}</label>
  40. <label aria-hidden="true" hidden id="blockly-argument-input">{{'ARGUMENT_INPUT'|translate}}</label>
  41. <label aria-hidden="true" hidden id="blockly-argument-menu">{{'ARGUMENT_OPTIONS_LIST'|translate}}</label>
  42. <label aria-hidden="true" hidden id="blockly-argument-text">{{'TEXT'|translate}}</label>
  43. <label aria-hidden="true" hidden id="blockly-block-menu">{{'BLOCK_ACTION_LIST'|translate}}</label>
  44. <label aria-hidden="true" hidden id="blockly-block-summary">{{'BLOCK_SUMMARY'|translate}}</label>
  45. <label aria-hidden="true" hidden id="blockly-button">{{'BUTTON'|translate}}</label>
  46. <label aria-hidden="true" hidden id="blockly-disabled">{{'UNAVAILABLE'|translate}}</label>
  47. <label aria-hidden="true" hidden id="blockly-menu">{{'OPTION_LIST'|translate}}</label>
  48. `,
  49. directives: [blocklyApp.ToolboxComponent, blocklyApp.WorkspaceComponent],
  50. pipes: [blocklyApp.TranslatePipe],
  51. // The clipboard, tree and utils services are declared here, so that all
  52. // components in the application use the same instance of the service.
  53. // https://www.sitepoint.com/angular-2-components-providers-classes-factories-values/
  54. providers: [
  55. blocklyApp.ClipboardService, blocklyApp.TreeService,
  56. blocklyApp.UtilsService]
  57. })
  58. .Class({
  59. constructor: [function() {}]
  60. });