Giter Site home page Giter Site logo

Comments (2)

Sklico avatar Sklico commented on July 17, 2024 1

Hi @csharpee this is duplicate of #8. As we said there, at the moment we don't have any plans to support self-hosted version in this plugin. If you want it, feel free to fork our repo and change it on your own.

Thanks

from strapi-plugin-tinymce.

01CodeLT avatar 01CodeLT commented on July 17, 2024

@poberbeck @csharpee
For others coming here wondering how to do this the best solution at the moment might be patch-package (mentioned here https://docs.strapi.io/dev-docs/plugins-extension)

I just removed the apiKey property from the react component in this file admin/src/components/Editor/index.js and added a new one to load the JS locally...

return (
    !loading && pluginConfig ?
        <Editor
            tinymceScriptSrc={'/tinymce/tinymce.min.js'}
            value={value}
            tagName={name}`

Apply the change with patch-package and then add a postinstall command to copy tinymce to your public folder...

package.json

"scripts": {
    "postinstall": "node ./postinstall.js && patch-package"
},

postinstall.js

// Copy tinymce folder
const fse = require('fs-extra');
const path = require('path');
const topDir = __dirname;
fse.emptyDirSync(path.join(topDir, 'public', 'tinymce'));
fse.copySync(path.join(topDir, 'node_modules', 'tinymce'), path.join(topDir, 'public', 'tinymce'), { overwrite: true });

.gitignore

public/tinymce/*

This will remove the api key message from your tinymce editors. Would be good if the contributors would add a conditional for the tinymceScriptSrc property then it can be done natively? The above method might also be useful in the docs?

from strapi-plugin-tinymce.

Related Issues (20)

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.