From c9533c4a128789722df861e89376a27109728daa Mon Sep 17 00:00:00 2001 From: Sean Dockray Date: Thu, 10 Sep 2020 23:45:05 +1000 Subject: [PATCH] Updating from sandpoints --- static/css/site.css | 2 +- themes/sandpoints/assets/css/player.css | 83 +++++++++++++++++++ themes/sandpoints/assets/css/site.css | 11 +-- themes/sandpoints/assets/js/sandpoints.js | 37 ++++++++- .../sandpoints/data/sandpointsnamegraph.json | 6 +- .../_default/_markup/render-image.html | 13 +-- .../sandpoints/layouts/_default/single.html | 2 +- themes/sandpoints/layouts/partials/css.html | 30 ++----- themes/sandpoints/layouts/partials/head.html | 1 - themes/sandpoints/static/js/popcorn.min.js | 70 ++++++++++++++++ themes/sandpoints/static/js/soundcite.min.js | 4 + 11 files changed, 211 insertions(+), 48 deletions(-) create mode 100644 themes/sandpoints/assets/css/player.css create mode 100644 themes/sandpoints/static/js/popcorn.min.js create mode 100644 themes/sandpoints/static/js/soundcite.min.js diff --git a/static/css/site.css b/static/css/site.css index 9cdb69c..6e21111 100644 --- a/static/css/site.css +++ b/static/css/site.css @@ -1 +1 @@ -stdin 436:3 ⚠ grid-auto-flow works only if grid-template-rows and grid-template-columns are present in the same rule [autoprefixer] html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:hidden;border-width:0}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}@font-face{font-family:vollkorn;font-style:italic;font-weight:500;src:url(../fonts/vollkorn-v12-latin-ext_latin-500italic.eot);src:local(''),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.eot?#iefix)format('embedded-opentype'),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.woff2)format('woff2'),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.woff)format('woff'),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.ttf)format('truetype'),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.svg#Vollkorn)format('svg')}@font-face{font-family:vollkorn;font-style:normal;font-weight:400;src:url(../fonts/vollkorn-v12-latin-ext_latin-regular.eot);src:local(''),url(../fonts/vollkorn-v12-latin-ext_latin-regular.eot?#iefix)format('embedded-opentype'),url(../fonts/vollkorn-v12-latin-ext_latin-regular.woff2)format('woff2'),url(../fonts/vollkorn-v12-latin-ext_latin-regular.woff)format('woff'),url(../fonts/vollkorn-v12-latin-ext_latin-regular.ttf)format('truetype'),url(../fonts/vollkorn-v12-latin-ext_latin-regular.svg#Vollkorn)format('svg')}@font-face{font-family:vollkorn;font-style:normal;font-weight:500;src:url(../fonts/vollkorn-v12-latin-ext_latin-500.eot);src:local(''),url(../fonts/vollkorn-v12-latin-ext_latin-500.eot?#iefix)format('embedded-opentype'),url(../fonts/vollkorn-v12-latin-ext_latin-500.woff2)format('woff2'),url(../fonts/vollkorn-v12-latin-ext_latin-500.woff)format('woff'),url(../fonts/vollkorn-v12-latin-ext_latin-500.ttf)format('truetype'),url(../fonts/vollkorn-v12-latin-ext_latin-500.svg#Vollkorn)format('svg')}@font-face{font-family:vollkorn;font-style:italic;font-weight:400;src:url(../fonts/vollkorn-v12-latin-ext_latin-italic.eot);src:local(''),url(../fonts/vollkorn-v12-latin-ext_latin-italic.eot?#iefix)format('embedded-opentype'),url(../fonts/vollkorn-v12-latin-ext_latin-italic.woff2)format('woff2'),url(../fonts/vollkorn-v12-latin-ext_latin-italic.woff)format('woff'),url(../fonts/vollkorn-v12-latin-ext_latin-italic.ttf)format('truetype'),url(../fonts/vollkorn-v12-latin-ext_latin-italic.svg#Vollkorn)format('svg')}@font-face{font-family:great vibes;font-style:normal;font-weight:400;src:url(../fonts/great-vibes-v7-latin-ext_latin-regular.eot);src:local('Great Vibes'),local('GreatVibes-Regular'),url(../fonts/great-vibes-v7-latin-ext_latin-regular.eot?#iefix)format('embedded-opentype'),url(../fonts/great-vibes-v7-latin-ext_latin-regular.woff2)format('woff2'),url(../fonts/great-vibes-v7-latin-ext_latin-regular.woff)format('woff'),url(../fonts/great-vibes-v7-latin-ext_latin-regular.ttf)format('truetype'),url(../fonts/great-vibes-v7-latin-ext_latin-regular.svg#GreatVibes)format('svg')}body{font-family:vollkorn,serif;font-weight:400;max-width:1024px;font-size:1.4rem;padding-left:3rem;padding-top:.5rem;color:#000}.header{display:-ms-grid;display:grid;grid-auto-flow:column;position:-webkit-sticky;position:sticky;top:0;padding-top:.5rem;font-size:1.1rem;background-color:#fff;z-index:10}.mantlebar{display:none}.breadcrumbs{-ms-grid-column:1;grid-column:1}.bibliotheke{width:2.4rem;-ms-grid-column:2;grid-column:2;margin-left:auto}.bibliotheke:hover{text-decoration:none;font-size:1rem}.logolink{width:2.4rem;margin-left:auto}.sandpointlogo{border-radius:50%;border:.3em solid red;display:-webkit-inline-box;display:inline-flex;font-family:great vibes,cursive;font-size:1.2rem;font-weight:700;color:#fff;background-color:red;position:relative;padding-left:1em;padding-right:.3em;padding-bottom:1.2em;max-width:0;max-height:0}.sandpointF{position:absolute;font-size:1.2em;margin-top:-.2em;margin-left:-.4em}.sandpointN{position:absolute;font-size:.7em;margin-top:.4em;color:red;margin-left:-.5em}.sandpointC{position:absolute;font-size:1em;margin-left:-.37em}footer{display:-webkit-box;display:flex;margin-bottom:1rem;margin-top:4rem}li{list-style-type:"› "}li[role=doc-endnote]{list-style-type:decimal}img{width:100%}.sup{display:-webkit-inline-box;display:inline-flex;flex-wrap:nowrap;font-family:great vibes,cursive;font-size:.9em;font-style:normal;color:red;vertical-align:baseline;position:relative;top:-.3em}.sup:hover{font-weight:400!important}.syllabustitle,.coretitle{margin-top:4rem;font-style:italic;font-size:4rem;margin-bottom:4rem}.mantletitle,.crusttitle{margin-top:4rem;font-style:italic;font-size:2rem;margin-bottom:4rem}.has,.afterhas{font-style:italic;font-size:1.4rem}.grid{padding-left:3rem;margin-bottom:4rem;display:-ms-grid;display:grid;-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr}.leftcolumn{-ms-grid-column:1;grid-column:1;padding-right:1.2rem;position:relative}#TableOfContents{margin-left:-2rem;margin-top:-1.5rem}#TableOfContents li{list-style:decimal inside;padding-left:.5rem;color:rgba(0,0,0,.4);margin:0;padding:0}#TableOfContents li a{font-family:vollkorn;font-size:1.4rem;font-weight:500;font-style:normal}#TableOfContents>ol:first-child>span>li>a::after{content:"¶";color:rgba(0,0,0,.2);font-size:1.3em;padding-left:.1em}.rightcolumn{-ms-grid-column:2;grid-column:2;display:-ms-grid;display:grid;-ms-grid-columns:auto 1fr;grid-template-columns:auto 1fr;padding-left:.5rem}.has{-ms-grid-column:1;grid-column:1}.content{margin-top:4rem;padding-left:3rem;padding-right:10rem;max-width:720px}a{color:#000;text-decoration:none}a:hover{text-decoration:underline;-webkit-text-decoration-color:red;text-decoration-color:red;font-weight:500;font-size:.97em;cursor:pointer}h1{display:none}h2{font-weight:500;font-size:1.6rem}h3{font-weight:500;font-size:1.4rem}h4{font-weight:500;font-size:1.2rem}h5{font-weight:500;font-size:1.1rem}h6{font-weight:500;font-size:1rem}blockquote{font-style:italic;border-left:1px red solid;padding-left:1rem;padding-right:2rem;padding-top:.1rem;padding-bottom:.1rem;background-color:#fff9f9}h2+p:first-letter{font-family:great vibes,cursive;color:rgba(0,0,0,.8);font-size:1.5em;line-height:0}.hx{position:relative}.hpar{position:absolute;font-size:1.7em;font-style:normal;color:rgba(0,0,0,.1);top:0;margin-top:-.4em}body{counter-reset:h2}h2{counter-reset:h3}h3{counter-reset:h4}h4{counter-reset:h5}h5{counter-reset:h6}h2:before{color:rgba(0,0,0,.4);counter-increment:h2;content:counter(h2)". "}h3:before{color:rgba(0,0,0,.4);counter-increment:h3;content:counter(h2)"." counter(h3)". "}h4:before{color:rgba(0,0,0,.4);counter-increment:h4;content:counter(h2)"." counter(h3)"." counter(h4)". "}h5:before{color:rgba(0,0,0,.4);counter-increment:h5;content:counter(h2)"." counter(h3)"." counter(h4)"." counter(h5)". "}h6:before{color:rgba(0,0,0,.4);counter-increment:h6;content:counter(h2)"." counter(h3)"." counter(h4)"." counter(h5)"." counter(h6)". "}h2.nocount:before,h3.nocount:before,h4.nocount:before,h5.nocount:before,h6.nocount:before{content:"";counter-increment:none}@media(max-width:415px){html{box-sizing:border-box;max-width:414px;margin:0 auto;padding:0}body{font-size:1rem;padding-left:10px;padding-right:10px}.grid{display:inline}.syllabustitle{margin-top:3rem;margin-bottom:2rem;font-size:2.2rem}.leftcolumn{display:none}.has,.afterhas{font-size:1.1rem}.session,.topic{margin-bottom:.2em}.content{padding:0;margin:0 auto;margin-top:4rem}.hpar{display:none}.topicstitle{font-size:1.7rem}.sessiongrid{display:none}} \ No newline at end of file +stdin 437:3 ⚠ grid-auto-flow works only if grid-template-rows and grid-template-columns are present in the same rule [autoprefixer] html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:hidden;border-width:0}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}@font-face{font-family:vollkorn;font-style:italic;font-weight:500;src:url(../fonts/vollkorn-v12-latin-ext_latin-500italic.eot);src:local(''),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.eot?#iefix)format('embedded-opentype'),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.woff2)format('woff2'),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.woff)format('woff'),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.ttf)format('truetype'),url(../fonts/vollkorn-v12-latin-ext_latin-500italic.svg#Vollkorn)format('svg')}@font-face{font-family:vollkorn;font-style:normal;font-weight:400;src:url(../fonts/vollkorn-v12-latin-ext_latin-regular.eot);src:local(''),url(../fonts/vollkorn-v12-latin-ext_latin-regular.eot?#iefix)format('embedded-opentype'),url(../fonts/vollkorn-v12-latin-ext_latin-regular.woff2)format('woff2'),url(../fonts/vollkorn-v12-latin-ext_latin-regular.woff)format('woff'),url(../fonts/vollkorn-v12-latin-ext_latin-regular.ttf)format('truetype'),url(../fonts/vollkorn-v12-latin-ext_latin-regular.svg#Vollkorn)format('svg')}@font-face{font-family:vollkorn;font-style:normal;font-weight:500;src:url(../fonts/vollkorn-v12-latin-ext_latin-500.eot);src:local(''),url(../fonts/vollkorn-v12-latin-ext_latin-500.eot?#iefix)format('embedded-opentype'),url(../fonts/vollkorn-v12-latin-ext_latin-500.woff2)format('woff2'),url(../fonts/vollkorn-v12-latin-ext_latin-500.woff)format('woff'),url(../fonts/vollkorn-v12-latin-ext_latin-500.ttf)format('truetype'),url(../fonts/vollkorn-v12-latin-ext_latin-500.svg#Vollkorn)format('svg')}@font-face{font-family:vollkorn;font-style:italic;font-weight:400;src:url(../fonts/vollkorn-v12-latin-ext_latin-italic.eot);src:local(''),url(../fonts/vollkorn-v12-latin-ext_latin-italic.eot?#iefix)format('embedded-opentype'),url(../fonts/vollkorn-v12-latin-ext_latin-italic.woff2)format('woff2'),url(../fonts/vollkorn-v12-latin-ext_latin-italic.woff)format('woff'),url(../fonts/vollkorn-v12-latin-ext_latin-italic.ttf)format('truetype'),url(../fonts/vollkorn-v12-latin-ext_latin-italic.svg#Vollkorn)format('svg')}@font-face{font-family:great vibes;font-style:normal;font-weight:400;src:url(../fonts/great-vibes-v7-latin-ext_latin-regular.eot);src:local('Great Vibes'),local('GreatVibes-Regular'),url(../fonts/great-vibes-v7-latin-ext_latin-regular.eot?#iefix)format('embedded-opentype'),url(../fonts/great-vibes-v7-latin-ext_latin-regular.woff2)format('woff2'),url(../fonts/great-vibes-v7-latin-ext_latin-regular.woff)format('woff'),url(../fonts/great-vibes-v7-latin-ext_latin-regular.ttf)format('truetype'),url(../fonts/great-vibes-v7-latin-ext_latin-regular.svg#GreatVibes)format('svg')}body{font-family:vollkorn,serif;font-weight:400;max-width:1024px;font-size:1.4rem;padding-left:3rem;padding-top:.5rem;padding-right:2rem;color:#000}.header{display:-ms-grid;display:grid;grid-auto-flow:column;position:-webkit-sticky;position:sticky;top:0;padding-top:.5rem;font-size:1.1rem;background-color:#fff;z-index:10}.mantlebar{display:none}.breadcrumbs{-ms-grid-column:1;grid-column:1}.bibliotheke{width:2.4rem;-ms-grid-column:2;grid-column:2;margin-left:auto}.bibliotheke:hover{text-decoration:none;font-size:1rem}.logolink{width:2.4rem;margin-left:auto}.sandpointlogo{border-radius:50%;border:.3em solid red;display:-webkit-inline-box;display:inline-flex;font-family:great vibes,cursive;font-size:1.2rem;font-weight:700;color:#fff;background-color:red;position:relative;padding-left:1em;padding-right:.3em;padding-bottom:1.2em;max-width:0;max-height:0}.sandpointF{position:absolute;font-size:1.2em;margin-top:-.2em;margin-left:-.4em}.sandpointN{position:absolute;font-size:.7em;margin-top:.4em;color:red;margin-left:-.5em}.sandpointC{position:absolute;font-size:1em;margin-left:-.37em}footer{display:-webkit-box;display:flex;margin-bottom:1rem;margin-top:4rem}li{list-style-type:"› "}li[role=doc-endnote]{list-style-type:decimal}img{width:100%}.sup{display:-webkit-inline-box;display:inline-flex;flex-wrap:nowrap;font-family:great vibes,cursive;font-size:.9em;font-style:normal;color:red;vertical-align:baseline;position:relative;top:-.3em}.sup:hover{font-weight:400!important}.syllabustitle,.coretitle{margin-top:4rem;font-style:italic;font-size:4rem;margin-bottom:4rem}.mantletitle,.crusttitle{margin-top:4rem;font-style:italic;font-size:2rem;margin-bottom:4rem}.has,.afterhas{font-style:italic;font-size:1.4rem}.grid{padding-left:3rem;margin-bottom:4rem;display:-ms-grid;display:grid;-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr}.leftcolumn{-ms-grid-column:1;grid-column:1;padding-right:1.2rem;position:relative}#TableOfContents{margin-left:-2rem;margin-top:-1.5rem}#TableOfContents li{list-style:decimal inside;padding-left:.5rem;color:rgba(0,0,0,.4);margin:0;padding:0}#TableOfContents li a{font-family:vollkorn;font-size:1.4rem;font-weight:500;font-style:normal}#TableOfContents>ol:first-child>span>li>a::after{content:"¶";color:rgba(0,0,0,.2);font-size:1.3em;padding-left:.1em}.rightcolumn{-ms-grid-column:2;grid-column:2;display:-ms-grid;display:grid;-ms-grid-columns:auto 1fr;grid-template-columns:auto 1fr;padding-left:.5rem}.has{-ms-grid-column:1;grid-column:1}.content{margin-top:4rem;padding-left:3rem;padding-right:10rem;max-width:720px}a{color:#000;text-decoration:none}a:hover{text-decoration:underline;-webkit-text-decoration-color:red;text-decoration-color:red;font-weight:500;font-size:.97em;cursor:pointer}h1{display:none}h2{font-weight:500;font-size:1.6rem}h3{font-weight:500;font-size:1.4rem}h4{font-weight:500;font-size:1.2rem}h5{font-weight:500;font-size:1.1rem}h6{font-weight:500;font-size:1rem}blockquote{font-style:italic;border-left:1px red solid;padding-left:1rem;padding-right:2rem;padding-top:.1rem;padding-bottom:.1rem;background-color:#fff9f9}h2+p:first-letter{font-family:great vibes,cursive;color:rgba(0,0,0,.8);font-size:1.5em;line-height:0}.hx{position:relative}.hpar{position:absolute;font-size:1.7em;font-style:normal;color:rgba(0,0,0,.1);top:0;margin-top:-.4em}body{counter-reset:h2}h2{counter-reset:h3}h3{counter-reset:h4}h4{counter-reset:h5}h5{counter-reset:h6}h2:before{color:rgba(0,0,0,.4);counter-increment:h2;content:counter(h2)". "}h3:before{color:rgba(0,0,0,.4);counter-increment:h3;content:counter(h2)"." counter(h3)". "}h4:before{color:rgba(0,0,0,.4);counter-increment:h4;content:counter(h2)"." counter(h3)"." counter(h4)". "}h5:before{color:rgba(0,0,0,.4);counter-increment:h5;content:counter(h2)"." counter(h3)"." counter(h4)"." counter(h5)". "}h6:before{color:rgba(0,0,0,.4);counter-increment:h6;content:counter(h2)"." counter(h3)"." counter(h4)"." counter(h5)"." counter(h6)". "}h2.nocount:before,h3.nocount:before,h4.nocount:before,h5.nocount:before,h6.nocount:before{content:"";counter-increment:none}@media(max-width:767px){html{box-sizing:border-box;max-width:767px;margin:0 auto;padding:0}body{font-size:1rem;padding-left:10px;padding-right:10px}.grid{display:inline}.coretitle{margin-top:3rem;margin-bottom:2rem;font-size:2.2rem}.leftcolumn{display:none}.has,.afterhas{font-size:1.1rem}.mantle,.crust{margin-bottom:.2em}.content{padding:0;margin:0 auto;margin-top:4rem}.hpar{display:none}.mantletitle{font-size:1.7rem}.sessiongrid{display:none}} \ No newline at end of file diff --git a/themes/sandpoints/assets/css/player.css b/themes/sandpoints/assets/css/player.css new file mode 100644 index 0000000..34d5097 --- /dev/null +++ b/themes/sandpoints/assets/css/player.css @@ -0,0 +1,83 @@ +/* soundcite - v0.5.1 - 2017-07-10 + * Copyright (c) 2017 Tyler J. Fisher and Northwestern University Knight Lab + */ + +/*PLAYER CHROME*/ + +@-webkit-keyframes spin { + from { -webkit-transform: rotate(0deg); opacity: 0.4; } + 50% { -webkit-transform: rotate(180deg); opacity: 1; } + to { -webkit-transform: rotate(360deg); opacity: 0.4; } +} + +@-moz-keyframes spin { + from { -moz-transform: rotate(0deg); opacity: 0.4; } + 50% { -moz-transform: rotate(180deg); opacity: 1; } + to { -moz-transform: rotate(360deg); opacity: 0.4; } +} + +@-ms-keyframes spin { + from { -ms-transform: rotate(0deg); opacity: 0.4; } + 50% { -ms-transform: rotate(180deg); opacity: 1; } + to { -ms-transform: rotate(360deg); opacity: 0.4; } +} + +@-o-keyframes spin { + from { -o-transform: rotate(0deg); opacity: 0.4; } + 50% { -o-transform: rotate(180deg); opacity: 1; } + to { -o-transform: rotate(360deg); opacity: 0.4; } +} + +@keyframes spin { + from { transform: rotate(0deg); opacity: 0.2; } + 50% { transform: rotate(180deg); opacity: 1; } + to { transform: rotate(360deg); opacity: 0.2; } +} + +.soundcite-loaded { + border-radius: 6px; + padding: 0 5px 0 5px; + display: inline-block; + cursor: pointer; +} + +.soundcite-loaded:before { + display: inline-block; + content: ""; + vertical-align: -10%; + margin-right: 0.25em; +} + +.soundcite-loading:before { + margin-right: 0.5em; + font-size: 0.9em; + position: relative; + top: -.05em; + height: 0.75em; + width: 0.75em; + border: 2px solid #000; + border-right-color: transparent; + border-radius: 50%; + -webkit-animation: spin 1s linear infinite; + -moz-animation: spin 1s linear infinite; + -ms-animation: spin 1s linear infinite; + -o-animation: spin 1s linear infinite; + animation: spin 1s linear infinite; +} + +.soundcite-play:before { + font-size: 0.9em; + position: relative; + top: -.05em; + border: 0.5em solid transparent; + border-left: 0.75em solid black; +} + +.soundcite-pause:before { + font-size: 0.9em; + position: relative; + top: -.05em; + height: 1em; + border-left: .75em double black; + border-right: .5em solid transparent; +} diff --git a/themes/sandpoints/assets/css/site.css b/themes/sandpoints/assets/css/site.css index 0ec61de..70ed8ba 100644 --- a/themes/sandpoints/assets/css/site.css +++ b/themes/sandpoints/assets/css/site.css @@ -428,6 +428,7 @@ body { font-size: 1.4rem; padding-left: 3rem; padding-top: 0.5rem; + padding-right: 2rem; color: black; } @@ -725,10 +726,10 @@ h6:before { h2.nocount:before, h3.nocount:before, h4.nocount:before, h5.nocount:before, h6.nocount:before { content: ""; counter-increment: none } -@media (max-width: 415px) { +@media (max-width: 767px) { html { box-sizing: border-box; - max-width: 414px; + max-width: 767px; margin: 0 auto; padding: 0; } @@ -743,7 +744,7 @@ h2.nocount:before, h3.nocount:before, h4.nocount:before, h5.nocount:before, h6.n display: inline; } - .syllabustitle { + .coretitle { margin-top: 3rem; margin-bottom: 2rem; font-size: 2.2rem; @@ -757,7 +758,7 @@ h2.nocount:before, h3.nocount:before, h4.nocount:before, h5.nocount:before, h6.n font-size: 1.1rem; } - .session, .topic { + .mantle, .crust { margin-bottom: 0.2em; } @@ -771,7 +772,7 @@ h2.nocount:before, h3.nocount:before, h4.nocount:before, h5.nocount:before, h6.n display: none; } - .topicstitle { + .mantletitle { font-size: 1.7rem; } diff --git a/themes/sandpoints/assets/js/sandpoints.js b/themes/sandpoints/assets/js/sandpoints.js index cceb68c..c3e9cf0 100644 --- a/themes/sandpoints/assets/js/sandpoints.js +++ b/themes/sandpoints/assets/js/sandpoints.js @@ -1,10 +1,14 @@ window.addEventListener('scroll', function(e) { - if (document.querySelector('body').clientWidth > 1024) { + if (document.querySelector('body').clientWidth > 767) { let rightcolumn = document.querySelector('.rightcolumn'); - let mantletitle = document.querySelector('.mantletitle') || document.querySelector('.crusttitle'); + let mantletitle = document.querySelector('.mantletitle') || document.querySelector('.crusttitle') || false; + if (!mantletitle) { + return + } let mantlebar = document.querySelector('.mantlebar') let grid = document.querySelector('.grid') let gridrect = mantletitle.getBoundingClientRect(); + if (gridrect.top < 20 && !grid.classList.contains('moved')) { grid.classList.add('moved'); mantlebar.style.display = "inline"; @@ -18,6 +22,25 @@ window.addEventListener('scroll', function(e) { grid.style.display = "grid"; window.scroll({top: 0, behavior: 'smooth'}) } + } else { + let rightcolumn = document.querySelector('.rightcolumn'); + let mantletitle = document.querySelector('.mantletitle') || document.querySelector('.crusttitle') || false; + if (!mantletitle) { + return + } + let mantlebar = document.querySelector('.mantlebar') + let grid = document.querySelector('.grid') + let gridrect = mantletitle.getBoundingClientRect(); + + if (gridrect.top < 20 && !grid.classList.contains('moved')) { + grid.classList.add('moved'); + mantlebar.style.display = "inline"; + mantletitle.style.visibility = "hidden"; + } else if (gridrect.top > 21 && grid.classList.contains('moved')) { + grid.classList.remove('moved'); + mantletitle.style.visibility = "visible"; + mantlebar.style.display = "none"; + } } }) @@ -28,4 +51,14 @@ window.addEventListener('DOMContentLoaded', (e) => { s.appendChild(par.cloneNode(true)) par.remove() document.querySelector("#TableOfContents > ol:first-child").insertBefore(s, document.querySelector("#TableOfContents > ol:first-child").firstChild) + + if (document.querySelector(".soundcite")) { + var popcorn = document.createElement('script'); + popcorn.src = `/js/popcorn.min.js`; + document.body.appendChild(popcorn); + var soundcite = document.createElement('script'); + soundcite.src = `/js/soundcite.min.js`; + document.body.appendChild(soundcite); + + } }) diff --git a/themes/sandpoints/data/sandpointsnamegraph.json b/themes/sandpoints/data/sandpointsnamegraph.json index 27c276e..72b773f 100644 --- a/themes/sandpoints/data/sandpointsnamegraph.json +++ b/themes/sandpoints/data/sandpointsnamegraph.json @@ -8,12 +8,12 @@ "topic": { "depth": "mantle", "plural": "topics", - "has": ["lesson", "lessons"], + "has": ["experiment", "experiments"], "in": ["curriculum", "curricula"] }, - "lesson": { + "experiment": { "depth": "crust", - "plural": "lessons", + "plural": "experiments", "has": false, "in": ["topic", "topics"] } diff --git a/themes/sandpoints/layouts/_default/_markup/render-image.html b/themes/sandpoints/layouts/_default/_markup/render-image.html index aee9dbc..9333202 100644 --- a/themes/sandpoints/layouts/_default/_markup/render-image.html +++ b/themes/sandpoints/layouts/_default/_markup/render-image.html @@ -32,18 +32,9 @@ {{- else if strings.HasPrefix .Destination "audio:" -}} {{- $a_destination := (substr .Destination 6) -}} {{- if findRE "^.*static" $a_destination -}} -
{{ .Text }}
- + {{ .Text }} {{- else -}} -
{{ .Text }}
- - {{- end -}} -{{- else if strings.HasPrefix .Destination "soundcite:" -}} - {{- $a_destination := (substr .Destination 10) -}} - {{- if findRE "^.*static" $a_destination -}} - {{ .Text }} - {{- else -}} - {{ .Text }} + {{ .Text }} {{- end -}} {{- else if findRE "^.*static" .Destination -}} {{- .Text -}} diff --git a/themes/sandpoints/layouts/_default/single.html b/themes/sandpoints/layouts/_default/single.html index 98359ce..1b862db 100644 --- a/themes/sandpoints/layouts/_default/single.html +++ b/themes/sandpoints/layouts/_default/single.html @@ -31,7 +31,7 @@
{{ range index $currentNode.Params (printf "has_%s" (index ($graphOptions.Get "has") 1) )}} {{ with $.GetPage (printf "%s%s" (printf "/%s/" (index ($graphOptions.Get "has") 0)) . ) }} -
+ {{ end }} diff --git a/themes/sandpoints/layouts/partials/css.html b/themes/sandpoints/layouts/partials/css.html index feeb06c..d584261 100644 --- a/themes/sandpoints/layouts/partials/css.html +++ b/themes/sandpoints/layouts/partials/css.html @@ -1,27 +1,9 @@ {{ if (or (eq hugo.Environment "gitea") (eq hugo.Environment "preview") ) }} - -{{ else if .Site.IsServer }} + + +{{ else if (or (eq hugo.Environment "offline") (.Site.IsServer)) }} {{ $style := resources.Get "css/site.css" | postCSS (dict "config" "./assets/css/postcss.config.js") | minify }} - -{{ else }} - {{ $flist := newScratch }} - {{ $flist.Set "initial" "nop" }} - {{ range (readDir "public/css") }} - {{ $finfo := os.Stat (printf "%s%s" "public/css/" .Name) }} - {{ $flist.SetInMap "css_files" (printf "%s" $finfo.ModTime) .Name }} - {{ $flist.Set "initial" "yay" }} - {{ end }} - - {{ $css := "nop" }} - - {{ if eq ($flist.Get "initial") "yay" }} - {{ $css = (index (last 1 ( $flist.GetSortedMapValues "css_files" )) 0) }} - {{ end }} - - {{ if in $css "css" }} - - {{ else }} - {{ $style := resources.Get "css/site.css" | postCSS (dict "config" "./assets/css/postcss.config.js") | minify }} - - {{ end }} + + {{ $style := resources.Get "css/player.css" | postCSS (dict "config" "./assets/css/postcss.config.js") | minify }} + {{ end }} diff --git a/themes/sandpoints/layouts/partials/head.html b/themes/sandpoints/layouts/partials/head.html index a11094a..242f87b 100644 --- a/themes/sandpoints/layouts/partials/head.html +++ b/themes/sandpoints/layouts/partials/head.html @@ -28,6 +28,5 @@ {{ $sjsopts := dict "targetPath" "js/sandpoints.js" "minify" "true"}} {{ $sjs := resources.Get "js/sandpoints.js" | js.Build $sjsopts }} - {{ block "title" . }}{{- .Title }} -- {{ .Site.Title -}}{{ end }} diff --git a/themes/sandpoints/static/js/popcorn.min.js b/themes/sandpoints/static/js/popcorn.min.js new file mode 100644 index 0000000..be7366c --- /dev/null +++ b/themes/sandpoints/static/js/popcorn.min.js @@ -0,0 +1,70 @@ + + + + + +/* + FILE ARCHIVED ON 5:15:07 Dec 19, 2014 AND RETRIEVED FROM THE + INTERNET ARCHIVE ON 18:37:00 Jan 28, 2015. + JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE. + + ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. + SECTION 108(a)(3)). +*/ +/* + * popcorn.js version 1.5.6 + * /web/20141219051507/http://popcornjs.org + * + * Copyright 2011, Mozilla Foundation + * Licensed under the MIT license + */ + +(function(r,q){function t(a){G.put.call(this,a)}function y(a){this.parent=a;this.byStart=[{start:-1,end:-1}];this.byEnd=[{start:-1,end:-1}];this.animating=[];this.endIndex=this.startIndex=0;this.previousUpdateTime=-1;this.count=1}function H(a,b){return function(){if(c.plugin.debug)return a.apply(this,arguments);try{return a.apply(this,arguments)}catch(e){c.plugin.errors.push({plugin:b,thrown:e,source:a.toString()});this.emit("pluginerror",c.plugin.errors)}}}if(q.addEventListener){var w=Array.prototype, +A=Object.prototype,B=w.forEach,C=w.slice,v=A.hasOwnProperty,D=A.toString,I=r.Popcorn,z=[],E=false,x={events:{hash:{},apis:{}}},F=function(){return r.requestAnimationFrame||r.webkitRequestAnimationFrame||r.mozRequestAnimationFrame||r.oRequestAnimationFrame||r.msRequestAnimationFrame||function(a){r.setTimeout(a,16)}}(),G={put:function(a){for(var b in a)if(a.hasOwnProperty(b))this[b]=a[b]}},c=function(a,b){return new c.p.init(a,b||null)};c.version="1.5.6";c.isSupported=true;c.instances=[];c.p=c.prototype= +{init:function(a,b){var e,d=this;if(typeof a==="function")if(q.readyState==="complete")a(q,c);else{z.push(a);if(!E){E=true;var g=function(){q.removeEventListener("DOMContentLoaded",g,false);for(var l=0,n=z.length;l0;s--)m[s].end>i&&d.removeTrackEvent(m[s]._id);for(m=0;mi&&d.removeTrackEvent(p[m]._id);d.data.trackEvents.byEnd.push({start:u,end:u});d.data.trackEvents.byStart.push({start:u,end:u})};d.media.addEventListener("durationchange", +d.data.durationChange,false)}if(d.options.frameAnimation){d.data.timeUpdate=function(){c.timeUpdate(d,{});c.forEach(c.manifest,function(i,u){if(n=d.data.running[u]){k=n.length;for(var p=0;p=1?j():d.media.addEventListener("loadedmetadata",j,false);return this}}};c.p.init.prototype=c.p;c.byId=function(a){for(var b=c.instances,e=b.length,d=0;d=0;e--){d=a.data.running[b][e];d._natives.end.call(a, +null,d);a.emit("trackend",c.extend({},d,{plugin:d.type,type:"trackend"}))}return a}},enable:function(a,b){if(a.data.disabled[b]){a.data.disabled[b]=false;if(b in c.registryByName&&a.data.running[b])for(var e=a.data.running[b].length-1,d;e>=0;e--){d=a.data.running[b][e];d._natives.start.call(a,null,d);a.emit("trackstart",c.extend({},d,{plugin:d.type,type:"trackstart",track:d}))}return a}},destroy:function(a){var b=a.data.events,e=a.data.trackEvents,d,g,h,j;for(g in b){d=b[g];for(h in d)delete d[h]; +b[g]=null}for(j in c.registryByName)c.removePlugin(a,j);e.byStart.length=0;e.byEnd.length=0;if(!a.isDestroyed){a.data.timeUpdate&&a.media.removeEventListener("timeupdate",a.data.timeUpdate,false);a.isDestroyed=true}c.instances.splice(c.instances.indexOf(a),1)}});c.guid.counter=1;c.extend(c.p,function(){var a={};c.forEach("load play pause currentTime playbackRate volume duration preload playbackRate autoplay loop controls muted buffered readyState seeking paused played seekable ended".split(/\s+/g), +function(b){a[b]=function(e){var d;if(typeof this.media[b]==="function"){if(e!=null&&/play|pause/.test(b))this.media.currentTime=c.util.toSeconds(e);this.media[b]();return this}if(e!=null){d=this.media[b];this.media[b]=e;d!==e&&this.emit("attrchange",{attribute:b,previousValue:d,currentValue:e});return this}return this.media[b]}});return a}());c.forEach("enable disable".split(" "),function(a){c.p[a]=function(b){return c[a](this,b)}});c.extend(c.p,{roundTime:function(){return Math.round(this.media.currentTime)}, +exec:function(a,b,e){var d=arguments.length,g="trackadded",h,j;try{j=c.util.toSeconds(a)}catch(l){}if(typeof j==="number")a=j;if(typeof a==="number"&&d===2){e=b;b=a;a=c.guid("cue")}else if(d===1)b=-1;else if(h=this.getTrackEvent(a)){this.data.trackEvents.remove(a);t.end(this,h);c.removeTrackEvent.ref(this,a);g="cuechange";if(typeof a==="string"&&d===2){if(typeof b==="number")e=h._natives.start;if(typeof b==="function"){e=b;b=h.start}}}else if(d>=2){if(typeof b==="string"){try{j=c.util.toSeconds(b)}catch(n){}b= +j}if(typeof b==="number")e=e||c.nop();if(typeof b==="function"){e=b;b=-1}}d={id:a,start:b,end:b+1,_running:false,_natives:{start:e||c.nop,end:c.nop,type:"cue"}};if(h)d=c.extend(h,d);if(g==="cuechange"){d._id=d.id||d._id||c.guid(d._natives.type);this.data.trackEvents.add(d);t.start(this,d);this.timeUpdate(this,null,true);c.addTrackEvent.ref(this,d);this.emit(g,c.extend({},d,{id:a,type:g,previousValue:{time:h.start,fn:h._natives.start},currentValue:{time:b,fn:e||c.nop},track:h}))}else c.addTrackEvent(this, +d);return this},mute:function(a){a=a==null||a===true?"muted":"unmuted";if(a==="unmuted"){this.media.muted=false;this.media.volume=this.data.state.volume}if(a==="muted"){this.data.state.volume=this.media.volume;this.media.muted=true}this.emit(a);return this},unmute:function(a){return this.mute(a==null?false:!a)},position:function(){return c.position(this.media)},toggle:function(a){return c[this.data.disabled[a]?"enable":"disable"](this,a)},defaults:function(a,b){if(c.isArray(a)){c.forEach(a,function(e){for(var d in e)this.defaults(d, +e[d])},this);return this}if(!this.options.defaults)this.options.defaults={};this.options.defaults[a]||(this.options.defaults[a]={});c.extend(this.options.defaults[a],b);return this}});c.Events={UIEvents:"blur focus focusin focusout load resize scroll unload",MouseEvents:"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave click dblclick",Events:"loadstart progress suspend emptied stalled play pause error loadedmetadata loadeddata waiting playing canplay canplaythrough seeking seeked timeupdate ended ratechange durationchange volumechange"}; +c.Events.Natives=c.Events.UIEvents+" "+c.Events.MouseEvents+" "+c.Events.Events;x.events.apiTypes=["UIEvents","MouseEvents","Events"];(function(a,b){for(var e=x.events.apiTypes,d=a.Natives.split(/\s+/g),g=0,h=d.length;g-1&&this.media.addEventListener(a,function(l){if(e.data.events[a])for(h=e.data.events[a].slice();h.length;)h.shift().call(e,l)},false);return this},unlisten:function(a,b){var e,d=this.data.events[a];if(d){if(typeof b=== +"string"){for(e=0;ea.media.currentTime&&b.start<=a.media.currentTime&&!b._running){b._running=true;a.data.running[b._natives.type].push(b);if(!a.data.disabled[b._natives.type]){b._natives.start.call(a,null,b);a.emit("trackstart",c.extend({},b,{plugin:b._natives.type,type:"trackstart",track:b}))}}};t.end=function(a,b){var e;if((b.end<=a.media.currentTime||b.start> +a.media.currentTime)&&b._running){e=a.data.running[b._natives.type];b._running=false;e.splice(e.indexOf(b),1);if(!a.data.disabled[b._natives.type]){b._natives.end.call(a,null,b);a.emit("trackend",c.extend({},b,{plugin:b._natives.type,type:"trackend",track:b}))}}};y.prototype.where=function(a){return(this.parent.getTrackEvents()||[]).filter(function(b){var e,d;if(!a)return true;for(e in a){d=a[e];if(b[e]&&b[e]===d||b._natives[e]&&b._natives[e]===d)return true}return false})};y.prototype.add=function(a){var b= +this.byStart,e=this.byEnd,d;a&&a._id&&this.parent.data.history.push(a._id);a.start=c.util.toSeconds(a.start,this.parent.options.framerate);a.end=c.util.toSeconds(a.end,this.parent.options.framerate);for(d=b.length-1;d>=0;d--)if(a.start>=b[d].start){b.splice(d+1,0,a);break}for(b=e.length-1;b>=0;b--)if(a.end>e[b].end){e.splice(b+1,0,a);break}d<=this.parent.data.trackEvents.startIndex&&a.start<=this.parent.data.trackEvents.previousUpdateTime&&this.parent.data.trackEvents.startIndex++;b<=this.parent.data.trackEvents.endIndex&& +a.end-1;){b=this.byStart[g];e=this.byEnd[g];if(!b._id){j.push(b);l.push(e)}if(b._id){b._id!==a&&j.push(b);e._id!==a&&l.push(e);if(b._id===a)h=g}g++}d=this.animating.length; +g=0;if(d)for(;--d>-1;){b=this.animating[g];b._id||n.push(b);b._id&&b._id!==a&&n.push(b);g++}h<=this.startIndex&&this.startIndex--;h<=this.endIndex&&this.endIndex--;this.byStart=j;this.byEnd=l;this.animating=n;this.count--;d=this.parent.data.history.length;for(g=0;ge&&k._running===false){k._running=true;a.data.running[f].push(k);if(!a.data.disabled[f]){d.start.call(a,b, +k);a.emit("trackstart",c.extend({},k,{plugin:f,type:"trackstart",track:k}))}}j++}else{c.removeTrackEvent(a,k._id);return}}}else if(d>e){for(;g.byStart[j]&&g.byStart[j].start>e;){k=g.byStart[j];f=(d=k._natives)&&d.type;if(!d||o[f]||a[f]){if(k._running===true){k._running=false;i=a.data.running[f];i.splice(i.indexOf(k),1);if(!a.data.disabled[f]){d.end.call(a,b,k);a.emit("trackend",c.extend({},k,{plugin:f,type:"trackend",track:k}))}}j--}else{c.removeTrackEvent(a,k._id);return}}for(;g.byEnd[h]&&g.byEnd[h].end> +e;){k=g.byEnd[h];f=(d=k._natives)&&d.type;if(!d||o[f]||a[f]){if(k.start<=e&&k._running===false){k._running=true;a.data.running[f].push(k);if(!a.data.disabled[f]){d.start.call(a,b,k);a.emit("trackstart",c.extend({},k,{plugin:f,type:"trackstart",track:k}))}}h--}else{c.removeTrackEvent(a,k._id);return}}}g.endIndex=h;g.startIndex=j;g.previousUpdateTime=e;g.byStart.length= +0)c.error("'"+a+"' is a protected function name");else{var d=typeof b==="function",g=["start","end","type","manifest"],h=["_setup","_teardown","start","end","frame"],j={},l=function(k,f){k=k||c.nop;f=f||c.nop;return function(){k.apply(this,arguments);f.apply(this,arguments)}};c.manifest[a]=e=e||b.manifest||{};h.forEach(function(k){b[k]=H(b[k]||c.nop,a)});var n=function(k,f){if(!f)return this;if(f.ranges&&c.isArray(f.ranges)){c.forEach(f.ranges,function(m){m=c.extend({},f,m);delete m.ranges;this[a](m)}, +this);return this}var i=f._natives={},u="",p;c.extend(i,k);f._natives.type=f._natives.plugin=a;f._running=false;i.start=i.start||i["in"];i.end=i.end||i.out;if(f.once)i.end=l(i.end,function(){this.removeTrackEvent(f._id)});i._teardown=l(function(){var m=C.call(arguments),s=this.data.running[i.type];m.unshift(null);m[1]._running&&s.splice(s.indexOf(f),1)&&i.end.apply(this,m);m[1]._running=false;this.emit("trackend",c.extend({},f,{plugin:i.type,type:"trackend",track:c.getTrackEvent(this,f.id||f._id)}))}, +i._teardown);i._teardown=l(i._teardown,function(){this.emit("trackteardown",c.extend({},f,{plugin:a,type:"trackteardown",track:c.getTrackEvent(this,f.id||f._id)}))});f.compose=f.compose||[];if(typeof f.compose==="string")f.compose=f.compose.split(" ");f.effect=f.effect||[];if(typeof f.effect==="string")f.effect=f.effect.split(" ");f.compose=f.compose.concat(f.effect);f.compose.forEach(function(m){u=c.compositions[m]||{};h.forEach(function(s){i[s]=l(i[s],u[s])})});f._natives.manifest=e;if(!("start"in +f))f.start=f["in"]||0;if(!f.end&&f.end!==0)f.end=f.out||Number.MAX_VALUE;if(!v.call(f,"toString"))f.toString=function(){var m=["start: "+f.start,"end: "+f.end,"id: "+(f.id||f._id)];f.target!=null&&m.push("target: "+f.target);return a+" ( "+m.join(", ")+" )"};if(!f.target){p="options"in e&&e.options;f.target=p&&"target"in p&&p.target}if(!f._id&&f._natives)f._id=c.guid(f._natives.type);if(f instanceof t){if(f._natives){f._id=f.id||f._id||c.guid(f._natives.type);if(f._natives._setup){f._natives._setup.call(this, +f);this.emit("tracksetup",c.extend({},f,{plugin:f._natives.type,type:"tracksetup",track:f}))}}this.data.trackEvents.add(f);t.start(this,f);this.timeUpdate(this,null,true);f._id&&c.addTrackEvent.ref(this,f)}else c.addTrackEvent(this,f);c.forEach(k,function(m,s){g.indexOf(s)===-1&&this.on(s,m)},this);return this};c.p[a]=j[a]=function(k,f){var i,u;if(k&&!f)f=k;else if(i=this.getTrackEvent(k)){u=f;var p={},m;for(m in i)if(v.call(u,m)&&v.call(i,m))p[m]=i[m];if(i._natives._update){this.data.trackEvents.remove(i); +if(v.call(f,"start"))i.start=f.start;if(v.call(f,"end"))i.end=f.end;t.end(this,i);d&&b.call(this,i);i._natives._update.call(this,i,f);this.data.trackEvents.add(i);t.start(this,i)}else{c.extend(i,f);this.data.trackEvents.remove(k);i._natives._teardown&&i._natives._teardown.call(this,i);c.removeTrackEvent.ref(this,k);if(d)n.call(this,b.call(this,i),i);else{i._id=i.id||i._id||c.guid(i._natives.type);if(i._natives&&i._natives._setup){i._natives._setup.call(this,i);this.emit("tracksetup",c.extend({},i, +{plugin:i._natives.type,type:"tracksetup",track:i}))}this.data.trackEvents.add(i);t.start(this,i);this.timeUpdate(this,null,true);c.addTrackEvent.ref(this,i)}this.emit("trackchange",{id:i.id,type:"trackchange",previousValue:p,currentValue:i,track:i});return this}i._natives.type!=="cue"&&this.emit("trackchange",{id:i.id,type:"trackchange",previousValue:p,currentValue:u,track:i});return this}else f.id=k;this.data.running[a]=this.data.running[a]||[];i=c.extend({},this.options.defaults&&this.options.defaults[a]|| +{},f);n.call(this,d?b.call(this,i):b,i);return this};e&&c.extend(b,{manifest:e});var o={fn:j[a],definition:b,base:b,parents:[],name:a};c.registry.push(c.extend(j,o,{type:a}));c.registryByName[a]=o;return j}};c.plugin.errors=[];c.plugin.debug=c.version==="1.5.6";c.removePlugin=function(a,b){if(!b){b=a;a=c.p;if(c.protect.natives.indexOf(b.toLowerCase())>=0){c.error("'"+b+"' is a protected function name");return}var e=c.registry.length,d;for(d=0;d-1){g=g.split(";");h=0;if(b&&typeof b==="number")h=parseFloat(g[1],10)/b;e[d]=parseInt(g[0],10)+h}d=e[0];return{1:parseFloat(d,10),2:parseInt(d,10)*60+parseFloat(e[1],10),3:parseInt(d,10)*3600+parseInt(e[1],10)*60+parseFloat(e[2],10)}[e.length||1]}};c.p.cue=c.p.exec;c.protect={natives:function(a){return Object.keys?Object.keys(a):function(b){var e,d=[];for(e in b)v.call(b,e)&&d.push(e);return d}(a)}(c.p).map(function(a){return a.toLowerCase()})}; +c.forEach({listen:"on",unlisten:"off",trigger:"emit",exec:"cue"},function(a,b){var e=c.p[b];c.p[b]=function(){if(typeof console!=="undefined"&&console.warn){console.warn("Deprecated method '"+b+"', "+(a==null?"do not use.":"use '"+a+"' instead."));c.p[b]=e}return c.p[a].apply(this,[].slice.call(arguments))}});r.Popcorn=c}else{r.Popcorn={isSupported:false};for(w="byId forEach extend effects error guid sizeOf isArray nop position disable enable destroyaddTrackEvent removeTrackEvent getTrackEvents getTrackEvent getLastTrackEventId timeUpdate plugin removePlugin compose effect xhr getJSONP getScript".split(/\s+/);w.length;)r.Popcorn[w.shift()]= +function(){}}})(window,window.document); diff --git a/themes/sandpoints/static/js/soundcite.min.js b/themes/sandpoints/static/js/soundcite.min.js new file mode 100644 index 0000000..0eb36c0 --- /dev/null +++ b/themes/sandpoints/static/js/soundcite.min.js @@ -0,0 +1,4 @@ +/* soundcite - v0.5.1 - 2017-07-10 + * Copyright (c) 2017 Tyler J. Fisher and Northwestern University Knight Lab + */ +(function(window,document,callback){var loaded_p=true;var loaded_s=true;var insertionPoint=document.head||document.getElementsByTagName("head").item(0)||document.documentElement.childNodes[0];function cmp_vers(v1,v2){var a1=v1.split(".");var a2=v2.split(".");for(var i=0;i0||cb(js)){var script=document.createElement("script");script.type="text/javascript";script.src="https://cdn.knightlab.com/libs/soundcite/latest/vendor/popcorn.min.js";script.onload=script.onreadystatechange=function(){if(!loaded_p&&(!(d=this.readyState)||d=="loaded"||d=="complete")){new_js=window.Popcorn;if(js){window.Popcorn=js}cb(new_js,loaded_p=true);insertionPoint.removeChild(script)}};insertionPoint.appendChild(script)}}function load_soundcloud(version,cb){var js=window.SC,d;if(loaded_s){cb(js)}else if(!js||!js.Dialog||cmp_vers(version,js._version)>0||cb(js)){var script=document.createElement("script");script.type="text/javascript";script.src="//connect.soundcloud.com/sdk-2.0.0.js";script.onload=script.onreadystatechange=function(){if(!loaded_s&&(!(d=this.readyState)||d=="loaded"||d=="complete")){cb(window.SC,loaded_s=true);insertionPoint.removeChild(script)}};insertionPoint.appendChild(script)}}function r(f){if(/in/.test(document.readyState)){setTimeout(function(){r(f)},9)}else{f()}}r(function(){var elements=document.getElementsByClassName("soundcite");for(var i=0;i=0&&i<=255}if(rgb&&valid_color(rgb[0])&&valid_color(rgb[1])&&valid_color(rgb[2])){return rgb}return null}var update_playing_element=function(el,percentage){var color=SOUNDCITE_CONFIG.background_color||"0,0,0";el.style.cssText="background: -webkit-linear-gradient(left, rgba("+color+",.15)"+percentage+"%, rgba("+color+",.05)"+(percentage+1)+"%);"+"background: linear-gradient(to right, rgba("+color+",.15)"+percentage+"%, rgba("+color+",.05)"+(percentage+1)+"%);"};window.soundcite={};if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){soundcite.mobile=true}else{soundcite.mobile=false}var clips=[];var audio_container=document.createElement("div");addClass(audio_container,"soundcite-audio");document.getElementsByTagName("body")[0].appendChild(audio_container);if($SoundCloud){$SoundCloud.initialize({client_id:SOUNDCITE_CONFIG["soundcloud_client_id"]})}function pause_all_clips(except_clip){for(var i=0;i=this.end){if(this.plays){this.plays_left--;if(this.plays_left>0){this.play();this.track_position()}else{this.stop()}}else{this.play();this.track_position()}}},this));if(this.end===null){this.end=this.sound.getDuration()}this.sound_loaded()},this))}SoundCloudClip.prototype=Object.create(Clip.prototype);SoundCloudClip.prototype.sound_position=function(){return this.sound.getCurrentPosition()};SoundCloudClip.prototype.pause_sound=function(){this.sound.pause()};SoundCloudClip.prototype.stop_sound=function(){this.sound.stop()};SoundCloudClip.prototype.play=function(){var pos=this.sound_position();if(pos=this.end){this.sound.seek(this.start)}removeClass(this.el,"soundcite-play");addClass(this.el,"soundcite-pause");this.sound.play();this.playing=true};function PopcornClip(el){Clip.apply(this,Array.prototype.slice.call(arguments));this.id="soundcite-audio-"+clips.length;this.url=el.getAttribute("data-url");this.start=Math.floor(this.start/1e3);if(this.end!==null){this.end=Math.floor(this.end/1e3)}var audio=document.createElement("audio");audio.id=this.id;audio.setAttribute("src",this.url);audio.setAttribute("preload","true");audio_container.appendChild(audio);this.sound=$Popcorn("#"+this.id,{frameAnimation:true});this.sound.on("loadeddata",bind(function(){if(this.end===null){this.end=this.sound.duration()}this.sound.cue(this.end,bind(function(){if(this.plays){this.plays_left--;if(this.plays_left>0){this.sound.currentTime(this.start);this.play()}else{this.stop();this.sound.currentTime(this.start)}}else{this.sound.currentTime(this.start);this.play()}},this));if(!soundcite.mobile){this.sound_loaded()}},this));if(soundcite.mobile){this.sound_loaded()}else if(this.sound.readyState()>1){this.sound_loaded()}}PopcornClip.prototype=Object.create(Clip.prototype);PopcornClip.prototype.sound_position=function(){return this.sound.currentTime()};PopcornClip.prototype.pause_sound=function(){this.sound.pause();this.sound.off("timeupdate")};PopcornClip.prototype.stop_sound=function(){this.sound.pause();this.sound.off("timeupdate")};PopcornClip.prototype._play_sound=function(){removeClass(this.el,"soundcite-loading soundcite-play");addClass(this.el,"soundcite-pause");this.sound.play();this.playing=true;this.sound.on("timeupdate",bind(this.track_progress,this))};PopcornClip.prototype.play_sound=function(){var pos=this.sound.roundTime();if(pos=this.end){this.sound.on("seeked",bind(function(){this.sound.off("seeked");this._play_sound()},this));this.sound.currentTime(this.start)}else{this._play_sound()}};PopcornClip.prototype.play=function(){if(soundcite.mobile){removeClass(this.el,"soundcite-play");addClass(this.el,"soundcite-loading");if(this.sound.readyState()>1){this.play_sound()}else{this.sound.on("canplaythrough",bind(function(){this.play_sound()},this));document.getElementById(this.id).load()}}else{this.play_sound()}};for(var i=0;i