[ Index ] |
|
Code source de FCKeditor 2.4 |
1 [//lasso 2 /* 3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net 4 * Copyright (C) 2003-2007 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 * File Name: fckeditor.lasso 23 * This is the integration file for Lasso. 24 * 25 * It defines the FCKeditor class ("custom type" in Lasso terms) that can 26 * be used to create editor instances in Lasso pages on server side. 27 * 28 * File Authors: 29 * Jason Huck (jason.huck@corefive.com) 30 */ 31 32 define_type( 33 'editor', 34 -namespace='fck_', 35 -description='Creates an instance of FCKEditor.' 36 ); 37 local( 38 'instancename' = 'FCKEditor1', 39 'width' = '100%', 40 'height' = '200', 41 'toolbarset' = 'Default', 42 'initialvalue' = string, 43 'basepath' = '/fckeditor/', 44 'config' = array, 45 'checkbrowser' = true, 46 'displayerrors' = false 47 ); 48 49 define_tag( 50 'onCreate', 51 -required='instancename', -type='string', 52 -optional='width', -type='string', 53 -optional='height', -type='string', 54 -optional='toolbarset', -type='string', 55 -optional='initialvalue', -type='string', 56 -optional='basepath', -type='string', 57 -optional='config', -type='array' 58 ); 59 self->instancename = #instancename; 60 local_defined('width') ? self->width = #width; 61 local_defined('height') ? self->height = #height; 62 local_defined('toolbarset') ? self->toolbarset = #toolbarset; 63 local_defined('initialvalue') ? self->initialvalue = #initialvalue; 64 local_defined('basepath') ? self->basepath = #basepath; 65 local_defined('config') ? self->config = #config; 66 /define_tag; 67 68 define_tag('create'); 69 if(self->isCompatibleBrowser); 70 local('out' = ' 71 <div> 72 <input type="hidden" id="' + self->instancename + '" name="' + self->instancename + '" value="' + encode_html(self->initialvalue) + '" style="display:none" /> 73 ' + self->parseConfig + ' 74 <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> 75 </div> 76 '); 77 else; 78 local('out' = ' 79 <div> 80 <textarea name="' + self->instancename + '" rows="4" cols="40" style="width: ' + self->width + '; height: ' + self->height + '">' + encode_html(self->initialvalue) + '</textarea> 81 </div> 82 '); 83 /if; 84 return(@#out); 85 /define_tag; 86 87 define_tag('isCompatibleBrowser'); 88 local('result' = true); 89 (client_browser >> 'Apple' || client_browser >> 'Opera' || client_browser >> 'KHTML') ? #result = false; 90 return(#result); 91 /define_tag; 92 93 define_tag('parseConfig'); 94 if(self->config->size); 95 local('out' = '<input type="hidden" id="' + self->instancename + '___Config" value="'); 96 iterate(self->config, local('this')); 97 loop_count > 1 ? #out += '&'; 98 #out += encode_html(#this->first) + '=' + encode_html(#this->second); 99 /iterate; 100 #out += '" style="display:none" />\n'; 101 return(@#out); 102 /if; 103 /define_tag; 104 /define_type; 105 ]
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 15:28:05 2007 | par Balluche grâce à PHPXref 0.7 |