3
* author: Anthony DIllon
6
function WelcomeSystem($parent){
10
var windowHeight = 500;//$('#welcome #welcome-screen').outerHeight();
11
var windowWidth = $('#welcome #welcome-screen').outerWidth();
13
this.init = function(){
16
$('#welcome #welcome-screen ul a').bind('click',function(e){
17
_this.startTour($(this).attr('class'));
20
$('#welcome #welcome-screen .explore-mode').bind('click',function(e){
21
_this.startTour('explore-mode');
24
$('#welcome #welcome-screen .tour-mode').bind('click',function(e){
25
_this.startTour('tour-mode');
28
$('#welcome #welcome-screen .close').bind('click',function(e){
29
_this.startTour('explore-mode');
31
$('#welcome #welcome-screen').show();
32
var hash = window.location.hash;
33
if (hash != undefined) {
34
_this.startTour(hash.substring(1));
38
this.startTour = function(tourId) {
43
_parent.guidedTourSystem.setCurrentIndex(0);
44
_parent.systemMenu.handleMenuClick('home');
49
_parent.guidedTourSystem.setCurrentIndex(1);
50
_parent.systemMenu.handleMenuClick('firefox');
55
_parent.guidedTourSystem.setCurrentIndex(2);
56
_parent.systemMenu.handleMenuClick('email');
61
_parent.guidedTourSystem.setCurrentIndex(3);
62
_parent.systemMenu.handleMenuClick('shotwell');
67
_parent.guidedTourSystem.setCurrentIndex(4);
68
_parent.systemMenu.handleMenuClick('software');
70
case 'create-documents':
73
_parent.guidedTourSystem.setCurrentIndex(5);
74
_parent.systemMenu.handleMenuClick('writer');
76
case 'create-presentations':
79
_parent.guidedTourSystem.setCurrentIndex(6);
80
_parent.systemMenu.handleMenuClick('impress');
82
case 'create-spreadsheets':
85
_parent.guidedTourSystem.setCurrentIndex(7);
86
_parent.systemMenu.handleMenuClick('calc');
91
_parent.guidedTourSystem.setCurrentIndex(8);
92
_parent.systemMenu.handleMenuClick('movieplayer');
93
_parent.moviePlayerSystem.addVideo();
100
$('#welcome').hide();
102
_parent.guidedTourSystem.setCurrentIndex(0);
103
_parent.systemMenu.handleMenuClick('home');
109
$('#tour-guide .explore-to-welcome').bind('click',function(){
112
$('#tour-guide .explore-to-download').bind('click',function(){
113
_parent.errorMessage.open();
115
$('#tour-guide .explore-to-exit').bind('click',function(){
116
window.location.replace("http://www.ubuntu.com");
118
/*if($('#tour-guide').is(':visible')){
119
$('.explore-to-welcome').css('bottom',210);
120
$('.explore-to-download').css('bottom',150);
122
$('.explore-to-welcome').css('bottom',80);
123
$('.explore-to-download').css('bottom',20);
127
this.open = function(){
129
$('#welcome').show();
133
this.center = function(){
134
var left = ($(document).width() / 2) - (windowWidth / 2);
135
var top = Math.max(24,($(document).height() / 2) - (windowHeight / 2));
136
$('#welcome #welcome-screen').css('left',left);
137
$('#welcome #welcome-screen').css('top',top);
140
this.resize = function(){
144
this.isOpen = function(){