Widget demo
HTML source
<div id="filebrowser-demo-div" style="width: 500px"></div>
Javascript source
Meteora.uses('Meteora.Filebrowser');
Meteora.onStart(
function() {
new Filebrowser(
'filebrowser-demo-div',
// This is the server-side script that will
// feed the Meteora.Filebrowser widget with
// specially crafted JSON data.
'/demo/ajax_filebrowser'
);
}
);
Meteora.onStart(
function() {
new Filebrowser(
'filebrowser-demo-div',
// This is the server-side script that will
// feed the Meteora.Filebrowser widget with
// specially crafted JSON data.
'/demo/ajax_filebrowser'
);
}
);
JSON response
{
// the current path we are viewing
path: '/current/path',
// current path's data
info: {
path: '/current/path',
ext: 'path',
name: 'path',
size: 4096,
type: {
dir: true,
file: false,
link: false
}
},
// files on this path
files: [
{
path: '/current/path/foo.txt',
ext: 'txt',
name: 'foo.txt',
size: 3445,
type: {
dir: false,
file: true,
link: false
},
html: '<a href="...">...</a>'
},
{
path: '/current/path/bar.txt',
ext: 'txt',
name: 'bar.txt',
size: 18872,
type: {
dir: false,
file: true,
link: false
},
html: '<a href="...">...</a>'
},
{
path: '/current/path/more',
ext: 'more',
name: 'more',
size: 4096,
type: {
dir: true,
file: false,
link: false
},
html: '<a href="...">...</a>'
}
]
}
// the current path we are viewing
path: '/current/path',
// current path's data
info: {
path: '/current/path',
ext: 'path',
name: 'path',
size: 4096,
type: {
dir: true,
file: false,
link: false
}
},
// files on this path
files: [
{
path: '/current/path/foo.txt',
ext: 'txt',
name: 'foo.txt',
size: 3445,
type: {
dir: false,
file: true,
link: false
},
html: '<a href="...">...</a>'
},
{
path: '/current/path/bar.txt',
ext: 'txt',
name: 'bar.txt',
size: 18872,
type: {
dir: false,
file: true,
link: false
},
html: '<a href="...">...</a>'
},
{
path: '/current/path/more',
ext: 'more',
name: 'more',
size: 4096,
type: {
dir: true,
file: false,
link: false
},
html: '<a href="...">...</a>'
}
]
}