-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
41 lines (38 loc) · 1.16 KB
/
index.js
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
$(function() {
$('#post').keypress(function(event) {
if (event.which == 13) {
var node = document.createElement('div');
node.setAttribute('class', 'feed-item');
var d = new Date();
node.innerHTML = "[" + (d.getMonth()+1) + "/" + d.getDate() + "] " + "<a href='denkrick.html'><b>Anna</b></a>: " + $(this).val();
$('#board').prepend(node);
$(this).val('');
}
});
$('.input-comment').keypress(function(event) {
if (event.which == 13) {
var node = document.createElement('div');
node.setAttribute('class', 'comment');
var d = new Date();
node.innerHTML = "[" + (d.getMonth()+1) + "/" + d.getDate() + "] " + "<b>Anna:</b> " + $(this).val();
this.parentNode.insertBefore(node, this);
$(this).val('');
}
});
<!-- FILTER RECORDINGS -->
$('#filter').keyup(function() {
var a = $(this).val();
if (a.length > 0) {
children = ($("#accordion1").children());
var containing = children.filter(function() {
var regex = new RegExp('\\b'+a, 'i');
return regex.test($('a', this).text());
}).slideDown();
children.not(containing).slideUp();
} else {
children.slideDown();
}
return false;
});
$('#post').focus();
});