Forum closed. New forum available at http://community.wymeditor.org/

Stopping <script> being stripped out - embedding SWFObject's

Support forum for WYMeditor.

Stopping <script> being stripped out - embedding SWFObject's

Postby rolandino on Fri Oct 30, 2009 4:26 pm

Hi,

I'd *really* like to know how to stop <script> being stripped out so that I can embed SWFObject calls.
Yes - I've read both of these:
--- http://meridimus.com/post/167515648/wymeditor-flash
--- http://simonwoodside.com/weblog/2009/2/ ... ym_editor/
and got it working with YouTube embedding.

But - this doesn't really help with SWFObject.

CKEditor simply allows me to do this, but screws up other code by sticking other bits of guff in - which is why i'd really *like* to use WYMEDITOR.
Can anyone help here? Don't mind hacking the code.

I came across this in the code:

WYMeditor.XhtmlSaxListener.prototype.addScript = function(text)
{
if(!this.remove_scripts){
this.output += text;
}
};


but couldn't figure out how to simply tell is that this.remove_scripts=false. Also, if I simply commented out the logic such that

this.output += text;

was always happening, made no difference.

So - any ideas anyone?

Thanks,
R
rolandino
 
Posts: 3
Joined: Fri Oct 30, 2009 4:13 pm

Re: Stopping <script> being stripped out - embedding SWFObject's

Postby rolandino on Tue Nov 03, 2009 10:41 am

Anyone? I mean, it's either get this fixed or off to ckeditor. Which is a shame, because that it is a bit cruft-tastic really.
R
rolandino
 
Posts: 3
Joined: Fri Oct 30, 2009 4:13 pm

Re: Stopping <script> being stripped out - embedding SWFObject's

Postby mr_lundis on Tue Nov 03, 2009 2:57 pm

Hi! I'm sorry for not replying sooner.

It's not WYMeditor that's striping out your script tags, but the browser. WYMeditor currently relies on the innerHtml property to get and set the value of the editor, and it seems like most browsers simply strips out any script elements you insert using innerHtml. Most of the time, this actually makes sense, as the script you insert would be executed right away - thus there's really no point to inserting javascript through javascript... :?

CKEditor obviously doesn't use innerHtml or they've found a workaround.

For script insertion to work in WYM, we would need some way of working around the innerHtml problem, as well as some kind of method of escaping the javascript code to avoid it beeeing executed. In the next major version (0.6) we're moving away from using innerHtml (it has some other issues as well) in favour of a custom javascript dom/html-parser, making it a lot easier to fix this issue. But unless there's some cleaver workaround, I'm afraid not much can be done for the current version...

As always, any kind of suggestions and/or patches are welcome!

Cheers! ;)
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
mr_lundis
 
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden

Re: Stopping <script> being stripped out - embedding SWFObject's

Postby rolandino on Tue Nov 03, 2009 11:16 pm

Hi Jonatan,

Many thanks for your informative reply, very interesting.
Shame about the current version - new version would need that ability I reckon, to allow people to insert SWF Object type code.
Any idea of timescales re: the new version?

Thanks,
R
rolandino
 
Posts: 3
Joined: Fri Oct 30, 2009 4:13 pm

Re: Stopping <script> being stripped out - embedding SWFObject's

Postby mr_lundis on Wed Nov 04, 2009 8:26 am

You're welcome!
Currently the development is going very slowly, to be honest. Most of the devs (me included) are busy with a lot of other stuff. Before we had some corporate support from the company where Jean-François Hovinne (aka jfh) used to work, that's not the case any more. Unless we get some other sponsor, we'll only be able to do this in our spare time.

We've been discussing different ways of trying to monetize this solution, to enable us to work on a more even basis. But selling software is really hard, especially when its open source, and the need for some kind of support solution for WYM is fairly limited...

Anyway, I hope you find what you're looking for.
Cheers! ;)
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
mr_lundis
 
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron