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:
Родитель
fbb65f1ded
Коммит
2d33d6d9b2
|
@ -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>®</sup> Research</small><br />
|
||||
World<span style="color:#6ba9e6">Wide Telescope</span>
|
||||
</h1>
|
||||
<h3 localize="Content Loading. Please Wait..."></h3>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
|
|
@ -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>
|
Загрузка…
Ссылка в новой задаче