annotate jmoleditor/Jmoleditor/editor.htm @ 4:7c1f9962ac07 draft

Add temporary hack until my galaxy stdout/stderr UTF-8 bug is fixed.
author bgruening
date Fri, 27 Sep 2013 15:51:46 -0400
parents 17a3f755d472
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
1 <!--
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
2 //////////////////////////////////////////////////////////////////////////////////
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
3 //
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
4 JSDraw
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
5 // Copyright Scilligence Corporation, 2009-2012
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
6 // http://www.scilligence.com/
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
7 //
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
8 //////////////////////////////////////////////////////////////////////////////////
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
9 -->
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
10
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
11 <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" >
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
12 <head>
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
13 <title>JSDraw - A Javascript Chemical Structure Editor/Viewer</title>
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
14 <meta http-equiv="X-UA-Compatible" content="IE=edge" >
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
15 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
16
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
17 <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojo/dojo.xd.js" type="text/javascript"></script>
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
18 <script type="text/javascript" src='Scilligence.JSDraw.js'></script>
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
19
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
20
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
21 </head>
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
22 <body>
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
23
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
24 <h2>Paint your structure and add it to Galaxy!</h2>
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
25
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
26 <table border=1><tr><td>
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
27 Editor:<br />
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
28 <div class='JSDraw' id="test" style="width: 760px; height: 300px;border:1px solid gray" ondatachange='molchange'
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
29 dataformat='molfile' data=''></div>
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
30 </td></tr></table>
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
31 <button onclick='document.getElementById("data_type").value ="mol";document.getElementById("galaxyData").value = JSDraw.get("test").getMolfile();document.getElementById("galaxyform").submit();'>Export Molfile to Galaxy</button>
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
32 <button onclick='document.getElementById("data_type").value ="smi";document.getElementById("galaxyData").value = JSDraw.get("test").getSmiles();document.getElementById("galaxyform").submit();'>Export Smiles to Galaxy</button>
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
33
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
34 <form name="galaxyform" id="galaxyform" enctype="multipart/form-data" action="" method="post">
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
35 <input name='galaxyData' id='galaxyData' type='hidden' value='' />
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
36 <input name='data_type' id='data_type' type='hidden' value='mol' />
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
37 <input name='tool_id' id='tool_id' type='hidden' value='' />
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
38 </form>
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
39
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
40 <br />
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
41 Mol. Weight: <label id='mw' style='width:120px;font-weight:bold'></label>
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
42 Formula: <label id='formula' style='width:300px;font-weight:bold'></label>
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
43
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
44 <script type="text/javascript">
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
45 JSDraw.init();
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
46
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
47 function molchange(jsdraw) {
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
48 document.getElementById('formula').innerHTML = jsdraw.getFormula(true);
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
49 document.getElementById('mw').innerHTML = jsdraw.getMolWeight();
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
50 }
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
51
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
52 function getParameterByName(name)
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
53 {
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
54 name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
55 var regexS = "[\\?&]" + name + "=([^&#]*)";
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
56 var regex = new RegExp(regexS);
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
57 var results = regex.exec(window.location.search);
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
58 if(results == null)
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
59 return "";
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
60 else
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
61 return decodeURIComponent(results[1].replace(/\+/g, " "));
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
62 }
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
63
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
64 document.getElementById('tool_id').value = getParameterByName('tool_id') ;
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
65
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
66 document.getElementById('galaxyform').action = getParameterByName('GALAXY_URL')+"?tool_id="+getParameterByName('tool_id')+"&URL="+getParameterByName('URL')+" " ;
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
67
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
68 </script>
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
69
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
70 </body>
17a3f755d472 Uploaded
bgruening
parents:
diff changeset
71 </html>