百度编辑器里添加按钮

编辑器李添加pdf引用按钮修改说明图:(注:在点击按钮弹出的iframe页面地址处未获取到转换为pdf的地址)

 



 



 

 

Editor_config.js新增按钮及按钮提示

 

 

,toolbars:[

      […………….  ,'quotepdf']

]

,labelMap:{

      …………..         ,'quotepdf':'pdf引用'

}

 

 

Editor_all.js新增如下:

15367行:

var btnCmds = [……….    ,'quotepdf']

15482

var dialogBtns = {

      ok : […………           ,'quotepdf']

}

46364651行新增:

UE.plugins['quotepdf'] = function() {

   var me =this;

    function deleteIframe(){

        me._iframe && delete me._iframe;

    }

    me.addListener("selectionchange",function(){

        deleteIframe();

    });

    me.commands["quotepdf"] = {

        queryCommandState : function(){

            return this.highlight ? -1 :0;

        }

    }

};

 

15343

var  iframeUrlMap ={

..

..

……               ,

'quotepdf':'~/dialogs/insertframe/pdf.html'

}

 

Themes/default/ueditor.css 样式新增:(按钮样式,及弹出iframe样式)

 

.edui-for-quotepdf .edui-icon {

    background-position: -240px -40px;

}

/*pdf-insertframe*/

.edui-for-quotepdf .edui-dialog-content  {

    width:350px;

    height:200px;

    overflow: hidden;

}

Dialogs/insertframe下新增pdf.html

猜你喜欢

转载自577439237.iteye.com/blog/2276985