DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:jquery-syntax

jQuery.Syntax plugin

Compatible with DokuWiki

  • 2013-12-08 "Binky" unknown
  • 2013-05-10 "Weatherwax" unknown
  • 2012-10-13 "Adora Belle" unknown
  • 2012-01-25 "Angua" yes

plugin Extreme client-side syntax highlighting.

Last updated on
2012-06-01
Provides
Syntax, Action
Repository
Source
Conflicts with
code, code2, code3

Download and Installation

Download and install the plugin using the Plugin Manager using the URL given above. 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 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

  1. Edit a page
  2. Click the picture icon to insert an image
  3. 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.saharas.sahara

Makuhari, Chiba, Japan
2013-09-22

plugin/jquery-syntax.txt · Last modified: 2013/09/22 16:58 by 2409:11:8000:0:7d6a:c322:6486:7e95