Project

General

Profile

Download (935 Bytes) Statistics
| Branch: | Tag: | Revision:
1
$(document).ready(
2
	function() {
3
		$("#fbOpen").click(
4
			function() {
5
				$("#fbBrowser").fadeIn(750);
6
				fbBrowse($("#fbTarget").val());
7
			}
8
		);
9
	}
10
);
11

    
12
function fbBrowse(path) {
13
	$("#fileContent").fadeOut();
14

    
15
	if ($("#fbCurrentDir")) {
16
		$("#fbCurrentDir").html("Loading ...");
17
	}
18

    
19
	$.ajax(
20
		"/filebrowser/browser.php?path=" + encodeURI(path ? path : "/"),
21
		{ type: "get", complete: fbComplete }
22
	);
23

    
24
}
25

    
26
function fbComplete(req) {
27
	$("#fbBrowser").html(req.responseText);
28

    
29
	var actions = {
30
		fbHome:  function() { fbBrowse("/");                                },
31
		fbClose: function() { $("#fbBrowser").fadeOut(750); },
32
		fbDir:   function() { fbBrowse(this.id);                            },
33
		fbFile:  function() { $("#fbTarget").val(this.id);             }
34
	}
35

    
36
	for (var type in actions) {
37
		$("#fbBrowser ." + type).each(
38
			function() {
39
				$(this).click(actions[type]);
40
				$(this).css("cursor","pointer");
41
			}
42
		);
43
	}
44
}
(1-1/2)