~cm-t/ubuntu-fr-tour/ubuntu-fr-tour

« back to all changes in this revision

Viewing changes to 13.04/12.04/js/welcomesystem.js

  • Committer: cm-t arudy
  • Date: 2013-10-22 01:24:09 UTC
  • Revision ID: arudy@ubuntu-fr.org-20131022012409-3dmo4i9u4ufohe5f
First Fr push to 13.10
Fixed many icons (updated to new version or fixed graphic)
Added Cloud indicator
Added Keyboard uindicator
Fixed many layout to fit Fr string

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *  Welcome System
3
 
 *  author: Anthony DIllon
4
 
 */
5
 
 
6
 
function WelcomeSystem($parent){
7
 
        var _parent = $parent;
8
 
        var _this = this;
9
 
        var _isOpen = false;
10
 
        
11
 
        this.init = function(){
12
 
                this.center();
13
 
                this.open();
14
 
                $('#welcome #welcome-screen ul a').bind('click',function(e){
15
 
                        _this.startTour($(this).attr('class'));
16
 
                });
17
 
                
18
 
                $('#welcome #welcome-screen .explore-mode').bind('click',function(e){
19
 
                        _this.startTour('explore-mode');
20
 
                });
21
 
                
22
 
                $('#welcome #welcome-screen .tour-mode').bind('click',function(e){
23
 
                        _this.startTour('tour-mode');
24
 
                });
25
 
                
26
 
                $('#welcome #welcome-screen .close').bind('click',function(e){
27
 
                        _this.startTour('explore-mode');
28
 
                });
29
 
                $('#welcome  #welcome-screen').show();
30
 
                var hash = window.location.hash; 
31
 
                if (hash != undefined) {
32
 
                        _this.startTour(hash.substring(1));
33
 
                }
34
 
        }
35
 
        
36
 
        this.startTour = function(tourId) {
37
 
                switch(tourId){
38
 
                        case 'browse-files':
39
 
                                $('#welcome').hide();
40
 
                                _isOpen = false;
41
 
                                _parent.guidedTourSystem.setCurrentIndex(0);
42
 
                                _parent.systemMenu.handleMenuClick('home');
43
 
                        break;
44
 
                        case 'surf-the-web':
45
 
                                $('#welcome').hide();
46
 
                                _isOpen = false;
47
 
                                _parent.guidedTourSystem.setCurrentIndex(1);
48
 
                            _parent.systemMenu.handleMenuClick('firefox');
49
 
                        break;
50
 
                        case 'check-email':
51
 
                                $('#welcome').hide();
52
 
                                _isOpen = false;
53
 
                                _parent.guidedTourSystem.setCurrentIndex(2);
54
 
                                _parent.systemMenu.handleMenuClick('email');
55
 
                        break;
56
 
                        case 'view-photos':
57
 
                                $('#welcome').hide();
58
 
                                _isOpen = false;
59
 
                                _parent.guidedTourSystem.setCurrentIndex(3);
60
 
                                _parent.systemMenu.handleMenuClick('shotwell');
61
 
                        break;
62
 
                        case 'find-apps':
63
 
                                $('#welcome').hide();
64
 
                                _isOpen = false;
65
 
                                _parent.guidedTourSystem.setCurrentIndex(4);
66
 
                                _parent.systemMenu.handleMenuClick('software');
67
 
                        break;
68
 
                        case 'create-documents':
69
 
                                $('#welcome').hide();
70
 
                                _isOpen = false;
71
 
                                _parent.guidedTourSystem.setCurrentIndex(5);
72
 
                                _parent.systemMenu.handleMenuClick('writer');
73
 
                        break;
74
 
                        case 'create-presentations':
75
 
                                $('#welcome').hide();
76
 
                                _isOpen = false;
77
 
                                _parent.guidedTourSystem.setCurrentIndex(6);
78
 
                                _parent.systemMenu.handleMenuClick('impress');
79
 
                        break;
80
 
                        case 'create-spreadsheets':
81
 
                                $('#welcome').hide();
82
 
                                _isOpen = false;
83
 
                                _parent.guidedTourSystem.setCurrentIndex(7);
84
 
                            _parent.systemMenu.handleMenuClick('calc');
85
 
                        break;
86
 
                        case 'explore-mode':
87
 
                                $('#welcome').hide();
88
 
                                _isOpen = false;
89
 
                        break;
90
 
                        case 'tour-mode':
91
 
                                $('#welcome').hide();
92
 
                                _isOpen = false;
93
 
                                _parent.guidedTourSystem.setCurrentIndex(0);
94
 
                                _parent.systemMenu.handleMenuClick('home');
95
 
                        break;
96
 
                        default:
97
 
                                return false;
98
 
                        break;
99
 
                }
100
 
                $('#tour-guide .explore-to-welcome').bind('click',function(){
101
 
                        _this.open();
102
 
                });
103
 
                $('#tour-guide .explore-to-welcome').bind('mouseover',function(){
104
 
                        $('#tour-guide .explore-tooltip-welcome').show();
105
 
                });
106
 
                $('#tour-guide .explore-to-welcome').bind('mouseout',function(){
107
 
                        $('#tour-guide .explore-tooltip-welcome').hide();
108
 
                });
109
 
                $('#tour-guide .explore-to-download').bind('mouseover',function(){
110
 
                        $('#tour-guide .explore-tooltip-download').show();
111
 
                });
112
 
                $('#tour-guide .explore-to-download').bind('mouseout',function(){
113
 
                        $('#tour-guide .explore-tooltip-download').hide();
114
 
                });
115
 
                $('#tour-guide .explore-to-download').bind('click',function(){
116
 
                        _parent.errorMessage.open();
117
 
                });
118
 
                /*if($('#tour-guide').is(':visible')){
119
 
                        $('.explore-to-welcome').css('bottom',210);
120
 
                        $('.explore-to-download').css('bottom',150);
121
 
                }else{
122
 
                        $('.explore-to-welcome').css('bottom',80);
123
 
                        $('.explore-to-download').css('bottom',20);
124
 
                }*/
125
 
        }
126
 
        
127
 
        this.open = function(){
128
 
                _isOpen = true;
129
 
                $('#welcome').show();
130
 
                
131
 
        }
132
 
        
133
 
        this.center = function(){
134
 
            var windowHeight = 575;//$('#welcome #welcome-screen').outerWidth(true);
135
 
        var left = ($(document).width() / 2) - (windowHeight / 2);
136
 
                var top = Math.max(24,($(document).height() / 2) - (windowHeight / 2));
137
 
                $('#welcome #welcome-screen').css('left',left);
138
 
                $('#welcome #welcome-screen').css('top',top); 
139
 
        }
140
 
            
141
 
        this.resize = function(){
142
 
                this.center();
143
 
        }
144
 
        
145
 
        this.isOpen = function(){
146
 
                return _isOpen;
147
 
        }
148
 
        
149
 
}