From 213a6638c975182ff4d7ef66e7761d61bed3fcc6 Mon Sep 17 00:00:00 2001 From: yqjiang Date: Mon, 10 Jun 2013 17:08:16 -0300 Subject: [PATCH] edit for display mulitpal issns --- targets/cufts/js/cufts_results.js | 52 +++++++++++++++++-------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/targets/cufts/js/cufts_results.js b/targets/cufts/js/cufts_results.js index 50c2b05..2af8772 100644 --- a/targets/cufts/js/cufts_results.js +++ b/targets/cufts/js/cufts_results.js @@ -11,45 +11,51 @@ Drupal.behaviors.roblib_search_cufts = { item_str += '
'; item_str += '' + val.title + ''; item_str += '
'; - - item_str += '
'; - var issns=val.issns.toString(); - if(issns.length==8) - { - newIssns = issns.substr(0,4)+'-'+issns.substr(4,4); - } - else - { - newIssns = issns; - } - - item_str += newIssns; + + item_str += '
ISSN: '; + jQuery.each(val.issns, function(key2, val2) { + var newIssn = ""; + var issn = val2.toString(); + if (issn.length == 8) + { + newIssn = issn.substr(0, 4) + '-' + issn.substr(4, 4); + } + else + { + newIssn = issn; + } + item_str += newIssn + ','; + }); item_str += '
'; - + item_str += '
'; - item_str += val.fulltext_coverages; + + jQuery.each(val.fulltext_coverages, function(key3, val3) { + item_str += val3; + }); + item_str += '
'; - + item_str += '
'; items.push(item_str); - - + + }); } var originURL = settings.roblib_search_cufts.url; var originSuffix = settings.roblib_search_cufts.suffix; var newSuffix = originSuffix.replace("&format=json", ""); - if(parseInt(data.numOfResults)>0) + if (parseInt(data.numOfResults) > 0) { jQuery('#' + 'roblib-search-content-cufts').empty().append(items.join('')); - jQuery('#' + 'roblib-search-cufts-more').empty().append('see all '+data.numOfResults+' results'); + jQuery('#' + 'roblib-search-cufts-more').empty().append('see all ' + data.numOfResults + ' results'); } else - { + { jQuery('#' + 'roblib-search-content-cufts').empty().append('

no result

'); jQuery('#' + 'roblib-search-cufts-more').empty(); - } - }); + } + }); } }