<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>FCKeditor on 小惡魔 - AppleBOY</title><link>https://blog.wu-boy.com/tags/fckeditor/</link><description>Recent content in FCKeditor on 小惡魔 - AppleBOY</description><generator>Hugo</generator><language>en-us</language><managingEditor>appleboy.tw@gmail.com (Appleboy)</managingEditor><webMaster>appleboy.tw@gmail.com (Appleboy)</webMaster><lastBuildDate>Tue, 30 Mar 2010 12:21:52 +0000</lastBuildDate><atom:link href="https://blog.wu-boy.com/tags/fckeditor/feed.xml" rel="self" type="application/rss+xml"/><item><title>[編輯器] CKeditor 更換 background-color and font-size</title><link>https://blog.wu-boy.com/2010/03/%E7%B7%A8%E8%BC%AF%E5%99%A8-ckeditor-%E6%9B%B4%E6%8F%9B-background-color-and-font-size/</link><pubDate>Tue, 30 Mar 2010 12:21:52 +0000</pubDate><author>appleboy.tw@gmail.com (Appleboy)</author><guid>https://blog.wu-boy.com/2010/03/%E7%B7%A8%E8%BC%AF%E5%99%A8-ckeditor-%E6%9B%B4%E6%8F%9B-background-color-and-font-size/</guid><description>&lt;p&gt;&lt;a href="https://www.flickr.com/photos/appleboy/4476260884/" title="Flickr 上 appleboy46 的 logo"&gt;&lt;img src="https://i2.wp.com/farm5.static.flickr.com/4024/4476260884_a9464cf0e5_o.png?resize=182%2C134&amp;#038;ssl=1" alt="logo" data-recalc-dims="1" /&gt;&lt;/a&gt; 相信大家在製作 Web 過程，一定會用到編輯器，然而 &lt;a href="http://ckeditor.com/"&gt;CKeditor&lt;/a&gt; 前身 &lt;a href="http://zh.wikipedia.org/zh-tw/FCKeditor"&gt;FCKeditor&lt;/a&gt; 非常有名，FCKeditor 運行了六年之久，在去年2009年的時候，轉換成了 CKeditor，目前開發團隊也專注於此版本，現在已經推出到 &lt;a href="http://ckeditor.com/blog/CKEditor_3.2_released"&gt;CKEditor 3.2 released!&lt;/a&gt;，可以參考 &lt;a href="http://docs.cksource.com/CKEditor_3.x/Developers_Guide"&gt;CKEditor 3.x - Developer&amp;rsquo;s Guide&lt;/a&gt;，裡面也整合了 &lt;a href="http://jquery.com/"&gt;jQuery&lt;/a&gt;，替很多開發者想到更多管道去整合網站，然而今天設計網站，需要改變編輯器的背景顏色，預設是白色背景，但是並非所有網站都是白色呈現，所以才需要動到背景顏色，這樣好讓使用者可以融入整個背景，在 &lt;a href="http://plurk.com"&gt;Plurk&lt;/a&gt; 發表了這問題，也找了官方論壇，都沒有發現正確解答，官方論壇有篇類似問題：&lt;a href="http://goo.gl/3iyL"&gt;Change the background color of the CKEditor text area&lt;/a&gt;，這篇自己試過是沒有用的，正確解法可以參考 CKeditor 的 &lt;a href="http://docs.cksource.com/ckeditor_api/"&gt;API&lt;/a&gt;:&lt;a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.contentsCss"&gt;contentsCss&lt;/a&gt;。 1. 首先在 CKeditor 根目錄建立新檔案：mysitestyles.css&lt;/p&gt;
&lt;pre class="brush: css; title: ; notranslate" title=""&gt;body
{
 /* Font */
 font-family: Arial, Verdana, sans-serif;
 font-size: 12px;

 /* Text color */
 color: #f0f0f0;

 /* Remove the background color to make it transparent */
 background-color: #353c42;
}

html
{
 /* #3658: [IE6] Editor document has horizontal scrollbar on long lines
 To prevent this misbehavior, we show the scrollbar always */
 _overflow-y: scroll
}

img:-moz-broken
{
 -moz-force-broken-image-icon : 1;
 width : 24px;
 height : 24px;
}
img, input, textarea
{
 cursor: default;
}&lt;/pre&gt; 2. 設定 config.js 檔案(Ckeditor 目錄裡面) 
&lt;pre class="brush: jscript; title: ; notranslate" title=""&gt;CKEDITOR.editorConfig = function( config )
{
	// Define changes to default configuration here. For example:
	// config.language = 'fr';
	config.uiColor = '#AADC6E';
	config.contentsCss = '/path/ckeditor/mysitestyles.css';
};&lt;/pre&gt; 重點在於 
&lt;p&gt;&lt;span style="color:green"&gt;config.contentsCss = &amp;lsquo;/path/ckeditor/mysitestyles.css&amp;rsquo;;&lt;/span&gt; 這行，在 Path 部份，請注意由根目錄開始寫起喔。 另外解法，就是用 &lt;a href="http://docs.cksource.com/CKEditor_3.x/Developers_Guide/jQuery_Adapter"&gt;jQuery Adapter&lt;/a&gt;，header 加入：&lt;/p&gt;</description></item><item><title>[PHP]好用的FCKeditor</title><link>https://blog.wu-boy.com/2008/10/php%E5%A5%BD%E7%94%A8%E7%9A%84fckeditor/</link><pubDate>Fri, 17 Oct 2008 05:09:51 +0000</pubDate><author>appleboy.tw@gmail.com (Appleboy)</author><guid>https://blog.wu-boy.com/2008/10/php%E5%A5%BD%E7%94%A8%E7%9A%84fckeditor/</guid><description>&lt;p&gt;最近在玩這一套 &lt;a href="http://www.fckeditor.net/"&gt;FCKeditor&lt;/a&gt; 線上 HTML 編輯系統，這目前很多 opensource 都有利用這一套編輯系統來搭配，我覺得還蠻方便的，所以很多後台或者是前台都會使用，我想這已經是現在的趨勢了，然而要安裝這個也相當容易，官方網站都寫的很清楚，可以先使用他們線上的 &lt;a href="http://www.fckeditor.net/demo"&gt;demo&lt;/a&gt;，如果要加入到自己的系統，他們也有提供一些文件讓大家參考：&lt;a href="http://docs.fckeditor.net/"&gt;線上文件&lt;/a&gt;，其實他們支援各大語法：asp，php，Python… 一堆，安裝方法也很容易，底下寫一下安裝方法： 1. 首先先下載 &lt;a href="http://www.fckeditor.net/"&gt;FCKeditor&lt;/a&gt; 這一套軟體： &lt;a href="http://www.fckeditor.net/download"&gt;點我下載&lt;/a&gt; 目前是這個版本：FCKeditor_2.6.3.zip 2. 裡面有一些 sample 可以使用 fckeditor/_samples/default.html 3. 如果你要使用在自己的系統裡面起加入底下語法：&lt;/p&gt;
&lt;pre class="brush: php; title: ; notranslate" title=""&gt;$root_path = './';
include($root_path . "fckeditor/fckeditor.php");
$sBasePath = "fckeditor/";

//實體化 FCKeditor 並指定欄位名稱
$oFCKeditor = new FCKeditor('file_data');
$oFCKeditor-&gt;BasePath = $sBasePath;

//預設的語言，zh表繁體中文
$oFCKeditor-&gt;Config['DefaultLanguage'] = 'zh';

//預設填入的內容
$oFCKeditor-&gt;Value = '

&lt;p&gt;
 This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;FCKeditor&lt;/a&gt;.
&lt;/p&gt;' ;

//直接輸出FCKeditor表單
$oFCKeditor-&gt;Create(); &lt;/pre&gt; 基本上這樣大致上就完成了喔。很容易吧</description></item></channel></rss>