Passed
Branch master (32b4c5)
by Askupa
01:33
created

src/js/mivhak.buttons.js   A

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 47
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
c 1
b 0
f 0
nc 1
dl 0
loc 47
rs 10
wmc 4
mnd 0
bc 4
fnc 4
bpm 1
cpm 1
noi 4
1
// Built-in buttons
2
Mivhak.buttons = {
3
    
4
    /**
5
     * The wrap button features a toggle button and is used to toggle line wrap
6
     * on/off for the currently active tab
7
     */
8
    wrap: {
9
        text: 'Wrap Lines', 
10
        toggle: true, 
11
        click: function(e) {
12
            e.stopPropagation();
13
            this.callMethod('toggleLineWrap');
14
        }
15
    },
16
    
17
    /**
18
     * The copy button copies the code in the currently active tab to clipboard
19
     * (except for Safari, where it selects the code and prompts the user to press command+c)
20
     */
21
    copy: {
22
        text: 'Copy',
23
        click: function(e) {
24
            this.callMethod('copyCode');
25
        }
26
    },
27
    
28
    /**
29
     * The collapse button toggles the entire code viewer into and out of its
30
     * collapsed state.
31
     */
32
    collapse: {
33
        text: 'Colllapse',
34
        click: function(e) {
35
            this.callMethod('collapse');
36
        }
37
    },
38
    
39
    /**
40
     * The about button shows the user information about Mivhak
41
     */
42
    about: {
43
        text: 'About Mivhak',
44
        click: function(e) {
45
            this.notifier.closableNotification('Mivhak.js v1.0.0');
46
        }
47
    }
48
};