Socket
Book a DemoInstallSign in
Socket

amcms_filemanager

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amcms_filemanager

0.2.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

AmcmsFilemanager

Filemanager for tinymce. Allows uploading of files to a remote server via the file picker plugin in Tinymce.

Full Feature List

  • Browse directory
  • Mutli File Upload
  • Rename File
  • Copy File
  • Delete File
  • Make Directory
  • Resize Image
  • Authentication hooks
  • Allowed file types

Usage

How to use my plugin.

Installation

Add this line to your application's Gemfile:

gem 'amcms_filemanager'

And then execute:

$ bundle

Or install it yourself as:

$ gem install amcms_filemanager

Mount the filemanger routes in config/routes.rb

mount AmcmsFilemanager::Engine => '/', as: :amcms_filemanager

Create an initialiser in your project

config/initialisers/amcms_filemanager.rb

AmcmsFilemanager::configure do |config|
  config.root_path = 'images'
  config.authentication = {
    model: :user
  }
end

In your project where TinyMCE is located add this to initialise the filemanager:

const amcmsFileManager = (type, callback) => tinymce.activeEditor.windowManager.openUrl({
  title: 'AMCMS Filemanager',
  url: `http://localhost:3000/filemanager?type=${type}`,
  onMessage: function(instance, event) {
    callback(event.data.location);
    tinymce.activeEditor.windowManager.close();
  },
  width: window.innerWidth - 50,
  height: window.innerHeight - 50,
});

Next add a callback to the filepicker to trigger the filemanager for image, link and media dialogs:

tinymce.init({
  ...
  file_picker_callback: (callback, value, meta) => {
    amcmsFileManager(meta.filetype, callback);
  }
});

FAQs

Package last updated on 24 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.