We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • CodeMirror for Evolution updated to version 2.23

    Changes:
    - updated CodeMirror JS core to 2.23
    - fixed problem with bad rendering of CodeMirror on inactive tab

    Download from the first post
      Freelance Web Developer who likes MODX, PHP, jQuery, ExtJS, SASS and other cool web things. Currenty doing great stuff at COEX CZ.

      GitHub: https://github.com/hansek
      Follow me: https://twitter.com/jantezner
      Or follow us: https://twitter.com/coexcz

      http://www.modx.cz || http://www.coex.cz
      • 36404
      • 307 Posts
      thanks a lot Hansek, it works like a charm smiley

      have swing
        réfléchir avant d'agir
        • 39007
        • 2 Posts
        Excellent plugin. Thanks a lot.
          • 36595
          • 29 Posts
          2.23 not work in content sad
            • 36404
            • 307 Posts
            hi Dimitri,

            i think i may have an idea why
            using nearly always modx with yams i do not run into that kind of problem as my contents are tvs but if you have a look at this piece of code at the end of codemirror.plugin.php (i plead guilty smiley)
            // when editing a snippet a chunk or else
            if (document.getElementById('tv_body') === null) {
            	var myTextArea = document.getElementsByName('$textarea_name')[0];
            	myCodeMirror.push(CodeMirror.fromTextArea(myTextArea, config));
            }
            // pages with one or more TVs
            else {
            	var tv_textareas = $$('#tv_body textarea');
            	if (tv_textareas.length != 0) {
            		tv_textareas.each(function(el,t){
            			myCodeMirror.push(CodeMirror.fromTextArea(el, config));
            		});
            	}
            }

            the first part concerns the pages with no tvs and manages only the first textarea in the ressource editing which is... introtext
            var myTextArea = document.getElementsByName('$textarea_name')[0] //this is the guilty part of code

            may be replacing the whole code with just
            var textareas = $$('textarea');
            if (textareas.length != 0) {
            	textareas.each(function(el,t){
            		CodeMirror.fromTextArea(el, config);
            	});
            }

            would do the trick, managing all the textareas being tvs or not (i haven't tested this code but it sounds logical smiley)

            have swing
              réfléchir avant d'agir
            • In first post is fixed version 2.23 b, it should be OK ;-)
                Freelance Web Developer who likes MODX, PHP, jQuery, ExtJS, SASS and other cool web things. Currenty doing great stuff at COEX CZ.

                GitHub: https://github.com/hansek
                Follow me: https://twitter.com/jantezner
                Or follow us: https://twitter.com/coexcz

                http://www.modx.cz || http://www.coex.cz
                • 36416
                • 589 Posts
                Quote from: virtualbear at Mar 26, 2012, 01:50 PM
                hi,
                now, next thing for me to do, allow code mirror to replace tv textareas even if the page wysiwyg editor is set to yes, would be great to be able to mix tinymce and codemirror depending on what kind of content you want to manage

                The best thing would, of course, be a configurable list of affected TVs in a plugin config. wink
                • CodeMirror for Evolution updated to core 2.25 + lot of improvements.

                  Eoler: it could be nice feature, but then come things like prioritization before TinyMCE, individual settings for TVs and much other, maybe next time ... ;-)
                    Freelance Web Developer who likes MODX, PHP, jQuery, ExtJS, SASS and other cool web things. Currenty doing great stuff at COEX CZ.

                    GitHub: https://github.com/hansek
                    Follow me: https://twitter.com/jantezner
                    Or follow us: https://twitter.com/coexcz

                    http://www.modx.cz || http://www.coex.cz
                  • CodeMirror for Evolution updated to core 2.25 + lot of improvements in first post!

                    Eoler: it could be nice feature, but then come things like prioritization before TinyMCE, individual settings for TVs and much other, maybe next time ... ;-)
                      Freelance Web Developer who likes MODX, PHP, jQuery, ExtJS, SASS and other cool web things. Currenty doing great stuff at COEX CZ.

                      GitHub: https://github.com/hansek
                      Follow me: https://twitter.com/jantezner
                      Or follow us: https://twitter.com/coexcz

                      http://www.modx.cz || http://www.coex.cz
                      • 16903
                      • 39 Posts
                      I installed CodeMirror using Evo 1.0.6 but i have no idea how to use it.
                      There is no syntax highlighting? Can you give me a clue how i can use that plugin?

                      Thanks in advance.