swcarpentry / DEPRECATED-bc

DEPRECATED: This repository is now frozen - please see individual lesson repositories.
Other
299 stars 383 forks source link

Add height to Eventbrite iframe #563

Closed rgaiacs closed 9 years ago

rgaiacs commented 10 years ago

and values for when using two rooms.

gvwilson commented 10 years ago

I think this approach requires more care and attention from lead instructors (and others editing bootcamp home pages) than we can reasonably expect... :-(

rgaiacs commented 10 years ago

I think this approach requires more care and attention from lead instructors (and others editing bootcamp home pages) than we can reasonably expect... :-(

Agree but AFAIK we can't use Javascript. Could we get this merge and open another issue for setting the height automatically?

ChaosEvoker commented 10 years ago

Is there a reason that we can't use Javascript? That seems like the easiest way to get the type of dynamic height you are looking for.

gvwilson commented 10 years ago

@r-gaia-cs ?

rgaiacs commented 10 years ago

Is there a reason that we can't use Javascript? That seems like the easiest way to get the type of dynamic height you are looking for.

You can use Javascript to dynamic change the height of the iframe but you first need to know the value of the height. Unfortunately you can't use Javascript to get the height of the elements inside the iframe to set the properly value for the iframe due same origin policy:

Cross-origin script API access

JavaScript APIs such as iframe.contentWindow, window.parent, window.open and window.opener allow documents to directly reference each other. When the two documents do not have the same origin, these references provide limited access to the Window and Location objects.

I couldn't use Javascript and when asked all the Javascript expert that I know they all said that what I want isn't possible due this same origin policy.

ChaosEvoker commented 10 years ago

Oh, yeah that's not possible AFAIK. Is there a way to know what type of page you will be getting from the URL target of the iframe? If we can figure out what we are going to get ahead of time, then we can preemptively set the height based on a data structure mapping targets to heights.

rgaiacs commented 10 years ago

Oh, yeah that's not possible AFAIK. Is there a way to know what type of page you will be getting from the URL target of the iframe? If we can figure out what we are going to get ahead of time, then we can preemptively set the height based on a data structure mapping targets to heights.

The only information from the URL is Eventbrite ID. So there is no way to know that in advance.

One option was what I suggested previous: let the user set the height. Another option is add another metadata at YAML header saying the number of rooms, add some conditions at the page to be handle by Jekyll and maybe this part to _includes to keep index.html small to novices.