I'm trying to figure out how I can convert a ckeditor plugin to an external plugin.
eg
The simple plugin “about”.
I Rename the folder to about2
I put in the folder about2 the file plugin.js and an icon about2.png
The code of the file plugin.js is:
(function () { var about2Cmd = { exec: function (editor) { editor.openDialog('about2'); return } }; CKEDITOR.plugins.add('about2', { requires: ['dialog'], init: function (editor) { var commandName = 'about2'; editor.addCommand(commandName, about2Cmd); editor.ui.addButton('About2', { label: "about2", command: commandName, icon: this.path + "about2.png" }); CKEDITOR.dialog.add(commandName, CKEDITOR.getUrl(this.path + 'dialogs/images/.js')) } }) })();
The code of the file about2.js is:
CKEDITOR.dialog.add('about2', function (a) { return { title: CKEDITOR.env.ie ? b.dlgTitle : b.title, minWidth: 390, minHeight: 230, contents: [{ id: 'tab1', label: '', title: '', expand: true, padding: 0, elements: [{ type: 'html', html: '<style type="text/css">.cke_about_container{color:#000 !important;padding:10px 10px 0;margin-top:5px}.cke_about_container p{margin: 0 0 10px;}.cke_about_container .cke_about_logo{height:81px;background-color:#fff;background-image:url(' + CKEDITOR.plugins.get('about').path + 'dialogs/logo_ckeditor.png);' + 'background-position:center; ' + 'background-repeat:no-repeat;' + 'margin-bottom:10px;' + '}' + '.cke_about_container a' + '{' + 'cursor:pointer !important;' + 'color:blue !important;' + 'text-decoration:underline !important;' + '}' + '</style>' + '<div class="cke_about_container">' + '<div class="cke_about_logo"></div>' + '<p>' + 'CKEditor ' + CKEDITOR.version + ' (revision ' + CKEDITOR.revision + ')<br>' + '<a href="http://ckeditor.com/">http://ckeditor.com</a>' + '</p>' + '<p>' + b.help.replace('$1', '<a href="http://docs.cksource.com/CKEditor_3.x/Users_Guide/Quick_Reference">' + b.userGuide + '</a>') + '</p>' + '<p>' + b.moreInfo + '<br>' + '<a href="http://ckeditor.com/license">http://ckeditor.com/license</a>' + '</p>' + '<p>' + b.copy.replace('$1', '<a href="http://cksource.com/">CKSource</a> - Frederico Knabben') + '</p>' + '</div>' }] }], buttons: [CKEDITOR.dialog.cancelButton] }; });
What is wrong?