On 23-3-2012 13:53, Jasha Joachimsthal wrote:
> 
>
> On 23 March 2012 13:42, Dennis van der Laan <[email protected]> wrote:
>
>> On 23-3-2012 13:36, Jasha Joachimsthal wrote:
>>> On 23 March 2012 13:29, Franklin, Matthew B. <[email protected]>
>> wrote:
>>>>> -----Original Message-----
>>>>> From: Jasha Joachimsthal [mailto:[email protected]]
>>>>> Sent: Friday, March 23, 2012 8:16 AM
>>>>> To: [email protected]
>>>>> Subject: Re: iframe height of opensocial gadgets
>>>>>
>>>>> @Matt: dynamic height is supported in native gadgets, but Dennis is
>>>>> creating an iframe gadget where the iframe inside the gadget needs the
>>>> full
>>>>> height.
>>>> Not sure what you mean by full height.  Maybe I am missing something but
>>>> it sounds like the gadgets have a height attribute that is not currently
>>>> being respected by rave, which is overriding it with 250px.  We do want
>> to
>>>> support letting the gadget define a default height other than 250px.
>>>>
>>>>
>>> I don't mean the height attribute of the gadget definition, but the
>> height
>>> attribute of the <iframe> inside the gadget definition. That one is
>> unknown
>>> (or "100%"). The gadget itself doesn't know how much height the content
>> of
>>> the iframe needs and the iframe content itself cannot directly call it's
>>> parent because they run in different domains.
>> I don't know exactly what Jasha is saying. Do you mean that when we use
>> locked domains, the rpc-trick will not work for iframes within our
>> gadgets? I haven't tried this, so I can't confirm it.
>> What Matt is describing, is exactly what I want at this moment: if a
>> gadget defines a 'height' attribute in the gadget definition, the
>> created iframe (not by the gadget, but by Rave) should have this height
>> set as an attribute.
>>
>> Dennis
>>
>>>
>>>> -Matt
>>>>
>>>>> On 23 March 2012 12:49, Franklin, Matthew B. <[email protected]>
>> wrote:
>>>>>>> -----Original Message-----
>>>>>>> From: Dennis van der Laan [mailto:[email protected]]
>>>>>>> Sent: Friday, March 23, 2012 6:43 AM
>>>>>>> To: [email protected]
>>>>>>> Subject: Re: iframe height of opensocial gadgets
>>>>>>>
>>>>>>> Hi Jasha,
>>>>>>>
>>>>>>> On 23-3-2012 11:16, Jasha Joachimsthal wrote:
>>>>>>>> On 22 March 2012 22:28, Dennis van der Laan <
>> [email protected]
>>>>>>> wrote:
>>>>>>>>> My first question is that I noticed gadgets which have a 'height'
>>>>>>>>> argument in the gadget moduleprefs, are not resized to that height.
>>>>> The
>>>>>>>>> iframe created for those gadgets have a 'default' height of 250px.
>> I
>>>>>>>>> tried to search for the code where the iframe is created or the
>>>> height
>>>>>>>>> is set, but I was unable to find it. Can anybody confirm that the
>>>>>> height
>>>>>>>>> of the gadget iframe is not resized, based on the 'height' argument
>>>> in
>>>>>>>>> the ModulePrefs, or is the gadget module incorrect?
>>>>>>>>>
>>>>>>>>>
>>>>>>>> The dynamic-height cannot detect how much height the iframe needs.
>>>>> You
>>>>>>>> should be able to let the iframe content notify the container to
>>>> resize
>>>>>> the
>>>>>>>> iframe with rpc relay calls. As an example the gadget definition in
>>>> [1]
>>>>>>>> registers the rpc and calls the adjustHeight. The content of the
>>>> iframe
>>>>>> is
>>>>>>>> rendered with [2]. The iframe content does an rpc call to the
>>>>>> adjustHeight.
>>>>>>>> As you may see, we've injected the Shindig host there, but at least
>>>> in
>>>>>> the
>>>>>>>> gadget it can be replaced with
>>>>>> gadgets.rpc.getOrigin(window.location.href)
>>>>>>>> (haven't checked for the iframe content).
>>>>>>>>
>>>>>>>> [1]
>>>>>>>> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-
>>>>>>> teams-war/src/main/webapp/WEB-INF/jsp/teams.jsp
>>>>>>>> [2]
>>>>>>>> https://github.com/OpenConext/OpenConext-teams/blob/master/coin-
>>>>>>> teams-war/src/main/webapp/WEB-INF/tags/genericpage.tag
>>>>>>> For most of our gadgets, we indeed use dynamic height, by letting the
>>>>>>> gadget call gadgets.window.adjustHeight(). The rpc-call by which an
>>>>>>> iframe can control the gadgets height is new to me, so thanks for
>> this
>>>>>>> example!
>>>>>>> Unfortunately, we also want to use off-the-shelf gadgets from third
>>>>>>> parties and they do not use these constructs. I guess providing a
>>>>>>> 'height' attribute in the ModulePrefs element is optional for a
>>>> platform
>>>>>>> to support, but because google at least supports it, most
>> iframe-based
>>>>>>> gadgets just provide a static height in their gadget definition.
>>>>>>> As I mentioned, Rave (or Shindig?) currently generates iframes with a
>>>>>>> default height of 250px, which is hardcoded in the html (not by using
>>>>>>> CSS). Can you point me to the code where this iframe is generated?
>>>> Maybe
>>>>>>> I can provide a patch for supporting the 'height' attribute.
>>>>>> Sounds like a bug.  I thought we had support for the height property
>> of
>>>>>> OpenSocial gadgets, so not sure why it isn't working.  If you want to
>>>> look
>>>>>> through rave_opensocial.js, find where the issue is and provide a
>> patch,
>>>>>> that would be great!  A jira ticket will need to be created for this
>>>> issue.
> Okay, now even I am confused.
> Dennis, do you have a gadget with an iframe inside the definition or are
> you talking about the iframe that is created by the portal/Shindig in which
> the gadget is rendered?
>
The second one... I'm very sorry to create so much confusion for a
relatively small issue. I guess I'm not too familiar with all the terms
you use and who creates what.
I think the confusion started because I thanked you for your rpc-trick,
which IS used when a gadget creates its own iframe (within the iframe
created by Rave?/Shindig?). We have gadgets doing that, so the rpc-trick
will come in handy, but is has nothing to do with a gadget definition
having a height attribute set in the ModulePrefs :)

-- 
Dennis van der Laan, MSc
Centre for Information Technology
University of Groningen

Reply via email to