My Library

'); var bibUrls = data['tm_field_bib_record_link$url'] || [], bibTitles = data.tm_field_staff_picks_title || [], reviewBodies = data.tm_field_staff_picks_review_short || [], bibAuthors = data.tm_field_staff_picks_author || [], firstName = data['tm_user$field_profile_first_name'], lastName = data['tm_user$field_profile_last_name'], displayName = data['ss_user$profile_staff_picks$field_staff_picks_display_name'] || '', location = data['ss_user$field_emp_location$name'] || null; if (!bibUrls[0] || !bibTitles[0] || !reviewBodies[0]) return null; var actualName = [firstName, lastName].join(' '); var bibLink = $('') .attr({href: bibUrls[0] || ''}) .append(bibTitles[0] || 'Title Not Found'); var bibAuthor = bibAuthors[0]; var bibText = $('

').append([ bibLink, bibAuthor ? ' | By: ' + bibAuthors[0] : '', ]); var reviewContent = [ bibText, $('

').append([ '"', reviewBodies[0], '"', $('').append([ ' —', (displayName || actualName), location !== null ? ', ' + location : '' ].join('')) ]) ]; review.html(reviewContent); return review; } var staffPicksContent = $('#staff-picks-content'); $.ajax({ url: 'https://intranet.ocls.info/staff-picks/query', method: 'GET', data: { random: true, limit : 1 }, dataType: 'json' }) .then(function (response) { response = response || {}; var solrResponse = response.response || {}, numFound = solrResponse.numFound || 0, docs = solrResponse.docs || []; if (numFound == 0 || !docs.length) return; var innerContent = docs.map($staffPick).filter(function (row) { return row !== null; }); if (innerContent.length) { // build and place content from data staffPicksContent.append([ $('

').text('Staff Picks'), ].concat(innerContent)); } else { staffPicksContent.remove(); } }) .catch(function (e) { console.error(e); }); })(window.jQuery);


WebPAC PRO © Innovative Interfaces, Inc.