Giter VIP home page Giter VIP logo

tinymce_filelink's Introduction

TinyMCE File Link

A TinyMCE plugin with a toolbar button that opens a dialog to conveniently insert a link to a file previously uploaded to the server. Like the link plugin does, but more convenient.

Toolbar icon

The listing has filters, provides more info about the file, and allows to preview the file.

Screenshot of the open dialog

Useful, if you have lots of files (like documents) and need to link to them in content regularly.

The listing is a view, so if you need more or different filter criteria or more info columns, adapt the "tinymce_file_browser" view as needed via Views admin UI.

If people have access to the editor, but no access to the browser view (by views access setting), the button will still be visible, but disabled.

The browser view also allows to change the link contents, as the markup from the preview column is the markup that will get inserted. Unless you selected an image or text in the editor before opening the dialog, as then the link will get wrapped around your selection.

Installation

Install this module using the official Backdrop CMS instructions

Edit one of your TinyMCE editor profiles to add this plugin to the toolbar.

Issues

Bugs and feature requests should be reported in the Issue Queue

Current Maintainers

License

This project is GPL v2 software. See the LICENSE.txt file in this directory for complete text.

tinymce_filelink's People

Contributors

indigoxela avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tinymce_filelink's Issues

Uncaught ReferenceError: tinymce is not defined

This happens only if the dialog content page is loaded, when no tinymce is active.
Can happen if toggling between editors via "Formatting options" dropdown (when there are multiple editors available), for example after using this plugin with tiny, and then directly switching to CKE.
And also when calling the page directly (not the normal use-case).

Both edge cases, and it's easy to fix.

Also use required_tags in the hook

hook_tinymce_external_plugins() allows to set required_tags - in this case <a>, which isn't done, yet.

Just for completeness, as it's very unlikely, that this is off in the filter settings, anyway. But you never know...

Better alternative for native "confirm" dialog

That was a bit improvised. Browsers tend to suggest to suppress further confirm dialogs, but it's not unusual to preview several files ... not ideal.

Luckily Tiny provides an API for everything, also custom confirm...

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.