kindeditor使用方法,kindeditor怎么設(shè)置長寬度
kindeditor的使用方法以及設(shè)置長寬度的方法如下:
首先下載kindeditor的以及和kindeditor相關(guān)的文件,如下圖所示:
將下圖中的三個(gè)文件拷貝到所需的項(xiàng)目中,如下圖所示:
下載完成之后既是kindeditor具體的使用方法,首先在HTML中建一個(gè)textare框,給其一個(gè)id。如下圖所示:
接下來引入jQuery及kindeditor的js文件,并在js中寫上相關(guān)的文件,如下圖所示:
然后kindeditor長寬度的設(shè)置方法如下。一般長寬度都是用參數(shù)來設(shè)置的,如下圖:
kindeditor的大小除了可以利用參數(shù)來設(shè)置之外,還可以給ke-container和ke-container-default設(shè)置一個(gè)寬度和高度。通常需要輸入以下代碼:
.ke-container.ke-container-default{
width:600px!important;
height:100px!important;
}
如下圖所示:
如何使用kindeditor插件
使用方法:
把解壓出來的 kindeditor 文件夾,放置到網(wǎng)站的根目錄中;注意,為了實(shí)現(xiàn)視頻顯示頁面位置不受限制同時(shí)不用改變視頻調(diào)用代碼,本插件文件引用均以相對跟目錄的絕對路徑,如果不放在根目錄,對應(yīng)路徑需要全部修改,否則不能正常顯示;建議不要改動(dòng);
在發(fā)布文集頁面調(diào)用已加入視頻播放器插件的kindeditor,調(diào)用方法參照http://www.kindsoft.net/docs/usage.html 中的說明。如果自定義配置了輯器的工具欄的情況下,請務(wù)必在 items 加入 'inrtfile',位置無要求;
如:
items : [
'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
'justifyfull', 'inrtorderedlist', 'inrtunorderedlist', 'indent', 'outdent', 'subscript',
'superscript', 'clearhtml', 'quickformat', 'lectall', '|', 'fullscreen', '/',
'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
'flash', 'media','inrtVideo', 'inrtfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
'anchor', 'link', 'unlink', '|', 'about'
],
對于通過插件工具欄按鈕插入生成的代碼不要改動(dòng),均有其作用的;
在顯示文集頁面調(diào)用視頻播放器ckplayer;
<script chart="utf-8" src="/kindeditor/plugins/inrtVideo/ckplayer/ckplayer.js"></script>
完成以上步驟即可,使用本插件。
jsf頁面怎么使用kindeditor編輯器
第一步: 需要把kindeditor全部加入到項(xiàng)目中; 第二步: 在新添加的頁面中加入以下代碼 第三步:也是比較重要的一步,在web.config需要配置一些參數(shù)。 .節(jié)點(diǎn)中配置 第四步:需要注意的細(xì)節(jié) 1.在增加的時(shí)候獲取字符串需
請問關(guān)于在線編輯器的使用,以kindeditor為例
你好,很高興你再次向我提問,不過這個(gè)插件我沒有用過,昨天解決你的問題是因?yàn)榭吹搅四愕腻e(cuò)誤提示,但現(xiàn)在我對你的錯(cuò)誤不是很清楚!你說的編輯器的‘基本方法大全’你可以去找kindeditor
的API啊,里面有介紹他的所有使用方法的!有什么疑問我可以在幫你一起解決!
html中加入KindEditor除了引入js文件還要怎么實(shí)現(xiàn)
第1步:引入jquery.js;
第2步:引入KindEditor.js;
第3步:引入KindEditor對應(yīng)的css;
第4步:給Html中的文本域賦予一個(gè)id;如:
<textareaid="product"></textarea>
第5步:在js中調(diào)用,如:
vareditor1;
KindEditor.ready(function(K){
editor1=K.create("#product",{
width:"80%",//設(shè)置文本域的寬度
height:"300px",//設(shè)置文本域的高度
//設(shè)置文本域的顯示主題風(fēng)格(需要根據(jù)引入的kingEditor主題而定)
themeType:"default",
syncType:"form",//同步表單
resizeType:0,//禁止用戶拖動(dòng)文本域
afterBlur:function(){this.sync();}//將kindeditor的值同步到textarea
});
以上參數(shù)可以根據(jù)具體情況修改,也可以查看KindEditor的使用教程,有詳細(xì)介紹。
kindeditor 編輯器php的詳細(xì)配置方法
通過使用KE.show(config)方法即可將編輯器添加到文檔中。下面是一段源碼:
KE.show = function(args) {
KE.init(args);
KE.event.ready(function() { KE.create(args.id); });
};
從源碼中可以看出,有兩種使用編輯器的方法:
法一:KE.show(config);
法二:KE.init(config);KE.create(id);
·無論使用哪種方式使用KindEditor編輯器,都必須進(jìn)行參數(shù)配置;
·可以在KE.show()和KE.init()方法中傳遞配置參數(shù)config;
·配置參數(shù)config是一個(gè)對象,一般使用字面量對象;
·其中,id參數(shù)是唯一必須進(jìn)行配置的,其他參數(shù)可以省略。
參數(shù)設(shè)置例子
KE.show({
id : "content_1",
width : "70%", //編輯器的寬度為70%
height : "200px", //編輯器的高度為100px
filterMode : fal, //不會(huì)過濾HTML代碼
resizeMode : 1 //編輯器只能調(diào)整高度
});
配置參數(shù)
1、id
TEXTAREA輸入框的ID,必須設(shè)置。
數(shù)據(jù)類型:String
2、items
配置編輯器的工具欄,其中"-"表示換行,"|"表示分隔符。
數(shù)據(jù)類型:Array
默認(rèn)值:
['source', '|', 'fullscreen', 'undo', 'redo', 'print', 'cut', 'copy', 'paste',
'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
'justifyfull', 'inrtorderedlist', 'inrtunorderedlist', 'indent', 'outdent', 'subscript',
'superscript', '|', 'lectall', '-',
'title', 'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold',
'italic', 'underline', 'strikethrough', 'removeformat', '|', 'image',
'flash', 'media', 'advtable', 'hr', 'emoticons', 'link', 'unlink', '|', 'about']
3、width
編輯器的寬度,可以設(shè)置px或%,比TEXTAREA輸入框樣式表寬度優(yōu)先度高。
數(shù)據(jù)類型:String
默認(rèn)值:TEXTAREA輸入框的寬度
注: 3.2版本開始支持。
4、height
編輯器的高度,只能設(shè)置px,比TEXTAREA輸入框樣式表高度優(yōu)先度高。
數(shù)據(jù)類型:String
默認(rèn)值:TEXTAREA輸入框的高度
注: 3.2版本開始支持。
5、minWidth
數(shù)據(jù)類型:Int
指定編輯器最小寬度,單位為px。
默認(rèn)值:200
6、minHeight
數(shù)據(jù)類型:Int
指定編輯器最小高度,單位為px。
默認(rèn)值:100
7、filterMode
數(shù)據(jù)類型:Boolean
true時(shí)過濾HTML代碼,fal時(shí)允許輸入任何代碼。
默認(rèn)值:fal
注: 3.4以前版本的filterMode默認(rèn)值為true。
8、htmlTags
指定要保留的HTML標(biāo)記和屬性。哈希數(shù)組的key為HTML標(biāo)簽名,value為HTML屬性數(shù)組,"."開始的屬性表示style屬性。
數(shù)據(jù)類型:Object
默認(rèn)值:
{
font : ['color', 'size', 'face', '.background-color'],
span : ['style'],
div : ['class', 'align', 'style'],
table:['class', 'border', 'cellspacing', 'cellpadding', 'width', 'height', 'align', 'style'],
'td,th':['class', 'align', 'valign', 'width', 'height',
'colspan', 'rowspan', 'bgcolor', 'style'],
a : ['class', 'href', 'target', 'name', 'style'],
embed : ['src', 'width', 'height', 'type', 'loop', 'autostart', 'quality',
'style', 'align', 'allowscriptaccess', '/'],
img : ['src', 'width', 'height', 'border', 'alt', 'title', 'align', 'style', '/'],
hr : ['class', '/'],
br : ['/'],
'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : ['align', 'style'],
'tbody,tr,strong,b,sub,sup,em,i,u,strike' : []
}
注:filterMode為true時(shí)有效。3.4版本開始屬性可設(shè)置style,保留所有inline樣式。
9、resizeMode
2或1或0,2時(shí)可以拖動(dòng)改變寬度和高度,1時(shí)只能改變高度,0時(shí)不能拖動(dòng)。
數(shù)據(jù)類型:Int
默認(rèn)值:2
10、skinType
風(fēng)格類型,default或tinymce。
數(shù)據(jù)類型:String
默認(rèn)值:default
注:3.4以前版本和3.4.1版本開始默認(rèn)值為default,3.4版本的默認(rèn)值為oxygen。
11、wyswygMode
可視化模式或代碼模式
數(shù)據(jù)類型:Boolean
默認(rèn)值:true
12、cssPath
指定編輯器iframe document的CSS,用于設(shè)置可視化區(qū)域的樣式。
數(shù)據(jù)類型:String或Array
默認(rèn)值:空
注:3.4.1版本開始可指定多個(gè)CSS文件。例如:cssPath : ['a.css', 'b.css']
13、skinsPath
指定編輯器的skins目錄,skins目錄存放風(fēng)格的css文件和gif圖片。
數(shù)據(jù)類型:String
默認(rèn)值:KE.scriptPath + 'skins/'
14、pluginsPath
指定編輯器的plugins目錄。
數(shù)據(jù)類型:String
默認(rèn)值:KE.scriptPath + 'plugins/'
15、minChangeSize
undo/redo文字輸入最小變化長度,當(dāng)輸入的文字變化小于這個(gè)長度時(shí)不會(huì)添加到undo堆棧里。
數(shù)據(jù)類型:Int
默認(rèn)值:5
16、loadStyleMode
true時(shí)自動(dòng)加載編輯器的CSS。
數(shù)據(jù)類型:Boolean
默認(rèn)值:true
注: 3.4版本開始支持。
17、urlType
改變站內(nèi)本地URL,可設(shè)置空、relative、absolute、domain。
空為不修改URL,relative為相對路徑,absolute為絕對路徑,domain為帶域名的絕對路徑。
數(shù)據(jù)類型:String
默認(rèn)值:空
注: 3.4版本開始支持,3.4.1版本開始默認(rèn)值為空。
18、newlineTag
設(shè)置回車換行標(biāo)簽,可設(shè)置p、br。
數(shù)據(jù)類型:String
默認(rèn)值:br
注: 3.4版本開始支持。
19、afterCreate
設(shè)置編輯器創(chuàng)建后執(zhí)行的回調(diào)函數(shù)。
數(shù)據(jù)類型:Function
默認(rèn)值:無
20、afterDialogCreate
設(shè)置彈出浮動(dòng)框創(chuàng)建后執(zhí)行的回調(diào)函數(shù)。
數(shù)據(jù)類型:Function
默認(rèn)值:無
注: 3.4.3版本開始支持。
21、allowUpload
true或fal,true時(shí)顯示上傳圖片標(biāo)簽。
數(shù)據(jù)類型:Boolean
默認(rèn)值:true
注: 3.4版本開始支持。
22、allowFileManager
true或fal,true時(shí)顯示瀏覽服務(wù)器圖片功能。
數(shù)據(jù)類型:Boolean
默認(rèn)值:fal
注: 3.4版本開始支持。
23、referMethod
設(shè)置referMethod后上傳圖片的POST參數(shù)里有referMethod。
數(shù)據(jù)類型:String
默認(rèn)值:空
注: 3.4版本開始支持。
24、dialogAlignType
設(shè)置彈出框(dialog)的對齊類型,可設(shè)置page和空。
指定page時(shí)按當(dāng)前頁面居中,指定空時(shí)按編輯器居中。
數(shù)據(jù)類型:String
默認(rèn)值:page
注: 3.4.1版本開始支持。
25、imageUploadJson
指定上傳圖片的服務(wù)器端程序。
數(shù)據(jù)類型:String
默認(rèn)值:../../php/upload_json.php
注: 3.4.1版本開始支持。
26、fileManagerJson
指定瀏覽遠(yuǎn)程圖片的服務(wù)器端程序。
數(shù)據(jù)類型:String
默認(rèn)值:../../php/file_manager_json.php
注: 3.4.1版本開始支持。
27、autoSetDataMode
true或fal。
true時(shí)自動(dòng)將編輯器內(nèi)容設(shè)置到原來的textarea,也就是每次輸入內(nèi)容就執(zhí)行KE.util.tData函數(shù)。
數(shù)據(jù)類型:Boolean
默認(rèn)值:true
注: 3.5版本開始支持。打開autoSetDataMode模式后會(huì)降低輸入性能,理想的做法是關(guān)閉autoSetDataMode,提交數(shù)據(jù)前執(zhí)行KE.util.tData。
28、afterSetData
自動(dòng)執(zhí)行KE.util.tData后執(zhí)行的回調(diào)函數(shù),autoSetDataMode為true時(shí)有效。
數(shù)據(jù)類型:Function
默認(rèn)值:無
注: 3.5版本開始支持。
29、shadowMode
true或fal,true時(shí)彈出層顯示陰影。
數(shù)據(jù)類型:Boolean
默認(rèn)值:true
注: 3.5版本開始支持。
30、allowPreviewEmoticons
true或fal,true時(shí)鼠標(biāo)放在表情上可以預(yù)覽表情。
數(shù)據(jù)類型:Boolean
默認(rèn)值:true
注: 3.5版本開始支持。