In-browser code highlight

11 views
Skip to first unread message

Alexander Obuhovich

unread,
Sep 13, 2012, 1:32:06 PM9/13/12
to Development In-Portal
In-Portal Design Mode allows to edit TPL files using CodePress as in-browser edit.
It does it's job, but problem with it is obvious - it's doesn't have new releases, but web browsers are having new releases at least once per month.
Right now this make it not working in Google Chrome.

Recently after installing new version of phpMyAdmin I've noticed that sql query textarea now has nice real-time highlighting to ease in sql writing.
After digging a bit into it I found out that CodeMirror in-browser editor is behind all that.

Looking closely at developer's website I discovered that that editor has:
  • tons of languages supported
  • powerful JS API
  • custom CSS styling support

I think that we at least should replace CodePress in Design Mode and maybe find other powerful usage cases for this editor.

Dmitry A.

unread,
Sep 16, 2012, 4:23:57 AM9/16/12
to in-por...@googlegroups.com
This is really cool CodeMirror script!

I personally think we should retire "Design mode" for no popularity. Back in 2009 when we started it sounded very promising, but as practice showed it's easier and faster to change TPLs in IDEs for better success.

Anyway, I think we should plug CodeMirror in for our SQL Query textarea under tools to see how it's going to live there.

I am curious to know if we can teach it to parse / highlight In-Portal tags?


DA

Phil

unread,
Sep 16, 2012, 7:33:30 AM9/16/12
to in-por...@googlegroups.com
very interesting. Code Mirror could also be used in "source mode" when editing content.

About detecting In-Portal tags, just check docs : http://codemirror.net/doc/manual.html > "Writing CodeMirror Modes", sounds easy.


Envoyé avec Sparrow

Alexander Obuhovich

unread,
Sep 16, 2012, 11:18:59 AM9/16/12
to in-por...@googlegroups.com
Then please create 2 tasks:
  1. for moving design mode into separate module (or deleting it completely)
  2. for using CodeMirror on SQL Query page in Admin Console

Alexander Obuhovich

unread,
Sep 16, 2012, 5:24:19 PM9/16/12
to in-por...@googlegroups.com
Also we can use it in textareas, where html is entered, like on e-mail event editing.

Dmitry A.

unread,
Sep 16, 2012, 5:32:34 PM9/16/12
to in-por...@googlegroups.com
Yes, I like the idea of adding to Textareas where we work with HTML - good benefit.

Not sure about moving Design mode to separate module - can you clarify?

DA

Alexander Obuhovich

unread,
Sep 16, 2012, 5:44:07 PM9/16/12
to in-por...@googlegroups.com
Maybe we don't need to delete design mode functionality all together, but rather move it (at least admin part) into a separate module. Code will be there to get some future ideas from it if needed.

Dmitry A.

unread,
Oct 18, 2012, 5:59:02 AM10/18/12
to in-por...@googlegroups.com
Hi Alex,


Yes, I agree with what you are proposing here.


DA

Dmitry A.

unread,
Oct 22, 2012, 11:03:20 PM10/22/12
to in-por...@googlegroups.com
Here is 1 task out of 2:

1420: Using CodeMirror on SQL Query page in Adminhttp://tracker.in-portal.org/view.php?id=1420

Not sure where we going to put it - in 5.3.0 or put in 5.2.1

DA
Reply all
Reply to author
Forward
0 new messages