Add button in Baidu editor

Editor Li added the pdf reference button to modify the illustration: ( Note: The address converted to pdf is not obtained at the address of the iframe page popped up by clicking the button )

 



 



 

 

Editor_config.js adds buttons and button tips

 

 

,toolbars:[

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

]

,labelMap:{

      …………..         ,'quotepdf':'pdf quote '

}

 

 

Editor_all.js is added as follows:

Line 15367 :

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

15482 lines

var dialogBtns = {

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

}

Lines 4636 - 4651 added:

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 lines

var iframeUrlMap = {

..

..

……               ,

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

}

 

Themes/default/ueditor.css style added: (button style, and pop -up iframe style)

 

.edui-for-quotepdf .edui-icon {

    background-position: -240px -40px;

}

/*pdf-insertframe*/

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

    width:350px;

    height:200px;

    overflow: hidden;

}

 

Added pdf.html under Dialogs/ insertframe

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326654203&siteId=291194637