Issue #147 - added tour error hooks to sdk, then implemented in UI. As part of this, developed a generic error modal hook that can easily be triggered.

This commit is contained in:
Ron Gilchrist 2019-04-18 21:01:42 -07:00
Родитель fbb65f1ded
Коммит 2d33d6d9b2
5 изменённых файлов: 38 добавлений и 12 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -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') {

Просмотреть файл

@ -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
};
}]);

Просмотреть файл

@ -3,13 +3,7 @@
<div class="modal-content">
<div class="modal-body">
<img ng-src='https://wwtweb.blob.core.windows.net/webclient/wwtlogo.png' style="width:19%;height:19%;position:relative;left:-3px;margin-right:12px;" class="pull-left" localize="Microsoft WorldWide Telescope Logo"
localize-only="alt" />
<h1 style="position:relative;top:-2px">
<small style="color:white">Microsoft<sup>&reg;</sup> Research</small><br />
World<span style="color:#6ba9e6">Wide Telescope</span>
</h1>
<h3 localize="Content Loading. Please Wait..."></h3>
</div>

12
views/modals/message.html Normal file
Просмотреть файл

@ -0,0 +1,12 @@
<div class="modal-header" data-movable="1" data-movable-target=".modal-dialog">
<h5>
<i class="fa fa-close pull-right" ng-click="$hide()"></i>
<span localize="{{title}}"></span>
</h5>
</div>
<div class="modal-body" >
<p style="margin:25px 0" localize="{{message}}"></p>
</div>
<div class="modal-footer" style="border: none">
<a class="btn" data-dismiss="modal" style="width:80px" localize="Close" ng-click="$hide()"></a>
</div>