height & width settings

IT100 - October 6, 2008 - 13:23
Project:Flash Node
Version:6.x-3.1
Component:User interface
Category:feature request
Priority:normal
Assigned:flevour
Status:needs review
Description

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.

#1

IT100 - October 7, 2008 - 19:27
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

Anonymous (not verified) - October 21, 2008 - 19:32
Status:fixed» closed

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

#3

julien66 - October 21, 2009 - 12:03
Status:closed» 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

alxsvdr - October 27, 2009 - 13:57

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

alxsvdr - October 27, 2009 - 15:39

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

flevour - November 30, 2009 - 11:39
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

IT100 - December 6, 2009 - 08:52

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

 
 

Drupal is a registered trademark of Dries Buytaert.