Welcome, Guest. Please login or register.
March 21, 2010, 10:55:27 AM

Login with username, password and session length
Search:     Advanced search
WB 2.8.1 veröffentlicht!
Download und weitere Informationen gibt es hier .
110578 Posts in 15968 Topics by 9313 Members
Latest Member: Gudrun
* Home Help Search Login Register
+  WebsiteBaker Community Forum
|-+  English
| |-+  Archive (posts up to 2007) (Moderators: Argos, BerndJM)
| | |-+  Code module with syntax highlighting
Pages: [1] Go Down Print
Author Topic: Code module with syntax highlighting  (Read 2754 times)
doc

Offline Offline

Posts: 3581


« on: April 20, 2007, 11:15:44 PM »

Hello,

I have combined the default code module coming along with Website Baker with syntax highlighting functionality of Codepress.

Codepress is written by Fernando M.A.d.S. and allows syntax highlighting for HTML, CSS, Javascript and PHP tags within textareas. For further details see: http://codepress.org.

Download the attached module and install it from the WB backend. Maybe this feature could be added by default into WB2.7.

Please note:
This module works only for code, not for WYSIWYG pages (don´t know if this would make sense).

Regards Christian

Removed attachment. The updated one can be found in this thread
« Last Edit: April 22, 2007, 12:36:28 AM by doc » Logged
pcwacht
Guest
« Reply #1 on: April 21, 2007, 09:53:06 AM »

Quote
Please note:
This module works only for code, not for WYSIWYG pages (don´t know if this would make sense).
Maybe add it to the template editor and the module editor??
There it would make sense Wink


John
Logged
doc

Offline Offline

Posts: 3581


« Reply #2 on: April 21, 2007, 12:18:54 PM »

Hello John,

thanks for the proposal with the template editor. I think syntax highlighting would make a lot of sense for that module. What do you mean by module editor? I thought there is only a language and template editor available so far.

Best regards
Christian

P.S.: Have updated the attached module below (forgott to remove the starting <?php tag and the comment line while saving smiley
Logged
greenlemon

Offline Offline

Posts: 28


« Reply #3 on: April 21, 2007, 03:46:42 PM »

nice one!

but i think heres a bug by using 2 instances of code in one page.
the interface for typing in some code is showing two times of every instance.
know what i mean?
Logged
doc

Offline Offline

Posts: 3581


« Reply #4 on: April 21, 2007, 05:06:54 PM »

@greenlemon
The problem is related to the fact, that the Codepress Javascript routines needs to be linked into the <head> section for all admin pages. As its hard coded in the code2 module, each new module creates another JS link which cause this effect.

Have shifted the codepress folder to: /include/codepress. The JS routines needs to be included to the admin pages by inserting the code below between the <head></head> section of the file: /admin/interface/header.html

Code:
<script type="text/javascript" src="{INTERFACE_DIR}/../../include/codepress/codepress.js"></script>

I put a package together which allows syntax highlighting for the new module code2 and for the templateedit module (supports: CSS, Javascript, HTML, PHP files). If somebody wants to test the two modules, please donwload the attached zip file, extract the files and follow the instructions in the README.txt file. Maybe both features could be implemented by default into WB2.7.

Regards Christian

[Edit]Attachment removed as the module is not supported anymore and there are problems when the module is used in combination with Code2 from Chio.[/Edit]
« Last Edit: November 18, 2008, 07:29:50 PM by doc » Logged
pcwacht
Guest
« Reply #5 on: April 21, 2007, 05:31:18 PM »

Quote
What do you mean by module editor?
Hmm thought I have posted it here somewhere.
Basicly is the templateeditor but it looks at the modules dir instead, so you can edit the module files as well.

John

ps, did a brief search but wasn't able to find it in the forum.
Logged
Pages: [1] Go Up Print 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!