[Developers] paths for referencing javascript files from client side in acre

Stefano Mazzocchi stefano at metaweb.com
Sat Jul 4 18:21:52 UTC 2009


Iain Sproat wrote:
> Thanks Stefano, it works.

Awesome.

I was thinking that, in theory, we could add a parameter that could turn 
off 'execution' of scripts by acre and just return the source code 
behind it, but I'm not sure how much more useful than just making a copy 
this is.

> Any idea how to delete files in acre?  As a workaround I had copied and 
> pasted the code into a file in my app, and now it's not needed I'd like 
> to delete the file, but can't seem to find the button....

If you hover the file name on the sidebar on the left with your mouse, a 
'x' shows up next to it. Clicking that 'x' deletes the file.

But it is a good point that it might be hard to discover... maybe we 
should also add a 'delete' action in the file menu too.

Thoughts?

> Iain
> 
> On Sat, Jul 4, 2009 at 8:30 PM, Stefano Mazzocchi <stefano at metaweb.com 
> <mailto:stefano at metaweb.com>> wrote:
> 
>     Iain Sproat wrote:
>      > What's the correct path for referencing javascript files from
>     other acre
>      > apps on the client side?
>      >
>      > I'm using acre and trying to reuse the date javascript library
>     from the
>      > freebase libraries app.  I've got the following line in my client
>     side
>      > code, <script type="text/javascript"
>      >
>     src="http://libraries.apps.freebase.dev.freebaseapps.com/date"></script>.
>      > But this doesn't seem to work.
> 
>     Right, this doesn't work because that file is marked as a 'script' which
>     means that if called directly, acre will load it and *execute it* and
>     then return you the results of that execution, which is empty since that
>     script doesn't write anything to the output.
> 
>      > The script can be seen
>      > at
>     http://acre.freebase.com/#app=/freebase/apps/libraries&file=date
>     <http://acre.freebase.com/#app=/freebase/apps/libraries&file=date>
>      > <http://acre.freebase.com/#app=/freebase/apps/libraries&file=date
>     <http://acre.freebase.com/#app=/freebase/apps/libraries&file=date>>
>      > I can't use the acre.require command as it is on the server side.
> 
>     I've made a copy of that file and marked it as 'file' instead of script,
>     so that Acre will just send it back to you instead of executing it. Find
>     it at
> 
>      http://libraries.apps.freebase.dev.freebaseapps.com/date_client_side
> 
>     Hope this helps.
> 
>     --
>     Stefano Mazzocchi                              Application Catalyst
>     Metaweb Technologies, Inc.                      stefano at metaweb.com
>     <mailto:stefano at metaweb.com>
>     -------------------------------------------------------------------
> 
>     _______________________________________________
>     Developers mailing list
>     Developers at freebase.com <mailto:Developers at freebase.com>
>     http://lists.freebase.com/mailman/listinfo/developers
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers


-- 
Stefano Mazzocchi                              Application Catalyst
Metaweb Technologies, Inc.                      stefano at metaweb.com
-------------------------------------------------------------------



More information about the Developers mailing list