loadItemsUrl |
// loadItemsUrl
1. Example file: expected returned json loadfiles.json
2. The current working example is using static file.
3. Better to limit the loaded file so the page load time doesnt heavy.
4. Each item is loaded as 'media item object'
5. The example file from No. 1, the 'media item object' is
{
"path": "files/",
"filename": "unsplash-1.jpg"
}
6. The example file from No. 1 is what to be expected from loading the data, though you can add more information to the 'media item object', and i encourage you to add the image id to it, so the delete function will be perfeclty functioned
{
"id": 1,
"path": "files/",
"filename": "unsplash-1.jpg",
}
|
loadNextItemsUrl |
// loadNextItemsUrl
1. Example file: expected returned json loadnextfiles.json
2. The current working example is using static file.
3. The loadNextItem is happening when the scrollbar at Media Manager reach bottom, the loadNextItem has 5second delay (default)(can be changed) before can be executed again.
4. This function send the current total loaded item in Media Manager to be used at backend for showing the next loaded item, you can just see what data is sent at dev tools, network panel.
|
deleteItemUrl |
// deleteItemUrl
1. If this options is filled with a working URL, Media Manager will send additional 'media item object' to provide information about the item that is being deleted.
2. 'Media item object' is retrieved from loaded items object.
3. The current example of 'media item object' is:
{
"path": "files/",
"filename": "unsplash-1.jpg"
}
Or you can just see what data is sent when media item is being deleted at dev tools, network panel.
|
uploadUrl |
// uploadUrl
1. To enable the upload feature, include dropzone.js and specified what is the upload url, after successfully uploading the file, Media Manager will read the data returned from uploading and append it, so the expected data returned from uploading is exactly needed.
2. The expected returned data is a usual 'media item object' path and filename is most needed
{
"path": "files/",
"filename": "unsplash-1.jpg"
}
3. Please refer to: uploadfiles.php for uploading files using PHP, this is a minimalistic approach
|
insertType |
// insertType
1. insertType is accepting 'object', 'html', and 'string'
2. The data returned is:
object: The data will return 'media item object', like { "path": "files/", "filename": "unsplash-1.jpg" },
html: The data is returned as HTML DOM,
string: The data is returned as text, the data will be look like HTML DOM in the form of text.
3. Please do a test and look at dev tools console tab
|
insert |
// insert
1. This options accept a function, this function will be executed when 'Insert to post' button is pressed.
2. You can see how this function perform at the Media Manager example above
|