-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcommon.js
59 lines (55 loc) · 1.43 KB
/
common.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
/* Viewing ligand in 3d pocket */
/* Change clicked row's style class from 'normal' to 'clicked' */
var clicked_id = null;
var highlighted_id = null; /* highlited conformer */
var max_id = null
/* Check if query smiles is not empty */
function check_empty_field(form, field) {
loading();
if(field.value != "") {
form.submit();
}
else {
alert("You must supply molecule!");
loading(false);
}
}
function showClickedConformation(clicked_id) {
target = document.getElementById("row-conf-" + clicked_id);
highlited = document.getElementById("row-conf-" + highlighted_id);
if (highlited) {
if(highlighted_id % 2 == 0) {
highlited.className = 'even';
}
else {
highlited.className = 'odd';
}
}
// if(highlighted_id) {
//// if(clicked_id > highlighted_id) {
// target.scrollIntoView();
//// }
//// else {
//// target.scrollIntoView(false);
//// }
// //$('#row-conf-' + clicked_id).localScroll();
// }
Jmol.script(jmolApplet0,'model 2.' + clicked_id);
target.className = 'clicked';
highlighted_id = clicked_id;
}
/* Show next or previous conformer in Jmol and highlight appropriate row */
function showNextConformation() {
if (highlighted_id < max_id) {
conf_num = highlighted_id + 1;
showClickedConformation(conf_num);
highlighted_id = conf_num;
}
}
function showPrevConformation() {
if (highlighted_id > 1) {
conf_num = highlighted_id - 1;
showClickedConformation(conf_num);
highlighted_id = conf_num;
}
}