-
Notifications
You must be signed in to change notification settings - Fork 1
/
hider.js
41 lines (32 loc) · 997 Bytes
/
hider.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 () {
var findCommentRows = function () {
return document.getElementsByClassName('u_cbox_contents');
};
var hideComment = function (row) {
var comment = row,
showLink = document.createElement('a');
comment.style.color = '#fff';
showLink.text = '보기';
showLink.style.color = '#000';
showLink.style.cursor = 'pointer';
showLink.addEventListener('click', function (e) {
comment.style.color = null;
this.hidden = true;
});
comment.appendChild(showLink);
};
var hideAllComments = function () {
console.log('Shading comments..');
var rows = findCommentRows(),
len = rows.length,
row, i, showLink;
for (i = 0; i < len; i++) {
hideComment(rows[i]);
}
}
var init = function () {
console.log('Initializing');
hideAllComments();
};
init();
})();