How to use the web page editor CKEditor under Linux

  
                

CKEditor is commonly referred to fCKEDITOR, it is an excellent web editor, can support a variety of programming languages, more and more people use, how to use it under Linux web editor CKEditor it? Xiao Bian gave you about the method under Linux using CKEditor.

First, use:

1, is introduced ckeditor core file ckeditor.js

in the page "head" "script type = & ldquo; text /javascript & rdquo ; src=“ckeditor/ckeditor.js”"/script"

2. Insert the HTML control "textarea" in the place where the editor is used

"textarea id=“TextArea1” Cols=“20” rows=“2” class=“ckeditor”"/textarea

If it is an ASP.NET environment, you can also use the server-side control "TextBox"

"asp:TextBox ID=“tbContent” runat=“server” TextMode=“MultiLine" class=“ckeditor”"/asp:TextBox

Note that adding class=&ldquo to the control ;ckeditor”

3, replace the corresponding control with the editor code

"script type=“text/javascript”"

CKEDITOR.replace(‘TextArea1’);

//If it is a server-side control in the ASP.NET environment "TextBox"

CKEDITOR.replace(‘tbContent’);

//If The TextBox control is in the master page, so write

CKEDITOR.replace(‘"%=tbContent.ClientID.Replace(“_”,“$”) %"’);

"/script"

4, configuration editor

ckeditor configuration is concentrated in the ckeditor /config.js file, the following are some commonly used configuration parameters: Br>

//interface language, default is ‘en’

config.language = ‘zh-cn’;

//set width and height

Config.width = 400;

config.height = 400;

//Editor styles, there are three types: ‘kama’(default), ‘office2003&rsq Uo;,‘v2’

config.skin = ‘v2’;

//Background color

config.uiColor = ‘#FFF’;

//Toolbar (Basic & lsquo;Basic& rsquo;, Almighty & lsquo;Full & rsquo;, Custom) plugins/toolbar/plugin.js

config.toolbar = ‘Basic’;

config.toolbar = ‘Full’;

This will work with:

config.toolbar_Full = [

[‘Source’,‘-’, & lsquo; Save & rsquo;, & lsquo; NewPage & rsquo;, & lsquo; Preview & rsquo;, & lsquo; - & rsquo;, & lsquo; Templates & rsquo;],

[& lsquo; Cut & rsquo;, & lsquo; Copy & rsquo;, & lsquo; Paste & rsquo;, & lsquo ;PasteText’,‘PasteFromWord’,‘-’,‘Print’, ‘SpellChecker’, ‘Scayt’],

[‘Undo’,‘Redo’,‘ - & rsquo;, & lsquo; Find & rsquo;, & lsquo; Replace & rsquo;, & lsquo; - & rsquo;, & lsquo; SelectAll & r Squo;,‘RemoveFormat’],

[‘Form’, ‘Checkbox’, ‘Radio’, ‘TextField’, ‘Textarea’, ‘Select’, ‘Button’ , ‘ImageButton’, ‘HiddenField’],

‘/’,

[‘Bold’,‘Italic’,‘Underline’,‘Strike’ , & lsquo; - & rsquo;, & lsquo; Subscript & rsquo;, & lsquo; Superscript & rsquo;],

[& lsquo; NumberedList & rsquo;, & lsquo; BulletedList & rsquo;, & lsquo; - & rsquo;, & lsquo; Outdent & rsquo;, & lsquo; Indent & rsquo; , & lsquo; Blockquote & rsquo;],

[& lsquo; JustifyLeft & rsquo;, & lsquo; JustifyCenter & rsquo;, & lsquo; JustifyRight & rsquo;, & lsquo; JustifyBlock & rsquo;],

[& lsquo; Link & rsquo;, & lsquo; Unlink & rsquo ;,‘Anchor’],

[‘Image’,‘Flash’,‘Table’,‘HorizontalR Ule’,‘Smiley’,‘SpecialChar’,‘PageBreak’],

‘/’,

[‘Styles’,‘Format’,‘ Font’,‘FontSize’],

[‘TextColor’,‘BGColor’]

];

//Can the toolbar be shrunk
>

config.toolbarCanCollapse = true;

//Location of the toolbar

config.toolbarLocation = ‘top’;//Optional:bottom

//Toolbar is expanded by default

config.toolbarStartupExpanded = true;

//Cancel & drag"Drag to change size" function plugins/resize/plugin.js

Config.resize_enabled = false;

//Change the maximum height of the size

config.resize_maxHeight = 3000;

//Change the maximum width of the size

config.resize_maxWidth = 3000;

//Change the minimum height of the size

config.resize_min Height = 250;

//Minimum size to change size

config.resize_minWidth = 750;

//Whether it is automatically submitted when submitting a form containing this editor Update the data inside the element

config.autoUpdateElement = true;

//Set whether to use absolute or relative directory, empty to relative directory

config.baseHref = &lsquo ;’

//The z-index value of the editor

config.baseFloatZIndex = 10000;

//Set the shortcut key
Previous1234Next Page total 4 pages

Copyright © Windows knowledge All Rights Reserved