Topics

User Functions

Events

There are no upcoming events

What's New

Stories

No new stories

Comments last 2 weeks

No new comments

Trackbacks last 2 weeks

No new trackback comments

Links last 2 weeks

No recent new links

NEW FILES last 14 days

No new files

Welcome to Geeklog Monday, May 20 2013 @ 03:29 PM EDT


 Forum Index > Support > General Geeklog Support New Topic Post Reply
 jquery syntax highlightiing css brush
   
dwl
 05/03/12 12:20PM (Read 2122 times)  
++---
Junior

Status: offline


Registered: 01/05/11
Posts: 25
I've followed the documentation and steps for implementing the jQuery plugin but can not implement the brush for css. I can successfully implement classes for php and js syntax.

According to the documentation I should be able to activate it with
PHP Formatted Code
<code class="css">


On the alex gorbatchev site there is mention of requisite file names for different syntax highlighters but I can not find their location using sh*.js as a filefind parameter.

 
Profile Email
 Quote
dwl
 05/05/12 12:36PM  
++---
Junior

Status: offline


Registered: 01/05/11
Posts: 25
Nudge.

Does anyone have an answer? If not, I guess I'll have to change blog packages

 
Profile Email
 Quote
::Ben
 05/05/12 07:07PM  
+++++
Full Member

Status: offline


Registered: 01/14/05
Posts: 1359
Hi,

Load the css brush by editing plugins/jquery/functions.php file

PHP Formatted Code
// Code highlighter
    if($_JQ_CONF['use_codehighlighter'] == true){
        $strext = '/jquery/codehighlighter/jquery.beautyOfCode.js';
                $_SCRIPTS->setJavaScriptFile('jquery_beautyofcode', $strext);
                $str1 = '    jQuery(document).ready(function() {' . LB;
                $str1 .= '   jQuery.beautyOfCode.init({' . LB;
                $str1 .= '       brushes: ['Xml', 'JScript', 'Css', 'Plain', 'Php'],' . LB;
                $str1 .= '          ready: function() {' . LB;
                $str1 .= '           jQuery.beautyOfCode.beautifyAll();' . LB;
                $str1 .= '       }' . LB;
                $str1 .= '   });' . LB;
                $str1 .= '   });' . LB;
                $_SCRIPTS->setJavaScript($str1, true);
        }


Then use this syntax

PHP Formatted Code

<pre><code class="css">

/* SEMANTICS ******************************************************************/

a {
  background:transparent;
}

</code></pre>
 


Ben

We speak french on http://geeklog.fr
 
Profile Email Website
 Quote
dwl
 05/06/12 02:38PM  
++---
Junior

Status: offline


Registered: 01/05/11
Posts: 25
Thanks for the effort Ben but it still will not work. I am no longer receiving the error of the brush as unavailable but the styling is not working. The syntax is still coming out as black and white even though I am using:

HTML4STRICT Formatted Code

<pre><code class="css">

/* SEMANTICS ******************************************************************/

a {
  background:transparent;
}

</code></pre>
 


I did a line by line comparison of your block of code and the one already in plugins/jquery/functions.inc (there is no plugins/jquery/functions.php). There were discrepancies. The error I was receiving for css brush not being available is because it was not defined as the syntax below indicates:

PHP Formatted Code

//from existing code in function
$str1 .= '        brushes: [\'Xml\', \'JScript\', \'CSharp\', \'Plain\', \'Php\'],' . LB;
 


Unfortunately, with your code none of the brush values was escaped.

PHP Formatted Code

//from Ben's solution for function
$str1 .= '       brushes: ['Xml', 'JScript', 'Css', 'Plain', 'Php'],' . LB;
 


If it was intended, then I don't know what the solution is. Loading your code as written, my site would not load. All I had was a blank browser. Doing some debugging of tailing the PHP error log Escaping them or writing the code as
PHP Formatted Code

$str1 .= "        brushes: ['Xml', 'JScript', 'css', 'Plain', 'Php']," . LB;
 

did not work either. The site would load but the css syntax in the article I am writing has no highlighting.

 
Profile Email
 Quote
::Ben
 05/06/12 04:03PM  
+++++
Full Member

Status: offline


Registered: 01/14/05
Posts: 1359
Hi,

Sorry the file name is functions.inc where I replaced the CSharp by the Css brush but I don't know why none of the brush values was escaped because I pasted the code from the plugin file where they are escape Question

I confirm color hightlighting is working on my testing platform.



Ben

We speak french on http://geeklog.fr
 
Profile Email Website
 Quote
dwl
 05/06/12 06:05PM  
++---
Junior

Status: offline


Registered: 01/05/11
Posts: 25
Hi,

As I noticed when writing My post, if you quote code here, you need to double escape with 2 slashes.

As for the "Csharp" vs "css", are you saying "Csharp" is in the code by default as coded by you as plug-in author? The instance of "Csharp" in my quoted post's syntax is from the plug-in as installed from the site, not the block of code you sent to me.

The question now is, why is your version of the plug-in working and mine is not, at least for css syntax?


Quote by: ::Ben

Hi,

Sorry the file name is functions.inc where I replaced the CSharp by the Css brush but I don't know why none of the brush values was escaped because I pasted the code from the plugin file where they are escape Question

I confirm color hightlighting is working on my testing platform.



Ben


 
Profile Email
 Quote
dwl
 05/07/12 12:44AM  
++---
Junior

Status: offline


Registered: 01/05/11
Posts: 25
Well this is now solved.
  • I removed the plug-in in the back-end
  • deleted the files and directories manually
  • re-installed
  • changed 'Csharp' in the brushes to 'Css' in line 112 of plugins/jquery/functions.inc
  • low and behold it worked

 
Profile Email
 Quote
::Ben
 05/07/12 03:14AM  
+++++
Full Member

Status: offline


Registered: 01/14/05
Posts: 1359
Good news. I also added a report to the forum tracker.

Ben

We speak french on http://geeklog.fr
 
Profile Email Website
 Quote
Content generated in: 1.47 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to post 
Filtered HTML Allowed 
Censored Content