-
Notifications
You must be signed in to change notification settings - Fork 1
/
options.html
60 lines (50 loc) · 1.84 KB
/
options.html
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
60
<html>
<head><title>Wicket Debug Options</title></head>
<script type="text/javascript" src="wicket-idea.js"></script>
<script type="text/javascript">
// Saves options to localStorage.
function save_options() {
var host = document.getElementById("host");
localStorage["host"] = host.value;
var context = document.getElementById('context');
localStorage["context"] = context.value;
createContextMenu();
// Update status to let user know options were saved.
var status = document.getElementById("status");
status.innerHTML = "Options Saved.";
setTimeout(function(){
status.innerHTML = '';
}, 3000);
}
// Restores select box state to saved value from localStorage.
function restore_options() {
var host = localStorage["host"];
if (!host) {
host = 'localhost:10462';
}
var hostEl = document.getElementById("host");
hostEl.value=host;
var context = localStorage['context'];
if (!context){
context = 'http://*/*, https://*/*';
}
var contextEl = document.getElementById('context');
contextEl.value = context;
}
</script>
<body onload="restore_options()">
<form action="javascript:save_options()">
<label for="host">IDE Host :</label>
<p>Please input the URL to access your IDE in the form of HOST:PORT (default 'localhost:10462').</p>
<input type='text' name="host" id='host' value=''/>
<br/>
<label for="context">Context Menu Presence Host :</label>
<p>Define the hosts where you want to see the context menu item (in the form 'http://localhost/*, http://*.srmvision.com/*')
(default 'http://*/*, https://*/*').</p>
<input type='text' name="context" id='context' value='' style='width:100%'/>
<hr/>
<button type="submit">Save</button>
<div id="status"></div>
</form>
</body>
</html>