Hi,
I have installed the latex editor for my vBulletin forum, so that mathematical expressions within [TEX] BBCodes can be converted automatically to a respectable image. For the integration into vB, I used the addon vLatex, which is actually only compatible till vB 4.0.4. There was no CKEditor in vB 4.0.4 at all. I run my forum with version 4.1.10, which includes the CKEditor - nonetheless, the addon works except for one small thing.
When writing a post, there is a small but very handy Quick Menu.
It should speed up and simplify the use of latex. By clicking on an icon, the appropriate BBCode should then be inserted in the editor. That just does´nt happen. If you click on an icon, simply nothing happens. As I understand it, this menu is controlled via a JavaScript, which is presented as follows. I hope someone can help me there because I don´t have any Java knowledge. I´ve also posted on several vB-Support Forums without any success.
Firebug states two errors:
Greetings from Germany
Koch
I have installed the latex editor for my vBulletin forum, so that mathematical expressions within [TEX] BBCodes can be converted automatically to a respectable image. For the integration into vB, I used the addon vLatex, which is actually only compatible till vB 4.0.4. There was no CKEditor in vB 4.0.4 at all. I run my forum with version 4.1.10, which includes the CKEditor - nonetheless, the addon works except for one small thing.
When writing a post, there is a small but very handy Quick Menu.
It should speed up and simplify the use of latex. By clicking on an icon, the appropriate BBCode should then be inserted in the editor. That just does´nt happen. If you click on an icon, simply nothing happens. As I understand it, this menu is controlled via a JavaScript, which is presented as follows. I hope someone can help me there because I don´t have any Java knowledge. I´ve also posted on several vB-Support Forums without any success.
Firebug states two errors:
- insert_text is not a function
- get_selection is not a function
window.status = 'actualizado'; vB_Text_Editor.prototype.pod_vlatex_insertcommand = function (code) { if (this.wysiwyg_mode) { while (code.indexOf('{br}') != -1) code = code.replace('{br}', '<br />'); } else { while (code.indexOf('{br}') != -1) code = code.replace('{br}', "\n"); } var anchorpos = code.indexOf('#'); if (anchorpos == -1) { this.insert_text(code+' ', code.length+1); } else { var seltext = this.get_selection(); if ((seltext === false) || (seltext.length == 0)) { seltext = ""; } else { seltext = new String(seltext); } var precode = code.substring(0, anchorpos); var poscode = code.substring(anchorpos+1); this.insert_text(precode + seltext + poscode+' ', precode.length, poscode.length+1); } } vB_Text_Editor.prototype.pod_vlatex_init = function() { this.vlatex_commandmenu = document.getElementById('vlatex_commandmenu'); if (is_ie) { var buttonTagName = 'img'; } else { var buttonTagName = 'li'; } var buttons = this.vlatex_commandmenu.getElementsByTagName(buttonTagName); for (var i=0; i < buttons.length; i++) { buttons[i].editorid = this.editorid; buttons[i].onclick = function () { vB_Editor[this.editorid].check_focus(); }; buttons[i].onmousedown = function () { if (is_ie) { vB_Editor[this.editorid].pod_vlatex_insertcommand(this.alt); } else { vB_Editor[this.editorid].pod_vlatex_insertcommand(this.title); } }; } }
Greetings from Germany
Koch
Re: Problems with Javascript for Editor
insertText()
Not sure if there are underscores.