mirror of
https://github.com/urbit/shrub.git
synced 2024-12-12 18:48:14 +03:00
Merge remote-tracking branch 'galenwp/frontend-fixes'
Close some more talk/tree frontend bugs.
This commit is contained in:
commit
378e4587c2
@ -71,7 +71,23 @@ div.gram.same:hover div.meta {
|
||||
|
||||
.exp {
|
||||
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 {
|
||||
background-color: transparent; }
|
||||
|
@ -531,7 +531,7 @@ module.exports = recl({
|
||||
return window.util.scrollToBottom();
|
||||
},
|
||||
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);
|
||||
scrollTop = $window.scrollTop();
|
||||
old = {};
|
||||
@ -541,19 +541,19 @@ module.exports = recl({
|
||||
old[key] = true;
|
||||
}
|
||||
lastSaid = null;
|
||||
if (window.innerHeight + scrollTop > $('.writing').offset().top) {
|
||||
ref1 = state.messages;
|
||||
for (j = 0, len1 = ref1.length; j < len1; j++) {
|
||||
message = ref1[j];
|
||||
nowSaid = [message.ship, message.thought.audience];
|
||||
if (!old[message.key]) {
|
||||
sameAs = _.isEqual(lastSaid, nowSaid);
|
||||
scrollTop += sameAs ? MESSAGE_HEIGHT_SAME : MESSAGE_HEIGHT_FIRST;
|
||||
}
|
||||
lastSaid = nowSaid;
|
||||
ref1 = state.messages;
|
||||
results = [];
|
||||
for (j = 0, len1 = ref1.length; j < len1; j++) {
|
||||
message = ref1[j];
|
||||
nowSaid = [message.ship, message.thought.audience];
|
||||
if (!old[message.key]) {
|
||||
sameAs = _.isEqual(lastSaid, nowSaid);
|
||||
scrollTop += sameAs ? MESSAGE_HEIGHT_SAME : MESSAGE_HEIGHT_FIRST;
|
||||
}
|
||||
return this.setOffset = scrollTop;
|
||||
lastSaid = nowSaid;
|
||||
results.push(this.setOffset = scrollTop);
|
||||
}
|
||||
return results;
|
||||
},
|
||||
componentDidUpdate: function(_props, _state) {
|
||||
var _messages, d, t;
|
||||
@ -15882,7 +15882,10 @@ var ReactDOMOption = {
|
||||
}
|
||||
});
|
||||
|
||||
nativeProps.children = content;
|
||||
if (content) {
|
||||
nativeProps.children = content;
|
||||
}
|
||||
|
||||
return nativeProps;
|
||||
}
|
||||
|
||||
@ -22051,7 +22054,7 @@ module.exports = ReactUpdates;
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = '0.14.6';
|
||||
module.exports = '0.14.7';
|
||||
},{}],121:[function(require,module,exports){
|
||||
/**
|
||||
* Copyright 2013-2015, Facebook, Inc.
|
||||
@ -23146,6 +23149,7 @@ var warning = require('fbjs/lib/warning');
|
||||
*/
|
||||
var EventInterface = {
|
||||
type: null,
|
||||
target: null,
|
||||
// currentTarget is set when dispatching; no use in copying it here
|
||||
currentTarget: emptyFunction.thatReturnsNull,
|
||||
eventPhase: null,
|
||||
@ -23179,8 +23183,6 @@ function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEvent
|
||||
this.dispatchConfig = dispatchConfig;
|
||||
this.dispatchMarker = dispatchMarker;
|
||||
this.nativeEvent = nativeEvent;
|
||||
this.target = nativeEventTarget;
|
||||
this.currentTarget = nativeEventTarget;
|
||||
|
||||
var Interface = this.constructor.Interface;
|
||||
for (var propName in Interface) {
|
||||
@ -23191,7 +23193,11 @@ function SyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEvent
|
||||
if (normalize) {
|
||||
this[propName] = normalize(nativeEvent);
|
||||
} else {
|
||||
this[propName] = nativeEvent[propName];
|
||||
if (propName === 'target') {
|
||||
this.target = nativeEventTarget;
|
||||
} else {
|
||||
this[propName] = nativeEvent[propName];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
@charset "UTF-8";
|
||||
.col-md-10.body {
|
||||
padding-left: 0; }
|
||||
padding-left: 2.8125rem; }
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.col-md-10.body {
|
||||
@ -43,26 +42,26 @@ img.logo.first {
|
||||
.loading.state-3:before {
|
||||
content: "\25D0"; }
|
||||
|
||||
#head {
|
||||
position: fixed;
|
||||
z-index: 10; }
|
||||
@media (min-width: 544px) {
|
||||
#head {
|
||||
width: 576px; } }
|
||||
@media (min-width: 768px) {
|
||||
#head {
|
||||
width: 720px; } }
|
||||
@media (min-width: 992px) {
|
||||
#head {
|
||||
width: 940px; } }
|
||||
@media (min-width: 1200px) {
|
||||
#head {
|
||||
width: 1140px; } }
|
||||
@media (min-width: 544px) {
|
||||
#head {
|
||||
width: 576px; } }
|
||||
|
||||
@media (min-width: 768px) {
|
||||
#head {
|
||||
width: 720px; } }
|
||||
|
||||
@media (min-width: 992px) {
|
||||
#head {
|
||||
width: 940px; } }
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
#head {
|
||||
width: 1140px; } }
|
||||
|
||||
#head .loading {
|
||||
display: none; }
|
||||
|
||||
@media (max-width: 767px) {
|
||||
@media (max-width: 543px) {
|
||||
#head {
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
@ -84,7 +83,9 @@ img.logo.first {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
background-color: #fff;
|
||||
max-width: 16.66667%;
|
||||
transition: max-width .2s ease-in-out;
|
||||
position: fixed;
|
||||
z-index: 100; }
|
||||
.ctrl ul.nav {
|
||||
margin-top: 2rem;
|
||||
@ -100,7 +101,8 @@ img.logo.first {
|
||||
.ctrl a.nav-link {
|
||||
letter-spacing: 1px; }
|
||||
.ctrl .selected a.nav-link {
|
||||
font-weight: 500; }
|
||||
font-weight: 500;
|
||||
letter-spacing: 0; }
|
||||
|
||||
.ctrl.open,
|
||||
.ctrl:hover {
|
||||
@ -251,9 +253,6 @@ img.logo.first {
|
||||
[data-path^='/docs'] .selected .nav-link {
|
||||
color: #02D124; }
|
||||
|
||||
[data-path^='/docs'] .nav-link {
|
||||
font-weight: 500; }
|
||||
|
||||
[data-path^='/docs'] .home {
|
||||
background-color: #0500F0;
|
||||
border-color: #0500F0; }
|
||||
@ -281,13 +280,6 @@ img.logo.first {
|
||||
margin-left: .05rem;
|
||||
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 {
|
||||
vertical-align: top;
|
||||
font-size: 1.6rem;
|
||||
@ -321,46 +313,9 @@ img.logo.first {
|
||||
line-height: 1rem;
|
||||
margin-bottom: 1rem; } }
|
||||
|
||||
.lead h1:first-of-type {
|
||||
padding-bottom: 0; }
|
||||
|
||||
.body[data-path^='/docs'] h1 {
|
||||
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 {
|
||||
0% {
|
||||
visibility: hidden; }
|
||||
@ -451,13 +406,9 @@ img.logo.first {
|
||||
.menu.open .contents {
|
||||
top: 3rem; } }
|
||||
|
||||
.list h1,
|
||||
.list h1:first-of-type {
|
||||
.list h1 {
|
||||
font-size: inherit;
|
||||
font-weight: inherit;
|
||||
padding-bottom: 0;
|
||||
margin-bottom: 0;
|
||||
line-height: 2rem; }
|
||||
font-weight: inherit; }
|
||||
|
||||
.list h1.error {
|
||||
font-size: 1.6rem;
|
||||
@ -476,64 +427,10 @@ img.logo.first {
|
||||
font-weight: 500;
|
||||
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 {
|
||||
font-size: 2rem;
|
||||
color: #0500F0; }
|
||||
|
||||
.sections h1:first-of-type {
|
||||
padding-bottom: 0; }
|
||||
|
||||
.sections li h1 {
|
||||
font-size: 1.2rem; }
|
||||
|
||||
@ -552,7 +449,6 @@ img.logo.first {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin-right: 3rem;
|
||||
margin-top: 2rem;
|
||||
min-width: 14rem;
|
||||
margin-bottom: 3rem; }
|
||||
|
||||
|
101
web/tree/main.js
101
web/tree/main.js
@ -275,9 +275,6 @@ module.exports = query({
|
||||
return $('body').on('click', 'a', function(e) {
|
||||
var href;
|
||||
href = $(this).attr('href');
|
||||
if (href[0] === "#") {
|
||||
return true;
|
||||
}
|
||||
if (href && !/^https?:\/\//i.test(href)) {
|
||||
e.preventDefault();
|
||||
if ((href != null ? href[0] : void 0) !== "/") {
|
||||
@ -304,10 +301,10 @@ module.exports = query({
|
||||
}
|
||||
href_parts[0] = next;
|
||||
if (hist !== false) {
|
||||
history.pushState({}, "", util.basepath(href_parts.join("#")));
|
||||
history.pushState({}, "", util.basepath(href_parts.join("")));
|
||||
}
|
||||
if (next !== this.props.path) {
|
||||
ReactDOM.unmountComponentAtNode($('#body')[0]);
|
||||
React.unmountComponentAtNode($('#body')[0]);
|
||||
TreeActions.setCurr(next);
|
||||
return rend(BodyComponent({}, ""), $('#body')[0]);
|
||||
}
|
||||
@ -407,7 +404,7 @@ module.exports = function(queries, Child, load) {
|
||||
};
|
||||
},
|
||||
mergeWith: function(have, fresh, _queries) {
|
||||
var got, k, kid, ref1, ref2, ref3;
|
||||
var got, k, kid, ref1, ref2, ref3, ref4;
|
||||
if (have == null) {
|
||||
have = {};
|
||||
}
|
||||
@ -427,11 +424,11 @@ module.exports = function(queries, Child, load) {
|
||||
if (fresh.kids == null) {
|
||||
got.kids = have.kids;
|
||||
} else {
|
||||
got.kids = {};
|
||||
ref2 = fresh.kids;
|
||||
for (k in ref2) {
|
||||
kid = ref2[k];
|
||||
got.kids[k] = this.mergeWith((ref3 = have.kids) != null ? ref3[k] : void 0, kid, _queries.kids);
|
||||
got.kids = (ref2 = _.clone(have.kids)) != null ? ref2 : {};
|
||||
ref3 = fresh.kids;
|
||||
for (k in ref3) {
|
||||
kid = ref3[k];
|
||||
got.kids[k] = this.mergeWith((ref4 = got.kids) != null ? ref4[k] : void 0, kid, _queries.kids);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -632,7 +629,7 @@ module.exports = query({
|
||||
})(this);
|
||||
containerClas = clas({
|
||||
"col-md-10": true,
|
||||
"col-md-offset-3": this.props.meta.anchor !== 'none',
|
||||
"col-md-offset-2": this.props.meta.anchor !== 'none',
|
||||
body: true
|
||||
});
|
||||
bodyClas = clas((ref1 = this.props.meta.layout) != null ? ref1.split(',') : void 0);
|
||||
@ -651,12 +648,6 @@ module.exports = query({
|
||||
}), 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){
|
||||
var a, clas, div, hr, li, query, reactify, recl, ref, ul;
|
||||
|
||||
clas = require('classnames');
|
||||
var a, div, hr, li, query, reactify, recl, ref, ul;
|
||||
|
||||
reactify = require('./Reactify.coffee');
|
||||
|
||||
@ -962,7 +951,11 @@ module.exports = query({
|
||||
}, recl({
|
||||
displayName: "Kids",
|
||||
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;
|
||||
keyed = {};
|
||||
ref1 = this.props.kids;
|
||||
@ -1000,12 +993,8 @@ module.exports = query({
|
||||
if (this.props.sortBy === 'date') {
|
||||
keys.reverse();
|
||||
}
|
||||
k = clas({
|
||||
kids: true
|
||||
}, this.props.className);
|
||||
return div({
|
||||
className: k,
|
||||
key: "kids"
|
||||
className: klass
|
||||
}, (function() {
|
||||
var i, len, ref5, results;
|
||||
results = [];
|
||||
@ -1014,8 +1003,7 @@ module.exports = query({
|
||||
elem = (ref5 = this.props.kids[keyed[k]]) != null ? ref5 : "";
|
||||
results.push([
|
||||
div({
|
||||
key: keyed[k],
|
||||
id: keyed[k]
|
||||
key: keyed[k]
|
||||
}, 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;
|
||||
|
||||
clas = require('classnames');
|
||||
@ -1110,12 +1098,6 @@ module.exports = query({
|
||||
continue;
|
||||
}
|
||||
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) {
|
||||
href = elem.meta.link;
|
||||
}
|
||||
@ -1658,14 +1640,9 @@ module.exports = query({
|
||||
return clearInterval(this.int);
|
||||
},
|
||||
collectHeader: function(arg) {
|
||||
var c, comp, ga, gn;
|
||||
var c, ga, gn;
|
||||
gn = arg.gn, ga = arg.ga, c = arg.c;
|
||||
if (this.props.match) {
|
||||
comp = gn === this.props.match;
|
||||
} else {
|
||||
comp = gn && gn[0] === 'h' && parseInt(gn[1]) !== NaN;
|
||||
}
|
||||
if (comp) {
|
||||
if (gn && gn[0] === 'h' && parseInt(gn[1]) !== NaN) {
|
||||
ga = _.clone(ga);
|
||||
ga.onClick = this._click(ga.id);
|
||||
delete ga.id;
|
||||
@ -1677,28 +1654,24 @@ module.exports = query({
|
||||
}
|
||||
},
|
||||
parseHeaders: function() {
|
||||
var contents, i, len, ref, ref1, v;
|
||||
var i, len, ref, ref1, v;
|
||||
if (this.props.body.c) {
|
||||
ref = this.props.body.c;
|
||||
for (i = 0, len = ref.length; i < len; i++) {
|
||||
v = ref[i];
|
||||
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 {
|
||||
gn: "div",
|
||||
ga: {
|
||||
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){
|
||||
var dedup, pending, util, waspWait;
|
||||
var dedup, util;
|
||||
|
||||
util = require('../utils/util.coffee');
|
||||
|
||||
dedup = {};
|
||||
|
||||
pending = {};
|
||||
|
||||
waspWait = [];
|
||||
|
||||
module.exports = {
|
||||
refresh: function() {
|
||||
return dedup = {};
|
||||
@ -1780,17 +1749,11 @@ module.exports = {
|
||||
return;
|
||||
}
|
||||
dedup[url] = true;
|
||||
pending[url] = true;
|
||||
return $.get(url, {}, function(data, status, xhr) {
|
||||
var dep;
|
||||
delete pending[url];
|
||||
dep = urb.getXHRWasp(xhr);
|
||||
urb.sources[dep] = url;
|
||||
waspWait.push(dep);
|
||||
if (_.isEmpty(pending)) {
|
||||
waspWait.map(urb.waspData);
|
||||
waspWait = [];
|
||||
}
|
||||
urb.waspData(dep);
|
||||
if (cb) {
|
||||
return cb(null, data);
|
||||
}
|
||||
@ -2137,10 +2100,10 @@ scroll = {
|
||||
scroll: function() {
|
||||
var ct, dy, top;
|
||||
this.cs = $(window).scrollTop();
|
||||
if (this.w > 1170) {
|
||||
if (this.w > 767) {
|
||||
this.clearNav();
|
||||
}
|
||||
if (this.w < 1170) {
|
||||
if (this.w < 767) {
|
||||
dy = this.ls - this.cs;
|
||||
this.$d.removeClass('focus');
|
||||
if (this.cs <= 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user