Here is a window:
This plugin writed as adition to CodeColorer plugin, but it can be easily adopted to other syntax plugins.
It’s odd but not one syntax plugin haven’t TinyMCE plugin.
Futures:
- work only with TinyMCE 3.х or later
- maybe work only with WP 2.7 or later
Tuneup to other plugins, just edit tinymce.js, where you just fix a format of inserted code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | function insertCCTBcode() { var tagtext; var langname_ddb = document.getElementById('cctb_lang'); var langname = langname_ddb.value; var linenumbers = document.getElementById('cctb_linenumbers').checked; var inst = tinyMCE.getInstanceById('content'); var html = inst.selection.getContent(); if (linenumbers) //edit code here tagtext = "[cc lang='" + langname + "' "; else tagtext = "[cc lang='" + langname + "' line_numbers='false'"; //don't forget to change ({ } change to [ ] becouse they broke view) window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, tagtext+']'+html+'{/cc}'); tinyMCEPopup.editor.execCommand('mceRepaint'); tinyMCEPopup.close(); return; } |
codecolorer-tinymce-buttom download and try it (version 0.1)
Got somsing to say? Say it here!
Pages: 1 2











Submitting Comment, Give me a second...
@Aahan
yes it’s possible. contact me in GTalk, nickname — homolibere (@gmail.com)