-
{{'WORKSPACE'|translate}}
+blocklyApp.WorkspaceComponent = ng.core.Component({
+ selector: 'blockly-workspace',
+ template: `
+
+
{{'WORKSPACE'|translate}}
-
-
-
-
-
+
+
+
+
+
-
- Workspace is empty.
-
-
+
+ Workspace is empty.
+
+
-
+ `,
+ directives: [blocklyApp.WorkspaceTreeComponent],
+ pipes: [blocklyApp.TranslatePipe]
+})
+.Class({
+ constructor: [
+ blocklyApp.NotificationsService, blocklyApp.TreeService,
+ blocklyApp.UtilsService, blocklyApp.ModalService,
+ function(
+ _notificationsService, _treeService, _utilsService, _modalService) {
// ACCESSIBLE_GLOBALS is a global variable defined by the containing
// page. It should contain a key, toolbarButtonConfig, whose
// corresponding value is an Array with two keys: 'text' and 'action'.
- // The first is the text to display on the button, and the second is the
- // function that gets run when the button is clicked.
+ // The first is the text to display on the button, and the second is
+ // the function that gets run when the button is clicked.
this.toolbarButtonConfig =
ACCESSIBLE_GLOBALS && ACCESSIBLE_GLOBALS.toolbarButtonConfig ?
ACCESSIBLE_GLOBALS.toolbarButtonConfig : [];
@@ -84,28 +84,33 @@ blocklyApp.WorkspaceComponent = ng.core
this.notificationsService = _notificationsService;
this.treeService = _treeService;
this.utilsService = _utilsService;
- }],
- clearWorkspace: function() {
- this.workspace.clear();
- },
- getActiveDescId: function(treeId) {
- return this.treeService.getActiveDescId(treeId);
- },
- handleButtonClick: function(buttonConfig) {
- buttonConfig.action();
- if (buttonConfig.onClickNotification) {
- this.notificationsService.setStatusMessage(
- buttonConfig.onClickNotification);
- }
- },
- onWorkspaceToolbarKeypress: function(e) {
- this.treeService.onWorkspaceToolbarKeypress(
- e, document.activeElement.id);
- },
- onKeypress: function(e, tree) {
- this.treeService.onKeypress(e, tree);
- },
- isWorkspaceEmpty: function() {
- return this.utilsService.isWorkspaceEmpty();
+ this.modalService = _modalService;
}
- });
+ ],
+ isModalShown: function() {
+ return this.modalService.isModalShown();
+ },
+ clearWorkspace: function() {
+ this.workspace.clear();
+ },
+ getActiveDescId: function(treeId) {
+ return this.treeService.getActiveDescId(treeId);
+ },
+ handleButtonClick: function(buttonConfig) {
+ buttonConfig.action();
+ if (buttonConfig.onClickNotification) {
+ this.notificationsService.setStatusMessage(
+ buttonConfig.onClickNotification);
+ }
+ },
+ onWorkspaceToolbarKeypress: function(e) {
+ this.treeService.onWorkspaceToolbarKeypress(
+ e, document.activeElement.id);
+ },
+ onKeypress: function(e, tree) {
+ this.treeService.onKeypress(e, tree);
+ },
+ isWorkspaceEmpty: function() {
+ return this.utilsService.isWorkspaceEmpty();
+ }
+});
diff --git a/demos/accessible/index.html b/demos/accessible/index.html
index d892ce463..3e35d4451 100644
--- a/demos/accessible/index.html
+++ b/demos/accessible/index.html
@@ -20,12 +20,15 @@
+
+
+