But what is the real problem ? (getting editing and feedback in a simple way)
Textarea or contenteditable provide support for editing, but not for syntax highliting or fancy functions
- or to have them, the usual is to write all needed for editing from the ground - because it's not possible to control content of editable
in other way than by operating ranges of selection (like startOfsset and endOffset, regarding to startContainer and endContainer - and if they are equal, that's the cursor).
But it's very convinient to get both: contenteditable and syntax just by aligning precisely one over another, then get rid of few corner cases - as you can see below.
I made it once in Firefox 23+- in very minimal way.
I applied it by userContent.css with @-moz-document regexp("^.*#?\\.(css|js|jsm)$") { .. },
it was working with view-source: as well, without making any changes to the original document
(half transparent anonymous content over it), very little was needed to keep it in sync
(or to have a handy feature to highligt same words as under cursor when Ctrl key is pressed) and.. you could just save the document after editing.
Orthogonally to that, I had userContent/Chrome.css opened in the sidebar and on every key up I unregister and loadAndRegisterSheet with it :) (the styles were applied live to documents or browser when the sidebar was open and saved on unload).
7 comments
[ 3.3 ms ] story [ 27.1 ms ] threadTextarea or contenteditable provide support for editing, but not for syntax highliting or fancy functions - or to have them, the usual is to write all needed for editing from the ground - because it's not possible to control content of editable in other way than by operating ranges of selection (like startOfsset and endOffset, regarding to startContainer and endContainer - and if they are equal, that's the cursor).
But it's very convinient to get both: contenteditable and syntax just by aligning precisely one over another, then get rid of few corner cases - as you can see below.
I made it once in Firefox 23+- in very minimal way. I applied it by userContent.css with @-moz-document regexp("^.*#?\\.(css|js|jsm)$") { .. }, it was working with view-source: as well, without making any changes to the original document (half transparent anonymous content over it), very little was needed to keep it in sync (or to have a handy feature to highligt same words as under cursor when Ctrl key is pressed) and.. you could just save the document after editing.
- - - Orthogonally to that, I had userContent/Chrome.css opened in the sidebar and on every key up I unregister and loadAndRegisterSheet with it :) (the styles were applied live to documents or browser when the sidebar was open and saved on unload).