annotate wiki/htdocs/applets/FCKeditor/fckeditor.lasso @ 4005:f5c322ae1c7b

add recent version of fckeditor 2.6.3
author Byeongweon [tasyblue@gmail.com]
date Mon, 11 Aug 2008 13:54:49 +0900
parents 6089ade226fb
children 07862b0663fd 1d37117f8ca6
rev   line source
3954
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
1 [//lasso
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
2 /*
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
4 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
5 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
6 * == BEGIN LICENSE ==
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
7 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
8 * Licensed under the terms of any of the following licenses at your
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
9 * choice:
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
10 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
11 * - GNU General Public License Version 2 or later (the "GPL")
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
12 * http://www.gnu.org/licenses/gpl.html
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
13 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
14 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
15 * http://www.gnu.org/licenses/lgpl.html
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
16 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
17 * - Mozilla Public License Version 1.1 or later (the "MPL")
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
18 * http://www.mozilla.org/MPL/MPL-1.1.html
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
19 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
20 * == END LICENSE ==
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
21 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
22 * This is the integration file for Lasso.
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
23 *
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
24 * It defines the FCKeditor class ("custom type" in Lasso terms) that can
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
25 * be used to create editor instances in Lasso pages on server side.
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
26 */
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
27
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
28 define_type(
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
29 'editor',
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
30 -namespace='fck_',
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
31 -description='Creates an instance of FCKEditor.'
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
32 );
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
33 local(
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
34 'instancename' = 'FCKEditor1',
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
35 'width' = '100%',
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
36 'height' = '200',
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
37 'toolbarset' = 'Default',
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
38 'initialvalue' = string,
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
39 'basepath' = '/fckeditor/',
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
40 'config' = array,
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
41 'checkbrowser' = true,
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
42 'displayerrors' = false
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
43 );
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
44
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
45 define_tag(
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
46 'onCreate',
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
47 -required='instancename', -type='string',
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
48 -optional='width', -type='string',
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
49 -optional='height', -type='string',
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
50 -optional='toolbarset', -type='string',
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
51 -optional='initialvalue', -type='string',
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
52 -optional='basepath', -type='string',
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
53 -optional='config', -type='array'
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
54 );
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
55 self->instancename = #instancename;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
56 local_defined('width') ? self->width = #width;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
57 local_defined('height') ? self->height = #height;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
58 local_defined('toolbarset') ? self->toolbarset = #toolbarset;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
59 local_defined('initialvalue') ? self->initialvalue = #initialvalue;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
60 local_defined('basepath') ? self->basepath = #basepath;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
61 local_defined('config') ? self->config = #config;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
62 /define_tag;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
63
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
64 define_tag('create');
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
65 if(self->isCompatibleBrowser);
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
66 local('out' = '
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
67 <input type="hidden" id="' + self->instancename + '" name="' + self->instancename + '" value="' + encode_html(self->initialvalue) + '" style="display:none" />
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
68 ' + self->parseConfig + '
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
69 <iframe id="' + self->instancename + '___Frame" src="' + self->basepath + 'editor/fckeditor.html?InstanceName=' + self->instancename + '&Toolbar=' + self->toolbarset + '" width="' + self->width + '" height="' + self->height + '" frameborder="0" scrolling="no"></iframe>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
70 ');
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
71 else;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
72 local('out' = '
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
73 <textarea name="' + self->instancename + '" rows="4" cols="40" style="width: ' + self->width + '; height: ' + self->height + '">' + encode_html(self->initialvalue) + '</textarea>
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
74 ');
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
75 /if;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
76 return(@#out);
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
77 /define_tag;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
78
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
79 define_tag('isCompatibleBrowser');
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
80 local('result' = false);
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
81 if (client_browser->Find("MSIE") && !client_browser->Find("mac") && !client_browser->Find("Opera"));
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
82 #result = client_browser->Substring(client_browser->Find("MSIE")+5,3)>=5.5;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
83 /if;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
84 if (client_browser->Find("Gecko/"));
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
85 #result = client_browser->Substring(client_browser->Find("Gecko/")+6,8)>=20030210;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
86 /if;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
87 if (client_browser->Find("Opera/"));
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
88 #result = client_browser->Substring(client_browser->Find("Opera/")+6,4)>=9.5;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
89 /if;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
90 if (client_browser->Find("AppleWebKit/"));
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
91 #result = client_browser->Substring(client_browser->Find("AppleWebKit/")+12,3)>=522;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
92 /if;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
93 return(#result);
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
94 /define_tag;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
95
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
96 define_tag('parseConfig');
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
97 if(self->config->size);
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
98 local('out' = '<input type="hidden" id="' + self->instancename + '___Config" value="');
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
99 iterate(self->config, local('this'));
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
100 loop_count > 1 ? #out += '&amp;';
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
101 #out += encode_html(#this->first) + '=' + encode_html(#this->second);
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
102 /iterate;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
103 #out += '" style="display:none" />\n';
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
104 return(@#out);
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
105 /if;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
106 /define_tag;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
107 /define_type;
6089ade226fb replace fckeditor with clean up version
Byeongweon [tasyblue@gmail.com]
parents:
diff changeset
108 ]