Jul 05, 2009, 09:09 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Search via SMF or Google: modx forums all of modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
News:Read what MODx Developers say: MODx Dev. Blogs
Pages: [1] 2 3 4   Go Down
  Print  
Author Topic: [Plugin] CodePress Snippet Syntax Highlighter  (Read 16074 times)
0 Members and 1 Guest are viewing this topic.
netnoise
Coding Team
*
Posts: 213



WWW
« on: Oct 17, 2006, 10:54 AM »

This experimental Plugin replaces the standard textarea for editing snippets with CodePress. To use it, extract archive to plugins folder, create a new plugin with the code from codepress.plugin.php and toggle 'OnSnipFormRender' event.

Edit: Don't use this version, it has been obsoleted. Try 0.2 instead.


* codepress_screenshot.png (78.35 KB, 881x791 - viewed 755 times.)
* codepress-0.1.tar.gz (60.13 KB - downloaded 489 times.)
« Last Edit: Jun 21, 2007, 03:17 AM by netnoise » Logged

davidm
MODx evangelist
Marketing & Design Team
*
Posts: 7,026


Software is like sex, it's better when it's free !


WWW
« Reply #1 on: Oct 17, 2006, 10:58 AM »

There was already something to that effect, but it was not a *live* syntax highlighting... this is awesome !
I have been dreaming about this for a long time... Off to install this baby Grin

It this works fine, I say we bundle this plugin with the MODx distribution...

Edit : Just wondering... how difficult would it be to add this for template editing ?
It would be nice having html with syntax highlighting... and modules, plugins and possibly other content too...
« Last Edit: Oct 17, 2006, 11:06 AM by davidm » Logged

.: nodeo.net : Pour un web libre, moderne et ouvert ! :: david-molliere.net : Suivez en "live" mes expérimentations et billets sur les CMS et autres applications web :.

*** Forums modxcms.fr Participez à l'élaboration du site MODx francophone ! ***

! Nouveau !  En live, ne manquez pas les news de modxcms.fr sur Twitter   ! Nouveau !

MODx est l'outil idéal pour les developpeurs et webdesigners qui cherchent un framework de gestion de contenu hautement flexible et performant, tout en étant simple d'accès pour les utilisateurs finaux.

Config : Apache 2.2.8 - MySQL 5.0.67 - PHP 5.2.8 | Debian 4.0 (Etch)

Réalisations sous MODx : | pargade-notaires.fr | soleil.info | gican.asso.fr | michelez-notaires.com | amadom.gerondicap.com | jocelyne-violet.net
netnoise
Coding Team
*
Posts: 213



WWW
« Reply #2 on: Oct 17, 2006, 11:38 AM »

The CodePress editor already supports HTML/CSS highlighting among PHP and others, too. It seems to be quite easy to make that work for template editing, chunks, and so. Will do it by time if nobody else does Wink
Logged

davidm
MODx evangelist
Marketing & Design Team
*
Posts: 7,026


Software is like sex, it's better when it's free !


WWW
« Reply #3 on: Oct 17, 2006, 11:42 AM »

Yeah well, too bad I can't help there, my php training is planned in december...

Anyway, thanks Smiley
Logged

.: nodeo.net : Pour un web libre, moderne et ouvert ! :: david-molliere.net : Suivez en "live" mes expérimentations et billets sur les CMS et autres applications web :.

*** Forums modxcms.fr Participez à l'élaboration du site MODx francophone ! ***

! Nouveau !  En live, ne manquez pas les news de modxcms.fr sur Twitter   ! Nouveau !

MODx est l'outil idéal pour les developpeurs et webdesigners qui cherchent un framework de gestion de contenu hautement flexible et performant, tout en étant simple d'accès pour les utilisateurs finaux.

Config : Apache 2.2.8 - MySQL 5.0.67 - PHP 5.2.8 | Debian 4.0 (Etch)

Réalisations sous MODx : | pargade-notaires.fr | soleil.info | gican.asso.fr | michelez-notaires.com | amadom.gerondicap.com | jocelyne-violet.net
Gildas
Full Member
***
Posts: 172


WWW
« Reply #4 on: Oct 18, 2006, 02:09 AM »

This is a GREAT tool Grin Exactly what I'am looking for... Now I have a replacement for all my [[Include]] Wink

David, I have made some tests and it works fine with Chunks and Templates...
Logged

Ackwa | [Plugin] EditArea : Download / Support
OncleBen31
Sr. Member
****
Posts: 283


I believe in MODx!


WWW
« Reply #5 on: Oct 18, 2006, 02:53 AM »

Waow  Grin Grin!!!

I dream of something like that. This Plugin is a must have. it's work well and it's easy to use it with template, chunk, plugin and module editing. Just replace the line
Code:
if($e->name=='OnSnipFormRender') {
by
Code:
if($e->name=='OnSnipFormRender' || $e->name=='OnChunkFormRender' || $e->name=='OnPluginFormRender' || $e->name=='OnModFormRender' || $e->name=='OnTempFormRender') {
And add the following events : OnChunkFormRender, OnPluginFormRender, OnModFormRender, OnTempFormRender

For the moment I don't succed in using it with document editing. Any idea ?
Logged
davidm
MODx evangelist
Marketing & Design Team
*
Posts: 7,026


Software is like sex, it's better when it's free !


WWW
« Reply #6 on: Oct 18, 2006, 04:41 AM »

Thanks guys !

@OncleBen31 : I'll try this code !

I imagine what you tried and didn't get to work for documents is add

$e->name=='OnDocFormRender'

to the list.

I am no dev as you know, but when you tried it, did you turn off WYSIWYG ? If WYSIWYG is on, it is logical since it's not a textarea but a richtext area.

Plus, if there are several plugin which listen to the same event, that could also be the cause of it... There is a new feature in 0.9.5 which allows to control the execution ordrer of plugins, maybe look in that direction...



Logged

.: nodeo.net : Pour un web libre, moderne et ouvert ! :: david-molliere.net : Suivez en "live" mes expérimentations et billets sur les CMS et autres applications web :.

*** Forums modxcms.fr Participez à l'élaboration du site MODx francophone ! ***

! Nouveau !  En live, ne manquez pas les news de modxcms.fr sur Twitter   ! Nouveau !

MODx est l'outil idéal pour les developpeurs et webdesigners qui cherchent un framework de gestion de contenu hautement flexible et performant, tout en étant simple d'accès pour les utilisateurs finaux.

Config : Apache 2.2.8 - MySQL 5.0.67 - PHP 5.2.8 | Debian 4.0 (Etch)

Réalisations sous MODx : | pargade-notaires.fr | soleil.info | gican.asso.fr | michelez-notaires.com | amadom.gerondicap.com | jocelyne-violet.net
OncleBen31
Sr. Member
****
Posts: 283


I believe in MODx!


WWW
« Reply #7 on: Oct 18, 2006, 04:57 AM »

I've already test without the Rich Text Editor : still doesn't work. And I've test to change the order execution with Button Botom Bar... and no change.
Logged
davidm
MODx evangelist
Marketing & Design Team
*
Posts: 7,026


Software is like sex, it's better when it's free !


WWW
« Reply #8 on: Oct 18, 2006, 05:04 AM »

Ok... thanks.

Maybe someone from the dev team could help us here Smiley
Logged

.: nodeo.net : Pour un web libre, moderne et ouvert ! :: david-molliere.net : Suivez en "live" mes expérimentations et billets sur les CMS et autres applications web :.

*** Forums modxcms.fr Participez à l'élaboration du site MODx francophone ! ***

! Nouveau !  En live, ne manquez pas les news de modxcms.fr sur Twitter   ! Nouveau !

MODx est l'outil idéal pour les developpeurs et webdesigners qui cherchent un framework de gestion de contenu hautement flexible et performant, tout en étant simple d'accès pour les utilisateurs finaux.

Config : Apache 2.2.8 - MySQL 5.0.67 - PHP 5.2.8 | Debian 4.0 (Etch)

Réalisations sous MODx : | pargade-notaires.fr | soleil.info | gican.asso.fr | michelez-notaires.com | amadom.gerondicap.com | jocelyne-violet.net
OncleBen31
Sr. Member
****
Posts: 283


I believe in MODx!


WWW
« Reply #9 on: Oct 18, 2006, 05:35 AM »

Maybe someone from the dev team could help us here Smiley
Please  Wink

If there is RegExp master, I think it will be easy for him to add some code in the javascript to add the MODx tag for highlighting.
Logged
TobyL
Coding Team
*
Posts: 1,006



« Reply #10 on: Oct 18, 2006, 05:55 AM »

Whoa....ha!

MODx is starting to freak me  Grin This is so cool man! Picked up a few typo's in my snippet straight away...

I did notice though that teh highlighting fails if there's a lot of comments at the top of the snippet. I looked at several snippets and each time if it has lot's of comments the code doesn't highlight anymore. Come to think of it this may have to do with (single) quote's in comments. The highlighter colors text in quotes, even in comments I noticed. Offcourse a single - single quote isn't unusual in comments. Hmm,.. I'll take that up with the developer I think.
Logged

davidm
MODx evangelist
Marketing & Design Team
*
Posts: 7,026


Software is like sex, it's better when it's free !


WWW
« Reply #11 on: Oct 18, 2006, 06:07 AM »

Did anyone of you have a path problem with the plugin ?

I get this error (with 0.9.5 rev 1732) :

Code:
Not Found
The requested URL /assets/plugins/codepress/codepress.html was not found on this server.

I have checked typing http://www.mydomain.tld/assets/plugins/codepress/codepress.html the file is there alright.
I am guessing it's a path problem.

Code:
ta.parentNode.innerHTML+= '<iframe onload="setCode();" style="border:none; margin:0; padding:0; width:100%; height:400px;" id="codepress" src="/assets/plugins/codepress/codepress.html"></iframe><br />';

It seems it's a relative path, might be what's causing this...

Edit : It's indeed a path problem.
I have harcoded the full url instead of relative path and it's working as expected...
« Last Edit: Oct 18, 2006, 06:13 AM by davidm » Logged

.: nodeo.net : Pour un web libre, moderne et ouvert ! :: david-molliere.net : Suivez en "live" mes expérimentations et billets sur les CMS et autres applications web :.

*** Forums modxcms.fr Participez à l'élaboration du site MODx francophone ! ***

! Nouveau !  En live, ne manquez pas les news de modxcms.fr sur Twitter   ! Nouveau !

MODx est l'outil idéal pour les developpeurs et webdesigners qui cherchent un framework de gestion de contenu hautement flexible et performant, tout en étant simple d'accès pour les utilisateurs finaux.

Config : Apache 2.2.8 - MySQL 5.0.67 - PHP 5.2.8 | Debian 4.0 (Etch)

Réalisations sous MODx : | pargade-notaires.fr | soleil.info | gican.asso.fr | michelez-notaires.com | amadom.gerondicap.com | jocelyne-violet.net
Onesmarthost
Moderators
*
Posts: 436


I love MODx!


WWW
« Reply #12 on: Oct 18, 2006, 07:24 AM »

This is a great addon Smiley

Thanks.,  Grin
Logged

Aaron Wardle

http://www.onesmarthost.co.uk/modx-hosting-offer.html // UK Web Hosting with lots of MODx Love..
Free MODx Install
Free transfer from existing web host!
Perrine
Moderators
*
Posts: 1,774



WWW
« Reply #13 on: Oct 18, 2006, 07:52 AM »

Very nice ! Thx a lot Wink
Logged

Nouveau sur MODx ? ||
Recherche
Communauté FR
Documentation FR
Réalisations sous MODx
Webolution
Entreprise AGS
J'aurais dû lui dire...
Atelier d'architecture Gambino
Déco'In : l'idée deco qu'il vous faut
HistWar : jeu de stratégie napoléonien

Ma config : MODx 0.9.6.2/3 || Apache 2.2.8 || PHP 5.2.6 || MySQL 5.0.45 || Debian 4.0 (Etch)
xwisdom
Foundation
*
Posts: 1,732



« Reply #14 on: Oct 20, 2006, 03:39 PM »

Man I've been looking for something like this for years! Were on earth did you find it?

It's WONDERFUL!!

Bye bye Textarea!

Logged

xWisdom
www.xwisdomhtml.com
The fear of the Lord is the beginning of wisdom:
MODx Co-Founder - Create and do more with less.
Pages: [1] 2 3 4   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF | SMF © 2006-2008, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!