gurucomkz/silverstripe-blobpasteupload

blobpasteupload

Installs: 197

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 1

Open Issues: 0

Language:JavaScript

Type:silverstripe-vendormodule

0.1.2 2020-05-21 00:17 UTC

This package is auto-updated.

Last update: 2024-03-18 10:10:52 UTC


README

Allows to paste images from clipboard to the built-in TinyMCE editor with subsequent upload to the files library. Currently Images are uploaded to the root folder.

Installation

Install with composer

composer require gurucomkz/silverstripe-blobpasteupload

Flush config with /flush=1 url.

Conflict resultion

Module uses TinyMCEConfig::setContentCSS() to inject some styles into the editor area. Sadly, there's no TinyMCEConfig::addContentCSS function and we have to first get the current CSS list, append to it and then save it.

If you have your own styles injected into the editor, please, in order to preserve this modules injections, do the following:

$myStyle = '...path...'; #this is your stylesheet file URL

$tinymceconfig = TinyMCEConfig::get('cms'); # get instance
$contentCSS = $tinymceconfig->getContentCSS(); # get current list
if(!is_array($contentCSS)) $contentCSS = []; #check for array
$contentCSS[] = $myStyle; #HERE we append your file - repeat for every file
$tinymceconfig->setContentCSS($contentCSS); #save again

TODO

  • Configure target folder