Completed
Push — master ( dce25d...9db7be )
by Dimas
09:29 queued 12s
created

etc/server/comments/dynamic.js   A

Complexity

Total Complexity 5
Complexity/F 1.25

Size

Lines of Code 33
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 20
dl 0
loc 33
c 0
b 0
f 0
rs 10
wmc 5
mnd 1
bc 1
fnc 4
bpm 0.25
cpm 1.25
noi 1
1
$.ajax({
2
  url: "list",
3
  method: "POST",
4
  success: function (res, stats) {
5
    console.log(res);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
6
  },
7
});
8
9
AjaxForm();
10
11
$(".comment-container").click(function () {
12
  var email = $('#comment_submission [name="email"]');
13
  var avatar = `https://www.gravatar.com/avatar/${md5(
14
    email.val().toString().trim()
15
  )}`;
16
17
  var gravatar_submission = $("#comment_submission img.avatar");
18
  if (gravatar_submission.length) {
19
    gravatar_submission.attr("src", avatar);
20
  }
21
22
  $(this).addClass("toggled");
23
24
  $(document).click(function () {
25
    $(".comment-container").removeClass("toggled");
26
  });
27
28
  $(".comment-container").click(function (e) {
29
    e.stopPropagation();
30
  });
31
32
  $(this).find("textarea").focus();
33
});
34