Is there some public domain/BSD-style origin for vbulletin_textedit.js? Did vBulletin license it out to IPB?
Run ips_text_editor.js through Javascript Tidy (I used Opera since apparently Firefox does it wrong) to get all the linebreaks back, then compare it to vbulletin_textedit.js.
There is a lot of very similar code, but for one succinct example search for "hex" within both files.
vbulletin_textedit.js:
ips_text_editor.js:
Run ips_text_editor.js through Javascript Tidy (I used Opera since apparently Firefox does it wrong) to get all the linebreaks back, then compare it to vbulletin_textedit.js.
There is a lot of very similar code, but for one succinct example search for "hex" within both files.
vbulletin_textedit.js:
Code:
this.build_forecolor_popup = function(obj, menu) { var colorout = fetch_object(this.editorid + '_color_out'); colorout.editorid = this.editorid; colorout.onclick = vB_Text_Editor_Events.prototype.colorout_onclick; var table = document.createElement('table'); table.cellPadding = 0; table.cellSpacing = 0; table.border = 0; var i = 0; for (var hex in coloroptions) { if (i % 8 == 0) { var tr = table.insertRow(-1); } i++; var div = document.createElement('div'); div.style.backgroundColor = coloroptions[hex]; var option = tr.insertCell(-1); option.style.textAlign = 'center'; option.className = 'ocolor'; option.appendChild(div); option.cmd = obj.cmd; option.editorid = this.editorid; option.controlkey = obj.id; option.colorname = coloroptions[hex]; option.id = this.editorid + '_color_' + coloroptions[hex]; option.onmouseover = option.onmouseout = option.onmouseup = option.onmousedown = vB_Text_Editor_Events.prototype.menuoption_onmouseevent; option.onclick = vB_Text_Editor_Events.prototype.coloroption_onclick; } menu.appendChild(table); }
Code:
case "forecolor": case "backcolor": var table = document.createElement("table"); table.cellPadding = 0; table.cellSpacing = 0; table.border = 0; var i = 0; for (hex in ips_primary_colors) { if (i % 8 == 0) { var tr = table.insertRow(- 1); } i++; var div = document.createElement("div"); div.style.backgroundColor = ips_primary_colors[hex]; div.innerHTML = " "; var option = tr.insertCell(- 1); option.className = "rte-menu-color"; option.appendChild(div); option.cmd = obj.cmd; option.editor_id = this.editor_id; option.colorname = ips_primary_colors[hex]; option.id = this.editor_id + "_color_" + ips_primary_colors[hex]; option.onmouseover = option.onmouseout = option.onmouseup = option.onmousedown = ips_editor_events.prototype.menu_option_onmouseevent; option.onclick = ips_editor_events.prototype.color_cell_onclick; } menu.style.overflow = "visible"; menu.appendChild(table); break ; }
Comment