Project

General

Profile

Download (1.01 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

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

    
28
}
29

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

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

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