diff --git a/src/main/webapp/wise5/authoringTool/authoringToolController.es6 b/src/main/webapp/wise5/authoringTool/authoringToolController.es6
index 4f027362c9..f2a03c1645 100644
--- a/src/main/webapp/wise5/authoringTool/authoringToolController.es6
+++ b/src/main/webapp/wise5/authoringTool/authoringToolController.es6
@@ -266,6 +266,11 @@ class AuthoringToolController {
} else {
this.projectTitle = null;
}
+ this.turnOffJSONValidMessage();
+ }
+
+ turnOffJSONValidMessage() {
+ this.$rootScope.$broadcast('setIsJSONValid', { isJSONValid: null });
}
/**
diff --git a/src/main/webapp/wise5/authoringTool/authoringToolController.js b/src/main/webapp/wise5/authoringTool/authoringToolController.js
index 17da20da6b..43229ce03d 100644
--- a/src/main/webapp/wise5/authoringTool/authoringToolController.js
+++ b/src/main/webapp/wise5/authoringTool/authoringToolController.js
@@ -252,6 +252,12 @@ var AuthoringToolController = function () {
} else {
this.projectTitle = null;
}
+ this.turnOffJSONValidMessage();
+ }
+ }, {
+ key: 'turnOffJSONValidMessage',
+ value: function turnOffJSONValidMessage() {
+ this.$rootScope.$broadcast('setIsJSONValid', { isJSONValid: null });
}
/**
diff --git a/src/main/webapp/wise5/authoringTool/authoringToolController.js.map b/src/main/webapp/wise5/authoringTool/authoringToolController.js.map
index ee9ef40ad6..9f039190b1 100644
--- a/src/main/webapp/wise5/authoringTool/authoringToolController.js.map
+++ b/src/main/webapp/wise5/authoringTool/authoringToolController.js.map
@@ -1 +1 @@
-{"version":3,"sources":["authoringToolController.es6"],"names":["AuthoringToolController","$anchorScroll","$filter","$location","$mdDialog","$rootScope","$scope","$state","$timeout","ConfigService","ProjectService","SessionService","TeacherDataService","$translate","numberProject","isMenuOpen","views","id","name","label","icon","type","showToolbar","active","logoPath","getThemePath","processUI","$on","event","toState","toParams","fromState","fromParams","confirm","parent","angular","element","document","body","title","content","ariaLabel","ok","cancel","show","then","renewSession","forceLogOut","ev","alert","textContent","targetEvent","setGlobalMessage","Date","getTime","params","stateParams","isPopup","projectId","nodeId","componentId","target","targetObject","templateUrl","controller","controllerAs","$stateParams","clickOutsideToClose","escapeToClose","saveEvent","current","showStepTools","$current","view","currentViewName","getProjectId","runId","getRunId","projectTitle","getProjectTitle","url","mouseMoved","notifyAuthorProjectEnd","wiseBaseURL","getWISEBaseURL","window","location","message","time","globalMessage","text","$broadcast","eventName","category","context","componentType","data","$inject"],"mappings":"AAAA;;;;;;;;;;IAEMA,uB;AAEJ,mCACIC,aADJ,EAEIC,OAFJ,EAGIC,SAHJ,EAIIC,SAJJ,EAKIC,UALJ,EAMIC,MANJ,EAOIC,MAPJ,EAQIC,QARJ,EASIC,aATJ,EAUIC,cAVJ,EAWIC,cAXJ,EAYIC,kBAZJ,EAYwB;AAAA;;AAAA;;AACtB,SAAKX,aAAL,GAAqBA,aAArB;AACA,SAAKC,OAAL,GAAeA,OAAf;AACA,SAAKC,SAAL,GAAiBA,SAAjB;AACA,SAAKC,SAAL,GAAiBA,SAAjB;AACA,SAAKC,UAAL,GAAkBA,UAAlB;AACA,SAAKC,MAAL,GAAcA,MAAd;AACA,SAAKC,MAAL,GAAcA,MAAd;AACA,SAAKC,QAAL,GAAgBA,QAAhB;AACA,SAAKK,UAAL,GAAkB,KAAKX,OAAL,CAAa,WAAb,CAAlB;AACA,SAAKO,aAAL,GAAqBA,aAArB;AACA,SAAKC,cAAL,GAAsBA,cAAtB;AACA,SAAKC,cAAL,GAAsBA,cAAtB;AACA,SAAKC,kBAAL,GAA0BA,kBAA1B;;AAEA,SAAKE,aAAL,GAAqB,IAArB,CAfsB,CAeK;AAC3B,SAAKC,UAAL,GAAkB,KAAlB;;AAEA;AACA,SAAKC,KAAL,GAAa;AACX,sBAAgB;AACdC,YAAI,mBADU;AAEdC,cAAM,KAAKL,UAAL,CAAgB,aAAhB,CAFQ;AAGdM,eAAO,KAAKN,UAAL,CAAgB,aAAhB,CAHO;AAIdO,cAAM,MAJQ;AAKdC,cAAM,SALQ;AAMdC,qBAAa,IANC;AAOdC,gBAAQ;AAPM,OADL;AAUX,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ACD;;;;;AAED;;;;;;8BAMUG,S,EAAWC,Q,EAAU;AAC7B,UAAIC,UAAU,eAAd;AACA,UAAInC,SAAS,IAAb;AACA,UAAIC,cAAc,IAAlB;AACA,UAAImC,gBAAgB,IAApB;AACA,UAAIC,OAAO,EAAX;;AAEA,WAAKpF,kBAAL,CAAwByD,SAAxB,CAAkCyB,OAAlC,EAA2CnC,MAA3C,EAAmDC,WAAnD,EACImC,aADJ,EACmBF,QADnB,EAC6BD,SAD7B,EACwCI,IADxC;AAED;;;;;;AAGHhG,wBAAwBiG,OAAxB,GAAkC,CAChC,eADgC,EAEhC,SAFgC,EAGhC,WAHgC,EAIhC,WAJgC,EAKhC,YALgC,EAMhC,QANgC,EAOhC,QAPgC,EAQhC,UARgC,EAShC,eATgC,EAUhC,gBAVgC,EAWhC,gBAXgC,EAYhC,oBAZgC,EAahC,QAbgC,CAAlC;;kBAgBejG,uB","file":"authoringToolController.js","sourcesContent":["'use strict';\n\nclass AuthoringToolController {\n\n constructor(\n $anchorScroll,\n $filter,\n $location,\n $mdDialog,\n $rootScope,\n $scope,\n $state,\n $timeout,\n ConfigService,\n ProjectService,\n SessionService,\n TeacherDataService) {\n this.$anchorScroll = $anchorScroll;\n this.$filter = $filter;\n this.$location = $location;\n this.$mdDialog = $mdDialog;\n this.$rootScope = $rootScope;\n this.$scope = $scope;\n this.$state = $state;\n this.$timeout = $timeout;\n this.$translate = this.$filter('translate');\n this.ConfigService = ConfigService;\n this.ProjectService = ProjectService;\n this.SessionService = SessionService;\n this.TeacherDataService = TeacherDataService;\n\n this.numberProject = true; // TODO: make dynamic or remove\n this.isMenuOpen = false;\n\n // ui-views and their corresponding names, labels, and icons\n this.views = {\n 'root.project': {\n id: 'projectHomeButton',\n name: this.$translate('projectHome'),\n label: this.$translate('projectHome'),\n icon: 'home',\n type: 'primary',\n showToolbar: true,\n active: true\n },\n 'root.project.notebook': {\n id: 'notebookButton',\n name: this.$translate('notebookSettings'),\n label: this.$translate('notebookSettings'),\n icon: 'book',\n type: 'primary',\n showToolbar: true,\n active: true\n },\n 'root.project.asset': {\n id: 'assetButton',\n name: this.$translate('fileManager'),\n label: this.$translate('fileManager'),\n icon: 'attach_file',\n type: 'primary',\n showToolbar: true,\n active: true\n },\n 'root.project.info': {\n id: 'infoButton',\n name: this.$translate('PROJECT_INFO'),\n label: this.$translate('PROJECT_INFO'),\n icon: 'info',\n type: 'primary',\n showToolbar: true,\n active: true\n },\n 'root.main': {\n id: 'projectListButton',\n name: this.$translate('projectsList'),\n label: this.$translate('projectsList'),\n icon: 'reorder',\n type: 'primary',\n showToolbar: false,\n active: true\n },\n 'root.project.node': {\n name: '',\n label: '',\n icon: '',\n type: 'secondary',\n showToolbar: true,\n active: false\n },\n 'root.project.nodeConstraints': {\n name: '',\n label: '',\n icon: '',\n type: 'secondary',\n showToolbar: true,\n active: false\n },\n 'root.project.nodeEditPaths': {\n name: '',\n label: '',\n icon: '',\n type: 'secondary',\n showToolbar: true,\n active: false\n },\n };\n\n this.logoPath = this.ProjectService.getThemePath() + '/images/WISE-logo-ffffff.svg';\n this.processUI();\n\n // listen for state change events and close the menu\n this.$scope.$on('$stateChangeSuccess',\n (event, toState, toParams, fromState, fromParams) => {\n this.isMenuOpen = false;\n this.processUI();\n });\n\n $scope.$on('showSessionWarning', () => {\n let confirm = this.$mdDialog.confirm()\n .parent(angular.element(document.body))\n .title(this.$translate('sessionTimeout'))\n .content(this.$translate('autoLogoutMessage'))\n .ariaLabel(this.$translate('sessionTimeout'))\n .ok(this.$translate('yes'))\n .cancel(this.$translate('no'));\n this.$mdDialog.show(confirm).then(() => {\n this.SessionService.renewSession();\n }, () => {\n this.SessionService.forceLogOut();\n });\n });\n\n // alert user when they're inactive for a long time\n this.$scope.$on('showRequestLogout', (ev) => {\n let alert = this.$mdDialog.confirm()\n .parent(angular.element(document.body))\n .title(this.$translate('serverUpdate'))\n .textContent(this.$translate('serverUpdateRequestLogoutMessage'))\n .ariaLabel(this.$translate('serverUpdate'))\n .targetEvent(ev)\n .ok(this.$translate('ok'));\n\n this.$mdDialog.show(alert).then(() => {\n // do nothing\n }, () => {\n // do nothing\n });\n });\n\n /*\n * Listen for the savingProject event which means the authoring tool\n * is in the process of saving the project and display this information\n * globally.\n */\n this.$scope.$on('savingProject', () => {\n this.setGlobalMessage(this.$translate('saving'), null);\n });\n\n /*\n * Listen for the projectSaved event which means the project has just\n * been saved to the server\n */\n this.$scope.$on('projectSaved', () => {\n\n /*\n * Wait half a second before changing the message to 'Saved' so that\n * the 'Saving...' message stays up long enough for the author to\n * see that the project is saving. If we don't perform this wait,\n * it will always say 'Saved' and authors may wonder whether the\n * project ever gets saved.\n */\n this.$timeout(() => {\n this.setGlobalMessage(this.$translate('SAVED'), new Date().getTime());\n }, 500);\n });\n\n /*\n * Open the asset chooser to let the author insert an asset into the\n * specified target\n */\n this.$scope.$on('openAssetChooser', (event, params) => {\n // create the params for opening the asset chooser\n const stateParams = {\n isPopup: params.isPopup,\n projectId: params.projectId,\n nodeId: params.nodeId,\n componentId: params.componentId,\n target: params.target,\n targetObject: params.targetObject\n };\n\n // open the dialog that will display the assets for the user to choose\n this.$mdDialog.show({\n templateUrl: 'wise5/authoringTool/asset/asset.html',\n controller: 'ProjectAssetController',\n controllerAs: 'projectAssetController',\n $stateParams: stateParams,\n clickOutsideToClose: true,\n escapeToClose: true\n });\n });\n\n /*\n * Open the asset chooser to let the author insert an WISE Link into the\n * specified target\n */\n this.$scope.$on('openWISELinkChooser', (event, params) => {\n // create the params for opening the WISE Link authoring popup\n const stateParams = {\n projectId: params.projectId,\n nodeId: params.nodeId,\n componentId: params.componentId,\n target: params.target\n };\n\n // open the WISE Link authoring popup\n this.$mdDialog.show({\n templateUrl: 'wise5/authoringTool/wiseLink/wiseLinkAuthoring.html',\n controller: 'WISELinkAuthoringController',\n controllerAs: 'wiseLinkAuthoringController',\n $stateParams: stateParams,\n clickOutsideToClose: true,\n escapeToClose: true\n });\n });\n\n this.$rootScope.$on('$stateChangeSuccess',\n (event, toState, toParams, fromState, fromParams) => {\n if (toState != null && toState.name == 'root.main') {\n this.saveEvent('projectListViewed', 'Navigation');\n }\n });\n\n if (this.$state.current.name == 'root.main') {\n this.saveEvent('projectListViewed', 'Navigation');\n }\n }\n\n /**\n * Update UI items based on state, show or hide relevant menus and toolbars\n * TODO: remove/rework this and put items in their own ui states?\n */\n processUI() {\n // scroll to the top of the page\n this.$anchorScroll('top');\n\n // set current view and whether to show the toolbars and step tools\n this.showStepTools = this.$state.$current.name === 'root.project' ||\n this.$state.$current.name === 'root.project.node' ||\n this.$state.$current.name === 'root.project.nodeConstraints' ||\n this.$state.$current.name === 'root.project.nodeEditPaths';\n const view = this.views[this.$state.$current.name];\n if (view) {\n this.currentViewName = view.name;\n this.showToolbar = view.showToolbar;\n } else {\n this.currentViewName = '';\n this.showToolbar = false;\n }\n\n this.projectId = this.ConfigService.getProjectId();\n this.runId = this.ConfigService.getRunId();\n\n if (this.projectId) {\n this.projectTitle = this.ProjectService.getProjectTitle();\n } else {\n this.projectTitle = null;\n }\n }\n\n /**\n * Navigate the user to the My Projects page in the Authoring Tool\n */\n goToMyProjects() {\n this.$location.url('/author');\n }\n\n /**\n * Toggle the authoring tool main menu\n */\n toggleMenu() {\n this.isMenuOpen = !this.isMenuOpen;\n }\n\n /**\n * Notify Session to renew when user moves the mouse\n */\n mouseMoved() {\n this.SessionService.mouseMoved();\n }\n\n exit() {\n this.ProjectService.notifyAuthorProjectEnd().then(() => {\n let wiseBaseURL = this.ConfigService.getWISEBaseURL();\n window.location = wiseBaseURL + '/teacher';\n });\n }\n\n /**\n * Set the global message at the top right\n * @param message the message to display\n * @param time the time to display\n */\n setGlobalMessage(message, time) {\n const globalMessage = {\n text: message,\n time: time\n };\n this.$rootScope.$broadcast('setGlobalMessage', { globalMessage: globalMessage });\n };\n\n /**\n * Save an Authoring Tool event\n * @param eventName the name of the event\n * @param category the category of the event\n * example 'Navigation' or 'Authoring'\n */\n saveEvent(eventName, category) {\n let context = 'AuthoringTool';\n let nodeId = null;\n let componentId = null;\n let componentType = null;\n let data = {};\n\n this.TeacherDataService.saveEvent(context, nodeId, componentId,\n componentType, category, eventName, data);\n }\n}\n\nAuthoringToolController.$inject = [\n '$anchorScroll',\n '$filter',\n '$location',\n '$mdDialog',\n '$rootScope',\n '$scope',\n '$state',\n '$timeout',\n 'ConfigService',\n 'ProjectService',\n 'SessionService',\n 'TeacherDataService',\n 'moment'\n];\n\nexport default AuthoringToolController;\n"]}
\ No newline at end of file
+{"version":3,"sources":["authoringToolController.es6"],"names":["AuthoringToolController","$anchorScroll","$filter","$location","$mdDialog","$rootScope","$scope","$state","$timeout","ConfigService","ProjectService","SessionService","TeacherDataService","$translate","numberProject","isMenuOpen","views","id","name","label","icon","type","showToolbar","active","logoPath","getThemePath","processUI","$on","event","toState","toParams","fromState","fromParams","confirm","parent","angular","element","document","body","title","content","ariaLabel","ok","cancel","show","then","renewSession","forceLogOut","ev","alert","textContent","targetEvent","setGlobalMessage","Date","getTime","params","stateParams","isPopup","projectId","nodeId","componentId","target","targetObject","templateUrl","controller","controllerAs","$stateParams","clickOutsideToClose","escapeToClose","saveEvent","current","showStepTools","$current","view","currentViewName","getProjectId","runId","getRunId","projectTitle","getProjectTitle","turnOffJSONValidMessage","$broadcast","isJSONValid","url","mouseMoved","notifyAuthorProjectEnd","wiseBaseURL","getWISEBaseURL","window","location","message","time","globalMessage","text","eventName","category","context","componentType","data","$inject"],"mappings":"AAAA;;;;;;;;;;IAEMA,uB;AAEJ,mCACIC,aADJ,EAEIC,OAFJ,EAGIC,SAHJ,EAIIC,SAJJ,EAKIC,UALJ,EAMIC,MANJ,EAOIC,MAPJ,EAQIC,QARJ,EASIC,aATJ,EAUIC,cAVJ,EAWIC,cAXJ,EAYIC,kBAZJ,EAYwB;AAAA;;AAAA;;AACtB,SAAKX,aAAL,GAAqBA,aAArB;AACA,SAAKC,OAAL,GAAeA,OAAf;AACA,SAAKC,SAAL,GAAiBA,SAAjB;AACA,SAAKC,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C,QANgC,EAOhC,QAPgC,EAQhC,UARgC,EAShC,eATgC,EAUhC,gBAVgC,EAWhC,gBAXgC,EAYhC,oBAZgC,EAahC,QAbgC,CAAlC;;kBAgBenG,uB","file":"authoringToolController.js","sourcesContent":["'use strict';\n\nclass AuthoringToolController {\n\n constructor(\n $anchorScroll,\n $filter,\n $location,\n $mdDialog,\n $rootScope,\n $scope,\n $state,\n $timeout,\n ConfigService,\n ProjectService,\n SessionService,\n TeacherDataService) {\n this.$anchorScroll = $anchorScroll;\n this.$filter = $filter;\n this.$location = $location;\n this.$mdDialog = $mdDialog;\n this.$rootScope = $rootScope;\n this.$scope = $scope;\n this.$state = $state;\n this.$timeout = $timeout;\n this.$translate = this.$filter('translate');\n this.ConfigService = ConfigService;\n this.ProjectService = ProjectService;\n this.SessionService = SessionService;\n this.TeacherDataService = TeacherDataService;\n\n this.numberProject = true; // TODO: make dynamic or remove\n this.isMenuOpen = false;\n\n // ui-views and their corresponding names, labels, and icons\n this.views = {\n 'root.project': {\n id: 'projectHomeButton',\n name: this.$translate('projectHome'),\n label: this.$translate('projectHome'),\n icon: 'home',\n type: 'primary',\n showToolbar: true,\n active: true\n },\n 'root.project.notebook': {\n id: 'notebookButton',\n name: this.$translate('notebookSettings'),\n label: this.$translate('notebookSettings'),\n icon: 'book',\n type: 'primary',\n showToolbar: true,\n active: true\n },\n 'root.project.asset': {\n id: 'assetButton',\n name: this.$translate('fileManager'),\n label: this.$translate('fileManager'),\n icon: 'attach_file',\n type: 'primary',\n showToolbar: true,\n active: true\n },\n 'root.project.info': {\n id: 'infoButton',\n name: this.$translate('PROJECT_INFO'),\n label: this.$translate('PROJECT_INFO'),\n icon: 'info',\n type: 'primary',\n showToolbar: true,\n active: true\n },\n 'root.main': {\n id: 'projectListButton',\n name: this.$translate('projectsList'),\n label: this.$translate('projectsList'),\n icon: 'reorder',\n type: 'primary',\n showToolbar: false,\n active: true\n },\n 'root.project.node': {\n name: '',\n label: '',\n icon: '',\n type: 'secondary',\n showToolbar: true,\n active: false\n },\n 'root.project.nodeConstraints': {\n name: '',\n label: '',\n icon: '',\n type: 'secondary',\n showToolbar: true,\n active: false\n },\n 'root.project.nodeEditPaths': {\n name: '',\n label: '',\n icon: '',\n type: 'secondary',\n showToolbar: true,\n active: false\n },\n };\n\n this.logoPath = this.ProjectService.getThemePath() + '/images/WISE-logo-ffffff.svg';\n this.processUI();\n\n // listen for state change events and close the menu\n this.$scope.$on('$stateChangeSuccess',\n (event, toState, toParams, fromState, fromParams) => {\n this.isMenuOpen = false;\n this.processUI();\n });\n\n $scope.$on('showSessionWarning', () => {\n let confirm = this.$mdDialog.confirm()\n .parent(angular.element(document.body))\n .title(this.$translate('sessionTimeout'))\n .content(this.$translate('autoLogoutMessage'))\n .ariaLabel(this.$translate('sessionTimeout'))\n .ok(this.$translate('yes'))\n .cancel(this.$translate('no'));\n this.$mdDialog.show(confirm).then(() => {\n this.SessionService.renewSession();\n }, () => {\n this.SessionService.forceLogOut();\n });\n });\n\n // alert user when they're inactive for a long time\n this.$scope.$on('showRequestLogout', (ev) => {\n let alert = this.$mdDialog.confirm()\n .parent(angular.element(document.body))\n .title(this.$translate('serverUpdate'))\n .textContent(this.$translate('serverUpdateRequestLogoutMessage'))\n .ariaLabel(this.$translate('serverUpdate'))\n .targetEvent(ev)\n .ok(this.$translate('ok'));\n\n this.$mdDialog.show(alert).then(() => {\n // do nothing\n }, () => {\n // do nothing\n });\n });\n\n /*\n * Listen for the savingProject event which means the authoring tool\n * is in the process of saving the project and display this information\n * globally.\n */\n this.$scope.$on('savingProject', () => {\n this.setGlobalMessage(this.$translate('saving'), null);\n });\n\n /*\n * Listen for the projectSaved event which means the project has just\n * been saved to the server\n */\n this.$scope.$on('projectSaved', () => {\n\n /*\n * Wait half a second before changing the message to 'Saved' so that\n * the 'Saving...' message stays up long enough for the author to\n * see that the project is saving. If we don't perform this wait,\n * it will always say 'Saved' and authors may wonder whether the\n * project ever gets saved.\n */\n this.$timeout(() => {\n this.setGlobalMessage(this.$translate('SAVED'), new Date().getTime());\n }, 500);\n });\n\n /*\n * Open the asset chooser to let the author insert an asset into the\n * specified target\n */\n this.$scope.$on('openAssetChooser', (event, params) => {\n // create the params for opening the asset chooser\n const stateParams = {\n isPopup: params.isPopup,\n projectId: params.projectId,\n nodeId: params.nodeId,\n componentId: params.componentId,\n target: params.target,\n targetObject: params.targetObject\n };\n\n // open the dialog that will display the assets for the user to choose\n this.$mdDialog.show({\n templateUrl: 'wise5/authoringTool/asset/asset.html',\n controller: 'ProjectAssetController',\n controllerAs: 'projectAssetController',\n $stateParams: stateParams,\n clickOutsideToClose: true,\n escapeToClose: true\n });\n });\n\n /*\n * Open the asset chooser to let the author insert an WISE Link into the\n * specified target\n */\n this.$scope.$on('openWISELinkChooser', (event, params) => {\n // create the params for opening the WISE Link authoring popup\n const stateParams = {\n projectId: params.projectId,\n nodeId: params.nodeId,\n componentId: params.componentId,\n target: params.target\n };\n\n // open the WISE Link authoring popup\n this.$mdDialog.show({\n templateUrl: 'wise5/authoringTool/wiseLink/wiseLinkAuthoring.html',\n controller: 'WISELinkAuthoringController',\n controllerAs: 'wiseLinkAuthoringController',\n $stateParams: stateParams,\n clickOutsideToClose: true,\n escapeToClose: true\n });\n });\n\n this.$rootScope.$on('$stateChangeSuccess',\n (event, toState, toParams, fromState, fromParams) => {\n if (toState != null && toState.name == 'root.main') {\n this.saveEvent('projectListViewed', 'Navigation');\n }\n });\n\n if (this.$state.current.name == 'root.main') {\n this.saveEvent('projectListViewed', 'Navigation');\n }\n }\n\n /**\n * Update UI items based on state, show or hide relevant menus and toolbars\n * TODO: remove/rework this and put items in their own ui states?\n */\n processUI() {\n // scroll to the top of the page\n this.$anchorScroll('top');\n\n // set current view and whether to show the toolbars and step tools\n this.showStepTools = this.$state.$current.name === 'root.project' ||\n this.$state.$current.name === 'root.project.node' ||\n this.$state.$current.name === 'root.project.nodeConstraints' ||\n this.$state.$current.name === 'root.project.nodeEditPaths';\n const view = this.views[this.$state.$current.name];\n if (view) {\n this.currentViewName = view.name;\n this.showToolbar = view.showToolbar;\n } else {\n this.currentViewName = '';\n this.showToolbar = false;\n }\n\n this.projectId = this.ConfigService.getProjectId();\n this.runId = this.ConfigService.getRunId();\n\n if (this.projectId) {\n this.projectTitle = this.ProjectService.getProjectTitle();\n } else {\n this.projectTitle = null;\n }\n this.turnOffJSONValidMessage();\n }\n\n turnOffJSONValidMessage() {\n this.$rootScope.$broadcast('setIsJSONValid', { isJSONValid: null });\n }\n\n /**\n * Navigate the user to the My Projects page in the Authoring Tool\n */\n goToMyProjects() {\n this.$location.url('/author');\n }\n\n /**\n * Toggle the authoring tool main menu\n */\n toggleMenu() {\n this.isMenuOpen = !this.isMenuOpen;\n }\n\n /**\n * Notify Session to renew when user moves the mouse\n */\n mouseMoved() {\n this.SessionService.mouseMoved();\n }\n\n exit() {\n this.ProjectService.notifyAuthorProjectEnd().then(() => {\n let wiseBaseURL = this.ConfigService.getWISEBaseURL();\n window.location = wiseBaseURL + '/teacher';\n });\n }\n\n /**\n * Set the global message at the top right\n * @param message the message to display\n * @param time the time to display\n */\n setGlobalMessage(message, time) {\n const globalMessage = {\n text: message,\n time: time\n };\n this.$rootScope.$broadcast('setGlobalMessage', { globalMessage: globalMessage });\n };\n\n /**\n * Save an Authoring Tool event\n * @param eventName the name of the event\n * @param category the category of the event\n * example 'Navigation' or 'Authoring'\n */\n saveEvent(eventName, category) {\n let context = 'AuthoringTool';\n let nodeId = null;\n let componentId = null;\n let componentType = null;\n let data = {};\n\n this.TeacherDataService.saveEvent(context, nodeId, componentId,\n componentType, category, eventName, data);\n }\n}\n\nAuthoringToolController.$inject = [\n '$anchorScroll',\n '$filter',\n '$location',\n '$mdDialog',\n '$rootScope',\n '$scope',\n '$state',\n '$timeout',\n 'ConfigService',\n 'ProjectService',\n 'SessionService',\n 'TeacherDataService',\n 'moment'\n];\n\nexport default AuthoringToolController;\n"]}
\ No newline at end of file
diff --git a/src/main/webapp/wise5/authoringTool/components/shared/toolbar/toolbar.es6 b/src/main/webapp/wise5/authoringTool/components/shared/toolbar/toolbar.es6
index 245f5b0d6c..4e0abebd32 100644
--- a/src/main/webapp/wise5/authoringTool/components/shared/toolbar/toolbar.es6
+++ b/src/main/webapp/wise5/authoringTool/components/shared/toolbar/toolbar.es6
@@ -11,6 +11,9 @@ class ToolbarController {
}
this.globalMessage = params.globalMessage;
});
+ this.$rootScope.$on('setIsJSONValid', (event, params) => {
+ this.isJSONValid = params.isJSONValid;
+ });
}
toggleMenu() {
@@ -39,6 +42,8 @@ const Toolbar = {