、CKEditorバージョンの紹介 |
公式サイトのアドレス:のhttp://ckeditor.com
CKEditorバージョンをダウンロードします。http://ckeditor.com/download
CKFinder(無料版)をダウンロードします。http://cksource.com/ckfinder/download
CKEditorAPI:http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html
第二に、インストールして使用します |
CKEditorバージョン:4.4.2、CKFinder:2.4.1本明細書中で使用されるバージョンとして、
1.、ダウンロード後のファイルをコピーし解凍し、同じディレクトリの下に置きます。_sourceフォルダのCKFinderは、写真をアップロードするために、ソースコードに格納されていることに注意してください。そこの2つのフォルダが必要とされていない多くのものであり、個々の状況に基づいて適切に削除しません。
2.リファレンスCKEditorバージョンコアJSファイル<スクリプトSRC = "〜/コンテンツ/ JS /プラグイン/ CKEditorバージョン/ ckeditor.js"> </ SCRIPT>
3. textareaタグを交換してください。
1
2
3
4
5
|
CKEDITOR.replace(
'textarea_nameorid'
,
{
toolbar :
'Basic'
,
uiColor :
'#9AB8F3'
});
|
オプションは、ファイルconfig.jsを直接書き込むことができます
1
2
3
4
5
|
CKEDITOR.editorConfig = function( config )
{
config.toolbar=
'Basic'
;
config.uiColor =
'#9AB8F3'
;
};
|
そのconfig.jsのカスタマイズ
1
2
3
4
|
CKEDITOR.replace(
'textarea_nameorid'
,
{
customConfig :
'/custom/ckeditor_config.js'
});
|
4.新しいCKEditorバージョンは、自動的にフォームが送信される前に、コンテンツを手動で同期、コンテンツの機能を同期キャンセル
1
2
3
|
for
(instance
in
CKEDITOR.instances) {
CKEDITOR.instances[instance].updateElement();
}
|
CKEditorバージョンの新バージョンでは、最後に地元のピクチャ機能をキャンセルしました。アップロードローカルの画像を達成するために、プラグインがCKFinderを使用する必要があります
1> binディレクトリの参照の下にDLLプロジェクトを追加しました。(注:コードはオープンソースではなく、怠惰な同志は、_sourceディレクトリからプロジェクトを開き、独自のコードを書くことができます)
2> config.ascxファイルを変更します
1
2
3
4
|
public
override
bool
CheckAuthentication()
{
return
true
;
}<br><br> BaseUrl =
"/Upload/CKFinder/"
|
3> JSファイルの参照CKFinderコア<スクリプトSRC = "〜/コンテンツ/ JS /プラグイン/ ckfinder / ckfinder.js"> </ SCRIPT>
4>および関連CKEditorバージョンCKFinder 2つのプラグイン、config.jsのCKEditorバージョン開いて、次のコードペースト
1
2
3
4
5
6
7
8
9
10
11
12
13
|
var
ckfinderPath =
"/Content/js/plugins/ckfinder"
;
//ckfinder路径
config.filebrowserBrowseUrl = ckfinderPath +
'/ckfinder.html'
;
config.filebrowserImageBrowseUrl = ckfinderPath +
'/ckfinder.html?type=Images'
;
config.filebrowserFlashBrowseUrl = ckfinderPath +
'/ckfinder.html?type=Flash'
;
config.filebrowserUploadUrl = ckfinderPath +
'/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files'
;
config.filebrowserImageUploadUrl = ckfinderPath +
'/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images'
;
config.filebrowserFlashUploadUrl = ckfinderPath +
'/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash'
;
|