diff --git a/backend/static/css/style.css b/backend/static/css/style.css index fdc4771b..4aa286ab 100644 --- a/backend/static/css/style.css +++ b/backend/static/css/style.css @@ -308,7 +308,7 @@ li.CodeMirror-hint-active { #result-tree .node.cached-pinned { color: grey; border: 1px solid grey; } #result-tree .node.cached-not-pinned { color: grey; border: 1px solid grey; } #result-tree .node-total { display: none; } -#result-tree .node.high { background-color: #FFF7F7; } -#result-tree .node.veryhigh { background-color: #FFEEEE; } -#result-tree .node.high.cached { background-color: #FFFFF7; } -#result-tree .node.veryhigh.cached { background-color: #FFFFEE; } +#result-tree .node.high { background-color: #FFEEEE; } +#result-tree .node.veryhigh { background-color: #FFCCCC; } +#result-tree .node.high.cached { background-color: #FFFFEE; } +#result-tree .node.veryhigh.cached { background-color: #FFFFCC; } diff --git a/backend/static/js/helper.js b/backend/static/js/helper.js index 6a590c89..805436dc 100644 --- a/backend/static/js/helper.js +++ b/backend/static/js/helper.js @@ -898,11 +898,12 @@ function getFormattedResultEntry(str, maxLength, column = undefined) { // the column header. var var_name = $($("#resTable").find("th")[column + 1]).html(); // console.log("Check if \"" + str + "\" in column \"" + var_name + "\" is a float ..."); - if (var_name == "?note" || var_name.endsWith("_note")) str = parseFloat(str).toFixed(2).toString(); + if (var_name.endsWith("?note") || var_name.endsWith("_note")) str = parseFloat(str).toFixed(2).toString(); + if (var_name.endsWith("_per_paper")) str = parseFloat(str).toFixed(2).toString(); if (var_name.endsWith("_perc") || var_name.endsWith("percent")) str = parseFloat(str).toFixed(2).toString(); - if (var_name == "?lp_proz") str = parseFloat(str).toFixed(0).toString(); - if (var_name == "?gesamt_score") str = parseFloat(str).toFixed(1).toString(); - if (var_name == "?lehrpreis") str = parseFloat(str).toFixed(0).toString(); + if (var_name.endsWith("?lp_proz")) str = parseFloat(str).toFixed(0).toString(); + if (var_name.endsWith("?gesamt_score") || var_name.endsWith("?imdb_rating")) str = parseFloat(str).toFixed(1).toString(); + if (var_name.endsWith("?lehrpreis")) str = parseFloat(str).toFixed(0).toString(); pos = cpy.lastIndexOf("^^") pos_http = cpy.indexOf("http"); @@ -930,8 +931,10 @@ function getFormattedResultEntry(str, maxLength, column = undefined) { const typeIsInteger = link.endsWith("int") || link.endsWith("integer"); const typeIsDecimalButNumberIsInteger = link.endsWith("decimal") && str.match(/^\d+$/); if (typeIsInteger || typeIsDecimalButNumberIsInteger) { - str = formatInteger(str); - rightAlign = true; + if (!var_name.endsWith("year")) { + str = formatInteger(str); + rightAlign = true; + } } // For IRIs that start with http display the item depending on the link type. diff --git a/backend/static/js/qleverUI.js b/backend/static/js/qleverUI.js index b63f7f25..2e12d1f8 100755 --- a/backend/static/js/qleverUI.js +++ b/backend/static/js/qleverUI.js @@ -129,7 +129,7 @@ $(document).ready(function () { return; } - if (token.string.match(/^[.`\w?<@]\w*$/)) { + if (token.string.match(new RegExp('^[.`\w?<@]\w*$'))) { string = token.string; } // do not suggest anything inside a word @@ -422,7 +422,7 @@ async function processQuery(sendLimit=0, element=$("#exebtn")) { var nofRows = result.res.length; const [totalTime, computeTime, resolveTime] = getResultTime(result.time); let resultSize = result.resultsize; - let limitMatch = result.query.match(/LIMIT\s+(\d+)\s*$/); + let limitMatch = result.query.match(/\bLIMIT\s+(\d+)\s*$/); if (limitMatch) { resultSize = parseInt(limitMatch[1]); } let resultSizeString = tsep(resultSize.toString()); $('#resultSize').html(resultSizeString); @@ -446,19 +446,16 @@ async function processQuery(sendLimit=0, element=$("#exebtn")) { // create "Map View" buttons. let mapViewButtonVanilla = ''; let mapViewButtonPetri = ''; - let mapViewButtonPetriPatrick = ''; if (result.res.length > 0 && /wktLiteral/.test(result.res[0][columns.length - 1])) { let mapViewUrlVanilla = 'http://qlever.cs.uni-freiburg.de/mapui/index.html?'; let mapViewUrlPetri = 'http://qlever.cs.uni-freiburg.de/mapui-petri/?'; - let mapViewUrlPetriPatrick = 'http://qlever.cs.uni-freiburg.de/mapui-petri-patrick/?'; let params = $.param({ query: normalizeQuery(query), backend: BASEURL }); // var query_escaped = query.replace(/"/g, "\\\""); // console.log("QUERY:", `'${query}'`); // var query_escaped = encodeURIComponent(query); // mapViewButtonVanilla = `
`; mapViewButtonVanilla = ` Map view`; - mapViewButtonPetri = ` Map view++`; - mapViewButtonPetriPatrick = ` Map view+++`; + mapViewButtonPetri = ` Map view`; } // Show the buttons (if there are any). @@ -468,17 +465,18 @@ async function processQuery(sendLimit=0, element=$("#exebtn")) { // the Django configuration of the respective backend). var res = "