diff --git a/scripts/fckeditor/editor/plugins/elog/fckplugin.js b/scripts/fckeditor/editor/plugins/elog/fckplugin.js index 9890d832..786609bf 100644 --- a/scripts/fckeditor/editor/plugins/elog/fckplugin.js +++ b/scripts/fckeditor/editor/plugins/elog/fckplugin.js @@ -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(''+linkText+''); +} + +FCKCommands.RegisterCommand('InsertLink', oInsertLinkCommand); diff --git a/scripts/fckeditor/fckelog.js b/scripts/fckeditor/fckelog.js index ee517863..3f9904da 100644 --- a/scripts/fckeditor/fckelog.js +++ b/scripts/fckeditor/fckelog.js @@ -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'], diff --git a/src/elogd.c b/src/elogd.c index d376701a..fbecaf14 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -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");