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 ( c6c6df...c74c01 )
by Florian
29s
created

js/downloadgpx.js   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 30
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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

2 Functions

Rating   Name   Duplication   Size   Complexity  
A DownloadGPX.initiateDownload 0 19 1
A DownloadGPX.init 0 5 1
1
/*jslint
2
  regexp: true
3
  indent: 4
4
*/
5
6
/*global
7
  $,
8
  document, encodeURIComponent,
9
  Markers
10
*/
11
12
var DownloadGPX = {};
13
DownloadGPX.m_map = null;
14
15
16
DownloadGPX.init = function (themap) {
17
    'use strict';
18
19
    DownloadGPX.m_map = themap;
20
};
21
22
23
DownloadGPX.initiateDownload = function () {
24
    'use strict';
25
26
    var data = '<?xml version="1.0" encoding="UTF-8" standalone="no" ?>\n';
27
    data += '<gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1" xmlns="http://www.topografix.com/GPX/1/1" creator="Flopp\'s Map - http://flopp.net/" xmlns:wptx1="http://www.garmin.com/xmlschemas/WaypointExtension/v1" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd  http://www.garmin.com/xmlschemas/WaypointExtension/v1 http://www.garmin.com/xmlschemas/WaypointExtensionv1.xsd" xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3">\n';
28
    data += '    <metadata>\n';
29
    data += '        <name>Export from Flopp\'s Map</name>\n';
30
    data += '    </metadata>\n';
31
    data += Markers.toXmlWpts();
32
    data += '</gpx>\n';
33
    console.log(data);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
34
    var element = document.createElement('a');
35
    element.setAttribute('href', 'data:application/gpx+xml;charset=utf-8,' + encodeURIComponent(data));
36
    element.setAttribute('download', 'markers.gpx');
37
    element.style.display = 'none';
38
    document.body.appendChild(element);
39
    element.click();
40
    document.body.removeChild(element);
41
};
42