blob: 564d49d47d6ff7e8f516b98a17fa1028441c32ac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
$(document).ready(
function() {
$("#fbOpen").click(
function() {
$("#fbBrowser").fadeIn(750);
fbBrowse($("#fbTarget").val());
}
);
}
);
function fbBrowse(path) {
$("#fileContent").fadeOut();
if ($("#fbCurrentDir")) {
$("#fbCurrentDir").html("Loading ...");
}
$.ajax(
"/vendor/filebrowser/browser.php?path=" + encodeURI(path ? path : "/"),
{ type: "get", complete: fbComplete }
);
}
function fbComplete(req) {
$("#fbBrowser").html(req.responseText);
var actions = {
fbHome: function() { fbBrowse("/"); },
fbClose: function() { $("#fbBrowser").fadeOut(750); },
fbDir: function() { fbBrowse(this.id); },
fbFile: function() { $("#fbTarget").val(this.id); }
}
for (var type in actions) {
$("#fbBrowser ." + type).each(
function() {
$(this).click(actions[type]);
$(this).css("cursor","pointer");
}
);
}
}
|