Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2010-12-30 11:01:38

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

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 the sites directory)
  • I dropped your txp.js file into the reg_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 called edit_area to the edit_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

#18 2011-04-27 21:04:49

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

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

#19 2011-04-28 01:24:21

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

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

#20 2011-04-28 01:38:37

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

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

#21 2011-04-28 01:40:56

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

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

#23 2011-04-28 12:14:00

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

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

#24 2011-04-28 15:08:24

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

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

#26 2011-11-21 17:50:37

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

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.

———————-

  1. Installed and activated soo_editarea version 0.1.4 on TXP 4.4.1
  2. Placed /edit_area (EditArea 0.8.2) in /textpattern
  3. Installed and activated soo_plugin_pref version 0.2.2
  4. 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

#27 2012-01-08 00:16:48

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: soo_editarea: EditArea integration with Txp tag highlighting

This is awesome, thanks :¬)

Last edited by rossharvey (2012-01-08 00:17:49)

Offline

#28 2012-01-08 05:53:30

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

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

#29 2012-01-09 16:45:06

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

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

#30 2012-01-24 15:39:01

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

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

Board footer

Powered by FluxBB