Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
| 1 |
<!doctype html> |
| 2 |
<html><head> |
| 3 |
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script> |
| 4 |
<script src="https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js"></script> |
| 5 |
<style> |
| 6 |
.box { |
| 7 |
width: 300px; |
| 8 |
float: left; |
| 9 |
margin: 0 20px 0 20px; |
| 10 |
} |
| 11 |
.box div, .box input { |
| 12 |
border: 1px solid; |
| 13 |
-moz-border-radius: 4px; |
| 14 |
border-radius: 4px; |
| 15 |
width: 100%; |
| 16 |
padding: 0px; |
| 17 |
margin: 5px; |
| 18 |
} |
| 19 |
.box div { |
| 20 |
border-color: grey; |
| 21 |
height: 300px; |
| 22 |
overflow: auto; |
| 23 |
} |
| 24 |
.box input { |
| 25 |
height: 30px; |
| 26 |
} |
| 27 |
h1 { |
| 28 |
margin-left: 30px; |
| 29 |
} |
| 30 |
body { |
| 31 |
background-color: #F0F0F0; |
| 32 |
font-family: "Arial"; |
| 33 |
} |
| 34 |
</style> |
| 35 |
</head><body lang="en"> |
| 36 |
<h1>SockJS Echo example</h1> |
| 37 |
|
| 38 |
<div id="first" class="box"> |
| 39 |
<div></div> |
| 40 |
<form><input autocomplete="off" value="Type here..."></input></form> |
| 41 |
</div> |
| 42 |
|
| 43 |
<script> |
| 44 |
var sockjs_url = '/echo'; |
| 45 |
var sockjs = new SockJS(sockjs_url); |
| 46 |
$('#first input').focus(); |
| 47 |
|
| 48 |
var div = $('#first div'); |
| 49 |
var inp = $('#first input'); |
| 50 |
var form = $('#first form'); |
| 51 |
|
| 52 |
var print = function(m, p) { |
| 53 |
p = (p === undefined) ? '' : JSON.stringify(p); |
| 54 |
div.append($("<code>").text(m + ' ' + p)); |
| 55 |
div.append($("<br>")); |
| 56 |
div.scrollTop(div.scrollTop()+10000); |
| 57 |
}; |
| 58 |
|
| 59 |
sockjs.onopen = function() {print('[*] open', sockjs.protocol);}; |
| 60 |
sockjs.onmessage = function(e) {print('[.] message', e.data);}; |
| 61 |
sockjs.onclose = function() {print('[*] close');}; |
| 62 |
|
| 63 |
form.submit(function() { |
| 64 |
print('[ ] sending', inp.val()); |
| 65 |
sockjs.send(inp.val()); |
| 66 |
inp.val(''); |
| 67 |
return false; |
| 68 |
}); |
| 69 |
|
| 70 |
</script> |
| 71 |
</body></html> |