-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html.bak
85 lines (68 loc) · 2.02 KB
/
test.html.bak
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CLASH Text Submit Test</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.1/themes/redmond/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script src="mysqltest.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<style>
#resizable { width: 500px; height: 300px; padding: 0.5em; }
#resizable h3 { text-align: left; margin: 0; }
</style>
<script>
$(function() {
$( "#resizable" ).resizable({
aspectRatio: 16 / 9
});
$( "#button" ).button();
$('#characterLeft').text('3000 characters remaining');
$('#resizable').keyup(function () {
var max = 3000;
var len = $(this).val().length;
if (len >= max) {
$('#characterLeft').text(' you have reached the limit');
} else {
var ch = max - len;
$('#characterLeft').text(ch + ' characters remaining');
}
});
});
</script>
</head>
<body>
<form id="form" action="">
<div id="enter">
<label for="resizable">Enter Text:</label>
<textarea id="resizable" cols="30" rows="10" wrap="physical" name="text" maxlength="3000" placeholder="Enter text to CLASH"></textarea>
<div for="resizable" id="characterLeft"></div>
<button type="button" id="button">CLASH IT!</button>
</div>
</form>
<br>
<div id="resultSection">
<label for="NLTKresult">Result from Node:</label>
</div>
<script src="https://cdn.socket.io/socket.io-1.2.0.js"></script>
<script>
var socket = io();
$('#button').click(function(){
console.log('trying to emit...');
socket.emit('text', $('#resizable').val());
console.log($('#resizable').val());
$('#resizable').val('');
return false;
});
socket.on('response', function(msg){
console.log('response recieved ' + msg);
$('#resultSection').append($('<p>').text(msg));
});
</script>
<!--mysql testing-->
<h1>MYSQL Testing</h1>
<p>.</p>
<input type="button" onclick="popup()" value="test">
</body>
</html>