Implement InsertLink

SVN revision: 1961
This commit is contained in:
Stefan Ritt 2007-11-07 21:33:12 +00:00
parent 4fe5ff024e
commit 76e068438a
3 changed files with 27 additions and 1 deletions

View File

@ -125,3 +125,27 @@ oInsertTimeCommand.GetState = function()
}
FCKCommands.RegisterCommand('InsertTime', oInsertTimeCommand);
/*---- 'InsertLink' ------------------------------------------------*/
// Create 'InsertLink' toolbar button
var oInsertLinkItem = new FCKToolbarButton('InsertLink', window.top.ELOGInsertLink, null, null, true, null, 34);
FCKToolbarItems.RegisterItem('InsertLink', oInsertLinkItem);
// Register 'InsertLink' command
var oInsertLinkCommand = new Object();
oInsertLinkCommand.Name = 'InsertLink';
oInsertLinkCommand.Execute = function()
{
linkText = prompt(window.top.ELOGLinkTextPrompt, '');
linkURL = prompt(window.top.ELOGLinkURLPrompt, 'http://');
// Get the editor instance that we want to interact with.
var oEditor = FCKeditorAPI.GetInstance('Text') ;
// Insert the desired HTML.
oEditor.InsertHtml('<a href="'+linkURL+'">'+linkText+'</a>');
}
FCKCommands.RegisterCommand('InsertLink', oInsertLinkCommand);

View File

@ -18,7 +18,7 @@ FCKConfig.ToolbarSets["Default"] = [
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['OrderedList','UnorderedList','-','Outdent','Indent'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
['Link','Unlink','Anchor'],
['InsertLink','Unlink','Anchor'],
['ELOGImage','Table','Rule','Smiley','SpecialChar','InsertTime'],
['Style','FontFormat','FontName','FontSize'],
['TextColor','BGColor'],

View File

@ -9564,6 +9564,8 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
rsprintf("var ELOGSubmitEntry = '%s';\n", loc("Submit entry"));
rsprintf("var ELOGInsertImage = '%s';\n", loc("Insert image"));
rsprintf("var ELOGInsertDateTime = '%s';\n\n", loc("Insert Date/Time"));
rsprintf("var ELOGLinkTextPrompt = '%s';\n\n", loc("Enter name of hyperlink"));
rsprintf("var ELOGLinkURLPrompt = '%s';\n\n", loc("Enter URL of hyperlink"));
rsprintf("function initFCKedit()\n");
rsprintf("{\n");
rsprintf(" var oFCKeditor = new FCKeditor('Text', '100%%', '500');\n");