Based on what Steve did, I did a first cut at making the URL's more configurable, using one of the sample sites.

Index: webapp/extensions/time/time-extension.js
===================================================================
--- webapp/extensions/time/time-extension.js    (revision 1720)
+++ webapp/extensions/time/time-extension.js    (working copy)
@@ -23,11 +23,12 @@
         return;
     }
     Exhibit.TimeExtension.urlPrefix = url.substr(0, 
url.indexOf("time-extension.js"));
-        
+    Exhibit.TimeExtension.urlShortPrefix = url.substr(0, 
url.indexOf('exhibit/'))
+ 
     var paramTypes = { bundle: Boolean };
     SimileAjax.parseURLParameters(url, Exhibit.TimeExtension.params, 
paramTypes);
         
-    var scriptURLs = [ 
"http://static.simile.mit.edu/timeline/api-2.2.0/timeline-api.js"; ];
+    var scriptURLs = [ Exhibit.TimeExtension.urlShortPrefix + 
"/timeline/api-2.2.0/timeline-api.js" ];
     var cssURLs = [];
         
     if (Exhibit.TimeExtension.params.bundle) {
Index: webapp/site/examples/billionaires/billionaires.html
===================================================================
--- webapp/site/examples/billionaires/billionaires.html (revision 1720)
+++ webapp/site/examples/billionaires/billionaires.html (working copy)
@@ -2,12 +2,14 @@
 <head>
     <title>SIMILE | Exhibit | Billionaires</title>
     
+  
+  
+    
     <link href="billionaires.js" type="application/json" rel="exhibit/data" />
+    <script 
src="http://localhost:8888/exhibit/api/exhibit-api.js?bundle=false";></script>
     
-    <script 
src="http://static.simile.mit.edu/exhibit/api-2.1.0/exhibit-api.js";></script>
-    
     <!-- google map key for the simile web site -->
-    <script 
src="http://static.simile.mit.edu/exhibit/extensions-2.1.0/map/map-extension.js?gmapkey=ABQIAAAA5JLLfCE9c7HAtg25QM2KCRQtmVvwtG6TMOLiwecD59_rvdOkHxTAPhubLidYKS8G8qHrZGTBqAeJEg";></script>
+    <script 
src="http://localhost:8888/exhibit/extensions/map/map-extension.js?gmapkey=ABQIAAAA5JLLfCE9c7HAtg25QM2KCRQtmVvwtG6TMOLiwecD59_rvdOkHxTAPhubLidYKS8G8qHrZGTBqAeJEg";></script>
     
     <link rel='stylesheet' href='styles.css' type='text/css' />
 </head>
Index: webapp/site/examples/cereals/cereal-characters.html
===================================================================
--- webapp/site/examples/cereals/cereal-characters.html (revision 1720)
+++ webapp/site/examples/cereals/cereal-characters.html (working copy)
@@ -4,8 +4,8 @@
     
     <link href="cereal-characters.js" type="application/json" 
rel="exhibit/data" />
     
-    <script 
src="http://static.simile.mit.edu/exhibit/api-2.1.0/exhibit-api.js"; 
type="text/javascript"></script>
-    <script 
src="http://static.simile.mit.edu/exhibit/extensions-2.1.0/time/time-extension.js";
 type="text/javascript"></script>
+    <script 
src="http://localhost:8888/exhibit/api/exhibit-api.js?bundle=false"; 
type="text/javascript"></script>
+    <script 
src="http://localhost:8888/exhibit/extensions/time/time-extension.js?bundle=false";
 type="text/javascript"></script>
     
     <script src="copyright.js" type="text/javascript"></script>
     <link rel='stylesheet' href='styles.css' type='text/css' />
Index: webapp/api/exhibit-api.js
===================================================================
--- webapp/api/exhibit-api.js   (revision 1720)
+++ webapp/api/exhibit-api.js   (working copy)
@@ -8,7 +8,8 @@
  */
 
 (function() {
-    var useLocalResources = false;
+    var useLocalResources = true;
+    var localResourcesURI ="http://localhost:8888";;
     var noAuthentication = false;
     
     if (document.location.search.length > 0) {
@@ -163,7 +164,7 @@
         }
         
         if (useLocalResources) {
-            Exhibit.urlPrefix = "http://127.0.0.1:8888/exhibit/api/";;
+            Exhibit.urlPrefix = localResourcesURI + "/exhibit/api/";
         }
 
         if (Exhibit.params.locale) { // ISO-639 language codes,
@@ -225,12 +226,12 @@
          */
         if (includeTimeline) {
             scriptURLs.push(useLocalResources ?
-                
"http://127.0.0.1:8888/exhibit/extensions/time/time-extension.js"; :
+                localResourcesURI + 
"/exhibit/extensions/time/time-extension.js" :
                 
"http://static.simile.mit.edu/exhibit/extensions-2.0/time/time-extension.js";);
         }
         if (includeMap) {
             scriptURLs.push(useLocalResources ?
-                
"http://127.0.0.1:8888/exhibit/extensions/map/map-extension.js"; :
+                localResourcesURI + "/exhibit/extensions/map/map-extension.js" 
:
                 
"http://static.simile.mit.edu/exhibit/extensions-2.0/map/map-extension.js";);
         }
         
@@ -246,7 +247,7 @@
         window.SimileAjax_onLoad = loadMe;
         
         var url = useLocalResources ?
-            "http://127.0.0.1:8888/ajax/api/simile-ajax-api.js?bundle=false"; :
+            localResourcesURI + "/ajax/api/simile-ajax-api.js?bundle=false" :
             "http://static.simile.mit.edu/ajax/api-2.1.0/simile-ajax-api.js";;
             
         var createScriptElement = function() {

I was trying not to change the underlying code..   I'd love feedback on comments, I'm just starting to learn _javascript_, so extra eyes would be great.  

If this meets approval, what's the best way to submit this for inclusion?

Eric


On Dec 22, 2008, at 11:16 AM, Larry Kluger wrote:


Thanks Steve,

I've created an Exhibit wiki page and added a link to your blog entry.

Regards,

Larry



From: Steve <[email protected]>
To: SIMILE Widgets <[email protected]>
Sent: Monday, December 22, 2008 1:58:37 AM
Subject: Re: simile.mit.edu down?


Hi Larry,
  Fyi, here is what I did to host Exhibit. Feel free to post comments
if there is anything I should clarify.

http://www.stevetrefethen.com/blog/HostingMITsSimileExhibitOSProject.aspx

-Steve

On Dec 19, 10:45 am, Larry Kluger <[email protected]> wrote:
> Hi Steve,
>
> I was wondering if you and the other posters were using Timeline or Exhibit. (Or one of the other fine Simile libraries.)
>
> Anyhow, I don't have much knowledge about Exhibit, but David H is an ace programmer. It may well be the case that the software looks to see if a certain library is already loaded, and, if not, it then loads it from MIT. In that case, the solution is for your html file to load the needed libraries (from your server) before the Exhibit code needs them.
>
> It could also be the case that something in the sw will need to be changed to enable you to host all of Exhibit on your server. In that case, I'm sure that David would be receptive to your patch.
>
> And your step by step instructions on how to locally host Exhibit would be very much appreciated by the community.
>
> Note that David sometimes dynamically adds script tags to the dom. In other words, he tells the browser to load libraries at runtime, not as a normal script tag inside of an html file.
>
> HTH,
>
> Larry




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "SIMILE Widgets" group. 
To post to this group, send email to [email protected] 
To unsubscribe from this group, send email to [email protected] 
For more options, visit this group at http://groups.google.com/group/simile-widgets?hl=en
-~----------~----~----~----~------~----~------~--~---


-----------------------------------------------------
Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 | http://www.opensourceconnections.com



Reply via email to