|
@ -22,27 +22,28 @@ |
|
|
var item = test[i]; |
|
|
var item = test[i]; |
|
|
if(item.librarian.includes(thename)){ |
|
|
if(item.librarian.includes(thename)){ |
|
|
ledocument = item.debrispath; |
|
|
ledocument = item.debrispath; |
|
|
|
|
|
lelibrarian = item.librarian; |
|
|
//put ledocument into li and nest inside ul |
|
|
//put ledocument into li and nest inside ul |
|
|
var extension = ledocument.replace(/^.*\./, ''); |
|
|
var extension = ledocument.replace(/^.*\./, ''); |
|
|
console.log(ledocument); |
|
|
console.log(ledocument); |
|
|
if ((extension=="jpg") || (extension=="jpeg") || (extension=="png") || (extension=="gif") || (extension=="tiff")) { |
|
|
if ((extension=="jpg") || (extension=="jpeg") || (extension=="png") || (extension=="gif") || (extension=="tiff")) { |
|
|
$(".name-elements").append("<li><img class='listed-images' src='/files/"+ledocument+"'></li>"); |
|
|
$(".name-elements").append("<li><img class='listed-images' src='/files/"+ledocument+"'>Librarians: "+lelibrarian+"</li>"); |
|
|
} |
|
|
} |
|
|
else if (extension=="pdf") { |
|
|
else if (extension=="pdf") { |
|
|
$(".name-elements").append("<li><embed class='listed-pdf' src='files/"+ledocument+"'/></li>"); |
|
|
$(".name-elements").append("<li><embed class='listed-pdf' src='files/"+ledocument+"'/>Librarians: "+lelibrarian+"</li>"); |
|
|
} |
|
|
} |
|
|
else if (extension=="epub") { |
|
|
else if (extension=="epub") { |
|
|
$(".name-elements").append("<li>"+ledocument+"</li>"); |
|
|
$(".name-elements").append("<li>"+ledocument+lelibrarian+"</li>"); |
|
|
} |
|
|
} |
|
|
else if ((extension=="mp3") || (extension=="wav") || (extension=="m4a")) { |
|
|
else if ((extension=="mp3") || (extension=="wav") || (extension=="m4a")) { |
|
|
$(".name-elements").append("<li><audio class='listed-audio' controls><source src='files/"+ledocument+"'></audio></li>"); |
|
|
$(".name-elements").append("<li><audio class='listed-audio' controls><source src='files/"+ledocument+"'></audio>Librarians: "+lelibrarian+"</li>"); |
|
|
} |
|
|
} |
|
|
else if ((extension=="mov") || (extension=="mp4")) { |
|
|
else if ((extension=="mov") || (extension=="mp4")) { |
|
|
$(".name-elements").append("<li><video class='listed-videos' controls><source src='files/"+ledocument+"'></video></li>"); |
|
|
$(".name-elements").append("<li><video class='listed-videos' controls><source src='files/"+ledocument+"'></video>Librarians: "+lelibrarian+"</li>"); |
|
|
} |
|
|
} |
|
|
else if ((extension=="odt") || (extension=="docx")) { |
|
|
else if ((extension=="odt") || (extension=="docx")) { |
|
|
// something for odt and docx |
|
|
// something for odt and docx |
|
|
$(".name-elements").append("<li>"+ledocument+"</li>"); |
|
|
$(".name-elements").append("<li>"+ledocument+lelibrarian+"</li>"); |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|