Textpattern Forum

You are not logged in. Register | Login | Help

#1 2007-02-26 20:49:22

hcgtv
Member
From: Charlotte, NC
Registered: 2005-11-29
Posts: 2,154
Website

EditArea usage in the admin section

This is a continuation from this thread topic posted by Nathan82.

I’ve been banging the heck out of EditArea in my local install, using the latest SVN code (r2243), and it works fine, great for working on new templates and tweaking plugin code.

Basic instructions:

  • Download the lastest version of EditArea
  • Unzip it to your local machine, rename the folder to editarea
  • Upload the editarea folder as a subdirectory under /textpattern on your web server

Edit /textpattern/lib/txplib_head.php, insert the following lines before the </head> line:

<script language="javascript" type="text/javascript" src="editarea/edit_area/edit_area_compressor.php?plugins"></script>
	<script language="javascript" type="text/javascript">
	editAreaLoader.init({
	id : "html"
	,syntax: "html"
	,start_highlight: "true"
	,allow_toggle: "true"
	,display: "later"
	,font_family: 'Consolas, Monaco, "Courier New", monospace'
	});
	editAreaLoader.init({
	id : "form"
	,syntax: "html"
	,start_highlight: "true"
	,allow_toggle: "true"
	,display: "later"
	,font_family: 'Consolas, Monaco, "Courier New", monospace'
	});
	editAreaLoader.init({
	id : "css"
	,syntax: "css"
	,start_highlight: "true"
	,allow_toggle: "true"
	,display: "later"
	,font_family: 'Consolas, Monaco, "Courier New", monospace'
	});
	editAreaLoader.init({
	id : "plugin-code"
	,syntax: "php"
	,start_highlight: "true"
	,allow_toggle: "true"
	,display: "later"
	,font_family: 'Consolas, Monaco, "Courier New", monospace'
	});
	</script>

What you’ll have is a toggle under Pages, Forms, Style and Plugin edit areas. This gives you the same speed the normal backend gives you but with a one click access to syntax highlighting, true tab support and full browser screen editing.

Enjoy and let me know how it works for you.


txp:tag – Textpattern Tags ~ TxPlanet – Textpattern Planet

Offline

#2 2007-02-26 20:55:04

hakjoon
Moderator
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,631
Website

Re: EditArea usage in the admin section

Is EditArea finally working well enough that it’s usable? Wouldn’t be too hard to package this up as a plugin.


Shoving is the answer – pusher robot

Offline

#3 2007-02-26 21:09:24

hcgtv
Member
From: Charlotte, NC
Registered: 2005-11-29
Posts: 2,154
Website

Re: EditArea usage in the admin section

hakjoon wrote:

Wouldn’t be too hard to package this up as a plugin.

That would indeed be awesome, I just don’t have the TxP plugin experience to do it.

As for it being stable, it’s yet to crash my Firefox browser and it’s very fast. One of the reasons I made this post was I was hoping for others to try it and give me their impressions.

As for a plugin, there’s many ways load the script and with different options. There’s also some things that can be left out, like docs, examples, etc. I just haven’t delved into slimming it down but it can be done for a smaller download.


txp:tag – Textpattern Tags ~ TxPlanet – Textpattern Planet

Offline

#4 2007-02-26 21:37:18

mrdale
Moderator
From: Walla Walla
Registered: 2004-11-19
Posts: 2,051
Website

Re: EditArea usage in the admin section

Awesome! pretty code colors… Always wanted something like this to pop up…

Offline

#5 2007-02-26 21:38:07

hakjoon
Moderator
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,631
Website

Re: EditArea usage in the admin section

Quick and Dirty. Have to edit the plugin code if you want to change any thing. I can flesh it out if there is interest. Doesn’t work in the plugin tab because plugins can’t run there.

hak_editarea_v0.1.txt


Shoving is the answer – pusher robot

Offline

#6 2007-02-26 22:01:05

hcgtv
Member
From: Charlotte, NC
Registered: 2005-11-29
Posts: 2,154
Website

Re: EditArea usage in the admin section

hakjoon wrote:

Doesn’t work in the plugin tab because plugins can’t run there.

Wow, that’s a bummer, it’s most useful for tweaking plugin code. Is this written in stone somewhere that plugins can’t mess with this area?

Installed the plugin, works fine, TxPlugin 101 class :)

Last edited by hcgtv (2007-02-26 22:07:55)


txp:tag – Textpattern Tags ~ TxPlanet – Textpattern Planet

Offline

#7 2007-02-26 22:11:19

hakjoon
Moderator
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,631
Website

Re: EditArea usage in the admin section

hcgtv wrote:
Is this written in stone somewhere that plugins can’t mess with this area?

It’s so you can always uninstall a bad plugin. Which if you think about is a pretty good idea :)

However we could always enable it for Yura’s plugin composer. Which will also let you edit the plugin and does not have the plugin tab limitation.


Shoving is the answer – pusher robot

Offline

#8 2007-02-26 22:18:30

mrdale
Moderator
From: Walla Walla
Registered: 2004-11-19
Posts: 2,051
Website

Re: EditArea usage in the admin section

>hak

That was quick. Sure makes editing a 950 line css file more fun… which makes me wonder, is that a Massive CSS file?

Offline

#9 2007-02-26 22:19:07

hakjoon
Moderator
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,631
Website

Re: EditArea usage in the admin section

hakjoon wrote:
However we could always enable it for Yura’s plugin composer.

Well it requires editing the plugin code to give the textarea an ID, but it works.

Last edited by hakjoon (2007-02-26 22:22:36)


Shoving is the answer – pusher robot

Offline

#10 2007-02-26 22:19:13

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,383
Website

Re: EditArea usage in the admin section

Great plugin, thanks Bert and Patrick!


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

Board footer

Powered by FluxBB