Browse Source

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

pull/122/head
Evan Theurer 12 years ago
parent
commit
e77c96c478
  1. 13
      static/js/directives/helptour.js
  2. 4
      static/partials/helptour.html

13
static/js/directives/helptour.js

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

4
static/partials/helptour.html

@ -4,12 +4,12 @@ @@ -4,12 +4,12 @@
<h3 class="modal-title">{{_('Tour')}}</h3>
</div>
<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 class="modal-footer">
<div class="pull-right">
<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>

Loading…
Cancel
Save