~ubuntu-branches/ubuntu/saucy/moin/saucy

« back to all changes in this revision

Viewing changes to wiki/htdocs/applets/FCKeditor/fckeditor.lasso

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-11-13 16:45:52 UTC
  • mfrom: (0.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20081113164552-49t6zf2t2o5bqigh
Tags: 1.8.0-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop recommendation of python-xml, the packages isn't anymore in
    sys.path.

Show diffs side-by-side

added added

removed removed

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