Skip to content

Instantly share code, notes, and snippets.

View dcnb's full-sized avatar

Devin Becker dcnb

View GitHub Profile
<button class="btn btn-warning ms-3" onclick="reset_cb_items();" title="Refresh Collection Data">
<span id="refresh-icon"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-clockwise" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z"/>
<path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z"/>
</svg></span>
<span class="sr-only visually-hidden">Refresh Collection Data</span>
</button>
<script>
function reset_cb_items(){
@dcnb
dcnb / hashfilter.js
Created June 8, 2015 21:26
Hashtag filter for Isotope and Latah County Oral History Collection index page
ar hashfilter = location.hash.substr(1).replace("%20"," ").replace("%20"," ").replace("%20"," ").replace("%20"," ");
var hashfilterclass = "." + location.hash.substr(1).replace("%20","-").replace("%20","-").replace("%20","-").replace(" ","-").replace(" ","-").replace(" ","-");
if (hashfilter == ''){
$(document).ready(function()
{ $("#quicksearch").focus();});}
else {
$(document).ready(function() {
$("#quicksearch").focus();
$("#quicksearch").val('');
$('#quicksearch').val($('#quicksearch').val() + hashfilter);
@dcnb
dcnb / filterit.js
Created June 8, 2015 21:25
Filterit Function for Isotope and Latah County Oral HIstory index page
var filterit = function() {
$('#quicksearch').val('');
$(this).addClass('selectfilter');
$('a.vocab').not(this).removeClass('selectfilter');
var filterValue = $(this).attr('data-filter');
var filterClass = $(this).attr('data-filter').replace(" ","-").replace(" ","-");
$('#quicksearch').val($('#quicksearch').val() + filterValue);
$('#quicksearch').keyup();
window.location.hash = filterValue;
var filterValueclass = "." + filterClass;
@dcnb
dcnb / lcoh_people.xsl
Created June 8, 2015 21:23
XSL stylesheet for producing interviwee page
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
<xsl:output method="text"/>
<xsl:output method="html" indent="yes" name="html"/>
<xs:element name="//date" type="xs:date"/>
<xsl:template match="/">
<xsl:for-each select="//person">
<xsl:variable name="filename" select="concat('people/', lower-case(page))"/>
@dcnb
dcnb / Version3Cachefile.class.original.php
Created June 8, 2015 21:19
Revision of Array in Version3Cachefile.class.php
$this->data = array(
'cachefile' => $cachefile,
'title' => (string)$ohfile->record->title,
'accession' => (string)$ohfile->record->accession,
'chunks' => (string)$ohfile->record->sync,
'time_length' => (string)$ohfile->record->duration,
'collection' => (string)$ohfile->record->collection_name,
'series' => (string)$ohfile->record->series_name,
'fmt' => (string)$ohfile->record->fmt,
'media_url' => (string)$ohfile->record->media_url,
@dcnb
dcnb / transcript.class.original.php
Created June 8, 2015 21:09
Revised transcript.class.php file for Oral History Metadata Synchronizer (OHMS) system
private function formatIndex() {
if (!empty($this->index)) {
if (count($this->index->point) == 0) {
$this->indexHTML = '';
return;
}
$indexHTML = "<div id=\"accordionHolder\">\n";
foreach ($this->index->point as $point) {
$timePoint = (floor((int)$point->time / 60)) . ':' . str_pad(((int)$point->time % 60), 2, '0', STR_PAD_LEFT);
$synopsis = $point->synopsis;
<div class="box3">
<p style="margin:0px 0px 0px -10px;"><a href="/digital/lcoh/people/<?php $page = strtolower(str_replace(", ", "_", str_replace(" & ", "and",$cacheFile->interviewee)));$webpage = strstr($page, ' ', true); if (strpos($page,' ') !== false) {
echo $webpage;} else {echo $page;}?>.html" class="prev1" title="Go to all interviews">&laquo; View All <?php
$name = $cacheFile->interviewee;
$pieces = explode(",", $name);
echo $pieces[1];
echo " ";
echo $pieces[0]; ?> interviews</a></p>
<div style=" float: right; font-size: 13px; margin-top: -38px;" >
<p><a href="mailto:dbecker@uidaho.edu?subject=<?php echo $cacheFile->interviewee; ?>--<?php echo $cacheFile->intnum; ?>">Report a problem with this interview.</a></p></div>