]> Softwares of Agnibho - sysrev.git/commitdiff
Abstract formatting
authorAgnibho Mondal <mondal@agnibho.com>
Sun, 30 May 2021 18:58:36 +0000 (00:28 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Sun, 30 May 2021 18:58:36 +0000 (00:28 +0530)
custom.css
script.js

index e1c8d68d988ab8183233ac3ff7c988c17f82d30a..a480caf7bfc7abc1ca249c2f8f4df8cc70bea322 100644 (file)
@@ -1,3 +1,3 @@
-pre {
+.abstract {
        white-space: pre-wrap;
 }
index df0a9dbe3749d6406132ffc4289f134b3aa4ed22..ac948e62667840787abc580b247e7dfbf2c9de74 100644 (file)
--- 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, "<strong>Objectives</strong>");
+  text=text.replace(/\nbackground/i, "<strong>Background</strong>");
+  text=text.replace(/\nmethods?/i, "\n<strong>Methods</strong>");
+  text=text.replace(/\ndesigns?/i, "\n<strong>Design</strong>");
+  text=text.replace(/\nmaterials? and methods?/i, "\n<strong>Materials and methods</strong>");
+  text=text.replace(/\nmethodology/i, "\n<strong>Methodology</strong>");
+  text=text.replace(/\ninterventions?/i, "\n<strong>Interventions</strong>");
+  text=text.replace(/\nstatistical analysis/i, "\n<strong>Statistical Analysis</strong>");
+  text=text.replace(/\nprincipal findings?/i, "\n<strong>Principal Findings</strong>");
+  text=text.replace(/\nfindings?/i, "\n<strong>Findings</strong>");
+  text=text.replace(/\noutcomes?/i, "\n<strong>Outcomes</strong>");
+  text=text.replace(/\nresults?/i, "\n<strong>Results</strong>");
+  text=text.replace(/\nconclusions?/i, "\n<strong>Conclusions</strong>");
+  text=text.replace(/\nsignificance/i, "\n<strong>Significance</strong>");
+  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()+"<div class='list-group-item'><a href='#' class='to-select' data-step='1' data-cite='"+item.citationKey+"'><input type='checkbox' "+flag+" class='step-2-select'> "+item.title+" ["+item.creators[0].lastName+" et al]</a><pre>"+item.abstractNote+"</pre></div>");
+        $("#step-2").html($("#step-2").html()+"<div class='list-group-item'><a href='#' class='to-select' data-step='1' data-cite='"+item.citationKey+"'><input type='checkbox' "+flag+" class='step-2-select'> "+item.title+" ["+item.creators[0].lastName+" et al]</a><div class='abstract'>"+abstractFormat(item.abstractNote)+"</div></div>");
       }
     });
   });