From d3709d1128862493558e0489f7e314ed0d9b1ba4 Mon Sep 17 00:00:00 2001 From: michaelplews Date: Mon, 12 Sep 2016 20:17:44 -0500 Subject: [PATCH] Release 1.0.1 - Minor console logging and only parsing the .bib once --- citations.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/citations.js b/citations.js index 41e6f79..790d507 100644 --- a/citations.js +++ b/citations.js @@ -1,8 +1,15 @@ require(['custom/bibtex-parser/parse-bibtex']); require(['custom/jupyter_markdown_citations/custom_bibliography']); +appName = 'jupyter_markdown_citations' + +function parseBib(){ + json = doParse(bibliography); + console.log(appName + ': ', 'bibliography json-ified'); + return json +} + function searchCite(){ - json = doParse(bibliography) var citations = document.getElementsByTagName("cite") for(var i = 0; i < citations.length; i++){ citRef = citations[i].innerHTML.toUpperCase(); @@ -19,8 +26,9 @@ function searchCite(){ + json[citRef].MONTH.charAt(0).toUpperCase() //Capitalize first letter + json[citRef].MONTH.slice(1) + '. ' //Add remainder of string + json[citRef].YEAR); + console.log(appName + ': ', citRef + ' referenced'); }; } -//setTimeout(function(){searchCite();},2000); +setTimeout(function(){parseBib();},500); setInterval(function(){searchCite();},2000);