The attached path adds a checkbox to the rule options to force the text to stay on a single line. This is necessary because the flash will some times incorrectly wrap text in block elements (like floated navigation links), occasionally even breaking in the middle of a word.

CommentFileSizeAuthor
#6 sifr3.patch4.11 KBarmyofda12mnkeys
#2 sifr3.inc_.patch2.21 KBseanr
sifr3.inc_.patch1.05 KBseanr

Comments

seanr’s picture

Ugh, damned thing isn't saving the value and I have no idea why.

seanr’s picture

StatusFileSize
new2.21 KB

Better patch here (now saves and outputs correctly). Not sure it actually does what the wiki says its supposed to though.

lasseitorp’s picture

I can't get this to work even with the new patch.

The checkbox comes up in the module, but there's no output in the object tag.
Has anyone got this going??

kla2t’s picture

I had the same problem and couldn't get the patch to work. Obviously the sifr3.inc - even in the patched version - does not influence the output regarding the preventWrap / forceSingleLine parameters. They always equal "false".
The error seems to be in the sifr.js file. I simplified the variables

var AN=x.forceSingleLine===true;
var AS=x.preventWrap===true&&!AN;

to

var AN=true;
var AS=true;

and now there are no more irregular line breaks.
I don't know if this could cause new issues, but as a dirty hack it does the job for me.

armyofda12mnkeys’s picture

think i know the problem, just not the solution :) (got a temp solution though by using the last patch and manually changing the created sites/default/files/render/sifr3-rules.js) ...

Think this is what is happening:

user submits rule or cache is cleared etc...
render_get_rules() then is called to get (or create static $rules)

render_render_rules_js() is what builds the js files...
it calls a wrapper function render_wrap_rules() with those $rules, which calls sifr3.inc's sifr3_render_wrap_rules() with all the parameters for the rule in an array...

The output of the file is being created here... for certain parameters you dont want them as a simple 'string key, string value' combo.
aka not "forceSIngleLine":"true" but you want forceSIngleLine:true...
I set the value hardcoded straight in my sifr3-rules.js file, and it worked. so its now just getting that function to do that for certain values.

Basically it calls drupal_to_js() to take the $rules array and encode it into a js array. i think we need to get rid of that add just loop through and create the array manually maybe (since we dont want to change the core function)?
OR??
change sifr.js so it can parse this true value?

armyofda12mnkeys’s picture

StatusFileSize
new4.11 KB

Doing some ghettoness now, but its a solution if dont want to manually change the file ... file attached, not using drupal_to_js but a slight variation sifr3_to_js ...
For string values... If the string value is 'true', then dont return as '"true"' but 'true', so the value in js file is true and not "true".

Patch is against the render modules original sifr3.inc so it includes the changes in the above patch as well (aka run this against original sifr3.inc).

kla2t’s picture

...applied the patch successfully!
Obviously it is much better than my hard-coded hack above. And it opens the possibilty to attribute different forceSingleLine / preventWrap values to different sifr-rules.
Thanks!