Re: another CKEditor filter

dirkdigweed wrote:

I just wanted to point out, not to forget to output the title of the wolf_pages plugin in ENT_COMPAT-Mode, otherwise, the js array (means the whole dialog execution  of ckeditor!!) will be broken, if title with a single or double quote in this field exist!

Since this involves a single file, I prefer to post a fix here than make you redownload the whole plugin, which is a little heavy(ckeditor and filemanager files are included).

Edit 'views/wolf_plugins/wolf_pages/list-php' and leave this:

<?php if(isset($pages)): ?>
<?php $l = count($pages); ?>
CKFilter.wolfpages = {
  protocol: '<?php echo (USE_HTTPS) ? 'https://': 'http://'; ?>',
  items: [
    ['',''],
<?php for($i = 0; $i<$l; $i++): ?>
    ["<?php echo addslashes($pages[$i]['title']); ?>", '<?php echo $pages[$i]['url']; ?>']<?php if($i<$l-1) { echo ','; } ?>

<?php endfor; ?>
  ]
};
<?php endif; ?>

Thumbs up

27

Re: another CKEditor filter

Did some tests at home. Here, the browse button works on FF 10, but it's on Mac. I'll do a clean install on Win as it seems that my install was in a mess or had some interference with other plugins.

Wolf CMS Paper Guy
Wolf CMS related blog / journal at Project 79 | Wolf CMS Docs

28

Re: another CKEditor filter

Just tested this plugin on a clean 0.7.5 install in:

IE8: works
FF10: works
Chrome latest version: works

Only thing I mentioned was in Safari 5.1.2, the plugin works but when you insert a picture from the file manager into a post and save the page, it returns "Invalid CSRF token". When you resave a second time it works correctly...

Last edited by Apache (2012-02-02 03:51)

Thumbs up

29

Re: another CKEditor filter

Apache wrote:

Just tested this plugin on a clean 0.7.5 install in:

IE8: works
FF10: works
Chrome latest version: works

Only thing I mentioned was in Safari 5.1.2, the plugin works but when you insert a picture from the file manager into a post and save the page, it returns "Invalid CSRF token". When you resave a second time it works correctly...

Got a message "Please upload only images, no other files are supported." when I try to upload a pdf file through the file manager. "Allow users to upload files other than images?" is set on "Yes" in the settings. Is this a known issue or did I forget something? "Max upload file size" is set on zero MB (use the server's setting).

Just testing some plugins on a clean install 0.7.5.

Thumbs up

Re: another CKEditor filter

To be honest, I didn't test that option until now.

The thing is, you are launching the filebrowser from the 'Image' dialog, so the only files it will allow to upload are images and accept the format you defined in your settings.

I didn't know this, so it's my fault for including the option in the settings.

Thumbs up

Re: another CKEditor filter

Ok, found it

Edit 'views/filter/public/ckeditor_config.php' and leave the filemanager settings like:

<?php if($settings['filemanager_enabled']): ?>
        filebrowserRoot : "<?php echo $settings['filemanager_root']; ?>",
        filebrowserBrowseUrl : CKFilter.paths.filemanager,
        filebrowserImageBrowseUrl : CKFilter.paths.filemanager + '?type=Images',
        filebrowserFlashBrowseUrl : CKFilter.paths.filemanager + '?type=Flash',
<?php endif;?>

now a 'Browse Server' button will be added in the 'Link' dialog, where you'll be able to upload other files.

Do you guys think this should added by default?

Addendum:
Instead of the above, use the following and the 'Browse server' button will be added to the link managed depending on the setting 'Allow users to upload files other than images':

<?php if($settings['filemanager_enabled']): ?>
        filebrowserRoot : "<?php echo $settings['filemanager_root']; ?>",
<?php if($settings['filemanager_upload_images_only'] == '0' ): ?>
        filebrowserBrowseUrl : CKFilter.paths.filemanager,
<?php endif; ?>
        filebrowserImageBrowseUrl : CKFilter.paths.filemanager + '?type=Images',
        filebrowserFlashBrowseUrl : CKFilter.paths.filemanager + '?type=Flash',
<?php endif;?>

Last edited by andrewmman (2012-02-02 21:27)

Thumbs up +2

32

Re: another CKEditor filter

andrewmman wrote:

Ok, found it

Edit 'views/filter/public/ckeditor_config.php' and leave the filemanager settings like:

<?php if($settings['filemanager_enabled']): ?>
        filebrowserRoot : "<?php echo $settings['filemanager_root']; ?>",
        filebrowserBrowseUrl : CKFilter.paths.filemanager,
        filebrowserImageBrowseUrl : CKFilter.paths.filemanager + '?type=Images',
        filebrowserFlashBrowseUrl : CKFilter.paths.filemanager + '?type=Flash',
<?php endif;?>

now a 'Browse Server' button will be added in the 'Link' dialog, where you'll be able to upload other files.

Do you guys think this should added by default?

Addendum:
Instead of the above, use the following and the 'Browse server' button will be added to the link managed depending on the setting 'Allow users to upload files other than images':

<?php if($settings['filemanager_enabled']): ?>
        filebrowserRoot : "<?php echo $settings['filemanager_root']; ?>",
<?php if($settings['filemanager_upload_images_only'] == '0' ): ?>
        filebrowserBrowseUrl : CKFilter.paths.filemanager,
<?php endif; ?>
        filebrowserImageBrowseUrl : CKFilter.paths.filemanager + '?type=Images',
        filebrowserFlashBrowseUrl : CKFilter.paths.filemanager + '?type=Flash',
<?php endif;?>

Great like this! Works like a charm.

Thumbs up

33

Re: another CKEditor filter

Do add this as a default. Besides images, the common users like .pdf's a lot smile

Wolf CMS Paper Guy
Wolf CMS related blog / journal at Project 79 | Wolf CMS Docs

Re: another CKEditor filter

New update,

now sites without mod_rewrite are supported.

All issues discussed in here are fixed.

Link in first post.

p.s:

I encourage developers to tweak the 'scripts/user/config.js' and adjust it to their needs. The toolbar you see is one I defined, also check the 'scripts/user/styles.js'.

Please try this new version and if there are no issues, this will finally be added to the repo.

Thumbs up

35

Re: another CKEditor filter

andrewmman wrote:

Please try this new version and if there are no issues, this will finally be added to the repo.

Wahey! Works great! big_smile

We should remove the other CKEditor plugin to avoid confusion - or should we just replace that one with this one? I wonder what's easiest/clearest.

Thanks for all your work on this!

36

Re: another CKEditor filter

@andrewmman Great work! Is there a way to fix the "Invalid CSRF token" in Safari 5.1.2 (Windows XP) ? It happens when I insert a picture through the file manager and save the post. The save button is hit some seconds after the image in inserted. Other browsers don't have this issue.

Thumbs up

Re: another CKEditor filter

At least it's not my fault and seems to be a known issue of ckeditor, check ticket.

I'll see if there are any solutions.

Addenda:

If you read the ticket discussion, someone suggests to edit the image plugin and set a known img as temporary source(it will be removed, it's not important), so open 'scripts/ckeditor/plugins/image/dialogs/image.js' and with your text editor do a search/replace with the following:

Search:

else if(C==g){D.setAttribute('src','');D.removeAttribute('src');}}

Replace with:

else if(C==g){D.setAttribute('src','wolf/icons/file-image-16.png');D.removeAttribute('src');}}

Be sure you clear Safari's cache and it should be 'solved'.
At least it worked for me(Safari on snow leopard)

Last edited by andrewmman (2012-02-08 02:52)

Thumbs up +1

38

Re: another CKEditor filter

andrewmman wrote:

At least it's not my fault and seems to be a known issue of ckeditor, check ticket.

I'll see if there are any solutions.

Addenda:

If you read the ticket discussion, someone suggests to edit the image plugin and set a known img as temporary source(it will be removed, it's not important), so open 'scripts/ckeditor/plugins/image/dialogs/image.js' and with your text editor do a search/replace with the following:

Search:

else if(C==g){D.setAttribute('src','');D.removeAttribute('src');}}

Replace with:

else if(C==g){D.setAttribute('src','wolf/icons/file-image-16.png');D.removeAttribute('src');}}

Be sure you clear Safari's cache and it should be 'solved'.
At least it worked for me(Safari on snow leopard)

Excellent! Thank you.

Thumbs up

39

Re: another CKEditor filter

Hi, I just run in to a little problem with this plugin. When a singlequote is present in the title of a page I get a error in wolf_pages.js.

Screenshot here

Thumbs up

Re: another CKEditor filter

Download the latest version (2.1.2), that issue has been fixed.

Thumbs up

41

Re: another CKEditor filter

Andrewman: great plugin, i just love function Site pages in add/repari link.

Is it possible that align function in td-table isn't working correctly?

I've add [ 'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock' ], -> does display icons, but functionality is 0 sad

Also a question: how to create a script that would limit your first color choice (at first i would like to offer only my web design colors). More colors would still be able get by clicking "more colors".

Last edited by BigBug (2012-03-24 19:01)

Thumbs up

Re: another CKEditor filter

BigBug wrote:

I've add [ 'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock' ], -> does display icons, but functionality is 0

Check your scripts/user/config.js and comment out or remove the following, IF you want to use inline css:

justifyClasses : [ 'left', 'centered', 'right', 'justify' ],

that setting makes CKEditor apply a custom class to the element, instead of declaring inline styles, ( i.e: adding ' style= text-align: left').

As for custom colors, check CKEditor docs. In this case you would like to check this

Last edited by andrewmman (2012-03-25 12:53)

Thumbs up

Re: another CKEditor filter

I installed CKEditor on one installation of WolfCMS and it worked great.

I installed WolfCMS on another web host, added CKEditor, enabled it, checked the settings, and everything looked OK.  In the Pages editor, the CKEditor pane showed up in the Filters dropdown.  But when I selected CKEditor for that page, neither a toolbar nor a text window appeared when the page was redrawn.  It looks like the kind of problem that can be caused either by some deep and serious incompatibility between/among components, or by a single missing or incorrect character somewhere.  I am in clue-reception mode.

One notable difference with the second web host is that I don't have ssh access, and files can only be uploaded by sftp.  It is not possible to extract from an archive in the hosted environment, I have to extract on another machine and recursively put the files over.  The result was good enough that ckeditor was recognized by the plugins page, but maybe there's something about the way tftp does things that causes this problem.  One possibility that comes to mind is the issue of binary vs. ascii mode transfers, but I have FileZilla configured to consider files with certain extensions to be ascii, and the default is binary.  Extensions .php, .txt, and .js are to be considered ascii; .png and .gif are not.

I don't know that that issue would necessarily relate in any way to the behavior I'm seeing, because while I can imagine improper copying of images messing up the toolbar, I wouldn't think that could prevent the textarea from being drawn.

Would ckeditor, or wolfcms, create log files that would possibly be worth looking at?  Is there a way to enable additional logging by editing a file somewhere?

I've already uninstalled ckeditor, deleted the ckeditor tree, re-put a fresh ckeditor tree (freshly extracted from the zip file), and re-enabled the plugin, and I get the same result.

So, clues?

Thumbs up

44

Re: another CKEditor filter

I had the same issue with FF11 only. Try to delete all the cookies/history etc from the browser then try again.

Do try to view it with e.g. Chrome.

Wolf CMS Paper Guy
Wolf CMS related blog / journal at Project 79 | Wolf CMS Docs

Re: another CKEditor filter

Thanks for the suggestion.  I checked IE (Mac OS X 10.4 and WinXP), Chrome (WinXP), and Safari (Mac OS X 10.4).  Same result.  Within the "body" tab, the "Filter" dropdown floats alone on a field of white.  The same thing happens in the "sidebar" tab.

On my other webhost, I have *never* encountered this, and still don't (as of about a minute ago).

I'm thinking it has to be some kind of configuration issue, possibly with Apache or PHP.  Not that I have any particular evidence of that, other than that the problem occurs on one webhost and not the other, and shows up in multiple browsers.

Is there any instrumentation I can activate in WolfCMS or CKEditor?

Thumbs up

46

Re: another CKEditor filter

MixedContent wrote:

Is there any instrumentation I can activate in WolfCMS or CKEditor?

You can set Wolf's "config.php" file (in CMS root dir) to readable, then find these lines:

// Should Wolf produce PHP error messages for debugging?
define('DEBUG', false);

and change "false" to "true". (You'll need to remove write permissions on config.php for Wolf to run again.) That might not get much of a result in this case, but worth checking.

Also - you said in your previous post that you used Filezilla to upload the uncompressed files. Perhaps worth uninstalling, and using WinSCP instead and upload again? I get better results with it than Filezilla when I'm not able to unpack remotely. Given your symptoms, the possibility of corrupted files on upload can't be ruled out.

Let us know how it goes!

Re: another CKEditor filter

If you get nothing but the filter select element, ckeditor had problems rendering the editor. Since this plugin is 90% javascript, you should debug javascript errors ( Firebug console or Developer tools of your browser) in the console.

Quick check: Did you edit any of the user config scripts? You may have an error if so (missing comma or quote, for example)

Thumbs up

Re: another CKEditor filter

I'll try using lftp from my linux-in-the-sky and see if anything changes.  If not, I'll try WinSCP (I assume it can use the sftp protocol and doesn't need to do any ssh'ing on the remote host).

As for javascript, I'm pretty unfamiliar with it -- what's the recommended way to debug things?

I didn't edit anything in the ckeditor tree, what I uploaded was a fresh unzip.

Thanks for the info.

Thumbs up

Re: another CKEditor filter

Before doing the re-install, I set FireFox to open the error console on a javascript error.  I got this:

====
Error: uncaught exception: [CKEDITOR.resourceManager.load] Resource name "wolf_pages" was not found at "http://.../wolfcms/wolf/plugins/ckedito … ?t=B8DJ5M3".
====

(the file in question is wolf/plugins/ckeditor/scripts/ckeditor/plugins/wolf_pages/plugin.js.)


Apparently,in the ckeditor zip archive, that file exists, but not at that path:

        [...]

  ckeditor/scripts/ckeditor/plugins/
  ckeditor/scripts/ckeditor/plugins/a11yhelp/
  ckeditor/scripts/ckeditor/plugins/a11yhelp/dialogs/

        [...]

  ckeditor/scripts/wolf_plugins/
  ckeditor/scripts/wolf_plugins/wolf_pages/
  ckeditor/scripts/wolf_plugins/wolf_pages/plugin.js

        [...]

I suppose I could move the file to the directory where it's being looked for, but another part of the code may need it to be where it is now.

(This does, of course, prompt the question: why does the plugin work fine on my other web host?)

Thumbs up

Re: another CKEditor filter

OK, I copied the file from where it is to where it was looked for and not found, and the toolbar appears now.

So I have a workaround, but this looks to me like a bug, yes?

Thumbs up