Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for configuration of Word and HTML import types #7

Open
danfusaro opened this issue Jun 2, 2022 · 3 comments
Open

Allow for configuration of Word and HTML import types #7

danfusaro opened this issue Jun 2, 2022 · 3 comments
Labels

Comments

@danfusaro
Copy link

As described in

Allow for Contentful admins to change the default values (e.g. "merge") for HTML imports when using the PowerPaste feature.

@exalate-issue-sync
Copy link

Ref: INT-2914

@danfusaro
Copy link
Author

I can submit a PR for this if you'd like!

@danfusaro
Copy link
Author

danfusaro commented Jun 2, 2022

Proposed changes:
tinymce-for-contentful.js

var p = tweak(api.parameters.instance.plugins);
    var tb = tweak(api.parameters.instance.toolbar);
    var mb = tweak(api.parameters.instance.menubar);
    var ppwi = tweak(api.parameters.instance.wordImport);
    var pphi = tweak(api.parameters.instance.htmlImport);

    api.window.startAutoResizer();

    tinymce.init({
      selector: "#editor",
      plugins: p,
      toolbar: tb,
      menubar: mb,
      min_height: 600,
      max_height: 750,
      autoresize_bottom_margin: 15,
      resize: false,
      image_caption: true,
      powerpaste_word_import: ppwi,
      powerpaste_html_import: pphi,
...

extension.json:

...
{
        "id": "wordImport",
        "name": "Word Import Type",
        "type": "Symbol",
        "default": "prompt",
        "required": false,
        "description": "This setting controls how content being pasted from Microsoft Word is filtered. Possible values: clean, merge, prompt"
      },
      {
        "id": "htmlImport",
        "name": "HTML Import Type",
        "type": "Symbol",
        "default": "clean",
        "required": false,
        "description": "This setting controls how content being pasted from sources other than Microsoft Word is filtered. Note that this includes content copied from TinyMCE itself. Possible values: clean, merge, prompt"
      }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant