Welcome, Guest. Please login or register.
Did you miss your activation email?
February 12, 2012, 04:11:58 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
149621 Posts in 21098 Topics by 7537 Members
Latest Member: lotte2
* Home Help Search Login Register
Pages: 1 2 [3]   Go Down
Print
Author Topic: addon (2.6.0): Template Edit  (Read 26484 times)
YeShakka

Offline Offline

Posts: 146



« Reply #50 on: July 11, 2006, 04:49:14 PM »

Hi develper of this module!
attached the patched files.
With these files it will be possible to use the module if the Admin istn't in the dir WBDIR/admin

I replaced
Code:
<?php echo WB_URL?>/admin
by
Code:
<?php echo ADMIN_URL?>/

One suggestion:
please try to incorporate the Generic Syntax Highlighter - GeSHi
in the next release:
http://qbnz.com/highlighter/

Greetings,
Shakka
Logged
pcwacht
Guest
« Reply #51 on: July 11, 2006, 06:37:08 PM »

I did look into codehighlighting before...
but it must highlight in a textarea (where the edit takes place)

You know some script wich does just that?


John
Logged
ruebenwurzel
WebsiteBaker Org e.V.

Offline Offline

Posts: 7660



WWW
« Reply #52 on: July 11, 2006, 07:56:15 PM »

Hello Shakka,

replaced the version at addons repository with the patched version from you.

Thanks for your work

Matthias
Logged
pcwacht
Guest
« Reply #53 on: July 11, 2006, 08:32:25 PM »

Here is a very tiny function wich outputs highlighted code

Code:
function highlight_code($code) {
    define(COLOR_DEFAULT, '000');
    define(COLOR_FUNCTION, '00b'); //also for variables, numbers and constants
    define(COLOR_KEYWORD, '070');
    define(COLOR_COMMENT, '800080');
    define(COLOR_STRING, 'd00');
    if(substr($code, 0, 2) != '<?') {
        $code = "<?\n".$code."\n?>";
        $add_tags = true;
    }
    $code = highlight_string($code, true);
    if(substr($code, 0, 6) == '<code>') {
       $code = substr($code, 6, (strlen($code) - 13));
    }
    $xhtml_convmap = array(
       '<font' => '<span',
       '</font>' => '</span>',
       'style="color:' => 'style="color:',
       '<br />' => '<br/>',
       '#000000">' => '#'.COLOR_DEFAULT.'">',
       '#0000BB">' => '#'.COLOR_FUNCTION.'">',
       '#007700">' => '#'.COLOR_KEYWORD.'">',
       '#FF8000">' => '#'.COLOR_COMMENT.'">',
       '#DD0000">' => '#'.COLOR_STRING.'">'
    );
    $code = strtr($code, $xhtml_convmap);
    $code = substr($code, 25, (strlen($code) -33));
    if($add_tags) {
        $code = substr($code, 0, 26).substr($code, 36, (strlen($code) - 74));
    }
    return $code;
}


John
Logged
Waldschwein
Guest
« Reply #54 on: December 11, 2007, 01:48:32 PM »

Hello!

Yes, I know it's a long time ago, but I have some suggestion:
Can the Template Edit use the way of editing the files like the new AnotherImageGallery 1.6 does? With highlite function and line number? Would be great.  cool

Regards Michael
Logged
doc
Guest
« Reply #55 on: December 11, 2007, 04:17:44 PM »

Hello Michael,

this is no problem. The required Javascript stuff is implemented since the WB2.6.6 core. I posted a generic solution in the Hello world thread. Ralf (Berlin) has added this feature to the Bookmarks.
So everything to add syntax highlighting is there, we simply need some volunteers who implement it.

Regards Christian
Logged
doc
Guest
« Reply #56 on: December 19, 2007, 06:37:41 PM »

Hello,

just released v1.41 of the Template Edit module on the Addons repository. This release includes the syntax highlighting features of the Codepress framework introduced with WB 2.6.7.

Requirments for Syntax highlighting
WB version: >=2.6.7
Javascript must be enabled in your browser

If WB version is below 2.6.7 or Javascript is disabled, the module works as the previous version.

Installation
Deinstall any existing version via the WB backend, then install the new version.

Have fun
Christian
« Last Edit: December 22, 2007, 08:29:10 AM by doc » Logged
DGEC

Offline Offline

Posts: 386


WWW
« Reply #57 on: December 21, 2007, 09:27:55 PM »

The code higlighting is nice!

If you already have 1.4a installed however, you'll need to unsinstall it first, there is no upgrade php and you can't just overwrite it.  You'll get "already installed" error message.

You know, error messages really shouldn't disappear so fast.  The 2 seconds or whatever that used to be there for messages was annoying, but disappearing error messages are not good either. A longer wait, or even better, a status message area on the page would be a better solution.
Logged
doc
Guest
« Reply #58 on: December 22, 2007, 08:28:05 AM »

Hello,

nothing changed to the code. The same error message is shown with almost all Admin tools. So deinstall it first (there are no datbase entries) and then install the new version.

If you want, add a upgrade script and post the new version here in the forum.

Regards Christian
Logged
sstvmaster1

Offline Offline

Posts: 7


« Reply #59 on: January 07, 2008, 12:06:14 AM »

Hello at All an a happy new Year,

In Opera 9.50 Beta Build 9716 on Win Xp Pro, the textarea is gray and i can't edit.
In Firefox i can edit. I don't know where the error is.

So jetzt mal in Deutsch. Also wie schongesagt in opera habe ich nur ein ausgegrautes textarea im read-only modus. Den Opera 9.25 habe ich nicht installiert.

Hier Fehler aus der Javascriptkonsole:
Here is the Errorkonsole message output from opera:
Code:
JavaScript - http://www.my-domain.de/include/codepress/codepress.html?engine=opera&language=php&ts=1199666727265
Inline script thread
Error:
name: ReferenceError
message: Statement on line 5: Undefined variable: Language
Backtrace:
  Line 5 of linked script http://www.my-domain.de/include/codepress/languages/php.js?ts=1199666727359
    Language.syntax = [ // PHP
stacktrace:   ...
JavaScript - http://www.my-domain.de/modules/templateedit/tool_edit.php
Event thread: load
Error:
name: TypeError
message: Statement on line 27: Cannot convert undefined or null to Object
Backtrace:
  Line 27 of linked script http://www.my-domain.de/include/codepress/codepress.js
            self.editor.body = self.contentWindow.document.getElementsByTagName('body')[0];
  ...
stacktrace:   ...
JavaScript - http://www.my-domain.de/include/codepress/codepress.html?engine=opera&language=css&ts=1199666747906
Inline script thread
Error:
name: ReferenceError
message: Statement on line 5: Undefined variable: Language
Backtrace:
  Line 5 of linked script http://www.my-domain.de/include/codepress/languages/css.js?ts=1199666748000
    Language.syntax = [ // CSS
stacktrace:   ...
JavaScript - http://www.my-domain.de/modules/templateedit/tool_edit.php
Event thread: load
Error:
name: TypeError
message: Statement on line 27: Cannot convert undefined or null to Object
Backtrace:
  Line 27 of linked script http://www.my-domain.de/include/codepress/codepress.js
            self.editor.body = self.contentWindow.document.getElementsByTagName('body')[0];
  ...
stacktrace:   ...
JavaScript - http://www.my-domain.de/include/codepress/codepress.html?engine=opera&language=css&ts=1199666950125
Inline script thread
Error:
name: ReferenceError
message: Statement on line 5: Undefined variable: Language
Backtrace:
  Line 5 of linked script http://www.my-domain.de/include/codepress/languages/css.js?ts=1199666950187
    Language.syntax = [ // CSS
stacktrace:   ...
JavaScript - http://www.my-domain.de/modules/templateedit/tool_edit.php
Event thread: load
Error:
name: TypeError
message: Statement on line 27: Cannot convert undefined or null to Object
Backtrace:
  Line 27 of linked script http://www.my-domain.de/include/codepress/codepress.js
            self.editor.body = self.contentWindow.document.getElementsByTagName('body')[0];
  ...
stacktrace:   ...
JavaScript - http://www.my-domain.de/include/codepress/codepress.html?engine=opera&language=css&ts=1199667262375
Inline script thread
Error:
name: ReferenceError
message: Statement on line 5: Undefined variable: Language
Backtrace:
  Line 5 of linked script http://www.my-domain.de/include/codepress/languages/css.js?ts=1199667262437
    Language.syntax = [ // CSS
stacktrace:   ...
JavaScript - http://www.my-domain.de/modules/templateedit/tool_edit.php
Event thread: load
Error:
name: TypeError
message: Statement on line 27: Cannot convert undefined or null to Object
Backtrace:
  Line 27 of linked script http://www.my-domain.de/include/codepress/codepress.js
            self.editor.body = self.contentWindow.document.getElementsByTagName('body')[0];
  ...
stacktrace:   ...


thanks, danke.

mfg

Maik
Logged
doc
Guest
« Reply #60 on: January 07, 2008, 01:45:43 PM »

Hello,

could reproduce the error. Seems there is a small bug in the Javascript framework Codepress. Tested it with the latest release of Codepress and the error is gone.

Do the following to get rid of the bug with Opera (seems to work with IE and FF)
a) delete all files and subfolder contained in /includes/codepress/ of your WB installation (via FTP)
b) download latest codepress version (v0.9.6)
c) unzip the file locally on your computer
d) upload local files contained in /codepress to your WB installation /includes/codepress (via FTP)

Then try again. It should work now.

Regards Christian

P.S.: We will add the latest version of Codepress to WB core with the next WB version
« Last Edit: January 07, 2008, 01:48:56 PM by doc » Logged
sstvmaster1

Offline Offline

Posts: 7


« Reply #61 on: January 08, 2008, 10:32:02 PM »

Hello Christian

now it works in Opera 9.25 and 9.50 Beta, Windows and Linux (Kubuntu).

thank you

greets Maik

Logged
bupaje

Offline Offline

Posts: 519


WWW
« Reply #62 on: April 23, 2008, 03:35:03 AM »

I haven't been around in a while and just updated this module. It really is much friendlier and useful with the color coding and other improvements. Thank you for your work on this.
Logged

My Blog, My Site
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1680



« Reply #63 on: November 11, 2008, 08:09:53 PM »

this module is great, but why every time i log in it slows down my browser Huh does any one has same problem ? I use IE 7 ?
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
doc
Guest
« Reply #64 on: February 22, 2009, 12:45:12 PM »

Hello,

template edit is no longer developed but you can check out the Addon File Editor instead.

Addon File Editor can be downloaded from the WB Add-ons repository. This editor uses EditArea for Syntax highlighting which is somewhat faster than Codepress and allows much more possibilities than the old template edit.

Regards Christian
Logged
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1680



« Reply #65 on: February 23, 2009, 08:59:38 AM »

But it can edit only filer in addon folder Huh or any file in server ?
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
doc
Guest
« Reply #66 on: February 23, 2009, 09:46:27 AM »

Hi,

the module name: "Addon File Editor" already tells you what files you can modify (WB Add-ons files like: WB language files, Template files or Add-ons files). Please read through the Addon File Editor thread (Englisch) there you find some other modules which allow to edit all files on the server.

Christian
Logged
ivanisevic82

Offline Offline

Posts: 92


« Reply #67 on: August 27, 2009, 10:48:01 AM »

According to me template edit was absolutly better than Addon File Editor to edit the templates.

Where is possible to download the last version, even if it is no me developed I prefer it!

Thank you!
Logged
erpe

Offline Offline

Posts: 2077


WWW
« Reply #68 on: August 27, 2009, 11:41:13 AM »

http://www.websitebakers.com/pages/admin/admin-tools/template-edit-toggle.php

rgds

erpe

PS: I wrote you a pm and didn't got a reply  huh
Logged

bupaje

Offline Offline

Posts: 519


WWW
« Reply #69 on: August 28, 2009, 07:26:39 PM »

Great mod - thanks!

Minor issue



guess need to fix the css or use a small icon instead.
Logged

My Blog, My Site
Pages: 1 2 [3]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!