Project

General

Profile

Download (1.08 KB) Statistics
| Branch: | Tag: | Revision:
1
/*
2
	pfSense_MODULE:	shell
3
*/
4

    
5
Event.observe(
6
	window, "load",
7
	function() {
8
		Event.observe(
9
			"fbOpen", "click",
10
			function() {
11
				Effect.Appear("fbBrowser", { duration: 0.75 });
12
				fbBrowse($("fbTarget").value);
13
			}
14
		);
15
	}
16
);
17

    
18
function fbBrowse(path) {
19
	new Effect.Fade("fileContent");
20

    
21
	if($("fbCurrentDir"))
22
		$("fbCurrentDir").innerHTML = "Loading ...";
23

    
24
	new Ajax.Request(
25
		"/filebrowser/browser.php?path=" + encodeURI(path ? path : "/"),
26
		{ method: "get", onComplete: fbComplete }
27
	);
28
	
29
}
30

    
31
function fbComplete(req) {
32
	$("fbBrowser").innerHTML = req.responseText;
33

    
34
	var actions = {
35
		fbHome:  function() { fbBrowse("/");                                },
36
		fbClose: function() { Effect.Fade("fbBrowser", { duration: 0.75 }); },
37
		fbDir:   function() { fbBrowse(this.id);                            },
38
		fbFile:  function() { $("fbTarget").value = this.id;                }
39
	}
40

    
41
	for(var type in actions) {
42
		$A(Element.getElementsByClassName("fbBrowser", type)).each(
43
			function(element) {
44
				Event.observe(element, "click", actions[type]);
45
				element.style.cursor = "pointer";
46
			}
47
		);
48
	}
49
}
(1-1/2)