Code Monkey home page Code Monkey logo

mm's Introduction

Media Manager

Media Manager is an open source web file manager and can be a nice alternative to Wordpress Media Manager, CKFinder, KCFinder, elFinder... It is still in its early stages, but feel free to use it, report bugs and contribute.

screenshot

This project use Javascript and :

Demo

https://www.iutbayonne.univ-pau.fr/~klevron/mm/

Features

  • Backends (by using flysystem) :
    • Local
    • FTP
    • SFTP
    • ...
  • Drag&drop file upload
  • Multiple file upload
  • Image preview
  • Input option
  • Multilanguage
  • File actions :
    • Details
    • Download
    • Rename / Move
    • Delete
  • Folder actions :
    • Details
    • Download
    • Rename / Move
    • Delete
  • Context menu
  • vuejs component
  • npm package
  • Integration :
    • CKEditor plugin
    • TinyMCE plugin
    • Drupal module

Install

Client

<link href="mm.min.css" rel="stylesheet">
...
<script src="mm.min.js"></script>

Server

Media Manager is a client side tool, it will display files located on a server, it needs a web service to communicate with :

  • you can use a simple server : mm-server,
  • or you can build your own, take a look at API doc.

Usage

HTML

<div id="media-manager"></div>

JavaScript

new MM({
    el: '#media-manager',
    api: {
        baseUrl: 'https://server.com/api/',
        listUrl: 'list',
        downloadUrl: 'download',  // optional
        uploadUrl: 'upload',      // optional
        deleteUrl: 'delete'       // optional
    }
});

With input

HTML

<input type="text" id="file-input">
<div id="media-manager"></div>

JavaScript

new MM({
    el: '#media-manager',
    api: {
        baseUrl: 'https://server.com/api/',
        listUrl: 'list'
    },
    input: {
        el: '#file-input',
        multiple: false
    }
});

Options

el

  • Type : String
  • Details : CSS selector string.

basePath

  • Type : String
  • Default : ""
  • Details : Base path with a trailing slash, e.g. "folder/".

api

  • Type : Object
  • Details : API Config.

api.baseUrl

  • Type : String
  • Default : null

api.listUrl

  • Type : String
  • Default : null

api.downloadUrl

  • Type : String
  • Default : null

api.uploadUrl

  • Type : String
  • Default : null

api.options

  • Type : Object
  • Default : {}
  • Details : Will be used to create an axios instance.

input

  • Type : Object
  • Default : false
  • Details : Input config.

input.el

  • Type : String
  • Details : CSS selector string.

input.multiple

  • Type : Boolean

selected

  • Type : String|array
  • Details : Selected medias.

onSelect(event)

  • Type : function
  • Details : Select callback, use event.selected to get selected files.

showBreadcrumb

  • Type : Boolean
  • Default : true

height

  • Type : String
  • Default : null
  • Details : Use this if you want a fixed height, e.g. '600px'.

mm's People

Contributors

klevron avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.