Welcome, Guest. Please login or register.
August 20, 2008, 05:27:31 PM

Login with username, password and session length
Search:     Advanced search
Website Baker 2.7.0 (stable) released!
For more information look here.
The announcement board can be found here.
60556 Posts in 9791 Topics by 5824 Members
Latest Member: blubb
* Home Help Search Login Register
+  Website Baker Community Forum
|-+  English
| |-+  Modules
| | |-+  Code module with syntax highlighting
Pages: [1] Go Down Print
Author Topic: Code module with syntax highlighting  (Read 1178 times)
doc
Leaders Team
A Baker's Baker
*****
Offline Offline

Posts: 2277

Never mind!!!


« 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
Leaders Team
A Baker's Baker
*****
Offline Offline

Posts: 2277

Never mind!!!


« 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
Pending Apprentice Baker
**
Offline Offline

Posts: 7


Email
« 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
Leaders Team
A Baker's Baker
*****
Offline Offline

Posts: 2277

Never mind!!!


« 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
« Last Edit: April 21, 2007, 07:13:12 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.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!