Project

General

Profile

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

    
5
jQuery(document).ready(
6
	function() {
7
		jQuery("#fbOpen").click(
8
			function() {
9
				jQuery("#fbBrowser").fadeIn(750);
10
				fbBrowse(jQuery("#fbTarget").val());
11
			}
12
		);
13
	}
14
);
15

    
16
function fbBrowse(path) {
17
	jQuery("#fileContent").fadeOut();
18

    
19
	if(jQuery("#fbCurrentDir"))
20
		jQuery("#fbCurrentDir").html("Loading ...");
21

    
22
	jQuery.ajax(
23
		"/filebrowser/browser.php?path=" + encodeURI(path ? path : "/"),
24
		{ type: "get", complete: fbComplete }
25
	);
26
	
27
}
28

    
29
function fbComplete(req) {
30
	jQuery("#fbBrowser").html(req.responseText);
31

    
32
	var actions = {
33
		fbHome:  function() { fbBrowse("/");                                },
34
		fbClose: function() { jQuery("#fbBrowser").fadeOut(750); },
35
		fbDir:   function() { fbBrowse(this.id);                            },
36
		fbFile:  function() { jQuery("#fbTarget").val(this.id);             }
37
	}
38

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