-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
86 lines (70 loc) · 3.17 KB
/
index.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
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
86
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>HFS FILE CHAT</title>
<link rel="stylesheet" href="style.css" type="text/css">
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="chat.js"></script>
</head>
<body onload='save_username(); get_file(message_number);'>
<!--Function with parameter must be a string to correct working setInteval repeats-->
<div id="page-wrap">
<a href="about.html" title="This is an open source!"><h2>HFS FILE CHAT</h2></a>
<p id="name-area"></p>
<div id="chat-wrap"><div id="chat-area"></div></div>
<center>
<font color="ff7ff2">Maximum Length =
<a id="maxLength" href="javascript:void(0)" style="display:inline; color: ff7ff2;" onclick="input_max_Length()"></a>
<div id="set_maxLength_div" style="display:none;"><input id="set_maxLength_input" type="number" min="0" value="0" style="width: 75px;"> <input value="OK" type="button" onclick="set_maxLength()"></div>
symbols
</font>
</center>
<center>
<font color="ff7ff2" title="Use button to allow '\n' inside textarea.">
Use button? <input id="button" name="button" type="checkbox" onclick="show_hide_button();">
</font>
<input id="send" type="button" onclick="send_message();" style="display:none;" value="Send Message">
</center>
<br>
<form id="send-message-area">
<p id="last_message" style="display:none;"></p>
<p id="username">Username: </p>
<textarea id="sendie" height="auto" rows="10" maxlength="3000" placeholder="Type your message and press Enter" onclick="set_maxLength();"></textarea>
</form>
</div>
<script>
//Add changed value of maxLength for textarea and add the button to allow '\n' inside this textarea.
var sendie = document.getElementById('sendie');
var maxLength = sendie.getAttribute('maxLength');
var maxLength_div = document.getElementById('maxLength');
var set_maxLength_div = document.getElementById('set_maxLength_div');
var set_maxLength_input = document.getElementById('set_maxLength_input');
var send_button = document.getElementById('send');
var checkbox_button = document.getElementById('button');
maxLength_div.innerHTML = maxLength;
function input_max_Length(){
maxLength_div.style.display = 'none';
set_maxLength_div.style.display = 'inline';
set_maxLength_input.value = maxLength;
}
function set_maxLength(){
var input_maxLength = set_maxLength_input.value;
if(input_maxLength!=0){maxLength = input_maxLength;}
else{maxLength = parseInt(maxLength_div.innerHTML);}
maxLength_div.innerHTML = maxLength;
sendie.setAttribute('maxLength', maxLength);
set_maxLength_div.style.display = 'none';
maxLength_div.style.display = 'inline';
}
function show_hide_button(){
if (checkbox_button.checked){
send_button.style.display = "block";
} else {
send_button.style.display = "none";
}
}
function send_message(){ //onclick the button
save_message_as_file(); //save message as file and upload this to HFS
sendie.value = "";
}
</script>
</body></html>