forked from GMOD/jbrowse
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
163 lines (140 loc) · 7.11 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>JBrowse</title>
<link rel="stylesheet" type="text/css" href="css/genome.css">
<script type="text/javascript">
// jshint unused: false
var dojoConfig = {
async: true,
baseUrl: './src',
has: {
'host-node': false // Prevent dojo from being fooled by Electron
}
};
// Move Electron's require out before loading Dojo
if(window.process&&process.versions&&process.versions.electron) {
window.electronRequire = require;
delete window.require;
}
</script>
<script type="text/javascript" src="src/dojo/dojo.js"></script>
<script type="text/javascript" src="src/JBrowse/init.js"></script>
<script type="text/javascript">
function flankingText(){
alert("Add selected number of bases upstream and downstream of the gene model.");
}
function DownloadText(){
alert("The sequence format for the downloaded image will be in CODATA format only.\nFor other sequence formats, please use copy and paste method.\nDownload option may not function properly with the Safari Browser, so please use an alternative browser.");
}
function showBox(text, obj) {
helpNode = document.createElement('div');
helpNode.id = 'popBox';
helpNode.setAttribute('class','popBox');
helpNode.innerHTML = text;
obj.appendChild(helpNode);
}
function hideBox() {
node = document.getElementById('popBox');
node.parentNode.removeChild(node);
}
window.onerror=function(msg){
if( document.body )
document.body.setAttribute("JSError",msg);
}
// puts the main Browser object in this for convenience. feel
// free to move it into function scope if you want to keep it
// out of the global namespace
var JBrowse;
var queryParams;
require(['JBrowse/Browser', 'dojo/io-query', 'dojo/json' ],
function (Browser,ioQuery,JSON) {
// the initial configuration of this JBrowse
// instance
// NOTE: this initial config is the same as any
// other JBrowse config in any other file. this
// one just sets defaults from URL query params.
// If you are embedding JBrowse in some other app,
// you might as well just set this initial config
// to something like { include: '../my/dynamic/conf.json' },
// or you could put the entire
// dynamically-generated JBrowse config here.
// parse the query vars in the page URL
queryParams = ioQuery.queryToObject( window.location.search.slice(1) );
var config = {
containerID: "GenomeBrowser",
dataRoot: queryParams.data,
queryParams: queryParams,
location: queryParams.loc,
forceTracks: queryParams.tracks,
initialHighlight: queryParams.highlight,
show_nav: queryParams.nav,
show_tracklist: queryParams.tracklist,
show_overview: queryParams.overview,
show_menu: queryParams.menu,
show_fullviewlink: queryParams.fullviewlink,
show_tracklabels: queryParams.tracklabels,
highResolutionMode: queryParams.highres,
stores: { url: { type: "JBrowse/Store/SeqFeature/FromConfig", features: [] } },
bookmarks: { },
makeFullViewURL: function( browser ) {
// the URL for the 'Full view' link
// in embedded mode should be the current
// view URL, except with 'nav', 'tracklist',
// and 'overview' parameters forced to 1.
return browser.makeCurrentViewURL({ nav: 1, tracklist: 1, overview: 1 });
},
updateBrowserURL: true
};
//if there is ?addFeatures in the query params,
//define a store for data from the URL
if( queryParams.addFeatures ) {
config.stores.url.features = JSON.parse( queryParams.addFeatures );
}
// if there is ?addTracks in the query params, add
// those track configurations to our initial
// configuration
if( queryParams.addTracks ) {
config.tracks = JSON.parse( queryParams.addTracks );
}
// if there is ?addBookmarks, add those to configuration
if( queryParams.addBookmarks ) {
config.bookmarks.features = JSON.parse( queryParams.addBookmarks );
}
// if there is ?addStores in the query params, add
// those store configurations to our initial
// configuration
if( queryParams.addStores ) {
config.stores = JSON.parse( queryParams.addStores );
}
// create a JBrowse global variable holding the JBrowse instance
JBrowse = new Browser( config );
<!-- google analytics -->
var is_production = true;
var is_embed = false;
var dev_test = /(-dev)|(-test)/;
var hostname = location.hostname;
if(hostname.search(dev_test) != -1) {
is_production = false;
} // end if(hostname.search(dev_test) != -1)
if(queryParams.nav && queryParams.tracklist && queryParams.overview) {
is_embed = true;
}
if(is_production && !is_embed) {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-48916712-1', 'araport.org');
ga('require', 'linkid', 'linkid.js');
ga('send', 'pageview');
} // end if(is_production)
});
</script>
</head>
<body>
<div id="GenomeBrowser" style="height: 100%; width: 100%; padding: 0; border: 0;"></div>
<div style="display: none">JBrowseDefaultMainPage</div>
</body>
</html>