Codeeditor_XH

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Codeeditor_XH

Post by cmb » Fri Jan 13, 2012 12:50 am

Hello Community,

I've just released Codeeditor_XH 1beta1. It's available from my website.

Codeeditor_XH provides a replacement for the simple textarea in CMSimple_XH's back-end to edit the template, the stylesheet and the plugin stylesheets. Furthermore it implements the editor interface of CMSimple_XH 1.5 (and up), so it can be used to edit the content of the website.

Instead of being a WYSIWYG or WYSIWYM editor, it allows to edit the source code directly, and currently offers syntax highlighting, line numbering, code indenting, bracket matching and optional line wrapping.

The current version has to be considered Beta software! Use with caution!

From the changelog:
cmb updated to CodeMirror 2.2
cmb switched from implicit requirements check to explicit system check
cmb added several config options
cmb rewritten without need for jQuery
cmb implemented editor interface for CMSimple_XH 1.5+
cmb added default.php for CMSimple_XH 1.5+
cmb added manual
cmb cleaned up code
cmb added warning when leaving page with unsaved modifications (doesn't work in Opera)

Any feedback is welcome.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

beate_r
Posts: 174
Joined: Thu May 22, 2008 11:44 pm
Location: Hessen / Germany

Re: Codeeditor_XH

Post by beate_r » Fri Jan 13, 2012 3:16 am

Schöne Idee für alle, die nicht den Luxus einen Shell-Zugriffs haben.

Wie siehts denn mit der Abwärtskompatibilität aus, besonders auch zu CMSimple 3.x?

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Codeeditor_XH

Post by cmb » Fri Jan 13, 2012 12:35 pm

Hallo Beate,
beate_r wrote:Schöne Idee für alle, die nicht den Luxus einen Shell-Zugriffs haben.
oder einen FTP-fähigen Quellcode-Editor zur Hand.
beate_r wrote:Wie siehts denn mit der Abwärtskompatibilität aus, besonders auch zu CMSimple 3.x?
Der CodeMirror für Template und Stylesheets sollte eigentlich auch mit allen älteren XH-Versionen funktionieren (UTF-8 ist eigentlich nicht unbedingt nötig). Ich hab's nun mal schnell unter LE 3.4 getestet (bei CMSimple 3.3 hab' ich keinen PL installiert). Da gibt's dann mehrere kleine Probleme:
  • Der PL meckert, dass er kein codeeditor/index.php findet => also schnell ein leeres (<?php ?>) angelegt
  • 403 Forbidden, da die Abfrage auf direkten Zugriff auf admin.php und init.php beruht CMSIMPLE_XH_VERSION basiert => das läßt sich ändern (lokal hab' ich's mal schnell auskommentiert)
  • Kein CodeMirror, da die Semantik von $onload geändert wurde => schnell angepasst
  • Nun funktioniert der CodeMirror für Plugin-Stylesheets
  • Bei Template und Stylesheet wird der CodeMirror allerdings nicht aktiviert, da die Textarea keine Klasse, sondern nur einen Namen hat. => da müsste da JS zur Initialisierung geändert werden
  • Um das Editieren des Content per CodeMirror zu erlauben, müsste eine Initialisierungsdatei ergänzt werden
Im Prinzip also alles machbar. Aber es kostet Zeit, das zu programmieren, und v.a. noch mehr Zeit, um es dann unter diversen älteren Versionen zu testen. Und die investiere ich eigentlich lieber in zusätzliche Features oder auch in andere Plugins.

Nun hab ich schnell mal unter XH 1.1.4 und XH 1.2 getestet, und musste feststellen, dass der CodeMirror für Template und Plugin nicht funktioniert, da für die Textarea hier noch immer keine Klasse definiert wurde. Das werde ich also auf jeden Fall beim Codeeditor_XH noch nachbessern. Und vielleicht auch die Integration als Content-Editor für ältere Versionen. Aber ich denke, weiter werde ich nicht gehen. Letztlich steht es jedem frei, auf CMSimple_XH umzustellen.

Christoph

PS: I've just noticed that this thread is in a English forum. :oops: So a short summary:

Codeeditor_XH does not work under classic CMSimple. Currently it doesn't work under CMSimple <(=?) 1.3. This will be fixed in the next version, so that Codeeditor_XH will run at least under CMSimple_XH 1.2.
Last edited by cmb on Fri Jan 13, 2012 1:24 pm, edited 1 time in total.
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Codeeditor_XH

Post by cmb » Fri Jan 13, 2012 1:19 pm

Hi,

using jQuery is often very reasonable. But as CodeMirror doesn't need it, I didn't want to include jQuery for the minimal JS I had to add (< 150 LOC).

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

beate_r
Posts: 174
Joined: Thu May 22, 2008 11:44 pm
Location: Hessen / Germany

Re: Codeeditor_XH

Post by beate_r » Fri Jan 13, 2012 10:18 pm

Christoph, thank You very much for Your clarification. I fully agree with Your position on backporting the tool.

BTW: i am pretty much impressed on Your efforts on CMSimple_XH: it has remained as simple and smart as ever, and upgrading is usually smooth. Thanks for the good work.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Codeeditor_XH

Post by cmb » Sat Jan 14, 2012 2:16 am

Hello Beate,
beate_r wrote:I fully agree with Your position on backporting the tool.
Thanks for your understanding. :) I guess most (almost all?) new installations of CMSimple are made with CMSimple_XH nowadays, so that's no problem. I'm well aware that there are many existing installations running under classic CMSimple (3.x and even 2.x). And I'm aware, that updating to CMSimple_XH is by far more complex than updating e.g. Firefox, particularly if it comes to switching to UTF-8. And this is quite a problem for web-designers, who serve a large customer base. But I do hope, that they can manage to update the "old" versions over time, so all (end-users, web-designers and developers) can benefit.
beate_r wrote:i am pretty much impressed on Your efforts on CMSimple_XH: it has remained as simple and smart as ever, and upgrading is usually smooth. Thanks for the good work.
This "your" has to be read as plural! All members of the CMSimple_XH developer team were involved in CMSimple_XH 1.5. The most work was done Martin, who developed the new filebrowser, integrated tinyMCE, implemented the new admin menu and laid out most of the "hidden" features (greatly improved search, evalutating newsboxes and so on).

And yes: CMSimple_XH should stay simple and smart. That's its raison d'être competing with giants as Joomla, Typo3, Drupal and Wordpress these days.

Christoph

PS: I've totally forgotten to mention Holger :oops:, who's not a member of the CMSimple_XH dev team, but who had the great idea to implement editors as plugins, inspired the editor interface and is a generally source of good ideas, valuable feedback and criticism for the team.
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Codeeditor_XH

Post by cmb » Fri Aug 24, 2012 8:43 pm

Hello Community,

I've just released Codeeditor_XH 1beta2.

Any feedback is welcome!

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Codeeditor_XH

Post by cmb » Sun Sep 02, 2012 10:41 am

Hello Community,

I've just released Codeeditor_XH 1beta3.

This fixes a bug regarding external config files (thank you, svasti, for reporting the bug).

Any feedback is welcome!

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Codeeditor_XH

Post by cmb » Mon Sep 03, 2012 5:22 pm

Hello Community,

I've just released Codeeditor_XH 1beta4.

I have updated the underlying CodeMirror to the latest version (2.33), as it seems the version used in 1beta3 (2.22) had a bug regarding the displayed vs. the internal cursor position.

For upgrading, it's basically enough to upload the contained folder codemirror/.

Please note that the filebrowser integration doesn't work with CMSimple_XH 1.5.3 or below, but don't switch to 1.5.4rc2 on a production server -- wait until 1.5.4 is released, or copy plugins/filebrowser/editorhooks/codeeditor/ from 1.5.4rc2 to your existing 1.5.3.

Any feedback is welcome!

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Codeeditor_XH

Post by cmb » Mon Feb 11, 2013 8:00 pm

Hello Community,

I've just released Codeeditor_XH 1rc1.

This version is compatible with Stylemanager_XH, but you need to replace the init.js.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply