MCPcopy Create free account
hub / github.com/Milkyroad/SCiPNET / mainHTMLFun

Function mainHTMLFun

public/src/js/control.js:46–273  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44 }
45 })
46 function mainHTMLFun() {
47 playSound('/src/ex_file/audio/dashEntrance.mp3')
48 playSound('/src/ex_file/audio/dashNormal.mp3')
49 //get local temperature if location masking is disabled
50 if (loaded == false && locationGet != false) {
51 $.getJSON("https://api.openweathermap.org/data/2.5/weather", {
52 lat: countrylat,
53 lon: countrylong,
54 units: 'metric',
55 APPID: config.WEATHER_KEY
56 }).done(function(weather) {
57 loaded = true //log for second time loading
58 temperature = weather.main.temp || "27"
59 $('#feedTemp').text(`${temperature} °C`)
60 })
61 } else {
62 if (locationGet == false) {
63 $('#feedTemp').text(`27 °C`) //location disabled, if user enables location in the second time, it will pass to the api again
64 } else {
65 $('#feedTemp').text(`${temperature} °C`) //second time loading
66 }
67 }
68
69 //config
70 function configLine(title, max, min, show) {
71 return {
72 type: 'line',
73 data: {
74 datasets: [{
75 backgroundColor: `rgba(${hex2rgb(color)}, 0.2)`,
76 borderColor: `${color}`,
77 cubicInterpolationMode: 'monotone',
78 fill: true,
79 data: []
80 }]
81 },
82 options: {
83 responsive: true,
84 maintainAspectRatio: false,
85 plugins: {
86 title: {
87 display: show,
88 text: title,
89 font: {
90 weight: 'regular'
91 }
92 },
93 legend: {
94 display: false
95 }
96 },
97 elements: {
98 point: {
99 radius: 0
100 },
101 line: {
102 borderWidth: 1
103 }

Callers 1

siteControlFunction · 0.85

Calls 6

generateDNAFunction · 0.85
DNAStrandFunction · 0.85
configLineFunction · 0.70
randomVaFunction · 0.70
$Function · 0.50
updateMethod · 0.45

Tested by

no test coverage detected