npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

kibo-filemanager-js

v1.4.1

Published

The JavaScript Filemanager for CKEditor, Quill, TinyMCE editors

Downloads

2

Readme

Filemanager-js

The easy to use Filemanager for CKEditor, Quill, TinyMCE, ...

Commands

  • Select path
  • Uploads
  • Create directory
  • Rename
  • Remove

Properties

  • Lazy loading of directory content
  • Responsive layout
  • Active breadcrumb
  • Sorting by name/ size/ type
  • Uploads multiple files

Filemanager

Filemanager

Filemanager


1. Try it yourself

1.1) Clone repository

[email protected]:Kibo/filemanager-js.git

1.2) Install dependencies

npm i

1.3) Run it

npm run serve

1.4) Look at your browser

localhost:8080

2. Integration with your preferred editor

2.1) Set editor name in filemanager.config.ts

  • EDITORS.ckeditor4
  • EDITORS.quill
  • EDITORS.tinymce5

2.2) Set OUTPUT_PATH and PUBLIC_PATH in vue.config.js


3. Connect the filemanager to your backend API

  • change import in the top of file index.ts
// Remove this import
import * as API from "../api/api-mock";
// Uncoment this import for production
//import * as API from "../api/api-axios";

There are calls to your backend server in file /api/api-axios. You need to implement appropriate methods on your server.

Do you have a NodeJS project? Hire me! Implementation for filesystem, S3, Dropbox, Cloudinary, Google Drive, ...


4. Build the Filemanager

npm run build

5. Connect the Filemanager with your preferred editor

CKEditor 4

@see https://ckeditor.com/docs/ckeditor4/latest/guide/dev_file_browse_upload.html

var editor = CKEDITOR.replace( 'ckeditor1', {
  filebrowserBrowseUrl: "/vendor/kibo-filemanager/index.html"
});

Quill 1.3.7

@see https://quilljs.com/docs/modules/toolbar/#handlers

The filemanager creates image and link dialog too. You're welcome.

LinkDialog LinkDialog

var quill1 = new Quill('#editor', {
  theme: 'snow'
});

var toolbar = quill1.getModule('toolbar');
toolbar.addHandler('image', setImage);
function setImage(value){
  window.open("/vendor/kibo-filemanager/index.html?iname=quill1&filter=image", "filemanager", "height=768,width=1024");
}

toolbar.addHandler('link', setLink);
function setLink(value){
  window.open("/vendor/kibo-filemanager/index.html?iname=quill1&filter=link", "filemanager", "height=768,width=1024");
}

This creates new handlers for image and link. Pls, notice that there are params in filemanager URL: iname and filter.

  • param iname means instance name, and value is the name of quill variable. In this case quill1. This is for case you use multiple instances of quill.
  • param filter means filter, and open image or link dialog.

TyniMCE 5

@see https://www.tiny.cloud/docs/configure/file-image-upload/#file_picker_callback

tinymce.init({
  selector: '#mytextarea',
  height: 500,
  plugins: ['link image'],
  toolbar: 'link image',
  file_picker_callback: function (callback, value, meta) {
        var type = meta.filetype;
        var field_name = 'tinymce-5';
        var w = window,
            d = document,
            e = d.documentElement,
            g = d.getElementsByTagName('body')[0],
            x = w.innerWidth || e.clientWidth || g.clientWidth,
            y = w.innerHeight || e.clientHeight || g.clientHeight;

        var cmsURL = '/vendor/kibo-filemanager/index.html?&field_name=' + field_name + '&langCode=en';

        if (type == 'image') {
            cmsURL = cmsURL + "&type=images";
        }
        tinymce.activeEditor.windowManager.openUrl({
            url: cmsURL,
            title: 'Filemanager',
            width: x * 0.8,
            height: y * 0.8,
            resizable: "yes",
            close_previous: "no",
            onMessage: function (api, data) {
                if (data.mceAction === 'customAction') {
                    callback(data.url);
                    api.close();
                }
            }
        });
    }
});

6. Congratulation


Development

  • There is method onSelect() in file /src/components/Filemenager.vue. It returns an URL of selected file.
  • There are integration files for every editor.
  • The Node (file, directory) has to implement this INode interface.

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Run your unit tests

npm run test:unit

Customize configuration

See Configuration Reference.