UEditor自定义标题功能修改及链接编辑器默认新窗口打开链接
Author:zhoulujun Date:
UEditor自定义标题功能修改
发现,UEditor本身给文章加的标题都是h1,但是,seo里面,h1标题可是网页标题啊。强调是strong,但是,文本编辑器本身就有加粗(strong)功能。
那么,就的自己动手改造一番。
搜索,'标题居中‘,在zh-cn.js 出现,然后改造为:
'customstyle':{
'tc':'h2标题居中',
'tl':'h2标题居左',
'im':'h3标题居中',
'hi':'h3标题居左'
},
然后,在以 customstyle搜索,发现ueditor.all.js出现UE.plugins['customstyle']=function() {},改造如下:
me.setOpt({ 'customstyle':[
{tag:'h2',name:'tc'},
{tag:'h2',name:'tl'},
{tag:'h3',name:'im'},
{tag:'h3',name:'hi'}
]});
然后上传,发现有效
ueditor1.2.1修改超链接默认值
首先超链接的文件是在ueditor目录中的dialogs目录中的link目录的link.html
statics\js\ueditor\dialogs\link\link.html,31行
然后在链接地址或标题上加value属性和值,希望在新窗口打开,则设置checked属性,如下面红色代码所示。
或者写死,都为新窗口打开。在代码93行修改
var obj = {
'href': href,
'target': $G('target').checked ? '_blank' : '_self',
'title': $G('title').value.replace(/^\s+|\s+$/g, ''),
'_href': href
};
修改链接属性,比如改为noflow
<td colspan="2">
<label for="nofollow">链接属性</label>
<select id='nofollow'>
<option value="nofollow" selected="selected" title="nofollow">nofollow</option>
<option value="" title="取消rel属性">无</option>
<option value="index" title="index">index</option>
<option value="chapter" title="文档的章">chapter</option>
<option value="section" title="文档的节">section</option>
<option value="subsection" title="文档的子段">subsection</option>
<option value="appendix" title="文档附录">appendix</option>
<option value="help" title="帮助文档">help</option>
<option value="bookmark" title="相关文档">bookmark</option>
<option value="start" title="start">start</option>
<option value="next" title="next">next</option>
<option value="prev" title="prev">prev</option>
<option value="contents" title="文档目录">contents</option>
<option value="copyright" title="copyright">copyright</option>
<option value="licence" title="licence">licence</option>
<option value="glossary" title="copyright">index</option>
<option value="glossary" title="glossary">glossary</option>
<option value="stylesheet" title="stylesheet">stylesheet</option>
<option value="alternate" title="文档的可选版本(例如打印页、翻译页或镜像)">alternate</option>
</select>
</td>
先修改到这里
转载本站文章《UEditor自定义标题功能修改及链接编辑器默认新窗口打开链接》,
请注明出处:https://www.zhoulujun.cn/html/webfront/SGML/web/2018_0529_8117.html