Skip to content

Commit

Permalink
Release 1.0.1 - Minor console logging and only parsing the .bib once
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelplews committed Sep 13, 2016
1 parent 7660ba1 commit d3709d1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions citations.js
Original file line number Diff line number Diff line change
@@ -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();
Expand All @@ -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);

0 comments on commit d3709d1

Please sign in to comment.