Finished a TinyMCE plugin

Feed 41 posts, 14 voices

Mar 18, 2008 13:49
Avatar
396 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.

 
Mar 18, 2008 16:46
Avatar
820 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.

 
Mar 18, 2008 16:55
Avatar
83 posts

great, i will test it for sure!

 
Mar 19, 2008 09:36
Avatar
396 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

 
May 22, 2008 20:57
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!

 
May 26, 2008 16:47
Avatar
396 posts

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

 
May 26, 2008 17:03
Avatar
396 posts

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

 
May 28, 2008 07:38
Avatar
7 posts

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

 
May 28, 2008 17:09
Avatar
396 posts

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

 
May 30, 2008 06:19
Avatar
7 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.

 
May 30, 2008 22:30
Avatar
286 posts

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

 
Jun 2, 2008 16:24
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.

 
Jun 2, 2008 16:26
Avatar
3 posts

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

 
Jun 3, 2008 03:10
Avatar
820 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!

 
Jun 3, 2008 12:33
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!)

 
Jun 3, 2008 17:44
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.

 
Jun 3, 2008 18:37
Avatar
276 posts

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

 
Jun 4, 2008 04:36
Avatar
7 posts

Did you manage to solve the problem?

 
Jun 5, 2008 05:46
Avatar
396 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.

 
Jun 5, 2008 05:47
Avatar
396 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.

 
Jun 26, 2008 00:11
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...

 
Jun 27, 2008 11:56
Avatar
396 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...

 
Jun 27, 2008 12:09
Avatar
382 posts

do you have idea of how can me more flexible ?

 
Jul 1, 2008 07:03
Avatar
396 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());
 
Jul 1, 2008 23:42
Avatar
10 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.