Codacy var names part 3 and more

This commit is contained in:
Matteo Gheza 2021-04-05 19:43:31 +02:00
parent 3c40f31c05
commit dcff77e67e
10 changed files with 25 additions and 24 deletions

View File

@ -1,10 +1,10 @@
import {default as createUnityInstance} from './ld46.loader.js';
import {default as createUnityInstance} from "./ld46.loader.js";
import build_size_data from './ld46.data.gz';
import buildSizeFramework from './ld46.framework.js.gz';
import buildSizeWasm from './ld46.wasm.gz';
import buildSizeData from "./ld46.data.gz";
import buildSizeFramework from "./ld46.framework.js.gz";
import buildSizeWasm from "./ld46.wasm.gz";
console.log("data "+build_size_data);
console.log("data "+buildSizeData);
console.log("framework "+buildSizeFramework);
console.log("wasm "+buildSizeWasm);

View File

@ -53,7 +53,7 @@ input::placeholder {
.modal-text {
margin-top: 15px;
line-height: 25px;
font-size: 1.0em;
font-size: 1em;
font-family: calibri;
}

View File

@ -208,7 +208,7 @@ async function loadTable ({ tablePage, setInterval = true, interval = 10000, onl
response.json().then(data => {
fillTable({ data, replaceLatLngWithMap, callback });
console.log("Table loaded from cache");
$("#offline_update").text(new Date(parseInt(response.headers.get("date"))).toLocaleString());
$("#offline_update").text(new Date(parseInt(response.headers.get("date"), 10)).toLocaleString());
});
});
});

View File

@ -29,4 +29,4 @@ div#results {
.leaflet-pane.leaflet-shadow-pane {
display: none;
}
}

View File

@ -137,7 +137,7 @@ function chooseAddr (addrLat, addrLng, zoom = undefined, lat1 = undefined, lng1
}
// started from https://derickrethans.nl/leaflet-and-nominatim.html
function addrSearch (string_results_found = undefined, stringResultsNotFound = undefined) {
function addrSearch (stringResultsFound= undefined, stringResultsNotFound = undefined) {
function searchError (error, checkClipboard) {
if (!checkClipboard) {
$("<p>", { html: stringResultsNotFound }).appendTo("#results");
@ -147,7 +147,7 @@ function addrSearch (string_results_found = undefined, stringResultsNotFound = u
}
let inp = document.getElementById("addr").value;
// if translation strings are not defined, skip the nominatim step and don't log errors (no console.error)
const checkClipboard = string_results_found === undefined && stringResultsNotFound === undefined;
const checkClipboard = stringResultsFound=== undefined && stringResultsNotFound === undefined;
$("#results").empty();
if (inp.match("\@(-?[\d\.]*)")) { // Google Maps
@ -190,8 +190,8 @@ function addrSearch (string_results_found = undefined, stringResultsNotFound = u
items.push("<li><a href='' onclick='chooseAddr(\"" + val.lat + "\", \"" + val.lon + "\", undefined, " + val.boundingbox[0] + ", " + val.boundingbox[2] + ", " + val.boundingbox[1] + ", " + val.boundingbox[3] + ", \"" + val.osm_type + "\"); return false;'>" + val.display_name + "</a></li>");
});
if (items.length != 0) {
$("<p>", { html: string_results_found + ":" }).appendTo("#results");
if (items.length !== 0) {
$("<p>", { html: stringResultsFound+ ":" }).appendTo("#results");
$("<ul/>", {
class: "results-list",
html: items.join("")

View File

@ -13,6 +13,7 @@ function fetchHandler (event, contentType, notFoundMessage) {
// for an HTML page.
if (event.request.mode === "navigate") {
event.respondWith((async () => {
console.log("respond with");
try {
// First, try to use the navigation preload response if it's supported.
const preloadResponse = await event.preloadResponse;
@ -78,8 +79,8 @@ self.addEventListener("install", (event) => {
fetch("resources/dist/manifest.json")
.then((response) => response.json())
.then((manifest) => {
const scripts_required = ["main.js", "maps.js"];
scripts_required.map((scriptName) => {
const scriptsRequired = ["main.js", "maps.js"];
scriptsRequired.map((scriptName) => {
console.log(manifest);
console.log(scriptName);
cache.add("resources/dist/" + manifest[scriptName]);

View File

@ -18,7 +18,7 @@ export default async function fillTable ({ data, replaceLatLngWithMap = false, c
$.each(data, function (rowNum, item) {
const row = document.createElement("tr");
row.id = "row-" + rowNum;
$.each(item, function (cell_num, i) {
$.each(item, function (cellNum, i) {
if (i !== null) {
if (replaceLatLngWithMap && i.match(/[+-]?\d+([.]\d+)?[;][+-]?\d+([.]\d+)?/gm)) { /* credits to @visoom https://github.com/visoom */
const lat = i.split(";")[0];
@ -56,19 +56,19 @@ export default async function fillTable ({ data, replaceLatLngWithMap = false, c
loadedLanguage = {};
}
if (!$.fn.DataTable.isDataTable("#table")) {
var setableDt = $("#table").DataTable({
var tableDt = $("#table").DataTable({
responsive: true,
language: loadedLanguage,
buttons: ["excel", "pdf", "csv"]
});
setableDt.buttons().container()
tableDt.buttons().container()
.appendTo("#table_wrapper :nth-child(1):eq(0)");
if (callback !== false) {
callback(setableDt);
callback(tableDt);
}
} else {
setableDt.rows().invalidate();
tableDt.rows().invalidate();
}
window.setableDt = setableDt;
window.tableDt = tableDt;
}

View File

@ -3,7 +3,7 @@ export default async function fillTable ({ data, replaceLatLngWithMap = false, c
$.each(data, function (rowNum, item) {
const row = document.createElement("tr");
row.id = "row-" + rowNum;
$.each(item, function (cell_num, i) {
$.each(item, function (cellNum, i) {
if (i !== null) {
if (replaceLatLngWithMap && i.match(/[+-]?\d+([.]\d+)?[;][+-]?\d+([.]\d+)?/gm)) { /* credits to @visoom https://github.com/visoom */
const lat = i.split(";")[0];

View File

@ -127,4 +127,4 @@ module.exports = (env) => {
})
);
return merge(common, prodConfig);
}
};

View File

@ -19,8 +19,8 @@
</tbody>
</table>
<script>
loadTable({tablePage: "log", setInterval: false, callback: function(setableDt) {
setableDt
loadTable({tablePage: "log", setInterval: false, callback: function(tableDt) {
tableDt
.column( '3:visible' )
.order( 'desc' )
.draw();