I am looking for a resource that can give me information on how to modify the link when a user adds a link to the page. Also looking for a resource that will allow me to modify the dialog box of the link to add a new textbox under the place where the user can enter information for google analytics that would be written to the a href line.
Fri, 06/24/2011 - 02:40
#1

Re: Adding Code to Link
http://nightly.ckeditor.com/7082/_samples/api_dialog.html
Re: Adding Code to Link
I have called my new tab GoogleAnalaytics and the text field GoogleAnalyticsField. I have added a loop to display all key/value pairs from the data object and do not see this new field within the object. Would I need to create a new function to have this new field and tab id to be apart of the data object inside of ckeditor?
Re: Adding Code to Link
Repopulating the textbox if the link is edited might be a bit more tricky, but not impossible though probably not necessary.
Re: Adding Code to Link
Re: Adding Code to Link
CKEDITOR.on( 'dialogDefinition', function( ev ) { // Take the dialog name and its definition from the event // data. var dialogName = ev.data.name; var dialogDefinition = ev.data.definition; // Check if the definition is from the dialog we're // interested on (the "Link" dialog). if ( dialogName == 'link' ) { ... etc.$().ready(function() { $(".googleLink").click(function() { recordOutboundLink($(this), 'Outbound Links', '/outgoing/http___www_example_com'); return false; }); });$().ready(function() { $(".googleLink").click(function() { recordOutboundLink($(this).attr("href")); return false; }); });$().ready(function() { $("a").click(function() { recordOutboundLink($(this).attr("href")); return false; }); });$().ready(function() { $("a").each(function() { if ($(this).attr("href").indexOf("example.com") != -1) { $(this).click(function() { recordOutboundLink($(this).attr("href")); return false; }); } }); });Re: Adding Code to Link
CKEDITOR.on ('dialogDefinition', function(ev) { var dialogName = ev.data.name; var dialogDefinition = ev.data.definition; if (dialogName == 'link') { var infoTab = dialogDefinition.getContents('info'); var urlField = infoTab.get('url'); urlField['default'] = 'www.example.com'; } dialogDefinition.addContents({ id: 'GoogleAnalytics', label: 'Google Analytics', elements : [{ id: 'GoogleAnalyticsField', type: 'text', label: 'Google Analytics'}] }); dialogDefinition.onFocus = function() { var urlField = this.getContentElement('info', 'url'); urlField.select(); }; });I have not looked at other ways to do this. I am taking a page that uses FCKeditor 2.2 and trying to upgrade it to CKEditor. In the FCKEditor origional page that was done in 2007 a person created this method which had some bugs and I am wanting to upgrade it to current technology. Even though a process might be more time consuming and a large learnign curve, I am all about knowledge. I love to take a current project and do the learning on it to fit current situation so that the knowledge can be used into the future.
In my html page, I do not have a function recordOutboundLink so in the mean time I will research what this is and see how I can use it for my current situation. I will also look at the JQuery part as I have done some stuff with JQuery but not alot.
Re: Adding Code to Link