We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23478
    • 133 Posts
    Hello

    I know the code is wrong... this is not mine... this is document "design" from the sample site that populates beta3 distribution.
    I said I used it just has an example as it was extracted from the sample datas given with MODx 0.9.5. beta3 ... and so it is accessible to every one
    (The only modification I’ve made is some translating... and has I’m not very good in english, I can’t translate it back to english lipsrsealed )

    I don’t want to correct the code (also I know how to correct it) I just want Tiny NOT remove code I could write. I think my last example is better : adding eForm’s atributes ... what is real for eForms would become real for my next developpement. If, when developping code (snippet), I have to spend twice my time for modifying editor... that will not be nice.


    Please do not consider my intervention has a request for that particular piece of code ... please don’t tell me how to correct it ...
    This is just a perfect sample of why I can’t let redactors use Tiny despite I think could be a better RTE than FCK.

    I’m sorry, i’ve got undred of examples of things that will go wrong with that corrections, but it’s difficult for me to translate them in english.

    My last argument will be : I’ve got the right of writing code the doesn’t complain XHTML rules !
    I don’t want an editor to detroy my work... even if it thinks it’s not a good one >:(
    If I want a black-box wizzard that destroys everything not from its scheme, I can buy some microsoft product ! wink

    Edit : add a smiley ... for the last phrase : i’m not angry grin
      • 4018
      • 1,131 Posts
      Quote from: piwaille at Oct 30, 2006, 04:22 PM

      If I want a black-box wizzard that destroys everything not from its scheme, I can buy some microsoft product !

      Heh heh...I like that last statement! Couldn’t agree more! smiley
        Jeff Whitfield

        "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
        • 4018
        • 1,131 Posts
        Ok...another option I have found that I will be adding in is the ability to turn off the cleanup option. Since it is on by default, it cleans up and/or removes any and all attributes as set by the valid_elements, extended_valid_elements, and invalid_elements options. Granted, this is both good and bad. It’s bad in the fact that if your code does not follow the elements outlined in your valid_elements settings then your code is likely to be altered. Invalid attributes for any given element will best stripped from your code if the cleanup option is on. In my option, this behavior is good because it keeps your users from inserting any non-compliant code that could cause the site to break. You can turnoff the cleanup option...but in doing so you pretty much allow anyone using TinyMCE to insert non-compliant code, which can be worse in some cases. I personally do not think that turning off the cleanup option is a good idea.

        The new settings I’m working on will be set to allow for full compliance with the XHTML spec. I’m adding a new javascript file that will allow for setting extended options for things like the valid_elements, extended_valid_elements, and invalid_elements options. It’ll also be good to have this space for possible future options that are outside the scope of the plugin code and parameters. Beyond the default settings for the valid_elements option, a developer can extend the elements with the extended_valid_elements and invalid_elements option or alter the valid_elements option in the javascript options file.

        One last thing: Being that I’m a pretty strong advocate of standards compliant code, short of turning off the cleanup option, I can’t really help those who wish to alter the valid_elements options to allow for non-compliant code. Now, I understand that there are extenuating circumstances that require doing things that are a little less than standards compliant. I also understand that the cleanup option in TinyMCE might not work well for everyone. I guess what I’m saying is that if you need help, by all means ask....I will be more than happy (ecstatic!) to help you. However, if what you’re asking means doing something that is a gross misstep in standards compliance I will mention it and offer advice on how to fix it. Please don’t take this the wrong way. I only do it because I care. smiley

        Jeff
          Jeff Whitfield

          "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
        • Re the non-standard attributes eForm uses, seems to me that since your form is in a chunk, unless you’re using your RTE to edit the chunk, it won’t be a problem.

          How about being able to turn off the cleanup option on a per-user basis? That way your regular editors could have it on, and your developers could have it off?
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
          • Forms can be in documents now, though, so it should be addressed I think. I totally agree with having it be able to be turned off, though I suspect Tiny doesn’t make that an option. :/
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • Quote from: rthrash at Oct 30, 2006, 05:33 PM

              Forms can be in documents now, though, so it should be addressed I think. I totally agree with having it be able to be turned off, though I suspect Tiny doesn’t make that an option. :/
              Sure it can, you can use (from the TinyMCE docs):
              Use *[ * ] to include all elements and all attributes this can be very useful when used with the invalid_elements option.
                Garry Nutting
                Senior Developer
                MODX, LLC

                Email: [email protected]
                Twitter: @garryn
                Web: modx.com
              • Now that’s great news and should be our option I think. Allow all unless specifically denied (and the opposite of how good user perms should be configured).
                  Ryan Thrash, MODX Co-Founder
                  Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                  • 4018
                  • 1,131 Posts
                  Ok...based on Gary’s suggestion, I tried it out and also set the cleanup option to false. Then I loaded up a new document and posted in the code from before. This is what I got:

                  <h3 style="cursor: pointer;" mce_thref="javascript:void(0)" mce_href="javascript:void(0)" onclick="new Effect.toggle( 'styles' , 'blind');">Liste des styles (<a>Montrer/Cacher</a>)</h3>


                  I even tried adding in the href attribute to the h3 tag in the valid_elements option and it still didn’t work. So...what that tells me is that TinyMCE simply doesn’t like any seriously non-compliant code. If the href attribute isn’t an actual attribute of the h3 tag then Tiny will likely choke on it. I think the reason behind this is due to the fact that TinyMCE tries to interpret the code in the editor for direct editing and display. If it doesn’t understand an href attribute in an h3 tag it simply assumes that it is invalid and renames it to something that won’t cause any harm. I personally like this since I would much prefer the content to validate properly rather than stand the chance of something being entered that might cause serious problems to a site.

                  More to come...

                  Jeff
                    Jeff Whitfield

                    "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
                    • 38290
                    • 712 Posts
                      jpdevries
                    • Haha JP, not surprised ... they were posted 6 and a half years ago, lol.

                      The links are now:

                      http://www.tinymce.com/wiki.php/Configuration:extended_valid_elements
                      http://www.tinymce.com/wiki.php/Configuration:valid_elements

                        Garry Nutting
                        Senior Developer
                        MODX, LLC

                        Email: [email protected]
                        Twitter: @garryn
                        Web: modx.com