How to add a reference tag to the kindeditor Editor

Source: Internet
Author: User

The kindeditor editor does not contain blockquote tags by itself. If you need to add tags, You need to modify them by yourself, next, I will introduce you to the steps for adding blockquote tags to the kindeditor editor in eblog. For more information, see.

Blockquote labels should be a very common feature for many people, which is also convenient to use. If you don't talk much about it, let's start the transformation journey.

Kindeditor adds custom plug-ins and "blockquote" plug-ins

1. Add the plugins/bockquote. js file.

The Code is as follows: Copy code

KindEditor. plugin ('bockquote ', function (K ){
Var self = this, name = 'bockquote ';
Self. clickToolbar (name, function (){
Var lang = self. lang (name + '.'),
Html = ['<div style = "padding: 10px 20px;"> ',
'<Textarea class = "ke-textarea" style = "width: 408px; height: 260px;"> </textarea> ',
'</Div>']. join (''),
Dialog = self. createDialog ({
Name: name,
Width: 450,
Title: self. lang (name ),
Body: html,
YesBtn :{
Name: self. lang ('yes '),
Click: function (e ){
Var type = textarea. val ();
Html = '<blockquote>' + K. escape (type) + '</blockquote> ';
Self. insertHtml (html). hideDialog (). focus ();
}
}
}),
Textarea = K ('textea ', dialog. div );
Textarea [0]. focus ();
});
});

2. Define the language and modify the lang/zh_CN.js file. Add the following code.
Bockquote: 'insert quot ',

3. Modify themes/default/default.pngimage and the default.css file.

I have modified this image, and the person who will be able to use photoshop to modify it is the last icon of the image.

Add the following code to the default.css file:

The Code is as follows: Copy code

. Ke-icon-bockquote {
Background-position: 0px-1248px;
Width: 16px;
Height: 16px;
}

4. Add the bockquote plug-in to the items array when calling the editor.

The Code is as follows: Copy code
Items: ['bockquote']

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.