This repository has been archived by the owner on Oct 12, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
FckeditorModule
58 lines (50 loc) · 2.26 KB
/
FckeditorModule
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
I've just started to build a CP module for [http://www.fckeditor.net FCKeditor].
It is in his first stages. Comments and tests results are welcome.
To use it, you must:
* download and install fckeditor.py
* download and install FCKeditor in a folder called "FCKeditor"
* create 2 folders: "content" and "images". They will be used to store pages and images.
* create a CP config file referencing "content" and "images" as static elements.
{{{
[staticContent]
content=content
images=images
}}}
* Finally, you must tell to FCKeditor that CP is his friends. For that adapt FCKeditor/fckconfig.js like following:
{{{
FCKConfig.ImageBrowser = true ;
+ FCKConfig.ImageBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Image&Connector=/editor/connector" ;
- FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/asp/connector.asp' ;
}}}
Be careful to align your cpg.root to Connector URL and to remove (or comment) the existing asp Filemanager.
Voila!!
Start your CP daemon: python fckeditor.py and browse to localhost:8080/ and follow simple links I've put there.
I've tested it with FCKeditor-2.0RC2 and FCKeditor-2.0RC3 on Gentoo with FireFox-1.0. Following FCKeditor website it works with IE 5.5+, Firefox 1.0+, Mozilla 1.3+ and Netscape 7+.
* Attachment Note: fckeditor.py - Thu 10 Mar 2005 02:27:49 PM CST.
There is a bug with edit link. The way in which the test.html is written into the page for editing causes Javascript errors. Below is the diff of a fix.
{{{
28c28,29
- return template % {'content':'','page':page}
---
+ content = "''"
+ return template % {'content':content,'page':page}
49,50c49,59
- content=open(fpath).read()
- content=content.replace("\'","\\'")
---
+
+ content = ""
+ file = open(fpath)
+ for line in file.readlines():
+ line = line.replace("\'","\\'")
+ line = line.replace("\n","")
+ line = line.replace("\r","")
+ content += "'%s' +\n" % line
+
+ content += "''"
+
170c179
- oFCKeditor.Value = '%(content)s' ;
---
+ oFCKeditor.Value = %(content)s;
}}}