I thought I already posted this, but it doesn't seem to be in the queue?

With previous versions of SWFTools there was an option to force the js embedding code on to every page. This has disappeared in the latest version.

This means that SWFTools will not be able to handle content that is generated by a macro/filter (e.g. flashnode). The filter will retrieve the decoded macro from the cache, but this will not trigger the js addition to the page so the content will not be replaced with the flash movie.

When I first developed flashnode I tried to use a regex on the body/teaser to look for the flash div and use that to decide to insert the script in the header, but I never got it to work at the time and went for just inserting on every page.

This feature needs to be re-instated in some way in SWFTools to correctly support filter generated flash content.

Thinking out loud - with flashnode the js was inserted using hook_nodeapi. If the routine to add js to the header were exposed as a callable function then other modules (e.g. flashnode) could call something like swftools_add_js_header() to force the header addition. If a js embedding method is in use then the appropriate header would be inserted. The use of a static variable could then sit in that function to determine if flash is already added. Modules like flashnode could then choose to force js on to every page themselves, or do something clever, without SWFTools needing to work out whether to add or not. Calls to swf() would add js as normal, again by calling the add js function.

Or does that sound very complicated and a simple option in admin to add to every page is better.

Maybe could do the latter in the short term, and move towards the former at a later stage to optimise the code?

Comments

sime’s picture

Status: Active » Fixed

OK, think this is restored, please let me know if any trubbles.

Anonymous’s picture

Status: Fixed » Closed (fixed)