Table of Contents
jQuery.Syntax Plugin
Compatible with DokuWiki
Lemming, Anteater, Rincewind, Angua
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
Similar to code, code2, code3, codeprettify, highlightjs, syntaxhighlighter
Download and Installation
Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.
Syntax and Usage
jQuery.Syntax is an extremely fast and lightweight syntax highlighter. It has dynamic loading of syntax source files and integrates cleanly using CSS or modelines.
Please see the main project page (via web.archive.org) for examples, compatibility, and free cake!
Transparently replaces <code>
and <file>
tags, as per most other code
style plugins.
<code php-script> php script goes here </code>
Discussion
Online Interpreter
if you replace
toolbar.append('<a href="http://www.oriontransfer.co.nz/software/jquery-syntax"
with
toolbar.append('<a href="http://codepad.org" target="oriontransfer">!</a>');toolbar.append('<a href="http://www.oriontransfer.co.nz/software/jquery-syntax" target="oriontransfer">?</a>')
you can provide a link to an online-Interpreter
Fixing the Media Manager / Image Insertion
As at 2012-07-26, the latest version (2012-06-01) of jquery syntax highlighting plugin messes with the jQuery that comes with DokuWiki 2012-01-25 “Angua”, and this prevents image insertion via the Media Manager to work. Since I couldn't find an issue tracker associated with this plugin, I'll stick the bug report and its fix here.
Steps to Reproduce
- Edit a page
- Click the picture icon to insert an image
- Click on an image in the window which opens
Observed: Nothing visible to use happens, error appears in console
Expected: Popup dialog appears which allows user to set link target, alignment and size of image
Analysis: Looks like jQuery from DokuWiki gets clobbered by the jQuery which jquery-syntax adds. The variable $updateVersion is not passed to the popup Media Manager window.
Fix: Prevent jquery-syntax in the Media Manager window from loading its own version of jQuery: in dokuwiki/lib/plugins/jquerysyntax/action.php
, add
if (empty($updateVersion)) return false;
before
if ($updateVersion < 36.0) { $event->data['script'][] = array( 'type' => 'text/javascript', 'charset' => 'utf-8', '_data' => '', 'src' => $plugin_root.'/jquery-1.6.min.js' ); $noConflict = "jQuery.noConflict();"; }
After doing this, the image insertion works as expected and syntax highlighting still works. Tested using DokuWiki 2013-05-10a “Weatherwax”.
— Caspar Krieger, updated by s.sahara 2013-09-22