Добро пожаловать на мой блог

Собственно о чем речь?

Это блог! В котором я веду свои заметки и копи-пасты с других сайтов. В основном это не что иное как дневник. Приятного чтения.

Как сделать себе такую панель?

Это можно выяснить перейдя по ссылке »

Вход в блог

Забыли/потеряли пароль?

Регистрация закрыта

Мне жаль, но регистрация на этом блоге закрыта!

Для того, чтоб получить регистрацию свяжитесь с владельцем блога nick {at} homolibere {dot} info.

Note: If you are the admin and want to display the register form here, log in to your dashboard, and go to Settings > General and click "Anyone can register".

CodeColorer TinyMCE Button

Кнопка, которая появляется на панели TinyMCE

A new button on TinyMCE panel

Here is a window:

Форма, отображающаяся по нажатию на кнопку

Form that displaying after button pressed

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

марта 31, 2009 Add a comment
Home > IMadeThis, Webware > CodeColorer TinyMCE Button
Comments (10) Trackback Leave a comment
  1. Июль 22nd, 2011 at 16:50 | #1

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

  2. Aahan
    Июль 22nd, 2011 at 15:26 | #2

    Thank you. If possible can we have a chat on GTalk please? (not skype, if possible)

  3. Июль 22nd, 2011 at 10:11 | #3

    @Aahan
    nope, just tested… it’s broken for now. i’ll fix it today and inform you later about my progress.

    tnx for interesting my plugin)))

  4. Aahan
    Июль 21st, 2011 at 21:38 | #4

    Is your plugin still working? I mean on wordpress 3.2.1 and with CodeColorer 0.9.9?? Please update me on this.

  5. Май 21st, 2009 at 16:34 | #5

    Hello!

    I couldn’t find a contact link; I hope it’s okay I reach you this way.

    I would like to include parts of this plugin in a patch for syntaxhighlighter-plus. Would you grant me permission for that?

    Thank you for your excellent work. :-)

    Ciao!

    • Май 21st, 2009 at 16:38 | #6

      Yes, of course. Feel free to use this cod under GPL License as everything on official WP-Plugins page ;-)

  6. Апрель 8th, 2009 at 23:05 | #7

    еще раз обновил статью и добавил английскую версию

  7. Апрель 4th, 2009 at 13:44 | #8

    Обновил статью и переместил ссылку на официальный сайт расширений для ВП

  8. Апрель 1st, 2009 at 17:45 | #9

    Если прочитать внимательно комментарии автора плагина, то можно заметить, что код, вставленый через визуальный редактор, ломается. И это правда :)

    • Апрель 1st, 2009 at 22:08 | #10

      С первым апреля! На самом деле раньше код действительно ломался, но я уже поправил код еще до выкладывания, однако поправить пост запамятовал… мот скоро поправлю. Сейчас код не ломается.

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackbacks (0 ) Detail Trackback