-
Notifications
You must be signed in to change notification settings - Fork 87
/
selectserver.html
55 lines (48 loc) · 1.55 KB
/
selectserver.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
<div class="selectserver container">
<div class="span7">
<div class="header"></div>
<form class="form-horizontal">
<legend>Select BIMserver</legend>
<div class="serverAddressDiv form-group">
<label class="control-label" for="inputServer">Server</label>
<div class="controls">
<div class="btn-group input-append">
<div class="input-prepend input-group">
<span class="input-group-addon">http://</span>
<input type="text" id="inputServer" class="form-control address" placeholder="BIMserver">
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="controls">
<button type="button" class="btn selectServerButton btn-primary">Select server</button>
</div>
</div>
</form>
</div>
</div>
<script>
function SelectServer(address) {
var othis = this;
$(".header").load(Global.baseDir + "header.html");
pushHistory({page: "SelectServer"}, "Select BIMServer");
this.selectServer = function(){
var address = $(".address").val();
address = stripHttps(address);
document.location = document.location.origin + document.location.pathname + "?api_address=http://" + address;
};
if ($.cookie("address" + window.document.location.port) != null) {
$(".address").val(stripHttps($.cookie("address" + window.document.location.port)));
} else if (address != null) {
$(".address").val(stripHttps(address));
}
$(".selectServerButton").click(function(){
othis.selectServer();
});
$(".address").enterpress(function(){
othis.selectServer();
});
$(".address").focus();
}
</script>