Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
StoneCypher committed Oct 16, 2017
1 parent 7df77bc commit 36cd824
Show file tree
Hide file tree
Showing 10 changed files with 1,695 additions and 799 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
@@ -1,7 +1,15 @@
* [[`7df77bc142`](https://github.com/StoneCypher/jssm/commit/7df77bc142)] - merge from upstream (John Haugeland)
* [[`881bba05e3`](https://github.com/StoneCypher/jssm/commit/881bba05e3)] - Add explicitly unknown license; fixed all of the badges except cdnjs (John Haugeland)
* [[`d0f8c67305`](https://github.com/StoneCypher/jssm/commit/d0f8c67305)] - shield should point to master (John Haugeland)
* [[`4bf74b912c`](https://github.com/StoneCypher/jssm/commit/4bf74b912c)] - progress (John Haugeland)
* [[`8cc09988f8`](https://github.com/StoneCypher/jssm/commit/8cc09988f8)] - underway (John Haugeland)
* [[`de4e409ee8`](https://github.com/StoneCypher/jssm/commit/de4e409ee8)] - basics of a test set (John Haugeland)
* [[`6fdf7aa4c2`](https://github.com/StoneCypher/jssm/commit/6fdf7aa4c2)] - intermediate - compiling but tests failing (John Haugeland)
* [[`f529dd05d8`](https://github.com/StoneCypher/jssm/commit/f529dd05d8)] - Update README.md (John Haugeland)
* [[`17b9d18031`](https://github.com/StoneCypher/jssm/commit/17b9d18031)] - Update README.md (John Haugeland)
* [[`90dc197268`](https://github.com/StoneCypher/jssm/commit/90dc197268)] - General housecleaning. Fix the audit line finally (John Haugeland)
* [[`f0144e00d5`](https://github.com/StoneCypher/jssm/commit/f0144e00d5)] - Update README.md (John Haugeland)
* [[`d08392bc34`](https://github.com/StoneCypher/jssm/commit/d08392bc34)] - Update README.md (John Haugeland)
* [[`9277224ca2`](https://github.com/StoneCypher/jssm/commit/9277224ca2)] - notes on testing (John Haugeland)
* [[`9c9d052ee8`](https://github.com/StoneCypher/jssm/commit/9c9d052ee8)] - grammar for named ordered lists and for nominated states (John Haugeland)
* [[`ed78d312f1`](https://github.com/StoneCypher/jssm/commit/ed78d312f1)] - package bumps (John Haugeland)
Expand Down
454 changes: 318 additions & 136 deletions docs/lib/assets/anchor.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/lib/assets/bass.css
Expand Up @@ -457,6 +457,7 @@
min-height:0;
}
.flex-none{ -webkit-box-flex:0; -webkit-flex:none; -ms-flex:none; flex:none }
.fs0{ flex-shrink: 0 }

.order-0{ -webkit-box-ordinal-group:1; -webkit-order:0; -ms-flex-order:0; order:0 }
.order-1{ -webkit-box-ordinal-group:2; -webkit-order:1; -ms-flex-order:1; order:1 }
Expand Down
113 changes: 86 additions & 27 deletions docs/lib/assets/site.js
@@ -1,5 +1,3 @@
'use strict';

/* global anchors */

// add anchor links to headers
Expand All @@ -9,7 +7,7 @@ anchors.add('h3');
// Filter UI
var tocElements = document.getElementById('toc').getElementsByTagName('li');

document.getElementById('filter-input').addEventListener('keyup', function (e) {
document.getElementById('filter-input').addEventListener('keyup', function(e) {
var i, element, children;

// enter key
Expand All @@ -24,14 +22,14 @@ document.getElementById('filter-input').addEventListener('keyup', function (e) {
}
}

var match = function () {
var match = function() {
return true;
};

var value = this.value.toLowerCase();

if (!value.match(/^\s*$/)) {
match = function (element) {
match = function(element) {
var html = element.firstChild.innerHTML;
return html && html.toLowerCase().indexOf(value) !== -1;
};
Expand All @@ -48,23 +46,6 @@ document.getElementById('filter-input').addEventListener('keyup', function (e) {
}
});

var toggles = document.getElementsByClassName('toggle-step-sibling');
for (var i = 0; i < toggles.length; i++) {
toggles[i].addEventListener('click', toggleStepSibling);
}

function toggleStepSibling() {
var stepSibling = this.parentNode.parentNode.parentNode.getElementsByClassName('toggle-target')[0];
var klass = 'display-none';
if (stepSibling.classList.contains(klass)) {
stepSibling.classList.remove(klass);
stepSibling.innerHTML = '▾';
} else {
stepSibling.classList.add(klass);
stepSibling.innerHTML = '▸';
}
}

var items = document.getElementsByClassName('toggle-sibling');
for (var j = 0; j < items.length; j++) {
items[j].addEventListener('click', toggleSibling);
Expand All @@ -87,17 +68,33 @@ function showHashTarget(targetId) {
if (targetId) {
var hashTarget = document.getElementById(targetId);
// new target is hidden
if (hashTarget && hashTarget.offsetHeight === 0 && hashTarget.parentNode.parentNode.classList.contains('display-none')) {
if (
hashTarget &&
hashTarget.offsetHeight === 0 &&
hashTarget.parentNode.parentNode.classList.contains('display-none')
) {
hashTarget.parentNode.parentNode.classList.remove('display-none');
}
}
}

window.addEventListener('hashchange', function () {
function scrollIntoView(targetId) {
// Only scroll to element if we don't have a stored scroll position.
if (targetId && !history.state) {
var hashTarget = document.getElementById(targetId);
if (hashTarget) {
hashTarget.scrollIntoView();
}
}
}

function gotoCurrentTarget() {
showHashTarget(location.hash.substring(1));
});
scrollIntoView(location.hash.substring(1));
}

showHashTarget(location.hash.substring(1));
window.addEventListener('hashchange', gotoCurrentTarget);
gotoCurrentTarget();

var toclinks = document.getElementsByClassName('pre-open');
for (var k = 0; k < toclinks.length; k++) {
Expand All @@ -106,4 +103,66 @@ for (var k = 0; k < toclinks.length; k++) {

function preOpen() {
showHashTarget(this.hash.substring(1));
}
}

var split_left = document.querySelector('#split-left');
var split_right = document.querySelector('#split-right');
var split_parent = split_left.parentNode;
var cw_with_sb = split_left.clientWidth;
split_left.style.overflow = 'hidden';
var cw_without_sb = split_left.clientWidth;
split_left.style.overflow = '';

Split(['#split-left', '#split-right'], {
elementStyle: function(dimension, size, gutterSize) {
return {
'flex-basis': 'calc(' + size + '% - ' + gutterSize + 'px)'
};
},
gutterStyle: function(dimension, gutterSize) {
return {
'flex-basis': gutterSize + 'px'
};
},
gutterSize: 20,
sizes: [33, 67]
});

// Chrome doesn't remember scroll position properly so do it ourselves.
// Also works on Firefox and Edge.

function updateState() {
history.replaceState(
{
left_top: split_left.scrollTop,
right_top: split_right.scrollTop
},
document.title
);
}

function loadState(ev) {
if (ev) {
// Edge doesn't replace change history.state on popstate.
history.replaceState(ev.state, document.title);
}
if (history.state) {
split_left.scrollTop = history.state.left_top;
split_right.scrollTop = history.state.right_top;
}
}

window.addEventListener('load', function() {
// Restore after Firefox scrolls to hash.
setTimeout(function() {
loadState();
// Update with initial scroll position.
updateState();
// Update scroll positions only after we've loaded because Firefox
// emits an initial scroll event with 0.
split_left.addEventListener('scroll', updateState);
split_right.addEventListener('scroll', updateState);
}, 1);
});

window.addEventListener('popstate', loadState);
15 changes: 15 additions & 0 deletions docs/lib/assets/split.css
@@ -0,0 +1,15 @@
.gutter {
background-color: #f5f5f5;
background-repeat: no-repeat;
background-position: 50%;
}

.gutter.gutter-vertical {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFAQMAAABo7865AAAABlBMVEVHcEzMzMzyAv2sAAAAAXRSTlMAQObYZgAAABBJREFUeF5jOAMEEAIEEFwAn3kMwcB6I2AAAAAASUVORK5CYII=');
cursor: ns-resize;
}

.gutter.gutter-horizontal {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
cursor: ew-resize;
}

0 comments on commit 36cd824

Please sign in to comment.