Code Mirror plugin improvements#5863
Conversation
There was a problem hiding this comment.
In case you're wondering what this is all about, it lets your text editor know that the following code is javascript (instead of html) but output buffering captures the tag and throws it away because we don't actually want it.
There was a problem hiding this comment.
What if you'd add similar comment above this code, so others inspecting the code will know what is it for.
But I must say I'm not comfortable with it, any editor allows mode switching, and while it's not comfortable to switch between js an php, IMHO this executed code just should not be there.
|
I get two notices: |
|
Thanks! |
|
The build fails because of PHPCS problems in a layout file. The Joomla! phpcs rules are not suitable for writing layout or template files. |
|
... or you know maybe I could just cut that extra line at the end of the file. |
|
Not a huge fan of the wording used in the new language strings but they |
|
Maybe is it possible, that the use of CodeWarrior in the Template Manager are based on Global / User editor settings? As at moment (J! 3.3.6) it is not the case .. |
|
@brianteeman I'm happy to change those strings if anyone has a suggestion. @bluezeyes CodeWarrior... なつかしい... Uh, I'll need to look into the template manager issue. It should be based on global settings. What else would it be based on? |
|
@okonomiyaki3000 they are OK for now. They can be reviewed at a later date when we do a general review of all strings. This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5863. |
|
@okonomiyaki3000 Well, it just tried out this CM+Emmet extension: http://extensions.joomla.org/extension/edition/editors/codemirror-plus-emmet-editor |
Please make new string perfect now. You complained that many strings are not OK in en-GB, thus creating a lot of language PRs. Changing these new strings later on will —again— force TTs to do a useless work. |
|
@bluezeyes I think I get it. When you install this extension, do you get the option for a new editor? So that, in your user settings, you can select either 'CodeMirror' or 'CodeMirror + Emmet'? @infograf768 I agree. |
|
The language strings are OK - they follow the style guides. They are just As agreed with the PLT a complete review of all the strings for this sort But if you are desperate for them I can rewrite these tonight but I can not On 22 January 2015 at 09:15, Elijah Madden notifications@github.com wrote:
Brian Teeman |
|
@okonomiyaki3000 Correct. |
|
@bluezeyes Then the reason is that the jform xml file for the template pages does not simply use your configured editor, it uses 'codemirror' explicitly. It must do this because, otherwise, a wysiwyg might be used. This is a weak point of the 'editor' field type. It would be best if users could select their content editor and code editor independent of one another but that is not a possibility right now. Alternatively, we could just start including Emmet. It would be absolutely trivial to add this functionality. The only possible issue that Emmet is separate distribution from CodeMirror and created by a different developer. Is there any issue with adding it to Joomla? Licensing or anything like that? |
|
Do you mean https://github.com/emmetio/emmet/blob/master/LICENSE If so then there is no problem with the licence - I will leave it to others |
|
@brianteeman Yes, that's the one. No problem to add this if it's something people want. |
|
@okonomiyaki3000 Well I tried it with vanilla Joomla 3.3.6 Template Isis No changes except installing CM+E . #Edith:# Arrgh ... I should get rest.. overseen your jForm notice @brianteeman Yes that is the original one. |
|
@bluezeyes Yeah, as it currently works, since CM+E is a different editor from just 'CodeMirror' (as far as Joomla is concerned) and the form on the template editor is explicitly selecting 'CodeMirror' (despite any system or user-level settings), CM+E will never be used there. So, I'll look into adding support for it in the basic installation. I'll put it in a different PR though, in case it's controversial. If it gets in, CM+E will basically be obsolete. |
|
@okonomiyaki3000 Elijah you have three PR
Thanks This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5863. |
There was a problem hiding this comment.
Changed this a little. Maybe it's a big more palatable now.
|
Thanks for accepting those fixes. All tested good from me This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5863. |
|
@bluezeyes here you go #5874 |
|
@test ok This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5863. |
|
@test OK |
…ins. Toolbar is removed, can be a plugin instead.
f2b3e5a to
f18c228
Compare
|
This PR has received new commits. CC: @acjunior01, @anibalsanchez, @brianteeman, @DGT41, @yvesh This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5863. |
|
I rebased this because it had become a mess somehow without a whole set of commits being doubled. There's still a commit that adds the toolbar and then a subsequent one that removes it. Finally, there is no toolbar but, instead, CodeMirror can now be extended with additional plugins. I think this is a much better way to go. |
|
Code Mirror works good here. Just two mirror we lose the code colors and on the text box above code mirror in the template manger see: Without the patch This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5863. |
|
This PR has received new commits. CC: @acjunior01, @anibalsanchez, @brianteeman, @DGT41, @yvesh This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5863. |
|
@zero-24 Thanks for catching that. It's a simple fix but it brings up a question. I have put two hidden parameters in the plugin config. One is the path to Codemirror itself, the other is the path format for for mode files. By putting these values in the config, it makes it possible for someone to modify them (they are hidden so you'd have to first write a plugin that modifies the JForm). This would allow you to use a different version or your own custom package of the CodeMirror js and css files. OK, that's really quite an unusual thing for someone to want to do. Of course, I know that. Anyway, I need to prepend |
|
@okonomiyaki3000 what do you think about. $modeURL = $modePath . $extJS;
if (!file_exists($modeURL))
{
$modeURL = JUri::root(true) . '/' . $modePath . $extJS;
}^^ in the PHP Block of the init lauout cm.modeURL = <?php echo json_encode($modeURL); ?>;^^ in the JS part of the layout. So both should work i guess ;) |
|
That's not how it works. |
|
So, all is OK now and we just need to test it right? |
|
I have tested this item 🔴 unsuccessfully on 657b77d This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5863. |
|
I have tested this item ✅ successfully on 657b77d This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5863. |
|
I have tested this item ✅ successfully on 657b77d This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5863. |
|
RTC thanks This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5863. |
|
Yeah! ☺ Von meinem Samsung Gerät gesendet. -------- Ursprüngliche Nachricht -------- RTC thanksThis comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5863. — |
Code Mirror plugin improvements


This PR makes quite a few changes to the CodeMirror plugin (not the javascript library itself).