百度编辑器调用135编辑器方法

一:首先在ueditor.config.js中toolbars项里增加一个135editor菜单项

 toolbars:[

['bold','italic', 'underline', 'fontborder', 'strikethrough',  '135editor','rowspacingtop', 'rowspacingbottom', 'lineheight','removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|','superscript', 'subscript' ]], 

二:在ueditor文件夹里创建135editor.js

UE.registerUI('135editor',function(editor,uiName){
  var dialog = new UE.ui.Dialog({
      iframeUrl: editor.options.UEDITOR_HOME_URL+'dialogs/135editor/135EditorDialogPage.html', // 135EditorDialogPage
      cssRules:"width:"+ parseInt(document.body.clientWidth*0.9) +"px;height:"+(window.innerHeight -50)+"px;",
      editor:editor,
      name:uiName,
      title:"135编辑器"
  });
  dialog.fullscreen = false;
  dialog.draggable = false;
  var btn = new UE.ui.Button({
      name:'btn-dialog-' + uiName,       
      className:'edui-for-135editor',
      title:'135编辑器',
      onclick:function () {
          dialog.render();
          dialog.open();
      }
  });
  return btn;
},undefined);
// 修改最后的undefined参数为数字序号,比如5,可调整135编辑器按钮的顺序。默认出现在最后面

三:根据路径,在响应的位置放置135页面的文件

 

四:在编辑器的页面添加css样式

.edui-button.edui-for-135editor .edui-button-wrap .edui-button-body .edui-icon{
  background-image: url("http://static.135editor.com/img/icons/editor-135-icon.png") !important;
  background-size: 85%;
  background-position: center;
  background-repeat: no-repeat;
}

完成,在编辑器即可看到135的菜单图标了

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值