Documentation
API / Browse
This method allows you to browse for files in the MoxieManager and insert these into form fields or to a custom callback function.
Parameters
Name | Description |
---|---|
path |
Public file system path to display by default. For example: In order to configure a different start path from the rootpath, the first part of the path needs to be the last part of the rootpath. So if your rootpath is |
rootpath |
Public file system path to use as the root. This option needs to be within the configured backend |
fields | Comma separated list of field ID's to populate with selected file url. If you are using oninsert you can not use fields option and the other way around. |
view | Default view to open. Defaults to files but can also be configured to thumbs . |
insert | Boolean option that allows you to disable the insert functionallity. Can be used when the moxiemanager is used in standalone mode. |
filter | Initial filter to apply to file selection. This option will fill the filter input field with the value specified. |
extensions | Comma separated list of file extensions to display for. |
include_file_pattern | Regexp pattern that the files need to match inorder to be displayed. |
exclude_file_pattern | Regexp pattern that will be excluded from file list if it matches. |
include_directory_pattern | Regexp pattern that the directories need to mathc inorder to be displayed. |
exclude_directory_pattern | Regexp pattern that will be exluded from file list if it matches. |
disabled_tools | Comma separated list of tools to disable. |
hidden_tools | Comma separated list of tools to hide. |
url | Url of input file. If this is specified the MoxieManager will try to resolve the URL into a local file system path and the open the parent directory of that file and select the file. |
relative_urls | If this option is set to true, all URLs returned from the MoxieManager will be relative from the specified document_base_url. This option is set to false by default. |
document_base_url | Document base URL defaults to the current page. This is the point relative URLs will be relative to. |
no_host | Enables you to remove scheme/protocol and host name from urls produced. |
multiple | Boolean value, enable inserting multiple files or not, default true. |
width | Set the default width of the window, note that a to small value may break the UI. Should be a number pixel value only, example: width: 600 |
height | Set the default height of the window, note that a to small value may break the UI. Should be a number pixel value only, example: height: 400 |
fullscreen | Boolean value, set to true to open in fullscreen, default false. |
title | Sets the title of the main screen, replaces "MoxieManager" default title. |
leftpanel | Boolean value, display or hide the left filesystems panel, true by default. |
insert_filter | Callback that gets executed when files are selected and inserted. This callback allows you to alter the JSON data before it gets inserted into a form field or passed to the oninsert callback. |
skin | Enables you to set a custom skin to be used created by the skin tool. |
filelist_main_toolbar | Enables you to control what to display in the main toolbar of the filelist browse dialog. |
filelist_utils_toolbar | Enables you to control what to display in the utils toolbar of the filelist browse dialog. |
filelist_manage_menu | Enables you to configure what to display in the manage button menu. |
filelist_context_menu | Enables you to configure what to display in the context menu. |
filelist_insert_toolbar | Enables you to configure what to display in the insert/cancel toolbar. |
editimage_main_toolbar | Enables you to control what to display in the main toolbar of the edit image dialog. |
editimage_zoom_toolbar | Enables you to control what to display in the zoom toobar of the edit image dialog. |
editimage_actions_toolbar | Enables you to control what to display in the actions toolbar/pabel of the edit image dialog. |
fileinfo_fields | Space separated list of fields to display currently "path" and "url". |
remember_last_path | When enabled the MoxieManager will remember the last path the user was in when a file was selected. |
sort_by | Changes the default sort by column for file listings. |
sort_order | Changed the default sort order asc/desc. |
filelist_insert_event | Lets you specify an event to insert on can be click, dblclick or none. |
Events
In version 2.0 of MoxieManager, some events where removed and added by requestion from the users, this is a list of these events.
Name | Description |
onopen | Event triggered when opening. |
onclose | Event triggered when closing. |
onupload | Event triggered when an upload is completed. |
onsave | Event triggered when a text file or image is edited. |
oninsert | Event triggered when file is inserted. |
oncreate | Event triggered when folder is created. |
Examples
Default path to browse files from
moxman.browse({
path: '/files/images'
});
Custom oninsert callback function
moxman.browse({
oninsert: function(args) {
console.log(args.focusedFile);
}
});
On create event testing
moxman.browse({
oncreate: function(args) {
console.log(args);
}
});
You can also use events when calling createDoc (or other dialogs) directly
moxman.createDir({path: '/files', oncreate: alert('File created')});