Note that there are some explanatory texts on larger screens.

plurals
  1. POCustomising CKEditors Link Plugin
    text
    copied!<p>I am editing the link plugin to allow staff to select links to internal content. I have managed to add another tab to the link plugin dialog with a text input with an onKeyup event. The idea is, when they type it will list the results below where they can select the link they want. Once selected I was just going to update the info tab with the url and protocol.</p> <p>Here is my code sections from the existing link plugin</p> <pre><code>.... .... //Should update info tab with value function AddLink(txtLink) { var dialog = this.getDialog(); dialog.setValueOf('info', 'url', txtLink); dialog.setValueOf('info', 'protocol', ''); } //called when the user types in the search box. currently just uses text for basic testing var searchBoxChanged = function () { var dialog = this.getDialog(); var href = $(this).attr('href'); var txt = dialog.getValueOf('article', 'searchWords'); $('#searchResults').html("&lt;a href=\"JavaScript:AddLink('/Article/View/" + txt + "')\"&gt;Test Title&lt;/a&gt;"); } .... .... { //Adds extra tab to the link plugin for custom link searching id: 'article', label: linkLang.article, title: linkLang.article, elements: [ { type: 'text', id: 'searchWords', label: linkLang.articleSearch, style: 'height:40px', size: 29, onKeyUp: searchBoxChanged }, { type: 'html', html: '&lt;div id="searchResults"&gt;Please start tying to get results&lt;/div&gt;' } ] } .... .... </code></pre> <p>t the moment I am just using some basic static data from the textbox. The link in creating on the page ok, but when it is clicked I get the error:</p> <blockquote> <p>CRIPT5009: 'AddLink' is undefined</p> </blockquote> <p>Can anyone shed some light on where I am going wrong?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload