Hi, a make some progress with subj. but i have very small experience with coding for FCKeditor. I need some examples for 'fake image' insert and remove in to FCKeditor text area...
Now i have this (working) plugin for FCKeditor, but this insert only invisible <--break--> and <--pagebreak--> tags... Plugin need install (unpack) into modules/fckeditor/fckeditor/editor/plugins.
(file fckplugin.js)
// Define the command.
var FCKDrupal = function( name )
{
this.Name = name ;
this.EditMode = FCK.EditMode;
}
FCKDrupal.prototype.Execute = function()
{
switch ( this.Name )
{
case 'Break' :
var oBreak = FCK.InsertHtml('<!--break-->') ;
break;
case 'PageBreak' :
var oPageBreak = FCK.InsertHtml('<!--pagebreak-->') ;
break;
default :
}
}
FCKDrupal.prototype.GetState = function()
{
return FCK_TRISTATE_OFF ;
}
// Register the Drupal tag commands.
FCKCommands.RegisterCommand( 'DrupalBreak', new FCKDrupal( 'Break' ) ) ;
FCKCommands.RegisterCommand( 'DrupalPageBreak', new FCKDrupal( 'PageBreak' ) ) ;
// Create the Drupal tag buttons.
var oDrupalItem = new FCKToolbarButton( 'DrupalBreak', 'Break', null, FCK_TOOLBARITEM_ICONTEXT, true, true ) ;
oDrupalItem.IconPath = FCKConfig.PluginsPath + 'drupalbreak/drupalbreak.gif';
FCKToolbarItems.RegisterItem( 'DrupalBreak', oDrupalItem ) ;
var oDrupalItem = new FCKToolbarButton( 'DrupalPageBreak', 'PageBreak', null, FCK_TOOLBARITEM_ICONTEXT, true, true ) ;
oDrupalItem.IconPath = FCKConfig.PluginsPath + 'drupalbreak/drupalbreak.gif';
FCKToolbarItems.RegisterItem( 'DrupalPageBreak', oDrupalItem ) ;
Into modules/fckeditor/fckeditor.config.js needed (on the begining for me):
FCKConfig.Plugins.Add( 'drupalbreak' ) ;
and somewhere into toolbarset definition (for example):
FCKConfig.ToolbarSets["DrupalFull"] = [
['Source','DrupalBreak','DrupalPageBreak'],
...
Comments
Comment #1
ontwerpwerk commentedI love this plugin, it's a lot better than the one I tried in http://drupal.org/node/16137 ..
but I'm not really sure how I should handle it, is there a way to have those plugins live outside of the default FCKeditor plugins directory? that would make installation easier.
Comment #2
havran commentedHmm, plugins path is configurable.
I have created directory modules/fckeditor/plugins
Move drupalbreak plugin (directory) from modules/fckeditor/fckeditor/editor/plugins in to modules/fckeditor/plugins
And set
In file modules/fckeditor/fckedito.config.js
(PS: I attach version with new icons...)
Comment #3
ontwerpwerk commentedwill existing plugins still work, or do you have to copy them to your new plugins directory too?
Comment #4
ontwerpwerk commentedBy the way, I like the multiple pages icon :)
but I remember that that also requires an extra filter module http://drupal.org/project/paging .. please include that information in the readme.
Comment #5
havran commentedI make some progress, but...
I need check nodeValue == 'break' but (i think) FCKeditor replace nodeValue with his internal value (or something like that)...
Btw. i have 'stole' some original code from FCKeditor :)
Comment #6
ontwerpwerk commentedThis is helpful info for making plugins in second location than the default pluginspath
http://wiki.fckeditor.net/Developer%27s_Guide/Customization/Plug-ins
Comment #7
ontwerpwerk commentedI'll include a teaser button in the next version.
Comment #8
ray007 commentedSubscribing
Comment #9
igdrasil commentedthis code work this FCKEditor internal value:
Comment #10
ontwerpwerk commentedthat looks promising... but where does it fit in?
Comment #11
igdrasil commentedThis is only a small fix to the previous code fragment
Comment #12
lias commentedI've just experienced the fckeditor teaser problem but I'm not sure how to implement this plugin. Will this be rolled into a future version of fckeditor or as an addition? In the meantime, which part of the code should I use and how should it be installed?
Thanks for the clarification.
Lsabug
Comment #13
ontwerpwerk commentedthere is some experimental code in the current 5x dev release, but that really needs more testing, check the source if you are interested.
Comment #14
tangent commentedThe pagebreak button should not be included in this plugin. That would only be useful if the related drupal module is available and that's not a commonly used module. The related button should be in another plugin for that specific module.
Comment #15
tangent commentedThe break button should ensure that the
comment is never placed inside an html element. Allowing it to be placed inside a paragraph element, for example, will result in broken output in the teaser.
Comment #16
wwalc commentedPlugins for <!--break--> and <!--pagebreak--> tags have been rewritten. As of fckeditor 5.x-2.x, we have now two separate plugins for that tags.
Also, from now on, break tags should automatically move outside HTML elements.
Let me know if you have any problems with using it.
Comment #17
emackn commentedwhere are these plugins you speak of? :)
In the latest dev release of FCKEditor, http://drupal.org/node/16118/release
Comment #18
wwalc commentedIn fckeditor-5.x-2.x-dev.tar.gz package, plugins are placed inside fckeditor/plugins directory.
In fckeditor.config.js uncomment three lines to enable those two plugins:
[code]
//FCKConfig.PluginsPath = '../../plugins/' ;
//FCKConfig.Plugins.Add( 'drupalbreak' ) ;
//FCKConfig.Plugins.Add( 'drupalpagebreak' ) ;
[/code]
and remember to add 'DrupalBreak' and 'DrupalPageBreak' buttons to the toolbar
Note that the first line (FCKConfig.PluginsPath = '../../plugins/') sets the plugins path outside the default (fckeditor/fckeditor/editor/plugins) directory.
This is intended to avoid problems with FCKeditor upgrades (for example someone may delete FCKeditor directory, then upload newer version of FCKeditor and this way accidentically delete drupalbreak plugins)
So since 5.x-2.x, plugins path may (and should) be set to '../../plugins/' (which means "modules/fckeditor/plugins").
Comment #19
ayshe commented--deleted--
Comment #20
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #21
emanhossny commentedHello All,
actually, want to use this plugin, so i downloaded it & put it in the plugins folder of FCKeditor,
& i added to the fckcnfig.js an item in the default toolbar,
currently,i can see the break button in the toolbar of FCKeditor, but when i click on this button, it told me "Unknown command name "teaserbreak"",
can anyone help me in solving this problem?
Comment #22
wwalc commentedThis issue is about creating teasebreak plugins, please create new support request or bug report.
You have probably put the plugins into the wrong folder. The easiest way is to simply follow the README.txt. There is no need to move plugins at all, simply download the latest versions of FCKeditor module and FCKeditor and follow the instructions:
1. Open /drupal5/modules/fckeditor/fckeditor.config.js and uncomment these three lines:
FCKConfig.PluginsPath = '../../plugins/' ;
FCKConfig.Plugins.Add( 'drupalbreak' ) ;
FCKConfig.Plugins.Add( 'drupalpagebreak' ) ;
2. The second step is to add buttons to the toolbar (in the same file).
The button names are: DrupalBreak, DrupalPageBreak.
For example if you have a toolbar with an array of buttons defined as follows:
['Image','Flash','Table','Rule','SpecialChar']
simply add those two buttons at the end of array:
['Image','Flash','Table','Rule','SpecialChar', 'DrupalBreak', 'DrupalPageBreak']
Note that there is nothing about moving plugins.
Comment #23
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.