Project:Flash Node
Version:6.x-3.1
Component:User interface
Category:feature request
Priority:normal
Assigned:flevour
Status:needs review

Issue Summary

would it be possible to make 100% width and hight values available in the flashnode basic settings , current validation give's error when 100% is entered in this formfield.
100% would mean the size of the flashnode content container. Height 100% could be troublesome with browsers if isn't available. But 100% width could be done I think.

Its a suggestion.
Chris.

Comments

#1

Assigned to:Anonymous» IT100
Status:active» fixed

Its some kind of fix. I hacked page and node, set height and width of swf to 100%, added an id to the container which holds swf (check using firebug) and added code (which you can find under need) that detects screen.height: its a brutal solution but it works, its not compatible with an upgrade. Maybe it can start deeper inquiries into some nice swf adjustments for displaying a singel swf in an as large as possible screen area without setting the body to 100% height. (which gives other problems)

[code]
if(screen.height < 769) filename = "screensize-768.css";
else
if(screen.height < 801) filename = "screensize-800.css";
else
if(screen.height < 1025) filename = "screensize-1024.css";
else
filename = "screensize-1280.css";

loadjscssfile("http://www.100it.be/css/"+filename, "css") ////dynamically load and add this .css file

function loadjscssfile(filename, filetype){
if (filetype=="js"){ //if filename is a external JavaScript file
var fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript")
fileref.setAttribute("src", filename)
}
else if (filetype=="css"){ //if filename is an external CSS file
var fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet")
fileref.setAttribute("type", "text/css")
fileref.setAttribute("href", filename)
}
if (typeof fileref!="undefined") document.getElementsByTagName("head")[0].appendChild(fileref)
}

css example

.swftools-wrapper {
height: 400px;
}

[code]

#2

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

#3

Status:closed (fixed)» active

Hello,

I'm actually greatly interested with the possibility of setting the flashnode width and height parameters in percent (%).
To solution above is working but I really think it's a "brutal" one...

Does anybody have another solution to fix this problem ?
Thanks !

#4

Hello,

Subscribing to this one. Flashnode is a great module, but I'd like to set width and height as percentages. It's quite a common practice for embedded animations.

Thanks!

#5

Hello,

I decided to make a hack on flashnode module, and it's working. It's a quick fix, probably the scaling options will stop working (not using them). I did the following:

  1. Changed data types in flashnode table:
    alter table flashnode modify column height varchar(20) not null;
    alter table flashnode modify column width varchar(20) not null;
  2. modified flashnode.module to perform INSERT and UPDATE operations with string data instead of integer, for both width and height. See attached patch.

Regards.

AttachmentSize
flashnode.patch 3.64 KB

#6

Version:6.x-2.2» 6.x-3.1
Assigned to:IT100» flevour
Status:active» needs review

I am attaching a cleaner patch here against 3.1 CVS with support for upgrade path.
I am currently keeping the validation with is_numeric on width and height, stripping away any % char from the strings.
Probably would be better to move this logic to a separate flashnode_sanitize function.
Cheers,
Francesco

AttachmentSize
flashnode-handle-percentage-dimensions.patch 5.75 KB

#7

I changed to swftools because I wanted to put swf's between texts, swf tools gives the ability to set width to 100%

#8

For the life of me, I can't get this working... I successfully made all changes a-la flevour's patch, cross-referenced with the other patch.. fixing 1 error.. I manually edited the tables for flashnode using the provided alter code, I ran update.php

Nothing.

It successfully accepts "100%", and successfully populates the form on re-load with the correct percentage.. but as soon as it's embedded into the page, it shows up as "width":100
I double checked the flashnode_content function.. it's checking that it can have a % at the end.

I have SWFTools in use and have tried using all 3 embed modes available to me (Jquery Flash, SWFObject2, direct embed)

I cleared my cache.

At this point, I can only imagine the solution will be something totally new to me in terms of how drupal works...

Please, any help in this regard is appreciated

#9

I am already using Flash node and SWF Tools together. But I think Flash node overrides width and height values. I need flash blocks thats why I am using flash node, I need flash node.

Please help me to set size of my flash file to 100%.