Cuteeditor is a powerful text editor that supports Image Upload, file download, and word. It is very convenient for News Publishing Systems, blogs, and other systems.
1. cuteeditor Configuration
1. Upload the following files to the bin under the root directory of your site (these files can be found under cuteeditor6.0/bin)
Cuteeditor. dll,
Cuteeditor. imageeditor. dll (the editorimage function added in 6.0 ),
Cuteeditor. LIC (decrypt the file ),
Netspell. spellchecker. dll (spelling check function)
Note: (files with the extension ". DIC" are saved as plain text files in the dictionary format. Copy all the files in the cuteeditor6.0/bin folder to the bin in the root directory of the site)
2. Copy the cutesoft_client folder to the root directory of the project.
The cutesoft_clientpackage includes the cuteeditorfolder and example.css. The file-type data example.css specifies the editor style. (You may need to delete getfilethub. aspx in the dialog folder under 2.0)
Note: filespath is used to set the corresponding directory, such as: filespath = "~ /Admin/cutesoft_client/cuteeditor /"
3. Create an uploads folder under the root directory as the root directory for uploading images and attachments.
4. Add cuteeditor. DLL to the toolbox
In the blank area of the toolbox, right-click and select "add selection item" to add an external name to the tab: cuteeditor. Right-click the tab and select "select items". In the displayed dialog box, select the DLL file to be added in the ". Net frameword component" tab.
5. Set cuteeditor attributes (assuming that the current page is in the root directory)
1) set autoconfigure to simple, that is, select the simplest display mode.
2) Set editorwysiwygmodecss to cutesoft_client/example.cs. put the example.css file in this directory.
3) set filespath to cutesoft_client/cuteeditor and set the path of the cuteeditor directory.
6. Call controlsCodeAs follows:
<% @ Register tagprefix = "CE" namespace = "cuteeditor" assembly = "cuteeditor" %> This code is automatically generated if you drag the toolbox from the page by following step 1, you do not need to add it manually.
<Ce: Editor id = "editor1" runat = "server" width = "700px" filespath = "~ /Cutesoft_client/cuteeditor/"editorwysiwygmodecss =" ../example.css "themetype =" office2003_bluetheme "> </Ce: Editor>
Ii. basic attributes:
Editorwysiwygmodecss: sets the style.
Themetype: Set the style
Autoconfigure: whether the selection function is simple or complex
Text: Set the default content for loading.
Maxhtmllength: set the maximum length.
Breakelement: Default HTML generated by "enter"
Urltype: no difference found
Resizemode: Automatic length (in the middle of the length)
Readonly: whether it is read-only
Customculture: Set the language type China to ZH-CN.
Editcompletedocument: Set whether the HTML page code is complete (that is, whether the HTML header is included)
Allowpastehtml: whether HTML code can be pasted
Enablecontextmenu: whether to display the right-click menu in the text
3. configuration in the cuteeditor folder
1) control tool display: Set in cutesoft_client/cuteeditor/configuration/autoconfigure
2) Right-click the control button to display the settings in cutesoft_client/cuteeditor/configuration/contextmenumode.
3) Set permissions: cutesoft_client/cuteeditor/configuration/security
For example, to set attributes such as the size of various components, for example, to control the size of the uploaded files, you can modify "default" in the "Security" folder in cutesoft_client/cuteeditor/configuration/security. config File
======================================
<? XML version = "1.0" encoding = "UTF-8"?>
<Configuration>
<Security name = "restrictuploadedimagedimension"> true </Security> // whether to restrict the size of the uploaded Image
<Security name = "overwriteexistinguploadedfile"> false </Security> // If the uploaded file already exists, overwrite it
<Security name = "usetimestamprenameuploadedfiles"> true </Security> // rename it as time
<Security name = "autoresizeuploadedimages"> true </Security> // whether to automatically adjust the uploaded Image
<Security name = "maximagewidth"> 1024 </Security> // maximum width of the uploaded Image
<Security name = "maximageheight"> 768 </Security> // The minimum width of the uploaded Image
<Security name = "maximagesize"> 1000 </Security> // maximum value of the uploaded Image File
<Security name = "maxmediasize"> 100 </Security> // maximum value of the uploaded media file
<Security name = "maxflashsize"> 100 </Security> // maximum value of the uploaded FLASH file
<Security name = "maxdocumentsize"> 10000 </Security> // maximum document size
<Security name = "maxtemplatesize"> 1000 </Security> // maximum template value
<Security name = "imagegallerypath"> ~ /Uploads </Security> // Image File Upload path
<Security name = "mediagallerypath"> ~ /Uploads </Security> // Media File Upload path
<Security name = "flashgallerypath"> ~ /Uploads </Security> // FLASH file upload path
<Security name = "templategallerypath"> ~ /Templates </Security> // template path
<Security name = "filesgallerypath"> ~ /Uploads </Security> // file library path
<Security name = "maximagefoldersize"> 102400 </Security> // Maximum image folder size
<Security name = "maxmediafoldersize"> 102400 </Security> // maximum media folder size
<Security name = "maxflashfoldersize"> 102400 </Security> // maximum value of the flash folder
<Security name = "maxdocumentfoldersize"> 102400 </Security> // maximum document folder size
<Security name = "maxtemplatefoldersize"> 102400 </Security> // maximum template folder size
<Security name = "thumbnailwidth"> 80 </Security> // Minimum Width
<Security name = "thumbnailheight"> 80 </Security> // minimum height
<Security name = "thumbnailcolumns"> 5 </Security> // minimum number of Columns
<Security name = "thumbnailrows"> 3 </Security> // the minimum number of rows.
<Security name = "allowupload"> true </Security> // whether upload is allowed
<Security name = "allowmodify"> true </Security> // whether modification is allowed
<Security name = "allowrename"> true </Security> // whether to allow renaming
<Security name = "allowdelete"> true </Security> // whether to allow Deletion
<Security name = "allowcopy"> true </Security> // whether to allow replication
<Security name = "allowmove"> true </Security> <! -- This is rename too --> // whether to allow movement
<Security name = "allowcreatefolder"> true </Security> // whether to allow Folder creation
<Security name = "allowdeletefolder"> true </Security> // whether to allow Folder deletion
<Security name = "imagefilters"> // filter (SET) the image file format here
<Item>. jpg </item>
<Item>. JPEG </item>
<Item>. gif </item>
<Item>. PNG </item>
</Security>
<Security name = "mediafilters"> // filter (SET) media file formats here
<Item>. Avi </item>
<Item>. mpg </item>
<Item>. MpEG </item>
<Item>. MP3 </item>
</Security>
<Security name = "documentfilters"> // filter (SET) the file format here.
<Item>. txt </item>
<Item>. doc </item>
<Item>. pdf </item>
<Item>. Zip </item>
<Item>. rar </item>
<Item>. Avi </item>
<Item>. mpg </item>
<Item>. MpEG </item>
<Item>. SWF </item>
<Item>. jpg </item>
<Item>. JPEG </item>
<Item>. gif </item>
<Item>. PNG </item>
<Item>. htm </item>
</Security>
</Configuration>
======================================
4) set the tool's blocking button function: cutesoft_client/cuteeditor/configuration/shared
5) set the tool's blocking button function: cutesoft_client/cuteeditor/configuration/shared
6) language: cutesoft_client/cuteeditor/configuration/languages
7) Add the font: Set in cutesoft_client/cuteeditor/configuration/shared/common. config.
It seems that cuteeditor can be changed everywhere, because the overall idea is to use a touch board, and the specific embodiment is written in the configuration file. You can modify the configuration file or its properties to implement your own functions!
Iv. server-side control of cuteeditor
1) set the default text of the Editor:
Editor1.text = "default text"; // server Method
VaR editor = Document. getelementbyid ('<% = editor1.clientid %>'); // JavaScript Method
VaR editortext = editor. gethtml ();
2) modify the File Upload Directory: editor1.setsecuritygallerypath ("~ /Uploads/jpg ");
Modify the total size of the uploaded file (taking flash as an example): editor1.setsecuritymaxflashfoldersize (1000 );
Modify the size of a single uploaded file (taking flash as an example): editor1.setsecuritymaxflashsize (Kb); // The default unit is kb.
3) multi-user folders
Because the uploaded files are stored in the uploads folder, you can use Program Create an upload folder for each user. The Code is as follows:
Using system. IO;
String username = session ["username"]. tostring ();
Fullpath = server. mappath ("uploads \") + username;
If (! Directory. exists (fullpath ))
{
Directory. createdirectory (fullpath );
}
Editor1.setsecuritygallerypath ("~ /Uploads/"+ username );