1

Topic: TinyMCE 3.2.1 Released

This release fixes a few bugs, and adds a few new features such as valid xhtml output for flash movies this can be disabled if you set the media_strict option to false. But since valid object elements now works in all major browsers there is really no reason for disabling it.

We only fixed the object output for flash since this is most commonly used and there are just to many variants of media player, quicktime and so forth and testing them all will take some time.

We also worked a lot on the serialization of attributes. IE tends to return odd values for bool type attributes like checked or readonly. These are now resolved.

Best regards,
Spocke - Main developer of TinyMCE

2

Re: TinyMCE 3.2.1 Released

Thank you very much guys!

3

Re: TinyMCE 3.2.1 Released

Great! Keep these updates coming! TinyMCE is seriously loaded with know-how and man hours of work and expertise. Like always it is a pleasure just studying your code. And I've learnt so much from you guys - mostly in terms of writing JavaScript. And it all came from the need to customize TinyMCE for me (back then it still was a 1.x version).

A big Thank You to you guys!

Greetings from Germany,

Felix Riesterer.
(-> about me and this forum <-)

4

Re: TinyMCE 3.2.1 Released

Great !

One year after my fix for tinymce 2.1.x, tinymce is now officially completely valid xhtml !
http://lolotek.free.fr/fix_tinymce_w3c.html

Last edited by tek (2008-11-05 14:27:53)

5

Re: TinyMCE 3.2.1 Released

@felix: Thank you for helping us with moderating the forums. smile
@tek: Yeah, it took a while mainly due to some quirks in previous flash versions where embedding large flash movies using the XHTML strict model would fail. I don't think this is an issue anymore since most embedded flash movies are players anyway and they tend to be small. The current implementation only produces valid XHTML for flash. For other embed format it's still the old format since I don't know how various versions of media player or quicktime would react to the new format.

Best regards,
Spocke - Main developer of TinyMCE

6

Re: TinyMCE 3.2.1 Released

Autoplay (in the media plugin) is still being stripped from the code. I submitted this bug but it is still there and there doesn't seem to be any way to fix this.

7

Re: TinyMCE 3.2.1 Released

Yes, we wasn't able to fit it in for that release. It will probably be resolved for the next one.

Best regards,
Spocke - Main developer of TinyMCE

8

Re: TinyMCE 3.2.1 Released

There seems to be a bug that loses the caret in firefox 2 in the dialog windows when inlinepopups is enabled.

Best way to reproduce:
- Add a new line of text
- Select it
- Press create hyperlink(advlink)
- Click in one of the textboxes

You can type anything in the boxes but it doesn't show the carret which is confusing to customers. It also appear randomly in IE.

Grtz, Laurence

9

Re: TinyMCE 3.2.1 Released

Thanks for implementing my feature request!

10

Re: TinyMCE 3.2.1 Released

Can you tell me more about valid xhtml output for flash movies  and media_strict option? The new thing in this release. I could not find anything.

-Deepali

11

Re: TinyMCE 3.2.1 Released

What about this? Doesn't it suffice?
http://wiki.moxiecode.com/index.php/Tin … in_options

Greetings from Germany,

Felix Riesterer.
(-> about me and this forum <-)

12

Re: TinyMCE 3.2.1 Released

Thanks.

13

Re: TinyMCE 3.2.1 Released

spocke wrote:

This release fixes a few bugs, and adds a few new features such as valid xhtml output for flash movies this can be disabled if you set the media_strict option to false. But since valid object elements now works in all major browsers there is really no reason for disabling it.

We only fixed the object output for flash since this is most commonly used and there are just to many variants of media player, quicktime and so forth and testing them all will take some time.

We also worked a lot on the serialization of attributes. IE tends to return odd values for bool type attributes like checked or readonly. These are now resolved.

Did you see I submitted a patch for the Media plugin to remove dependencies on the external JS file?  It also produces strict XHTML output, while preserving compatibility with older browsers and all media types.

I posted about it in the working group forum, but only has 4 views so far.

http://sourceforge.net/tracker/index.ph … tid=635684

14

Re: TinyMCE 3.2.1 Released

Yes, I read it and looked at the code. Didn't have time to incorporate it though but I will definitely look in to it.

Best regards,
Spocke - Main developer of TinyMCE

15

Re: TinyMCE 3.2.1 Released

Spocke,

Did you already looked at this problem?

lkeijmel wrote:

There seems to be a bug that loses the caret in firefox 2 in the dialog windows when inlinepopups is enabled.

Best way to reproduce:
- Add a new line of text
- Select it
- Press create hyperlink(advlink)
- Click in one of the textboxes

You can type anything in the boxes but it doesn't show the carret which is confusing to customers. It also appear randomly in IE.

It is reproducible with the tinymce examples on the site.

Grtz, Laurence

16

Re: TinyMCE 3.2.1 Released

This issue is now resolved.

Best regards,
Spocke - Main developer of TinyMCE

17

Re: TinyMCE 3.2.1 Released

spocke wrote:

This issue is now resolved.

Thanks...

Grtz, Laurence

18

Re: TinyMCE 3.2.1 Released

I'm new to Tiny MCE, but very excited about what it looks like I'll be able to do with it.  After a few days of tweaking, I've finally got everything working just the way I want it.  However, once we started testing it on older browsers, I found that about 40% of the time in IE 6, it either won't load at all, or only about half of the toolbar icons will load.  I played around enough with the code to find that if the browser has a little extra time between the .init script and the text area, the problem seems to go away.  It would seem to me that the problem lies in the initializer not finishing its work before it's expected to load something up.  Based on your knowledge of Tiny MCE, is this possible?  Is there some way of checking to make sure that the init command finished before adding an editor to the page?

19

Re: TinyMCE 3.2.1 Released

j2jensen wrote:

I'm new to Tiny MCE, but very excited about what it looks like I'll be able to do with it.  After a few days of tweaking, I've finally got everything working just the way I want it.  However, once we started testing it on older browsers, I found that about 40% of the time in IE 6, it either won't load at all, or only about half of the toolbar icons will load.  I played around enough with the code to find that if the browser has a little extra time between the .init script and the text area, the problem seems to go away.  It would seem to me that the problem lies in the initializer not finishing its work before it's expected to load something up.  Based on your knowledge of Tiny MCE, is this possible?  Is there some way of checking to make sure that the init command finished before adding an editor to the page?

Hi j2jensen!

Just thought I'd comment on your question.

The init command is actually an event that your code is responding to, and in any type of event-driven programming, you cannot rely on those events coming in any particular order, or with any particular timing.  The editor does not wait for your init method to finish; it calls it and them moves on to the next thing on its list of to-dos.

If you have code that must complete before the editor loads, then definitely do not put it in the init event.  Instead, place your code before TinyMCE is initialized.  You can place the TinyMCE initialization function either at the end of your code, or place it within its own function (that's what I do).  I like placing the initialization in its own function or even its own "class" (object) because it creates a generic way to start TinyMCE that I can use in a variety of situations.

For example, on any page that contains a TinyMCE editor on my site, I include a javascript file called RichTextEditor.js, and that file has everything I need to work with the editor, all defined within one object.  (I think of it as a "class".)  It looks something like this:

var RichTextEditor = {
    //... I define some misc. properties here - values related to the
    //... text editor that I need to keep track of globally.

    initialize: function (options) {
    
        if (typeof(document.execCommand) === "undefined") {
            LotteryPostError.Show("Your web browser cannot handle the Lottery Post Rich Text Editor, so you will need to disable the Rich Text Editor before you can use this page.\n\nTo do so, click Board Settings in the Options menu, and then un-check the Rich Text Editor checkbox.\n\nAlternatively, we recommend that you upgrade your web browser to the latest version of Microsoft Internet Explorer or Mozilla Firefox, both of which will allow the use of the Rich Text Editor.", "Web Browser Not Compatible", "icon-caution-16.gif");
        }
        else {
            var tinyMceOptions = {
                accessibility_focus: false,
                //... more default options defined
            };

            if (typeof(options) === "object") {

                if (options.gzip && tinyMCE_GZ) {
                    tinyMCE_GZ.init();
                    delete options.gzip;
                }

                SpeednetDOM.MergeProperties(options, tinyMceOptions);
            }
            
            tinyMCE.init(tinyMceOptions);
        }
    },

    //... here's where I define callbacks that I use from TinyMCE
    //... called as "RichTextEditor.callbackFn()"
};

That's actually a pretty small snippet of the actual code, but hopefully it demonstrates the basic structure I created.  It helps keep everything related to the text editor self-contained, it's highly re-usable, and I can control when everything fires.  (It is my own personal approach.  There are any number of different ways to do what I am doing.)

When I'm ready to start the editor, I use the following code, and I can optionally pass some additional editor options if they are needed on the page.  For example, if I want to change how TinyMCE finds the textareas.

RichTextEditor.initialize();

or

RichTextEditor.initialize({editor_selector: "editbox", entity_encoding: "named"});

TinyMCE has an absolute TON of flexibility, and an ability to do lots and lots of different things itself.  However, there are times when the proper thing to do in YOUR site is to have your own code control a particular thing, rather than relying on TinyMCE.

You'll see that sometimes if you need to have precise control over the output.  TinyMCE has tremendous capability in that department, but there are some things that make more sense to tweak after YOU get control of the content.  (Such as server-side processing.)

Good luck to you!  For what it's worth, your choice in text editor was perfect, because in my opinion this is hands-down the best text editor you can find.

-Todd

20

Re: TinyMCE 3.2.1 Released

Todd,

Thank you for taking so much time with your response.  I may not have made it clear exactly what the problem is, however. 

I've placed all the code that I use for initializing TinyMCE into a javascript file, which declares various methods and one variable that gets used by some of those methods (to keep track of which editor was accessed last).  The first of these declared methods looks like this:

 
// file: tnl_tiny_mce_init.js
function tnlTinyMceInit(tnlStyleSheet)
{
    var tnlTinyMcePluginList = 'spellchecker,safari,style,...';

    tinyMCE_GZ.init({ 
            plugins : tnlTinyMcePluginList, 
            themes : 'advanced', 
            languages : 'en' 
    }); 
    
    tinyMCE.init({ 
            mode : 'none', 
            theme : 'advanced', 
            ...
            setupcontent_callback : tnlTinyMceSetup
    });
}

And the setupcontent_callback method you see looks like this:

function tnlTinyMceSetup(editor_id, body, doc)
{
    var editor = tinyMCE.get(editor_id);
    tnlHideBars(editor);
    editor.onMouseUp.add(tnlShowBars);
    editor.onKeyDown.addToTop(tnlOnTab);
}

And so in my page I initialize tinyMCE like so:

<script type="text/javascript" src="/js/tiny_mce/tiny_mce_gzip.js"></script>
<script type="text/javascript" src="/js/tiny_mce/tnl_tiny_mce_init.js"></script>
<script type="text/javascript"> tnlTinyMceInit('clientStyleSheet.css');</script>

And then I create editors like so:

<textarea cols="80" rows="20" name="content_text" id="content_text" style="display: none;"/>
<script type="text/javascript"> tinyMCE.execCommand('mceAddControl', true, 'content_text');</script>

This works fine on Firefox 3, Chrome, and IE 7.  But on IE 6, sometimes the Tiny MCE editor is never created.  From my debugging, I basically find that the tnlTinyMceInit function executes without an error, but the tnlTinyMceSetup never gets called.  I'm guessing that this happens because the gzip initialization doesn't complete before the tinyMCE.init() runs.  When I switch from the gzip version to regular, the problem seems to go away, but first of all I don't know whether that's because the problem lies with gzip, or if it's just changing the timing enough to avoid manifesting the bug.  Secondly, I would very much like to use gzip, so I'd rather fix the source of the bug rather than using a workaround.

So my questions are:
- does it seem likely that I've correctly diagnosed the problem?
- is there a way for me to make sure that the gzip loader has finished before I call tinyMCE.init()?

Thanks again.

James

21

Re: TinyMCE 3.2.1 Released

James:

Of course, there are many possibilities for why it is going wrong, but my initial read of your code leads me to think that the problem is the way you are initializing the editor.

Instead of doing the tinyMCE.execCommand() right after the textarea, change the mode setting from 'none' to 'specific_textareas', and set a new setting for editor_selector to 'someClass' (use your own class name), and then add that same class name to the textarea element. (class="someClass").

Doing this will let TinyMCE find and setup your editor, instead of YOU controlling when it will happen.

I think what's happening is that the other web browsers have faster JavaScript engines, and they are getting the editor code loaded and processed quicker than IE.  So in the case of IE, when the browser hits your script with the execCommand in it, the editor code has not yet finished setting up, and so the function call doesn't work.

-Todd

22

Re: TinyMCE 3.2.1 Released

@spocke:

My message above actually reminds me of something I was going to request.  In the editor_selector setting, can you please add the ability to specify an ID instead of class, by putting a pound sign before the value?  For example:

tinyMCE.init(){
    ...
    mode: "specific_textareas",
    editor_selector: "#myTextarea"
});

If you guys are ever going to use jQuery behind the scenes for TinyMCE, it would be wicked to be able to put a jQuery expression in that setting, but until then the pound sign would be most useful.

Thanks!

Last edited by speednet (2008-11-22 03:29:31)

23

Re: TinyMCE 3.2.1 Released

Nah, use the elements setting instead. We are not going to use jQuery inside TinyMCE. TinyMCE will remain library independent.

Best regards,
Spocke - Main developer of TinyMCE

24

Re: TinyMCE 3.2.1 Released

I've tried using editor_selector, and it behaves the same way.  IE6 still doesn't load some of the time.  I put in some debugging statements and found that the tinyMCE_GZ.init() and tinyMCE.init() statements finish before the tinyMCE.execCommand() runs.  So unless the init method starts some asynchronous processes going that doesn't complete until after the process itself finishes, that doesn't appear to be the issue.  So I guess that's the question: does it load asynchronously, and if so, how can I check that it's finished loading?  I tried checking a variable I found on tinyMCE_GZ ... coreLoaded or something like that... but I'm not sure if that means anything really.

Due to the dynamic nature of our pages, we can't use the elements setting because we don't know until each editor is loaded how many editors are going to be loaded, much less their names.  Calling a new .init() each time it gets loaded seems to make the EditorManager forget about all but the last editor, which causes problems with some of my other functionality.  Plus I imagine it adds to the overhead of loading the page.

On the page where I was noticing these problems, I found that removing a calendar popup script that we have also makes the problem appear to go away.  Looking through the calendar popup's code, I can't seem to find anything that ought to conflict with the loader, though, so this might also just be a matter of changing the timing.  Is there anything that I ought to watch out for in particular?

Speaking of library independency, I have another question:  Several of our pages use prototype.js.  Does TinyMCE play well with prototype?  Is there anything I should know before adding a TinyMCE editor to one of these pages?

Many thanks,

James

25

Re: TinyMCE 3.2.1 Released

@j2jensen:  I think I mentioned that was the problem!  Once you put in the editor_selector and change the mode, remove that command as it is no longer necessary, and is in fact creating the problem.