Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: soo_editarea: EditArea integration with Txp tag highlighting
Had a look at CodeMirror. Promising, certainly, but a lot more work to get a usable implementation with Txp, as far as I can see. EditArea is pretty much plug-and-play for Txp, notwithstanding the Safari bug.
CodeMirror doesn’t seem to have any equivalent to EditArea’s full-screen toggle. For me that’s a major feature.
Code is topiary
Offline
Re: soo_editarea: EditArea integration with Txp tag highlighting
Jeff, I appreciate you taking the time to look at Codemirror. I used EditArea a while back when Stuart made his bundled Big Blue admin template and really wanted to like it but found it slow on my (admittedly aging) machine and didn’t need most of the toolbar stuff (some of which you can, at least, turn off). Maybe I need to try it again now that the browser javascript engines have all been supercharged.
I think you’re right about there not being a full screen view in codemirror. I routinely set the textarea width for the code boxes to 100% and the font to consolas and you can drag enlarge the textarea in Safari but I realise that is not quite the same, particularly for plugin authors.
TXP Builders – finely-crafted code, design and txp
Offline
Re: soo_editarea: EditArea integration with Txp tag highlighting
jakob wrote:
found it slow on my (admittedly aging) machine and didn’t need most of the toolbar stuff (some of which you can, at least, turn off).
Most likely features for the next iteration of soo_editarea would be:
- JavaScript syntax highlighting — really the only question is how is this triggered in the absence of a core Txp js panel. (Very simple to automatically load the js syntax file based on Style/Form name, for example.)
- Control over what to include in the EditArea toolbar. (I don’t know if leaving stuff out of the toolbar would help performance or not.)
I routinely set the textarea width for the code boxes to 100% and the font to consolas and you can drag enlarge the textarea in Safari but I realise that is not quite the same, particularly for plugin authors.
Dragging to resize textareas is a nice feature of WebKit browsers. Still, I really like being able to pop in and out of full-screen mode with a single click.
Code is topiary
Offline
Re: soo_editarea: EditArea integration with Txp tag highlighting
Version 0.1.3 fixes a bug with Internet Explorer (type
attribute in script
tag).
Code is topiary
Offline
#17 2011-04-27 20:27:54
- marjoleink
- Member
- From: Amsterdam, NL
- Registered: 2011-04-26
- Posts: 18
Re: soo_editarea: EditArea integration with Txp tag highlighting
jsoo wrote:
EditArea is a JavaScript-based code editor for browser textareas. Features include:
— Suggested by the (apparently defunct) atb_editarea plugin, and discussion on the Txp forum.
I’m not so sure atb_textarea is ‘defunct’, because I just managed to install it in my creaky-fresh (and first-time) multi-site install. :D
A few extra steps I needed:
- I put the
edit_area
directory inside the textpattern install directory (i.e. at the same level as thesites
directory) - I dropped your
txp.js
file into thereg_syntax
folder (it seems to be functionally identical to the file iblastoff made but that has disappeared) - inside the
sites/[mysite]/admin
directory I made a symlink callededit_area
to theedit_area
directory (with the ‘standard’ multi-site setup this step will make it work for any site that uses the same install) - a small edit to the plugin code so that it now uses the txp parser instead of the html parser for the html textareas
The plugin code looks a lot simpler than yours, which I may try out later. For now, I’m quite happy to have it working, with TXP syntax highlighting and all!
It’s only the third plugin for me, but together with smd_prefalizer and rvm_maintenance (not that there’s much to see), I’m ready to try my first theme installation. :) (After I have something to eat, at least.)
Cheers,
Last edited by marjoleink (2011-04-27 21:04:37)
Marjolein Katsma ¤ Hacking a theme to learn tags now ¤ nul = nada — lt = very little — why is there even a site there?
Offline
Re: soo_editarea: EditArea integration with Txp tag highlighting
Thanks for the plugin Jeff.
If you could add a feature that would allow you to config the default width and height of the area, it would save me manually hacking the call. I’m lazy.
Offline
Re: soo_editarea: EditArea integration with Txp tag highlighting
marjoleink wrote:
I’m not so sure atb_textarea is ‘defunct’, because I just managed to install it in my creaky-fresh (and first-time) multi-site install. :D
You’re right, “defunct” wasn’t the right word. It is, however, (apparently) orphaned, as you discovered by trying the author’s link. You’re also right that atb_editarea is a very small plugin. But then, that’s part of the reason you needed extra steps :) Glad to hear my txp.js
file works with it.
Code is topiary
Offline
Re: soo_editarea: EditArea integration with Txp tag highlighting
mrdale wrote:
If you could add a feature that would allow you to config the default width and height of the area, it would save me manually hacking the call. I’m lazy.
Good idea, done in v0.1.4. Note that it will allow you to go larger than the Txp default, but not smaller.
Code is topiary
Offline
Re: soo_editarea: EditArea integration with Txp tag highlighting
Version 0.1.4 released
Adds prefs for default height and width, as suggested by mrdale.
Code is topiary
Offline
#22 2011-04-28 10:19:28
- marjoleink
- Member
- From: Amsterdam, NL
- Registered: 2011-04-26
- Posts: 18
Re: soo_editarea: EditArea integration with Txp tag highlighting
jsoo wrote:
You’re right, “defunct” wasn’t the right word. It is, however, (apparently) orphaned …
I didn’t think so, as its Textpattern.org page says it was last updated in January this year. To me that looks recent enough for it not to be orphaned. And it doesn’t have the ‘orphaned’ flag either (which I have noted on other resources there – and paid attention to). And the ‘Information URL’ link there is working, too.
What are the criteria for something being “orphaned” here?
You’re also right that atb_editarea is a very small plugin. But then, that’s part of the reason you needed extra steps :)
Apart from adding the txp.js the only real (and important) extra step is providing for the multi-site install, which I’d need for your plugin as well as far as I can see: there needs to be a web-accessible address for the browser to find the EditArea script. The main installation directory is (deliberately) outside the web root in this multi-site scheme.
BTW, your information page looks a bit broken now – after the screenshots is a mass of textile source…
Cheers,
Last edited by marjoleink (2011-04-28 10:29:06)
Marjolein Katsma ¤ Hacking a theme to learn tags now ¤ nul = nada — lt = very little — why is there even a site there?
Offline
Re: soo_editarea: EditArea integration with Txp tag highlighting
marjoleink wrote:
What are the criteria for something being “orphaned” here?
Usually it’s inactivity. In this case I’m making an assumption based on the fact that not long after releasing this plugin, the author has stopped posting to the forum, and has moved his blog to a different CMS. I could be wrong :)
Apart from adding the txp.js the only real (and important) extra step is providing for the multi-site install
You mentioned something about editing the plugin code. That plugin’s simplicity comes from hard-coding paths etc., which is why you had to hack it to use a different syntax file. I’m not knocking the plugin; it works as advertised. You’re right you’d need the same symlink using my plugin. The reason to consider my version is if you want the preference settings for fonts etc.
BTW, your information page looks a bit broken now – after the screenshots is a mass of textile source…
Argh, thank you for pointing that out. Had broken my plugin compiler’s symlink to classTextile.php
…
Code is topiary
Offline
Re: soo_editarea: EditArea integration with Txp tag highlighting
jsoo wrote: Good idea, done in v0.1.4. Note that it will allow you to go larger than the Txp default, but not smaller.
Well that was easy… how about this… “I want a pony”
Offline