资源简介
jsp论坛jsp论坛jsp论坛jsp论坛jsp论坛
代码片段和文件信息
“““
FCKeditor - The text editor for internet
Copyright (C) 2003-2006 Frederico Caldeira Knabben
Licensed under the terms of the GNU Lesser General Public License:
http://www.opensource.org/licenses/lgpl-license.php
For further information visit:
http://www.fckeditor.net/
“Support Open Source software. What about a donation today?“
File Name: fckeditor.py
This is the integration file for Python.
File Authors:
Andrew Liu (andrew@liuholdings.com)
“““
import cgi
import os
import string
def escape(text replace=string.replace):
“““Converts the special characters ‘<‘ ‘>‘ and ‘&‘.
RFC 1866 specifies that these characters be represented
in HTML as < > and & respectively. In Python
1.5 we use the new string.replace() function for speed.
“““
text = replace(text ‘&‘ ‘&‘) # must be done 1st
text = replace(text ‘<‘ ‘<‘)
text = replace(text ‘>‘ ‘>‘)
text = replace(text ‘“‘ ‘"‘)
text = replace(text “‘“ ‘‘‘)
return text
# The FCKeditor class
class FCKeditor(object):
def __init__(self instanceName):
self.InstanceName = instanceName
self.basePath = ‘/fckeditor/‘
self.Width = ‘100%‘
self.Height = ‘200‘
self.ToolbarSet = ‘Default‘
self.Value = ‘‘;
self.Config = {}
def Create(self):
return self.CreateHtml()
def CreateHtml(self):
HtmlValue = escape(self.Value)
Html = ““
if (self.IsCompatible()):
File = “fckeditor.html“
link = “%seditor/%s?InstanceName=%s“ % (
self.basePath
File
self.InstanceName
)
if (self.ToolbarSet is not None):
link += “&ToolBar=%s“ % self.ToolbarSet
# Render the linked hidden field
Html += “yle=\“display:none\“ />“ % (
self.InstanceName
self.InstanceName
HtmlValue
)
# Render the configurations hidden field
Html += “yle=\“display:none\“ />“ % (
self.InstanceName
self.GetConfigFieldString()
)
# Render the editor iframe
Html += “rame id=\“%s\__frame\“ src=\“%s\“ width=\“%s\“ height=\“%s\“ frameborder=\“0\“ scrolling=\“no\“> rame>“ % (
self.InstanceName
link
self.Width
self.Height
)
else:
if (self.Width.find(“%%“) < 0):
WidthCSS = “%spx“ % self.Width
else:
WidthCSS = self.Width
if (self.Height.find(“%%“) < 0):
HeightCSS = “%spx“ % self.Height
else:
HeightCSS = self.Height
Html += ““ % (
self.InstanceName
WidthCSS
HeightCSS
HtmlValue
)
Html += “ “
return Html
def IsCompatible(self):
if (os.environ.has_key(“HTTP_USER_AGENT“)):
sAgent = os.environ.get(“HTTP_USER_AGENT“ ““)
else:
s
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2384 2006-07-26 13:41 WebModule2\FCKeditor\editor\lang\_translationstatus.txt
文件 1510 2006-04-19 21:55 WebModule2\CodePub.Com说明.txt
文件 1157 2006-04-01 01:31 WebModule2\FCKeditor\htaccess.txt
文件 24837 2005-02-09 14:51 WebModule2\FCKeditor\license.txt
文件 1123 2006-05-23 01:53 WebModule2\FCKeditor\_documentation.html
文件 3050 2006-05-07 16:21 WebModule2\FCKeditor\editor\skins\_fckviewstrips.html
文件 2144 2005-12-21 23:49 WebModule2\FCKeditor\editor\lang\_getfontformat.html
文件 173727 2006-07-25 20:51 WebModule2\FCKeditor\_whatsnew.html
文件 0 2003-08-12 08:37 WebModule2\FCKeditor\editor\dialog\fck_spellerpages\spellerpages\blank.html
文件 4840 2006-06-03 21:56 WebModule2\FCKeditor\editor\filemanager\browser\default\browser.html
文件 4093 2005-02-16 20:35 WebModule2\FCKeditor\editor\dialog\fck_spellerpages\spellerpages\controls.html
文件 4720 2006-05-16 13:31 WebModule2\FCKeditor\editor\dialog\fck_about.html
文件 2652 2006-04-03 02:42 WebModule2\FCKeditor\editor\dialog\fck_anchor.html
文件 2931 2005-02-09 21:14 WebModule2\FCKeditor\editor\dialog\fck_button.html
文件 3040 2005-12-17 03:17 WebModule2\FCKeditor\editor\dialog\fck_checkbox.html
文件 5129 2004-12-20 00:16 WebModule2\FCKeditor\editor\dialog\fck_colorselector.html
文件 21664 2005-12-19 23:47 WebModule2\FCKeditor\editor\dialog\fck_docprops.html
文件 2723 2005-05-06 10:41 WebModule2\FCKeditor\editor\dialog\fck_docprops\fck_document_preview.html
文件 4831 2006-06-02 20:16 WebModule2\FCKeditor\editor\dialog\fck_find.html
文件 5453 2006-05-09 02:49 WebModule2\FCKeditor\editor\dialog\fck_flash.html
文件 1368 2005-11-23 04:42 WebModule2\FCKeditor\editor\dialog\fck_flash\fck_flash_preview.html
文件 2744 2005-02-09 19:27 WebModule2\FCKeditor\editor\dialog\fck_form.html
文件 2479 2005-02-08 20:18 WebModule2\FCKeditor\editor\dialog\fck_hiddenfield.html
文件 9528 2006-07-14 13:03 WebModule2\FCKeditor\editor\dialog\fck_image.html
文件 2756 2006-06-23 13:20 WebModule2\FCKeditor\editor\dialog\fck_image\fck_image_preview.html
文件 12671 2006-05-13 01:19 WebModule2\FCKeditor\editor\dialog\fck_li
文件 3100 2005-08-25 22:29 WebModule2\FCKeditor\editor\dialog\fck_listprop.html
文件 7360 2006-05-09 03:06 WebModule2\FCKeditor\editor\dialog\fck_paste.html
文件 2381 2005-10-07 01:22 WebModule2\FCKeditor\editor\plugins\placeholder\fck_placeholder.html
文件 3059 2005-12-17 03:18 WebModule2\FCKeditor\editor\dialog\fck_radiobutton.html
............此处省略1465个文件信息
评论
共有 条评论