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

« back to all changes in this revision

Viewing changes to 12.04/js/shutdownSystem.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
 
 *  Shut Down System
3
 
 *  author: Anthony Dillon
4
 
 */
5
 
 
6
 
function ShutdownSystem(){
7
 
        var _this = this;
8
 
        
9
 
        this.init = function(){
10
 
                $('#shutdown-window  .control .close').bind('click', function(){
11
 
                        _this.close();
12
 
                });
13
 
                $('#shutdown-window .content .shutdown-buttons div').bind('click', function(){
14
 
                        var clickedClass = $(this).attr('class').replace(' highlight', '');
15
 
                        switch(clickedClass){
16
 
                                case 'shutdown':
17
 
                                        _this.shutdownClicked();
18
 
                                break;
19
 
                                case 'cancel':
20
 
                                        _this.cancelClicked();
21
 
                                break;
22
 
                        }
23
 
                });
24
 
                this.center();
25
 
        }
26
 
        
27
 
        this.cancelClicked = function(){
28
 
                this.close();
29
 
        }
30
 
        
31
 
        this.shutdownClicked = function(){
32
 
                window.location.href = 'http://www.ubuntu.com/ubuntu/take-the-tour';
33
 
        }
34
 
        
35
 
        this.open = function(){
36
 
                this.resize();
37
 
                $('#shutdown-window').show();
38
 
                $('#shutdown-window ').trigger('mousedown');
39
 
        }
40
 
        
41
 
        this.close = function(){
42
 
                $('#shutdown-window').hide();
43
 
                this.center();
44
 
        }
45
 
        
46
 
        this.resize = function(){
47
 
                var left = ($(document).width() / 2) - ($('#shutdown-window').width() / 2);
48
 
                var top = ($(document).height() / 2) - ($('#shutdown-window').height() / 2);
49
 
                $('#shutdown-window').css('left',left);
50
 
                $('#shutdown-window').css('top',top-100);
51
 
        }
52
 
        
53
 
        this.center = function(){
54
 
                var left = ($(document).width() / 2) - ($('#shutdown-window').width() / 2);
55
 
                        var top = ($(document).height() / 2) - ($('#shutdown-window').height() / 2);
56
 
                        $('#shutdown-window').css('left',left);
57
 
                        $('#shutdown-window').css('top',top-100);
58
 
            }
59
 
}