On 4/25/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to implement an exhibit for offline use. Followed the instructions > in WIKI but without success.
Let's take my fairly straight-forward http://exhibit.ecmanaut.googlepages.com/installed-fonts.html exhibit as an example. I use code like this in exhibits I want to use both online and offline interchangeably, without modifying the exhibit itself. I have checked out the subversion repositories for Exhibit and Timeline to the (somewhat datedly named) /Users/jhs/cvs directory. In this particular example, I also link a css style sheet from the same location, using this code in the <head> tag where you would normally link the Exhibit API: <script type="text/javascript"> function load( url ) { var script = '<script type="text/javascript" src="'+ url +'"></scr'+'ipt>\n'; document.write( script ); } function css( url ) { var link = '<link rel="stylesheet" href="'+ url +'" type="text/css" />\n'; document.write( link ); } if( location.protocol != "file:" ) { css( "http://simile.mit.edu/exhibit/examples/presidents/styles.css" ); load( "http://simile.mit.edu/repository/exhibit/branches/2.0/src/webapp/api/exhibit-api.js?views=timeline&bundle=false" ); } else { css( "/Users/jhs/cvs/exhibit/src/webapp/examples/presidents/styles.css" ); load( "/Users/jhs/cvs/exhibit/src/ajax/api/simile-ajax-api.js?bundle=false" ); load( "/Users/jhs/cvs/timeline/src/webapp/api/timeline-api.js?bundle=false" ); load( "/Users/jhs/cvs/exhibit/src/webapp/api/exhibit-api.js?bundle=false" ); } </script> You may want to compensate for exact paths; for instance, this uses the 2.0 exhibit API branch (in the online case, if clause), which you might not want to do. Feel very invited to share on the wiki. You probably want to drop the bundle=false bits too to use bundled (quicker loading) versions instead of separate files; my preferences as an API developer are likely a bit atypical. -- / Johan Sundström, http://ecmanaut.blogspot.com/ _______________________________________________ General mailing list [email protected] http://simile.mit.edu/mailman/listinfo/general
