Merge remote-tracking branch 'galenwp/frontend-fixes'

Close some more talk/tree frontend bugs.
This commit is contained in:
Raymond Pasco 2016-02-24 10:15:47 -05:00
commit 378e4587c2
4 changed files with 95 additions and 214 deletions

View File

@ -71,7 +71,23 @@ div.gram.same:hover div.meta {
.exp { .exp {
font-family: 'scp'; font-family: 'scp';
font-size: .9rem; } font-size: .9rem;
max-height: 2rem; }
.exp .speech > span {
color: #fff;
background-color: #000;
padding: .3rem; }
.exp .fat {
max-height: 0;
transition: max-height .1s ease-in-out;
overflow: hidden; }
.exp .fat pre {
color: #fff; }
.exp:hover .fat {
max-height: 16rem;
overflow: scroll;
background-color: #000;
color: #fff; }
.gram pre { .gram pre {
background-color: transparent; } background-color: transparent; }

View File

@ -531,7 +531,7 @@ module.exports = recl({
return window.util.scrollToBottom(); return window.util.scrollToBottom();
}, },
componentWillUpdate: function(props, state) { componentWillUpdate: function(props, state) {
var $window, i, j, key, lastSaid, len, len1, message, nowSaid, old, ref, ref1, sameAs, scrollTop; var $window, i, j, key, lastSaid, len, len1, message, nowSaid, old, ref, ref1, results, sameAs, scrollTop;
$window = $(window); $window = $(window);
scrollTop = $window.scrollTop(); scrollTop = $window.scrollTop();
old = {}; old = {};
@ -541,19 +541,19 @@ module.exports = recl({
old[key] = true; old[key] = true;
} }
lastSaid = null; lastSaid = null;
if (window.innerHeight + scrollTop > $('.writing').offset().top) { ref1 = state.messages;
ref1 = state.messages; results = [];
for (j = 0, len1 = ref1.length; j < len1; j++) { for (j = 0, len1 = ref1.length; j < len1; j++) {
message = ref1[j]; message = ref1[j];
nowSaid = [message.ship, message.thought.audience]; nowSaid = [message.ship, message.thought.audience];
if (!old[message.key]) { if (!old[message.key]) {
sameAs = _.isEqual(lastSaid, nowSaid); sameAs = _.isEqual(lastSaid, nowSaid);
scrollTop += sameAs ? MESSAGE_HEIGHT_SAME : MESSAGE_HEIGHT_FIRST; scrollTop += sameAs ? MESSAGE_HEIGHT_SAME : MESSAGE_HEIGHT_FIRST;
}
lastSaid = nowSaid;
} }
return this.setOffset = scrollTop; lastSaid = nowSaid;
results.push(this.setOffset = scrollTop);
} }
return results;
}, },
componentDidUpdate: function(_props, _state) { componentDidUpdate: function(_props, _state) {
var _messages, d, t; var _messages, d, t;
@ -15882,7 +15882,10 @@ var ReactDOMOption = {
} }
}); });
nativeProps.children = content; if (content) {
nativeProps.children = content;
}
return nativeProps; return nativeProps;
} }
@ -22051,7 +22054,7 @@ module.exports = ReactUpdates;
'use strict'; 'use strict';
module.exports = '0.14.6'; module.exports = '0.14.7';
},{}],121:[function(require,module,exports){ },{}],121:[function(require,module,exports){
/** /**
* Copyright 2013-2015, Facebook, Inc. * Copyright 2013-2015, Facebook, Inc.
@ -23146,6 +23149,7 @@ var warning = require('fbjs/lib/warning');
*/ */
var EventInterface = { var EventInterface = {
type: null, type: null,
target: null,
// currentTarget is set when dispatching; no use in copying it here // currentTarget is set when dispatching; no use in copying it here
currentTarget: emptyFunction.thatReturnsNull, currentTarget: emptyFunction.thatReturnsNull,
eventPhase: null, eventPhase: null,
@ -23179,8 +23183,6 @@ function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEvent
this.dispatchConfig = dispatchConfig; this.dispatchConfig = dispatchConfig;
this.dispatchMarker = dispatchMarker; this.dispatchMarker = dispatchMarker;
this.nativeEvent = nativeEvent; this.nativeEvent = nativeEvent;
this.target = nativeEventTarget;
this.currentTarget = nativeEventTarget;
var Interface = this.constructor.Interface; var Interface = this.constructor.Interface;
for (var propName in Interface) { for (var propName in Interface) {
@ -23191,7 +23193,11 @@ function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEvent
if (normalize) { if (normalize) {
this[propName] = normalize(nativeEvent); this[propName] = normalize(nativeEvent);
} else { } else {
this[propName] = nativeEvent[propName]; if (propName === 'target') {
this.target = nativeEventTarget;
} else {
this[propName] = nativeEvent[propName];
}
} }
} }

View File

@ -1,6 +1,5 @@
@charset "UTF-8";
.col-md-10.body { .col-md-10.body {
padding-left: 0; } padding-left: 2.8125rem; }
@media (max-width: 767px) { @media (max-width: 767px) {
.col-md-10.body { .col-md-10.body {
@ -43,26 +42,26 @@ img.logo.first {
.loading.state-3:before { .loading.state-3:before {
content: "\25D0"; } content: "\25D0"; }
#head { @media (min-width: 544px) {
position: fixed; #head {
z-index: 10; } width: 576px; } }
@media (min-width: 544px) {
#head { @media (min-width: 768px) {
width: 576px; } } #head {
@media (min-width: 768px) { width: 720px; } }
#head {
width: 720px; } } @media (min-width: 992px) {
@media (min-width: 992px) { #head {
#head { width: 940px; } }
width: 940px; } }
@media (min-width: 1200px) { @media (min-width: 1200px) {
#head { #head {
width: 1140px; } } width: 1140px; } }
#head .loading { #head .loading {
display: none; } display: none; }
@media (max-width: 767px) { @media (max-width: 543px) {
#head { #head {
top: 0; top: 0;
z-index: 10; z-index: 10;
@ -84,7 +83,9 @@ img.logo.first {
padding-left: 0; padding-left: 0;
padding-right: 0; padding-right: 0;
background-color: #fff; background-color: #fff;
max-width: 16.66667%;
transition: max-width .2s ease-in-out; transition: max-width .2s ease-in-out;
position: fixed;
z-index: 100; } z-index: 100; }
.ctrl ul.nav { .ctrl ul.nav {
margin-top: 2rem; margin-top: 2rem;
@ -100,7 +101,8 @@ img.logo.first {
.ctrl a.nav-link { .ctrl a.nav-link {
letter-spacing: 1px; } letter-spacing: 1px; }
.ctrl .selected a.nav-link { .ctrl .selected a.nav-link {
font-weight: 500; } font-weight: 500;
letter-spacing: 0; }
.ctrl.open, .ctrl.open,
.ctrl:hover { .ctrl:hover {
@ -251,9 +253,6 @@ img.logo.first {
[data-path^='/docs'] .selected .nav-link { [data-path^='/docs'] .selected .nav-link {
color: #02D124; } color: #02D124; }
[data-path^='/docs'] .nav-link {
font-weight: 500; }
[data-path^='/docs'] .home { [data-path^='/docs'] .home {
background-color: #0500F0; background-color: #0500F0;
border-color: #0500F0; } border-color: #0500F0; }
@ -281,13 +280,6 @@ img.logo.first {
margin-left: .05rem; margin-left: .05rem;
font-size: 1rem; } } font-size: 1rem; } }
[data-path^='/docs/system/hoon/runes'] .nav-link {
font-family: 'scp'; }
[data-path^='/docs/system/hoon/runes'] .nav-link,
[data-path^='/docs/system/hoon/runes'] .ctrl .selected a.nav-link {
font-weight: 600; }
.app { .app {
vertical-align: top; vertical-align: top;
font-size: 1.6rem; font-size: 1.6rem;
@ -321,46 +313,9 @@ img.logo.first {
line-height: 1rem; line-height: 1rem;
margin-bottom: 1rem; } } margin-bottom: 1rem; } }
.lead h1:first-of-type {
padding-bottom: 0; }
.body[data-path^='/docs'] h1 { .body[data-path^='/docs'] h1 {
color: #0500F0; } color: #0500F0; }
.body[data-path^='/docs'] h1 code {
background-color: transparent;
color: #0500F0;
padding: 0; }
.body[data-path^='/docs'] .book h2 {
color: #B1B7BD; }
.body[data-path^='/docs'] .book h2 code {
color: #0500F0;
background-color: transparent; }
.body[data-path^='/docs'] .book h2 a {
color: #0500F0; }
.body[data-path^='/docs'] .book hr {
margin-bottom: 3rem; }
.body[data-path^='/docs/system/hoon/runes/'] h1 {
color: #B1B7BD; }
.body[data-path^='/docs/system/hoon/runes/basic'] h1 {
color: #0500F0; }
.body[data-path^='/docs/system/hoon/library/'] h3 {
font-size: 1.5rem; }
.body[data-path^='/docs/system/hoon/library/'] h2 {
font-size: 1rem; }
.body[data-path^='/docs/system/hoon/library/'] .toc h3 {
padding-top: 0;
margin-bottom: 0; }
@keyframes menu-open { @keyframes menu-open {
0% { 0% {
visibility: hidden; } visibility: hidden; }
@ -451,13 +406,9 @@ img.logo.first {
.menu.open .contents { .menu.open .contents {
top: 3rem; } } top: 3rem; } }
.list h1, .list h1 {
.list h1:first-of-type {
font-size: inherit; font-size: inherit;
font-weight: inherit; font-weight: inherit; }
padding-bottom: 0;
margin-bottom: 0;
line-height: 2rem; }
.list h1.error { .list h1.error {
font-size: 1.6rem; font-size: 1.6rem;
@ -476,64 +427,10 @@ img.logo.first {
font-weight: 500; font-weight: 500;
height: 2rem; } height: 2rem; }
.body[data-path^='/docs'] .list.runes {
margin-top: 3rem; }
.body[data-path^='/docs'] .list.runes li {
height: 3rem; }
.body[data-path^='/docs'] .list.runes a h1,
.body[data-path^='/docs'] .list.runes a div,
.body[data-path^='/docs'] .list.runes a p {
display: inline; }
.body[data-path^='/docs'] .list.runes a {
text-decoration: none; }
.body[data-path^='/docs'] .list.runes a,
.body[data-path^='/docs'] .list.runes a h1 code {
color: #000; }
.body[data-path^='/docs'] .list.runes a h1 code {
margin-right: 1rem;
background-color: transparent;
color: #0500F0; }
.body[data-path^='/docs'] .list.runes a code {
background-color: #eceeef; }
.body[data-path^='/docs'] .list.runes a code {
padding: .3rem; }
.body[data-path^='/docs'] .list.runes a:after {
content: "▶";
width: 1rem;
font-size: .6rem;
vertical-align: middle;
padding: .3rem;
padding-top: .4rem;
line-height: 1rem;
margin-left: 1rem;
background-color: #B1B7BD;
color: #fff; }
.body[data-path^='/docs'] .list.runes a:hover:after {
background-color: #0500F0; }
.kids.runes h1 {
padding-top: 3rem; }
.kids.runes h2 {
font-size: 1.5rem;
margin-bottom: 1rem; }
.kids.runes > div {
margin-top: 6rem; }
.kids.runes > hr {
display: none; }
.kids.runes > div p:first-of-type {
font-weight: 500; }
.sections h1 { .sections h1 {
font-size: 2rem; font-size: 2rem;
color: #0500F0; } color: #0500F0; }
.sections h1:first-of-type {
padding-bottom: 0; }
.sections li h1 { .sections li h1 {
font-size: 1.2rem; } font-size: 1.2rem; }
@ -552,7 +449,6 @@ img.logo.first {
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
margin-right: 3rem; margin-right: 3rem;
margin-top: 2rem;
min-width: 14rem; min-width: 14rem;
margin-bottom: 3rem; } margin-bottom: 3rem; }

View File

@ -275,9 +275,6 @@ module.exports = query({
return $('body').on('click', 'a', function(e) { return $('body').on('click', 'a', function(e) {
var href; var href;
href = $(this).attr('href'); href = $(this).attr('href');
if (href[0] === "#") {
return true;
}
if (href && !/^https?:\/\//i.test(href)) { if (href && !/^https?:\/\//i.test(href)) {
e.preventDefault(); e.preventDefault();
if ((href != null ? href[0] : void 0) !== "/") { if ((href != null ? href[0] : void 0) !== "/") {
@ -304,10 +301,10 @@ module.exports = query({
} }
href_parts[0] = next; href_parts[0] = next;
if (hist !== false) { if (hist !== false) {
history.pushState({}, "", util.basepath(href_parts.join("#"))); history.pushState({}, "", util.basepath(href_parts.join("")));
} }
if (next !== this.props.path) { if (next !== this.props.path) {
ReactDOM.unmountComponentAtNode($('#body')[0]); React.unmountComponentAtNode($('#body')[0]);
TreeActions.setCurr(next); TreeActions.setCurr(next);
return rend(BodyComponent({}, ""), $('#body')[0]); return rend(BodyComponent({}, ""), $('#body')[0]);
} }
@ -407,7 +404,7 @@ module.exports = function(queries, Child, load) {
}; };
}, },
mergeWith: function(have, fresh, _queries) { mergeWith: function(have, fresh, _queries) {
var got, k, kid, ref1, ref2, ref3; var got, k, kid, ref1, ref2, ref3, ref4;
if (have == null) { if (have == null) {
have = {}; have = {};
} }
@ -427,11 +424,11 @@ module.exports = function(queries, Child, load) {
if (fresh.kids == null) { if (fresh.kids == null) {
got.kids = have.kids; got.kids = have.kids;
} else { } else {
got.kids = {}; got.kids = (ref2 = _.clone(have.kids)) != null ? ref2 : {};
ref2 = fresh.kids; ref3 = fresh.kids;
for (k in ref2) { for (k in ref3) {
kid = ref2[k]; kid = ref3[k];
got.kids[k] = this.mergeWith((ref3 = have.kids) != null ? ref3[k] : void 0, kid, _queries.kids); got.kids[k] = this.mergeWith((ref4 = got.kids) != null ? ref4[k] : void 0, kid, _queries.kids);
} }
} }
} }
@ -632,7 +629,7 @@ module.exports = query({
})(this); })(this);
containerClas = clas({ containerClas = clas({
"col-md-10": true, "col-md-10": true,
"col-md-offset-3": this.props.meta.anchor !== 'none', "col-md-offset-2": this.props.meta.anchor !== 'none',
body: true body: true
}); });
bodyClas = clas((ref1 = this.props.meta.layout) != null ? ref1.split(',') : void 0); bodyClas = clas((ref1 = this.props.meta.layout) != null ? ref1.split(',') : void 0);
@ -651,12 +648,6 @@ module.exports = query({
}), extra('comments'), extra('footer')) }), extra('comments'), extra('footer'))
]); ]);
} }
}), recl({
render: function() {
return div({
className: "col-md-offset-3 col-md-10"
}, rele(load));
}
})); }));
@ -942,9 +933,7 @@ module.exports = recl({
},{"./Reactify.coffee":14}],10:[function(require,module,exports){ },{"./Reactify.coffee":14}],10:[function(require,module,exports){
var a, clas, div, hr, li, query, reactify, recl, ref, ul; var a, div, hr, li, query, reactify, recl, ref, ul;
clas = require('classnames');
reactify = require('./Reactify.coffee'); reactify = require('./Reactify.coffee');
@ -962,7 +951,11 @@ module.exports = query({
}, recl({ }, recl({
displayName: "Kids", displayName: "Kids",
render: function() { render: function() {
var _k, d, elem, k, keyed, keys, ref1, ref2, ref3, ref4, sorted, str, v; var _k, d, elem, k, keyed, keys, klass, ref1, ref2, ref3, ref4, sorted, str, v;
klass = "kids";
if (this.props.dataType) {
klass += " " + this.props.dataType;
}
sorted = true; sorted = true;
keyed = {}; keyed = {};
ref1 = this.props.kids; ref1 = this.props.kids;
@ -1000,12 +993,8 @@ module.exports = query({
if (this.props.sortBy === 'date') { if (this.props.sortBy === 'date') {
keys.reverse(); keys.reverse();
} }
k = clas({
kids: true
}, this.props.className);
return div({ return div({
className: k, className: klass
key: "kids"
}, (function() { }, (function() {
var i, len, ref5, results; var i, len, ref5, results;
results = []; results = [];
@ -1014,8 +1003,7 @@ module.exports = query({
elem = (ref5 = this.props.kids[keyed[k]]) != null ? ref5 : ""; elem = (ref5 = this.props.kids[keyed[k]]) != null ? ref5 : "";
results.push([ results.push([
div({ div({
key: keyed[k], key: keyed[k]
id: keyed[k]
}, reactify(elem.body)), hr({}) }, reactify(elem.body)), hr({})
]); ]);
} }
@ -1025,7 +1013,7 @@ module.exports = query({
})); }));
},{"./Async.coffee":3,"./Reactify.coffee":14,"classnames":25}],11:[function(require,module,exports){ },{"./Async.coffee":3,"./Reactify.coffee":14}],11:[function(require,module,exports){
var a, clas, div, h1, li, pre, query, reactify, recl, ref, span, ul, util; var a, clas, div, h1, li, pre, query, reactify, recl, ref, span, ul, util;
clas = require('classnames'); clas = require('classnames');
@ -1110,12 +1098,6 @@ module.exports = query({
continue; continue;
} }
href = util.basepath(path); href = util.basepath(path);
if (this.props.linkToFragments != null) {
href = "#" + item;
}
if (this.props.childIsFragment != null) {
href = (util.basepath(this.props.path)) + "#" + item;
}
if (elem.meta.link) { if (elem.meta.link) {
href = elem.meta.link; href = elem.meta.link;
} }
@ -1658,14 +1640,9 @@ module.exports = query({
return clearInterval(this.int); return clearInterval(this.int);
}, },
collectHeader: function(arg) { collectHeader: function(arg) {
var c, comp, ga, gn; var c, ga, gn;
gn = arg.gn, ga = arg.ga, c = arg.c; gn = arg.gn, ga = arg.ga, c = arg.c;
if (this.props.match) { if (gn && gn[0] === 'h' && parseInt(gn[1]) !== NaN) {
comp = gn === this.props.match;
} else {
comp = gn && gn[0] === 'h' && parseInt(gn[1]) !== NaN;
}
if (comp) {
ga = _.clone(ga); ga = _.clone(ga);
ga.onClick = this._click(ga.id); ga.onClick = this._click(ga.id);
delete ga.id; delete ga.id;
@ -1677,28 +1654,24 @@ module.exports = query({
} }
}, },
parseHeaders: function() { parseHeaders: function() {
var contents, i, len, ref, ref1, v; var i, len, ref, ref1, v;
if (this.props.body.c) { if (this.props.body.c) {
ref = this.props.body.c; ref = this.props.body.c;
for (i = 0, len = ref.length; i < len; i++) { for (i = 0, len = ref.length; i < len; i++) {
v = ref[i]; v = ref[i];
if (v.gn === 'div' && ((ref1 = v.ga) != null ? ref1.id : void 0) === "toc") { if (v.gn === 'div' && ((ref1 = v.ga) != null ? ref1.id : void 0) === "toc") {
contents = [{
gn: "h1",
ga: {
className: "t"
},
c: ["Table of contents"]
}].concat(slice.call(_.filter(v.c.map(this.collectHeader))));
if (this.props.noHeader) {
contents.shift();
}
return { return {
gn: "div", gn: "div",
ga: { ga: {
className: "toc" className: "toc"
}, },
c: contents c: [{
gn: "h1",
ga: {
className: "t"
},
c: ["Table of contents"]
}].concat(slice.call(_.filter(v.c.map(this.collectHeader))))
}; };
} }
} }
@ -1756,16 +1729,12 @@ $(function() {
},{"./actions/TreeActions.coffee":1,"./components/AnchorComponent.coffee":2,"./components/BodyComponent.coffee":4,"./components/Components.coffee":7,"./utils/scroll.coffee":23,"./utils/util.coffee":24}],21:[function(require,module,exports){ },{"./actions/TreeActions.coffee":1,"./components/AnchorComponent.coffee":2,"./components/BodyComponent.coffee":4,"./components/Components.coffee":7,"./utils/scroll.coffee":23,"./utils/util.coffee":24}],21:[function(require,module,exports){
var dedup, pending, util, waspWait; var dedup, util;
util = require('../utils/util.coffee'); util = require('../utils/util.coffee');
dedup = {}; dedup = {};
pending = {};
waspWait = [];
module.exports = { module.exports = {
refresh: function() { refresh: function() {
return dedup = {}; return dedup = {};
@ -1780,17 +1749,11 @@ module.exports = {
return; return;
} }
dedup[url] = true; dedup[url] = true;
pending[url] = true;
return $.get(url, {}, function(data, status, xhr) { return $.get(url, {}, function(data, status, xhr) {
var dep; var dep;
delete pending[url];
dep = urb.getXHRWasp(xhr); dep = urb.getXHRWasp(xhr);
urb.sources[dep] = url; urb.sources[dep] = url;
waspWait.push(dep); urb.waspData(dep);
if (_.isEmpty(pending)) {
waspWait.map(urb.waspData);
waspWait = [];
}
if (cb) { if (cb) {
return cb(null, data); return cb(null, data);
} }
@ -2137,10 +2100,10 @@ scroll = {
scroll: function() { scroll: function() {
var ct, dy, top; var ct, dy, top;
this.cs = $(window).scrollTop(); this.cs = $(window).scrollTop();
if (this.w > 1170) { if (this.w > 767) {
this.clearNav(); this.clearNav();
} }
if (this.w < 1170) { if (this.w < 767) {
dy = this.ls - this.cs; dy = this.ls - this.cs;
this.$d.removeClass('focus'); this.$d.removeClass('focus');
if (this.cs <= 0) { if (this.cs <= 0) {