new WYSIWYG-Editor event Plugin: CKEDITOR!

Creating and modifying plugins.
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by Timbalu »

What about the embedded question? Or do your plugins not live in your blogs plugins directory?

In the ckeditor config you should have something like this:
rel path: plugins/serendipity_event_ckeditor/ckeditor/
HTTP path: /serendipity/plugins/
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
ICE
Regular
Posts: 240
Joined: Tue Jun 28, 2005 11:15 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by ICE »

My blog is a completely normal blog, without embedding or other odd configurations.

rel path: plugins/serendipity_event_ckeditor/ckeditor/
HTTP path: /plugins/

My full Document root path is: /cold-ice/blog/plugins/serendipity_event_ckeditor
My Domain cold-ice.de is rooted into /cold-ice/blog/ , which means, cold-ice.de sees only the directory /cold-ice/blog as /
Last edited by ICE on Wed Aug 07, 2013 8:15 pm, edited 1 time in total.
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by Timbalu »

Yes, very strange!
Please paste some source code of backends entry forms page, eg this part (start 2 stop):

Code: Select all

    <script type="text/javascript">
        CKEDITOR.replace('serendipity[body]', {});
// everything here until
    </script>
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
ICE
Regular
Posts: 240
Joined: Tue Jun 28, 2005 11:15 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by ICE »

Code: Select all

    <script type="text/javascript">
        CKEDITOR_BASEPATH   = 'plugins/serendipity_event_ckeditor/ckeditor/';
        CKEDITOR_PLUGPATH   = '/plugins/';
        KCFINDER_UPLOADPATH = '/uploads/';
    </script>
    <script language="javascript" type="text/javascript" src="plugins/serendipity_event_ckeditor/ckeditor/ckeditor.js"></script>
    <script type="text/javascript">
        CKEDITOR.config['skin'] = 'moono';
        CKEDITOR.config['height'] = 400;
        //CKEDITOR.config.removePlugins = 'flash,iframe';
        CKEDITOR.config.allowedContent = false;
        CKEDITOR.config.removeButtons = 'Styles';
        CKEDITOR.config.toolbarGroups = [
            { name: 'styles' },
            { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
            { name: 'paragraph', groups: [ 'list', /*'indent', */'blocks', 'align', 'bidi' ] },
            { name: 'links' },
            { name: 'insert' },
            '/',
            { name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
            { name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
            { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
            { name: 'others' },
            { name: 'mediaembed' },
            { name: 'tools' },
            { name: 'about' }
        ];
    </script>

Code: Select all

    <script type="text/javascript">
        CKEDITOR.replace('serendipity[body]', {});
    </script>

            
    <script type="text/javascript">
        CKEDITOR.replace('serendipity[extended]', {});
    </script>

        
    <script type="text/javascript">
        CKEDITOR.on( 'instanceReady', function( event ) {
            event.editor.on( 'focus', function() {
                //console.log( 'focused', this );
                isinstance = this;
            });
        });

        function Spawnnuggets(item) {
            if (document.getElementById('nuggets' + item)) {
                CKEDITOR.replace('nuggets' + item, {
                    // Reset toolbar Groups settings
                    // toolbarGroups: null
                });
            }
        }

        function serendipity_imageSelector_addToBody (str, textarea) {
            var oEditor = isinstance; // WHOW this was easy...!!!!
            //console.log(oEditor);
            if (oEditor.mode == "wysiwyg") {
                oEditor.insertHtml(str);
            } 
        }
    </script>
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by Timbalu »

You definitely found a bug! :oops: Thank you!
Why in hell didn't we notice this before...!
Total sorry, I always tested this in extended hooked-in views only, since starting this plugin officially.

Now we will have to do it this way:
Wait until our sync will work again, to get an updated 1.3.1 next week via Spartacus.
If you have already the 1.3.1 version, just replace serendipity_event_ckeditor.php with this file:
https://raw.github.com/s9y/additional_p ... editor.php

PS. @ICE, could you downsize you pasted images to fit into a standard or smaller screen view, please? Thanks!
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
ICE
Regular
Posts: 240
Joined: Tue Jun 28, 2005 11:15 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by ICE »

Okay, now it had changed ... but not similar with your screenshot:
Attachments
Einträge - Serendipity Verwaltungsoberfläche(2).png
Einträge - Serendipity Verwaltungsoberfläche(2).png (16.91 KiB) Viewed 9606 times
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by Timbalu »

Does that evening never end... :wink:

Again, paste the code part (and this only)

Code: Select all

        <script type="text/javascript">
            CKEDITOR.replace('serendipity[body]', {});
...everything IN here, until this ending...
        </script>
Now this lacks to be the right file path
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
ICE
Regular
Posts: 240
Joined: Tue Jun 28, 2005 11:15 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by ICE »

sorry ... :oops:

Code: Select all

<script type="text/javascript">
        CKEDITOR.replace('serendipity[body]', {});
        CKEDITOR.config.extraPlugins = 'entryformsbody,mediaembed'; // no spaces allowed!
        CKEDITOR.plugins.add('entryformsbody', {
            init: function(editor) {
                editor.addCommand( 'openML', {
                    exec : function( editor ) {
                        window.open('serendipity_admin_image_selector.php', 'ImageSel', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1');
                    }
                });
                editor.ui.addButton('openML', {
                    label:   'S9yMedia',
                    title:   'Serendipity Media Library',
                    command: 'openML',
                    icon: 'http://www.cold-ice.de/index.php?/plugins/serendipity_event_ckeditor/img/mls9y.png'
                });
            }
        });
    </script>
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by Timbalu »

That is odd!
Please change this line here
https://github.com/s9y/additional_plugi ... r.php#L395
to this:

Code: Select all

                    icon: '<?php echo ($serendipity['rewrite'] == 'rewrite' ? serendipity_rewriteURL('plugins/serendipity_event_ckeditor/img/mls9y.png') : 'plugins/serendipity_event_ckeditor/img/mls9y.png'); ?>'
This is for testing purposes only, since we have more occurrences of the serendipity_rewriteURL() usage. This does not seem to fit in plugins as everywhere else. And I do not know if this tweak fits both 'none' and 'errormode'.

Which is your personal MOD REWRITE setting in the Serendipity Configuration - Design and Options?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
ICE
Regular
Posts: 240
Joined: Tue Jun 28, 2005 11:15 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by ICE »

Sorry, was to fast ...

URL Rewriting is off in Settings.

Nevertheless, it does not show the icon ...

Code: Select all

    <script type="text/javascript">
        CKEDITOR.replace('serendipity[body]', {});
        CKEDITOR.config.extraPlugins = 'entryformsbody,mediaembed'; // no spaces allowed!
        CKEDITOR.plugins.add('entryformsbody', {
            init: function(editor) {
                editor.addCommand( 'openML', {
                    exec : function( editor ) {
                        window.open('serendipity_admin_image_selector.php', 'ImageSel', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1');
                    }
                });
                editor.ui.addButton('openML', {
                    label:   'S9yMedia',
                    title:   'Serendipity Media Library',
                    command: 'openML',
                    icon: 'plugins/serendipity_event_ckeditor/img/mls9y.png'
                });
            }
        });
    </script>
ICE
Regular
Posts: 240
Joined: Tue Jun 28, 2005 11:15 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by ICE »

Ah, if I change URL Rewriting to apache mod_replace, then it works!!! If it is disabled, then the icon disappears.

Code: Select all

    <script type="text/javascript">
        CKEDITOR.replace('serendipity[extended]', {});
        CKEDITOR.config.extraPlugins = 'entryformsextended,mediaembed'; // no spaces allowed!
        CKEDITOR.plugins.add('entryformsextended', {
            init: function(editor) {
                editor.addCommand( 'openML', {
                    exec : function( editor ) {
                        window.open('serendipity_admin_image_selector.php', 'ImageSel', 'width=800,height=600,toolbar=no,scrollbars=1,scrollbars,resize=1,resizable=1');
                    }
                });
                editor.ui.addButton('openML', {
                    label:   'S9yMedia',
                    title:   'Serendipity Media Library',
                    command: 'openML',
                    icon: 'http://www.cold-ice.de/plugins/serendipity_event_ckeditor/img/mls9y.png'
                });
            }
        });
    </script>
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by Timbalu »

Sorry my fault! It should be:

Code: Select all

                    icon: '<?php echo ($serendipity['rewrite'] == 'rewrite' ? serendipity_rewriteURL('plugins/serendipity_event_ckeditor/img/mls9y.png') : $serendipity['serendipityHTTPPath'] . 'plugins/serendipity_event_ckeditor/img/mls9y.png'); ?>'
Could you please check for me, if this is also working with: "Use apache errohandling" too?
I'll check this tomorrow then, to update all occurrences properly.

Sorry for this late night scripting! :)
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
ICE
Regular
Posts: 240
Joined: Tue Jun 28, 2005 11:15 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by ICE »

no problem, CKEditor is great!

The icon appears in every situation (disabled, errorhandling, mod_rewrite).

Now I'm happy! It's a new blogging feeling! Thanks for your help!
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by Timbalu »

Fine! Thanks for testing.
I'll do that tomorrow.

Good night!
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
ICE
Regular
Posts: 240
Joined: Tue Jun 28, 2005 11:15 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by ICE »

Good night!
Post Reply