kalamu/media-manager
Composer 安装命令:
composer require kalamu/media-manager
包简介
Javascript library for media managment on top of a RESTfull API
README 文档
README
This library is a JavaScript media manager based on top of a RESTFull API. The library include only the client side library.
The goal is to provide a simple interface for :
- consulting medias
- uploadind/downloading files
- making simple changes on medias
- selecting files (in a form context)
For the moment, the library only work for images, but we plan to manage more types of files shortly
KalamuMediaManager
Constructor
var manager = new KalamuMediaManager(config);
Config is a object with the following properties.
| Parameter | Required ? | Description |
|---|---|---|
lang |
optional | Define the interface language. If not set, navigator.language is used. Accepted values are : en, fr |
dropZone |
required | DOM Element to add files (by drag'n drop or file input) |
displayZone |
required | DOM Element to display the file list |
infoZone |
required | DOM Element that must be a bootstrap modal to display file informations |
apiEntryPoint |
required | URL address of the RESTfull API |
selectable |
optional | Define if the files can be selected. Accepted values are : none, single, multiple |
onStart |
optional | Function triggered at startup, once the file list has been fetched from the API |
onSelectionChanged |
optional | Function triggered when the user change the file selection |
Methods
getImages()
Return the list of image objects that are on the manager.
Exemple :
console.log(manager.getImages()); // > Array(4) [ {...}, {...}, {...}, {...} ] // get the uniq identifier of an image console.log(manager.getImages()[0].config.identifier); // > "0be916c4219e1a26c..."
getSelection()
Return an array containing the identifier of each image selected.
Exemple :
console.log(manager.getSelection()); // > Array(2) [ "0be916c4219e1a26c...", "15b8669705ab106b00bfc..." ]
setSelection(identifiers)
This method allow to set which files are selected.
Exemple :
console.log(manager.getSelection()); // > Array(2) [ "0be916c4219e1a26c...", "15b8669705ab106b00bfc..." ] manager.setSelection(["0be916c4219e1a26c..."]); // change the selection console.log(manager.getSelection()); // > Array(1) [ "0be916c4219e1a26c..." ]
kalamu/media-manager 适用场景与选型建议
kalamu/media-manager 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 06 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 kalamu/media-manager 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kalamu/media-manager 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-06-14