Passed
Push — master ( e95921...ddbd1b )
by Dimas
13:28 queued 05:15
created

etc/superuser/pw.js   A

Complexity

Total Complexity 8
Complexity/F 1.33

Size

Lines of Code 33
Function Count 6

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 25
c 0
b 0
f 0
dl 0
loc 33
rs 10
wmc 8
mnd 2
bc 2
fnc 6
bpm 0.3333
cpm 1.3333
noi 0
1
var req = null;
2
$("textarea#str").keyup(function (e) {
3
  e.preventDefault();
4
  var value = $(this).val();
5
6
  if (req == null){
7
    req = $.post(location.href, {
8
      e: value
9
    }, function (res) {
10
      $('textarea[name="encphp"]').val(res.result);
11
      var en = userJSEncrypt('dimaslanjaka', value);
12
      $('textarea[name="encjs"]').val(en);
13
    }).always(function(res){
14
      req = null;
15
    });
16
  }
17
});
18
$("textarea#encstr").keyup(function (e) {
19
  e.preventDefault();
20
  var value = $(this).val();
21
22
  if (req == null){
23
    req = $.post(location.href, {
24
      d: value
25
    }, function (res) {
26
      $('textarea[name="decjs"]').val(res.result);
27
      var en = userJSDecrypt('dimaslanjaka', value);
28
      $('textarea[name="decphp"]').val(en);
29
    }).always(function(res){
30
      req = null;
31
    });
32
  }
33
});