Skip to content
This repository has been archived by the owner on Dec 20, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
add guided tour for the graph page
  • Loading branch information
danieleguido committed Feb 4, 2016
1 parent 61d3ce8 commit b8a9278
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 18 deletions.
41 changes: 24 additions & 17 deletions client/src/js/controllers/guided-tour.js
Expand Up @@ -12,34 +12,39 @@ angular.module('histograph')

$scope.currentStep = -1;
$scope.currentView;

$scope.enable = false;
$scope.steps = {
// 'explore.resources': {
// current: 0,
// steps: [
// 0,1
// ]
// },
// 'resource.resources': {
// current: 0,
// steps: [
// 5,6
// ]
// }
'explore.resources': {
steps: [
0,1
]
},
'resource.resources': {
steps: [
5,6
]
},
'explore.projection': {
steps: [
10
]
}
};

var currentState,
__promise;

$scope.showNext = false;
$scope.showPrevious = false;
/*
According to the view we are in
*/
$scope.nextStep = function(){

$scope.currentStep ++;
}

$scope.previousStep = function() {

$scope.currentStep--;
}

/*
Expand All @@ -48,10 +53,12 @@ angular.module('histograph')
*/
$rootScope.$on(EVENTS.STATE_VIEW_CONTENT_LOADED, function(e, state) {
currentState = state.name;

if(__promise)
$timeout.cancel(__promise);


if(!$scope.enable)
return;
__promise = $timeout(function(){
if($scope.steps[state.name] && !$scope.steps[state.name].consumed) {
$scope.currentStep = $scope.steps[state.name].steps[$scope.steps[state.name].current || 0]
Expand Down
2 changes: 1 addition & 1 deletion client/src/js/lib/angular-tour-tpls.min.js
Expand Up @@ -16,7 +16,7 @@
angular.module('tour/tour.tpl.html', []).run([
'$templateCache',
function ($templateCache) {
$templateCache.put('tour/tour.tpl.html', '<div class="tour-tip">\n' + ' \n' + '<span class="tour-arrow tt-{{ ttPlacement }}" ng-hide="centered"></span> <div class="tour-content-wrapper">\n' + ' <h3 ng-bind="ttTitle"></h3>\n' + ' <p ng-bind="ttContent"></p>\n' + ' <a ng-click="proceed()" ng-bind="ttNextLabel" class="small btn-line-white btn tour-next-tip"></a><a ng-click="proceed()" ng-bind="ttPrevLabel" class="small btn-line-white btn tour-next-tip"></a>\n' + ' <a ng-click="closeTour()" class="tour-close-tip"><span class="fa fa-times-circle"></a>\n' + ' </div>\n' + '</div>\n' + '');
$templateCache.put('tour/tour.tpl.html', '<div class="tour-tip">\n' + ' \n' + '<span class="tour-arrow tt-{{ ttPlacement }}" ng-hide="centered"></span> <div class="tour-content-wrapper">\n' + ' <h3 ng-bind="ttTitle"></h3>\n' + ' <p ng-bind="ttContent"></p>\n' + ' <a ng-click="previousStep()" class="small btn-line-white btn tour-next-tip" translate>button.previous</a><a ng-click="nextStep()" class="small btn-line-white btn tour-next-tip" translate>button.next</a>\n' + ' <a ng-click="closeTour()" class="tour-close-tip"><span class="fa fa-times-circle"></a>\n' + ' </div>\n' + '</div>\n' + '');
}
]);
angular.module('angular-tour.tour', []).constant('tourConfig', {
Expand Down
1 change: 1 addition & 0 deletions client/src/locale/locale-en_US.json
Expand Up @@ -13,6 +13,7 @@
"button.login.with.google": "log in with your google account",
"button.more": "more",
"button.next": "next",
"button.previous": "previous",
"button.myselection.explore": "explore connections",

"crowd.whois": "Do you know who is",
Expand Down
4 changes: 4 additions & 0 deletions client/views/index.jade
Expand Up @@ -218,6 +218,10 @@ html
virtual-step(tourtip="{{'guided-tour.step.view.resource.add' | translate}}" tourtip-element=".resource.item .btn-contribute", tourtip-offset-horizontal="0", tourtip-placement="top")
virtual-step(tourtip="{{'guided-tour.step.view.resource.annotate' | translate}}" tourtip-element=".resource.item h3", tourtip-offset-horizontal="0", tourtip-placement="bottom")

//- milkyway
virtual-step(tourtip="{{'guided-tour.step.view.graph' | translate}}" tourtip-element="#milkyway", tourtip-offset-horizontal="0", tourtip-placement="center-top")


div(id="messenger", class="tk-proxima-nova {{messaging? 'active': ''}}")
div.inner
span {{message}}
Expand Down

0 comments on commit b8a9278

Please sign in to comment.