-
Notifications
You must be signed in to change notification settings - Fork 191
/
viewer.js
120 lines (74 loc) · 1.72 KB
/
viewer.js
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
var Viewer = function(){
var entries=[];
var selections=document.getElementById("selections");
this.init=function(){
};
/*
Adds a new selection object and initializes it
*/
this.add_entry = function(type, parent){
var li = document.createElement('li');
if(type == "Model"){
var model = new Model();
entries.push(model);
var model_string = document.createElement('input');
var label = document.createElement('p');
label.className="label"
label.innerHTML="M";
li.appendChild(label);
li.appendChild(model_string);
li.className="entry"
li.style.float="left";
}else if(type == "Selection"){
var selection = new Selection();
entries.push(selection);
var selection_string
}else if(type == "Label"){
}
var selections=document.getElementById("selections");
selections.appendChild(li);
};
this.read_url = function(){
var url = window.location.search.substr(1);
}
this.update_url = function(){
};
};
function openNav() {
document.getElementById("sidenav").style.width = "250px";
glviewer.translate(-125,0,500);
}
/* Set the width of the side navigation to 0 */
function closeNav() {
document.getElementById("sidenav").style.width = "0";
glviewer.translate(125,0,500);
}
var Model = function(){
this.type="PDB";
this.selections=[];
this.model="";
this.createModel = function(){
console.log("model");
}
this.addChild= function(){
}
}
var Selection = function(){
this.type=null;
this.query="";
this.style;
this.labels=[];
this.addChild= function(){
}
};
var Style = function(){
}
var Label = function(){
this.text="";
};
var Menu = function(){
this.items = [];
this.actions = [];
}
var state = new Viewer();
state.init();