====== jQuery.Syntax Plugin ====== ---- plugin ---- description: Extreme client-side syntax highlighting author : Samuel Williams email : samuel@oriontransfer.org type : syntax, action lastupdate : 2012-06-01 compatible : Lemming, Anteater, Rincewind, Angua depends : conflicts : code, code2, code3 similar : code, code2, code3, highlightjs, syntaxhighlighter tags : code, syntax, syntaxhighlight, client-side downloadurl: https://trello.com/1/cards/5b06b36d52c372005384d296/attachments/5b06b4d31a2c79a2bb503980/download/jquery-syntax-dokuwiki.zip bugtracker : https://github.com/ioquatix/jquery-syntax/issues sourcerepo : https://github.com/ioquatix/jquery-syntax-dokuwiki/tree/master/jquerysyntax donationurl: http://pledgie.com/campaigns/8915 screenshot_img: ---- ===== Download and Installation ===== Search and install the plugin using the [[plugin:extension|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 [[https://web.archive.org/web/20130917025759/http://www.codeotaku.com/projects/jquery-syntax/index.en|main project page]] //(via web.archive.org)// for examples, compatibility, and free cake! Transparently replaces '''' and '''' tags, as per most other ''code'' style plugins. php script goes here ===== Discussion ===== ==== Online Interpreter ==== if you replace toolbar.append(' with toolbar.append('!');toolbar.append('?') 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". --- [[http://www.casparkrieger.com|Caspar Krieger]], updated by [[user>s.sahara|s.sahara]] //2013-09-22//