Merge remote-tracking branches 'ohaitch/redo-pull-161', 'joemfb/moon-error', 'knubie/master' and 'ohaitch/tree-64612ca'

Errata for merge a6e1b08
More user-friendly +moon experience
talk@d1ecb80
tree@64612ca
This commit is contained in:
Raymond Pasco 2016-06-26 00:38:42 -04:00
6 changed files with 274 additions and 179 deletions

View File

@ -10,8 +10,10 @@
$~
$~
==
:- %noun
?> =(1 (met 5 p.bec))
:- %tang :_ ~ :- %leaf
=+ ran=(clan p.bec)
?: ?=({?($earl $pawn)} ran)
"can't create a moon from a {?:(?=($earl ran) "moon" "comet")}"
=+ mon=(mix (lsh 5 1 (end 5 1 eny)) p.bec)
=+ tic=.^(@ /a/(scot %p p.bec)/tick/(scot %da now)/(scot %p mon))
"moon: {<`@p`mon>}; ticket: {<`@p`tic>}"

View File

@ -50,14 +50,14 @@
:: "codemirror/4.3.0/mode/markdown/markdown.min.js");
;* ?. nopack.dbg
:_ ~
;script(type "text/javascript", src "{?.(aut "" "/~~")}".
"/~/at/===/web/pack/js/tree-urb.js");
:: "/~/at/===/web/pack/js/tree-hoon-urb.js");
;script(type "text/javascript", src "{?.(aut "" "/~~/~/at")}".
"/===/web/pack/js/tree-urb.js");
:: "/===/web/pack/js/tree-hoon-urb.js");
;=
:: ;script(type "text/javascript", src "/===/web/lib/js/hoon.js");
;script(type "text/javascript", src "/===/web/tree/main.js");
;script(type "text/javascript", src "{?.(aut "" "/~~")}".
"/~/at/===/web/lib/js/urb.js");
;script(type "text/javascript", src "{?.(aut "" "/~~/~/at")}".
"/===/web/lib/js/urb.js");
==
;link(type "application/rss+xml", rel "alternate", href "{(spud tub)}.rss-xml");
==

View File

@ -68,14 +68,12 @@ div.gram.same:hover div.meta {
white-space: nowrap; }
.speech {
margin-left: 1.875rem;
white-space: nowrap; }
margin-left: 1.875rem; }
.exp {
font-family: 'scp';
font-size: .9rem; }
.exp .speech {
white-space: nowrap;
max-width: 100%;
overflow-x: scroll; }
.exp .speech > span {

View File

@ -511,7 +511,7 @@ module.exports = recl({
},{"../util.coffee":15,"./MemberComponent.coffee":4,"classnames":16}],6:[function(require,module,exports){
var INFINITE, Infinite, MESSAGE_HEIGHT_FIRST, MESSAGE_HEIGHT_FIRST_MARGIN_TOP, MESSAGE_HEIGHT_SAME, Message, MessageActions, MessageStore, StationActions, StationStore, div, recl, util;
var FONT_SIZE, INFINITE, Infinite, MESSAGE_HEIGHT_FIRST, MESSAGE_HEIGHT_FIRST_MARGIN_TOP, MESSAGE_HEIGHT_SAME, Message, MessageActions, MessageStore, StationActions, StationStore, div, recl, util;
util = require('../util.coffee');
@ -533,12 +533,14 @@ Message = require('./MessageComponent.coffee');
INFINITE = true;
MESSAGE_HEIGHT_FIRST = 54;
MESSAGE_HEIGHT_FIRST_MARGIN_TOP = 36;
MESSAGE_HEIGHT_SAME = 27;
MESSAGE_HEIGHT_FIRST = 56 - MESSAGE_HEIGHT_SAME;
MESSAGE_HEIGHT_FIRST_MARGIN_TOP = 16;
FONT_SIZE = parseInt($('body').css('font-size').match(/(\d*)px/)[1]);
module.exports = recl({
displayName: "Messages",
pageSize: 200,
@ -630,7 +632,12 @@ module.exports = recl({
}
this.focused = true;
$(window).on('blur', this._blur);
return $(window).on('focus', this._focus);
$(window).on('focus', this._focus);
return $(window).on('resize', _.debounce((function(_this) {
return function() {
return _this.forceUpdate();
};
})(this), 250));
},
componentWillUpdate: function(props, state) {
return this.scrollBottom = $(document).height() - ($(window).scrollTop() + window.innerHeight);
@ -678,7 +685,7 @@ module.exports = recl({
return StationActions.setAudience(audi);
},
render: function() {
var _messages, body, lastIndex, lastSaid, messageHeights, messages, ref, station;
var _messages, body, canvas, context, lastIndex, lastSaid, messageHeights, messages, ref, speechLength, station;
station = this.state.station;
messages = this.sortedMessages(this.state.messages);
this.last = messages[messages.length - 1];
@ -696,18 +703,46 @@ module.exports = recl({
lastIndex = this.lastSeen ? messages.indexOf(this.lastSeen) + 1 : null;
lastSaid = null;
messageHeights = [];
canvas = document.createElement('canvas');
context = canvas.getContext('2d');
speechLength = $('.grams').width() - (FONT_SIZE * 1.875);
_messages = messages.map((function(_this) {
return function(message, index) {
var height, marginTop, nowSaid, sameAs, speech;
var height, lineNums, marginTop, nowSaid, sameAs, speech, speechArr;
nowSaid = [message.ship, _.keys(message.thought.audience)];
sameAs = _.isEqual(lastSaid, nowSaid);
lastSaid = nowSaid;
lineNums = 1;
speechArr = [];
context.font = FONT_SIZE + 'px bau';
if (message.thought.statement.speech.lin != null) {
speechArr = message.thought.statement.speech.lin.txt.split(/(\s|-)/);
} else if (message.thought.statement.speech.url != null) {
speechArr = message.thought.statement.speech.url.txt.split(/(\s|-)/);
} else if (message.thought.statement.speech.fat != null) {
context.font = (FONT_SIZE * 0.9) + 'px scp';
speechArr = message.thought.statement.speech.fat.taf.exp.txt.split(/(\s|-)/);
}
_.reduce(_.tail(speechArr), function(base, word) {
if (context.measureText(base + word).width > speechLength) {
lineNums += 1;
if (word === ' ') {
return '';
} else if (word === '-') {
return _.head(base.split(/\s|-/).reverse()) + word;
} else {
return word;
}
} else {
return base + word;
}
}, _.head(speechArr));
if (INFINITE) {
if (sameAs) {
height = MESSAGE_HEIGHT_SAME;
height = MESSAGE_HEIGHT_SAME * lineNums;
marginTop = 0;
} else {
height = MESSAGE_HEIGHT_FIRST;
height = MESSAGE_HEIGHT_FIRST + (MESSAGE_HEIGHT_SAME * lineNums);
marginTop = MESSAGE_HEIGHT_FIRST_MARGIN_TOP;
}
} else {

View File

@ -98,31 +98,49 @@ div.logo.inverse:before {
content: "\25D0"; }
@media (min-width: 768px) {
.menu,
.ctrl {
width: 180px; }
width: 180px;
max-width: 180px; }
.ctrl.open,
.ctrl:hover {
max-width: 360px;
min-width: 180px;
width: auto; } }
width: auto; }
.menu.depth-1 {
margin-left: 180px; }
.menu.depth-2 {
margin-left: 360px; } }
@media (min-width: 992px) {
.menu,
.ctrl {
width: 235px; }
width: 235px;
max-width: 235px; }
.ctrl.open,
.ctrl:hover {
max-width: 470px;
min-width: 235px;
width: auto; } }
width: auto; }
.menu.depth-1 {
margin-left: 235px; }
.menu.depth-2 {
margin-left: 470px; } }
@media (min-width: 1200px) {
.menu,
.ctrl {
width: 285px; }
width: 285px;
max-width: 285px; }
.ctrl.open,
.ctrl:hover {
max-width: 570px;
min-width: 285px;
width: auto; } }
width: auto; }
.menu.depth-1 {
margin-left: 285px; }
.menu.depth-2 {
margin-left: 570px; } }
#head .loading {
display: none; }
@ -203,9 +221,11 @@ div.logo.inverse:before {
border: 0;
text-transform: none; }
.ctrl.navbar {
max-width: none; }
.ctrl.navbar.open,
.ctrl.navbar:hover {
max-width: none;
min-width: none; }
@media (max-width: 991px) {
@ -632,6 +652,11 @@ ol > li:before {
color: #000;
padding: 0; }
.body[data-path*='/docs'] .head,
.body[data-path^='/work'] .head {
margin-bottom: 4rem;
padding-left: 0; }
.body[data-path*='/docs'] .book h2,
.body[data-path^='/work'] .book h2 {
color: #B1B7BD; }
@ -1312,7 +1337,7 @@ ol > li:before {
color: #0500F0; }
.sections h1:first-of-type {
padding-bottom: 0; }
padding-bottom: 1rem; }
.sections li h1 {
font-size: 1.2rem; }
@ -1335,9 +1360,6 @@ ol > li:before {
margin-bottom: 3rem;
float: none; }
.sections .kids > div p {
font-weight: 500; }
.sections hr {
display: none; }

View File

@ -1,10 +1,12 @@
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var TreeDispatcher, TreePersistence;
var TreeDispatcher, TreePersistence, _initialLoad;
TreeDispatcher = require('../dispatcher/Dispatcher.coffee');
TreePersistence = require('../persistence/TreePersistence.coffee');
_initialLoad = true;
module.exports = {
loadPath: function(path, data) {
return TreeDispatcher.handleServerAction({
@ -21,6 +23,7 @@ module.exports = {
});
},
clearData: function() {
_initialLoad = false;
TreePersistence.refresh();
return TreeDispatcher.handleServerAction({
type: "clearData"
@ -30,6 +33,9 @@ module.exports = {
if (query == null) {
return;
}
if (_initialLoad) {
console.warn("Requesting data druing initial page load", JSON.stringify(path), query);
}
if (path.slice(-1) === "/") {
path = path.slice(0, -1);
}
@ -50,6 +56,9 @@ module.exports = {
obj
));
},
registerScriptElement: function(elem) {
return TreePersistence.waspElem(elem);
},
addVirtual: function(components) {
return TreeDispatcher.handleViewAction({
type: "addVirtual",
@ -61,7 +70,13 @@ module.exports = {
pax: pax,
sup: sup,
txt: txt
}, "talk-comment");
}, "talk-comment", "talk", (function(_this) {
return function(err, res) {
if (err == null) {
return _this.clearData();
}
};
})(this));
},
setPlanInfo: function(arg) {
var loc, who;
@ -72,6 +87,7 @@ module.exports = {
}, "write-plan-info", "hood");
},
setCurr: function(path) {
_initialLoad = false;
return TreeDispatcher.handleViewAction({
type: "setCurr",
path: path
@ -281,7 +297,7 @@ module.exports = function(queries, Child, load) {
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":27,"../utils/util.coffee":29,"./LoadComponent.coffee":12}],3:[function(require,module,exports){
var Comments, TreeActions, TreeStore, a, clas, div, extras, h1, h3, img, input, load, p, query, reactify, recl, ref, rele, util;
var Comments, TreeActions, TreeStore, a, clas, div, extras, h1, h3, img, input, load, name, p, query, reactify, recl, ref, rele, util;
clas = require('classnames');
@ -299,6 +315,12 @@ Comments = require('./CommentsComponent.coffee');
util = require('../utils/util.coffee');
name = function(displayName, component) {
return _.extend(component, {
displayName: displayName
});
};
recl = React.createClass;
rele = React.createElement;
@ -306,77 +328,66 @@ rele = React.createElement;
ref = React.DOM, div = ref.div, h1 = ref.h1, h3 = ref.h3, p = ref.p, img = ref.img, a = ref.a, input = ref.input;
extras = {
spam: recl({
displayName: "Spam",
render: function() {
if (document.location.hostname !== 'urbit.org') {
return div({});
spam: name("Spam", function() {
if (document.location.hostname !== 'urbit.org') {
return div({});
}
return div({
className: 'spam'
}, a({
href: "http://urbit.org#sign-up"
}, "Sign up"), " for our newsletter.");
}),
logo: name("Logo", function(arg) {
var color, src;
color = arg.color;
if (color === "white" || color === "black") {
src = "//media.urbit.org/logo/logo-" + color + "-100x100.png";
}
return a({
href: "http://urbit.org",
style: {
border: "none"
}
return div({
className: 'spam'
}, a({
href: "http://urbit.org#sign-up"
}, "Sign up"), " for our newsletter.");
}
}, img({
src: src,
className: "logo first"
}));
}),
logo: recl({
displayName: "Logo",
render: function() {
var color, src;
color = this.props.color;
if (color === "white" || color === "black") {
src = "//media.urbit.org/logo/logo-" + color + "-100x100.png";
}
return a({
href: "http://urbit.org",
style: {
border: "none"
}
}, img({
src: src,
className: "logo first"
}));
}
date: name("Date", function(arg) {
var date;
date = arg.date;
return div({
className: 'date'
}, date);
}),
date: recl({
displayName: "Date",
render: function() {
return div({
className: 'date'
}, this.props.date);
}
title: name("Title", function(arg) {
var title;
title = arg.title;
return h1({
className: 'title'
}, title);
}),
title: recl({
displayName: "Title",
render: function() {
return h1({
className: 'title'
}, this.props.title);
}
image: name("Image", function(arg) {
var image;
image = arg.image;
return img({
src: image
});
}),
image: recl({
displayName: "Image",
render: function() {
return img({
src: this.props.image
}, "");
}
preview: name("Preview", function(arg) {
var preview;
preview = arg.preview;
return p({
className: 'preview'
}, preview);
}),
preview: recl({
displayName: "Preview",
render: function() {
return p({
className: 'preview'
}, this.props.preview);
}
}),
author: recl({
displayName: "Author",
render: function() {
return h3({
className: 'author'
}, this.props.author);
}
author: name("Author", function(arg) {
var author;
author = arg.author;
return h3({
className: 'author'
}, author);
}),
next: query({
path: 't',
@ -385,61 +396,56 @@ extras = {
head: 'r',
meta: 'j'
}
}, recl({
displayName: "Next",
render: function() {
var curr, index, keys, next, ref1;
curr = this.props.kids[this.props.curr];
if (curr != null ? (ref1 = curr.meta) != null ? ref1.next : void 0 : void 0) {
keys = util.getKeys(this.props.kids);
if (keys.length > 1) {
index = keys.indexOf(this.props.curr);
next = index + 1;
if (next === keys.length) {
next = 0;
}
next = keys[next];
next = this.props.kids[next];
if (next) {
return div({
className: "link-next"
}, a({
href: this.props.path + "/" + next.name
}, "Next: " + next.meta.title));
}
}, name("Next", function(arg) {
var curr, index, keys, kids, next, path, ref1, ref2;
curr = arg.curr, path = arg.path, kids = arg.kids;
if ((ref1 = kids[curr]) != null ? (ref2 = ref1.meta) != null ? ref2.next : void 0 : void 0) {
keys = util.getKeys(kids);
if (keys.length > 1) {
index = keys.indexOf(curr);
next = index + 1;
if (next === keys.length) {
next = 0;
}
next = keys[next];
next = kids[next];
if (next) {
return div({
className: "link-next"
}, a({
href: path + "/" + next.name
}, "Next: " + next.meta.title));
}
}
return div({}, "");
}
return div({}, "");
})),
comments: Comments,
footer: recl({
displayName: "Footer",
render: function() {
var containerClas, footerClas;
containerClas = clas({
footer: true,
container: this.props.container === 'false'
});
footerClas = clas({
'col-md-12': this.props.container === 'false'
});
return div({
className: containerClas,
key: 'footer-container'
footer: name("Footer", function(arg) {
var container, containerClas, footerClas;
container = arg.container;
containerClas = clas({
footer: true,
container: container === 'false'
});
footerClas = clas({
'col-md-12': container === 'false'
});
return div({
className: containerClas,
key: 'footer-container'
}, [
div({
className: footerClas,
key: 'footer-inner'
}, [
div({
className: footerClas,
key: 'footer-inner'
}, [
"This page was made by Urbit. Feedback: ", a({
href: "mailto:urbit@urbit.org"
}, "urbit@urbit.org"), " ", a({
href: "https://twitter.com/urbit_"
}, "@urbit_")
])
]);
}
"This page was made by Urbit. Feedback: ", a({
href: "mailto:urbit@urbit.org"
}, "urbit@urbit.org"), " ", a({
href: "https://twitter.com/urbit_"
}, "@urbit_")
])
]);
})
};
@ -563,7 +569,7 @@ module.exports = recl({
},{}],5:[function(require,module,exports){
var Comment, Ship, TreeActions, a, clas, code, div, form, h2, img, input, load, p, query, reactify, recl, ref, rele, textarea, util;
var Comment, DEFER_USER, Ship, TreeActions, a, clas, code, div, form, h2, img, input, load, p, query, reactify, recl, ref, rele, textarea, util;
clas = require('classnames');
@ -585,6 +591,8 @@ rele = React.createElement;
ref = React.DOM, div = ref.div, p = ref.p, h2 = ref.h2, img = ref.img, a = ref.a, form = ref.form, textarea = ref.textarea, input = ref.input, code = ref.code;
DEFER_USER = true;
Comment = function(arg) {
var body, loading, ref1, time, user;
time = arg.time, user = arg.user, body = arg.body, loading = (ref1 = arg.loading) != null ? ref1 : false;
@ -614,15 +622,23 @@ module.exports = query({
};
},
componentDidMount: function() {
return urb.init((function(_this) {
return function() {
return _this.setState({
user: urb.user
});
};
})(this));
if (!DEFER_USER) {
return urb.init((function(_this) {
return function() {
return _this.setState({
user: urb.user
});
};
})(this));
}
},
componentDidUpdate: function(_props) {
var ref1;
if (urb.user && !this.state.user) {
this.setState({
user: (ref1 = urb.user) != null ? ref1 : ""
});
}
if (this.props.comt.length > _props.comt.length) {
return this.setState({
loading: null
@ -860,22 +876,27 @@ module.exports = recl({
},{}],9:[function(require,module,exports){
var div, recl;
var div, name, recl;
recl = React.createClass;
name = function(displayName, component) {
return _.extend(component, {
displayName: displayName
});
};
div = React.DOM.div;
module.exports = recl({
displayName: "ImagePanel",
render: function() {
return div({
className: "image-container",
style: {
backgroundImage: "url('" + this.props.src + "')"
}
});
}
module.exports = name("ImagePanel", function(arg) {
var src;
src = arg.src;
return div({
className: "image-container",
style: {
backgroundImage: "url('" + src + "')"
}
});
});
@ -1261,7 +1282,9 @@ module.exports = recl({
})(this));
},
componentWillUnmount: function() {
return TreeActions.clearNav();
return setTimeout((function() {
return TreeActions.clearNav();
}), 0);
},
render: function() {
return div({
@ -1502,6 +1525,9 @@ module.exports = query({
if (href && !/^https?:\/\//i.test(href)) {
e.preventDefault();
url = new URL(this.href);
if (!/http/.test(url.protocol)) {
return;
}
if (urb.util.basepath("", url.pathname) !== urb.util.basepath("", document.location.pathname)) {
document.location = this.href;
return;
@ -1972,12 +1998,14 @@ module.exports = _.extend(reactify, {
},{"../stores/TreeStore.coffee":27,"./LoadComponent.coffee":12}],18:[function(require,module,exports){
var appendNext, recl, rele, waitingScripts;
var TreeActions, appendNext, recl, rele, waitingScripts;
recl = React.createClass;
rele = React.createElement;
TreeActions = require('../actions/TreeActions.coffee');
waitingScripts = null;
appendNext = function() {
@ -1997,7 +2025,7 @@ module.exports = recl({
var s;
s = document.createElement('script');
_.assign(s, this.props);
urb.waspElem(s);
TreeActions.registerScriptElement(s);
s.onload = appendNext;
this.js = s;
if (waitingScripts != null) {
@ -2018,7 +2046,7 @@ module.exports = recl({
});
},{}],19:[function(require,module,exports){
},{"../actions/TreeActions.coffee":1}],19:[function(require,module,exports){
var a, div, input, query, reactify, recl, ref,
slice = [].slice;
@ -2518,19 +2546,21 @@ module.exports = {
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 = [];
if (urb.wasp != null) {
dep = urb.getXHRWasp(xhr);
urb.sources[dep] = url;
waspWait.push(dep);
if (_.isEmpty(pending)) {
waspWait.map(urb.waspData);
waspWait = [];
}
}
if (cb) {
return cb(null, data);
}
});
},
put: function(data, mark, appl) {
put: function(data, mark, appl, cb) {
if (appl == null) {
appl = /[a-z]*/.exec(mark)[0];
}
@ -2538,9 +2568,14 @@ module.exports = {
return urb.send(data, {
mark: mark,
appl: appl
});
}, cb);
});
},
waspElem: function(a) {
if (urb.wasp != null) {
return urb.waspElem(a);
}
},
encode: function(obj) {
var _encode, delim;
delim = function(n) {
@ -2896,6 +2931,9 @@ scroll = {
},
scroll: function() {
var ct, dy, top;
if (!((this.$n != null) && (this.$d != null))) {
return;
}
this.cs = $(window).scrollTop();
if (this.w > 767) {
this.clearNav();