Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-06-15 20:43:50

atbradley
Plugin Author
From: Rhode Island, US
Registered: 2007-02-15
Posts: 34
Website

atb_editarea: Enhance your Presentation area edit fields

This plugin simply uses Christophe Dolivet’s Editarea to enhance your Admin section’s Presentation tabs, giving you a useful code editor for your pages, forms, and stylesheets (and JavaScript, if you have stm_javascript installed).

Offline

#2 2010-06-17 11:30:40

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: atb_editarea: Enhance your Presentation area edit fields

Awesome, can’t wait to try it out!

Offline

#3 2010-06-17 14:12:13

wornout
Member
From: Italy
Registered: 2009-01-20
Posts: 256
Website

Re: atb_editarea: Enhance your Presentation area edit fields

Very helpful…
Just what I needed!

Offline

#4 2010-07-05 22:56:49

jan
Member
From: Utrecht, The Netherlands
Registered: 2006-08-31
Posts: 71
Website

Re: atb_editarea: Enhance your Presentation area edit fields

Wooo… this is perfect! The full screen option is very nice as well!


Kensington TXP powered rock

Offline

#5 2010-07-06 12:14:44

jan
Member
From: Utrecht, The Netherlands
Registered: 2006-08-31
Posts: 71
Website

Re: atb_editarea: Enhance your Presentation area edit fields

And support for tabs! :-) Great!


Kensington TXP powered rock

Offline

#6 2010-10-03 15:53:55

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: atb_editarea: Enhance your Presentation area edit fields

The plugin is great, thanks. Just wanted to point oud a strange rendering bug with latest versions of Safari. On my Mac, the shadows below the text are offset by 3-4 pixels, causing a mess. Previously it was working. Anybody else has this problem?

Offline

#7 2010-12-16 17:26:31

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

Re: atb_editarea: Enhance your Presentation area edit fields

Zanza wrote:

The plugin is great, thanks. Just wanted to point oud a strange rendering bug with latest versions of Safari. On my Mac, the shadows below the text are offset by 3-4 pixels, causing a mess. Previously it was working. Anybody else has this problem?

I’m late to the party, but I’ve just discovered this plugin. The offset/blurring is a known issue with Safari and EditArea.

Here’s a hack: find the following in edit_area_full.js (version 0.8.2):

if(t.isSafari){t.editor_area.Ç.position=\"absolute\";a.Ç.marginLeft=\"-3px\";if(t.isSafari < 3.2)a.Ç.marginTop=\"1px\";}

and replace with this:

if(t.isSafari){t.editor_area.Ç.position=\"absolute\";if(t.isSafari < 5)a.Ç.marginLeft=\"-3px\";if(t.isSafari < 3.2)a.Ç.marginTop=\"1px\";}

Note that this solution causes OmniWeb to develop the blurring problem. Can solve that by telling OmniWeb to spoof Safari 4 (use OmniWeb’s per-site preferences).


Code is topiary

Offline

#8 2010-12-16 17:37:08

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

Re: atb_editarea: Enhance your Presentation area edit fields

For rudimentary Txp syntax highlighting, add this to reg_syntax/html.js:

		,'txp' : {
			'search' : '(<)(/?txp:[^ \r\n\t>]*)([^>]*>)'
			,'class' : 'txp'
			,'modifiers' : 'gi'
			,'execute' : 'before' // before or after
		}

just above the similar tags item. Then add this:

			,'txp': 'color: #EE9216;'

in the REGEXPS item at the bottom. Edit the color value to suit.

If you don’t want to hack html.js, copy the entire file with the above changes into a new file called txp.js, changing a couple of items near the top from html to txp, then hack the plugin to get it to load txp.js where it currently loads html.js.


Code is topiary

Offline

#9 2011-04-28 00:19:41

marjoleink
Member
From: Amsterdam, NL
Registered: 2011-04-26
Posts: 18

Re: atb_editarea: Enhance your Presentation area edit fields

As a brand-new Textpattern user with an equally brand-new ‘multi-site’ install (for only one site so far), I installed atb_editarea today (mostly because I wanted some ‘assistance’ with installing themes). I reported an overview of my experience in the soo_editarea thread – on the one hand because I had also downloaded that plugin, but happened to try this one first, on the other hand because I added the txp.js file provided by Jeff Soo.

I’m very happy with the result now, but it took a bit to get it all working. Here’s what I did:

  • I copied the edit_area directory into the main textpattern installation directory (on the same level as the ‘sites’ tree)
  • I added the txp.js parser to the reg_syntax folder inside edit_area
  • I edited the plugin code so that for the textareas containing HTML it would use the txp parser instead of the html parser (that took me a while to figure out)
  • and then it didn’t work — until I realised that the plugin (necessarily) refers to the path where to find the EditArea script, and that location isn’t directly accessible from a site in a multi-site setup; once I’d figured that out the solution was easy: I created a symlink called edit_area in my sites/[sitename]/admin directory to the edit_area directory in the main textpattern installation directory.

And with that, it works beautifully!

Here’s my slightly tweaked code:

if (@txpinterface == 'admin')
{
	register_callback('atb_editarea_page', 'page');
	register_callback('atb_editarea_form', 'form');
	register_callback('atb_editarea_style', 'css');
	register_callback('atb_editarea_plugin', 'admin_side', 'body_end');
}

function atb_editarea_page() { atb_editarea('html', 'txp'); }	// TXP syntax highlighter
function atb_editarea_form() { atb_editarea('form', 'txp'); }	// TXP syntax highlighter
function atb_editarea_style() { atb_editarea('css', 'css'); }
function atb_editarea_plugin() {
	if ( 'js' === gps('event') ) { atb_editarea('js', 'js'); }
}

function atb_editarea( $did, $syntax ) {

	echo <<<EOS
<script language="javascript" type="text/javascript" src="edit_area/edit_area_full.js"></script>
<script language="javascript" type="text/javascript">
editAreaLoader.init({
	id : "$did"		// textarea id
	,syntax: "$syntax"			// syntax to be used for highlighting
	,start_highlight: true		// to display with highlight mode on start-up
});
</script>
EOS;
}

atbradley wrote:

This plugin simply uses Christophe Dolivet’s Editarea to enhance your Admin section’s Presentation tabs, giving you a useful code editor for your pages, forms, and stylesheets (and JavaScript, if you have stm_javascript installed).

The link for the plugin given here (top post in this thread) no longer works – above I’ve linked to its page in the Textpattern.org site. Also, for EditArea this isn’t the best link, better link to this EditArea Sourceforge page which (for now) still has the same version as you’re including in the plugin.

Cheers,

Last edited by marjoleink (2011-04-28 00:22:49)


Marjolein Katsma ¤ Hacking a theme to learn tags now ¤ nul = nada — lt = very little — why is there even a site there?

Offline

Board footer

Powered by FluxBB