Browse Source

Add flag to localStorage to hide help tour when already shown.

pull/149/head
Evan Theurer 12 years ago
parent
commit
9503307cbf
  1. 11
      static/js/directives/helptour.js
  2. 4
      static/partials/helptour.html

11
static/js/directives/helptour.js

@ -24,8 +24,9 @@ define(['jquery', 'text!partials/helpoverlay.html', 'text!partials/helptour.html
//helptour //helptour
return [function() { return [function() {
var controller = ['$scope', '$rootScope', '$timeout', 'mediaStream', '$modal', function($scope, $rootScope, $timeout, mediaStream, $modal) { var controller = ['$scope', '$timeout', '$modal', 'userSettingsData', function($scope, $timeout, $modal, userSettingsData) {
var displayTime = 500; var displayTime = 500;
var shown = localStorage.getItem('mediastream-helptour');
var doStep = function(i, elem) { var doStep = function(i, elem) {
$timeout(function() { $timeout(function() {
$(elem).addClass('in'); $(elem).addClass('in');
@ -41,8 +42,8 @@ define(['jquery', 'text!partials/helpoverlay.html', 'text!partials/helptour.html
}; };
var introTour = function() { var introTour = function() {
$scope.layout.settings = false; $scope.layout.settings = false;
var controller = ['$scope', '$modalInstance', function($scope, $modalInstance) { var controller = ['$scope', '$modalInstance', function(scope, $modalInstance) {
$scope.goTour = function() { scope.goTour = function() {
$modalInstance.dismiss(); $modalInstance.dismiss();
startTour(); startTour();
}; };
@ -50,11 +51,13 @@ define(['jquery', 'text!partials/helpoverlay.html', 'text!partials/helptour.html
$modal.open({ $modal.open({
template: templatehelptour, template: templatehelptour,
controller: controller, controller: controller,
resolve: {},
size: 'sm' size: 'sm'
}); });
}; };
if (!shown) {
introTour(); introTour();
localStorage.setItem('mediastream-helptour', true);
}
$scope.$on('showHelpTour', function(current, last) { $scope.$on('showHelpTour', function(current, last) {
if(current) { if(current) {
introTour(); introTour();

4
static/partials/helptour.html

@ -4,12 +4,12 @@
<h3 class="modal-title">{{_('Tour')}}</h3> <h3 class="modal-title">{{_('Tour')}}</h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p>Congratulations! Anonymous secure peer to peer chat and video calls are a short click away. Quickly get started with the features tour below.</p> <p>{{_('Congratulations! Anonymous secure peer to peer chat and video calls are a short click away. Quickly get started with the features tour below.')}}</p>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<div class="pull-right"> <div class="pull-right">
<button class="btn btn-default" ng-click="$dismiss()">{{_('Cancel')}}</button> <button class="btn btn-default" ng-click="$dismiss()">{{_('Cancel')}}</button>
<button class="btn btn-primary" ng-click="goTour()">{{_('Go')}}</button> <button class="btn btn-success" ng-click="goTour()">{{_('Go')}}</button>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save