We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39977
    • 11 Posts
    Logged in as Admin:
    Elements: Plugins: CodeMirror: Properties: Default properties unlocked
    Select Theme : Choose anything from pulldown (other than default)
    Save --> Access Denied

    ??????

    Modx Revo 2.26
    CodeMirror 2.20
    Xampp 1.8.1
    PHP 5.4.7
      • 39977
      • 11 Posts
      Created a new CodeMirror plugin property set and can name and save it, but cannot get it to enable, it returns to the default property set.

      So I loaded ACE editor in instead. Its works fine and I can change themes. But I cannot get it to work with resources, only with elements, even though I can select it for the rich editor for resources in system settings.

      Does anyone know how to either apply ACE to resources, or get themes to work with CodeMirror?
        • 10208 ☆ A M B ☆
        • 1,780 Posts
        Did you change ANY of the security settings/permissions? ever?

        For your new property set, did you assign it to the plugin in the system events tab? Scroll down, where it says default, double click and select your new property set.
          Frogabog- MODX Websites in Portland Oregon
          "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
          Having server issues? These guys have MODX Hosting perfected - SkyToaster
          • 39977
          • 11 Posts
          Before you responded, I was able to get ACE editor working on resources by (duh) unselecting Rich text on all resource pages.

          Thank you for your help. Yes, for CodeMirror theming, that was exactly the correct answer: for each of the seven events that had "default" selected, change (duh squared) those to the newly created property set with the alternative them. Thank you Frogabog. Many thanks :^)

          Is there any easy way to change the default height in the Modx Manager for the content window? Whether I fold the top document section or not I cannot enlarge the editor window. I would assume that is in a CSS sheet somewhere, or is a system value.
            • 10208 ☆ A M B ☆
            • 1,780 Posts
            Quote from: pvcon13 at Dec 31, 2012, 02:29 PM

            Is there any easy way to change the default height in the Modx Manager for the content window? Whether I fold the top document section or not I cannot enlarge the editor window. I would assume that is in a CSS sheet somewhere, or is a system value.

            Beats me... Annoying huh?

            Glad it's working out otherwise :~}
              Frogabog- MODX Websites in Portland Oregon
              "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
              Having server issues? These guys have MODX Hosting perfected - SkyToaster
              • 39194
              • 149 Posts
              To get Ace working with Resources, you can just set use_editor system setting to false
              You can expand Ace (so is CodeMirror) to fit browser window by Ctrl+F11 (for Ace). You can also replace height: textArea.height line in Ace plugin to height: 800 for example. Or you can add these lines:

                              grow: true,
                              growMax: 1024,

              Now editor will grow up to fit it's code.


              Adding resize handler to Ace is in my TODO list...
                • 39977
                • 11 Posts
                Thank you Danil!

                The first change (height) works well. I cannot see any difference with the second change (grow: true, growMax: 1024).

                As far as I am concerned the best thing is Ctrl+F11. Exactly what I looking for, actually better :^) !

                With regard to taking one of your themes and minorly changing a few colors around, I went look for CSS files and found only the JS files for languages and themes. I noticed on the ACE editor universal site they had both as pairs, so I assume to make this work with Modx you had to do some major surgery (or you hid the css well ;-_)

                Thank you again for this great plugin and all the work you put into it. Till yesterday I did all my serious PHP and JS coding in class files using outside ide/editors first and tested, and then brought into Modx later, primarily because the UI for longer coding was so less comfortable. Your plugin handles about 80 percent of the differences. Very Much Appreciated. :^)
                  • 39194
                  • 149 Posts
                  I have no my own themes, all themes are taken from ace sources. I run build script (comes with ace sources), it merges files (and inserts css to js). So, you can fork original ace repository, create your own theme and run buld script (requires node.js with some node modues) with `full` argument - you get your theme file in build/src-min-noconflict/

                  I have good news for those, who uses Ace instead of external editor:

                  1) I have added live php syntax checker
                  2) ace devs work on code completion feature

                  In general, it is possible to turn MODX into online IDE with almost all useful features. Just take a look at the Cloud9 IDE
                  But I am not sure MODx CMF, MODx core team and MODx regular devs need this.