Archive

Posts Tagged ‘plugin’

Watch a site being developed – the webveteran.com experiment

June 29th, 2009

I had this crazy idea, and  I think I’m going to try it! I started to build a new website for myself… long overdo from almost three years ago. And I figured, ‘why not do so publicly?’ Sure it’s like dropping my drawers, but I’m confident although I know I am not the absolute best. But I think it would be interesting… at least, I think it would be to watch someone else do so.

The completed site will be/have:

  • web2.0 layout and functionality
  • coldFusion, ajax, scriptaculous, javascript sound
  • custom cms with plugin architecture (I might open this up as well)
  • seo + sef urls
  • one page load navigation (ajax)

So without further wait, please visit 2009.webveteran.com to take part in the experiment. Comment and criticisms are welcome and appreciated.

Keep in mind, this is a site entirely in development! What you will see occasionally:

  • broken links
  • broken content
  • dummy text
  • images as test text

Heck, you might even see a table or two (gasp). You’ll probably also see me change libraries every now and then (as was the case with the scroller). And of course there may be days without any progress whatsoever. Subscribe to this blog or my twitter account to keep updated!

[sigh] here we go…

News, The Experiment , , , , , , , , , ,

Visual Code Editor 1.2.1: adds iframe, supports php4

January 16th, 2009

Visual Code Editor 1.2 allows iFrames in WordPress’s visual editor (TinyMCE). Example

And 1.2.1 has a code fix for WordPress installations on PHP4. Thanks to Keith for tipping me off!

PHP, TinyMCE, Visual Code Editor , , ,

Coda Plugin – v090108

January 8th, 2009

I started to play around with Coda’s Plugin builder. Instantly I came up with two plugins. Already they save me a lot of time. Especially when dealing with material submitted via DOC or XLS.

Link

This will take the selected text and return it as an A tag. For example,

http://www.linktohere.com

will be changed to

<a href="http://www.linktohere.com">http://www.linktohere.com</a>

MailTo

This is very similar to Link above, but makes a mail tag.

example@test.com

becomes

<a href="mailto:example@test.com">example@test.com</a>

Coda Plugin

WebVeteran’s Coda Plugin:
WVCPs.codaplugin.zip

Nothing too fancy. Only a step higher than using the Clips window. But they may save you time as well. Just download the zip, extract it, double-click, enjoy.

Coda , , , , ,

Visual Code Editor v1.0

November 18th, 2008

Visual Code Editor modifies WordPress’s behavior so that code format is preserved when using the visual editor. It will work with any syntax highlighter that accepts encoded (or escaped) syntax.

Download the plugin: http://wordpress.org/extend/plugins/visual-code-editor/

WordPress is really nice. But it mangles syntax in posts. I set out to end that with a non source-code-editing method: a plugin!

The problem in WordPress comes in when you edit your post twice. When you load that post again, WP converts ampersands into “&”. Which is nice. But if you edit that post again, WP re encodes ampersands again. Giving you “&”. Want to guess what happens if you save and load it again? :)

Now lets compound that with the visual editor, which automatically encodes for you as you type or paste. That only accelerates the process. And the fault here is with WP when it loads the post. Not with TinyMCE, at all.
Lets make matters even worse. WP’s default settings for TinyMCE is really screwy. It’s horrible for programmers who want to blog.

  • Users have to switch to HTML or TEXT views to insert <pre> or <code> tags.
  • TinyMCE does not allow unknown attributes for tags like <pre line=”1″>.

That may sound really picky. But most syntax highlight plugins require either <pre> or <code> and to use special attributes in them to display properly. Some require the syntax to have all entities escaped, some require the opposite. What a freaking nightmare. So I set out to end this nonsense.

Enter Visual Code Editor. It’s a plugin I wrote for WordPress. Visual Code Editor makes it possible (and trouble free) to post and edit code snippets in wordpress’s visual editor.

  • Adds <pre> & <code> to block format menu
  • Allows extra attributes for compatibility in some syntax highlighters (ie, <pre lang=”php” line=’5′>)
  • Unescape WP’s double escaping of &
  • v1.1: Removes extra <pre> tags around SyntaxHighlighter Plus’s sourcecode blocks
  • v1.1.1: Tested with WordPress 2.7

And the nicest thing is… it’s a plugin! You don’t have to go around editing WP’s base installation. Download, extract, upload, activate, done.

Coupled with the SyntaxHighlighter Plus plugin, you get results like this:

syntax highlight

Syntax highlighter Plus runs through javascript on the client and expects the code to have entities encoded. Thanks to my plugin and TinyMCE, we’re golden. I chose Syntax highlighter Plus for a few reasons.

  • it’s the easiest to use and is smart.
  • It runs in javascript, search engines do not see tons of inline css muddying the page.
  • The page also downloads faster because of that.
  • The ‘copy to clipboard’ does not require flash.

All you have to do is create a [/sourcecode] block, select the sourcecode block, select Preformatted from Tiny’s format menu, then paste in your code. It should look like this:

syntax highlight   

The Preformatted area tells TinyMCE to leave the formatting the heck alone. makes Syntax highlighter Plus do it’s magic on the viewer side. And you can still edit all of your code in the visual editor. Awesome!I also left the door open for other syntax highlighters, which instead of using , use <pre lang=”xxx” [line="5"]> or even <code>, etc.   

Feel free to download the plugin, which is now in the WordPress PlugIn Directory! Yippee I learnt how ta use SVN today! http://wordpress.org/extend/plugins/visual-code-editor/

Plugins that failed to help

I did my homework before writing this plugin. I tried all of the following. All of which failed in one way or another.

  • Chili Code Highlighter
  • CodeHighlighter
  • Developer Formatter
  • Disable wpautop
  • Editor Extender
  • EmbedIt
  • Google Syntax Highlighter for WordPress
  • Preserve Code Formatting
  • Raw HTML capability
  • Text Control
  • TinyMCE Entities Patch
  • Code Snippet
  • Dean’s Code Highlighter
  • Highlight Source Pro
  • iG:Syntax Hiliter
  • Sniplets
  • Snippet Highlight
  • WP-CodeBox
  • WP-Syntax

Visual Code Editor , , ,