Opened 17 years ago
Closed 13 years ago
#2116 closed Bug (invalid)
MediaWiki and file links
Reported by: | Wiktor Walc | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Project : MediaWiki+FCKeditor | Version: | SVN (FCKeditor) - Retired |
Keywords: | Cc: | fwoelk@… |
Description
Source: http://www.fckeditor.net/forums/viewtopic.php?f=6&t=9289
we are using wiki extension FCKeditor 2.6 in media wiki 1.11.0 to edit the wiki text. The editor is working fine with just one exception. Because we don't want to upload all documents to the wiki, we link documents to our wiki pages with the following syntax:
<html><a href="file://servername/directoryname/documentname.doc" target="_blank">description</a></html>
After editing the page with FCKeditor the code is replaced by the editor with:
[file://servername/directoryname/documentname.doc description]
So the link doesn't work any more.
Attachments (5)
Change History (23)
comment:1 Changed 16 years ago by
Keywords: | Confirmed added |
---|
comment:2 Changed 16 years ago by
You have to add $wgUrlProtocols[] = "file:"; to your LocalSettings.php file. Here is the reference: http://meta.wikimedia.org/wiki/MediaWiki_FAQ#Is_it_somehow_possible_to_use_a_.22file.22_URI-qualifier_for_local_intranets_e.g._.5Bfile:.2F.2Flocalhost.2FC:_C-Drive.5D.3F
Also, I'm very close to completing a plugin for Mediawiki+FCKeditor which will allow you to do this easily. This will be my first contribution to this project so I'll need some direction as to who to talk to?
comment:3 Changed 16 years ago by
Sounds great!
You can create new ticket and attach a plugin here at dev.fckeditor.net. If you need any help, you may try to catch me at #fckeditor IRC channel at irc.freenode.net.
We can either add a link to your plugin at http://mediawiki.fckeditor.net or even include it in the package.
Also please feel free to email me directly:
wiktor AAA fckeditor DDD net (AAA = @, DDD = .)
comment:4 follow-up: 5 Changed 16 years ago by
I've attached the work I've been working on. I think it's ready for others to give it a bash. I've also attached a preview of what it looks like (on Linux).
Installation:
- Unzip the file into:
/wiki/extensions/FCKeditor/plugins/
- Edit /wiki/extensions/FCKeditor/fckeditor_config.js
Add to the top of the page:
FCKConfig.Plugins.Add("locallink", "en");
Add to your desired placement for the button
'Local_Link'
eg:
['Link','Unlink','Anchor','Local_Link'],
Let me know of any feedback/bugs/etc.
comment:5 follow-up: 6 Changed 16 years ago by
Hello conjur3r,
when installing the 'locallink' extension, I proceed as you comment in your install instructions.
However, when loading FCKeditor I get an error "Unknown item "Local_Link"" when loading the toolbars.
I have tried also to replace the " " by ' ' in both "LocalSetting.php" and "fckeditor_config.js" but it is still not working.
I have also set the extension to spanish (created a file es.js, which I attach, by translating your en.js), but I am getting the message always, regardless of the language set.
Therefore, although I have tried with all the possible combinations, my lines in LocalSettings.php now look like:
FCKConfig.Plugins.Add( 'locallink', 'es' ); ... $wgUrlProtocols = array( 'http://', 'https://', 'file:', 'ftp://', 'irc://', 'gopher://', 'telnet://', // Well if we're going to support the above.. -ævar 'nntp://', // @bug 3808 RFC 1738 'worldwind://', 'mailto:', 'news:' );
while fckeditor_config.js contains:
['Link','Unlink','Anchor','Local_Link'],
and fckplugin.js now contains:
// register the local link command FCKCommands.RegisterCommand( 'Local_Link', new FCKDialogCommand( FCKLang['DlgLocalLinkTitle'], FCKLang['DlgLocalLinkTitle'], FCKConfig.PluginsPath + 'locallink/dialogs/locallink.html', 500, 300 ) ); // create the local link toolbar button var objLocalLink = new FCKToolbarButton( 'Local_Link', FCKLang['DlgLocalLinkTitle'], null, FCK_TOOLBARITEM_ICONTEXT); objLocalLink.IconPath = FCKConfig.PluginsPath + 'locallink/images/locallink.gif'; FCKToolbarItems.RegisterItem('Local_Link', objLocalLink);
Thank you for your help.
Replying to conjur3r:
I've attached the work I've been working on. I think it's ready for others to give it a bash. I've also attached a preview of what it looks like (on Linux).
Installation:
- Unzip the file into:
/wiki/extensions/FCKeditor/plugins/
- Edit /wiki/extensions/FCKeditor/fckeditor_config.js
Add to the top of the page:
FCKConfig.Plugins.Add("locallink", "en");
Add to your desired placement for the button
'Local_Link'
eg:
['Link','Unlink','Anchor','Local_Link'],
Let me know of any feedback/bugs/etc.
comment:6 Changed 16 years ago by
Your LocalSettings.php file shouldn't have
FCKConfig.Plugins.Add( 'locallink', 'es' );
This line goes to the top of your fckeditor_config.js file.
As for the language file, I'll take a look at that shortly. I've already discovered one bit of text that isn't translatable :(
comment:7 follow-up: 8 Changed 16 years ago by
Sorry, I mistyped it.
That line is in fact in my fckeditor_config.js, together with the 'mediawiki' plugin already present.
Do I need to insert the line on the very top of my config file?
Thanks for the plugin.
comment:8 follow-up: 9 Changed 16 years ago by
Try putting that line to the top of the config file. That's where I have mine at present.
comment:9 Changed 16 years ago by
It was simply a file permissions problem. Now everything works perfect.
Ah, in the translation file es.js, please replace the string "File:" by "Archivo:", now I have it completely translated.
Thank you for your help.
Replying to conjur3r:
Try putting that line to the top of the config file. That's where I have mine at present.
comment:10 Changed 16 years ago by
Keywords: | Review? added |
---|
comment:11 follow-up: 12 Changed 16 years ago by
Hi,
I've installed the extension, and it's exactly what i need for an intranet-based wiki. But unfortunately it doesn't work.
I can add a filelink in FCK-Editor, but after saving the article (or switching to wikitext-view) the link is corrupt: The path to the file looks like "C:\directory\file.jpg", but the link points to "file:///file.jpg". I'm running MediaWiki 1.13.1 and the current FCKEditor extension.
Do you have any ideas how to solve this?
comment:12 Changed 16 years ago by
Replying to jdm:
Hi,
I've installed the extension, and it's exactly what i need for an intranet-based wiki. But unfortunately it doesn't work.
I can add a filelink in FCK-Editor, but after saving the article (or switching to wikitext-view) the link is corrupt: The path to the file looks like "C:\directory\file.jpg", but the link points to "file:///file.jpg". I'm running MediaWiki 1.13.1 and the current FCKEditor extension.
Do you have any ideas how to solve this?
Just a quick question: what browser have you tried in and on which operating system?
I'm on MW 1.12 so I can't confirm on MW 1.13.x
comment:13 Changed 16 years ago by
I've tested it on WindowsXP Pro and Firefox 3 and it doesn't work. After reading your post I tried it in Internet Explorer 7, and the links are being created correctly, so it seems there's a FF problem.
Here's what I learned about the problem so far: The updateParent() function in "childfile.html" extracts the filepath and name from the HTML-form. In IE everything works fine, in FF3 only the filename is read. I have currently no idea why this happens, i'll try to find a work-around in the next days...
comment:14 Changed 16 years ago by
I just gave it a test on XP and got a similar result with FF 3. It is fine with FF 2.x though. I noticed this happen in Opera 9.5 on linux as well.
I assume it is a security feature of the browsers to stop accidental leakage? I'm also hopeful there is a bypass method for firefox...
comment:15 Changed 16 years ago by
Keywords: | Review? removed |
---|
Could you attach sample content which doesn't work?
comment:16 Changed 16 years ago by
I just did find the reason for that behavior: It's a FF3 "feature" that was implemented for security reasons. See here: http://support.mozilla.com/tiki-view_forum_thread.php?locale=tr&comments_parentId=91513&forumId=1 and here: https://bugzilla.mozilla.org/show_bug.cgi?id=143220
@arczi: Just download and install the "locallink"-extension from above and try to create a link to a local file using FF3.
comment:17 Changed 16 years ago by
Cc: | fwoelk@… added |
---|
comment:18 Changed 13 years ago by
Resolution: | → invalid |
---|---|
Status: | confirmed → closed |
Since FCKeditor is no longer supported and was replaced with CKEditor, active development of the MediaWiki extension and support for it are also finished.
I’m closing this ticket as it is no longer valid.
Confirmed using MW 1.12 and the latest FCKeditor SVN extension.
To reproduce just add $wgRawHtml = true; in LocalSetting.php and paste in the above html code.