francoz
  •  francoz
  • 82.4% (Honored)
  • YAF Lover Topic Starter
2015-09-03T12:10:52Z
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
2015-09-03T12:12:08Z
Originally Posted by: francoz 

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?



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
2015-09-03T17:08:39Z
Indeed working, but far from an acceptable solution for users who do not know html. Hope it will be fixed in future versions.
Zero2Cool
2015-09-03T17:44:19Z
Originally Posted by: francoz 

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



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
2015-09-04T06:48:13Z
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
2015-09-04T13:20:23Z
Originally Posted by: francoz 

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?



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
2015-09-07T11:05:02Z
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
2016-08-23T07:23:05Z
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.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved