___/ On Mon 12 Jun 2006 09:05:07 BST, [ Viper007Bond ] wrote : \___
So, I'm writing a plugin to make buttons to insert YouTube and Google
Video videos into your posts. I'm doing it via ButtonSnap and it
works fine for the non-WYSIWYG editor.
Be very careful with these. Both YouTube and Google Video will begin
crashing Web browsers after a while (been a victim of both), having
'HotLinked' for a while, despite fair use. In the case of Google, there
will be a PageRank depletion (or a drop to 0), as well as ranking
penalties, backlinks depletion and unhappy visitors whose browsers crash
(even Konqueror) until the offensive code is removed. Some people seem to'
survive' the embedment of such videos, but I don't know how...
Oh! and ma will very be disappoint to see theat the object markup does not
validate! *smile* It is rarely (if ever) W3C standards-compliant.
Here's an example generated code snippet:
<object style="width: 425px; height: 350px"
type="application/x-shockwave-flash"
data="http://www.youtube.com/v/hl2UUunlI2Q"><param name="movie"
value="http://www.youtube.com/v/hl2UUunlI2Q" /><param name="wmode"
value="transparent" /></object>
The problem is that when I put that into TinyMCE, it totally screws
it up by adding line breaks:
<object style="width: 425px; height: 350px"
type="application/x-shockwave-flash"
data="http://www.youtube.com/v/hl2UUunlI2Q">
<param name="movie" value="http://www.youtube.com/v/hl2UUunlI2Q" />
<param name="wmode" value="transparent" /></object>
Before I resort to using a placeholder (like
[youtube]hl2UUunlI2Q[/youtube]) at least for TinyMCE, is there way I
can stop it from doing that? I just wanted to make this plugin a
button generator rather than a dynamic replacer. :/
I don't have a decent suggestion because I don't know TinyMCE's internals.
However, if your use a JavaScript pop-up to prompt for URL (e.g.
http://www.youtube.com/v/hl2UUunlI2Q ), try to wrap it with classes and
put some of the remainder [style] attribute in an auxiliary stylesheet. It
might help in preventing the nasty newlines...?
Best wishes,
Roy
--
Roy S. Schestowitz | "Hack to learn, don't learn to hack"
http://Schestowitz.com | GNU/Linux ¦ PGP-Key: 0x74572E8E
4:25pm up 45 days 21:58, 10 users, load average: 0.45, 0.67, 0.82
http://iuron.com - next generation of search paradigms
|