Integrate Ckfinder into CKEditor3.0 's method _ Web editor

Source: Internet
Author: User

Because this ckeditor new revision, did not provide the file uploads the function, therefore chooses the integration Ckfinder is a good choice
Need to modify the CKEditor plugin folder under the JS source code to Image Plug-ins for example (Flash and files the same):
Code
Copy Code code as follows:

Make some changes to the code below
{type: ' button ', ID: ' Browse ', align: ' center ', Label:m.lang.common.browseserver,hidden:false,filebrowser: ' Info: Txturl '}]}]},
2009-07-13 will browse Server button to display status (Hidden:false), add onclick function to open ckfinder page
{type: ' button ', ID: ' Browse ', align: ' center ', Label:m.lang.common.browseserver, Hidden:false, Filebrowser: ' Info:txtu RL ', onclick:function () {var finder = new Ckfinder (); finder. BasePath = '.. /ckfinder20090716/'; Finder. Selectfunction = Setfilefield; Finder. Popup (); } }]}]},


Add the bottom function outside the method body
2009-07-13 Yang Xin to retrieve the image address returned by Ckfinder and assign values to the Path text box and preview picture
function Setfilefield (FILEURL)
{
Get all text box controls under the main div
var inputstr = document.getElementById ("Cke_txtcontent_dialog"). getElementsByTagName ("Input");
for (var i=0; i<inputstr.length; i++)
{
if (inputstr[i].type== "text")
{
The first input box control is the image path, gets the ID, sets the new picture path
CKEDITOR.document.getById (inputstr[i].id). SetValue (FILEURL);
break;
}
}
CKEDITOR.document.getById (' Previewimage '). setattribute (' src ', decodeURI (FILEURL));
}

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.