~ya-bo-ng/ubuntu-online-tour/13.10

« back to all changes in this revision

Viewing changes to 13.04/12.10/js/folders.js

  • Committer: Anthony Dillon
  • Date: 2013-10-02 09:35:39 UTC
  • Revision ID: anthony.dillon@canonical.com-20131002093539-ewxr0tx9oi85ppoi
Inishal setup of the 13.10 version of the tour

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
* Folder object
 
3
*  author: Anthony Dillon
 
4
*/
 
5
 
 
6
function Folder($name, $location){ 
 
7
        if ($name==undefined) { $name='Untitled Folder';}
 
8
        if ($location==undefined) { $location='/Home';}
 
9
        var _name = $name;
 
10
        var _size = '6.2 GB';
 
11
        var _location = $location;
 
12
        var _in_bin = false;
 
13
 
 
14
        this.name = function (){ return _name; };
 
15
        this.size = function (){ return _size; };
 
16
        this.location = function (){ return _location; };
 
17
        this.in_bin = function (){ return _in_bin; };
 
18
        
 
19
        this.rename = function($name){
 
20
                _name = $name;
 
21
        }
 
22
        
 
23
        this.bin = function($in_bin){
 
24
                _in_bin = $in_bin;
 
25
        }
 
26
        
 
27
        this.move = function($location){
 
28
                _location = $location;
 
29
        }
 
30
        
 
31
        this.drawIcon = function($id, $type){
 
32
                return  "<div class='file-folder "+$type+"' data-type='folder' data-id='"+$id+"'><p></p><span>"+_name+"</span></div>";
 
33
        }
 
34
        
 
35
        this.type = function(){ 
 
36
                return 'folder';
 
37
        }
 
38
}
 
39