annotate test-data/index.html @ 3:7342f467507b draft

Uploaded v0.4 of JBrowse
author iuc
date Thu, 31 Dec 2015 13:58:43 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
1 <!DOCTYPE html>
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
2 <html>
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
3 <head>
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
5 <title>JBrowse</title>
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
6 <link rel="stylesheet" type="text/css" href="css/genome.css">
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
7 </head>
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
8 <body>
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
9
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
10 <script type="text/javascript">
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
11 // jshint unused: false
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
12 var dojoConfig = {
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
13 async: true,
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
14 baseUrl: './src',
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
15 has: {
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
16 'host-node': false // Prevent dojo from being fooled by Electron
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
17 }
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
18 };
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
19 // Move Electron's require out before loading Dojo
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
20 if(window.process&&process.versions&&process.versions.electron) {
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
21 window.electronRequire = require;
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
22 delete window.require;
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
23 }
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
24 </script>
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
25 <script type="text/javascript" src="src/dojo/dojo.js"></script>
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
26 <script type="text/javascript" src="src/JBrowse/init.js"></script>
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
27 <script type="text/javascript">
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
28 window.onerror=function(msg){
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
29 if( document.body )
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
30 document.body.setAttribute("JSError",msg);
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
31 }
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
32
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
33 // puts the main Browser object in this for convenience. feel
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
34 // free to move it into function scope if you want to keep it
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
35 // out of the global namespace
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
36 var JBrowse;
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
37 require(['JBrowse/Browser', 'dojo/io-query', 'dojo/json' ],
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
38 function (Browser,ioQuery,JSON) {
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
39 // the initial configuration of this JBrowse
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
40 // instance
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
41
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
42 // NOTE: this initial config is the same as any
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
43 // other JBrowse config in any other file. this
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
44 // one just sets defaults from URL query params.
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
45 // If you are embedding JBrowse in some other app,
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
46 // you might as well just set this initial config
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
47 // to something like { include: '../my/dynamic/conf.json' },
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
48 // or you could put the entire
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
49 // dynamically-generated JBrowse config here.
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
50
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
51 // parse the query vars in the page URL
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
52 var queryParams = ioQuery.queryToObject( window.location.search.slice(1) );
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
53
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
54 var config = {
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
55 containerID: "GenomeBrowser",
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
56
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
57 dataRoot: queryParams.data,
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
58 queryParams: queryParams,
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
59 location: queryParams.loc,
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
60 forceTracks: queryParams.tracks,
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
61 initialHighlight: queryParams.highlight,
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
62 show_nav: queryParams.nav,
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
63 show_tracklist: queryParams.tracklist,
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
64 show_overview: queryParams.overview,
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
65 show_menu: queryParams.menu,
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
66 show_tracklabels: queryParams.tracklabels,
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
67 highResolutionMode: queryParams.highres,
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
68 stores: { url: { type: "JBrowse/Store/SeqFeature/FromConfig", features: [] } },
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
69 makeFullViewURL: function( browser ) {
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
70
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
71 // the URL for the 'Full view' link
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
72 // in embedded mode should be the current
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
73 // view URL, except with 'nav', 'tracklist',
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
74 // and 'overview' parameters forced to 1.
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
75
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
76 return browser.makeCurrentViewURL({ nav: 1, tracklist: 1, overview: 1 });
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
77 },
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
78 updateBrowserURL: true
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
79 };
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
80
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
81 //if there is ?addFeatures in the query params,
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
82 //define a store for data from the URL
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
83 if( queryParams.addFeatures ) {
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
84 config.stores.url.features = JSON.parse( queryParams.addFeatures );
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
85 }
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
86
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
87 // if there is ?addTracks in the query params, add
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
88 // those track configurations to our initial
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
89 // configuration
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
90 if( queryParams.addTracks ) {
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
91 config.tracks = JSON.parse( queryParams.addTracks );
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
92 }
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
93
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
94 // if there is ?addStores in the query params, add
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
95 // those store configurations to our initial
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
96 // configuration
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
97 if( queryParams.addStores ) {
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
98 config.stores = JSON.parse( queryParams.addStores );
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
99 }
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
100
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
101 // create a JBrowse global variable holding the JBrowse instance
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
102 JBrowse = new Browser( config );
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
103 });
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
104 </script>
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
105
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
106 </head>
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
107
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
108 <body>
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
109 <div id="GenomeBrowser" style="height: 100%; width: 100%; padding: 0; border: 0;"></div>
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
110 <div style="display: none">JBrowseDefaultMainPage</div>
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
111 </body>
7342f467507b Uploaded v0.4 of JBrowse
iuc
parents:
diff changeset
112 </html>