YAFLogo

francoz
  • francoz
  • 82.4% (Honored)
  • YAF Lover Topic Starter
9 years ago
I am using YAF 2.2.3 BETA 20150707

There is no way I can post a table from CKEditor HTML. Is it a problem of my version? Is there a way to use the old CKEditor I had on version 1.9?

Sponsor
Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader YAF Version: YAF 3.1.16
9 years ago

I am using YAF 2.2.3 BETA 20150707

There is no way I can post a table from CKEditor HTML. Is it a problem of my version? Is there a way to use the old CKEditor I had on version 1.9?

Originally Posted by: francoz 

I am not 100% on this, but I think you have to allow the table HTML tags. I'll see what I can find.

Edit. We can post tables with CKEditor HTML. We have to click Source and do it the long way though using the HTML tags.


<table><tbody><tr><td>Hello
</td><td>World
</td></tr>
<tr>
<td>stuff goes here
</td>
<td>
more stuff is placed here</td>
</tr></tbody></table>
francoz
  • francoz
  • 82.4% (Honored)
  • YAF Lover Topic Starter
9 years ago
Indeed working, but far from an acceptable solution for users who do not know html. Hope it will be fixed in future versions.
Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader YAF Version: YAF 3.1.16
9 years ago

Indeed working, but far from an acceptable solution for users who do not know html. Hope it will be fixed in future versions.

Originally Posted by: francoz 

You can add the Table option by editing the ckeditor_init.js file.

If you examine the code I copied below you will see I added the ['Table'], parameter right after Source.

File can be found here.

...\forum\scripts\ckeditor\ckeditor_init.js


jQuery(document).ready(function() {
    var yafCKEditor = jQuery('textarea.YafTextEditor').ckeditor({
        extraPlugins: 'autosave,bbcodehtml,syntaxhighlight,bbcodeselector,codemirror,textselection,wordcount',
        autosave_saveDetectionSelectors: "a[id*='_PostReply'],a[id*='Cancel']",
        toolbar: [
            ['Source'],
            ['Table'],
            ['Cut', 'Copy', 'Paste'], ['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'],
            ['-', 'NumberedList', 'BulletedList'],
            ['-', 'Link', 'Unlink', 'Image'],
            ['Blockquote', 'syntaxhighlight', 'bbcodeselector'],
            ['SelectAll', 'RemoveFormat'],
            ['About'],
            '/',
            ['Bold', 'Italic', 'Underline', '-', 'TextColor', 'Font', 'FontSize'],
            ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'PasteText', 'PasteFromWord'],
            ['Outdent', 'Indent']
        ],
        entities_greek: false,
        entities_latin: false,
        language: editorLanguage,
        contentsCss: 'Scripts/ckeditor/yaf_contents.css',
        codemirror:
        {
            mode: 'bbcodemixed'
        }
    });

    jQuery("a[id*='_PostReply'],a[id*='_Save']").click(function () {
        yafCKEditor.editor.updateElement();
    });

    yafCKEditor.editor.addCommand('highlight', {
        modes: { wysiwyg: 1, source: 1 },
        exec: function (editor) {
            var selection = editor.getSelection();
            if (!selection) {
                editor.insertHtml('[h]' + '[/h]');
            }
            var text = selection.getSelectedText();

            editor.insertHtml('[h]' + text + '[/h]');
        }
    });

    yafCKEditor.editor.addCommand('postmessage', {
        modes: { wysiwyg: 1, source: 1 },
        exec: function () {
            yafCKEditor.editor.updateElement();
            if (jQuery("a[id*='_PostReply']").length) {
                __doPostBack(jQuery("a[id*='_PostReply']").attr('id').replace('_', '$').replace('_', '$'), '');
            } else if (jQuery("a[id*='_Save']").length) {
                __doPostBack(jQuery("a[id*='_Save']").attr('id').replace('_', '$').replace('_', '$'), '');
            }
        }
    });
});
francoz
  • francoz
  • 82.4% (Honored)
  • YAF Lover Topic Starter
9 years ago
Tried this, but nothing changes. No button on the toolbar and no way to paste tables straight into the editor as it happened with YAF 1.9. Server rebooted after changes.

Have you tested this on your own install?

Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader YAF Version: YAF 3.1.16
9 years ago

Tried this, but nothing changes. No button on the toolbar and no way to paste tables straight into the editor as it happened with YAF 1.9. Server rebooted after changes.

Have you tested this on your own install?

Originally Posted by: francoz 

Yes. If you go to www.PackerPeople.com you can see it for yourself. You have to use the CKEditor HTML editor though.

francoz
  • francoz
  • 82.4% (Honored)
  • YAF Lover Topic Starter
9 years ago
Working on my forum, too.

Up to version 1.9.X you could paste an existing table into the editor, taking it from Excel, for example, and that was really a nice feature. Now there is a workaround, but not as nice. Can live with that, anyway.

francoz
  • francoz
  • 82.4% (Honored)
  • YAF Lover Topic Starter
8 years ago
Well, just to let everybody know that pasting tables from external apps (Excel, for example) straight into visual editor is now working on CK Editor HTML. Forum version 2.2.3.