I've created 2 new dialog plugins that insert data regarding RSS feeds and Google AdSense respectively. They simply create <rss attrib="value"> and <adsense attrib="value"> which is then parsed by a PHP script when the page is viewed. This part of the plugins works fine and the correct values are entered into the <rss> and <adsense> tags.
However the images for the <rss></rss> and <adsense></adsense> tags in the WYSIWYG mode only show if the source button is click twice (i.e. go to source mode and then back to Editor mode) and not initially as the editor loads up.
The plugins are modelled around how the flash dialog displays the flash logo.
The code is as follows.
FCKCommands.RegisterCommand( 'AdSense', new FCKDialogCommand( 'AdSense', FCKLang.AdSenseDlgTitle, FCKPlugins.Items['adsense'].Path + 'fck_adsense.html', 400, 350 ) ) ;
var oAdSenseItem = new FCKToolbarButton('AdSense', FCKLang['DlgAdSenseTitle']);
oAdSenseItem.IconPath = FCKPlugins.Items['adsense'].Path + 'adsense.gif' ;
FCKToolbarItems.RegisterItem( 'AdSense', oAdSenseItem ) ;
var FCKAdsenseProcessor = new Object();
FCKAdsenseProcessor.ProcessDocument = function(A)
{
var B = A.getElementsByTagName('ADSENSE');
var C;
var i = B.length - 1;
while (i >= 0 && (C = B[i--]))
{
var D = C.cloneNode(true);
D.setAttribute('google_ad_client', C.getAttribute('google_ad_client'));
var E = FCKDocumentProcessors_CreateFakeImage('FCK__Adsense', D);
E.setAttribute('_fckadsense', 'true', 0);
FCKAdsenseProcessor.RefreshView(E, C);
C.parentNode.insertBefore(E, C);
C.parentNode.removeChild(C);
};
};
FCKAdsenseProcessor.RefreshView = function(A, B)
{
if (B.width > 0)
A.style.width = FCKTools.ConvertHtmlSizeToStyle(B.width);
if (B.height > 0)
A.style.height = FCKTools.ConvertHtmlSizeToStyle(B.height);
};
FCKDocumentProcessors.addItem(FCKAdsenseProcessor);
Any assistance would be greatly appreciated.
P.S. and if you know to get a context menu to work with this code that would be an added bonus!
However the images for the <rss></rss> and <adsense></adsense> tags in the WYSIWYG mode only show if the source button is click twice (i.e. go to source mode and then back to Editor mode) and not initially as the editor loads up.
The plugins are modelled around how the flash dialog displays the flash logo.
The code is as follows.
FCKCommands.RegisterCommand( 'AdSense', new FCKDialogCommand( 'AdSense', FCKLang.AdSenseDlgTitle, FCKPlugins.Items['adsense'].Path + 'fck_adsense.html', 400, 350 ) ) ;
var oAdSenseItem = new FCKToolbarButton('AdSense', FCKLang['DlgAdSenseTitle']);
oAdSenseItem.IconPath = FCKPlugins.Items['adsense'].Path + 'adsense.gif' ;
FCKToolbarItems.RegisterItem( 'AdSense', oAdSenseItem ) ;
var FCKAdsenseProcessor = new Object();
FCKAdsenseProcessor.ProcessDocument = function(A)
{
var B = A.getElementsByTagName('ADSENSE');
var C;
var i = B.length - 1;
while (i >= 0 && (C = B[i--]))
{
var D = C.cloneNode(true);
D.setAttribute('google_ad_client', C.getAttribute('google_ad_client'));
var E = FCKDocumentProcessors_CreateFakeImage('FCK__Adsense', D);
E.setAttribute('_fckadsense', 'true', 0);
FCKAdsenseProcessor.RefreshView(E, C);
C.parentNode.insertBefore(E, C);
C.parentNode.removeChild(C);
};
};
FCKAdsenseProcessor.RefreshView = function(A, B)
{
if (B.width > 0)
A.style.width = FCKTools.ConvertHtmlSizeToStyle(B.width);
if (B.height > 0)
A.style.height = FCKTools.ConvertHtmlSizeToStyle(B.height);
};
FCKDocumentProcessors.addItem(FCKAdsenseProcessor);
Any assistance would be greatly appreciated.
P.S. and if you know to get a context menu to work with this code that would be an added bonus!

RE: New plugin image not initially shown
http://wiki.fckeditor.net/Developer%27s ... n/Plug-ins
RE: New plugin image not initially shown
The file where I defined FCK_AdSense is the
/FCKeditor/editor/css/fck_internal.css
file.
Like I said, my AdSense image IS shown after you press the SOURCE button twice.
RE: New plugin image not initially shown
http://wiki.fckeditor.net/Developer's_G ... ion/Styles
Re: New plugin image not initially shown
I'm very interesting in that sort of plug-in to add server-side variable content in a page and representing it by an image.
This way the content writer will "preview" the rendering code.
Thank's