Skip to content

Commit

Permalink
Add current reference URL to DOI search-bait
Browse files Browse the repository at this point in the history
This addresses issue #1321.
  • Loading branch information
jimallman committed Aug 8, 2023
1 parent 594cde0 commit 3f53d15
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions curator/static/js/study-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -8852,14 +8852,17 @@ function autoApplyExactMatch() {
function lookUpDOI() {
// try to find a match, based on existing metadata
var referenceText = $.trim( $('#ot_studyPublicationReference').val() );
// toss in the current URL as well, in case this is the latest input
var urlText = $.trim( $('#ot_studyPublication').val() );
var combinedSearchText = referenceText +" "+ urlText;
var lookupURL;
if (referenceText === '') {
if ($.trim(combinedSearchText) === '') {
// try a generic search in a new window
lookupURL = 'http://search.crossref.org/';
window.open(lookupURL,'lookup');
} else {
// see if we get lucky..
lookupURL = '/curator/search_crossref_proxy?' + encodeURIComponent(referenceText).replace(/\(/g,'%28').replace(/\)/g,'%29');
lookupURL = '/curator/search_crossref_proxy?' + encodeURIComponent(combinedSearchText).replace(/\(/g,'%28').replace(/\)/g,'%29');

// show potential matches in popup? or new frame?
showModalScreen("Looking up DOI...", {SHOW_BUSY_BAR:true});
Expand All @@ -8870,7 +8873,7 @@ function lookUpDOI() {
// crossdomain: true,
// contentType: "application/json; charset=utf-8",
url: lookupURL,
//data: {'q': referenceText},
//data: {'q': combinedSearchText},
complete: function( jqXHR, textStatus ) {
hideModalScreen();
if (textStatus !== 'success') {
Expand Down

0 comments on commit 3f53d15

Please sign in to comment.