? ? Pending

User tests: Successful: Unsuccessful:

avatar okonomiyaki3000
okonomiyaki3000
6 Oct 2017

Pull Request for Issue # .

Summary of Changes

Instead of trying to determine the correct mode in PHP and explicitly set it in CodeMirror, use CodeMirror's built in functions to get the mode information. This means that (with no known exceptions) we can just pass the syntax parameter and get the right mode. This also means many more modes should be available. For example, until now, setting syntax="less" in the jform xml for the codemirror element would not give you less-mode. Now it should.

Testing Instructions

Try using codemirror with as many different modes as you can. HTML (obviously), CSS, JS, XML, PHP, etc.

Expected result

The mode settings (such as syntax coloring) should be correct.

Actual result

Until now, modes commonly used by Joomla users probably worked properly but some others (such as less) might not have.

Documentation Changes Required

No, I think not.

avatar joomla-cms-bot joomla-cms-bot - change - 6 Oct 2017
Category Front End Plugins
avatar okonomiyaki3000 okonomiyaki3000 - open - 6 Oct 2017
avatar okonomiyaki3000 okonomiyaki3000 - change - 6 Oct 2017
Status New Pending
avatar okonomiyaki3000 okonomiyaki3000 - change - 6 Oct 2017
Labels Added: ?
avatar okonomiyaki3000
okonomiyaki3000 - comment - 6 Oct 2017

Thanks. Don't drink and code.

avatar ggppdk ggppdk - test_item - 6 Oct 2017 - Tested successfully
avatar ggppdk
ggppdk - comment - 6 Oct 2017

I have tested this item successfully on e5bed71

Editing LESS files in Joomla template manager now has syntax highlighting !

Please note that you do not need to edit
administrator/components/com_templates/models/forms/source.xml
to change the 'syntax' attribute

because view.html.php sets it automatically to correct extension for currently loaded file

$this->form->setFieldAttribute('source', 'syntax', $ext);

Also tested with custom code that creates codemirror instances dynamically at browser,
Syntax highlighting now work if mode property is set !!!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18253.
avatar zero-24
zero-24 - comment - 7 Oct 2017

hmm to me this error comes up:
image

avatar ggppdk
ggppdk - comment - 7 Oct 2017

@zero-24

do you have latest staging ?
a new version of codemirror was merged

#18099

maybe also a hard browser reload to load latest codemirror JS

avatar zero-24 zero-24 - test_item - 7 Oct 2017 - Tested successfully
avatar zero-24
zero-24 - comment - 7 Oct 2017

I have tested this item successfully on e5bed71

Just Updated to staging works now ❤️ great Feature!


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

avatar zero-24 zero-24 - change - 7 Oct 2017
Milestone Added:
Status Pending Ready to Commit
Labels Added: ?
avatar mbabker mbabker - change - 9 Oct 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-10-09 23:23:23
Closed_By mbabker
Labels
avatar mbabker mbabker - close - 9 Oct 2017
avatar mbabker mbabker - merge - 9 Oct 2017
avatar Septdir
Septdir - comment - 2 Apr 2018

if use 2 editors on page syntax attr don't work.
In editors use attr only from first field.

avatar ggppdk
ggppdk - comment - 2 Apr 2018

@Septdir

It is not related to this PR
Please open a new issue and ping me, and i will make a PR to fix it

Add a Comment

Login with GitHub to post a comment