Developer forum

Forum » Development » Ckeditor extend - accecibility checker

Ckeditor extend - accecibility checker

Jan Sangill
Reply

 Hi,

In DW9 I need to test a plugin for ckeditor:
http://sdk.ckeditor.com/samples/accessibilitychecker.html - a11ychecker  

In my application this plugin have been added to the ckeditor plugin folder and its dependencies.
After that in my developer configuration ckeditor, I have added:
config.extraPlugins = 'a11ychecker';   

However, nothing is working or showing up. No extra options in the ckeditor. Its like its never loaded.

What am I missing?
 


Replies

 
Jan Sangill
Reply

bump. Any ideas?

 
Nicolai Pedersen
Reply

The a11ychecker is not distributed with DW9.

You would have to place the plugin in the folder \Admin\Editor\ckeditor\ckeditor\plugins or if it can be configured to have another location, place it there.

BR Nicolai

 
Jan Sangill
Reply

Hi Nikolai, I tried doing exactly this, and this didnt do the trick.
I added it to the plugin folder, added the appropriate code to the configiration I had.
No luck:(

 
Nicolai Pedersen
Reply

Check the JS console and see if that provides you something...

 
Jan Sangill
Reply

Hi Nikolai,

I did that ofc.

I have however debugged , and in the source of the pages I get this:

<script>
CKEDITOR.dtd.$removeEmpty['span'] = false;CKEDITOR.timestamp='12.54';CKEDITOR.defaulImageFolder='/Files/Images';function resizeEditor(){ } window.onresize = resizeEditor;
if (typeof CKEDITOR != 'undefined') {  CKEDITOR.replace('Indhold', {"language":"da-DK","width":"100%","height":"300","skin":"office2013","customConfig":"/Files/System/Editor/ckeditor/config/clean.js","extraPlugins":"internallink,linktofile,etags,fontawesome,codesnippet,widget,lineutils","baseFloatZIndex":800,"contentsCss":["/Admin/Resources/fonts/font-awesome/css/font-awesome.css",""],"allowedContent ":"true","stylesSet":"default:http://rksk.local.dynamicweb.dk/Admin/Editor/ckeditor/styles.ashx?url=%2fFiles%2fSystem%2fstyles.xml"});  CKEDITOR.instances['Indhold'].on('instanceReady', function(evt){ resizeEditor();if (parent.parent.right != undefined) {$(parent.parent.right.document).fire('shortcut:CKEditorLoaded'); }});
 var CKEditorEtagsUserCustomFields = null;
 CKEDITOR.on('dialogDefinition', CKEditorBrowse); }</script>

Notice the extraplugins. This means that whatever I put in my extraplugins, this wont work - I assume?

 

 

 
Nicolai Pedersen
Reply

Dunno...

Can you post your entire setup - the config page in MC and you config file?

 
Jan Sangill
Reply

What I can read from the source output:
You read in the config file (this case clean.js). In that config file I add my extraPlugins.
After that you overwrite the extraPlugins line, so the extraplugins I add in my config file would be overwritten by that.

This is in my clean.js (and attached is the Screenshot of the admin page):
 

CKEDITOR.editorConfig = function(config) {
    // Define changes to default configuration here.
    // For the complete reference:
    // http://docs.ckeditor.com/#!/api/CKEDITOR.config

    config.toolbar = [
        { name: 'document', items: ['Save','Source', '-', 'A11ychecker', 'NewPage', 'Preview', 'Print', '-', 'Templates'] },
        { name: 'clipboard', items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'] },
        { name: 'editing', items: ['Find', 'Replace', '-', 'SelectAll', '-', 'Scayt'] },
        { name: 'forms', items: ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'] },
        '/',
        { name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'CopyFormatting', 'RemoveFormat'] },
        { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl', 'Language'] },
        { name: 'links', items: ['Link', 'Unlink', 'Anchor'] },
        { name: 'insert', items: ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe', 'Youtube'] },
        '/',
        { name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize'] },
        { name: 'colors', items: ['TextColor', 'BGColor'] },
        { name: 'tools', items: ['Maximize', 'ShowBlocks'] },
        { name: 'about', items: ['About'] }
    ];

    config.extraPlugins = 'A11ychecker';

    config.filebrowserBrowseUrl = '/Admin/Editor/ckeditor/browser.aspx?type=link';
    config.filebrowserImageBrowseUrl = '/Admin/Editor/ckeditor/browser.aspx?type=image';
};

clean.png
 
Nicolai Pedersen
Reply

Hi Jan

Seems right - cannot answer what is wrong...

BR Nicolai

 
Jan Sangill
Reply

Hi Nicolai,

Am I not correct in stating that the issue might be how you add in the config for each textarea thats an editor, manually coded "extraPlugins" config - which will always ignore what I do in the config in Files/System itself?

Is there anywhere I might be able to add to core - so I can add to this line "extraPlugins":"internallink,linktofile,etags,fontawesome,codesnippet,widget,lineutils" ?

 
Nicolai Pedersen
Reply

If you have seen something, let me know.

To the best of knowledge all we do is loading those config files.

 
Jan Sangill
Reply

Hi Nikolai,
This is how I can get a new plugin working in CKeditor as of now:
See the script below. When this is placed in the bottom of : ParagraphEdit.aspx and ItemEdit.apsx I get it working

However, I have issues getting it working with for example: ItemListEdit.aspx (Get a jascript error on filter when I try to destroy the instance for some reason.)

What I do, is basically, I take the dynamic code you load on pageload for the ckeditor, and all I do is detroy the current loaded editors and reload it with the a11ychecker in extraplugins.

it would be ideal, if I didnt have to hack the core, for adding plugins to ckeditor. Is there any way this can be looked at, and in the future possible?

<script src="/Admin/Resources/js/jquery-2.1.1.min.js"></script>
<script>
   var $j = jQuery.noConflict();
   (function () {
      var editorsToReplace       = ["ParagraphText", "Content", "Indhold"];
      var editorsToReplaceLenght = editorsToReplace.length;
      for (i = 0; i < editorsToReplaceLenght; i++) {
         replaceEditorConfig(editorsToReplace[i]);
      }
   })();

   //method to reset editor for new plugin
   function replaceEditorConfig(name) {

      if (typeof CKEDITOR != 'undefined') {

         //get instance of editor
         var editor = CKEDITOR.instances[name];

         if (editor) {

            //destroy editor
            editor.destroy(true);

            //reset configts
            CKEDITOR.dtd.$removeEmpty['span'] = false;
            CKEDITOR.timestamp                = '12.54';
            CKEDITOR.defaulImageFolder        = '/Files/Images';
            function resizeEditor() {
            }

            window.onresize = resizeEditor;

            CKEDITOR.replace(name, {
                  "language"                               : "da-DK",
                  "width"                                  : "100%",
                  "height"                                 : "100%",
                  "skin"                                   : "office2013",
                  "extraPlugins"                           : "a11ychecker,internallink,linktofile,etags,fontawesome,codesnippet,widget,lineutils",
                  "baseFloatZIndex"                        : 800,
                  "contentsCss": [
                     "/Admin/Resources/fonts/font-awesome/css/font-awesome.css",
                     "/Admin/Public/EditorStylesheet.aspx?Stylesheet=https%3a%2f%2ffonts.googleapis.com%2fcss%3ffamily%3dOpen%2bSans%3a400%2c700%2chttps%3a%2f%2ffonts.googleapis.com%2fcss%3ffamily%3dBitter%3a400%2c700%2c%2fFiles%2fTemplates%2fDesigns%2frksk%2fcss%2fstyles.css%3fv%3d20170508%2c%2f%2fcustomer.cludo.com%2fcss%2f65%2f76%2fcludo-search-new.min.css"
                  ], "allowedContent ": "true", "stylesSet": "default:http://xxxx.dynamicweb.dk/Admin/Editor/ckeditor/styles.ashx?url=%2fFiles%2fSystem%2fstyles.xml"
               }
            );
            CKEDITOR.instances[name].on('instanceReady', function (evt) {
               resizeEditor();
               if (parent.parent.right != undefined) {
                  $(parent.parent.right.document).fire('shortcut:CKEditorLoaded');
               }
            });
            var CKEditorEtagsUserCustomFields = null;
            CKEDITOR.on('dialogDefinition', CKEditorBrowse);
         }

      }
   }
</script>

 

 
Jonathan Pascoe
Reply

Hi,  I have the same problem when trying to add a custom plugin or custom style sheet. If i edit the editors config file that is specified in the Editor settings in admin i can change the config of the editor, for example add or remove buttons but  config.extraPlugins or css  paramaters seem to be ignored! There are no errors in the console or network It just does not pick up the changes. Any news on how this can be achieved without hacking the Source code

 
Jan Sangill
Reply
This post has been marked as an answer

In the editor config in admin: ther eis a field: Extra plugins. Add it there.  My example was: a11ychecker,balloonpanel

Votes for this answer: 1
 
Jonathan Pascoe
Reply

Thanks, I thought i tried that frown  Any way that did the trick. But it would be nice to be able to actually use the config file :) Thanks again.

 

You must be logged in to post in the forum