diff --git a/controllers/MainController.js b/controllers/MainController.js index edb6845..a18d9f2 100644 --- a/controllers/MainController.js +++ b/controllers/MainController.js @@ -764,14 +764,21 @@ wwt.controllers.controller('MainController', }; $scope.playTour = function (url, edit) { - console.log(edit,url); if (!edit) { util.goFullscreen(); } - //console.log(encodeURIComponent(url)); - $('.finder-scope').hide(); - wwt.wc.add_tourReady(function () { + $('.finder-scope').hide(); + wwt.wc.add_tourError(function(e){ + util.toggleFullScreen(); + $scope.$applyAsync(function(){ + wwt.tourPlaying =$rootScope.tourPlaying = false; + }); + uiLibrary.showErrorMessage('There was an error loading this tour. The tour file may be damaged or inaccessible.'); + console.warn('caught ya!',$scope,e); + }); + wwt.wc.add_tourReady(function () { + console.log({ready:wwtlib.WWTControl.singleton.tourEdit}); $scope.$applyAsync(function () { $scope.activeItem = {label: 'currentTour'}; $scope.activePanel = 'currentTour'; @@ -782,7 +789,9 @@ wwt.controllers.controller('MainController', $scope.editTour(); } }); + wwtlib.WWTControl.singleton.playTour(url); + $scope.$applyAsync(function () { wwt.tourPlaying = $rootScope.tourPlaying = true; $rootScope.tourPaused = edit; diff --git a/controllers/modals/OpenItemController.js b/controllers/modals/OpenItemController.js index aefdb90..8086443 100644 --- a/controllers/modals/OpenItemController.js +++ b/controllers/modals/OpenItemController.js @@ -25,7 +25,7 @@ $('#openModal').modal('hide'); }); } else if (itemType === 'tour') { - console.log({editTour:$scope.tour.edit}); + // console.log({editTour:$scope.tour.edit}); $scope.playTour($scope.openItemUrl, !!$scope.tour.edit); $('#openModal').modal('hide'); } else if (itemType === 'FITS image') { diff --git a/factories/UILibrary.js b/factories/UILibrary.js index 35c8b51..6b0031c 100644 --- a/factories/UILibrary.js +++ b/factories/UILibrary.js @@ -323,6 +323,17 @@ embedVideo: embedVideo, annotationOpts: annotationOpts, showModal: showModal, + showErrorMessage:function(msg){ + var scope = $rootScope.$new(); + scope.message = msg; + scope.title = 'Error'; + var props = { + scope:scope, + template:'message' + }; + + showModal(props); + }, setObservingLocation:setObservingLocation }; }]); diff --git a/views/modals/loading.html b/views/modals/loading.html index e6fc6d3..0c841a7 100644 --- a/views/modals/loading.html +++ b/views/modals/loading.html @@ -3,13 +3,7 @@