Merge lp:~rjwills/ensoft-sextant/branding into lp:ensoft-sextant
- branding
- Merge into whiteline
Proposed by
Robert
Status: | Merged |
---|---|
Approved by: | Patrick Stevens |
Approved revision: | 20 |
Merged at revision: | 20 |
Proposed branch: | lp:~rjwills/ensoft-sextant/branding |
Merge into: | lp:ensoft-sextant |
Diff against target: |
855 lines (+449/-371) 5 files modified
resources/sextant/web/index.html (+14/-28) resources/sextant/web/interface.html (+87/-103) resources/sextant/web/queryjavascript.js (+195/-201) resources/sextant/web/style_sheet.css (+147/-36) src/sextant/export.py (+6/-3) |
To merge this branch: | bzr merge lp:~rjwills/ensoft-sextant/branding |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Robert | Approve | ||
Review via email: mp+233326@code.launchpad.net |
Commit message
Enhance the Sextant branding.
Description of the change
Enhance the Sextant branding.
To post a comment you must log in.
Revision history for this message
Patrick Stevens (patrickas) wrote : | # |
You've changed a bunch of file permissions, but I can report that as a bug and fix it later, since it's not particularly vital.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'resources/sextant/web/index.html' (properties changed: -x to +x) | |||
2 | --- resources/sextant/web/index.html 2014-08-13 10:02:58 +0000 | |||
3 | +++ resources/sextant/web/index.html 2014-09-04 09:50:20 +0000 | |||
4 | @@ -12,34 +12,20 @@ | |||
5 | 12 | <link rel="stylesheet" type="text/css" href="style_sheet.css"/> | 12 | <link rel="stylesheet" type="text/css" href="style_sheet.css"/> |
6 | 13 | <title>Sextant</title> | 13 | <title>Sextant</title> |
7 | 14 | </head> | 14 | </head> |
36 | 15 | <body> | 15 | <body style="height:100%" class="titlescreen"> |
37 | 16 | <table> | 16 | <div class="centered"> |
38 | 17 | <tr> | 17 | <div id="titlescreen-logo-text"> |
39 | 18 | <td> | 18 | Sextant |
40 | 19 | <h1>You have reached the portal to Sextant.</h1> | 19 | </div> |
41 | 20 | </td> | 20 | <div> |
42 | 21 | <td> | 21 | <button class="button" onclick="window.location='interface.html'">Open Sextant Explorer</button> |
43 | 22 | </td> | 22 | <!--<button class="button">View Programs</button>--> |
44 | 23 | </tr> | 23 | </div> |
45 | 24 | <tr> | 24 | </div> |
46 | 25 | <td> | 25 | |
47 | 26 | <!--Sextant image--> | 26 | <div id="titlescreen-bottombar"> |
48 | 27 | <img src="sextant.gif" alt = "sextant"> | 27 | To add a program to Sextant, use '<b>sextant add-program</b>' from the command line |
49 | 28 | </td> | 28 | </div> |
22 | 29 | <td> | ||
23 | 30 | <!--link to the Query page--> | ||
24 | 31 | <form action='/interface.html' method="get"> | ||
25 | 32 | <input type="submit" value="Query Page" class="button2" | ||
26 | 33 | name="link_query" id="form1_submit" /> | ||
27 | 34 | </form> | ||
28 | 35 | <!--link to Database Properties page--> | ||
29 | 36 | <form action='/database_properties' method="get"> | ||
30 | 37 | <input type="submit" value="Database Properties" class="button2" | ||
31 | 38 | name="link_properties" id="form2_submit" /> | ||
32 | 39 | </form> | ||
33 | 40 | </td> | ||
34 | 41 | </tr> | ||
35 | 42 | </table> | ||
50 | 43 | 29 | ||
51 | 44 | </body> | 30 | </body> |
52 | 45 | </html> | 31 | </html> |
53 | 46 | 32 | ||
54 | === modified file 'resources/sextant/web/interface.html' (properties changed: -x to +x) | |||
55 | --- resources/sextant/web/interface.html 2014-08-26 11:04:04 +0000 | |||
56 | +++ resources/sextant/web/interface.html 2014-09-04 09:50:20 +0000 | |||
57 | @@ -1,103 +1,87 @@ | |||
161 | 1 | <!-- | 1 | <!-- |
162 | 2 | Sextant | 2 | Sextant |
163 | 3 | Copyright 2014, Ensoft Ltd. | 3 | Copyright 2014, Ensoft Ltd. |
164 | 4 | Author: James Harkin | 4 | Author: James Harkin |
165 | 5 | 5 | ||
166 | 6 | Sextant web interface for Queries --> | 6 | Sextant web interface for Queries --> |
167 | 7 | 7 | ||
168 | 8 | <!DOCTYPE html> | 8 | <!DOCTYPE html> |
169 | 9 | <html> | 9 | <html> |
170 | 10 | <head> | 10 | <head> |
171 | 11 | <meta charset="utf-8"/> | 11 | <meta charset="utf-8"/> |
172 | 12 | <link rel="stylesheet" type="text/css" href="style_sheet.css"/> | 12 | <link rel="stylesheet" type="text/css" href="style_sheet.css"/> |
173 | 13 | <title> Sextant Query </title> | 13 | <title> Sextant Explorer </title> |
174 | 14 | </head> | 14 | </head> |
175 | 15 | 15 | ||
176 | 16 | <body onload="get_names_for_autocomplete('programs')"> | 16 | <body onload="get_names_for_autocomplete('programs'); set_arguments('', ''); show_item('welcome')"> |
177 | 17 | <!-- Create a table with a border to hold the input file query name | 17 | <div class="toolbar"> |
178 | 18 | and arguments. table remains fixed while page scrolls--> | 18 | <div> |
179 | 19 | <table style="background-color:#FFFFFF; width: 100%; | 19 | Program: |
180 | 20 | border:1px solid black; position: fixed;"> | 20 | <input list="program_names" id="program_name" class="textbox" |
181 | 21 | <tr style="height:20px"> | 21 | onblur="get_names_for_autocomplete('funcs')" style="width: 150px" /> |
182 | 22 | <td style="width:250"> | 22 | <datalist id="program_names"></datalist> |
183 | 23 | <h2>Input file</h2> | 23 | |
184 | 24 | </td> | 24 | <select id="query_list" class="dropdown" onchange="display_when();"> |
185 | 25 | <td style="width:350"> | 25 | <option value="whole_program">Whole graph</option> |
186 | 26 | <h2>Query</h2> | 26 | <option value="functions_calling"> |
187 | 27 | </td> | 27 | All functions calling specific function</option> |
188 | 28 | <td style="width:250"> | 28 | <option value="functions_called_by"> |
189 | 29 | <h2>Arguments</h2> | 29 | All functions called by a specific function</option> |
190 | 30 | </td> | 30 | <option value="all_call_paths"> |
191 | 31 | <td> | 31 | All function call paths between two functions</option> |
192 | 32 | <form> | 32 | <option value="shortest_call_path"> |
193 | 33 | <!--checkbox used to supress common nodes--> | 33 | Shortest path between two functions</option> |
194 | 34 | <label> | 34 | <option value="function_names"> |
195 | 35 | <input type="checkbox" id="suppress_common" value="True" /> | 35 | All function names</option> |
196 | 36 | Suppress common functions? | 36 | </select> |
197 | 37 | </label> | 37 | |
198 | 38 | </form> | 38 | <label> |
199 | 39 | </td> | 39 | <input type="checkbox" id="suppress_common" value="True"></input> |
200 | 40 | </tr> | 40 | Suppress common functions? |
201 | 41 | <tr style="height:100px"> | 41 | </label> |
202 | 42 | <td> | 42 | |
203 | 43 | <!-- Autocomplete textbox for program names; populated on upload--> | 43 | <button class="button" style="float:right; margin: 1px 20px -1px 0;" onclick="execute_query()">Run Query</button> |
204 | 44 | <input list="program_names" id="program_name" | 44 | </div> |
205 | 45 | onblur="get_names_for_autocomplete('funcs')" style="size:20"> | 45 | <div id="toolbar-row2" style="margin-left: 234px;"> |
206 | 46 | <datalist id="program_names"> | 46 | <!--list to populate arguments. Updates when program name is specified--> |
207 | 47 | </datalist> | 47 | <datalist id="function_names"></datalist> |
208 | 48 | </td> | 48 | |
209 | 49 | <td> | 49 | <span id="argument_1" style="size:20;"></span> |
210 | 50 | <!-- Drop-down box to hold choice of queries--> | 50 | <input list="function_names" id="function_1" class="textbox" style="size:20;"></input> |
211 | 51 | <form name="drop_list_1"> | 51 | |
212 | 52 | <SELECT id="query_list" onchange="display_when();"> | 52 | <span id="argument_2" style="size:20;"></span> |
213 | 53 | <option value="whole_program">Whole graph</option> | 53 | <input list="function_names" id="function_2" class="textbox" style="size:20;"></input> |
214 | 54 | <option value="functions_calling"> | 54 | </div> |
215 | 55 | All functions calling specific function</option> | 55 | </div> |
216 | 56 | <option value="functions_called_by"> | 56 | |
217 | 57 | All functions called by a specific function</option> | 57 | |
218 | 58 | <option value="all_call_paths"> | 58 | |
219 | 59 | All function call paths between two functions</option> | 59 | <!-- Output for image file--> |
220 | 60 | <option value="shortest_call_path"> | 60 | <img id=output_image src="sextant.jpg" |
221 | 61 | Shortest path between two functions</option> | 61 | class="pos_img" |
222 | 62 | <option value="function_names"> | 62 | style="align: bottom; font-style: italic; color: #C0C0C0; font-size: 15px" /> |
223 | 63 | All function names</option> | 63 | |
224 | 64 | </SELECT> | 64 | <!-- Paragraph for text output e.g. list of funtion names--> |
225 | 65 | </form> | 65 | <p id="function_names_output" class="pos_functions" style="size:20"></p> |
226 | 66 | <p> | 66 | |
227 | 67 | query selected : <input type="text" id="query" | 67 | <div class="centered" id="welcome"> |
228 | 68 | value="Whole graph" size="20"> | 68 | <div class="title">Welcome to Sextant Explorer</div> |
229 | 69 | </p> | 69 | <div class="subtitle"><b>To begin</b>: enter a program name, choose a query, and click 'Run Query'</div> |
230 | 70 | </td> | 70 | </div> |
231 | 71 | <td> | 71 | </div> |
232 | 72 | <!-- Autocomplete text box for argument | 72 | |
233 | 73 | 1 Is only visible for relevant queries--> | 73 | <div class="centered" id="please-wait"> |
234 | 74 | <div id="argument_1">No arguments required.</div> | 74 | <div class="title">Just a moment</div> |
235 | 75 | <input list="function_names" id="function_1" style="size:20; visibility:hidden"> | 75 | <div class="subtitle">Sextant is rendering the result. Large graphs may take a minute.</div> |
236 | 76 | <!--list to populate arguments. Updates when program name is specified--> | 76 | </div> |
237 | 77 | <datalist id="function_names"> | 77 | </div> |
238 | 78 | </datalist> | 78 | |
239 | 79 | <!-- Autocomplete text box for argument | 79 | <div class="centered" id="error"> |
240 | 80 | 2 Is only visible for relevant queries--> | 80 | <div class="error-title">Oops!</div> |
241 | 81 | <div id="argument_2"></div> | 81 | <div class="error-subtitle" id="error-msg"></div> |
242 | 82 | <input list="function_names" id="function_2" style="size:20; visibility:hidden"> | 82 | </div> |
243 | 83 | 83 | </div> | |
244 | 84 | </td> | 84 | |
245 | 85 | <td> | 85 | <script src="queryjavascript.js"></script> |
246 | 86 | 86 | </body> | |
247 | 87 | <!--execute button; submits query--> | 87 | </html> |
145 | 88 | <br><input type="submit" value="Execute
Query" class="button" | ||
146 | 89 | onclick="execute_query()"><br> | ||
147 | 90 | </td> | ||
148 | 91 | </tr> | ||
149 | 92 | </table> | ||
150 | 93 | <!-- Paragraph for text output e.g. list of funtion names--> | ||
151 | 94 | <p id="function_names_output" class="pos_functions" style="size:20; visibility:hidden"></p> | ||
152 | 95 | |||
153 | 96 | <!-- Output for image file--> | ||
154 | 97 | <img id=output_image src="sextant.jpg" alt="Execute query to display graph." | ||
155 | 98 | class="pos_img" | ||
156 | 99 | style="align: bottom; font-style: italic; color: #C0C0C0; font-size: 15px;"> | ||
157 | 100 | |||
158 | 101 | <script src="queryjavascript.js"></script> | ||
159 | 102 | </body> | ||
160 | 103 | </html> | ||
248 | 104 | 88 | ||
249 | === modified file 'resources/sextant/web/queryjavascript.js' (properties changed: -x to +x) | |||
250 | --- resources/sextant/web/queryjavascript.js 2014-08-26 11:04:04 +0000 | |||
251 | +++ resources/sextant/web/queryjavascript.js 2014-09-04 09:50:20 +0000 | |||
252 | @@ -1,201 +1,195 @@ | |||
454 | 1 | // Sextant | 1 | // Sextant |
455 | 2 | // Copyright 2014, Ensoft Ltd. | 2 | // Copyright 2014, Ensoft Ltd. |
456 | 3 | // Author: James Harkin, Patrick Stevens | 3 | // Author: James Harkin, Patrick Stevens |
457 | 4 | // | 4 | // |
458 | 5 | //Runs query and "GET"s either program names uploaded on the | 5 | //Runs query and "GET"s either program names uploaded on the |
459 | 6 | //server or function names from a specific program. | 6 | //server or function names from a specific program. |
460 | 7 | 7 | ||
461 | 8 | 8 | ||
462 | 9 | function get_names_for_autocomplete(info_needed){ | 9 | function get_names_for_autocomplete(info_needed){ |
463 | 10 | //Function queries to database to create a list | 10 | //Function queries to database to create a list |
464 | 11 | //which is used to populate the auto-complete text boxes. | 11 | //which is used to populate the auto-complete text boxes. |
465 | 12 | var xmlhttp = new XMLHttpRequest(); | 12 | var xmlhttp = new XMLHttpRequest(); |
466 | 13 | xmlhttp.onreadystatechange = function(){ | 13 | xmlhttp.onreadystatechange = function(){ |
467 | 14 | if (xmlhttp.status = 200){ | 14 | if (xmlhttp.status = 200){ |
468 | 15 | var values_list = xmlhttp.responseText; | 15 | var values_list = xmlhttp.responseText; |
469 | 16 | console.log(values_list) | 16 | if (values_list != "") { |
470 | 17 | values_list = JSON.parse(values_list); | 17 | values_list = JSON.parse(values_list); |
471 | 18 | if (info_needed =='programs'){ | 18 | if (info_needed =='programs'){ |
472 | 19 | //We need to populate the program names list | 19 | //We need to populate the program names list |
473 | 20 | add_options("program_names", values_list); | 20 | add_options("program_names", values_list); |
474 | 21 | } | 21 | } |
475 | 22 | if (info_needed =='funcs'){ | 22 | if (info_needed =='funcs'){ |
476 | 23 | //We need to populate the functions list for the arguments | 23 | //We need to populate the functions list for the arguments |
477 | 24 | add_options("function_names", values_list); | 24 | add_options("function_names", values_list); |
478 | 25 | } | 25 | } |
479 | 26 | } | 26 | } |
480 | 27 | } | 27 | } |
481 | 28 | if (info_needed == 'programs'){ | 28 | } |
482 | 29 | var string = "/database_properties?query=" + info_needed + "&program_name="; | 29 | if (info_needed == 'programs'){ |
483 | 30 | } | 30 | var string = "/database_properties?query=" + info_needed + "&program_name="; |
484 | 31 | else{ | 31 | } |
485 | 32 | var string = "/database_properties?query=" + "functions" + | 32 | else{ |
486 | 33 | "&program_name=" + document.getElementById("program_name").value; | 33 | var string = "/database_properties?query=" + "functions" + |
487 | 34 | if (info_needed == 'programs'){ | 34 | "&program_name=" + document.getElementById("program_name").value; |
488 | 35 | var string = "/database_properties?query=" + | 35 | if (info_needed == 'programs'){ |
489 | 36 | info_needed + "&program_name=" + prog_name; | 36 | var string = "/database_properties?query=" + |
490 | 37 | } | 37 | info_needed + "&program_name=" + prog_name; |
491 | 38 | //"GET" information from the specified url (string) | 38 | } |
492 | 39 | xmlhttp.open("GET", string, true); | 39 | //"GET" information from the specified url (string) |
493 | 40 | xmlhttp.send(); | 40 | xmlhttp.open("GET", string, true); |
494 | 41 | } | 41 | xmlhttp.send(); |
495 | 42 | xmlhttp.open("GET", string, true); | 42 | } |
496 | 43 | xmlhttp.send(); | 43 | xmlhttp.open("GET", string, true); |
497 | 44 | } | 44 | xmlhttp.send(); |
498 | 45 | 45 | } | |
499 | 46 | 46 | ||
500 | 47 | function add_options(selectedlist, values_list){ | 47 | |
501 | 48 | //Adds all the options obtained from the list of program | 48 | function add_options(selectedlist, values_list){ |
502 | 49 | //names or function names to an auto complete drop-down box | 49 | //Adds all the options obtained from the list of program |
503 | 50 | var options = '' | 50 | //names or function names to an auto complete drop-down box |
504 | 51 | if (values_list.length == 1 || values_list.length ==0){ | 51 | var options = '' |
505 | 52 | options += '<option value="'+values_list+'"/>'; | 52 | if (values_list.length == 1 || values_list.length ==0){ |
506 | 53 | } | 53 | options += '<option value="'+values_list+'"/>'; |
507 | 54 | else{ | 54 | } |
508 | 55 | for (var i=0; i < values_list.length;++i){ | 55 | else{ |
509 | 56 | options += '<option value="'+values_list[i]+'"/>'; | 56 | for (var i=0; i < values_list.length;++i){ |
510 | 57 | } | 57 | options += '<option value="'+values_list[i]+'"/>'; |
511 | 58 | } | 58 | } |
512 | 59 | document.getElementById(selectedlist).innerHTML = options; | 59 | } |
513 | 60 | } | 60 | document.getElementById(selectedlist).innerHTML = options; |
514 | 61 | 61 | } | |
515 | 62 | 62 | ||
516 | 63 | function display_when(){ | 63 | |
517 | 64 | //For each query specifies when auto-complete text boxes should be made | 64 | function set_argument(number, label) { |
518 | 65 | //visible or invisible and makes them read only | 65 | var argEl = document.getElementById("argument_" + number); |
519 | 66 | var query_list = document.getElementById("query_list"); | 66 | var funcEl = document.getElementById("function_" + number); |
520 | 67 | document.getElementById("query").value = | 67 | if (label == "") { |
521 | 68 | query_list.options[query_list.selectedIndex].text; | 68 | argEl.style.visibility = "hidden"; |
522 | 69 | var no_functions = new Array(); | 69 | funcEl.style.visibility = "hidden"; |
523 | 70 | var prog_name = document.getElementById("program_name").value; | 70 | funcEl.value = null; |
524 | 71 | if (query_list.options[query_list.selectedIndex].value == "functions_calling"){ | 71 | } else { |
525 | 72 | document.getElementById("argument_1").innerHTML = "Function being called"; | 72 | argEl.innerHTML = label; |
526 | 73 | document.getElementById("argument_2").innerHTML = ""; | 73 | argEl.style.visibility = "visible"; |
527 | 74 | document.getElementById("function_1").readOnly = false; | 74 | funcEl.style.visibility = "visible"; |
528 | 75 | document.getElementById("function_2").readOnly = true; | 75 | } |
529 | 76 | document.getElementById("function_1").style.visibility = "visible"; | 76 | } |
530 | 77 | document.getElementById("function_2").style.visibility = "hidden"; | 77 | |
531 | 78 | document.getElementById("function_2").value = null; | 78 | |
532 | 79 | } | 79 | function set_arguments(label1, label2) { |
533 | 80 | if (query_list.options[query_list.selectedIndex].value == "functions_called_by"){ | 80 | set_argument(1, label1); |
534 | 81 | document.getElementById("argument_1").innerHTML = "Function calling"; | 81 | set_argument(2, label2); |
535 | 82 | document.getElementById("argument_2").innerHTML = ""; | 82 | document.getElementById("toolbar-row2").style.display |
536 | 83 | document.getElementById("function_1").readOnly = false; | 83 | = (label1 == "" && label2 == "") ? "none" : "block"; |
537 | 84 | document.getElementById("function_2").readOnly = true; | 84 | } |
538 | 85 | document.getElementById("function_1").style.visibility = "visible"; | 85 | |
539 | 86 | document.getElementById("function_2").style.visibility = "hidden"; | 86 | |
540 | 87 | document.getElementById("function_2").value = null; | 87 | function display_when(){ |
541 | 88 | } | 88 | //For each query specifies when auto-complete text boxes should be made |
542 | 89 | if (query_list.options[query_list.selectedIndex].value == "all_call_paths"){ | 89 | //visible or invisible and makes them read only |
543 | 90 | document.getElementById("argument_1").innerHTML = "Function calling"; | 90 | var query_list = document.getElementById("query_list"); |
544 | 91 | document.getElementById("argument_2").innerHTML = "Function being called"; | 91 | |
545 | 92 | document.getElementById("function_1").readOnly = false; | 92 | var no_functions = new Array(); |
546 | 93 | document.getElementById("function_2").readOnly = false; | 93 | var prog_name = document.getElementById("program_name").value; |
547 | 94 | document.getElementById("function_1").style.visibility = "visible"; | 94 | if (query_list.options[query_list.selectedIndex].value == "functions_calling"){ |
548 | 95 | document.getElementById("function_2").style.visibility = "visible"; | 95 | set_arguments("Function being called", ""); |
549 | 96 | } | 96 | } |
550 | 97 | if (query_list.options[query_list.selectedIndex].value == "shortest_call_path"){ | 97 | if (query_list.options[query_list.selectedIndex].value == "functions_called_by"){ |
551 | 98 | document.getElementById("argument_1").innerHTML = "Function calling"; | 98 | set_arguments("Function calling", ""); |
552 | 99 | document.getElementById("argument_2").innerHTML = "Function being called"; | 99 | } |
553 | 100 | document.getElementById("function_1").readOnly = false; | 100 | if (query_list.options[query_list.selectedIndex].value == "all_call_paths"){ |
554 | 101 | document.getElementById("function_2").readOnly = false; | 101 | set_arguments("Function calling", "Function being called"); |
555 | 102 | document.getElementById("function_1").style.visibility = "visible"; | 102 | } |
556 | 103 | document.getElementById("function_2").style.visibility = "visible"; | 103 | if (query_list.options[query_list.selectedIndex].value == "shortest_call_path"){ |
557 | 104 | } | 104 | set_arguments("Function calling", "Function being called"); |
558 | 105 | if (query_list.options[query_list.selectedIndex].value == "whole_program") { | 105 | } |
559 | 106 | document.getElementById("argument_1").innerHTML = "No arguments required."; | 106 | if (query_list.options[query_list.selectedIndex].value == "whole_program") { |
560 | 107 | document.getElementById("argument_2").innerHTML = ""; | 107 | set_arguments("", ""); |
561 | 108 | document.getElementById("function_1").readOnly = true; | 108 | } |
562 | 109 | document.getElementById("function_2").readOnly = true; | 109 | if (query_list.options[query_list.selectedIndex].value == "function_names"){ |
563 | 110 | document.getElementById("function_1").style.visibility = "hidden"; | 110 | set_arguments("", ""); |
564 | 111 | document.getElementById("function_2").style.visibility = "hidden"; | 111 | } |
565 | 112 | document.getElementById("function_1").value = null; | 112 | } |
566 | 113 | document.getElementById("function_2").value = null; | 113 | |
567 | 114 | } | 114 | |
568 | 115 | if (query_list.options[query_list.selectedIndex].value == "function_names"){ | 115 | |
569 | 116 | document.getElementById("argument_1").innerHTML = "No arguments required."; | 116 | function execute_query(){ |
570 | 117 | document.getElementById("argument_2").innerHTML = ""; | 117 | document.getElementById("output_image").src = ""; |
571 | 118 | document.getElementById("function_1").readOnly = true; | 118 | |
572 | 119 | document.getElementById("function_2").readOnly = true; | 119 | //Returns error in alert window if query not executed properly, |
573 | 120 | document.getElementById("function_1").style.visibility = "hidden"; | 120 | //otherwise performs the query and outputs it |
574 | 121 | document.getElementById("function_2").style.visibility = "hidden"; | 121 | show_item("please-wait"); |
575 | 122 | document.getElementById("function_1").value = null; | 122 | var query_id = document.getElementById("query_list").value; |
576 | 123 | document.getElementById("function_2").value = null; | 123 | if (query_id == "function_names"){ |
577 | 124 | } | 124 | //url for page containing all function names |
578 | 125 | } | 125 | var string = "/database_properties?program_name=" + |
579 | 126 | 126 | document.getElementById("program_name").value + "&query=functions"; | |
580 | 127 | 127 | } | |
581 | 128 | 128 | else{ | |
582 | 129 | function execute_query(){ | 129 | //If not function names we will want a graph as an output; |
583 | 130 | //Returns error in alert window if query not executed properly, | 130 | //url returns svg file of graph. |
584 | 131 | //otherwise performs the query and outputs it | 131 | var string = "/output_graph.svg?program_name=" + |
585 | 132 | document.getElementById("output_image").src = ""; | 132 | document.getElementById("program_name").value + |
586 | 133 | document.getElementById("output_image").alt = "Please wait loading..."; | 133 | "&query=" + query_id + "&func1="; |
587 | 134 | var query_id = document.getElementById("query_list").value; | 134 | string = string + document.getElementById("function_1").value + |
588 | 135 | if (query_id == "function_names"){ | 135 | "&func2=" + document.getElementById("function_2").value; |
589 | 136 | //url for page containing all function names | 136 | string = string + "&suppress_common=" + |
590 | 137 | var string = "/database_properties?program_name=" + | 137 | document.getElementById('suppress_common').checked.toString(); |
591 | 138 | document.getElementById("program_name").value + "&query=functions"; | 138 | |
592 | 139 | } | 139 | } |
593 | 140 | else{ | 140 | var xmlhttp = new XMLHttpRequest(); |
594 | 141 | //If not function names we will want a graph as an output; | 141 | xmlhttp.open("GET", string, true); |
595 | 142 | //url returns svg file of graph. | 142 | xmlhttp.send(); |
596 | 143 | var string = "/output_graph.svg?program_name=" + | 143 | xmlhttp.onreadystatechange = function(){ |
597 | 144 | document.getElementById("program_name").value + | 144 | if (xmlhttp.readyState == 4 && xmlhttp.status == 200){ |
598 | 145 | "&query=" + query_id + "&func1="; | 145 | //readyState == 4 means query has finished executing. |
599 | 146 | string = string + document.getElementById("function_1").value + | 146 | //status == 200 means "GET"ing has been successful. |
600 | 147 | "&func2=" + document.getElementById("function_2").value; | 147 | if (query_id == "function_names"){ |
601 | 148 | string = string + "&suppress_common=" + | 148 | //Text output displayed in paragraph. |
602 | 149 | document.getElementById('suppress_common').checked.toString(); | 149 | document.getElementById("function_names_output").innerHTML = |
603 | 150 | 150 | xmlhttp.responseText; | |
604 | 151 | } | 151 | show_item("function_names_output"); |
605 | 152 | var xmlhttp = new XMLHttpRequest(); | 152 | } |
606 | 153 | xmlhttp.open("GET", string, true); | 153 | else{ |
607 | 154 | xmlhttp.send(); | 154 | show_item("output_image"); |
608 | 155 | xmlhttp.onreadystatechange = function(){ | 155 | document.getElementById("output_image").src = string; |
609 | 156 | if (xmlhttp.readyState == 4 && xmlhttp.status == 200){ | 156 | } |
610 | 157 | //readyState == 4 means query has finished executing. | 157 | } |
611 | 158 | //status == 200 means "GET"ing has been successful. | 158 | else if (xmlhttp.readyState == 4 && xmlhttp.status == 400){ |
612 | 159 | if (query_id == "function_names"){ | 159 | //Error occurred during query; display response. |
613 | 160 | //Text output displayed in paragraph. | 160 | show_error(xmlhttp.responseText); |
614 | 161 | document.getElementById("function_names_output").innerHTML = | 161 | } |
615 | 162 | xmlhttp.responseText; | 162 | else if(xmlhttp.readyState == 4 && xmlhttp.status == 404){ |
616 | 163 | document.getElementById("function_names_output").style.visibility = | 163 | //Error occurred during query; display response. |
617 | 164 | "visible" | 164 | show_error(xmlhttp.responseText); |
618 | 165 | //Clear current image if one exists. | 165 | } |
619 | 166 | document.getElementById("output_image").alt = ""; | 166 | else if(xmlhttp.readyState ==4 && xmlhttp.status == 204){ |
620 | 167 | document.getElementById("output_image").src = ""; | 167 | //Query executed correctly but graph returned is empty |
621 | 168 | } | 168 | show_error("Graph returned was empty"); |
622 | 169 | else{ | 169 | } |
623 | 170 | document.getElementById("function_names_output").style.visibility = | 170 | else if (xmlhttp.readyState == 4 && xmlhttp.status == 502) { |
624 | 171 | "hidden" | 171 | //Error occurs if Neo4j isn't running |
625 | 172 | document.getElementById("output_image").src = string; | 172 | show_error("Bad Gateway received - are you sure the database server is running?"); |
626 | 173 | } | 173 | } |
627 | 174 | } | 174 | else if(xmlhttp.readyState ==4){ |
628 | 175 | else if (xmlhttp.readyState == 4 && xmlhttp.status == 400){ | 175 | //query executed correctly |
629 | 176 | //Error occurred during query; display response. | 176 | show_error("An unknown error occurred"); |
630 | 177 | document.getElementById("output_image").alt = ""; | 177 | } |
631 | 178 | window.alert(xmlhttp.responseText); | 178 | } |
632 | 179 | } | 179 | } |
633 | 180 | else if(xmlhttp.readyState == 4 && xmlhttp.status == 404){ | 180 | |
634 | 181 | //Error occurred during query; display response. | 181 | function show_item(id) { |
635 | 182 | document.getElementById("output_image").alt = ""; | 182 | var els = ["output_image", "function_names_output", "welcome", "please-wait", "error"]; |
636 | 183 | window.alert(xmlhttp.responseText); | 183 | |
637 | 184 | } | 184 | for (var i = 0; i < els.length; i++) { |
638 | 185 | else if(xmlhttp.readyState ==4 && xmlhttp.status == 204){ | 185 | document.getElementById(els[i]).style.display = "none"; |
639 | 186 | //Query executed correctly but graph returned is empty | 186 | } |
640 | 187 | document.getElementById("output_image").alt = ""; | 187 | |
641 | 188 | window.alert("Graph returned was empty"); | 188 | document.getElementById(id).style.display = "block"; |
642 | 189 | } | 189 | } |
643 | 190 | else if (xmlhttp.readyState == 4 && xmlhttp.status == 502) { | 190 | |
644 | 191 | //Error occurs if Neo4j isn't running | 191 | |
645 | 192 | document.getElementById("output_image").alt = ""; | 192 | function show_error(msg) { |
646 | 193 | window.alert("Bad Gateway received - are you sure the database server is running?"); | 193 | show_item("error"); |
647 | 194 | } | 194 | document.getElementById("error-msg").innerHTML = msg; |
648 | 195 | else if(xmlhttp.readyState ==4){ | 195 | } |
448 | 196 | //query executed correctly | ||
449 | 197 | document.getElementById("output_image").alt = ""; | ||
450 | 198 | window.alert("Error not recognised"); | ||
451 | 199 | } | ||
452 | 200 | } | ||
453 | 201 | } | ||
649 | 202 | 196 | ||
650 | === modified file 'resources/sextant/web/style_sheet.css' (properties changed: -x to +x) | |||
651 | --- resources/sextant/web/style_sheet.css 2014-08-13 10:02:58 +0000 | |||
652 | +++ resources/sextant/web/style_sheet.css 2014-09-04 09:50:20 +0000 | |||
653 | @@ -1,36 +1,147 @@ | |||
690 | 1 | pre { | 1 | @import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,300,200); |
691 | 2 | color: green; | 2 | @import url(http://fonts.googleapis.com/css?family=Poiret+One); |
692 | 3 | background: white; | 3 | |
693 | 4 | font-family: monospace; | 4 | |
694 | 5 | } | 5 | pre { |
695 | 6 | 6 | color: green; | |
696 | 7 | body { | 7 | background: white; |
697 | 8 | font-family: Helvetica, sans-serif; | 8 | font-family: monospace; |
698 | 9 | } | 9 | } |
699 | 10 | .button{ | 10 | |
700 | 11 | display:block; width:100px; height:100px; border-radius:50px; font-size:15px; | 11 | body { |
701 | 12 | color:#fff; line-height:100px; text-align:center; background:#FF0000 | 12 | font-family: 'Source Sans Pro', sans-serif; |
702 | 13 | } | 13 | backround-color: rgb(245, 245, 245); |
703 | 14 | 14 | margin: 0; | |
704 | 15 | .pos_img{ | 15 | padding: 0; |
705 | 16 | position:absolute; | 16 | } |
706 | 17 | left:0px; | 17 | |
707 | 18 | top:270px; | 18 | body.titlescreen { |
708 | 19 | z-index:-1 | 19 | background-color: rgb(105, 145, 172); |
709 | 20 | 20 | color: rgb(245, 245, 245); | |
710 | 21 | } | 21 | } |
711 | 22 | .pos_functions{ | 22 | |
712 | 23 | position:absolute; | 23 | .pos_img{ |
713 | 24 | left:0px; | 24 | position:absolute; |
714 | 25 | top:250px; | 25 | left:0px; |
715 | 26 | 26 | top:80px; | |
716 | 27 | } | 27 | z-index:-1 |
717 | 28 | 28 | ||
718 | 29 | .button2{ | 29 | } |
719 | 30 | display:inline-block; width:200px; height:100px; border-radius:50px; | 30 | .pos_functions{ |
720 | 31 | font-size:15px; color:#fff; line-height:100px; | 31 | position:absolute; |
721 | 32 | text-align:center; background:#000000 | 32 | left:0px; |
722 | 33 | } | 33 | top:250px; |
723 | 34 | 34 | ||
724 | 35 | 35 | } | |
725 | 36 | 36 | ||
726 | 37 | .button2{ | ||
727 | 38 | display:inline-block; width:200px; height:100px; border-radius:50px; | ||
728 | 39 | font-size:15px; color:#fff; line-height:100px; | ||
729 | 40 | text-align:center; background:#000000 | ||
730 | 41 | } | ||
731 | 42 | |||
732 | 43 | |||
733 | 44 | |||
734 | 45 | |||
735 | 46 | |||
736 | 47 | div.centered { | ||
737 | 48 | position: absolute; | ||
738 | 49 | left: 50%; | ||
739 | 50 | top: 40%; /* for good design we position nearer the top */ | ||
740 | 51 | transform: translate(-50%, -40%); | ||
741 | 52 | -webkit-transform: translate(-50%, -40%); | ||
742 | 53 | -moz-transform: translate(-50%, -40%); | ||
743 | 54 | -ms-transform: translate(-50%, -40%); | ||
744 | 55 | text-align: center; | ||
745 | 56 | } | ||
746 | 57 | |||
747 | 58 | #titlescreen-logo-text { | ||
748 | 59 | font-size: 80px; | ||
749 | 60 | font-family: 'Poiret One', sans-serif; | ||
750 | 61 | letter-spacing: -2px; | ||
751 | 62 | padding-bottom: 4px; | ||
752 | 63 | } | ||
753 | 64 | |||
754 | 65 | #titlescreen-bottombar { | ||
755 | 66 | font-size: 20px; | ||
756 | 67 | position: absolute; | ||
757 | 68 | left: 0; | ||
758 | 69 | bottom: 0; | ||
759 | 70 | right: 0; | ||
760 | 71 | height: 80px; | ||
761 | 72 | font-weight: 300; | ||
762 | 73 | text-align: center; | ||
763 | 74 | } | ||
764 | 75 | |||
765 | 76 | .toolbar { | ||
766 | 77 | background-color: rgb(105, 145, 172); | ||
767 | 78 | color: rgb(245, 245, 245); | ||
768 | 79 | position: fixed; | ||
769 | 80 | padding: 4px 10px 4px 10px; | ||
770 | 81 | width: 100%; | ||
771 | 82 | } | ||
772 | 83 | |||
773 | 84 | .button { | ||
774 | 85 | background-color: rgb(195, 215, 223); | ||
775 | 86 | color: rgb(103, 114, 122); | ||
776 | 87 | padding: 4px 10px 4px 10px; | ||
777 | 88 | margin-left: 3px; | ||
778 | 89 | margin-right: 3px; | ||
779 | 90 | border: none; | ||
780 | 91 | } | ||
781 | 92 | |||
782 | 93 | .textbox { | ||
783 | 94 | background-color: rgb(245, 245, 245); | ||
784 | 95 | border: 1px solid rgb(103, 114, 122); | ||
785 | 96 | color: rgb(103, 114, 122); | ||
786 | 97 | padding: 2px 4px 2px 4px; | ||
787 | 98 | margin: 2px; | ||
788 | 99 | } | ||
789 | 100 | |||
790 | 101 | .dropdown { | ||
791 | 102 | background-color: rgb(245, 245, 245); | ||
792 | 103 | border: 1px solid rgb(103, 114, 122); | ||
793 | 104 | color: rgb(103, 114, 122); | ||
794 | 105 | padding: 1px 4px 1px 4px; | ||
795 | 106 | margin: 2px; | ||
796 | 107 | } | ||
797 | 108 | |||
798 | 109 | .button:hover { | ||
799 | 110 | background-color: rgb(245, 245, 245); | ||
800 | 111 | } | ||
801 | 112 | |||
802 | 113 | |||
803 | 114 | |||
804 | 115 | |||
805 | 116 | .title { | ||
806 | 117 | font-size: 41px; | ||
807 | 118 | font-family: 'Poiret One', sans-serif; | ||
808 | 119 | letter-spacing: -1px; | ||
809 | 120 | padding-bottom: 4px; | ||
810 | 121 | color: rgb(103, 114, 122); | ||
811 | 122 | } | ||
812 | 123 | |||
813 | 124 | .subtitle { | ||
814 | 125 | font-size: 20px; | ||
815 | 126 | color: rgb(103, 114, 122); | ||
816 | 127 | font-weight: 300; | ||
817 | 128 | } | ||
818 | 129 | |||
819 | 130 | .subtitle > b { | ||
820 | 131 | font-weight: 400; | ||
821 | 132 | } | ||
822 | 133 | |||
823 | 134 | |||
824 | 135 | .error-title { | ||
825 | 136 | font-size: 41px; | ||
826 | 137 | font-family: 'Poiret One', sans-serif; | ||
827 | 138 | letter-spacing: -1px; | ||
828 | 139 | padding-bottom: 4px; | ||
829 | 140 | color: rgb(215, 92, 55); | ||
830 | 141 | } | ||
831 | 142 | |||
832 | 143 | .error-subtitle { | ||
833 | 144 | font-size: 20px; | ||
834 | 145 | color: rgb(215, 92, 55); | ||
835 | 146 | font-weight: 300; | ||
836 | 147 | } | ||
837 | 37 | 148 | ||
838 | === modified file 'src/sextant/export.py' (properties changed: -x to +x) | |||
839 | --- src/sextant/export.py 2014-08-26 13:43:02 +0000 | |||
840 | +++ src/sextant/export.py 2014-09-04 09:50:20 +0000 | |||
841 | @@ -55,9 +55,12 @@ | |||
842 | 55 | # node already, DOT lets us add more information about that node | 55 | # node already, DOT lets us add more information about that node |
843 | 56 | # so we can insist on turning that same node into a box-shape | 56 | # so we can insist on turning that same node into a box-shape |
844 | 57 | # and changing its font. | 57 | # and changing its font. |
848 | 58 | output_str += ' "{}" [label="{}", fontname="{}", shape=box]\n'.format(func.name, | 58 | output_str += ( |
849 | 59 | ProgramConverter.get_display_name(func, suppress_common_nodes), | 59 | ' "{}" [label="{}", fontname="{}", fontsize="10", ' + |
850 | 60 | font_name) | 60 | 'shape=box, penwidth=0.5]\n').format( |
851 | 61 | func.name, | ||
852 | 62 | ProgramConverter.get_display_name(func, suppress_common_nodes), | ||
853 | 63 | font_name) | ||
854 | 61 | if func.is_common: | 64 | if func.is_common: |
855 | 62 | output_str += ' "{}" [fillcolor=lightgreen, style=filled]\n'.format(func.name) | 65 | output_str += ' "{}" [fillcolor=lightgreen, style=filled]\n'.format(func.name) |
856 | 63 | 66 |
Approving for now. HTML and CSS for the whole project may be reviewed at a later date.