我是一个完全的初学者,试图为FCKeditor开发,所以请容忍我这里。我的任务是开发一个自定义插件,允许用户浏览用户上传的一组特定图像。本质上,用户首先附加图像,然后使用FCKeditor插入这些图像。
我有我的插件目录:
我正在寻找一些关于自定义文件浏览器(让我们称之为mybrowser.asp)的策略的帮助。
1) mybrowser.asp应该在插件目录中吗?它是动态的,只适用于网站的一个特定区域。
2)如何将查询字符串传递给mybrowser.asp?
3)对于开发FCKeditor插件还有其他建议吗?任何可能对我有帮助的例子插件?
编辑:传递给插件页面的查询字符串将与主页上的查询字符串完全相同。(这是一个非常特殊的插件,只能在一个地方使用)
发布于 2008-10-13 17:16:15
除非您计划支持多种语言,否则不需要lang目录。但即使如此,我也会先让插件在一种语言中工作。
我可能会将mybrowser.asp放在插件目录中。
下面是一些fckplugin.js的代码,可以让您开始工作。
// Register the related command.
// RegisterCommand takes the following arguments: CommandName, DialogCommand
// FCKDialogCommand takes the following arguments: CommandName,
// Dialog Title, Path to HTML file, Width, Height
FCKCommands.RegisterCommand(
'MyBrowser',
new FCKDialogCommand(
'My Browser',
'Select An Image',
FCKPlugins.Items['MyBrowser'].Path + 'mybrowser.asp',
500,
250)
);
// Create the toolbar button.
// FCKToolbarButton takes the following arguments: CommandName, Button Caption
var button = new FCKToolbarButton( 'MyBrowser', 'Select An Image' ) ;
button.IconPath = FCKPlugins.Items['MyBrowser'].Path + 'img.png' ;
FCKToolbarItems.RegisterItem( 'MyBrowser', button ) ; 编辑:我还没有测试过这一点,但是您应该可以按照这些代码添加查询字符串。
'Select An Image',
FCKPlugins.Items['MyBrowser'].Path + 'mybrowser.asp' + window.top.location.search,
500, 发布于 2008-10-14 14:45:59
您可能不需要编写自己的文件浏览器,因为此功能是内置的。如果您检查fckconfig.js文件并搜索var _FileBrowserLanguage,您可以指定您的服务器语言,希望它在编辑器-> filemanager ->连接器文件夹中使用等效的文件。
如果你查一下文件,希望这会让你走上正确的轨道。
https://stackoverflow.com/questions/198279
复制相似问题