Library | Location & Format | Range of holdings and/or Access URL |
---|
');//
//if URL is present in any MHLD record, hide "ELECTRONIC_ACCESS" class within id "results_bio"+detail if(hasurl > 0) { jQuery('#results_bio'+hitNum+' .ELECTRONIC_ACCESS').remove(); } }}//});}function modifyNewSearchIndex (rId) {var resultsId = rId.split("detail")[1];jQuery('#detail_biblio'+resultsId).find('.displayElementText.SUBJECT_TERM a, .displayElementText.SUBJECTS a').each(function(){ var searchString = '&rt=false|||SUBJECT|||Subject'; var myHREF = jQuery(this).attr('href'); var newHREF = myHREF + searchString; jQuery(this).attr('href', newHREF);});jQuery('#detail_biblio'+resultsId).find('.displayElementText.GEOGRAPHIC_TERM a').each(function(){ var searchString = '&rt=false|||SUBJECT|||Subject'; var myHREF = jQuery(this).attr('href'); var newHREF = myHREF + searchString; jQuery(this).attr('href', newHREF);});jQuery('#detail_biblio'+resultsId).find('.displayElementText.PERSONAL_SUBJECT a').each(function(){ var searchString = '&rt=false|||SUBJECT|||Subject'; var myHREF = jQuery(this).attr('href'); var newHREF = myHREF + searchString; jQuery(this).attr('href', newHREF);});jQuery('#detail_biblio'+resultsId).find('.displayElementText.CORPORATE_SUBJECT a').each(function(){ var searchString = '&rt=false|||SUBJECT|||Subject'; var myHREF = jQuery(this).attr('href'); var newHREF = myHREF + searchString; jQuery(this).attr('href', newHREF);});jQuery('#detail_biblio'+resultsId).find('.displayElementText.CONFERENCE_SUBJECT a').each(function(){ var searchString = '&rt=false|||SUBJECT|||Subject'; var myHREF = jQuery(this).attr('href'); var newHREF = myHREF + searchString; jQuery(this).attr('href', newHREF);});jQuery('#detail_biblio'+resultsId).find('.displayElementText.TITLE_SUBJECT a').each(function(){ var searchString = '&rt=false|||SUBJECT|||Subject'; var myHREF = jQuery(this).attr('href'); var newHREF = myHREF + searchString; jQuery(this).attr('href', newHREF);});jQuery('#detail_biblio'+resultsId).find('.displayElementText.GENRE_TERM a').each(function(){ var searchString = '&rt=false|||GENRE_TERM|||Genre'; var myHREF = jQuery(this).attr('href'); var newHREF = myHREF + searchString; jQuery(this).attr('href', newHREF);});jQuery('#detail_biblio'+resultsId).find('.displayElementText.PERSONAL_AUTHOR a').each(function(){ var searchString = '&rt=false|||AUTHOR|||Author'; var myHREF = jQuery(this).attr('href'); myHREF= myHREF.split('&'); var newHREF = myHREF[0].split(/%2C\+(?=[^%2C\+]*$)/); newHREF = newHREF[0]+'&'+myHREF[1]+searchString; jQuery(this).attr('href', newHREF);});jQuery('#detail_biblio'+resultsId).find('.displayElementText.CORPORATE_AUTHOR a').each(function(){ var searchString = '&rt=false|||AUTHOR|||Author'; var myHREF = jQuery(this).attr('href'); myHREF= myHREF.split('&'); var newHREF = myHREF[0].split(/%2C\+(?=[^%2C\+]*$)/); newHREF = newHREF[0]+'&'+myHREF[1]+searchString; jQuery(this).attr('href', newHREF);});jQuery('#detail_biblio'+resultsId).find('.displayElementText.CONFERENCE_AUTHOR a').each(function(){ var searchString = '&rt=false|||AUTHOR|||Author'; var myHREF = jQuery(this).attr('href'); myHREF= myHREF.split('&'); var newHREF = myHREF[0].split(/%2C\+(?=[^%2C\+]*$)/); newHREF = newHREF[0]+'&'+myHREF[1]+searchString; jQuery(this).attr('href', newHREF);});jQuery('#detail_biblio'+resultsId).find('.displayElementText.ADDED_AUTHOR a').each(function(){ var searchString = '&rt=false|||AUTHOR|||Author'; var myHREF = jQuery(this).attr('href'); myHREF= myHREF.split('&'); var newHREF = myHREF[0].split(/%2C\+(?=[^%2C\+]*$)/); newHREF = newHREF[0]+'&'+myHREF[1]+searchString; jQuery(this).attr('href', newHREF);});jQuery('#detail_biblio'+resultsId).find('.displayElementText.ADDED_CONFERENCE_AUTHOR a').each(function(){ var searchString = '&rt=false|||AUTHOR|||Author'; var myHREF = jQuery(this).attr('href'); myHREF= myHREF.split('&'); var newHREF = myHREF[0].split(/%2C\+(?=[^%2C\+]*$)/); newHREF = newHREF[0]+'&'+myHREF[1]+searchString; jQuery(this).attr('href', newHREF);});jQuery('#detail_biblio'+resultsId).find('.displayElementText.ADDED_CORPORATE_AUTHOR a').each(function(){ var searchString = '&rt=false|||AUTHOR|||Author'; var myHREF = jQuery(this).attr('href'); myHREF= myHREF.split('&'); var newHREF = myHREF[0].split(/%2C\+(?=[^%2C\+]*$)/); newHREF = newHREF[0]+'&'+myHREF[1]+searchString; jQuery(this).attr('href', newHREF);});jQuery('#detail_biblio'+resultsId).find('.displayElementText.SERIES a').each(function(){ var searchString = '&rt=false|||SERIES|||Series'; var myHREF = jQuery(this).attr('href').split("+%3B")[0]; var myHREFArray = myHREF.split('qu='); var mySearchTerm = myHREFArray[1]; var mySearchVariable = myHREFArray[0]; var newHREF = mySearchVariable + 'qu="' + mySearchTerm + '"' + searchString; jQuery(this).attr('href', newHREF);});} // End function// Important: Modifications to this file may be overwritten during an upgrade.// If you want to customize this widget and have those modifications persist through upgrades,// make a copy of this widget and make modifications to the copied widget.// You can then assign the copied widget to the detail or search result displays you want.if('undefined' === typeof eRC_Availability) { eRC_Availability = { addAvailabilityToResult:function(resultId) { var idDiv = document.getElementById(resultId+'_ERC_ID'); if(!idDiv || !idDiv.innerHTML) { return; } eRC_Availability.makeIfNeeded(resultId); if(eRC_Base) { eRC_Base.getTitleData(function(data){ eRC_Availability.fill(resultId, data); }, resultId); } else { eRC_Availability.fill(resultId); } }, fill:function(resultId, data) { var aDiv = document.getElementById('availableNumber_'+resultId); if(aDiv) { var avail = 'Indisponível'; if (data && data.status && 'OK' === data.status && data.formats && data.formats.length > 0) { if (data.availability && data.availability.available) { if (data.availability.availableCopies) { // show copies available avail = data.availability.availableCopies; } else { // unlimited duration avail = 'Ilimitado'; } } else { // no copies available avail = 0; } } aDiv.innerHTML = avail; $J(aDiv).removeAttr('name'); } }, makeIfNeeded:function(resultId) { if(document.getElementById('availableNumber_'+resultId)) { return; } var matches = resultId.match(/^(detail|hitlist)(\d+)$/); if(matches) { if (com_sirsi_ent_page.isMobile) { var label = document.createElement('span'); label.setAttribute('class','availableLabel ercAvailableCountLabel text-h5'); if ($J('*[class^="detail_"]').length) { label.innerHTML = 'Disponível:'; } else { label.innerHTML = 'Disponível'; } number = document.createElement('span'); number.setAttribute('id','availableNumber_'+resultId); number.setAttribute('class','availableNumber ercAvailableCountNumber text-p'); number.setAttribute('name','smallSearchingGif'); number.setAttribute('style','display:inline-block;'); var div = document.createElement('div'); div.setAttribute('id','ercAvailableDiv_'+resultId); div.setAttribute('class','availableDiv ercAvailableCountSection'); div.appendChild(label); div.appendChild(number); if('detail' === matches[1]) { $J('.detailFieldsAlign').append(div); } else { document.getElementById('results_bio' + matches[2]).appendChild(div); } } else { var label = document.createElement('span'); label.setAttribute('class','availableLabel ercAvailableCountLabel '); label.innerHTML = 'Disponível:'; number = document.createElement('span'); number.setAttribute('id','availableNumber_'+resultId); number.setAttribute('class','availableNumber ercAvailableCountNumber'); number.setAttribute('name','smallSearchingGif'); number.setAttribute('style','display:inline-block;'); var div = document.createElement('div'); div.setAttribute('id','ercAvailableDiv_'+resultId); div.setAttribute('class','availableDiv ercAvailableCountSection'); div.appendChild(label); div.appendChild(number); var idStr = ('detail' === matches[1] ? 'detail_biblio' : 'results_bio') + matches[2]; document.getElementById(idStr).appendChild(div); } createSpinnersForSelector($J('#availableNumber_' + resultId), smallSpinnerOptions); } }, }}/***This uses the ROA Web Services 'GUEST' role to query bib data without a token. Your Web Services must be version 2015.08 or higher. See variables within the getBib function below you should set. Also, some CSS should be added to clean up the look. At a minimum, something like this should be in your theme or custom CSS file:.marc_tag_header, .marc_tag_data{color:#0A1084;min-width:35px;}.marc_ind_header, .marc_ind_data{color:#6D2315;min-width:35px;}.marc_subfield_code{color:#47156D;padding:3px;}****/function getBib(rId){/*Fill in the wsBaseUrl variable with your own Web Services URL (which you can copy from the Enterprise Admin console at Manage General Configuration -> Manage Web Services. It should end with a slash (for example: "http://blah.sirsi.net/blah_ilsws/"); you must be using the ROA Web Services, version 2015.08 or higher*/var wsBaseUrl='https://sails.sirsi.net/sails_ilsws/';/*Fill in a valid clientId, which can be found in your Web Services admin tool. DS_CLIENT is a default that works on most systems. I*/var clientId="DS_CLIENT";/***the origApp can be any single word you want. It's just used as another ROA Web Services logging marker***/var origApp='showmarc';/***defining a subfield delimiter character (using a decimal ascii value)***/var subfieldDelimiter= '';/***defining fixed field tags (to determine when to not use subfield delimiter)***/var fixedFieldTags=['000','001','003','005','006','007','008'];/***In the tagExclusions array, comma separate any tags you don't want to display***/var tagExclusions=['991','999']; if (typeof jQuery.ui == 'undefined') { reload_jqueryui(rId); return false; }var htmlOutput='
Tag | Ind. | Subfields | ';var catKey=jQuery('#'+rId+'_DOC_ID').text().split(':')[1];var marcUrl=wsBaseUrl+'/catalog/bib/key/'+catKey+'?includeFields=*';jQuery.ajax({ type: 'GET', url: marcUrl, dataType: 'json', headers: { "Accept": "application/json","Content-Type":"application/json","SD-Preferred-Role":"GUEST", "x-sirs-clientID":clientId,"sd-originating-app-id":origApp},success: function(marcdata) { bibTag=marcdata.fields.bib.fields;var marcOutput='
---|---|---|
'+curTag+' | ';htmlOutput+=''+curInd+' | ';jQuery.each(bibTag[tagIndex].subfields,function(subfieldIndex){ if(jQuery.inArray(curTag,fixedFieldTags)==-1){var subfieldCode=this.code+subfieldDelimiter;}else{var subfieldCode='';}var subfieldData=this.data;htmlOutput+=''+subfieldCode+''+subfieldData+'';});//end each subfield});//end each taghtmlOutput+=' |
';/***begin jqueryui dialog***/ $J(function() {$J(htmlOutput).dialog({width:500,maxHeight:700,hide: { effect: "scale", duration: 750 },title:'MARC for record # '+catKey,modal:true,buttons:{Ok: function(){$J(this).dialog("close");}}});});/***end jQueryUI dialog****/},error: function (xhr, ajaxOptions, thrownError) { console.log('Error occurred of status ' + xhr.status + ', message is ' + thrownError); }});//end ajax()}//end getbibfunction reload_jqueryui(rId){jQuery.getScript( "/client/js/ui/jquery.ui.core.js", function( data, textStatus, jqxhr ) { getBib(rId);});}// On Inital Page Load// Text definitionsvar returnToSearchLinkText = "Return to Search Results";var multipleFormatsText = "Multiple Formats";var ercTitleCode = "TITLE"; //"INITIAL_TITLE_SRCH";var ercAuthorCode = "AUTHOR"; //"INITIAL_AUTHOR_SRCH";var wsBaseUrl = "https://sails.sirsi.net/sails_ilsws/";var clientId = "DS_CLIENT";var ilsType = "Symphony"; //"Horizon";var qualifiedErcUrls = false;var collapseFormats = true;var collapseLevel = 2;var hideFacets = false;var linksInSameTab = true; var linkTarget = '_blank'; if (linksInSameTab) { linkTarget = '_self'; }var displayAvailable = false;var displayPlaceHold = true;var multiFormatRecords = true;var formatLinks = false;var facetFormatField = "FORMAT";var frbrUseFields = ['edition', 'pubdate', 'vendor']; //format is always presentvar frbrExpressionFields = { "format": { "label": "Format", "code": "S_FORMAT-SF", "show": true, "ils": true, "erc": true }, "language": { "label": "Language", "code": "LANGUAGE", "show": false, "ils": true, "erc": true }, "edition": { "label": "Edition", "code": "EDITION", "show": true, "ils": true, "erc": true }, "pubdate": { "label": "Publication Date", "code": "PUBDATE_RANGE", "show": true, "ils": true, "erc": true }, "vendor": { "label": "Vendor", "code": "ERC_VENDOR", "show": true, "ils": false, "erc": true }, "isbn": { "label": "${ISBN}", "code": "ISBN", "show": false, "ils": true, "erc": false }};jQuery(document).ready(function() { var bodyHeight = jQuery('body').height(); var resultsHeight = jQuery('#searchResultsColumn').height(); jQuery.each(frbrExpressionFields, function(i, fld) { if (!fld.show) { jQuery('.displayElementWrapper .' + fld.code).hide(); } });});//*******************************************************************************************************************//if (!$J("#content.bentoContent").length > 0) { //only execute if Bento is not in play var searchPath = location.pathname; var currentSearch = (location.search); var searchTarget = frbrGetSearchParam('te'); var searchFacets = frbrGetSearchParam('qf'); var searchLimit = frbrGetSearchParam('lm'); var numClusters = 0; // console.log('Current Search '+ currentSearch); if (frbrGetSearchParam('FRBR') != '1') { var testSearch = frbrRemoveParameter(currentSearch, 'rw'); testSearch = frbrRemoveParameter(testSearch, 'dt'); testSearch = frbrRemoveParameter(testSearch, 'isd'); testSearch = frbrRemoveParameter(testSearch, 'te'); // console.log('Test Search '+ testSearch); //console.log(sessionStorage.lastSearch); //console.log(window.location.search.indexOf("rw=")); if (sessionStorage.lastSearch || window.location.search.indexOf("rw=") == -1) { if ((testSearch != sessionStorage.lastSearch) || (searchTarget != sessionStorage.searchTarget) || window.location.search.indexOf("rw=") == -1) { sessionStorage.removeItem("skipIds"); sessionStorage.removeItem("unclusterIds"); //console.log("New search clearing list"); } } sessionStorage.lastSearch = testSearch; sessionStorage.searchTarget = searchTarget; } else { //console.log ('FRBR linked titles search'); } var skipIdList = new Object(); if (sessionStorage.skipIds) { skipIdList = JSON.parse(sessionStorage.skipIds); } var unclusterIdList = new Object(); if (sessionStorage.unclusterIds) { unclusterIdList = JSON.parse(sessionStorage.unclusterIds); } //console.log( "saved list: " + sessionStorage.skipIds); if (currentSearch.indexOf("FRBR=1") == -1) { sessionStorage.mySearch = currentSearch; } else { if (sessionStorage.mySearch) { var returnToSearchURL = sessionStorage.mySearch; var returnToSearchLink = '' + returnToSearchLinkText + ''; var linkTabHTML = '
' + returnToSearchLink + '
'; setTimeout(function(){ if (hideFacets) { jQuery("#limitcolumn_title").hide(); jQuery("#limitcolumn_availability").hide(); setTimeout(function() { jQuery(".facet").hide(); }, 150); jQuery(".navigatorCheckBox").hide(); jQuery(".limitcolumn_button").hide(); } jQuery(".navigatorName a").each(function() { curHref = jQuery(this).attr('href'); curHref = curHref.replace(".limitcolumn.navigatorclick?", "?FRBR=1&"); jQuery(this).attr('href', curHref); }); //jQuery(".navigatorName a").contents().unwrap(); if (hideFacets) { jQuery("#facetFormFORMAT").parent().show(); jQuery("#facetFormFRBR_FORMAT").parent().show(); jQuery("#facetFormERC_FORMAT").parent().show(); } jQuery("#limitcolumn_title").before(linkTabHTML); }, 300); jQuery(document).ready(function() { setTimeout(function() { jQuery('#sortSelect option[value!=""][value]').each(function() { var sortCode = jQuery(this).attr('value'); jQuery(this).removeAttr('onchange'); //jQuery(this).attr('onclick', 'window.location="'+window.location.href+'&st='+sortCode+'"'); jQuery(this).click(function() { window.location = window.location.href + '&st=' + sortCode; }); }); jQuery(".nonmobile .pagination .resultsToolbar_paginationNumbers a, .nonmobile .pagination .navigationImage a").each(function() { var curHref = jQuery(this).attr('href'); var pageLink = curHref.match(/handlepagingviasearchsession\/[0-9]*/); pageLink = pageLink[0].replace("handlepagingviasearchsession/", ""); pageHit = pageLink * 12; curHref = curHref.replace(/search\/results.*\?/, "search/results?FRBR=1&"); if (curHref.search("rw=") > 0) { curHref = curHref.replace(/rw=[0-9]*/, "rw=" + pageHit); } else { curHref += "&rw=" + pageHit; } jQuery(this).attr('href', curHref); }); if (jQuery('.mobile').length > 0) { jQuery(".mobile .paginationSingles .pageLink").each(function() { var curHref = jQuery(this).attr('href'); var pageLink = curHref.match(/handlepagingviasearchsession\/[0-9]*/); pageLink = pageLink[0].replace("handlepagingviasearchsession/", ""); pageHit = (pageLink - 1) * 12; curHref = curHref.replace(/search\/results.*\?/, "search/results?FRBR=1&"); if (curHref.search("rw=") > 0) { curHref = curHref.replace(/rw=[0-9]*/, "rw=" + pageHit); } else { curHref += "&rw=" + pageHit; } jQuery(this).attr('href', curHref); }); jQuery(".mobile #paginationForm #paginationInput").keyup(function() { var pageOnclick = '' + jQuery(".mobile #paginationForm #paginationButton").attr('onclick'); var pageHit = jQuery('.mobile #paginationForm #paginationInput').val(); if (pageHit == 0) { pageHit = 1; } pageHit = (pageHit - 1) * 12; pageOnclick = pageOnclick.replace(/[&]rw=[0-9]*/g, ""); pageOnclick = pageOnclick.replace(/[&]t:ac=[0-9]*/g, ""); pageOnclick = pageOnclick.replace(/search\/results.*\?/, "search/results?FRBR=1&rw=" + pageHit + "&"); jQuery(".mobile #paginationForm #paginationButton").attr('onclick', pageOnclick); }); } }, 300); }); jQuery('#q').attr('value', ""); //setTimeout("jQuery('#sortSelect').hide()",500); if (frbrGetSearchParam('DISP') != "") { var dispDocId = unescape(frbrGetSearchParam('DISP')); var linkToClick = "a[onclick*='" + dispDocId + "'][id*=detailLink]"; if (linkToClick == "") { //nonmodal display linkToClick = "a[href*='" + dispDocId + "'][id*=detailLink]"; } //console.log("click link "+ linkToClick); setTimeout(function() { $J(linkToClick).click() }, 500); // $(document).ready(function(){jQuery(linkToClick).click()}); } } } jQuery(document).ready(function() { jQuery("div.resultsToolbar_num_results").append('
(Some may be grouped)
'); });} //end of section to only execute if Bento is not in play//*******************************************************************************************************************//function setupFormats() { var frbrFormats = { "Books": { "id": "frbr-book", "title": "Book", "code": "BOOK", "facetCode": " ", "ils": true, "erc": true }, "Audio disc": { "id": "frbr-audio-disc", "title": "Audio disc", "code": "SOUNDDISC", "facetCode": " ", "ils": true, "erc": true }, "Continuing Resources": { "id": "frbr-continuing-resources", "title": "Continuing Resources", "code": "CR", "facetCode": " ", "ils": true, "erc": true }, "Video cassette": { "id": "frbr-video-cassette", "title": "Video cassette", "code": "VIDEOCASS", "facetCode": " ", "ils": true, "erc": true }, "Microform": { "id": "frbr-microform", "title": "Microform", "code": "MICROFORM", "facetCode": " ", "ils": true, "erc": true }, "Audio cassette": { "id": "frbr-audio-cassette", "title": "Audio cassette", "code": "SOUNDCASS", "facetCode": " ", "ils": true, "erc": true }, "Video disc": { "id": "frbr-video-disc", "title": "Video disc", "code": "VIDEODISC", "facetCode": " ", "ils": true, "erc": true }, "Maps": { "id": "frbr-maps", "title": "Maps", "code": "MAP", "facetCode": " ", "ils": true, "erc": true }, "Visual Materials": { "id": "frbr-visual-materials", "title": "Visual Materials", "code": "VISUAL", "facetCode": " ", "ils": true, "erc": true }, "Computer file": { "id": "frbr-computer-file", "title": "Computer file", "code": "COMPFILE", "facetCode": " ", "ils": true, "erc": true }, "Sound recording": { "id": "frbr-sound-recording", "title": "Sound recording", "code": "SOUNDREC", "facetCode": " ", "ils": true, "erc": true }, "Music Sound Recording": { "id": "frbr-music-sound-recording", "title": "Music Sound Recording", "code": "MUSICSNDREC", "facetCode": " ", "ils": true, "erc": true },/*** BEGIN CUSTOM - replaced Music ***//* "Music": { "id": "frbr-music", "title": "Music", "code": "NOTATEDMUSIC", "facetCode": " ", "ils": true, "erc": true },*//*** END CUSTOM ***/ "Manuscript": { "id": "frbr-manuscript", "title": "Manuscript", "code": "MS", "facetCode": " ", "ils": true, "erc": true }, "Regular print": { "id": "frbr-regular-print", "title": "Regular Print", "code": "UNKNOWN", "facetCode": " ", "ils": true, "erc": true }, "Atlas": { "id": "frbr-atlas", "title": "Atlas", "code": "ATLAS", "facetCode": " ", "ils": true, "erc": true }, "Filmstrip": { "id": "frbr-filmstrip", "title": "Filmstrip", "code": "FILMSTRIP", "facetCode": " ", "ils": true, "erc": true }, "Section": { "id": "frbr-section", "title": "Section", "code": "SECTION", "facetCode": " ", "ils": true, "erc": true }, "Motion picture": { "id": "frbr-motion-picture", "title": "Motion picture", "code": "MOTIONPICT", "facetCode": " ", "ils": true, "erc": true }, "Kit": { "id": "frbr-kit", "title": "Kit", "code": "KIT", "facetCode": " ", "ils": true, "erc": true }, "Mixed materials": { "id": "frbr-mixed-materials", "title": "Mixed materials", "code": "MIXED", "facetCode": " ", "ils": true, "erc": true }, "Remote sensing image": { "id": "frbr-remote-sensing-image", "title": "Remote sensing image", "code": "REMOTESEN", "facetCode": " ", "ils": true, "erc": true }, "Picture": { "id": "frbr-picture", "title": "Picture", "code": "PICTURE", "facetCode": " ", "ils": true, "erc": true }, "3-D Object": { "id": "frbr-3d-object", "title": "3-D Object", "code": "OBJECT", "facetCode": " ", "ils": true, "erc": true }, "Video Cartridge": { "id": "frbr-video-cartridge", "title": "Video cartridge", "code": "VIDEOCART", "facetCode": " ", "ils": true, "erc": true }, "Large Print": { "id": "frbr-large-print", "title": "Large print", "code": "LARGEPRINT", "facetCode": " ", "ils": true, "erc": true }, "Non projected graphic": { "id": "frbr-non-projected-graphic", "title": "Non projected graphic", "code": "NONPROJGRAPH", "facetCode": " ", "ils": true, "erc": true }, "Video recording": { "id": "frbr-video-recording", "title": "Video recording", "code": "VIDEOREC", "facetCode": " ", "ils": true, "erc": true }, "Chart": { "id": "frbr-chart", "title": "Chart", "code": "CHART", "facetCode": " ", "ils": true, "erc": true }, "Diagram": { "id": "frbr-diagram", "title": "Diagram", "code": "DIAGRAM", "facetCode": " ", "ils": true, "erc": true }, "Slide": { "id": "frbr-slide", "title": "Slide", "code": "SLIDE", "facetCode": " ", "ils": true, "erc": true }, "Print": { "id": "frbr-print", "title": "Print", "code": "PRINT", "facetCode": " ", "ils": true, "erc": true }, "Tactile": { "id": "frbr-tactile", "title": "Tactile", "code": "TACTILE", "facetCode": " ", "ils": true, "erc": true }, "Drawing": { "id": "frbr-drawing", "title": "Drawing", "code": "DRAWING", "facetCode": " ", "ils": true, "erc": true }, "Flashcard": { "id": "frbr-flash-card", "title": "Flashcard", "code": "FLASHCARD", "facetCode": " ", "ils": true, "erc": true }, "Globe": { "id": "frbr-globe", "title": "Globe", "code": "GLOBE", "facetCode": " ", "ils": true, "erc": true }, "View": { "id": "frbr-view", "title": "View", "code": "VIEW", "facetCode": " ", "ils": true, "erc": true }, "Photo": { "id": "frbr-photo", "title": "Photo", "code": "PHOTO", "facetCode": " ", "ils": true, "erc": true }, "Projected graphic": { "id": "frbr-projected-graphic", "title": "Projected graphic", "code": "UNKNOWN", "facetCode": " ", "ils": true, "erc": true }, "Technical drawing": { "id": "frbr-technical-drawing", "title": "Technical drawing", "code": "TECHDRAWING", "facetCode": " ", "ils": true, "erc": true }, "eBook": { "id": "frbr-ebook", "title": "eBook", "code": "E_BOOK", "facetCode": " ", "ils": false, "erc": true }, "Online Resource": { "id": "frbr-online-resource", "title": "Online Resource", "code": "ER", "facetCode": " ", "ils": true, "erc": true }, "eAudiobook": { "id": "frbr-eaudiobook", "title": "eAudiobook", "code": "E_SOUNDREC", "facetCode": " ", "ils": false, "erc": true }, "eVideo": { "id": "frbr-evideo", "title": "eVideo", "code": "E_VIDEO", "facetCode": " ", "ils": false, "erc": true }, "Cassette": { "id": "frbr-cassette", "title": "Audio cassette", "code": "SOUNDCASS", "facetCode": " ", "ils": true, "erc": true }, "Other": { "id": "frbr-other", "title": "Other", "code": "UNKNOWN", "facetCode": " ", "ils": true, "erc": true }, "Libros": { "id": "frbr-book", "title": "Libros", "code": "BOOK", "facetCode": " ", "ils": true, "erc": true }, "Disco de audio": { "id": "frbr-audio-disc", "title": "Disco de audio", "code": "SOUNDDISC", "facetCode": " ", "ils": true, "erc": true }, "Recursos permanentes": { "id": "frbr-continuing-resources", "title": "Recursos permanentes", "code": "CR", "facetCode": " ", "ils": true, "erc": true }, "Videocasete": { "id": "frbr-video-cassette", "title": "Videocasete", "code": "VIDEOCASS", "facetCode": " ", "ils": true, "erc": true }, "Microforma": { "id": "frbr-microform", "title": "Microforma", "code": "MICROFORM", "facetCode": " ", "ils": true, "erc": true }, "Casete de audio": { "id": "frbr-audio-cassette", "title": "Casete de audio", "code": "SOUNDCASS", "facetCode": " ", "ils": true, "erc": true }, "Disco de video": { "id": "frbr-video-disc", "title": "Disco de video", "code": "VIDEODISC", "facetCode": " ", "ils": true, "erc": true }, "Mapas": { "id": "frbr-maps", "title": "Mapas", "code": "MAP", "facetCode": " ", "ils": true, "erc": true }, "Material visual": { "id": "frbr-visual-materials", "title": "Material visual", "code": "VISUAL", "facetCode": " ", "ils": true, "erc": true }, "Fichero informático": { "id": "frbr-computer-file", "title": "Archivo informático", "code": "COMPFILE", "facetCode": " ", "ils": true, "erc": true }, "Grabación sonora": { "id": "frbr-sound-recording", "title": "Grabación sonora", "code": "SOUNDREC", "facetCode": " ", "ils": true, "erc": true }, "Grabación sonora musical": { "id": "frbr-music-sound-recording", "title": "Grabación sonora musical", "code": "MUSICSNDREC", "facetCode": " ", "ils": true, "erc": true }, "Música": { "id": "frbr-music", "title": "Música", "code": "NOTATEDMUSIC", "facetCode": " ", "ils": true, "erc": true }, "Manuscrito": { "id": "frbr-manuscript", "title": "Manuscrito", "code": "MS", "facetCode": " ", "ils": true, "erc": true }, "Letra normal": { "id": "frbr-regular-print", "title": "Letra normal", "code": "UNKNOWN", "facetCode": " ", "ils": true, "erc": true }, "Atlas": { "id": "frbr-atlas", "title": "Atlas", "code": "ATLAS", "facetCode": " ", "ils": true, "erc": true }, "Tira de película": { "id": "frbr-filmstrip", "title": "Tira de película", "code": "FILMSTRIP", "facetCode": " ", "ils": true, "erc": true }, "Sección": { "id": "frbr-section", "title": "Sección", "code": "SECTION", "facetCode": " ", "ils": true, "erc": true }, "Película": { "id": "frbr-motion-picture", "title": "Película", "code": "MOTIONPICT", "facetCode": " ", "ils": true, "erc": true }, "Equipo": { "id": "frbr-kit", "title": "Equipo", "code": "KIT", "facetCode": " ", "ils": true, "erc": true }, "Materiales mixtos": { "id": "frbr-mixed-materials", "title": "Materiales mixtos", "code": "MIXED", "facetCode": " ", "ils": true, "erc": true }, "Imagen obtenida por teledetección": { "id": "frbr-remote-sensing-image", "title": "Imagen de teledetección", "code": "REMOTESEN", "facetCode": " ", "ils": true, "erc": true }, "Dibujo": { "id": "frbr-picture", "title": "Dibujo", "code": "PICTURE", "facetCode": " ", "ils": true, "erc": true }, "Objecto 3-D": { "id": "frbr-3d-object", "title": "Objecto 3-D", "code": "OBJECT", "facetCode": " ", "ils": true, "erc": true }, "Cartridge de video": { "id": "frbr-video-cartridge", "title": "Cartridge de video", "code": "VIDEOCART", "facetCode": " ", "ils": true, "erc": true }, "Letra grande": { "id": "frbr-large-print", "title": "Letra grande", "code": "LARGEPRINT", "facetCode": " ", "ils": true, "erc": true }, "Gráfico no proyectado": { "id": "frbr-non-projected-graphic", "title": "Gráfico no proyectado", "code": "NONPROJGRAPH", "facetCode": " ", "ils": true, "erc": true }, "Grabación de vídeo ": { "id": "frbr-video-recording", "title": "Video recording", "code": "VIDEOREC", "facetCode": " ", "ils": true, "erc": true }, "Gráfico": { "id": "frbr-chart", "title": "Gráfico", "code": "CHART", "facetCode": " ", "ils": true, "erc": true }, "Diagrama": { "id": "frbr-diagram", "title": "Diagrama", "code": "DIAGRAM", "facetCode": " ", "ils": true, "erc": true }, "Diapositiva": { "id": "frbr-slide", "title": "Diapositiva", "code": "SLIDE", "facetCode": " ", "ils": true, "erc": true }, "Impreso": { "id": "frbr-print", "title": "Impreso", "code": "PRINT", "facetCode": " ", "ils": true, "erc": true }, "Táctil": { "id": "frbr-tactile", "title": "Táctil", "code": "TACTILE", "facetCode": " ", "ils": true, "erc": true }, "Dibujo": { "id": "frbr-drawing", "title": "Dibujo", "code": "DRAWING", "facetCode": " ", "ils": true, "erc": true }, "Tarjetas didácticas": { "id": "frbr-flash-card", "title": "Tarjeta de memoria flash", "code": "FLASHCARD", "facetCode": " ", "ils": true, "erc": true }, "Globo terráqueo": { "id": "frbr-globe", "title": "Globo terráqueo", "code": "GLOBE", "facetCode": " ", "ils": true, "erc": true }, "Ver": { "id": "frbr-view", "title": "Ver", "code": "VIEW", "facetCode": " ", "ils": true, "erc": true }, "Fotografía": { "id": "frbr-photo", "title": "Photo", "code": "PHOTO", "facetCode": " ", "ils": true, "erc": true }, "Gráfico proyectado": { "id": "frbr-projected-graphic", "title": "Projected graphic", "code": "UNKNOWN", "facetCode": " ", "ils": true, "erc": true }, "Dibujo técnico": { "id": "frbr-technical-drawing", "title": "Dibujo técnico", "code": "TECHDRAWING", "facetCode": " ", "ils": true, "erc": true }, "Libro electrónico": { "id": "frbr-ebook", "title": "Libro electrónico", "code": "E_BOOK", "facetCode": " ", "ils": false, "erc": true }, "Recurso en línea": { "id": "frbr-online-resource", "title": "Recurso en línea", "code": "ER", "facetCode": " ", "ils": true, "erc": true }, "eAudiolibro": { "id": "frbr-eaudiobook", "title": "eAudiolibro", "code": "E_SOUNDREC", "facetCode": " ", "ils": false, "erc": true }, "eVideo": { "id": "frbr-evideo", "title": "eVideo", "code": "E_VIDEO", "facetCode": " ", "ils": false, "erc": true }, "Casete": { "id": "frbr-cassette", "title": "Casete", "code": "SOUNDCASS", "facetCode": " ", "ils": true, "erc": true }, "Otro": { "id": "frbr-other", "title": "Otro", "code": "UNKNOWN", "facetCode": " ", "ils": true, "erc": true },/*** BEGIN CUSTOM ***/ "Electronic Resource": { "id": "frbr-online-resource", "title": "Electronic Resource", "code": "ER", "facetCode": " ", "ils": true, "erc": true }, "Magazines": { "id": "frbr-continuing-resources", "title": "Magazines", "code": "CR", "facetCode": " ", "ils": true, "erc": true }, "Music": { "id": "frbr-music", "title": "Music", "code": "MUSIC", "facetCode": " ", "ils": true, "erc": true }, "Video cartridge": { "id": "frbr-video-cartridge", "title": "Video cartridge", "code": "VIDEOCART", "facetCode": " ", "ils": true, "erc": false }, "Large print": { "id": "frbr-large-print", "title": "Large print", "code": "LARGEPRINT", "facetCode": " ", "ils": true, "erc": true }, "Notated music": { "id": "frbr-music", "title": "Notated music", "code": "NOTATEDMUSIC", "facetCode": " ", "ils": true, "erc": true }, "Transparency": { "id": "frbr-transparency", "title": "Transparency", "code": "TRANSPARENCY", "facetCode": " ", "ils": true, "erc": false }/*** END CUSTOM ***/ } //console.log('frbrFormatBOOK:'+frbrFormats['Books']['code']); //console.log('frbrFormatE_BOOK:'+frbrFormats['eBook']['code']); //console.log('frbrFormatBOOK:'+frbrFormats['BOOK']['code']); return frbrFormats;}//*******************************************************************************************************************//function removeGmd(titleData) { //console.log("tD:"+titleData); titleData = titleData.replace(/ *\[sound recording *(\([A-Za-z0-9_-]*\))* *\]/i, ""); titleData = titleData.replace(/ *\[videorecording *(\([A-Za-z0-9_-]*\))* *\]/i, ""); titleData = titleData.replace(/ *\[text .large print.\]/i, ""); titleData = titleData.replace(/ *\[microform\]/i, ""); titleData = titleData.replace(/ *\[computer file\]/i, ""); titleData = titleData.replace(/ *\[electronic resource\]/i, ""); titleData = titleData.replace(/ *\[filmstrip\]/i, ""); titleData = titleData.replace(/ *\[braille\]/i, ""); titleData = titleData.replace(/ *\[kit\]/i, ""); titleData = titleData.replace(/ *\[motion picture\]/i, ""); titleData = titleData.replace(/ *\[slide\]/i, ""); titleData = titleData.replace(/ *\[transparency\]/i, ""); titleData = titleData.replace(/ *\[realia\]/i, ""); titleData = titleData.replace(/ *\[grabación sonora *(\([A-Za-z0-9_-]*\))* *\]/i, ""); titleData = titleData.replace(/ *\[grabación de video *(\([A-Za-z0-9_-]*\))* *\]/i, ""); titleData = titleData.replace(/ *\[texto .en tipografía mayor.\]/i, ""); titleData = titleData.replace(/ *\[microforma\]/i, ""); titleData = titleData.replace(/ *\[archivo computacional\]/i, ""); titleData = titleData.replace(/ *\[recurso electrónico\]/i, ""); titleData = titleData.replace(/ *\[tira de película\]/i, ""); //titleData = titleData.replace(/ *\[braille\]/i, ""); titleData = titleData.replace(/ *\[conjunto\]/i, ""); titleData = titleData.replace(/ *\[película\]/i, ""); titleData = titleData.replace(/ *\[diapositiva\]/i, ""); titleData = titleData.replace(/ *\[transparencia\]/i, ""); //titleData = titleData.replace(/ *\[realia\]/i, ""); //console.log("nT:"+titleData); return titleData;}//*******************************************************************************************************************//function removeSubtitle(titleData) { titleData = titleData.replace(/: a novel *.*/i,""); return titleData}//*******************************************************************************************************************//// On Each Hit Loadedfunction frbrSearch(rId) { frbrFormats = setupFormats(); if (currentSearch.indexOf("FRBR=1") == -1) { var myProfile = com_sirsi_ent_page.friendlyUrl; //'frbr'; var myLocale = com_sirsi_ent_page.localeCode; if (jQuery('.frbrNote').length == 0) { // jQuery("div.resultsToolbar_num_results").append('
(Some may be grouped)
'); } var hitSelector = '#' + rId.replace(/hitlist/, "results_bio"); //console.log('hitSelector: '+hitSelector); $J('.hitNumber').hide(); isErcHit = 0; var hitDocId = $J('#' + rId + '_DOC_ID').text(); if (hitDocId == "") { isErcHit = 1; hitDocId = $J('#' + rId + '_ERC_ID').text(); hitFullId = $J(hitSelector + ' .displayDetailLink > a').attr('onclick'); //console.log('hitFullId: ' +hitFullId); if (hitFullId == null) { hitFullId = $J(hitSelector + ' .displayDetailLink > a').attr('href'); hitFullId = hitFullId.replace(/^.*detailnonmodal./, ""); hitFullId = hitFullId.replace(/\/.*$/, ""); hitFullId = hitFullId.replace(/\$002f/g, "/"); } else { hitFullId = hitFullId.toString(); hitFullId = hitFullId.match(/ent:.*\?/); hitFullId = String(hitFullId); hitFullId = hitFullId.replace(/\/.*$/, ""); // hitFullId = hitFullId.replace("\/[0-9]+\/[0-9]+\/[0-9]+\\?", ""); hitFullId = hitFullId.replace(/\$002f/g, "/"); } //console.log('hitFullId ' + hitFullId); hitDocId = hitFullId; } var isIlsh*t = 0; if (hitDocId.indexOf("SD_ILS") > -1) { isIlsh*t = 1; } //console.log('Checking Hit ' + rId + ' Doc ID ' +hitDocId); if (skipIdList[hitDocId]) { $J(hitSelector).parent().parent().hide(); //console.log(' Hit found in save list so not displayed'); } else { //console.log(' Hit not found in save list now searching for multiple titles'); var baseRssURL = "/client/rss/hitlist/" + myProfile + "/"; var baseSearchURL = "/client/" + myProfile + "/search/results?"; var curTitle = $J('#' + rId + '_FRBR_AUTHORIZED_TITLE').text(); var curMainTitle = $J('#' + rId + '_FRBR_TITLE').text(); if ((curTitle.match(/^Selections$/) != null) || (curTitle.match(/^Selections\./) != null) || (curTitle.indexOf(". Selections") > -1)) { curTitle = ""; } // if the authorized title does not contain Vol., Volume, or Part, but the main title does, then do not use the authorized title for searching else if ((curTitle.match(/\. Vol\. [0-9]/) == null) && (curTitle.match(/\. Volume [0-9]/) == null) && (curTitle.match(/\. Part [0-9]/) == null)) { if ((curMainTitle.match(/\. Vol\. [0-9]/) != null) || (curMainTitle.match(/\. Volume [0-9]/) != null) || (curMainTitle.match(/\. Part [0-9]/) != null)) { curTitle = ""; } } var curAuthor = $J('#' + rId + '_FRBR_AUTHOR').text(); var authorizedTitle = 1; if (curTitle == "") { // will have issues if no author & uniform title is made up of common words curTitle = $J('#' + rId + '_FRBR_TITLE').text(); if (curTitle == "") { // will have issues if no author & uniform title is made up of common words curTitle = $J('#' + rId + '_' + ercTitleCode).text(); curMainTitle = $J('#' + rId + '_' + ercTitleCode).text(); } authorizedTitle = 0; } if (curAuthor == "" && isIlsh*t == 0) { curAuthor = $J('#' + rId + '_' + ercAuthorCode).text(); } //console.log("authTitle: " + authorizedTitle); //console.log(rId + " Author:|" + curAuthor + "|"); //console.log(rId + " Title:|" +curTitle + "|"); // require both Title and Author to attempt collapse; allow Title only if it is a Uniform Title curTitle = curTitle.replace(/ : *$/,''); if (((curTitle != "") && (curAuthor != "")) || ((authorizedTitle == 1) && (curTitle != ""))) { //curTitle.replace(/;/g,""); curTitle = removeGmd(curTitle); var frbrSearchString = 'qu=TITLE:\"' + curTitle.replace(/ /g, '+') + '\"'; var rssSearchString = 'qu=TITLE:\"' + curTitle.replace(/ /g, '+').replace(/[?&;¿¡]/g, '') + '\"'; if (curAuthor != "") { frbrSearchString += '&qu=AUTHOR:\"' + curAuthor.replace(/ /g, '+') + '\"'; rssSearchString += '&qu=AUTHOR:\"' + curAuthor.replace(/ /g, '+').replace(/[?&;¿¡]/g, '') + '\"'; } // console.log('frbr search string ' + frbrSearchString); // console.log('rss search string ' + rssSearchString); var frbrRssSearchURL = baseRssURL + rssSearchString; var frbrHitSearchURL = baseSearchURL + frbrSearchString + '&FRBR=1'; if (searchFacets !== '') { frbrRssSearchURL += '&qf=' + searchFacets; frbrHitSearchURL += '&qf=' + searchFacets; } if (searchLimit !== '') { frbrRssSearchURL += '&lm=' + searchLimit; frbrHitSearchURL += '&lm=' + searchLimit; } if (searchTarget !== '') { frbrRssSearchURL += '&te=' + searchTarget; frbrHitSearchURL += '&te=' + searchTarget; } frbrRssSearchURL += '&ln=' + myLocale; //console.log('rss search string ' + frbrRssSearchURL); var numTitles = 0; $J.ajax({ type: 'GET', url: frbrRssSearchURL, dataType: 'xml', async: false, success: function(data) { var entries = $J(data).find('entry'); numTitles = $J(entries).length; if (numTitles > 1) { //console.log(' Search found '+ numTitles +' titles'); var expressions = []; //console.log("authTitle: "+authorizedTitle); if (authorizedTitle == 0) { //console.log("curTitle:"+curTitle); //console.log("curMainTitle:"+curMainTitle); var seriesPattern = new RegExp("^" + curMainTitle.toUpperCase() + " AND |^" + curMainTitle.toUpperCase() + "\.{0,1} VOLUME |^" + curMainTitle.toUpperCase() + "\.{0,1} VOL\. |^" + curMainTitle.toUpperCase() + "\.{0,1} PART |^" + curMainTitle.toUpperCase() + "\.{0,1} [0-9]{1,} |^" + curMainTitle.toUpperCase() + " Y |" + curMainTitle.toUpperCase() + "\. [A-Z ]{3,} "); //console.log("seriesPattern:"+seriesPattern); var frbrEntries = $J.map($J(entries), function(frbrEntry) { var frbrHitTitle = $J(frbrEntry).find('title').text().replace("Title ", ""); frbrHitTitle = removeGmd(frbrHitTitle); frbrHitTitle = removeSubtitle(frbrHitTitle);/*** BEGIN CUSTOM ***/ frbrHitTitle = frbrHitTitle.replace(/ \/ .*$/, '');/*** END CUSTOM ***/ //console.log("authTitle=0: "+frbrHitTitle.toUpperCase()+"|curTitle:"+curTitle.toUpperCase()); //console.log($J(frbrEntry).find('id').text().replace(/ent:\/\/.*\//,"")); //console.log("frbrHitTitle:"+frbrHitTitle); if ($J(frbrEntry).find('id').text().indexOf(hitDocId) !== -1) { //don't eliminate the title we started from! return frbrEntry; } else if (frbrHitTitle.toUpperCase().indexOf(curTitle.toUpperCase()) > 5 || (authorizedTitle == 0 && frbrHitTitle.toUpperCase().indexOf(curTitle.toUpperCase()) < 0)) { console.log("ctitle found in ftitle at(1): "+frbrHitTitle.toUpperCase().indexOf(curTitle.toUpperCase())); unclusterIdList[$J(frbrEntry).find('id').text().replace(/ent:\/\/.*\//, "")] = true; //removedIds.push($J(frbrEntry).find('id').text().replace(/ent:\/\/.*\//,"") ); //$J(this).remove(); numTitles--; return null; } else if (seriesPattern.test(frbrHitTitle.toUpperCase())) { console.log("volume pattern match:"+$J(frbrEntry).find('id').text().replace(/ent:\/\/.*\//,"") ); unclusterIdList[$J(frbrEntry).find('id').text().replace(/ent:\/\/.*\//, "")] = true; //removedIds.push($J(frbrEntry).find('id').text().replace(/ent:\/\/.*\//,"") ); //$J(this).remove(); numTitles--; return null; } else if (frbrHitTitle.length > curTitle.length + 6 || curTitle.length > frbrHitTitle.length + 6 ) { numTitles--; return null; } else { return frbrEntry; } //console.log(' Revised search total: '+ numTitles +' titles'); }); } // authorizedTitle = 0 else { //process hits from authorized title searches //console.log("curTitle:"+curTitle); //console.log("curMainTitle:"+curMainTitle); var seriesPattern = new RegExp("^" + curMainTitle.toUpperCase() + " AND |^" + curMainTitle.toUpperCase() + "\.{0,1} VOLUME |^" + curMainTitle.toUpperCase() + "\.{0,1} VOL\. |^" + curMainTitle.toUpperCase() + "\.{0,1} PART |^" + curMainTitle.toUpperCase() + "\.{0,1} [0-9]{1,} |^" + curMainTitle.toUpperCase() + "\.{0,1} I[IVX]{1,} |" + curMainTitle.toUpperCase() + " IN |" + curMainTitle.toUpperCase() + " Y |" + curMainTitle.toUpperCase() + "\. [A-Z ]{3,} "); //console.log("seriesPattern:"+seriesPattern); var frbrEntries = $J.map($J(entries), function(frbrEntry) { var frbrHitTitle = $J(frbrEntry).find('title').text().replace("Title ", ""); frbrHitTitle = removeGmd(frbrHitTitle); //console.log($J(frbrEntry).find('id').text().replace(/ent:\/\/.*\//,"")); //console.log("frbrHitTitle:"+frbrHitTitle); // Check if FRBR search hit is the same as the current main title followed by certain words that indicate a later volume in a series if (seriesPattern.test(frbrHitTitle.toUpperCase())) { console.log("volume pattern match(2):"+$J(frbrEntry).find('id').text().replace(/ent:\/\/.*\//,"") ); unclusterIdList[$J(frbrEntry).find('id').text().replace(/ent:\/\/.*\//, "")] = true; //removedIds.push($J(frbrEntry).find('id').text().replace(/ent:\/\/.*\//,"") ); //$J(this).remove(); numTitles--; return null; } else if ((frbrHitTitle.toUpperCase().indexOf(curTitle.toUpperCase()) < 5 && frbrHitTitle.toUpperCase().indexOf(curTitle.toUpperCase()) >= 0) && (frbrHitTitle.length > curTitle.length + 6 || curTitle.length > frbrHitTitle.length + 6 )) { console.log("ctitle found in ftitle at(2): "+frbrHitTitle.toUpperCase().indexOf(curTitle.toUpperCase())); numTitles--; return null; } else { return frbrEntry; } }); } console.log(' Final revised search total: '+ numTitles +' titles'); if (numTitles < 2) { return; } //console.log(removedIds); //console.log(frbrEntries); sessionStorage.unclusterIds = JSON.stringify(unclusterIdList); //console.log(JSON.stringify(unclusterIdList)); var divSelector = '#' + rId.replace(/hitlist/, "results_bio"); if ($J('body').hasClass('mobile')) { divSelector = '#' + rId.replace(/hitlist/, "results_cell"); } $J(divSelector).parent().children('.results_top_half').children('.results_chkbox').hide(); $J(divSelector).parent().children('.results_right').hide(); $J(divSelector).children('.thumb_hidden').hide(); $J(divSelector).parents('.cell_wrapper').addClass("frbrClusterDisplay"); //var multipleTag = '
' + multipleFormatsText + '
View all editions
'; //var multipleTag = '
- ${LIST_EDITIONS}
'; //var multipleTag = '
' + multipleFormatsText + '
'; var multipleTag = '
' + multipleFormatsText + '
'; $J(divSelector).append(multipleTag); var frbrThumbButton = ''; $J(divSelector).parents('.results_cell').append(frbrThumbButton); //console.log($J(divSelector).parents('.results_cell').attr('id')); divSelector = '#' + rId.replace(/hitlist/, "results_bio") + " .availableDiv"; //, "availableDiv"); $J(divSelector).hide(); $J(divSelector).next('br').hide(); divSelector = '#' + 'ercAvailableDiv_' + rId; setTimeout(function() { $J(divSelector).hide() }, 500); var divSelector2 = '#' + rId.replace(/hitlist/, "results_bio"); setTimeout(function() { $J(divSelector2).parent().parent().children('button[class^=availability-button]').hide() }, 5000); setTimeout(function() { $J(divSelector2).parent().parent().children('.availability-table-div').hide() }, 5000); //var imgLinkToClick = "a[onclick*='" + dispDocId + "'][id*=detailClick]"; var imgLinkSelector = '.' + rId.replace(/hitlist/, "detailClick"); $J(imgLinkSelector).attr('href', frbrHitSearchURL); $J(imgLinkSelector).attr('onclick', null); linkSelector = '#' + rId.replace(/hitlist/, "detailLink"); $J(linkSelector).attr('href', frbrHitSearchURL); $J(linkSelector).attr('onclick', null); var frbrTitle = removeGmd($J(linkSelector).text()); frbrTitle = frbrTitle.replace(/^\n/, ""); frbrTitle = frbrTitle.replace(/\n$/, ""); testFrbrTitle = frbrTitle.toUpperCase().replace(/^The |^An |^A /, ""); testFrbrTitle = testFrbrTitle.replace(/\.|,|:|=/g, ""); var frbrDialogTitle = frbrTitle; if (typeof $J('#' + rId + '_FRBR_AUTHORIZED_TITLE .FRBR_AUTHORIZED_TITLE_value') !== 'undefined') { testAuthTitle = $J('#' + rId + '_FRBR_AUTHORIZED_TITLE').text().toUpperCase(); if ((testFrbrTitle.toUpperCase().indexOf(testAuthTitle) < 0 && testAuthTitle.indexOf(testFrbrTitle.toUpperCase()) < 0)) { //If the authorized title has a qualifier, display it in parentheses after the current record's main title //Otherwise, display the authorized title followed by the current record's main title var qualPattern = new RegExp(/ [(][^)]*[)]$/); if (qualPattern.test($J('#' + rId + '_FRBR_AUTHORIZED_TITLE').text())) { frbrTitle = frbrTitle + ' (' + $J('#' + rId + '_FRBR_AUTHORIZED_TITLE').text() + ')'; frbrDialogTitle = frbrDialogTitle + ' (' + $J('#' + rId + '_FRBR_AUTHORIZED_TITLE').text() + ')'; } else { //Display the authorized title, then the "current" record's title frbrTitle = $J('#' + rId + '_FRBR_AUTHORIZED_TITLE').text() + ' (' + frbrTitle + ')'; frbrDialogTitle = $J('#' + rId + '_FRBR_AUTHORIZED_TITLE').text() + ' (' + frbrDialogTitle + ')'; } } } $J(linkSelector).html(frbrTitle); $J(frbrEntries).each(function() { var frbrHitTitle = $J(this).find('title').text().replace("Title ", ""); /*if (frbrHitTitle.toUpperCase().indexOf(curTitle.toUpperCase()) > 5 || (authorizedTitle == 0 && frbrHitTitle.toUpperCase().indexOf(curTitle.toUpperCase()) < 0)) { //console.log("ctitle found in ftitle at(2): "+frbrHitTitle.toUpperCase().indexOf(curTitle.toUpperCase())); $J(this).remove(); return; }*/ var el = $J(this); var frbrHitId = $J(el).find('id').text().replace(/ent:\/\/.*\//, ""); //if (removedIds[frbrHitId]) { //######## //if (unclusterIdList[frbrHitId]) { //console.log("is removed hit:"+frbrHitId); // next; //######## //} //######## isErcFrbrHit = 0; if ($J(el).find('id').text().indexOf("ERC") > -1) { isErcFrbrHit = 1; frbrFullId = $J(el).find('id').text(); //console.log('Hit id ' + frbrHitId); //console.log("frbrFullId " + frbrFullId); frbrHitId = frbrFullId; } var docInfo = frbrHitId.split(':'); var numAvail = 0; //console.log('docInfo0:'+docInfo[0]); if (displayAvailable) { var availableString = ""; if (docInfo[0] == "SD_ILS") { var titleID = docInfo[1]; //console.log('docInfo1:'+docInfo[1]); if (wsBaseUrl.substr(-1, 1) != "/") { wsBaseUrl += "/"; } if (ilsType == "Horizon") { var ilsURL = wsBaseUrl + 'rest/standard/lookupTitleInfo?clientID=' + clientId + '&includeItemInfo=true&json=true&titleKey=' + titleID + '&callback=?'; } else { var ilsURL = wsBaseUrl + 'rest/standard/lookupTitleInfo?clientID=' + clientId + '&includeAvailabilityInfo=true&json=true&titleID=' + titleID + '&callback=?'; } //console.log(ilsURL); $J.getJSON(ilsURL, function(data) { //console.log(data); if (ilsType == "Horizon") { if (data.titleInfo[0].available) { numAvail = data.titleInfo[0].available; } else { numAvail = 0; } } else { numAvail = data.TitleInfo[0].TitleAvailabilityInfo.totalCopiesAvailable; } availableString = '' + numAvail + ''; //console.log('availableString:'+availableString) jQuery('.frbrAvail_' + titleID).text(availableString); jQuery('#frbrAvailLabel_' + titleID).show(); //add total to count on format line var formatLabel = jQuery('#'+rId+'_frbrLinks .frbrAvail_' + titleID).closest('.frbr-expressions').find('.frbr-menu-labels');/*console.log("expression summary");console.log(formatLabel);var tmpcnt;tempcnt = formatLabel.find('.frbr-number-of-items').text();console.log("|"+tempcnt+"|");console.log("|"+numAvail+"|");console.log(formatLabel.html());*/ if (formatLabel.find('.frbr-number-of-items').length > 0) { formatLabel.find('.frbr-number-of-items').text(parseInt(formatLabel.find('.frbr-number-of-items').text()) + numAvail) } else { if (displayAvailable) { formatLabel.html(formatLabel.html() + ' (' + availableString + ' Currently Available)'); } }//console.log(formatLabel.html()); if (displayAvailable) { //(collapseFormats && displayAvailable) //add total to count on collapsed summary line var frbrSummaryLabel = jQuery('#'+rId+'_frbrLinks .frbrAvail_' + titleID).closest('.results_cell').find('.frbr-sum-of-available'); if (frbrSummaryLabel.html() == "") { frbrSummaryLabel.html(' (0 Currently Available)'); } frbrSummaryLabel.find('.frbr-number-of-items').text(parseInt(frbrSummaryLabel.find('.frbr-number-of-items').text()) + numAvail); } }); } else { /* Query eRC availability */ titleID = frbrHitId.replace(/^ent:\/\/[^\/]+\/[^\/]+\/[^\/:]+:/,""); var numAvail = ""; if (qualifiedErcUrls == true) { var titlesUrl = addPathParams(com_sirsi_ent_widgets.URLS.eRC.titleInfoUrl, encodeAsTapestry(frbrHitId)); //console.log(titlesUrl); jQuery.getJSON(titlesUrl, function(response) { var data = response.eResourceList[0]; if (data && data.status && 'OK' === data.status && data.formats && data.formats.length > 0) { if (data.availability && data.availability.available) { if (data.availability.availableCopies) { // show copies available numAvail = data.availability.availableCopies; } else { // unlimited duration numAvail = 'Unlimited'; } } else { // no copies available numAvail = 0; } } availableString = '' + numAvail + ''; //jQuery('.frbrAvail_'+frbrHitId).text(availableString); jQuery('.frbrAvail_' + titleID.replace(/:/g,"_")).text(availableString); jQuery('#frbrAvailLabel_' + titleID.replace(/:/g,"_")).show(); //add total to count on format line var formatLabel = jQuery('#'+rId+'_frbrLinks .frbrAvail_' + titleID.replace(/:/g,"_")).closest('.frbr-expressions').find('.frbr-menu-labels'); if (formatLabel.find('.frbr-number-of-items').length > 0) { formatLabel.find('.frbr-number-of-items').text(parseInt(formatLabel.find('.frbr-number-of-items').text()) + numAvail) } else { if (displayAvailable) { formatLabel.html(formatLabel.html() + ' (' + availableString + ' Currently Available)'); } } if (displayAvailable) { //(collapseFormats && displayAvailable) //add total to count on collapsed summary line var frbrSummaryLabel = jQuery('#'+rId+'_frbrLinks .frbrAvail_' + titleID.replace(/:/g,"_")).closest('.results_cell').find('.frbr-sum-of-available'); if (frbrSummaryLabel.html() == "") { frbrSummaryLabel.html(' (0 Currently Available)'); } if (numAvail == 'Unlimited') { frbrSummaryLabel.find('.frbr-number-of-items').text(parseInt(frbrSummaryLabel.find('.frbr-number-of-items').text()) + 1); } else { frbrSummaryLabel.find('.frbr-number-of-items').text(parseInt(frbrSummaryLabel.find('.frbr-number-of-items').text()) + numAvail); } } }); } else { titleID = frbrHitId.replace(/^ent:\/\/[^\/]+\/[^\/]+\/[^\/:]+:/,"") //titleID = frbrHitId.replace(/^ent:\/\/[^\/]+\/[^\/]+\//,"") var titlesUrl = addPathParams(com_sirsi_ent_widgets.URLS.eRC.titleInfoUrl, encodeAsTapestry(titleID)); //console.log(titlesUrl); jQuery.getJSON(titlesUrl, function(response) { var data = response.eResourceList[0]; if (data && data.status && 'OK' === data.status && data.formats && data.formats.length > 0) { if (data.availability && data.availability.available) { if (data.availability.availableCopies) { // show copies available numAvail = data.availability.availableCopies; } else { // unlimited duration numAvail = 'Unlimited'; } } else { // no copies available numAvail = 0; } } availableString = '' + numAvail + ''; //jQuery('.frbrAvail_'+frbrHitId).text(availableString); jQuery('.frbrAvail_' + titleID.replace(/:/g,"_")).text(availableString); jQuery('#frbrAvailLabel_' + titleID.replace(/:/g,"_")).show(); //add total to count on format line var formatLabel = jQuery('#'+rId+'_frbrLinks .frbrAvail_' + titleID.replace(/:/g,"_")).closest('.frbr-expressions').find('.frbr-menu-labels'); if (formatLabel.find('.frbr-number-of-items').length > 0) { if (numAvail == 'Unlimited') { formatLabel.find('.frbr-number-of-items').text(parseInt(formatLabel.find('.frbr-number-of-items').text()) + 1) } else { formatLabel.find('.frbr-number-of-items').text(parseInt(formatLabel.find('.frbr-number-of-items').text()) + numAvail) } } else { if (displayAvailable) { formatLabel.html(formatLabel.html() + ' (' + availableString + ' Currently Available)'); } } if (displayAvailable) { //(collapseFormats && displayAvailable) //add total to count on collapsed summary line var frbrSummaryLabel = jQuery('#'+rId+'_frbrLinks .frbrAvail_' + titleID.replace(/:/g,"_")).closest('.results_cell').find('.frbr-sum-of-available'); if (frbrSummaryLabel.html() == "") { frbrSummaryLabel.html(' (0 Currently Available)'); } if (numAvail == 'Unlimited') { frbrSummaryLabel.find('.frbr-number-of-items').text(parseInt(frbrSummaryLabel.find('.frbr-number-of-items').text()) + 1); } else { frbrSummaryLabel.find('.frbr-number-of-items').text(parseInt(frbrSummaryLabel.find('.frbr-number-of-items').text()) + numAvail); } } }); } } } //console.log("frbrHitId: "+frbrHitId); //console.log("hitDocId: "+hitDocId); if (frbrHitId != hitDocId) { skipIdList[frbrHitId] = true; //console.log(' Adding '+frbrHitId+' to list'); } var frbrLinkURL = frbrHitSearchURL + '&DISP=' + frbrHitId; //console.log('Link url ' +frbrLinkURL); var nonmodalLinkURL = $J(el).find('link').attr('href'); if (typeof nonmodalLinkURL !== "undefined") { nonmodalLinkURL = frbrRemoveParameter(nonmodalLinkURL, "ps"); } else { nonmodalLinkURL = " "; } var content = $J(el).find('content').text(); var tags = content.split('
'); var hasTag = []; jQuery.each(frbrUseFields, function(i, fld) { hasTag[fld] = -1; }); var formatTag = -1; var expressionFormat; //console.log('frbrFormatBOOK:'+frbrFormats['BOOK']['code']); for (var term = 0; term < tags.length; term++) { //console.log('tt:'+tags[term]); var alltags = tags[term].split(''); tags[term] = tags[term].split(''); var termName = alltags.shift(); //translate HTML entities to proper characters var parser = new DOMParser; var dom = parser.parseFromString('' + termName, 'text/html'); termName = dom.body.textContent; tags[term][0] = termName; var termValue = alltags.join(' & '); //console.log('termName(1):'+termName+'|termValue:'+termValue+'|'); if (!(termName == "" && termValue == "")) { // console.log('tt0:'+tags[term][0]); // console.log('isErc:'+isErcFrbrHit); // console.log('formatTag:'+formatTag); if ((tags[term][0] == "Format" || tags[term][0] == "Format:" || (isErcFrbrHit == 1 && (tags[term][0] == "Format" || tags[term][0] == "Format:"))) && formatTag == -1) { // console.log('termName(2):'+termName+'|termValue:'+termValue+'|'); if (termValue.indexOf(" & ") == -1) { // single format term in tag //translate HTML entities to proper characters parser = new DOMParser; dom = parser.parseFromString('' + termValue, 'text/html'); termValue = dom.body.textContent; // console.log('termValue(1):'+termValue+'|'); //formats:'+ frbrFormats[termValue]['code'] +'|'); //console.log("jQiEO:"+jQuery.isEmptyObject(frbrFormats[termValue])+"|"); if (jQuery.isEmptyObject(frbrFormats[termValue])) { //if (typeof frbrFormats[termValue]['code'] === "undefined" || frbrFormats[termValue]['code'].length < 1) { //console.log('frbrFormatBOOK:'+frbrFormats['Book']['code']); frbrFormats[termValue] = []; frbrFormats[termValue]['id'] = "frbr-other"; frbrFormats[termValue]['title'] = termValue; //"Other"; frbrFormats[termValue]['code'] = "UNKNOWN"; } //console.log("fFtcode:"+frbrFormats[termValue]['code']); formatTag = term; tags[term][1] = termValue; expressionFormat = frbrFormats[termValue]['code']; //termValue; if (typeof expressionFormat !== "undefined" && (typeof expressions[expressionFormat] == "undefined" || expressions[expressionFormat].length < 1)) { expressions[expressionFormat] = []; } //console.log('expFormat: ' + expressionFormat); } else { // multiple format terms in tag //console.log('termValue(2):'+termValue+'|'); //console.log('frbrFormatBOOK:'+frbrFormats['BOOK']['code']); var allforms = termValue.split(' & '); allforms.sort(); //console.log("af0:"+allforms[0]+"|"); var tmpexpression = []; for (var checktag = 0; checktag < allforms.length; checktag++) { //console.log("afct:"+allforms[checktag]+"|"); //translate HTML entities to proper characters parser = new DOMParser; dom = parser.parseFromString('' + allforms[checktag], 'text/html'); allforms[checktag] = dom.body.textContent; if (tmpexpression.indexOf(frbrFormats[allforms[checktag]]['code']) == -1) { tmpexpression.push(frbrFormats[allforms[checktag]]['code']); //console.log("tmpexp0:"+tmpexpression[0]); } else { //console.log("checktag(before):"+checktag+"|af[checktag]:"+allforms[checktag]); allforms.splice(checktag, 1); checktag--; //console.log("checktag(after):"+checktag+"|af[checktag]:"+allforms[checktag]); } } //console.log('frbrFormatBOOK:'+frbrFormats['BOOK']['code']); //console.log("af0(2):"+allforms[0]+"|"); if (frbrFormats[allforms[0]]['code'].length < 1) { frbrFormats[allforms[0]]['id'] = "frbr-other"; frbrFormats[allforms[0]]['title'] = "Other"; frbrFormats[allforms[0]]['code'] = "UNKNOWN"; } termValue = allforms.join(' & '); //console.log('termValue(3):'+termValue+'|'); formatTag = term; tags[term][1] = termValue; //console.log("fFtcode:"+frbrFormats[allforms[0]]['code']); expressionFormat = frbrFormats[allforms[0]]['code']; if (typeof expressionFormat != "undefined" && (typeof expressions[expressionFormat] == "undefined" || expressions[expressionFormat].length < 1)) { expressions[expressionFormat] = []; } } } jQuery.each(frbrUseFields, function(i, fld) { if (tags[term][0] == frbrExpressionFields[fld]['label'] || tags[term][0] == frbrExpressionFields[fld]['label'] + ":" || (hasTag[fld] == -1 && tags[term][0].indexOf(frbrExpressionFields[fld]['label']) > -1)) { hasTag[fld] = term; tags[term][1] = termValue; } }); } //end if termname not null } //end for var consoleTmp = ""; if (formatTag > -1) { //console.log("tft:"+tags[formatTag][1]); if (tags[formatTag][1].indexOf(" & ") > -1) { //multi-format record //console.log("made it tft 1"); //console.log("multi-tag tft:"+tags[formatTag][1]); consoleTmp = 'Format ' + tags[formatTag][1] + '|' + frbrFormats[tags[formatTag][1].split(' & ')[0]]['code']; //*** tags[formatTag][1] has an &!! var expressionText = ''; //''; if ($J('body').hasClass('mobile')) { expressionText = '
'; } //var expressionFormat = tags[formatTag][1] //expressionFormat = expressionFormat.replace(/ \& .*$/, ""); //console.log("made it 1a"); /* //### experimental for multi-format records, for treating subformats as subformats rather than additional formats if (tags[formatTag][1].indexOf("BOOK") > -1) { //console.log("made it 2"); if (tags[formatTag][1].indexOf("LARGEPRINT") > -1) { //console.log("made it 3a"); var tmptag = tags[formatTag][1]; tmptag = tmptag.replace("& LARGEPRINT",""); tmptag = tmptag.replace("BOOK", "BOOK (Large print)"); tags[formatTag][1] = tmptag; } else if (tags[formatTag][1].indexOf("COMICS") > -1) { //console.log("made it 3b"); tags[formatTag][1].replace("& COMICS",""); tags[formatTag][1].replace("BOOK", "Book (Comics/GN)"); } } */ var fmts = tags[formatTag][1].split(" & "); fmts.each(function(fmt) { if (expressionText.slice(-1) != ">") { expressionText += " & "; } expressionText += ' ' + frbrFormats[fmt]['title']; }); if (jQuery('body').hasClass('mobile')) { expressionText += "
"; } else { expressionText += ""; } } else { //single-format record //console.log("made it tft 1b"); //console.log("ftf: "+frbrFormats[tags[formatTag][1]]['code']); consoleTmp = 'Format ' + tags[formatTag][1] + '|' + frbrFormats[tags[formatTag][1]]['code']; //var expressionText = ' ' + frbrFormats[tags[formatTag][1]]['title']; var expressionText; if (jQuery('body').hasClass('mobile')) { expressionText = frbrFormats[tags[formatTag][1]]['title'] + '