<style></style> since 2000
Well I know everyone was on the edge of their seats, however, all can relax: the bug has been fixed.
All I did was create a way to manage what ‘view state’ I was in, rather then doing a if/then of the current class name. My only made-up explanation I can come up with for why this works is that on page load, jQuery builds a giant array of your page elements and properties. When I start swapping class names around, that array isn’t being updated. Therefor, I just needed to come up with a method for tracking the state and query that rather then the current class name. Now all is well.
See it in action, or, you can download the .NET project and see it in action. I don’t care for .NET, but it’s what I had at the time—that and I don’t know php (yet).
With a little down time at work, I started to make a few jQuery example pages for some quick documentation. One thing led to another, and I’ve decided to build a light version of the Google Reader interface. Check it out.
I wrote a detailed, albeit probably jumbled, post to on jQuery’s Google Group about my bug. Here’s a quick recap: I have two functions that depend on a wrapper div’s class. When I first load the page, I set that wrapper’s class based on a cookie. From then on, my two functions don’t function based on what the wrapper div currently is, but what it was at page load. Somehow it’s not seeing the current wrapper class. Do you know why? Two gold stars to anyone who solves it!
I started building this interface just to see what I could do with jQuery. Once I get all the bugs worked out, I'd be nice to hook it up to a RSS feed and see it actually function. Perhaps a good excuse to start learning PHP, and maybe even Code Igniter.
Instiki is a light wiki built on Ruby On Rails, however I'm not sure if it is still be maintained. I use it to maintain a lot of ideas and examples, mostly code heavy content. One thing that could make Instiki better would be syntax highlighting -- so lets implement it.
/instiki/app/views/layouts/default.rhtml and start implementing.
I'm not entirely sure how/where all the javascript is being rolled into the main template page of Instiki, so instead of tracking that down we can just put some good ol' fashioned <style></style> links.
Right after <%= javascript_include_tag :defaults %> put:
<link type="text/css" rel="stylesheet" href="/stylesheets/highlighter/SyntaxHighlighter.css"></link> <script type="text/javascript" src="/javascripts/highlighter/shCore.js"></script> <script type="text/javascript" src="/javascripts/highlighter/shBrushCss.js"></script> <script type="text/javascript" src="/javascripts/highlighter/shBrushJScript.js"></script> <script type="text/javascript" src="/javascripts/highlighter/shBrushXml.js"></script> <script type="text/javascript" src="/javascripts/highlighter/shBrushVb.js"></script>Now I only added the few language files that I needed -- You, of course, should link to whichever ones you need. At the bottom of
default.rhtml, right above </body> put:
<script language="javascript">
dp.SyntaxHighlighter.ClipboardSwf = '/flash/highlighter/clipboard.swf';
dp.SyntaxHighlighter.HighlightAll('code');
</script>
<pre> tag, set name attribute to code and class attribute to the language of your choosing.
<pre name="code" class="js"> ... some code here ... </pre>For the full run down of it's usage and options, check out the project page.
| Language | Class Name(s) |
|---|---|
| C++ | cpp, c, c++ |
| C# | c#, c-sharp, csharp |
| CSS | css |
| Delphi | delphi, pascal |
| Java | java |
| Java Script | js, jscript, javascript |
| PHP | php |
| Python | py, python |
| Ruby | rb, ruby, rails, ror |
| Sql | sql |
| VB | vb, vb.net |
| XML/HTML | xml, html, xhtml, xslt |
name attribute on a <pre> tag is not valid XHTML.
oh mr coffee. why are you so yummy
you make me so happy mr coffee
so happy in my tummy
(by the way, Hello World)
Howdy. I'm Richard W. Baker - a designer based in Jacksonville, Florida with a passion for information architecture and usable interfaces. At my day job, I work for the City of Jacksonville as a User Interface Designer.
If you still have questions, or you're interested in hiring me for your next project, .
coming soon
coming soon