1+ <!DOCTYPE html>
2+ < html >
3+ < title > GeneCheck </ title >
4+ < head >
5+ < meta charset ="utf-8 ">
6+ < meta name ="viewport " content ="width=device-width, initial-scale=1 ">
7+ < link rel ="stylesheet " href ="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css ">
8+ < script src ="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js "> </ script >
9+ < script src ="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js "> </ script >
10+
11+ < div class ="container ">
12+ < p align ="left "> < nav class ="navbar navbar-default ">
13+ < div class ="container ">
14+ < a href ="home.html " class ="btn btn-default ">
15+ < span class ="glyphicon glyphicon-triangle-left "> </ span > </ a >
16+ < h2 > Fitness</ h2 > </ p >
17+
18+ </ div >
19+ </ head >
20+ < center >
21+ < h1 > Welcome to GeneCheck!</ h1 >
22+ < br >
23+ </ head >
24+ < script >
25+
26+ function identifyDrug ( )
27+ {
28+ setTimeout ( function ( ) {
29+ alert ( 'Drug is tylenol, super strength' ) ;
30+ setTimeout ( function ( ) {
31+ alert ( 'Searching for potentially harmful interactions between this drug and your genetic information' ) ;
32+ setTimeout ( function ( ) { alert ( 'No potential harm detected' ) ; } , 1000 ) ;
33+ } , 500 ) ;
34+ } , 3000 ) ;
35+ }
36+ function search ( userId )
37+ {
38+ alert ( "test search" ) ;
39+ var medName = document . getElementById ( "medicationName" ) . value ;
40+ setMedName ( medName ) ;
41+ alert ( "search:" + medName + " for: " + userId ) ;
42+ var file = "./data/Gene-to-Drug-Sensitivity-Relationships.csv" ;
43+
44+ $ . ajax ( {
45+ url : file ,
46+ dataType : 'text' ,
47+ } ) . done ( searchInData ) ;
48+ }
49+
50+ var medNameToSearch = "" ;
51+
52+ function setMedName ( medName )
53+ {
54+ medNameToSearch = medName ;
55+ alert ( "setMedName: " + medNameToSearch ) ;
56+ }
57+
58+ function searchInData ( data )
59+ {
60+ //alert(data);
61+ var allRows = data . split ( / \r ? \n | \r / ) ;
62+ var rowNum = 0 ;
63+ while ( rowNum < allRows . length )
64+ {
65+ //alert(allRows.length);
66+ var rowCells = allRows [ rowNum ] . split ( ',' ) ;
67+ var url = "" ;
68+ //alert("rowCells[2] = "+rowCells[2]+ " ----- medNameToSearch = "+medNameToSearch);
69+ var found = ( rowCells [ 2 ] == medNameToSearch ) ;
70+ alert ( found ) ;
71+ if ( rowCells [ 2 ] . toUpperCase ( ) == medNameToSearch . toUpperCase ( ) )
72+ {
73+ alert ( "searchInData found med" ) ;
74+ url = "./fail.html" ;
75+ window . location . replace ( url ) ;
76+ break ;
77+ }
78+ if ( rowNum == allRows . length - 1 )
79+ {
80+ url = "./success.html" ;
81+ window . location . replace ( url ) ;
82+ break ;
83+ }
84+
85+ rowNum = rowNum + 1 ;
86+ }
87+ }
88+
89+ // Register Service Worker.
90+
91+ if ( 'serviceWorker' in navigator ) {
92+ // Path is relative to the origin, not project root.
93+ navigator . serviceWorker . register ( '/pwa-photobooth/sw.js' )
94+ . then ( function ( reg ) {
95+ console . log ( 'Registration succeeded. Scope is ' + reg . scope ) ;
96+ } )
97+ . catch ( function ( error ) {
98+ console . error ( 'Registration failed with ' + error ) ;
99+ } ) ;
100+ }
101+ </ script >
102+ < script src ="assets/js/script.js "> </ script >
103+ < script src ="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js "> </ script >
104+ < head >
105+
106+ < meta charset ="utf-8 ">
107+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
108+ < meta name ="viewport " content ="width=device-width, initial-scale=1 ">
109+
110+ < title > ToxScreen. Drug safety personalized to your genetic information.</ title >
111+
112+ < link rel ="stylesheet " href ="assets/css/styles.css ">
113+
114+ <!-- Meta tag for changing browser colors. -->
115+ < meta id ="theme-color " name ="theme-color " content ="#37474F ">
116+
117+ <!-- Meta tag for App-like behaviour in iOS -->
118+ < meta name =”apple-mobile-web-app-capable” content =”yes” >
119+
120+ <!-- Web Manifest -->
121+ < link rel ="manifest " href ="manifest.json ">
122+
123+ </ head >
124+
125+ < body >
126+ < div >
127+ < form class ="form-inline ">
128+ Search for Your Medication or take a picture:< br >
129+ < br >
130+ < br >
131+ < input type ="text " id ="medicationName " type ="text " class ="form-control " placeholder ="Medication "> < br >
132+ </ form >
133+
134+ < button type ="button " onclick ="search('123456') "> Search</ button > <!-- hardcoded userId -->
135+
136+ </ div >
137+
138+ < div class ="container ">
139+
140+ < div class ="app ">
141+
142+ < a href ="# " id ="start-camera " class ="visible "> Touch here to start the app.</ a >
143+ < video muted id ="camera-stream "> </ video >
144+ < img id ="snap ">
145+
146+ < p id ="error-message "> </ p >
147+
148+ < div class ="controls ">
149+ < a href ="# " id ="delete-photo " title ="Delete Photo " class ="disabled "> < i class ="material-icons "> delete</ i > </ a >
150+ < a href ="# " id ="take-photo " title ="Take Photo "> < i class ="material-icons "> camera_alt</ i > </ a >
151+ < a href ="# " id ="download-photo " download ="selfie.png " title ="Save Photo " class ="disabled " onclick ="identifyDrug(); "> < i class ="material-icons "> file_download</ i > </ a >
152+
153+ </ div >
154+
155+ <!-- Hidden canvas element. Used for taking snapshot of video. -->
156+ < canvas > </ canvas >
157+
158+ </ div >
159+
160+ </ div >
161+
162+
163+ < a href ="druginsights.html " role ="button " class "btn btn-default"> Submit </ a >
164+
165+ < br >
166+ < p id ="demo "> Click to check your drug sensitivities</ p >
167+
168+ </ script >
169+ </ center >
170+ </ body >
171+ </ html >
0 commit comments