小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

四大 FCKeditor 實(shí)戰(zhàn)應(yīng)用技巧(3)

 WindySky 2007-03-28
 3、外聯(lián)編輯條(多個(gè)編輯域共用一個(gè)編輯條)

  這個(gè)功能是2.3版本才開始提供的,以前版本的FCKeditor要在同一個(gè)頁面里用多個(gè)編輯器的話,得一個(gè)個(gè)創(chuàng)建,現(xiàn)在有了這個(gè)外聯(lián)功能,就不用那么麻煩了,只需要把工具條放在一個(gè)適當(dāng)?shù)奈恢?,后面就可以無限制的創(chuàng)建編輯域了,如圖:

  要實(shí)現(xiàn)這種功能呢,需要先在頁面中定義一個(gè)工具條的容器:<divid="xToolbar"></div>,然后再根據(jù)這個(gè)容器的id屬性進(jìn)行設(shè)置。

  ASP實(shí)現(xiàn)代碼

  

<div id="fckToolBar"></div> 
<% 
Dim oFCKeditor 
Set oFCKeditor = New FCKeditor 
with oFCKeditor 
.BasePath = fckPath 
.Config("ToolbarLocation") = "Out:fckToolBar" 

.ToolbarSet = "Basic" 
.Width = "100%" 
.Height = "200" 

.Value = "" 
.Create "jcontent" 

.Height = "150" 
.Value = "" 
.Create "jreach" 
end with 
%>

  JAVASCRIPT實(shí)現(xiàn)代碼

  

<div id="xToolbar"></div> 
FCKeditor 1: 
<script type="text/javascript"> 
<!-- 
// Automatically calculates the editor base path based on the _samples directory. 
// This is usefull only for these samples. A real application should use something like this: 
// oFCKeditor.BasePath = ‘/fckeditor/‘ ; // ‘/fckeditor/‘ is the default value. 
var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf(‘_samples‘)) ; 

var oFCKeditor = new FCKeditor( ‘FCKeditor_1‘ ) ; 
oFCKeditor.BasePath = sBasePath ; 
oFCKeditor.Height = 100 ; 
oFCKeditor.Config[ ‘ToolbarLocation‘ ] = ‘Out:parent(xToolbar)‘ ; 
oFCKeditor.Value = ‘This is some <strong>sample text</strong>. You are using FCKeditor.‘ ; 
oFCKeditor.Create() ; 
//--> 
</script> 
<br /> 
FCKeditor 2: 
<script type="text/javascript"> 
<!-- 
oFCKeditor = new FCKeditor( ‘FCKeditor_2‘ ) ; 
oFCKeditor.BasePath = sBasePath ; 
oFCKeditor.Height = 100 ; 
oFCKeditor.Config[ ‘ToolbarLocation‘ ] = ‘Out:parent(xToolbar)‘ ; 
oFCKeditor.Value = ‘This is some <strong>sample text</strong>. You are using FCKeditor.‘ ; 
oFCKeditor.Create() ; 
//--> 
</script>

  此部分的詳細(xì)DEMO請(qǐng)參照:
_samples/html/sample11.html
_samples/html/sample11_frame.html
4、文件管理功能、文件上傳的權(quán)限問題

  一直以后FCKeditor的文件管理部分的安全是個(gè)值得注意,但很多人沒注意到的地方,雖然FCKeditor在各個(gè)Release版本中一直存在的一個(gè)功能就是對(duì)上傳文件類型進(jìn)行過濾,但是她沒考慮過另一個(gè)問題:到底允許誰能上傳?到底誰能瀏覽服務(wù)器文件?

  之前剛開始用FCKeditor時(shí),我就出現(xiàn)過這個(gè)問題,還好NetRube(FCKeditor中文化以及FCKeditor ASP版上傳程序的作者)及時(shí)提醒了我,做法是去修改FCK上傳程序,在里面進(jìn)行權(quán)限判斷,并且再在fckconfig.js里把相應(yīng)的一些功能去掉。但隨之FCK版本的不斷升級(jí),每升一次都要去改一次配置程序fckconfig.js,我發(fā)覺厭煩了,就沒什么辦法能更好的控制這種配置么?事實(shí)上,是有的。

  在fckconfig.js里面,有關(guān)于是否打開上傳和瀏覽服務(wù)器的設(shè)置,在創(chuàng)建FCKeditor時(shí),通過程序來判斷是否創(chuàng)建有上傳瀏覽功能的編輯器。首先,我先在fckconfig.js里面把所有的上傳和瀏覽設(shè)置全設(shè)為false,接著我使用的代碼如下:

  ASP版本:

<% 
Dim oFCKeditor 
Set oFCKeditor = New FCKeditor 
with oFCKeditor 
.BasePath = fckPath 
.Config("ToolbarLocation") = "Out:fckToolBar" 
if request.cookies(site_sn)("issuper")="yes" then 
.Config("LinkBrowser") = "true" 
.Config("ImageBrowser") = "true" 
.Config("FlashBrowser") = "true" 
.Config("LinkUpload") = "true" 
.Config("ImageUpload") = "true" 
.Config("FlashUpload") = "true" 
end if 
.ToolbarSet = "Basic" 
.Width = "100%" 
.Height = "200" 
.Value = "" 
.Create "jcontent" 
%> 

  JAVASCRIPT版本:

  

      var oFCKeditor = new FCKeditor( ‘fbContent‘ ) ;
      <%if power = powercode then%>
      oFCKeditor.Config[‘LinkBrowser‘] = true ;
      oFCKeditor.Config[‘ImageBrowser‘] = true ;
      oFCKeditor.Config[‘FlashBrowser‘] = true ;
      oFCKeditor.Config[‘LinkUpload‘] = true ;
      oFCKeditor.Config[‘ImageUpload‘] = true ;
      oFCKeditor.Config[‘FlashUpload‘] = true ;
      <%end if%>
      oFCKeditor.ToolbarSet = ‘Basic‘ ;
      oFCKeditor.Width = ‘100%‘ ;
      oFCKeditor.Height = ‘200‘ ;
      oFCKeditor.Value = ‘‘ ;
      oFCKeditor.Create() ;

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多