Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-12-20 23:37:07

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

soo_editarea: EditArea integration with Txp tag highlighting

EditArea is a JavaScript-based code editor for browser textareas. Features include:

  • Code highlighting
  • Browser tab-key override for proper tabbing in the textarea
  • Full-screen mode
  • Find & replace w/ regex support
  • Multiple undo/redo

soo_editarea provides easy integration of EditArea into Textpattern. (Well, pretty easy: there are a few steps involved.)

Features:

You can set plugin preferences for:

  • Syntax language for Page & Form editing, allowing custom syntax file
  • Source path, making it easier to share one EditArea installation across multiple sites
  • Various EditArea options (tooltip language, font size & family, &c.)

Available at http://ipsedixit.net/txp/124/soo_editarea

Version History

  • 0.1.5 (2012/01/24)
    • Added pref for EditArea plugins (as requested by mrdale)
  • 0.1.4 (2011/04/27)
    • Added default height/width prefs (as requested by mrdale)
  • 0.1.3 (2010/12/30)
    • Fixed bug with Internet Explorer (type attribute in script tag)
    • General code cleaning
  • 0.1.2 (2010/12/20)
    • More preference options (tooltip language, font size & family, tab-to-space conversion)
  • 0.1.1 (2010/12/20)
    • Documentation update [thanks to Marc C. for the suggestions]
  • 0.1.0 (2010/12/20)
    • EditArea integration for Txp’s Page Template, Form, and CSS editors

Suggested by the (apparently defunct) atb_editarea plugin, and discussion on the Txp forum.

Last edited by jsoo (2012-01-26 01:10:08)


Code is topiary

Offline

#2 2010-12-20 23:59:24

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 581
Website

Re: soo_editarea: EditArea integration with Txp tag highlighting

Wow, thanks! Just got it all working, great plugin.

The only part that I kind of misunderstood at first revolves around the separate txp syntax instructions:

To have Txp tags appear in a different color, add a new syntax file at edit_area/reg_syntax/. (Whenever you upgrade the EditArea files you will have to remember to preserve this file.) Then change the soo_editarea option for Page Template & Form syntax (the installation instructions tell you how to set plugin options).

What I did:

  1. download txp.js and put it in the reg_syntax subfolder
  2. install soo_plugin_pref
  3. click on the soo_editarea plugin’s “Options” link and
  4. type “txp” in the “Page Template and Form Syntax” box.

That got the Textpattern tags highlighted in a different color. Nice :-)

Offline

#3 2010-12-21 00:16:28

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

Re: soo_editarea: EditArea integration with Txp tag highlighting

Thanks Marc; I’ll amend the instructions to make this clearer.

Edit: Done, and released version 0.1.2 with more options.

Last edited by jsoo (2010-12-21 02:49:32)


Code is topiary

Offline

#4 2010-12-21 08:38:54

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: soo_editarea: EditArea integration with Txp tag highlighting

Could you share a screenshot?


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#5 2010-12-21 13:43:29

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

Re: soo_editarea: EditArea integration with Txp tag highlighting

the_ghost wrote:

Could you share a screenshot?

Added screenshots to info page.

Or try the EditArea demo.


Code is topiary

Offline

#6 2010-12-21 14:33:28

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,385

Re: soo_editarea: EditArea integration with Txp tag highlighting

In Safari Mac the letters are blurred and unreadable, the same in iCab, in Google Chrome it is sharp.

Offline

#7 2010-12-21 14:49:00

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

Re: soo_editarea: EditArea integration with Txp tag highlighting

GugUser wrote:

In Safari Mac the letters are blurred and unreadable, the same in iCab, in Google Chrome it is sharp.

This is a known issue with EditArea and Safari. You can hack EditArea (as suggested in that link) or have Safari spoof a different user agent. It may also be possible to solve this with CSS, but I haven’t looked into it closely. Admittedly, that would probably be the cleanest solution.

iCab is also a WebKit browser so the solution is probably the same. (I haven’t used iCab for about 10 years so I don’t know.) OmniWeb is yet another WebKit browser, that works as is with EditArea. Oddly, though, the above hack fixes Safari but then makes OmniWeb blurry. (However, with OmniWeb it is easy to spoof different user agents on a per-domain basis.)


Code is topiary

Offline

#8 2010-12-21 17:37:20

hcgtv
Plugin Author
From: Miami, Florida
Registered: 2005-11-29
Posts: 2,634
Website

Re: soo_editarea: EditArea integration with Txp tag highlighting

Jeff, this looks good, thanks.

Offline

#9 2010-12-21 22:11:05

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,385

Re: soo_editarea: EditArea integration with Txp tag highlighting

In fact, by changing the user agent (in the same Safari), the quality of the characters is better. The best result is obtained if Safari faked to be Opera. Strange behavior of Safari.

Offline

#10 2010-12-22 00:15:02

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: soo_editarea: EditArea integration with Txp tag highlighting

Very nice! Easy to set up and it works well for me, I usually use Firefox or Chrome TXPing.

Well done Jeff, and just in time for Christmas too.

Offline

Board footer

Powered by FluxBB