Browse Source

Define layout object for each slide.

pull/149/head
Evan Theurer 12 years ago
parent
commit
7c39bc2277
  1. 92
      static/js/directives/helptour.js

92
static/js/directives/helptour.js

@ -25,6 +25,7 @@ define(['jquery', 'angular', 'text!partials/helpoverlay.html', 'text!partials/he
return [function() { return [function() {
var controller = ['$scope', '$timeout', '$modal', '$rootScope', 'mediaStream', function($scope, $timeout, $modal, $rootScope, mediaStream) { var controller = ['$scope', '$timeout', '$modal', '$rootScope', 'mediaStream', function($scope, $timeout, $modal, $rootScope, mediaStream) {
var isToggled = false;
var displayTime = 12000; var displayTime = 12000;
var shown = localStorage.getItem('mediastream-helptour'); var shown = localStorage.getItem('mediastream-helptour');
var timeoutAutoStepsIn = []; var timeoutAutoStepsIn = [];
@ -38,25 +39,94 @@ define(['jquery', 'angular', 'text!partials/helpoverlay.html', 'text!partials/he
chatMaximized: false, chatMaximized: false,
main: null, main: null,
presentation: false, presentation: false,
roombar: false,
screenshare: false,
settings: false
};
var tourLayoutShowRoomPane = {
buddylist: true,
buddylistAutoHide: false,
chat: false,
chatMaximized: false,
main: null,
presentation: false,
roombar: true,
screenshare: false,
settings: false
};
var tourLayoutShowBuddyListPane = {
buddylist: true,
buddylistAutoHide: false,
chat: false,
chatMaximized: false,
main: null,
presentation: false,
roombar: false,
screenshare: false,
settings: false
};
var tourLayoutShowChatPane = {
buddylist: true,
buddylistAutoHide: false,
chat: true,
chatMaximized: false,
main: null,
presentation: false,
roombar: false,
screenshare: false,
settings: false
};
var tourLayoutShowSettingsPane = {
buddylist: false,
buddylistAutoHide: false,
chat: false,
chatMaximized: false,
main: null,
presentation: false,
roombar: false,
screenshare: false,
settings: true
};
var tourLayoutShowMediaAccessPane = {
buddylist: true,
buddylistAutoHide: false,
chat: false,
chatMaximized: false,
main: null,
presentation: false,
roombar: false,
screenshare: false,
settings: false
};
var tourLayoutShowWelcomePane = {
buddylist: true,
buddylistAutoHide: false,
chat: false,
chatMaximized: false,
main: null,
presentation: false,
roombar: false,
screenshare: false, screenshare: false,
settings: false settings: false
}; };
var trigger = false;
menus.triggerMediaAccess = function() { menus.triggerMediaAccess = function() {
if (trigger) { if (isToggled) {
mediaStream.webrtc.testMediaAccess(function() {}); mediaStream.webrtc.testMediaAccess(function() {});
} else { } else {
mediaStream.webrtc.stop(); mediaStream.webrtc.stop();
} }
}; };
menus.toggleRoom = function(css) { menus.initRoomLayout = function() {
$scope.layout.roombar = !$scope.layout.roombar; $scope.layout = angular.extend($scope.layout, tourLayout);
};
menus.toggleRoom = function() {
$scope.layout = angular.extend($scope.layout, tourLayoutShowRoomPane);
}; };
menus.toggleChat = function() { menus.toggleChat = function() {
$scope.layout.chat = !$scope.layout.chat; $scope.layout = angular.extend($scope.layout, tourLayoutShowChatPane);
}; };
menus.toggleSettings = function() { menus.toggleSettings = function() {
$scope.layout.settings = !$scope.layout.settings; $scope.layout = angular.extend($scope.layout, tourLayoutShowSettingsPane);
}; };
menus.toggleCSS = function(css) { menus.toggleCSS = function(css) {
$('body').toggleClass(css); $('body').toggleClass(css);
@ -65,10 +135,12 @@ define(['jquery', 'angular', 'text!partials/helpoverlay.html', 'text!partials/he
var menu = $($scope.steps[$scope.currentIndex]).data('menu'); var menu = $($scope.steps[$scope.currentIndex]).data('menu');
var css = $($scope.steps[$scope.currentIndex]).data('css'); var css = $($scope.steps[$scope.currentIndex]).data('css');
if (menu) { if (menu) {
if (menu.search('trigger') > -1) { isToggled = !isToggled;
trigger = !trigger; if(!isToggled) {
menus.initRoomLayout();
} else {
menus[menu]();
} }
menus[menu](css);
} }
if (css) { if (css) {
menus.toggleCSS(css); menus.toggleCSS(css);
@ -123,7 +195,7 @@ define(['jquery', 'angular', 'text!partials/helpoverlay.html', 'text!partials/he
}; };
var initTour = function() { var initTour = function() {
backupLayout = angular.extend({}, $scope.layout); backupLayout = angular.extend({}, $scope.layout);
$scope.layout = angular.extend($scope.layout, tourLayout); menus.initRoomLayout();
autoTour(); autoTour();
}; };
var reset = function() { var reset = function() {

Loading…
Cancel
Save