source: pro-bachkim-filespace/sourcecode/assets/js/filemanager/filemanager.js @ 10

Last change on this file since 10 was 10, checked in by dungnv, 11 years ago
  • Property svn:mime-type set to text/plain
File size: 2.0 KB
Line 
1jQuery(
2        function($) {
3
4                /**
5                For resize panels on main screen
6                */
7                var maxWidth = 0;
8                function getDirTreeMaxWidth () {
9                        var scrWidth = $('#main-content').width();
10                        return parseInt(scrWidth / 2);
11                }
12
13                function layout ()
14                {
15                        var scrWidth = $('#main-content').width();
16                        var scrHeght = $(window).height();
17                        var dirTreeHeight = scrHeght - $('#title-bar').height() - $('#tools-bar').height() - $('#status-bar').height() - 2;
18
19                        $('#directory-view-container').height(dirTreeHeight);
20                        $('#directory-content-view-container').height(dirTreeHeight);
21                        $('#directory-content-view-container').width('calc(100% - ' + ($('#directory-view-container').width() + 8) + 'px)');
22                        var scollWidth = $('#directory-content-view-container').width();
23
24                        maxWidth = getDirTreeMaxWidth();
25
26                        $('#treeview-container').height(dirTreeHeight - 5);
27                }
28
29                layout ();
30
31                $('#directory-view-container').resizable({
32                        maxWidth: maxWidth,
33                        minWidth: 220,
34                        handles: "e",
35                        resize: function (event, ui) {
36                                layout ();
37                        }
38                });
39
40                $(window).resize (function() {layout ();$('#directory-view-container').resizable({maxWidth: maxWidth});});
41
42                /**
43                END - For resize panels on main screen
44                */
45
46
47                /**
48                For Directory Tree
49                */
50
51                var privateGrid = $('#file-container').violetGrid ({directoryContent:null});
52
53                var privateTree =  $('#treeview-container').violetTree({
54                        script:'http://localhost/ajax/privatecontent/getcontent',
55                        expandEasing: 'easeOutBounce',
56                        collapseEasing: 'easeOutBounce',
57                        homeDirNameDisplay: "Thư mục gốc",
58                        grid: privateGrid
59                });
60
61
62                $('#btnNewFolder').click (function(){
63                        var curDir = privateTree.getCurrentDir();
64                        privateTree.createDir(curDir);
65                });
66
67                $('#btnDel').click (function() {
68                        var curDir = privateTree.getCurrentDir();
69                        privateTree.deleteDir(curDir);
70                });
71
72                $('#btnCopy').click (function(){
73                        privateTree.copy();
74                });
75
76                /**
77                END - For Directory Tree
78                */
79
80        }
81);
Note: See TracBrowser for help on using the repository browser.