开发者

ZF & ckeditor. Icons are not loading. Got empty blocks instead of office-buttons

开发者 https://www.devze.com 2023-04-08 11:54 出处:网络
My directory root is \"Public\" as default in ZF. The default ZF htaccess also: RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR]

My directory root is "Public" as default in ZF.

The default ZF htaccess also:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

So editror works but without any icons. I see editor blocks, seems styles work too.

Why icons are not loading?

It stored in /public/js/editor/ckeditor.js.

Here my init code, its from example:

<script type="text/javascript">
        if ( window.CKEDITOR )
        {
                (function()
                {
                        var showCompatibilityMsg = function()
                        {
                                var env = CKEDITOR.env;

                                var html = '<p><strong>Your browser is not compatible with CKEditor.</strong>';

                                var browsers =
                                {
                                        gecko : 'Firefox 2.0',
                                        ie : 'Internet Explorer 6.0',
                                        opera : 'Opera 9.5',
                                        webkit : 'Safari 3.0'
                                };

                                var alsoBrowsers = '';

                                for ( var key in env )
                                {
                                        if ( browsers[ key ] )
                                        {
                                                if ( env[key] )
                                                        html += ' CKEditor is compatible with ' + browsers[ key ] + ' or higher.';
                                                else
                                                        alsoBrowsers += browsers[ key ] + '+, ';
                                        }
                                }

                                alsoBrowsers = alsoBrowsers.replace( /\+,([^,]+), $/, '+ and $1' );

                                html += ' It is also compatible with ' + alsoBrowsers + '.';

                                html += '</p><p>With non compatible browsers, you should still be able to see and edit the contents (HTML) in a plain text field.</p>';

                                var alertsEl = document.getElementById( 'alerts' );
                                alertsEl && ( alertsEl.innerHTML = html );
                        };

                        var onload = function()
                        {
                                // Show a friendly compatibility message as soon as the page is loaded,
                                // for those browsers that are not compatible with CKEditor.
                                if ( !CKEDITOR.env.isCompatible )
                                        showCompatibilityMsg();
                        };

                        // Register the o开发者_Go百科nload listener.
                        if ( window.addEventListener )
                                window.addEventListener( 'load', onload, false );
                        else if ( window.attachEvent )
                                window.attachEvent( 'onload', onload );
                })();
        }
    </script>


I had the same issue, I found the URL to the icons was ckeditor/plugins/icons.png when I navigated to that image director I got an error "The image cannot be displayed, because it contains errors"

I checked locally it worked.

For me the issues was in my FTP application I had changed the default file transfer mode from auto - to be ASCII. So it was uploading the png as though it was a text file instead of a Binary. Once I changed the transfer mode back to "Auto" everything worked.


I would recomend using FireBug (or similar tool) to check why the images aren't loading. If you look under the 'net' panel you can see weather the icons 404 (not found) or 403 (permissions).

0

精彩评论

暂无评论...
验证码 换一张
取 消