Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

hcgtv
Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
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.

Offline

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

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
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
Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
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.

Offline

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

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
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
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
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
Plugin Author
From: Key Largo, Florida
Registered: 2005-11-29
Posts: 2,722
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)

Offline

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

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
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
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
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
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
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
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: EditArea usage in the admin section

Great plugin, thanks Bert and Patrick!

Offline

#11 2007-02-26 22:20:16

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: EditArea usage in the admin section

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?

Yes. Plugins are deliberately disabled on the plugins tab. Otherwise there’d be no way to disable a plugin gone haywire.


Alex

Offline

#12 2007-02-26 22:25:40

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: EditArea usage in the admin section

mrdale wrote:
Sure makes editing a 950 line css file more fun… which makes me wonder, is that a Massive CSS file?

Well the CSS for my site is at 510 lines and it’s pretty basic, so I’d say you are on the small side :)

Bert, Els, mrDale, anybody else:
Please post stuff you would like to be able to do/customize with this and I’ll work on a more polished version. The code right now is a little too quick and dirty for a real release.

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


Shoving is the answer – pusher robot

Offline

Board footer

Powered by FluxBB