I have installed FCKeditor and LFO plugin. I can open file and save it. However, there is no place on the editor to show the current file name and sometimes it is hard to remember the file name during editing.
Can anyone please show me how to setup or I need any plugin?
Thanks!
Roger
Can anyone please show me how to setup or I need any plugin?
Thanks!
Roger
RE: Show current file name on editor.
However, since I am not good in coding, can you put the code together for me? I am willing to pay you back, please let me know.
Thanks!
Roger
RE: Show current file name on editor.
The LFO plugin stores the filename of the last opened file in FCKConfig.CurrentWorkingFile. An idea is to set the filename to be the tooltip of the LFO 'open file' icon. To set a tooltip of toolbar icons, see my 'HOWTO - hide/show a toolbar button':http://sourceforge.net/forum/forum.php?thread_id=1734452&forum_id=257179 . At the bottom of the second post it tells you how to reach the image of a toolbar button. When you have the image, you can set the tooltip like image.title = image.alt = 'new tooltip';
RE: Show current file name on editor.
And it's too complex to mess with the buttons when it's far easier to put a span before the editor or even change the whole document title. That's unobtrusive and would take just a pair of lines in the LFO plugin.
RE: Show current file name on editor.
The code is described in my HOWTOs so that shouldn't be a problem, but it could be not that user friendly indeed. That depends on who's using it and how much you want the filename to be visible. Changing the webpage its title is a good idea though.
You can use any button http://www.saulmade.nl/FCKeditor/FCKPlugins.php (just above the demo below on the page) or go to paypal.com and send something to mail a*t saulmade.nl .
That would be document.title = FCKConfig.CurrentWorkingFile;
You can put that line below (really below) 'SetFileName( sFileName ) ;' in 'LFO_GetFile.html' which should be on line 212.
And toughman168 should you want to say thank you, try paypal
RE: Show current file name on editor.
I instered "document.title = FCKConfig.CurrentWorkingFile;" to the 'LFO_GetFile.html' file and added the followings to my file called editor.php.
function toggleButton(editorInstance, itemName)
{
toolbarButton = editorInstance.EditorWindow.parent.FCKToolbarItems.LoadedItems[itemName]._UIButton.MainElement;
if (toolbarButton.style.display == 'none')
{
toolbarButton.style.display = 'block';
}
else
{
toolbarButton.style.display = 'none';
}
}
plus toolbarButton.getElementsByTagName('IMG')[0]
but, nothing happened.
What did I do wrong?
Thanks.
RE: Show current file name on editor.
Or what is it you want to do now? Where do you want to filename to appear?
RE: Show current file name on editor.
I did, but nothing happened.
Where can I see the file name?
Do I need to add the other codes to display the file name? (Any place will be OK, if I need to select the location to display.)
Thank you again.
RE: Show current file name on editor.
RE: Show current file name on editor.
I really don't know what can be the problem?
RE: Show current file name on editor.
Woops, forgot that we're in a dialog, the line needs to be:

FCK.EditorWindow.top.document.title = FCKConfig.CurrentWorkingFile;
or when you only want the filename to appear, use:
FCK.EditorWindow.top.document.title = FCKConfig.CurrentWorkingFile.match(/[^\/]*$/)[0];
And as always, what about paypaul
RE: Show current file name on editor.
Could it be something else? Do I have to do anything with my editor program?
Thanks!
RE: Show current file name on editor.
RE: Show current file name on editor.
It is not in a frame.
Sorry, I have the program for my company web page and can't release it to people outside our company.
Do you mind give me your "demo" and I might be able to figure out the differences.
Thanks!
RE: Show current file name on editor.
Goto http://www.saulmade.nl/FCKeditor/FCKPlugins.php click the open file button > Browse Server > select '_testForFCKeditor.html' > click OK and select any part of the file.
Now look at the browser's title, it should read '/FCKeditor/_testForFCKeditor.html'
If you don't see it, clear or disable your cache. If you still don't see it after that, you're looking at the wrong place. Just contact me back then.
Re: Show current file name on editor.
I'm using AjaxSave and I want to stick the filename in a hidden form field so I can submit that information with the form it is in. I made it a text box just so I could see if it changes.
I can't get it to work after trying everything I could think of.
FCK is loaded in a div called 'content' and I am using the LFO plugin.
When I put
alert(FCKConfig.CurrentWorkingFile);
on line 212 after
SetFileName( sFileName ) ;
in file 'LFO_GetFile.html' the alert pops up with the filename no problem.
When I try to set the text box named 'filename' the same way, nothing happens?
I even tried you example of changing the document's title to the current filename
FCK.EditorWindow.top.document.title = FCKConfig.CurrentWorkingFile;
and that won't even work either.
Is there something special I have to do because the editor is in a div?
I've tried and tried and can't figure this out.
Any help would be really really really appreciated.
Thank you in advance.