FORUMS CLOSED DUE TO SPAM. YOU STILL CAN ADD POST!

Finished a TinyMCE plugin

Feed 41 posts, 14 voices

Avatar
651 posts

In my quest for a good wysiwyg plugin, I tried first to create a Widg plugin, but that didn't appear to work very wel... I therefore created a very simple TinyMCE plugin. Currently it just replaces all the textareas, but at least you can turn it on or off through the admin section of Frog.

If you're interested, get it at http://www.vanderkleijn.net/frog-cms-plugins.html

It already includes tinymce, so just unzip it in your plugins directory and read the readme.txt file.

 
Avatar
1493 posts

I plugged it in to my SQLite3-testing Frog install. Worked great! I see what you mean on your blog about "In future, I'll try to make it a proper filter." When you change the filter with the TinyMCE plugin loaded, interesting things happen! Everything works, still, but having it behave like the Markdown or Textile filters would certainly be a welcome enhancement.

Since I'm a WYMeditor fan, when I get some time (ha!) I'll maybe see if I can follow your steps with TinyMCE for WYMeditor.

Thanks for this!

David.

 
Avatar
83 posts

great, i will test it for sure!

 
Avatar
651 posts

Maybe Philippe could help out by telling me:

  • how can I tell my javascript to detect an onchange event in the filter dropdown box?
  • how can I use that onchange event to execute a single line of javascript code based on the new value of the filter dropdown box?

If those two questions are answered, I can make a proper "filter" of the tinymce plugin. Problem is, I'm very bad with Javascript so I can't answer those two questions. (yet..?)

@David Good luck. I also like the WYMeditor but I think it will probably be a little more difficult to do. Maybe not.. :-) I'll be interested to hear your results.

Martijn

 
Avatar
6 posts

ha! sorry, but i just wrote a topic that it would be great to have a regular text editor... and there it is. thanks!

 
Avatar
651 posts

I've updated my tinymce plugin... please see [http://www.vanderkleijn.net/articles/2008/05/26/frog-tinymce-plugin-updated.html](this post)

 
Avatar
651 posts

now once more.... this is the post I meant

 
Avatar
10 posts

Great!! but it don't works in IE.

 
Avatar
651 posts

How doesn't it work in IE? Do you get an error message of some kind? Do you get a javascript error?

 
Avatar
10 posts

It don't initialize in IE6 and IE7, I fixed this error with this change.

In tiny_mce.js

change

if(base&&t.baseURL.indexOf('://')==-1)

For this:

if (base && t.baseURL.indexOf('://') == -1 && t.baseURL.indexOf('/') !== 0)

Thanks for the plugin!! It works fine now.

 
Avatar
486 posts

good news. i look forward to trying it out. thanks for sharing

 
Avatar
3 posts

Wow - what a fantastic plugin... and perfect timing, too! (I had to choose a CMS this week for my organization, and just found Frog today; with this plugin it's absolutely, totally perfect. Way to go.)

Just had one minor issue with the images dropdown: if there are any non-image files in the images/ folder (eg., by default "index.html") the script puts in extra commas, which throws a javascript error. You can fix it by either deleting any non-image files in the images folder, or by editing lists/image_list.php and moving if ($first == false) { print ','; } to below if ($suffix == ".jpg" || $suffix == ".gif" || $suffix == ".png" || $suffix == ".bmp") {

but above if ($first == true) { .

But wow - what an awesome plugin. Seriously, major kudos to the plugin developer and to the people who created Frog; you guys are awesome. We'll definitely be using this for our project.

 
Avatar
3 posts

Aw, crap. Sorry for the messed up code example! Line breaks for the win...?

 
Avatar
1493 posts

@sboots -- discovering that this forum uses Markdown to format messages is a bit like a rite of passage... :| Inline code should be placed between "backticks", and any line starting with a tab character will be treated as a code block. E.g., if ($first == false) { print ','; }, etc. ...

Glad you found us!

 
Avatar
3 posts

Ah, thanks! Much appreciated. Now to learn Markdown... :)

Another note, if images are showing up properly in the editor but their paths are wrong on actual pages, you might need to add relative_urls : false, to tiny_init.js (and possibly a document_base_url, but mine worked without it). (...c'mon, Markdown, don't let me down!)

 
Avatar
7 posts

I've installed TinyMCE plugin and now I have no idea how to include Snippet, cause I can't get php script into text editor. Even if I use the button to insert HTML.

Can anyone help me?

P.S. Sory if my english is not perfect, I'm not from english speaking country.

 
Avatar
343 posts

I had the same problem. The plugin should use a filter.

 
Avatar
7 posts

Did you manage to solve the problem?

 
Avatar
651 posts

@gothw - Seems you found and fixed a bug in the stock TinyMCE system apparently.. :-) Did you report it to the guys at http://tinymce.moxiecode.com/ ??

@KMX & @Bdesign - I know it's not perfect, but the filter system seems to be missing some functionality needed for it. I'll try to update it so the filter system works, but I'm not getting a reply from Philippe about it.

That said, which browser & version are you using? The TinyMCE system should only become available on Pages, not when you're trying to edit a Snipper or Layout.

 
Avatar
651 posts

@gothw & @sboots - thanks for the help by the way guys, I don't really have lots of time (actually next to no time) to spend on this. I'll include your fixes in the next version.

 
Avatar
9 posts

Has this plugin been converted to work as a filter? I just ran into the problem where it seem to stuff up when trying to add the contact form code...

 
Avatar
651 posts

no, not yet... I've been on holiday in San Francisco for the last two weeks. Just got back. And I'm not that great with javascript. The way the filter system is setup is very strict...

 
Avatar
541 posts

do you have idea of how can me more flexible ?

 
Avatar
651 posts

@Philippe - unless I'm mistaken (possible since I'm not very good with Javascript), when the value of the dropdown changes, it triggers a very specific prototype/filter specific method.

I'd suggest to use a "wrapper" method instead. This would mean that the existing call to the textile and markdown filters would be called through the javascript wrapper method.

This would allow other filter developers who don't want to (or can't) use prototype, to put their own actions in the wrapper method.

It could be as simple as: (pseudo code)

 filterdropdownbox.onchange(myfilter.toggleFilterDisplay());
 
Avatar
14 posts

This is a great plugin, thanks a bunch for creating. It would be helpful if you could update it for everyone so that we don't have to manually make the change mentioned by gothw in post #10 though.