<script type="text/javascript" src="unit/Search.js"></script>
<script type="text/javascript" src="unit/Preview.js"></script>
<script type="text/javascript" src="unit/Permalinks.js"></script>
+ <script type="text/javascript">
+ $(document).ready(function() {
+ var header = $('#qunit-header');
+ header.html( header.html() + ' - ' + common.testHost );
+ header = null;
+ });
+ </script>
</head>
// Defines common variables for testing
-// $$$ TODO make test host auto-magic
-common = {
- testHost: 'http://www-testflip.archive.org'
- //testHost: 'http://www-mang.archive.org'
+// What host to use for testing
+function testHost() {
+ // Autodetect if running from a home directory, or use live site
+ var user = null;
+ var patterns = [ new RegExp('.*?/~(.*?)/'), new RegExp('www-(.*?)\\.') ]
+ for (index in patterns) {
+ var match = patterns[index].exec(document.location.href);
+ if (match) {
+ user = match[1];
+ break;
+ }
+ }
+
+ if (user) {
+ return 'http://www-' + user + '.archive.org';
+ }
+
+ return 'http://www.archive.org'; // live site
+}
+
+var common = {
+ testHost: testHost(),
}
// Set up dummy BookReader class for JSLocate
module("JSLocate");
+// $$$ locate will fail when called from the same domain since the browser will not honour the
+// redirect to the datanode
+
asyncTest("JSLocate for notesonsubmarine00grea", function() {
expect(1);
$.getScript( jsLocateURL('notesonsubmarine00grea'),