Passed
Push — master ( 33081a...0dd98d )
by Paul
05:28
created

+/scripts/admin/logger.js   A

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 22
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
nc 1
dl 0
loc 22
rs 10
c 1
b 0
f 0
wmc 4
mnd 0
bc 4
fnc 4
bpm 1
cpm 1
noi 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A Logger.onClick_ 0 9 1
A logger.js ➔ Logger 0 3 1
1
/** global: GLSR, jQuery */
2
;(function( x ) {
3
4
	'use strict';
5
6
	var Logger = function() {
7
		x( 'form' ).on( 'click', '#clear-log', this.onClick_ );
8
	};
9
10
	Logger.prototype = {
11
		onClick_: function( ev ) {
12
		 	var request = {
13
				action: 'clear-log',
14
			};
15
			GLSR.Ajax( ev, request, function( response ) {
16
				GLSR.Notices( response.notices );
17
				x( '#log-file' ).val( response.logger );
18
			});
19
		},
20
	};
21
22
	GLSR.Logger = Logger;
23
})( jQuery );
24