Awesome, I've patched this in and submitted it. Unfortunately, I wasn't able
to do any real testing because it seems like cajoling is broken in Shindig.
Are you guys aware of this issue?
If I start up the sample container with the default gadget and check "use
caja". I get this exception:
2008-03-11 15:15:51.493::WARN: /gadgets/ifr
java.lang.RuntimeException: Unrecognized node: MultiDeclaration
at
com.google.caja.parser.quasiliteral.AbstractRewriter.expand(AbstractRewriter.java:135)
at
com.google.caja.parser.quasiliteral.AbstractRewriter.expandAll(AbstractRewriter.java:251)
at
com.google.caja.parser.quasiliteral.DefaultJsRewriter$1.fire(DefaultJsRewriter.java:64)
Let me know if you need any more information on how to reproduce the issue.
Thanks!
- Cassie
On Mon, Mar 10, 2008 at 11:17 PM, Mike Samuel <[EMAIL PROTECTED]> wrote:
>
>
> On 10/03/2008, Cassie <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > On Fri, Mar 7, 2008 at 8:21 PM, Mike Samuel <[EMAIL PROTECTED]>
> > wrote:
> >
> > >
> > >
> > > On 07/03/2008, Cassie <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Mike - looking at the patch I just have one question:
> > > >
> > > > - ___.allowCall(outers.opensocial, 'newDataRequest');
> > > > - ___.allowCall(outers.opensocial, 'newActivity');
> > > > ...
> > > >
> > > > + ___.all2(
> > > > + ___.allowCall, opensocial.Container.prototype,
> > > > + ['requestSendMessage', 'requestShareApp',
> > > > 'requestCreateActivity',
> > > > + 'hasPermission', 'requestPermission', 'getEnvironment',
> > > > 'newDataRequest',
> > > > + 'newActivity', 'newActivityMediaItem', 'newMessage']);
> > >
> > >
> > > Ok. All those functions were available on an opensocial object
> > > previously.
> > >
> > > How is opensocial exposed now?
> > >
> >
> > I don't quite understand. Like I mentioned above the functions are on
> > the opensocial object (they have always been there). I pasted the code in
> > the thread which shows how the methods were exposed before. This would be
> > line 494-504 in the container.js file.
> >
> > Hopefully you can tell me how to expose opensocial in the new format,
> > because I don't know how you are exposing it now :)
> >
>
> Ok, so these are functions attached to opensocial, not
> Opensocial.container?
>
> I tried that initially and got runtime errors. It seems to work now.
> Maybe that was caused by the breakage that Kevin was talking about.
>
> Attached is an updated patch that rolls that back, that removes the, no
> longer needed, calls to allow Array.sort and Array.push, and that includes
> an update caja.js.
>
> mike
>
>
>
>
>
>
> - Cassie
> >
> >
> >
> > >
> > >
> > >
> > >
> > >
> > > The added code there throws the allow call onto the Container class...
> > > > however, its not the Container class that gadgets use. They just use
> > > > opensocial.newDataRequest() ie a static function.
> > > > How do we change that code to reflect that difference?
> > > >
> > > > Once we fix that everything else looks fine for a first submit.
> > > > (and getting the next change from you for pulling from jars will
> > > > just be added greatness.)
> > > >
> > > > - Cassie
> > > >
> > > >
> > > > On Fri, Mar 7, 2008 at 2:09 AM, Mike Samuel <[EMAIL PROTECTED]>
> > > > wrote:
> > > >
> > > > > Attached is a patch.
> > > > >
> > > > > Kevin suggested that it'd be a good idea to get the added files
> > > > > from the Caja JAR instead of copying them into the shindig source
> > > > > tree.
> > > > > He also suggested consolidating and minifying those files in the
> > > > > JAR since shindig doesn't do runtime minification.
> > > > >
> > > > > That's a great idea but I'd like to do that in a separate change.
> > > > > I will talk to Mike Stay on Caja to make sure the jar contains those
> > > > > files
> > > > > or a minified JS bundle in future versions.
> > > > >
> > > > >
> > > > >
> > > > > features/caja contains runtime support for Cajoling of gadgets.
> > > > > See code.google.com/p/google-caja
> > > > >
> > > > > DOMita provides a partial fake DOM Level 2 implementation that
> > > > > gates gadget access to the DOM
> > > > >
> > > > > This change adds DOMita and updates the html sanitizer used when
> > > > > the Caja feature is enabled.
> > > > >
> > > > > Some of the functionality in container.js is redundant with
> > > > > domita, and is removed, but none of that functionality should be
> > > > > triggered
> > > > > when the Caja feature is disabled.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > cheers,
> > > > > mike
> > > > >
> > > >
> > > >
> > >
> >
>