对ubbeditor进行改造以适应seajs的思想

来源:互联网 发布:华为的主要业务知乎 编辑:程序博客网 时间:2024/05/29 03:31

待续。

首先我先说一下对ubbeditor的认识。

1、请看看下面代码:

            var tLinkTableHTML = '<table cellpadding="0" cellspacing="5" class="ubbEditorImageTable">';            tLinkTableHTML += '  <tr>';            tLinkTableHTML += '    <td>' + ubbEditorLang.tImageURL + '</td>';            tLinkTableHTML += '  </tr>';            tLinkTableHTML += '  <tr>';            tLinkTableHTML += '    <td><input id="' + this.tid + '-ubbEditorImageText" type="text" value="http://" class="ubbEditorImageText" ondblclick="this.select();" /></td>';            tLinkTableHTML += '  </tr>';            tLinkTableHTML += '  <tr>';            tLinkTableHTML += '    <td class="ubbEditorTD1"><input type="button" value="' + ubbEditorLang.tOK + '" class="ubbEditorImageButton" onclick="' + this.tName + '.tsetCommand(\'ImageS\', ' + this.tName + '.tEI(\'' + this.tid + '-ubbEditorImageText\').value);" /> <input type="button" value="' + ubbEditorLang.tCancel + '" class="ubbEditorImageButton" onclick="' + this.tName + '.tLoadMaskClose();" /></td>';            tLinkTableHTML += '  </tr>';            tLinkTableHTML += '</table>';

在ubbeditor随处可以见到这种拼html的行为,当然js的插件大都是固定html结构及css样式,但是他将js代码的对象名称也传进去来直接调用----这个还真没办法了,seajs里面的对象岂是全局对象?

2、根据测试,ubbeditor每次弹出弹出层都会新建层,关闭则移除。这是何等效率低下?


0 0