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 | <link rel="stylesheet" type="text/css" href="style_sheet.css"/> |
6 | <title>Sextant</title> |
7 | </head> |
8 | -<body> |
9 | -<table> |
10 | -<tr> |
11 | - <td> |
12 | - <h1>You have reached the portal to Sextant.</h1> |
13 | - </td> |
14 | - <td> |
15 | - </td> |
16 | -</tr> |
17 | -<tr> |
18 | - <td> |
19 | - <!--Sextant image--> |
20 | - <img src="sextant.gif" alt = "sextant"> |
21 | - </td> |
22 | - <td> |
23 | - <!--link to the Query page--> |
24 | - <form action='/interface.html' method="get"> |
25 | - <input type="submit" value="Query Page" class="button2" |
26 | - name="link_query" id="form1_submit" /> |
27 | - </form> |
28 | - <!--link to Database Properties page--> |
29 | - <form action='/database_properties' method="get"> |
30 | - <input type="submit" value="Database Properties" class="button2" |
31 | - name="link_properties" id="form2_submit" /> |
32 | - </form> |
33 | - </td> |
34 | -</tr> |
35 | -</table> |
36 | +<body style="height:100%" class="titlescreen"> |
37 | + <div class="centered"> |
38 | + <div id="titlescreen-logo-text"> |
39 | + Sextant |
40 | + </div> |
41 | + <div> |
42 | + <button class="button" onclick="window.location='interface.html'">Open Sextant Explorer</button> |
43 | + <!--<button class="button">View Programs</button>--> |
44 | + </div> |
45 | + </div> |
46 | + |
47 | + <div id="titlescreen-bottombar"> |
48 | + To add a program to Sextant, use '<b>sextant add-program</b>' from the command line |
49 | + </div> |
50 | |
51 | </body> |
52 | </html> |
53 | |
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 @@ |
58 | -<!-- |
59 | - Sextant |
60 | - Copyright 2014, Ensoft Ltd. |
61 | - Author: James Harkin |
62 | - |
63 | - Sextant web interface for Queries --> |
64 | - |
65 | -<!DOCTYPE html> |
66 | -<html> |
67 | -<head> |
68 | -<meta charset="utf-8"/> |
69 | - <link rel="stylesheet" type="text/css" href="style_sheet.css"/> |
70 | - <title> Sextant Query </title> |
71 | -</head> |
72 | - |
73 | -<body onload="get_names_for_autocomplete('programs')"> |
74 | -<!-- Create a table with a border to hold the input file query name |
75 | - and arguments. table remains fixed while page scrolls--> |
76 | -<table style="background-color:#FFFFFF; width: 100%; |
77 | - border:1px solid black; position: fixed;"> |
78 | -<tr style="height:20px"> |
79 | - <td style="width:250"> |
80 | - <h2>Input file</h2> |
81 | - </td> |
82 | - <td style="width:350"> |
83 | - <h2>Query</h2> |
84 | - </td> |
85 | - <td style="width:250"> |
86 | - <h2>Arguments</h2> |
87 | - </td> |
88 | - <td> |
89 | - <form> |
90 | - <!--checkbox used to supress common nodes--> |
91 | - <label> |
92 | - <input type="checkbox" id="suppress_common" value="True" /> |
93 | - Suppress common functions? |
94 | - </label> |
95 | - </form> |
96 | - </td> |
97 | -</tr> |
98 | -<tr style="height:100px"> |
99 | - <td> |
100 | - <!-- Autocomplete textbox for program names; populated on upload--> |
101 | - <input list="program_names" id="program_name" |
102 | - onblur="get_names_for_autocomplete('funcs')" style="size:20"> |
103 | - <datalist id="program_names"> |
104 | - </datalist> |
105 | - </td> |
106 | - <td> |
107 | - <!-- Drop-down box to hold choice of queries--> |
108 | - <form name="drop_list_1"> |
109 | - <SELECT id="query_list" onchange="display_when();"> |
110 | - <option value="whole_program">Whole graph</option> |
111 | - <option value="functions_calling"> |
112 | - All functions calling specific function</option> |
113 | - <option value="functions_called_by"> |
114 | - All functions called by a specific function</option> |
115 | - <option value="all_call_paths"> |
116 | - All function call paths between two functions</option> |
117 | - <option value="shortest_call_path"> |
118 | - Shortest path between two functions</option> |
119 | - <option value="function_names"> |
120 | - All function names</option> |
121 | - </SELECT> |
122 | - </form> |
123 | - <p> |
124 | - query selected : <input type="text" id="query" |
125 | - value="Whole graph" size="20"> |
126 | - </p> |
127 | - </td> |
128 | - <td> |
129 | - <!-- Autocomplete text box for argument |
130 | - 1 Is only visible for relevant queries--> |
131 | - <div id="argument_1">No arguments required.</div> |
132 | - <input list="function_names" id="function_1" style="size:20; visibility:hidden"> |
133 | - <!--list to populate arguments. Updates when program name is specified--> |
134 | - <datalist id="function_names"> |
135 | - </datalist> |
136 | - <!-- Autocomplete text box for argument |
137 | - 2 Is only visible for relevant queries--> |
138 | - <div id="argument_2"></div> |
139 | - <input list="function_names" id="function_2" style="size:20; visibility:hidden"> |
140 | - |
141 | - </td> |
142 | - <td> |
143 | - |
144 | - <!--execute button; submits query--> |
145 | - <br><input type="submit" value="Execute
Query" class="button" |
146 | - onclick="execute_query()"><br> |
147 | - </td> |
148 | -</tr> |
149 | -</table> |
150 | -<!-- Paragraph for text output e.g. list of funtion names--> |
151 | -<p id="function_names_output" class="pos_functions" style="size:20; visibility:hidden"></p> |
152 | - |
153 | -<!-- Output for image file--> |
154 | -<img id=output_image src="sextant.jpg" alt="Execute query to display graph." |
155 | - class="pos_img" |
156 | - style="align: bottom; font-style: italic; color: #C0C0C0; font-size: 15px;"> |
157 | - |
158 | -<script src="queryjavascript.js"></script> |
159 | -</body> |
160 | -</html> |
161 | +<!-- |
162 | + Sextant |
163 | + Copyright 2014, Ensoft Ltd. |
164 | + Author: James Harkin |
165 | + |
166 | + Sextant web interface for Queries --> |
167 | + |
168 | +<!DOCTYPE html> |
169 | +<html> |
170 | +<head> |
171 | +<meta charset="utf-8"/> |
172 | + <link rel="stylesheet" type="text/css" href="style_sheet.css"/> |
173 | + <title> Sextant Explorer </title> |
174 | +</head> |
175 | + |
176 | +<body onload="get_names_for_autocomplete('programs'); set_arguments('', ''); show_item('welcome')"> |
177 | + <div class="toolbar"> |
178 | + <div> |
179 | + Program: |
180 | + <input list="program_names" id="program_name" class="textbox" |
181 | + onblur="get_names_for_autocomplete('funcs')" style="width: 150px" /> |
182 | + <datalist id="program_names"></datalist> |
183 | + |
184 | + <select id="query_list" class="dropdown" onchange="display_when();"> |
185 | + <option value="whole_program">Whole graph</option> |
186 | + <option value="functions_calling"> |
187 | + All functions calling specific function</option> |
188 | + <option value="functions_called_by"> |
189 | + All functions called by a specific function</option> |
190 | + <option value="all_call_paths"> |
191 | + All function call paths between two functions</option> |
192 | + <option value="shortest_call_path"> |
193 | + Shortest path between two functions</option> |
194 | + <option value="function_names"> |
195 | + All function names</option> |
196 | + </select> |
197 | + |
198 | + <label> |
199 | + <input type="checkbox" id="suppress_common" value="True"></input> |
200 | + Suppress common functions? |
201 | + </label> |
202 | + |
203 | + <button class="button" style="float:right; margin: 1px 20px -1px 0;" onclick="execute_query()">Run Query</button> |
204 | + </div> |
205 | + <div id="toolbar-row2" style="margin-left: 234px;"> |
206 | + <!--list to populate arguments. Updates when program name is specified--> |
207 | + <datalist id="function_names"></datalist> |
208 | + |
209 | + <span id="argument_1" style="size:20;"></span> |
210 | + <input list="function_names" id="function_1" class="textbox" style="size:20;"></input> |
211 | + |
212 | + <span id="argument_2" style="size:20;"></span> |
213 | + <input list="function_names" id="function_2" class="textbox" style="size:20;"></input> |
214 | + </div> |
215 | + </div> |
216 | + |
217 | + |
218 | + |
219 | + <!-- Output for image file--> |
220 | + <img id=output_image src="sextant.jpg" |
221 | + class="pos_img" |
222 | + style="align: bottom; font-style: italic; color: #C0C0C0; font-size: 15px" /> |
223 | + |
224 | + <!-- Paragraph for text output e.g. list of funtion names--> |
225 | + <p id="function_names_output" class="pos_functions" style="size:20"></p> |
226 | + |
227 | + <div class="centered" id="welcome"> |
228 | + <div class="title">Welcome to Sextant Explorer</div> |
229 | + <div class="subtitle"><b>To begin</b>: enter a program name, choose a query, and click 'Run Query'</div> |
230 | + </div> |
231 | + </div> |
232 | + |
233 | + <div class="centered" id="please-wait"> |
234 | + <div class="title">Just a moment</div> |
235 | + <div class="subtitle">Sextant is rendering the result. Large graphs may take a minute.</div> |
236 | + </div> |
237 | + </div> |
238 | + |
239 | + <div class="centered" id="error"> |
240 | + <div class="error-title">Oops!</div> |
241 | + <div class="error-subtitle" id="error-msg"></div> |
242 | + </div> |
243 | + </div> |
244 | + |
245 | + <script src="queryjavascript.js"></script> |
246 | +</body> |
247 | +</html> |
248 | |
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 @@ |
253 | -// Sextant |
254 | -// Copyright 2014, Ensoft Ltd. |
255 | -// Author: James Harkin, Patrick Stevens |
256 | -// |
257 | -//Runs query and "GET"s either program names uploaded on the |
258 | -//server or function names from a specific program. |
259 | - |
260 | - |
261 | -function get_names_for_autocomplete(info_needed){ |
262 | - //Function queries to database to create a list |
263 | - //which is used to populate the auto-complete text boxes. |
264 | - var xmlhttp = new XMLHttpRequest(); |
265 | - xmlhttp.onreadystatechange = function(){ |
266 | - if (xmlhttp.status = 200){ |
267 | - var values_list = xmlhttp.responseText; |
268 | - console.log(values_list) |
269 | - values_list = JSON.parse(values_list); |
270 | - if (info_needed =='programs'){ |
271 | - //We need to populate the program names list |
272 | - add_options("program_names", values_list); |
273 | - } |
274 | - if (info_needed =='funcs'){ |
275 | - //We need to populate the functions list for the arguments |
276 | - add_options("function_names", values_list); |
277 | - } |
278 | - } |
279 | - } |
280 | - if (info_needed == 'programs'){ |
281 | - var string = "/database_properties?query=" + info_needed + "&program_name="; |
282 | - } |
283 | - else{ |
284 | - var string = "/database_properties?query=" + "functions" + |
285 | - "&program_name=" + document.getElementById("program_name").value; |
286 | - if (info_needed == 'programs'){ |
287 | - var string = "/database_properties?query=" + |
288 | - info_needed + "&program_name=" + prog_name; |
289 | - } |
290 | - //"GET" information from the specified url (string) |
291 | - xmlhttp.open("GET", string, true); |
292 | - xmlhttp.send(); |
293 | - } |
294 | - xmlhttp.open("GET", string, true); |
295 | - xmlhttp.send(); |
296 | -} |
297 | - |
298 | - |
299 | -function add_options(selectedlist, values_list){ |
300 | - //Adds all the options obtained from the list of program |
301 | - //names or function names to an auto complete drop-down box |
302 | - var options = '' |
303 | - if (values_list.length == 1 || values_list.length ==0){ |
304 | - options += '<option value="'+values_list+'"/>'; |
305 | - } |
306 | - else{ |
307 | - for (var i=0; i < values_list.length;++i){ |
308 | - options += '<option value="'+values_list[i]+'"/>'; |
309 | - } |
310 | - } |
311 | - document.getElementById(selectedlist).innerHTML = options; |
312 | -} |
313 | - |
314 | - |
315 | -function display_when(){ |
316 | - //For each query specifies when auto-complete text boxes should be made |
317 | - //visible or invisible and makes them read only |
318 | - var query_list = document.getElementById("query_list"); |
319 | - document.getElementById("query").value = |
320 | - query_list.options[query_list.selectedIndex].text; |
321 | - var no_functions = new Array(); |
322 | - var prog_name = document.getElementById("program_name").value; |
323 | - if (query_list.options[query_list.selectedIndex].value == "functions_calling"){ |
324 | - document.getElementById("argument_1").innerHTML = "Function being called"; |
325 | - document.getElementById("argument_2").innerHTML = ""; |
326 | - document.getElementById("function_1").readOnly = false; |
327 | - document.getElementById("function_2").readOnly = true; |
328 | - document.getElementById("function_1").style.visibility = "visible"; |
329 | - document.getElementById("function_2").style.visibility = "hidden"; |
330 | - document.getElementById("function_2").value = null; |
331 | - } |
332 | - if (query_list.options[query_list.selectedIndex].value == "functions_called_by"){ |
333 | - document.getElementById("argument_1").innerHTML = "Function calling"; |
334 | - document.getElementById("argument_2").innerHTML = ""; |
335 | - document.getElementById("function_1").readOnly = false; |
336 | - document.getElementById("function_2").readOnly = true; |
337 | - document.getElementById("function_1").style.visibility = "visible"; |
338 | - document.getElementById("function_2").style.visibility = "hidden"; |
339 | - document.getElementById("function_2").value = null; |
340 | - } |
341 | - if (query_list.options[query_list.selectedIndex].value == "all_call_paths"){ |
342 | - document.getElementById("argument_1").innerHTML = "Function calling"; |
343 | - document.getElementById("argument_2").innerHTML = "Function being called"; |
344 | - document.getElementById("function_1").readOnly = false; |
345 | - document.getElementById("function_2").readOnly = false; |
346 | - document.getElementById("function_1").style.visibility = "visible"; |
347 | - document.getElementById("function_2").style.visibility = "visible"; |
348 | - } |
349 | - if (query_list.options[query_list.selectedIndex].value == "shortest_call_path"){ |
350 | - document.getElementById("argument_1").innerHTML = "Function calling"; |
351 | - document.getElementById("argument_2").innerHTML = "Function being called"; |
352 | - document.getElementById("function_1").readOnly = false; |
353 | - document.getElementById("function_2").readOnly = false; |
354 | - document.getElementById("function_1").style.visibility = "visible"; |
355 | - document.getElementById("function_2").style.visibility = "visible"; |
356 | - } |
357 | - if (query_list.options[query_list.selectedIndex].value == "whole_program") { |
358 | - document.getElementById("argument_1").innerHTML = "No arguments required."; |
359 | - document.getElementById("argument_2").innerHTML = ""; |
360 | - document.getElementById("function_1").readOnly = true; |
361 | - document.getElementById("function_2").readOnly = true; |
362 | - document.getElementById("function_1").style.visibility = "hidden"; |
363 | - document.getElementById("function_2").style.visibility = "hidden"; |
364 | - document.getElementById("function_1").value = null; |
365 | - document.getElementById("function_2").value = null; |
366 | - } |
367 | - if (query_list.options[query_list.selectedIndex].value == "function_names"){ |
368 | - document.getElementById("argument_1").innerHTML = "No arguments required."; |
369 | - document.getElementById("argument_2").innerHTML = ""; |
370 | - document.getElementById("function_1").readOnly = true; |
371 | - document.getElementById("function_2").readOnly = true; |
372 | - document.getElementById("function_1").style.visibility = "hidden"; |
373 | - document.getElementById("function_2").style.visibility = "hidden"; |
374 | - document.getElementById("function_1").value = null; |
375 | - document.getElementById("function_2").value = null; |
376 | - } |
377 | -} |
378 | - |
379 | - |
380 | - |
381 | -function execute_query(){ |
382 | - //Returns error in alert window if query not executed properly, |
383 | - //otherwise performs the query and outputs it |
384 | - document.getElementById("output_image").src = ""; |
385 | - document.getElementById("output_image").alt = "Please wait loading..."; |
386 | - var query_id = document.getElementById("query_list").value; |
387 | - if (query_id == "function_names"){ |
388 | - //url for page containing all function names |
389 | - var string = "/database_properties?program_name=" + |
390 | - document.getElementById("program_name").value + "&query=functions"; |
391 | - } |
392 | - else{ |
393 | - //If not function names we will want a graph as an output; |
394 | - //url returns svg file of graph. |
395 | - var string = "/output_graph.svg?program_name=" + |
396 | - document.getElementById("program_name").value + |
397 | - "&query=" + query_id + "&func1="; |
398 | - string = string + document.getElementById("function_1").value + |
399 | - "&func2=" + document.getElementById("function_2").value; |
400 | - string = string + "&suppress_common=" + |
401 | - document.getElementById('suppress_common').checked.toString(); |
402 | - |
403 | - } |
404 | - var xmlhttp = new XMLHttpRequest(); |
405 | - xmlhttp.open("GET", string, true); |
406 | - xmlhttp.send(); |
407 | - xmlhttp.onreadystatechange = function(){ |
408 | - if (xmlhttp.readyState == 4 && xmlhttp.status == 200){ |
409 | - //readyState == 4 means query has finished executing. |
410 | - //status == 200 means "GET"ing has been successful. |
411 | - if (query_id == "function_names"){ |
412 | - //Text output displayed in paragraph. |
413 | - document.getElementById("function_names_output").innerHTML = |
414 | - xmlhttp.responseText; |
415 | - document.getElementById("function_names_output").style.visibility = |
416 | - "visible" |
417 | - //Clear current image if one exists. |
418 | - document.getElementById("output_image").alt = ""; |
419 | - document.getElementById("output_image").src = ""; |
420 | - } |
421 | - else{ |
422 | - document.getElementById("function_names_output").style.visibility = |
423 | - "hidden" |
424 | - document.getElementById("output_image").src = string; |
425 | - } |
426 | - } |
427 | - else if (xmlhttp.readyState == 4 && xmlhttp.status == 400){ |
428 | - //Error occurred during query; display response. |
429 | - document.getElementById("output_image").alt = ""; |
430 | - window.alert(xmlhttp.responseText); |
431 | - } |
432 | - else if(xmlhttp.readyState == 4 && xmlhttp.status == 404){ |
433 | - //Error occurred during query; display response. |
434 | - document.getElementById("output_image").alt = ""; |
435 | - window.alert(xmlhttp.responseText); |
436 | - } |
437 | - else if(xmlhttp.readyState ==4 && xmlhttp.status == 204){ |
438 | - //Query executed correctly but graph returned is empty |
439 | - document.getElementById("output_image").alt = ""; |
440 | - window.alert("Graph returned was empty"); |
441 | - } |
442 | - else if (xmlhttp.readyState == 4 && xmlhttp.status == 502) { |
443 | - //Error occurs if Neo4j isn't running |
444 | - document.getElementById("output_image").alt = ""; |
445 | - window.alert("Bad Gateway received - are you sure the database server is running?"); |
446 | - } |
447 | - else if(xmlhttp.readyState ==4){ |
448 | - //query executed correctly |
449 | - document.getElementById("output_image").alt = ""; |
450 | - window.alert("Error not recognised"); |
451 | - } |
452 | - } |
453 | -} |
454 | +// Sextant |
455 | +// Copyright 2014, Ensoft Ltd. |
456 | +// Author: James Harkin, Patrick Stevens |
457 | +// |
458 | +//Runs query and "GET"s either program names uploaded on the |
459 | +//server or function names from a specific program. |
460 | + |
461 | + |
462 | +function get_names_for_autocomplete(info_needed){ |
463 | + //Function queries to database to create a list |
464 | + //which is used to populate the auto-complete text boxes. |
465 | + var xmlhttp = new XMLHttpRequest(); |
466 | + xmlhttp.onreadystatechange = function(){ |
467 | + if (xmlhttp.status = 200){ |
468 | + var values_list = xmlhttp.responseText; |
469 | + if (values_list != "") { |
470 | + values_list = JSON.parse(values_list); |
471 | + if (info_needed =='programs'){ |
472 | + //We need to populate the program names list |
473 | + add_options("program_names", values_list); |
474 | + } |
475 | + if (info_needed =='funcs'){ |
476 | + //We need to populate the functions list for the arguments |
477 | + add_options("function_names", values_list); |
478 | + } |
479 | + } |
480 | + } |
481 | + } |
482 | + if (info_needed == 'programs'){ |
483 | + var string = "/database_properties?query=" + info_needed + "&program_name="; |
484 | + } |
485 | + else{ |
486 | + var string = "/database_properties?query=" + "functions" + |
487 | + "&program_name=" + document.getElementById("program_name").value; |
488 | + if (info_needed == 'programs'){ |
489 | + var string = "/database_properties?query=" + |
490 | + info_needed + "&program_name=" + prog_name; |
491 | + } |
492 | + //"GET" information from the specified url (string) |
493 | + xmlhttp.open("GET", string, true); |
494 | + xmlhttp.send(); |
495 | + } |
496 | + xmlhttp.open("GET", string, true); |
497 | + xmlhttp.send(); |
498 | +} |
499 | + |
500 | + |
501 | +function add_options(selectedlist, values_list){ |
502 | + //Adds all the options obtained from the list of program |
503 | + //names or function names to an auto complete drop-down box |
504 | + var options = '' |
505 | + if (values_list.length == 1 || values_list.length ==0){ |
506 | + options += '<option value="'+values_list+'"/>'; |
507 | + } |
508 | + else{ |
509 | + for (var i=0; i < values_list.length;++i){ |
510 | + options += '<option value="'+values_list[i]+'"/>'; |
511 | + } |
512 | + } |
513 | + document.getElementById(selectedlist).innerHTML = options; |
514 | +} |
515 | + |
516 | + |
517 | +function set_argument(number, label) { |
518 | + var argEl = document.getElementById("argument_" + number); |
519 | + var funcEl = document.getElementById("function_" + number); |
520 | + if (label == "") { |
521 | + argEl.style.visibility = "hidden"; |
522 | + funcEl.style.visibility = "hidden"; |
523 | + funcEl.value = null; |
524 | + } else { |
525 | + argEl.innerHTML = label; |
526 | + argEl.style.visibility = "visible"; |
527 | + funcEl.style.visibility = "visible"; |
528 | + } |
529 | +} |
530 | + |
531 | + |
532 | +function set_arguments(label1, label2) { |
533 | + set_argument(1, label1); |
534 | + set_argument(2, label2); |
535 | + document.getElementById("toolbar-row2").style.display |
536 | + = (label1 == "" && label2 == "") ? "none" : "block"; |
537 | +} |
538 | + |
539 | + |
540 | +function display_when(){ |
541 | + //For each query specifies when auto-complete text boxes should be made |
542 | + //visible or invisible and makes them read only |
543 | + var query_list = document.getElementById("query_list"); |
544 | + |
545 | + var no_functions = new Array(); |
546 | + var prog_name = document.getElementById("program_name").value; |
547 | + if (query_list.options[query_list.selectedIndex].value == "functions_calling"){ |
548 | + set_arguments("Function being called", ""); |
549 | + } |
550 | + if (query_list.options[query_list.selectedIndex].value == "functions_called_by"){ |
551 | + set_arguments("Function calling", ""); |
552 | + } |
553 | + if (query_list.options[query_list.selectedIndex].value == "all_call_paths"){ |
554 | + set_arguments("Function calling", "Function being called"); |
555 | + } |
556 | + if (query_list.options[query_list.selectedIndex].value == "shortest_call_path"){ |
557 | + set_arguments("Function calling", "Function being called"); |
558 | + } |
559 | + if (query_list.options[query_list.selectedIndex].value == "whole_program") { |
560 | + set_arguments("", ""); |
561 | + } |
562 | + if (query_list.options[query_list.selectedIndex].value == "function_names"){ |
563 | + set_arguments("", ""); |
564 | + } |
565 | +} |
566 | + |
567 | + |
568 | + |
569 | +function execute_query(){ |
570 | + document.getElementById("output_image").src = ""; |
571 | + |
572 | + //Returns error in alert window if query not executed properly, |
573 | + //otherwise performs the query and outputs it |
574 | + show_item("please-wait"); |
575 | + var query_id = document.getElementById("query_list").value; |
576 | + if (query_id == "function_names"){ |
577 | + //url for page containing all function names |
578 | + var string = "/database_properties?program_name=" + |
579 | + document.getElementById("program_name").value + "&query=functions"; |
580 | + } |
581 | + else{ |
582 | + //If not function names we will want a graph as an output; |
583 | + //url returns svg file of graph. |
584 | + var string = "/output_graph.svg?program_name=" + |
585 | + document.getElementById("program_name").value + |
586 | + "&query=" + query_id + "&func1="; |
587 | + string = string + document.getElementById("function_1").value + |
588 | + "&func2=" + document.getElementById("function_2").value; |
589 | + string = string + "&suppress_common=" + |
590 | + document.getElementById('suppress_common').checked.toString(); |
591 | + |
592 | + } |
593 | + var xmlhttp = new XMLHttpRequest(); |
594 | + xmlhttp.open("GET", string, true); |
595 | + xmlhttp.send(); |
596 | + xmlhttp.onreadystatechange = function(){ |
597 | + if (xmlhttp.readyState == 4 && xmlhttp.status == 200){ |
598 | + //readyState == 4 means query has finished executing. |
599 | + //status == 200 means "GET"ing has been successful. |
600 | + if (query_id == "function_names"){ |
601 | + //Text output displayed in paragraph. |
602 | + document.getElementById("function_names_output").innerHTML = |
603 | + xmlhttp.responseText; |
604 | + show_item("function_names_output"); |
605 | + } |
606 | + else{ |
607 | + show_item("output_image"); |
608 | + document.getElementById("output_image").src = string; |
609 | + } |
610 | + } |
611 | + else if (xmlhttp.readyState == 4 && xmlhttp.status == 400){ |
612 | + //Error occurred during query; display response. |
613 | + show_error(xmlhttp.responseText); |
614 | + } |
615 | + else if(xmlhttp.readyState == 4 && xmlhttp.status == 404){ |
616 | + //Error occurred during query; display response. |
617 | + show_error(xmlhttp.responseText); |
618 | + } |
619 | + else if(xmlhttp.readyState ==4 && xmlhttp.status == 204){ |
620 | + //Query executed correctly but graph returned is empty |
621 | + show_error("Graph returned was empty"); |
622 | + } |
623 | + else if (xmlhttp.readyState == 4 && xmlhttp.status == 502) { |
624 | + //Error occurs if Neo4j isn't running |
625 | + show_error("Bad Gateway received - are you sure the database server is running?"); |
626 | + } |
627 | + else if(xmlhttp.readyState ==4){ |
628 | + //query executed correctly |
629 | + show_error("An unknown error occurred"); |
630 | + } |
631 | + } |
632 | +} |
633 | + |
634 | +function show_item(id) { |
635 | + var els = ["output_image", "function_names_output", "welcome", "please-wait", "error"]; |
636 | + |
637 | + for (var i = 0; i < els.length; i++) { |
638 | + document.getElementById(els[i]).style.display = "none"; |
639 | + } |
640 | + |
641 | + document.getElementById(id).style.display = "block"; |
642 | +} |
643 | + |
644 | + |
645 | +function show_error(msg) { |
646 | + show_item("error"); |
647 | + document.getElementById("error-msg").innerHTML = msg; |
648 | +} |
649 | |
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 @@ |
654 | -pre { |
655 | - color: green; |
656 | - background: white; |
657 | - font-family: monospace; |
658 | -} |
659 | - |
660 | -body { |
661 | - font-family: Helvetica, sans-serif; |
662 | -} |
663 | -.button{ |
664 | - display:block; width:100px; height:100px; border-radius:50px; font-size:15px; |
665 | - color:#fff; line-height:100px; text-align:center; background:#FF0000 |
666 | -} |
667 | - |
668 | -.pos_img{ |
669 | - position:absolute; |
670 | - left:0px; |
671 | - top:270px; |
672 | - z-index:-1 |
673 | - |
674 | -} |
675 | -.pos_functions{ |
676 | - position:absolute; |
677 | - left:0px; |
678 | - top:250px; |
679 | - |
680 | -} |
681 | - |
682 | -.button2{ |
683 | - display:inline-block; width:200px; height:100px; border-radius:50px; |
684 | - font-size:15px; color:#fff; line-height:100px; |
685 | - text-align:center; background:#000000 |
686 | -} |
687 | - |
688 | - |
689 | - |
690 | +@import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,300,200); |
691 | +@import url(http://fonts.googleapis.com/css?family=Poiret+One); |
692 | + |
693 | + |
694 | +pre { |
695 | + color: green; |
696 | + background: white; |
697 | + font-family: monospace; |
698 | +} |
699 | + |
700 | +body { |
701 | + font-family: 'Source Sans Pro', sans-serif; |
702 | + backround-color: rgb(245, 245, 245); |
703 | + margin: 0; |
704 | + padding: 0; |
705 | +} |
706 | + |
707 | +body.titlescreen { |
708 | + background-color: rgb(105, 145, 172); |
709 | + color: rgb(245, 245, 245); |
710 | +} |
711 | + |
712 | +.pos_img{ |
713 | + position:absolute; |
714 | + left:0px; |
715 | + top:80px; |
716 | + z-index:-1 |
717 | + |
718 | +} |
719 | +.pos_functions{ |
720 | + position:absolute; |
721 | + left:0px; |
722 | + top:250px; |
723 | + |
724 | +} |
725 | + |
726 | +.button2{ |
727 | + display:inline-block; width:200px; height:100px; border-radius:50px; |
728 | + font-size:15px; color:#fff; line-height:100px; |
729 | + text-align:center; background:#000000 |
730 | +} |
731 | + |
732 | + |
733 | + |
734 | + |
735 | + |
736 | +div.centered { |
737 | + position: absolute; |
738 | + left: 50%; |
739 | + top: 40%; /* for good design we position nearer the top */ |
740 | + transform: translate(-50%, -40%); |
741 | + -webkit-transform: translate(-50%, -40%); |
742 | + -moz-transform: translate(-50%, -40%); |
743 | + -ms-transform: translate(-50%, -40%); |
744 | + text-align: center; |
745 | +} |
746 | + |
747 | +#titlescreen-logo-text { |
748 | + font-size: 80px; |
749 | + font-family: 'Poiret One', sans-serif; |
750 | + letter-spacing: -2px; |
751 | + padding-bottom: 4px; |
752 | +} |
753 | + |
754 | +#titlescreen-bottombar { |
755 | + font-size: 20px; |
756 | + position: absolute; |
757 | + left: 0; |
758 | + bottom: 0; |
759 | + right: 0; |
760 | + height: 80px; |
761 | + font-weight: 300; |
762 | + text-align: center; |
763 | +} |
764 | + |
765 | +.toolbar { |
766 | + background-color: rgb(105, 145, 172); |
767 | + color: rgb(245, 245, 245); |
768 | + position: fixed; |
769 | + padding: 4px 10px 4px 10px; |
770 | + width: 100%; |
771 | +} |
772 | + |
773 | +.button { |
774 | + background-color: rgb(195, 215, 223); |
775 | + color: rgb(103, 114, 122); |
776 | + padding: 4px 10px 4px 10px; |
777 | + margin-left: 3px; |
778 | + margin-right: 3px; |
779 | + border: none; |
780 | +} |
781 | + |
782 | +.textbox { |
783 | + background-color: rgb(245, 245, 245); |
784 | + border: 1px solid rgb(103, 114, 122); |
785 | + color: rgb(103, 114, 122); |
786 | + padding: 2px 4px 2px 4px; |
787 | + margin: 2px; |
788 | +} |
789 | + |
790 | +.dropdown { |
791 | + background-color: rgb(245, 245, 245); |
792 | + border: 1px solid rgb(103, 114, 122); |
793 | + color: rgb(103, 114, 122); |
794 | + padding: 1px 4px 1px 4px; |
795 | + margin: 2px; |
796 | +} |
797 | + |
798 | +.button:hover { |
799 | + background-color: rgb(245, 245, 245); |
800 | +} |
801 | + |
802 | + |
803 | + |
804 | + |
805 | +.title { |
806 | + font-size: 41px; |
807 | + font-family: 'Poiret One', sans-serif; |
808 | + letter-spacing: -1px; |
809 | + padding-bottom: 4px; |
810 | + color: rgb(103, 114, 122); |
811 | +} |
812 | + |
813 | +.subtitle { |
814 | + font-size: 20px; |
815 | + color: rgb(103, 114, 122); |
816 | + font-weight: 300; |
817 | +} |
818 | + |
819 | +.subtitle > b { |
820 | + font-weight: 400; |
821 | +} |
822 | + |
823 | + |
824 | +.error-title { |
825 | + font-size: 41px; |
826 | + font-family: 'Poiret One', sans-serif; |
827 | + letter-spacing: -1px; |
828 | + padding-bottom: 4px; |
829 | + color: rgb(215, 92, 55); |
830 | +} |
831 | + |
832 | +.error-subtitle { |
833 | + font-size: 20px; |
834 | + color: rgb(215, 92, 55); |
835 | + font-weight: 300; |
836 | +} |
837 | |
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 | # node already, DOT lets us add more information about that node |
843 | # so we can insist on turning that same node into a box-shape |
844 | # and changing its font. |
845 | - output_str += ' "{}" [label="{}", fontname="{}", shape=box]\n'.format(func.name, |
846 | - ProgramConverter.get_display_name(func, suppress_common_nodes), |
847 | - font_name) |
848 | + output_str += ( |
849 | + ' "{}" [label="{}", fontname="{}", fontsize="10", ' + |
850 | + 'shape=box, penwidth=0.5]\n').format( |
851 | + func.name, |
852 | + ProgramConverter.get_display_name(func, suppress_common_nodes), |
853 | + font_name) |
854 | if func.is_common: |
855 | output_str += ' "{}" [fillcolor=lightgreen, style=filled]\n'.format(func.name) |
856 |
Approving for now. HTML and CSS for the whole project may be reviewed at a later date.