3
* author: Anthony Dillon
6
function GuidedTourSystem($parent){
10
var browserfilesGuide;
15
var createdocumentsGuide;
16
var createpresentation;
17
var createspreadsheets;
19
var arrowClicked = false;
24
var currentIndex = -1;
27
this.init = function(){
28
homeGuide = {system:'welcome',icon:null, title:null, desc:'We hope you\'ve enjoyed the Ubuntu online tour. <a href="http://www.ubuntu.com/download/ubuntu/download#tour" target="_blank">Ready to download?</a> or <a href="/ubuntu/take-the-tour" >Back to the site</a>', hash: '#'};
30
browserfilesGuide = {system:'home',icon:'img/tourguide/file-small.png', title:'Browse files', desc:'It’s quick and easy to access your folders and files from Ubuntu’s home folder.', hash: 'browser-files'};
31
surfthewebGuide = {system:'firefox',icon:'img/tourguide/firefox-small.png', title:'Surf the web', desc:'Browsing the web is fast and secure with Ubuntu and Firefox.', hash: 'surf-the-web'};
32
checkemailGuide = {system:'email',icon:'img/tourguide/mail-small.png', title:'Check email', desc:'Read, write and send emails with Thunderbird. It’s easy and fast.', hash: 'check-email'};
33
viewphotosGuide = {system:'shotwell',icon:'img/tourguide/shotwell-small.png', title:'View photos', desc:'You can upload, organise, edit and share your photos with Shotwell.', hash: 'view-photos'};
34
findappsGuide = {system:'software',icon:'img/tourguide/apps-small.png', title:'Find apps', desc:'Search and download apps fast from the Ubuntu Software Centre.', hash: 'find-apps'};
35
createdocumentsGuide = {system:'writer',icon:'img/tourguide/document-small.png', title:'Create documents', desc:'LibreOffice Writer makes it easy to draft professional documents.', hash: 'create-documents'};
36
createspreadsheets = {system:'calc',icon:'img/tourguide/calc-small.png', title:'Create spreadsheets', desc:'LibreOffice Calc has everything you need to create clear and accurate spreadsheets.', hash: 'create-spreadsheets'};
37
createpresentation = {system:'impress',icon:'img/tourguide/impress-small.png', title:'Create presentations', desc:'Make a good impression with the intuitive LibreOffice Impress presentation tool.', hash: 'create-presentations'};
38
watchVideosGuide = {system:'movieplayer',icon:'img/tourguide/impress-small.png', title:'Watch videos', desc:'You can watch all your favourite films and videos, DVDs, downloads or movies youve created yourself.', hash: 'watch-video'};
40
guides = new Array(browserfilesGuide, surfthewebGuide, checkemailGuide, viewphotosGuide, findappsGuide, createdocumentsGuide, createspreadsheets, createpresentation, watchVideosGuide);
41
guideCount = guides.length;
42
$('#tour-guide .next-button').bind('click',function(){
43
if(!$(this).hasClass('disabled')){
48
$('#tour-guide .prev-button').bind('click',function(){
49
if(!$(this).hasClass('disabled')){
54
$('#tour-guide .back-to-download').bind('click', function(){
55
_parent.errorMessage.open();
61
this.close = function(){
62
_parent.closeAllWindows(closeAllWindows);
65
this.setSystem = function($system){
66
if($system == 'email-write'){ $system = 'email'; }
69
for(i = 0; i < guides.length; i++){
70
if(guides[i].system == $system){
71
this.setCurrentIndex(i);
76
if(!found){ this.setCurrentIndex(-1); }
81
this.setIndex = function($index){
82
currentIndex = $index;
85
this.setCurrentIndex = function($currentIndex, $update){
86
currentIndex = $currentIndex;
90
this.next = function(){
92
_parent.closeAllWindows(currentIndex);
93
if (currentIndex == guideCount -1) {
100
_parent.systemMenu.handleMenuClick(guides[currentIndex].system);
101
arrowClicked = false;
104
this.prev = function(){
106
_parent.closeAllWindows(currentIndex);
107
if (currentIndex == 0) {
108
currentIndex = guideCount -1;
114
_parent.systemMenu.handleMenuClick(guides[currentIndex].system);
115
arrowClicked = false;
118
this.update = function(){
119
$('#tour-guide .guide-container').hide();
121
if(currentIndex == -1){
122
//$('#tour-guide .prev-button').hide();
123
//$('#tour-guide .next-button').hide();
124
$('#tour-guide .welcome').show();
126
$('#tour-guide .'+guides[currentIndex].system).show();
127
$('#tour-guide .prev-button').show();
128
$('#tour-guide .next-button').show();
132
this.updateHash = function() {
133
window.location.hash = guides[currentIndex].hash;