I have found the fix to the bold/italic/underline key listener problem

(yeah, it was bugging me that much)
In the file
https://forum.ih8mud.com/clientscript/vbulletin_textedit.js there is a function prototype which is used to catch the keypresses on the editor window:
Code:
vB_Text_Editor_Events.prototype.editdoc_onkeypress=function(C){
if(!C){
C=window.event
}
if(C.ctrlKey){
[b][color=red]if(vB_Editor[this.editorid].allowbasicbbcode==false){[/color][/b]
return
}
var A=C.charCode?C.charCode:C.keyCode;
var B;
switch(String.fromCharCode(A).toLowerCase()){
case"b":B="bold";
break;
case"i":B="italic";
break;
case"u":B="underline";
break;
default:return
}
C=do_an_e(C);
vB_Editor[this.editorid].apply_format(B,false,null);
return false
}
else{
if(C.keyCode==9){
var D=fetch_object("rb_iconid_0");
if(D!=null){
D.focus()
}
else{
if(fetch_object(this.editorid+"_save")!=null&&!is_opera){
fetch_object(this.editorid+"_save").focus()
}
else{
if(fetch_object("qr_submit")!=null&&!is_opera){
fetch_object("qr_submit").focus()
}
else{
return
}
}
}
C=do_an_e(C)
}
}
};
(Offending line highlighted red)
The
allowbasicbbcode variable is new to vB 3.7.0 and is set in the following function:
Code:
this.init_command_button=function(obj){
obj.cmd=obj.id.substr(obj.id.indexOf("_cmd_")+5);
obj.editorid=this.editorid;
this.buttons[obj.cmd]=obj;
if(obj.cmd=="switchmode"){
if(AJAX_Compatible){
obj.state=this.wysiwyg_mode?true:false;
this.set_control_style(obj,"button",this.wysiwyg_mode?"selected":"normal")
}
else{
obj.parentNode.removeChild(obj)
}
}
else{
obj.state=false;
obj.mode="normal";
[b][color=red]if(obj.cmd=="bold"||obj.cmd=="italic"||obj.cmd=="underline"){
this.allowbasicbbcode=true
}[/color][/b]
}
obj.onclick=obj.onmousedown=obj.onmouseover=obj.onmouseout=vB_Text_Editor_Events.prototype.command_button_onmouseevent
};
The problem is that init_command_button() is called
only when the B/I/U buttons (the ones you click in the advanced editor) are actually present, which they aren't on the quick reply box on regular pages (obviously). This means that allowbasicbbcode never gets set to true (even though mud
always allows basic BB code) so the browser never inserts the event listener.
The
fix is to add a check to the conditional statement in the eventlistener prototype editdoc_onkeypress(). Essentially you need to add a check to ensure that the 'editorid' doesn't match that of the quickreply editor (the advanced editor's ID is always vB_Editor_001 and the quickreply's is always vB_Editor_QR)
SO, (phew) the fix is to change the line
Code:
[color=red]if(vB_Editor[this.editorid].allowbasicbbcode==false){[/color]
to
Code:
[color=red]if(vB_Editor[this.editorid].allowbasicbbcode==false[/color][color=lime] && (this.editorid != 'vB_Editor_QR' || this.editorid != 'vB_Editor_QE_1_editor')[/color][color=red]){[/color]
in the file
https://forum.ih8mud.com/clientscript/vbulletin_textedit.js
Viola, your quick edit control key listener will work again.
Woody, if you are not comfortable with making this change on the server (IE you'd rather wait until vB pushes the next RC) I can write a realllllly simple greasemonkey script that firefox users can install which will fix this problem.
-----Nate