From: Agnibho Mondal Date: Sun, 30 May 2021 18:58:36 +0000 (+0530) Subject: Abstract formatting X-Git-Url: https://code.agnibho.com/repo?a=commitdiff_plain;h=c8a343dfe4e1a3c8088e1a1e19a0addff0269d08;p=sysrev.git Abstract formatting --- diff --git a/custom.css b/custom.css index e1c8d68..a480caf 100644 --- a/custom.css +++ b/custom.css @@ -1,3 +1,3 @@ -pre { +.abstract { white-space: pre-wrap; } diff --git a/script.js b/script.js index df0a9db..ac948e6 100644 --- a/script.js +++ b/script.js @@ -11,6 +11,26 @@ if(localStorage.getItem("bibliographies")){ function write(){ localStorage.setItem("bibliographies", JSON.stringify(bibgraph)); } +function abstractFormat(text){ + console.log(text); + text="\n"+text; + text=text.replace(/\nobjectives?/i, "Objectives"); + text=text.replace(/\nbackground/i, "Background"); + text=text.replace(/\nmethods?/i, "\nMethods"); + text=text.replace(/\ndesigns?/i, "\nDesign"); + text=text.replace(/\nmaterials? and methods?/i, "\nMaterials and methods"); + text=text.replace(/\nmethodology/i, "\nMethodology"); + text=text.replace(/\ninterventions?/i, "\nInterventions"); + text=text.replace(/\nstatistical analysis/i, "\nStatistical Analysis"); + text=text.replace(/\nprincipal findings?/i, "\nPrincipal Findings"); + text=text.replace(/\nfindings?/i, "\nFindings"); + text=text.replace(/\noutcomes?/i, "\nOutcomes"); + text=text.replace(/\nresults?/i, "\nResults"); + text=text.replace(/\nconclusions?/i, "\nConclusions"); + text=text.replace(/\nsignificance/i, "\nSignificance"); + console.log(text); + return text; +} function showAllBibs(){ $("#all-bibs").html(""); Object.values(bibgraph).forEach(function(bib){ @@ -82,7 +102,7 @@ $(document).ready(function(){ flag=""; if(item.selected[1]==true) flag="checked"; if(item.selected[0]){ - $("#step-2").html($("#step-2").html()+"
"+item.title+" ["+item.creators[0].lastName+" et al]
"+item.abstractNote+"
"); + $("#step-2").html($("#step-2").html()+"
"+item.title+" ["+item.creators[0].lastName+" et al]
"+abstractFormat(item.abstractNote)+"
"); } }); });