GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 19b321...9e1e01 )
by Florian
01:13
created

ExternalLinks.init   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 3
rs 10
1
/*jslint
2
*/
3
4
/*global
5
  $, window, trackAction
6
*/
7
8
9
var ExternalLinks = {};
10
ExternalLinks.m_map = null;
11
ExternalLinks.m_targets = null;
12
13
14
ExternalLinks.init = function (themap) {
15
    'use strict';
16
17
    this.m_map = themap;
18
19
    if (this.m_targets) {
20
        return;
21
    }
22
23
    this.m_targets = {
24
        "★ Games ★": "",
25
        "Confluence.org": "http://www.confluence.org/confluence.php?lat=%lat%&lon=%lon%",
26
        "Geocaching.com": "http://coord.info/map?ll=%lat%,%lon%&z=%zoom%",
27
        "Geograph": "http://geo.hlipp.de/ommap.php?z=%zoom%&t=g&ll=%lat%,%lon%",
28
        "Ingress.com": "http://www.ingress.com/intel?latE6=%late6%&lngE6=%lone6%&z=%zoom%",
29
        "Lacita.org": "http://www.lacita.org/cgi_bin/bf.pl?Path=00&lat=%lat%&lng=%lon%&z=%zoom%",
30
        "Opencaching.de": "http://www.opencaching.de/map2.php?lat=%lat%&lon=%lon%&zoom=%zoom%",
31
        "Waymarking.com": "http://www.waymarking.com/wm/search.aspx?f=1&lat=%lat%&lon=%lon%",
32
        "★ Maps ★": "",
33
        "Bing Maps": "http://www.bing.com/maps/?v=2&cp=%lat%~%lon%&lvl=%zoom%",
34
        "Google Maps": "https://maps.google.com/maps?ll=%lat%,%lon%&z=%zoom%",
35
        "OpenStreetMap": "http://www.openstreetmap.org/?lat=%lat%&lon=%lon%&zoom=%zoom%",
36
        "OpenCycleMap": "http://www.opencyclemap.org/?zoom=%zoom%&lat=%lat%&lon=%lon%",
37
        "ÖPNV-Karte": "http://www.öpnvkarte.de/?zoom=%zoom%&lat=%lat%&lon=%lon%",
38
        "Wheelmap.org": "http://wheelmap.org/?zoom=%zoom%&lat=%lat%&lon=%lon%",
39
        "Wikimapia.org": "http://wikimapia.org/#lat=%lat%&lon=%lon%&z=%zoom%"
40
    };
41
42
    var tag = $('#externallinks');
43
44
    /*jslint unparam: true*/
45
    $.each(this.m_targets, function (key, value) {
0 ignored issues
show
Unused Code introduced by
The parameter value is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
46
        tag.append('<option value="' + key + '">' + key + '</option>');
47
    });
48
    /*jslint unparam: false*/
49
};
50
51
52
ExternalLinks.goto = function () {
53
    'use strict';
54
55
    var selected = $('#externallinks').find(":selected").text(),
56
        url = this.m_targets[selected],
57
        lat = this.m_map.getCenter().lat(),
58
        lng = this.m_map.getCenter().lng();
59
60
    if (!url || url === '') {
61
        return;
62
    }
63
64
    trackAction('external ' + selected);
65
66
    url = url.replace(/%lat%/g, lat.toFixed(6));
67
    url = url.replace(/%lon%/g, lng.toFixed(6));
68
    url = url.replace(/%late6%/g, Math.round(lat * 1000000));
69
    url = url.replace(/%lone6%/g, Math.round(lng * 1000000));
70
    url = url.replace(/%zoom%/g, this.m_map.getZoom());
71
72
    window.open(url, '_blank');
73
};
74