-
Notifications
You must be signed in to change notification settings - Fork 2
/
create_board.html
73 lines (66 loc) · 1.97 KB
/
create_board.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
<html>
<head>
<title>Create_Board Interface</title>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
function submitform(){
$.ajax({
type: "post",
// XXX: this should be modified to keep in sync with the
// currently used backend
// possible values: dev:300 | www:3000
url: "http://www.postiles.com:3000/board/toosimple",
data: {
anonymous: $('#anonymous').is(':checked'),
topic_id: '1',
name: $("#board_name").val(),
description: $("#board_discription").val(),
default_view: $('#board_type').val()[0],
session_key: $('#password').val(),
user_id: '50',
},
success: function(r){
if(r.status == 'error'){
$("#feedback").css("display", "block");
$("#feedback").html("creation failed, please contact [email protected]");
}else{
$("#feedback").css("display", "block");
setTimeout('dismiss()', 4000);
}
}
});
}
$(document).ready(function() {
$("#password").keypress(function(event) {
if (event.which == 13) {
submitform();
}
});
});
function dismiss() {
$("#feedback").css("display", "none");
}
</script>
<style>
#feedback {
display: none;
}
</style>
</head>
<body>
<p> Board Name </p>
<input type="text" id="board_name" name="name" autofocus="autofocus" />
<p> Board discription </p>
<input type="text" id="board_discription" name="discription"/>
<p> Board Type </p>
<select multiple = "multiple" size = "2" id = 'board_type'>
<option value="sheet">sheet</option>
<option value="free">free</option>
</select>
<input type="checkbox" id="anonymous" name="anonymous" >Anonymous</input>
<p> Your Password to create a board </p>
<input type="password" id="password" name="password" />
<a id="submit" href="javascript:submitform()"> Submit </a>
<p id="feedback"> Board Created successfully </p>
</body>
</html>