Skip to content

Commit a30b411

Browse files
committed
Fix some cursed regex buried in JSON string to find assembly name
1 parent 6999d56 commit a30b411

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

jbrowse/plugins/ExportSequence/js/ExportSequence.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,30 @@ define( ["dojo/_base/declare", 'dojo/_base/array','dojo/_base/lang','dojo/aspect
99
endCoord = endCoord.replace(/\.\d+$/,'');
1010
//var coordStr = visibleRegion.ref+":"+visibleRegion.start+"-"+visibleRegion.end;
1111
var current_url = window.location.href;
12-
var genome_regex = /data\=data\.(.+?)\&/;
12+
var genome_regex = /data\=data%2F(.+?)\&/;
1313
var genome_regex_matches = current_url.match(genome_regex);
1414
var coordStr = "searchInput=" + visibleRegion.ref+":"+startCoord+"-"+endCoord;
15-
//console.log(genome_regex_matches[1]);
15+
//console.log(genome_regex_matches[1]);
1616
if (genome_regex_matches!== null && genome_regex_matches[1].length >0){
1717

1818
coordStr +="&genome="+genome_regex_matches[1];
1919

2020
}
2121
var opts=this.inherited(arguments); //call the parent classes function
2222
opts.push( // add an extra menu item to the array returned from parent class function
23-
{
23+
{
2424
label: "Search for Guides",
2525
type: 'dijit/LinkPane',
2626
onClick: function() {
27-
27+
2828
window.open("http://"+location.hostname+"/src/guide-finder/GuideInitialize.py?action=initialize&"+coordStr);
29-
30-
},
29+
30+
},
3131
iconClass: "dijitIconPackage"
32-
}
33-
);
32+
}
33+
);
3434
return opts;
35-
}
36-
});
37-
}
35+
}
36+
});
37+
}
3838
);

src/setup/trackList.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"modify" : "function( track, feature, div ) { setColor='green'; if(feature.get('type') == 'ncRNA_gene'){ setColor='#8F6F8B';} else if(feature.get('type') == 'pseudogene'){setColor='#575256';} div.style.backgroundColor = setColor; }"
3434
},
3535
"onClick" : {
36-
"url" : "function(){ var genome_match = location.href.match(/data=data\.(.+?)\&/); return location.protocol+'//'+location.hostname+'/src/primer-design/web/geneFeatures.html?gene={Name}&ensid={gene_id}&org='+genome_match[1] }",
36+
"url" : "function(){ var genome_match = location.href.match(/data=data%2F(.+?)\&/); return location.protocol+'//'+location.hostname+'/src/primer-design/web/geneFeatures.html?gene={Name}&ensid={gene_id}&org='+genome_match[1] }",
3737
"action" : "iframeDialog",
3838
"label" : "{Name} Info, Guides, and Primers"
3939
},
@@ -76,7 +76,7 @@
7676
"onClick" : {
7777
"action" : "iframeDialog",
7878
"iconClass" : "dijitIconDatabase",
79-
"url" : "function(){ var genome_match = location.href.match(/data=data\.(.+?)\&/); return location.protocol+'//'+location.hostname+'/src/primer-design/web/geneFeatures.html?gene={batchName}&ensid={ensid}&org='+genome_match[1] }",
79+
"url" : "function(){ var genome_match = location.href.match(/data=data%2F(.+?)\&/); return location.protocol+'//'+location.hostname+'/src/primer-design/web/geneFeatures.html?gene={batchName}&ensid={ensid}&org='+genome_match[1] }",
8080
"title" : "{batchName} Info, Guides and Primers",
8181
"label": "<b>{label}</b><ul><li>Specificity Score: <b>{guideScore}</b></li><li>Off-targets for 0-1-2-3-4 mismatches:<b> {otDesc}</b>&nbsp&nbsp</li><p><b>{Notes}</b></p></ul>"
8282
}
@@ -97,10 +97,10 @@
9797
"onClick" : {
9898
"action" : "iframeDialog",
9999
"iconClass" : "dijitIconDatabase",
100-
"url" : "function(){ var genome_match = location.href.match(/data=data\.(.+?)\&/); return location.protocol+'//'+location.hostname+'/src/primer-design/web/geneFeatures.html?gene={batchName}&ensid={ensid}&org='+genome_match[1] }",
100+
"url" : "function(){ var genome_match = location.href.match(/data=data%2F(.+?)\&/); return location.protocol+'//'+location.hostname+'/src/primer-design/web/geneFeatures.html?gene={batchName}&ensid={ensid}&org='+genome_match[1] }",
101101
"title" : "{batchName} Info, Guides, and Primers",
102102
"label" : "<ul><li>Gene: <b>{batchName}&nbsp&nbsp&nbsp</b></li><li>TM: <b>{tm}&nbsp&nbsp&nbsp</b></li><li>GC%: <b>{gc}&nbsp&nbsp&nbsp&nbsp</b></li><p>Notes: {pair_notes}</li></p></ul>"
103-
}
103+
}
104104
},
105105
{
106106
"compress" : 0,

src/setup/trackList_no_regulatory.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"modify" : "function( track, feature, div ) { setColor='green'; if(feature.get('type') == 'ncRNA_gene'){ setColor='#8F6F8B';} else if(feature.get('type') == 'pseudogene'){setColor='#575256';} div.style.backgroundColor = setColor; }"
3434
},
3535
"onClick" : {
36-
"url" : "function(){ var genome_match = location.href.match(/data=data\.(.+?)\&/); return location.protocol+'//'+location.hostname+'/src/primer-design/web/geneFeatures.html?gene={Name}&ensid={gene_id}&org='+genome_match[1] }",
36+
"url" : "function(){ var genome_match = location.href.match(/data=data%2F(.+?)\&/); return location.protocol+'//'+location.hostname+'/src/primer-design/web/geneFeatures.html?gene={Name}&ensid={gene_id}&org='+genome_match[1] }",
3737
"action" : "iframeDialog",
3838
"label" : "{Name} Info, Guides, and Primers"
3939
},
@@ -64,7 +64,7 @@
6464
"onClick" : {
6565
"action" : "iframeDialog",
6666
"iconClass" : "dijitIconDatabase",
67-
"url" : "function(){ var genome_match = location.href.match(/data=data\.(.+?)\&/); return location.protocol+'//'+location.hostname+'/src/primer-design/web/geneFeatures.html?gene={batchName}&ensid={ensid}&org='+genome_match[1] }",
67+
"url" : "function(){ var genome_match = location.href.match(/data=data%2F(.+?)\&/); return location.protocol+'//'+location.hostname+'/src/primer-design/web/geneFeatures.html?gene={batchName}&ensid={ensid}&org='+genome_match[1] }",
6868
"title" : "{batchName} Info, Guides and Primers",
6969
"label" : "<b>{label}</b><ul><li>Specificity Score: <b>{guideScore}</b></li><li>Off-targets for 0-1-2-3-4 mismatches:<b> {otDesc}</b>&nbsp&nbsp</li><p><b>{Notes}</b></p></ul>" }
7070
},
@@ -84,10 +84,10 @@
8484
"onClick" : {
8585
"action" : "iframeDialog",
8686
"iconClass" : "dijitIconDatabase",
87-
"url" : "function(){ var genome_match = location.href.match(/data=data\.(.+?)\&/); return location.protocol+'//'+location.hostname+'/src/primer-design/web/geneFeatures.html?gene={batchName}&ensid={ensid}&org='+genome_match[1] }",
87+
"url" : "function(){ var genome_match = location.href.match(/data=data%2F(.+?)\&/); return location.protocol+'//'+location.hostname+'/src/primer-design/web/geneFeatures.html?gene={batchName}&ensid={ensid}&org='+genome_match[1] }",
8888
"title" : "{batchName} Info, Guides, and Primers",
8989
"label" : "<ul><li>Gene: <b>{batchName}&nbsp&nbsp&nbsp</b></li><li>TM: <b>{tm}&nbsp&nbsp&nbsp</b></li><li>GC%: <b>{gc}&nbsp&nbsp&nbsp&nbsp</b></li><p>Notes: {pair_notes}</li></p></ul>"
90-
}
90+
}
9191
},
9292
{
9393
"compress" : 0,

0 commit comments

Comments
 (0)