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

[5.0] Fix the code+ tinyMCE plugin #40679

Merged
merged 1 commit into from
May 29, 2023

Conversation

dgrammatiko
Copy link
Contributor

Pull Request for Issue # .

supplementary to #40626

Summary of Changes

The settings were set directly into the editor object, now the options interface is used (register)

Testing Instructions

Run npm I and check that the view->source code works as expected (note: npm run build:js is not ok here)

Actual result BEFORE applying this Pull Request

broken

Expected result AFTER applying this Pull Request

Not broken

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@HLeithner

@joomla-cms-bot joomla-cms-bot added NPM Resource Changed This Pull Request can't be tested by Patchtester PR-5.0-dev labels May 29, 2023
@dgrammatiko dgrammatiko mentioned this pull request May 29, 2023
@richard67
Copy link
Member

Run npm I and check that the view->source code works as expected (note: npm run build:js is not ok here)

@dgrammatiko Why that? And would npm ci also be sufficient and maybe better than npm I?

@dgrammatiko
Copy link
Contributor Author

dgrammatiko commented May 29, 2023

Why that?

Because the minification of the html file for the plugin is not in the npm run build:js, ref:

/* Create the Highlighter plugin */
// Get the css
let cssContent = await readFile('build/media_source/plg_editors_tinymce/js/plugins/highlighter/source.css', { encoding: 'utf8' });
cssContent = await Postcss([CssNano()]).process(cssContent, { from: undefined });
// Get the JS
let jsContent = await readFile('build/media_source/plg_editors_tinymce/js/plugins/highlighter/source.es6.js', { encoding: 'utf8' });
jsContent = await minify(jsContent, { sourceMap: false, format: { comments: false } });
// Write the HTML file
const htmlContent = `<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script type="module">${jsContent.code}</script>
<style type="text/css">${cssContent.css}</style>
</head>
<body style="height: 100vh"></body>
</html>
`;
await writeFile('media/plg_editors_tinymce/js/plugins/highlighter/source.html', htmlContent, { encoding: 'utf8', mode: 0o644 });

The npm ci should work fine as well

@brianteeman
Copy link
Contributor

I have tested this item ✅ successfully on a2187ff


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40679.

1 similar comment
@richard67
Copy link
Member

I have tested this item ✅ successfully on a2187ff


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40679.

@richard67 richard67 changed the title [5.0] Fix the code+ tinyMCE plugin [5.0] Fix the code+ tinyMCE plugin May 29, 2023
@richard67
Copy link
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40679.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label May 29, 2023
@richard67 richard67 added this to the Joomla! 5.0 milestone May 29, 2023
@HLeithner HLeithner merged commit 3217c03 into joomla:5.0-dev May 29, 2023
@HLeithner
Copy link
Member

Thanks

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label May 29, 2023
@dgrammatiko dgrammatiko deleted the 5.0-dev-tiny-cm branch May 29, 2023 13:44
@HLeithner
Copy link
Member

do we have the codemirror parameters in the codemirror plugin? and can we get the options from this plugin? @dgrammatiko

@dgrammatiko
Copy link
Contributor Author

The parameters are exposed to the php side here: #40682

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NPM Resource Changed This Pull Request can't be tested by Patchtester
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants