Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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_areadirectory inside the textpattern install directory (i.e. at the same level as thesitesdirectory) - I dropped your
txp.jsfile into thereg_syntaxfolder (it seems to be functionally identical to the file iblastoff made but that has disappeared) - inside the
sites/[mysite]/admindirectory I made a symlink callededit_areato theedit_areadirectory (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
#25 2011-04-28 16:14:31
- marjoleink
- Member

- From: Amsterdam, NL
- Registered: 2011-04-26
- Posts: 18
Re: soo_editarea: EditArea integration with Txp tag highlighting
mrdale wrote:
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”
if ($user == 'mrdale') echo "here's your pony!";
There you are!
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
edit: Ooops, sorry folks. This problem was due to running PHP 4 rather than PHP 5 or better. Flipped the PHP switch forward and all is well. Beautiful. Disregard the rest of this post. Problem solved.
———————-
- Installed and activated
soo_editareaversion 0.1.4 on TXP 4.4.1 - Placed
/edit_area(EditArea 0.8.2) in/textpattern - Installed and activated
soo_plugin_prefversion 0.2.2 - Placed txp.js in
/edit_area/reg_syntax
Going to Presentation > Forms, Pages, Style:
Fatal error: Call to undefined function: array_diff_key() in /textpattern/lib/txplib_misc.php(653) : eval()'d code on line 96
Going to Plugins > soo_editarea > Options:
Fatal error: Call to undefined function: array_diff_key() in /textpattern/lib/txplib_misc.php(540) : eval()'d code on line 81
Last edited by whaleen (2011-11-21 17:55:40)
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline
Re: soo_editarea: EditArea integration with Txp tag highlighting
This is awesome, thanks :¬)
Last edited by rossharvey (2012-01-08 00:17:49)
Offline
Re: soo_editarea: EditArea integration with Txp tag highlighting
Just edited this plugin to allow zencoding… just change
$func = 'editAreaLoader.init({' . n . t . 'start_highlight: true';
to
$func = 'editAreaLoader.init({' . n . t . 'start_highlight: true, plugins: "zencoding"';
and make sure the zencoding plugin is in editareas plug directory.
hint: maybe this could be made a config item.
Last edited by mrdale (2012-01-08 05:53:54)
Offline
Re: soo_editarea: EditArea integration with Txp tag highlighting
Fantastic, thanks Dale, I was thinking about that just this morning :¬)
Edit: I added the zencoding folder under the editarea plugin directory, then changed the above line via editing the plugin. How now, do I invoke the ‘replace’ after typing, for example, div#content>p.icon ?
Edit 2: found it: ctrl+,
Last edited by rossharvey (2012-01-09 16:55:58)
Offline
Re: soo_editarea: EditArea integration with Txp tag highlighting
mrdale wrote:
hint: maybe this could be made a config item.
I can take a hint. Especially when it’s presented on a silver platter. v0.1.5 now available; thanks again to mrdale. I haven’t actually tested it with zencoding, but the resultant js output looks correct to me.
Code is topiary
Offline