From bacc213671cc6664092210540b51bc15cc1b4703 Mon Sep 17 00:00:00 2001 From: Dan Haffey Date: Sun, 24 Jul 2016 18:02:52 -0700 Subject: [PATCH 1/6] :time app, measures time between poke and subsequent wakeup --- app/time.hoon | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 app/time.hoon diff --git a/app/time.hoon b/app/time.hoon new file mode 100644 index 000000000..e99bffc35 --- /dev/null +++ b/app/time.hoon @@ -0,0 +1,19 @@ +:: +:::: /hoon/time/app + :: +/? 310 +|% +++ card {$wait wire @da} +-- +|_ {bowl $~} +++ poke-noun + |= * + :_ +>.$ :_ ~ + [ost %wait /(scot %da now) +(now)] +:: +++ wake + |= {wir/wire $~} + ?> ?=({@ $~} wir) + ~& [%took `@dr`(sub now (slav %da i.wir))] + [~ +>.$] +-- From 4699a39992d431add8845935a566698078e84621 Mon Sep 17 00:00:00 2001 From: Joseph Bryan Date: Fri, 29 Jul 2016 04:45:30 -0400 Subject: [PATCH 2/6] fixes meta-. to capture to whitespace instead of by word --- lib/drum.hoon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/drum.hoon b/lib/drum.hoon index 399a1f43b..58e9de8ca 100644 --- a/lib/drum.hoon +++ b/lib/drum.hoon @@ -848,9 +848,9 @@ $dot ?. &(?=(^ old.hit) ?=(^ -.old.hit)) ta-bel =+ old=`(list @c)`-.old.hit - =+ b=(bwrd (lent old) old nedg) + =+ b=(bwrd (lent old) old nace) %- ta-hom(ris ~) - (ta-cat pos.inp (slag b old)) + (ta-cat pos.inp (slag (add b =(0 b)) old)) :: $bac ?: =(0 pos.inp) ta-bel From 920caadb935b3b39e365861cfb1aba90fc00e3e6 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Fri, 5 Aug 2016 17:28:50 -0700 Subject: [PATCH 3/6] permit whitespace in urb.py -d --- app/dojo.hoon | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/dojo.hoon b/app/dojo.hoon index 6ca33e4aa..bba248de9 100644 --- a/app/dojo.hoon +++ b/app/dojo.hoon @@ -1000,7 +1000,10 @@ :- num ?- -.source.com $data [%ex %sand %t data.source.com] - $dojo (rash command.source.com dp-build:dp) + $dojo + %+ rash command.source.com + (ifix [(punt gap) (punt gap)] dp-build:dp) + :: $clay :- %ex :* %wish From e0e22a26bf806b50b305f0daec3474f5ccdb2a8c Mon Sep 17 00:00:00 2001 From: Fang Date: Mon, 8 Aug 2016 15:47:24 +0200 Subject: [PATCH 4/6] The trigger for a "clear" is now "backspace on empty line" rather than "backspace at start of line". --- lib/drum.hoon | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/drum.hoon b/lib/drum.hoon index 399a1f43b..7a627a8e1 100644 --- a/lib/drum.hoon +++ b/lib/drum.hoon @@ -617,8 +617,10 @@ ta-bel .(str.u.ris (scag (dec (lent str.u.ris)) str.u.ris)) ?: =(0 pos.inp) - (ta-act %clr ~) - :: .(+> (se-blit %bel ~)) + ?: =(0 (lent buf.say.inp)) + (ta-act %clr ~) + :: .(+> (se-blit %bel ~)) + ta-bel =+ pre=(dec pos.inp) (ta-hom %del pre) :: From 389dffc7438b1e323f9065e98f61f495d698df8d Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Mon, 8 Aug 2016 13:40:37 -0700 Subject: [PATCH 5/6] tree@db321b0 and talk@11013ec --- web/talk/main.css | 5 + web/tree/main.css | 10 ++ web/tree/main.js | 264 +++++++++++++++++++++------------------------- 3 files changed, 133 insertions(+), 146 deletions(-) diff --git a/web/talk/main.css b/web/talk/main.css index 9e7d6d43d..1f6c76818 100644 --- a/web/talk/main.css +++ b/web/talk/main.css @@ -51,6 +51,10 @@ div.input.valid-false { .grams .meta:hover { overflow: visible; } +.gram:hover { + z-index: 2; + position: relative; } + div.gram.first:first-of-type { margin-top: 0; } @@ -242,6 +246,7 @@ input.action:focus:-ms-input-placeholder { .length { display: inline-block; + width: 120px; margin-left: 2rem; line-height: 2rem; font-family: 'bau'; diff --git a/web/tree/main.css b/web/tree/main.css index 282c903e9..74cb5cca5 100644 --- a/web/tree/main.css +++ b/web/tree/main.css @@ -1319,6 +1319,11 @@ ol > li:before { line-height: 1rem; margin-bottom: 1rem; } +@media (max-width: 767px) { + .urbit .post h1.title, + .urbit .post img { + max-width: 100%; } } + .urbit.post .person { margin-bottom: 2rem; } .urbit.post .person:first-of-type { @@ -1341,6 +1346,11 @@ ol > li:before { .urbit .post img { max-width: 32rem; } +@media (max-width: 767px) { + .urbit .post img { + max-width: 100%; + border-width: 6px; } } + .urbit.post .preview { display: none; } diff --git a/web/tree/main.js b/web/tree/main.js index 099a3675c..ef84302a9 100644 --- a/web/tree/main.js +++ b/web/tree/main.js @@ -1,5 +1,5 @@ (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 3) { - str += " " + d[3] + ":" + d[4] + ":" + d[5]; - } - _k = Number(new Date(str)); - keyed[_k] = k; - } - } else { - if (((ref3 = v.meta) != null ? ref3.sort : void 0) == null) { - sorted = false; - } - keyed[Number((ref4 = v.meta) != null ? ref4.sort : void 0)] = k; - } - } - if (sorted === false) { - keyed = _.keys(this.props.kids); - } - keys = _.keys(keyed).sort(); - if (this.props.sortBy === 'date') { - keys.reverse(); - } + var body, elem, kidClas, kids, kidsClas; + kids = util.sortKids(this.props.kids, this.props.sortBy); kidsClas = clas({ kids: true }, this.props.className); @@ -984,29 +960,28 @@ module.exports = query({ className: kidsClas, key: "kids" }, (function() { - var i, len, ref5, results; + var i, len, results; results = []; - for (i = 0, len = keys.length; i < len; i++) { - k = keys[i]; - elem = (ref5 = this.props.kids[keyed[k]]) != null ? ref5 : ""; - body = reactify(elem.body, k, { + for (i = 0, len = kids.length; i < len; i++) { + elem = kids[i]; + body = reactify(elem.body, null, { basePath: elem.path }); results.push([ div({ - key: keyed[k], - id: keyed[k], + key: elem.name, + id: elem.name, className: kidClas }, body), hr({}) ]); } return results; - }).call(this)); + })()); } })); -},{"./Async.coffee":2,"./Reactify.coffee":18,"classnames":31}],11:[function(require,module,exports){ +},{"../utils/util.coffee":30,"./Async.coffee":2,"./Reactify.coffee":18,"classnames":31}],11:[function(require,module,exports){ var a, clas, div, h1, li, pre, query, reactify, recl, ref, span, ul, util; clas = require('classnames'); @@ -1039,7 +1014,7 @@ module.exports = query({ }, this.props.dataType, { "default": this.props['data-source'] === 'default' }, this.props.className); - kids = this.renderList(this.sortedKids()); + kids = this.renderList(util.sortKids(this.props.kids, this.props.sortBy)); if (!(kids.length === 0 && (this.props.is404 != null))) { return ul({ className: k @@ -1051,48 +1026,15 @@ module.exports = query({ className: 'red inverse block error' }, 'Error: Empty path'), div({}, pre({}, this.props.path), span({}, 'is either empty or does not exist.'))); }, - sortedKids: function() { - var _k, _keys, k, ref1, ref2, ref3, ref4, sorted, v; - if (this.props.sortBy === 'bump') { - return _.sortBy(this.props.kids, function(arg) { - var bump, name; - bump = arg.bump, name = arg.name; - return bump || name; - }).reverse(); - } - sorted = true; - _keys = []; - ref1 = this.props.kids; - for (k in ref1) { - v = ref1[k]; - if (this.props.sortBy) { - if (this.props.sortBy === 'date') { - if (((ref2 = v.meta) != null ? ref2.date : void 0) == null) { - return _.keys(this.props.kids).sort(); - } - _k = Number(v.meta.date.slice(1).replace(/\./g, "")); - _keys[_k] = k; - } - } else { - if (((ref3 = v.meta) != null ? ref3.sort : void 0) == null) { - return _.keys(this.props.kids).sort(); - } - _keys[Number((ref4 = v.meta) != null ? ref4.sort : void 0)] = k; - } - } - if (this.props.sortBy === 'date') { - _keys.reverse(); - } - return _.values(_keys); - }, renderList: function(elems) { - var _date, author, cont, date, elem, href, i, image, item, len, linked, node, parts, path, preview, ref1, results, title; + var _date, author, cont, date, elem, href, i, image, item, len, linked, meta, node, parts, path, preview, ref1, results, title; results = []; for (i = 0, len = elems.length; i < len; i++) { elem = elems[i]; item = elem.name; + meta = (ref1 = elem.meta) != null ? ref1 : {}; path = this.props.path + "/" + item; - if (elem.meta.hide != null) { + if (meta.hide != null) { continue; } href = util.basepath(path); @@ -1102,12 +1044,12 @@ module.exports = query({ if (this.props.childIsFragment != null) { href = (util.basepath(this.props.path)) + "#" + item; } - if (elem.meta.link) { - href = elem.meta.link; + if (meta.link) { + href = meta.link; } parts = []; title = null; - if ((ref1 = elem.meta) != null ? ref1.title : void 0) { + if (meta.title) { if (this.props.dataType === 'post') { title = { gn: 'a', @@ -1120,7 +1062,7 @@ module.exports = query({ ga: { className: 'title' }, - c: [elem.meta.title] + c: [meta.title] } ] }; @@ -1130,7 +1072,7 @@ module.exports = query({ ga: { className: 'title' }, - c: [elem.meta.title] + c: [meta.title] }; } } @@ -1147,7 +1089,7 @@ module.exports = query({ }; } if (!this.props.titlesOnly) { - _date = elem.meta.date; + _date = meta.date; if (!_date || _date.length === 0) { _date = ""; } @@ -1163,7 +1105,7 @@ module.exports = query({ parts.push(title); if (!this.props.titlesOnly) { if (this.props.dataType === 'post') { - if (elem.meta.image) { + if (meta.image) { image = { gn: 'a', ga: { @@ -1173,7 +1115,7 @@ module.exports = query({ { gn: 'img', ga: { - src: elem.meta.image + src: meta.image } } ] @@ -1182,16 +1124,16 @@ module.exports = query({ } } if (this.props.dataPreview) { - if (!elem.meta.preview) { + if (!meta.preview) { parts.push.apply(parts, elem.snip.c.slice(0, 2)); } else { - if (elem.meta.preview) { + if (meta.preview) { preview = { gn: 'p', ga: { className: 'preview' }, - c: [elem.meta.preview] + c: [meta.preview] }; } else { preview = elem.snip; @@ -1200,13 +1142,13 @@ module.exports = query({ } } if (this.props.dataType === 'post') { - if (elem.meta.author) { + if (meta.author) { author = { gn: 'h3', ga: { className: 'author' }, - c: [elem.meta.author] + c: [meta.author] }; parts.push(author); } @@ -2370,10 +2312,11 @@ recl = React.createClass; ref = React.DOM, ul = ref.ul, li = ref.li, a = ref.a; module.exports = query({ - path: 't', kids: { head: 'r', - meta: 'j' + meta: 'j', + name: 't', + path: 't' } }, recl({ displayName: "Siblings", @@ -2389,8 +2332,8 @@ module.exports = query({ }); }, render: function() { - var keys, navClas; - keys = util.getKeys(this.props.kids); + var kids, navClas; + kids = util.sortKids(this.props.kids); navClas = { nav: true, 'col-md-12': this.props.meta.navmode === 'navbar' @@ -2401,32 +2344,30 @@ module.exports = query({ navClas = clas(navClas); return ul({ className: navClas - }, keys.map((function(_this) { - return function(key) { - var className, data, head, href, selected; - selected = key === _this.props.curr; + }, kids.map((function(_this) { + return function(arg) { + var className, head, href, meta, name, path, ref1, selected; + head = arg.head, meta = (ref1 = arg.meta) != null ? ref1 : {}, name = arg.name, path = arg.path; + selected = name === _this.props.curr; if (_this.props.meta.navselect) { - selected = key === _this.props.meta.navselect; - } - href = util.basepath(_this.props.path + "/" + key); - data = _this.props.kids[key]; - if (data.meta) { - head = data.meta.title; + selected = name === _this.props.meta.navselect; } + href = util.basepath(path); + head = meta.title; if (head == null) { - head = _this.toText(data.head); + head = _this.toText(head); } - head || (head = key); + head || (head = name); className = clas({ "nav-item": true, selected: selected }); - if (data.meta.sibsclass) { - className += " " + clas(data.meta.sibsclass.split(",")); + if (meta.sibsclass) { + className += " " + clas(meta.sibsclass.split(",")); } return li({ className: className, - key: key + key: name }, a({ className: "nav-link", href: href, @@ -3092,11 +3033,6 @@ scroll = { } this.cs = $(window).scrollTop(); this.cwh = window.innerHeight; - if ((this.ls - this.cs) < 0 && this.cwh !== this.lwh) { - console.log('current scroll: ' + this.cs); - console.log('last scroll: ' + this.ls); - console.log('window.innerHeight: ' + window.innerHeight); - } if (this.w > 767) { this.clearNav(); } @@ -3208,24 +3144,64 @@ module.exports = { return ship.slice(0, 6) + "_" + ship.slice(-6); } }, - getKeys: function(kids) { - var k, keys, ref, ref1, ref2, sorted, v; - sorted = true; - keys = []; - for (k in kids) { - v = kids[k]; - if ((ref = v.meta) != null ? ref.hide : void 0) { - continue; + dateFromAtom: function(date) { + var __, day, hor, min, mon, ref, sec, str, yer; + ref = date.slice(1).split("."), yer = ref[0], mon = ref[1], day = ref[2], __ = ref[3], hor = ref[4], min = ref[5], sec = ref[6]; + if (day != null) { + str = yer + "-" + mon + "-" + day; + if (hor != null) { + str += " " + hor + ":" + min + ":" + sec; } - if (((ref1 = v.meta) != null ? ref1.sort : void 0) == null) { - sorted = false; - } - keys[Number((ref2 = v.meta) != null ? ref2.sort : void 0)] = k; + return new Date(str); } - if (sorted !== true) { - return keys = _.keys(kids).sort(); - } else { - return keys = _.values(keys); + }, + getKeys: function(kids) { + return _.map(this.sortKids(kids), 'name'); + }, + sortKids: function(kids, sortBy) { + var _k, _kids, date, k, ref, ref1, v; + if (sortBy == null) { + sortBy = null; + } + kids = _.filter(kids, function(arg) { + var meta; + meta = arg.meta; + return !(meta != null ? meta.hide : void 0); + }); + switch (sortBy) { + case 'bump': + return _.sortBy(kids, function(arg) { + var bump, name; + bump = arg.bump, name = arg.name; + return bump || name; + }).reverse(); + case 'date': + _kids = []; + for (k in kids) { + v = kids[k]; + if (((ref = v.meta) != null ? ref.date : void 0) == null) { + return _.sortBy(kids, 'name'); + } + date = this.dateFromAtom(v.meta.date); + if (date == null) { + return _.sortBy(kids, 'name'); + } + _k = Number(new Date(date)); + _kids[_k] = v; + } + return _.values(_kids).reverse(); + case null: + _kids = []; + for (k in kids) { + v = kids[k]; + if (((ref1 = v.meta) != null ? ref1.sort : void 0) == null) { + return _.sortBy(kids, 'name'); + } + _kids[Number(v.meta.sort)] = v; + } + return _.values(_kids); + default: + throw new Error("Unknown sort: " + sortBy); } } }; @@ -3341,12 +3317,8 @@ EventEmitter.prototype.emit = function(type) { er = arguments[1]; if (er instanceof Error) { throw er; // Unhandled 'error' event - } else { - // At least give some kind of context to the user - var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); - err.context = er; - throw err; } + throw TypeError('Uncaught, unspecified "error" event.'); } } From 177c54cdd5d6f13ac808c16eaea15aa343f82002 Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Mon, 8 Aug 2016 14:04:59 -0700 Subject: [PATCH 6/6] re revert talk merge --- web/talk/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/talk/main.js b/web/talk/main.js index 056bdebde..495c0b1de 100644 --- a/web/talk/main.js +++ b/web/talk/main.js @@ -286,8 +286,8 @@ ref = React.DOM, div = ref.div, input = ref.input, textarea = ref.textarea; module.exports = recl({ displayName: "Member", render: function() { - var k, ship; - ship = this.props.ship; + var k, ref1, ship; + ship = (ref1 = this.props.ship) != null ? ref1 : ""; k = "ship"; if (this.props.presence) { k += " " + this.props.presence;