mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Implement InsertLink
SVN revision: 1961
This commit is contained in:
parent
4fe5ff024e
commit
76e068438a
@ -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);
|
||||
|
||||
@ -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'],
|
||||
|
||||
@ -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");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user