Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2005-09-07 05:54:39

kodeabe
New member
Registered: 2005-09-07
Posts: 2

How to force SuperClean to run on submit

I'm not that strong in javascript, so I can't figure out how to force Superclean to run with all options ON when the user tries to submit. I don't want it to ask for anything, in fact I don't want the user to notice it. How do i do this?

Offline

#2 2005-09-07 14:25:47

niko
Xinha Authority
From: Salzburg/Austria
Registered: 2005-02-14
Posts: 338

Re: How to force SuperClean to run on submit

you could do it server-side - that would be the easiest solution.

another solutions would be to execute this code onSubmit:

    editor._wordClean();
    var D = editor.getInnerHTML();
      D = D.replace(/face="[^"]*"/gi, '');
      // { (stops jedit's fold breaking)
      D = D.replace(/font-family:[^;}"']+;?/gi, '');

      D = D.replace(/size="[^"]*"/gi, '');
      // { (stops jedit's fold breaking)
      D = D.replace(/font-size:[^;}"']+;?/gi, '');

      D = D.replace(/color="[^"]*"/gi, '');
      // { (stops jedit's fold breaking)
      D = D.replace(/([^-])color:[^;}"']+;?/gi, '$1');

    D = D.replace(/(style|class)="\s*"/gi, '');
    D = D.replace(/<(font|span)\s*>/gi, '');
    editor.setHTML(D);

      HTMLArea._postback(editor.config.tidy_handler, {'content' : editor.getInnerHTML()},
                         function(javascriptResponse) { eval(javascriptResponse) });

(copied from SuperClean plugin)


Niko

Offline

Board footer

Powered by FluxBB