Skip to content

Commit

Permalink
deploy: 3db3bac
Browse files Browse the repository at this point in the history
  • Loading branch information
jomey committed Aug 1, 2023
1 parent cc480c9 commit 0443b4b
Show file tree
Hide file tree
Showing 34 changed files with 173 additions and 117 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 6808011296b6d9332757de519830d03a
config: 74a2f59abac509f183685eeab0297dad
tags: 645f666f9bcd5a90fca523b33c5a78b7
2 changes: 1 addition & 1 deletion CoC.html
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ <h2>Reporting a violation<a class="headerlink" href="#reporting-a-violation" tit
mode: "python"
},
kernelOptions: {
kernelName: "python3",
name: "python3",
path: "./."
},
predefinedOutput: true
Expand Down
3 changes: 2 additions & 1 deletion _static/copybutton.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ div.highlight {
position: relative;
}

.highlight:hover button.copybtn {
/* Show the copybutton */
.highlight:hover button.copybtn, button.copybtn.success {
opacity: 1;
}

Expand Down
44 changes: 36 additions & 8 deletions _static/copybutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const messages = {
},
'fr' : {
'copy': 'Copier',
'copy_to_clipboard': 'Copié dans le presse-papier',
'copy_to_clipboard': 'Copier dans le presse-papier',
'copy_success': 'Copié !',
'copy_failure': 'Échec de la copie',
},
Expand Down Expand Up @@ -102,18 +102,25 @@ const clearSelection = () => {
}
}

// Changes tooltip text for two seconds, then changes it back
// Changes tooltip text for a moment, then changes it back
// We want the timeout of our `success` class to be a bit shorter than the
// tooltip and icon change, so that we can hide the icon before changing back.
var timeoutIcon = 2000;
var timeoutSuccessClass = 1500;

const temporarilyChangeTooltip = (el, oldText, newText) => {
el.setAttribute('data-tooltip', newText)
el.classList.add('success')
setTimeout(() => el.setAttribute('data-tooltip', oldText), 2000)
setTimeout(() => el.classList.remove('success'), 2000)
// Remove success a little bit sooner than we change the tooltip
// So that we can use CSS to hide the copybutton first
setTimeout(() => el.classList.remove('success'), timeoutSuccessClass)
setTimeout(() => el.setAttribute('data-tooltip', oldText), timeoutIcon)
}

// Changes the copy button icon for two seconds, then changes it back
const temporarilyChangeIcon = (el) => {
el.innerHTML = iconCheck;
setTimeout(() => {el.innerHTML = iconCopy}, 2000)
setTimeout(() => {el.innerHTML = iconCopy}, timeoutIcon)
}

const addCopyButtonToCodeCells = () => {
Expand All @@ -125,7 +132,8 @@ const addCopyButtonToCodeCells = () => {
}

// Add copybuttons to all of our code cells
const codeCells = document.querySelectorAll('div.highlight pre')
const COPYBUTTON_SELECTOR = 'div.highlight pre';
const codeCells = document.querySelectorAll(COPYBUTTON_SELECTOR)
codeCells.forEach((codeCell, index) => {
const id = codeCellId(index)
codeCell.setAttribute('id', id)
Expand All @@ -141,10 +149,25 @@ function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
}

/**
* Removes excluded text from a Node.
*
* @param {Node} target Node to filter.
* @param {string} exclude CSS selector of nodes to exclude.
* @returns {DOMString} Text from `target` with text removed.
*/
function filterText(target, exclude) {
const clone = target.cloneNode(true); // clone as to not modify the live DOM
if (exclude) {
// remove excluded nodes
clone.querySelectorAll(exclude).forEach(node => node.remove());
}
return clone.innerText;
}

// Callback when a copy button is clicked. Will be passed the node that was clicked
// should then grab the text and replace pieces of text that shouldn't be used in output
function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true, copyEmptyLines = true, lineContinuationChar = "", hereDocDelim = "") {

var regexp;
var match;

Expand Down Expand Up @@ -199,7 +222,12 @@ function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onl

var copyTargetText = (trigger) => {
var target = document.querySelector(trigger.attributes['data-clipboard-target'].value);
return formatCopyText(target.innerText, '', false, true, true, true, '', '')

// get filtered text
let exclude = '.linenos';

let text = filterText(target, exclude);
return formatCopyText(text, '', false, true, true, true, '', '')
}

// Initialize with a callback so we can modify the text before copy
Expand Down
17 changes: 16 additions & 1 deletion _static/copybutton_funcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,25 @@ function escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
}

/**
* Removes excluded text from a Node.
*
* @param {Node} target Node to filter.
* @param {string} exclude CSS selector of nodes to exclude.
* @returns {DOMString} Text from `target` with text removed.
*/
export function filterText(target, exclude) {
const clone = target.cloneNode(true); // clone as to not modify the live DOM
if (exclude) {
// remove excluded nodes
clone.querySelectorAll(exclude).forEach(node => node.remove());
}
return clone.innerText;
}

// Callback when a copy button is clicked. Will be passed the node that was clicked
// should then grab the text and replace pieces of text that shouldn't be used in output
export function formatCopyText(textContent, copybuttonPromptText, isRegexp = false, onlyCopyPromptLines = true, removePrompts = true, copyEmptyLines = true, lineContinuationChar = "", hereDocDelim = "") {

var regexp;
var match;

Expand Down
2 changes: 1 addition & 1 deletion application.html
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ <h2>Selection Criteria<a class="headerlink" href="#selection-criteria" title="Pe
mode: "python"
},
kernelOptions: {
kernelName: "python3",
name: "python3",
path: "./."
},
predefinedOutput: true
Expand Down
39 changes: 15 additions & 24 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,25 +72,20 @@ const spy = new Gumshoe('#navigation a', { offset: yOffset });
// variables for time units
const counterDiv = document.getElementById("countdown-box");
const endDate = new Date(counterDiv.getAttribute('data-start-date'));
let days, hours, minutes, seconds;

function createCountdownSpans(className) {
const span = document.createElement("SPAN");
span.className = className;
return span
}

function updateCountdownHTML(span, value, unit) {
span.innerHTML = '<span class="number">' + value + '</span>' +
'<span class="unit">' + unit + '</span>';
}

function timeLeft() {
// find the amount of "seconds" between now and target
const currentDate = new Date().getTime();
return (endDate - currentDate) / 1000;
}

function updateCounterNumberSpan(counterDiv, selector, number) {
const span = counterDiv.querySelectorAll(selector + ' span.number')[0];
if (span.innerHTML !== number.toString()) {
span.innerHTML = number;
}
}

function updateCounter(counterDiv) {
let secondsLeft = timeLeft()
let days = parseInt(secondsLeft / 86400);
Expand All @@ -103,28 +98,21 @@ function updateCounter(counterDiv) {
let seconds = parseInt(secondsLeft % 60);

// format countdown string + set tag value.
updateCountdownHTML(counterDiv.getElementsByClassName('days')[0], days, 'Days');
updateCountdownHTML(counterDiv.getElementsByClassName('hours')[0], hours, 'Hours');
updateCountdownHTML(counterDiv.getElementsByClassName('minutes')[0], minutes, 'Mins');
updateCountdownHTML(counterDiv.getElementsByClassName('secs')[0], seconds, 'Secs');
updateCounterNumberSpan(counterDiv, 'span.days', days);
updateCounterNumberSpan(counterDiv, 'span.hours', hours);
updateCounterNumberSpan(counterDiv, 'span.minutes', minutes);
updateCounterNumberSpan(counterDiv, 'span.seconds', seconds);
}

function startCountDown(counterDiv) {
if (timeLeft() > 0) {
counterDiv.appendChild(createCountdownSpans('days'))
counterDiv.appendChild(createCountdownSpans('hours'))
counterDiv.appendChild(createCountdownSpans('minutes'))
counterDiv.appendChild(createCountdownSpans('secs'))

// update the counter every 1 second
setInterval(updateCounter, 1000, counterDiv);
} else {
document.getElementById("countdown-intro").remove();
}
}

startCountDown(counterDiv);

/* === Select schedule tab of current day */

function today(){
Expand All @@ -141,4 +129,7 @@ function selectScheduleDay() {
if(tab) { tab.click() }
}

selectScheduleDay()
document.addEventListener("DOMContentLoaded", () => {
selectScheduleDay()
startCountDown(counterDiv);
});
35 changes: 28 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ <h4 class="mb-3 text-center">
</h4>
<a class="btn btn-primary btn-lg mb-3 mx-2"
href="#"
target="_blank"

>
A sample link
</a>
Expand All @@ -162,7 +162,28 @@ <h4 class="countdown-intro mb-2 text-center">
</h4>
<div id="countdown-box"
class="countdown-box"
data-start-date="XX Month/2022">
data-start-date="2024-08-07T08:30:00-07:00">

<span class="days">
<span class="number"></span>
<span class="unit">Days</span>
</span>

<span class="hours">
<span class="number"></span>
<span class="unit">Hours</span>
</span>

<span class="minutes">
<span class="number"></span>
<span class="unit">Minutes</span>
</span>

<span class="seconds">
<span class="number"></span>
<span class="unit">Seconds</span>
</span>

</div>
</div>
</div>
Expand Down Expand Up @@ -1833,11 +1854,11 @@ <h3 class="section-heading text-center mb-3">Our Sponsors</h3>
</footer>

<!-- Javascript -->
<script src="assets/plugins/popper.min.js"></script>
<script src="assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/plugins/smoothscroll.min.js"></script>
<script src="assets/plugins/gumshoe/gumshoe.polyfills.min.js"></script>
<script src="assets/js/main.js"></script>
<script defer src="assets/plugins/popper.min.js"></script>
<script defer src="assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<script defer src="assets/plugins/smoothscroll.min.js"></script>
<script defer src="assets/plugins/gumshoe/gumshoe.polyfills.min.js"></script>
<script defer src="assets/js/main.js"></script>

</body>

Expand Down
2 changes: 1 addition & 1 deletion intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ <h1>Welcome to uwhackweek!<a class="headerlink" href="#welcome-to-uwhackweek" ti
mode: "python"
},
kernelOptions: {
kernelName: "python3",
name: "python3",
path: "./."
},
predefinedOutput: true
Expand Down
2 changes: 1 addition & 1 deletion logistics.html
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ <h2>Travel<a class="headerlink" href="#travel" title="Permalink to this headline
mode: "python"
},
kernelOptions: {
kernelName: "python3",
name: "python3",
path: "./."
},
predefinedOutput: true
Expand Down
2 changes: 1 addition & 1 deletion mission.html
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ <h1>Hackweek Mission<a class="headerlink" href="#hackweek-mission" title="Permal
mode: "python"
},
kernelOptions: {
kernelName: "python3",
name: "python3",
path: "./."
},
predefinedOutput: true
Expand Down
6 changes: 3 additions & 3 deletions preliminary/checklist/earthdata.html
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,8 @@ <h2>Configure programmatic access to NASA servers<a class="headerlink" href="#co
<p>In the below command, replace <code class="docutils literal notranslate"><span class="pre">EARTHDATA_LOGIN</span></code> with your personal username and
<code class="docutils literal notranslate"><span class="pre">EARTHDATA_PASSWORD</span></code> with your password</p>
</div>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="nb">echo</span> <span class="s1">&#39;machine urs.earthdata.nasa.gov login &quot;EARTHDATA_LOGIN&quot; password &quot;EARTHDATA_PASSWORD&quot;&#39;</span> &gt; ~/.netrc
chmod <span class="m">0600</span> ~/.netrc
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="nb">echo</span><span class="w"> </span><span class="s1">&#39;machine urs.earthdata.nasa.gov login &quot;EARTHDATA_LOGIN&quot; password &quot;EARTHDATA_PASSWORD&quot;&#39;</span><span class="w"> </span>&gt;<span class="w"> </span>~/.netrc
chmod<span class="w"> </span><span class="m">0600</span><span class="w"> </span>~/.netrc
</pre></div>
</div>
</section>
Expand All @@ -640,7 +640,7 @@ <h2>Configure programmatic access to NASA servers<a class="headerlink" href="#co
mode: "python"
},
kernelOptions: {
kernelName: "python3",
name: "python3",
path: "./preliminary/checklist"
},
predefinedOutput: true
Expand Down
Loading

0 comments on commit 0443b4b

Please sign in to comment.