Completed
Pull Request — master (#181)
by
unknown
03:39
created

public_html/js/PrivacyAPI.js   A

Size

Lines of Code 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 1
rs 10
noi 6
1
var PrivacyAPI = {};
2
3
PrivacyAPI.showPrivacy = function(anchor) {
4
    
5
    var stateInfo = {pageInfo: 'privacy', pageTitle: 'Talent Cloud: Privacy Policy'};
6
    document.title = stateInfo.pageTitle;
7
8
    TalentCloudAPI.hideAllContent();
0 ignored issues
show
Bug introduced by
The variable TalentCloudAPI seems to be never declared. If this is a global, consider adding a /** global: TalentCloudAPI */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
9
    
10
    var privacySection = document.getElementById('privacySection');
11
    privacySection.classList.remove('hidden');
12
13
    var locale = TalentCloudAPI.getLanguageFromCookie();
0 ignored issues
show
Unused Code introduced by
The variable locale seems to be never used. Consider removing it.
Loading history...
14
15
    // New Subpage Hero Scripts
16
17
    Utilities.getHeroElements();
0 ignored issues
show
Bug introduced by
The variable Utilities seems to be never declared. If this is a global, consider adding a /** global: Utilities */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
18
19
    var privacyHeroTitle = document.getElementById("privacyHeroTitle");
20
    privacyHeroTitle.classList.remove("hidden");
21
    privacyHeroTitle.setAttribute("aria-hidden", "false");
22
23
    // Google Analytics
24
25
    ga('set', 'page', '/privacy');
26
    ga('send', 'pageview');
27
28
    if (anchor == null) {
0 ignored issues
show
Best Practice introduced by
Comparing anchor to null using the == operator is not safe. Consider using === instead.
Loading history...
Coding Style introduced by
It is recommended to use === to compare with null.

Generally, it is recommended to use strict comparison whenever possible and not to rely on the weaker type-juggling comparison operator.

Read more about comparison operations.

Loading history...
29
        history.pushState(stateInfo, stateInfo.pageInfo, '#privacy');
0 ignored issues
show
Bug introduced by
The variable history seems to be never declared. If this is a global, consider adding a /** global: history */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
30
        window.scrollTo(0, 0);
31
    }
32
33
};