From 6bd7c717f5854d706b0f69a18e8206e9e0cec839 Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Wed, 16 Sep 2015 12:10:38 -0700 Subject: [PATCH 1/9] confusion --- lib/base.css | 605 +++++++-------------------------------------------- 1 file changed, 83 insertions(+), 522 deletions(-) diff --git a/lib/base.css b/lib/base.css index 6a5cd5955b..94fae6346f 100644 --- a/lib/base.css +++ b/lib/base.css @@ -70,552 +70,113 @@ font-weight: 500; font-style: normal; } -body, -html { - font-family: "bau", "Helvetica Neue", helvetica, arial, sans-serif; +@font-face { + font-family: "scp"; + src: url("//storage.googleapis.com/urbit-extra/scp-bold.woff"); + font-weight: 600; + font-style: normal; } -code, -pre, -li:before, -.spin, -#bred a, -h3.time { - font-family: "scp", "Courier New", courier, monospace; +@font-face { + font-family: "scp"; + src: url("//storage.googleapis.com/urbit-extra/scp-black.woff"); + font-weight: 700; + font-style: normal; } -body, -html { - font-size: 18px; - font-weight: 400; - line-height: 1.6rem; - -webkit-text-size-adjust: none; -} -a { - color: #000; - text-decoration: none; - border-bottom: 2px solid #000; - display: inline-block; - line-height: 0.8rem; -} -hr { - display: inline-block; - width: 6rem; - border: 0; - border-top: 2px solid #f4f4f4; -} -h1 { - margin-top: 4rem; -} -h2, -h3 { + +html, +body { margin: 0; - margin-top: 2rem; -} -h1, -h2, -h3, -h4, -strong { - font-weight: 500; -} -h4 { - margin-bottom: 0.3rem; -} -h5 { - font-style: italic; - font-weight: 200; - margin: 0; -} -h1 code, -h2 code, -h3 code { - font-size: inherit; - padding: 0.3rem; -} -pre, -code { - font-size: 0.8rem; -} -pre { - background-color: #f5f5f5; - padding: 0.3rem; - margin-left: -0.3rem; -} -code { - line-height: 1.2rem; - background-color: #f4f4f4; - margin-top: -0.05rem; - padding: 0.2rem; - display: inline-block; -} -ul { - list-style: none; padding: 0; } -li:before { - content: "+"; - padding-right: 0.3rem; - font-size: 0.8rem; - font-weight: 600; + +html, +input, +button, +body { + font-family: "bau"; + font-size: 18px; } -#nav, -#cont { + +pre, +code, +.mono { + font-family:"scp"; +} + +#c { + width: 32rem; + margin-left: -16rem; + position: absolute; left: 50%; } -#cont { - width: 42rem; - margin-left: -21rem; - background-color: #fff; - z-index: 1; -} -#nav { - position: fixed; - top: 0rem; - width: 57rem; - padding-top: 1rem; - z-index: 0; - margin-left: -32rem; - overflow: hidden; - opacity: 0; - transition: opacity 1s ease-in-out; -} -#nav.moving { - opacity: 1; - transition: opacity 0.3s ease-in-out; -} -#nav:hover { - opacity: 1; - transition: opacity 0.3s ease-in-out; -} -#cont { - position: absolute; - top: 0; - margin-bottom: 9rem; -} -.loading { - display: inline-block; -} -.spin { - color: #fff; - padding: 0.6rem; - font-size: 0.7rem; - font-weight: 600; - letter-spacing: 0.1rem; - z-index: 3; -} -.loading > .spin { - background-color: #555; -} -#body .loading > .spin { - background-color: #000; -} -.spin.state-0:before { - content: "\2599"; -} -.spin.state-1:before { - content: "\259B"; -} -.spin.state-2:before { - content: "\259C"; -} -.spin.state-3:before { - content: "\259F"; -} -#load.load { - display: inline-block; - font-weight: 500; - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(10,10,10,0.4); - opacity: 1; - transition: opacity 1s ease-in-out; - z-index: 4; -} -img.logo { - height: 2rem; - width: 2rem; -} -h3.time { - margin-top: 0.3rem; - font-size: 0.7rem; - font-weight: 200; -} -#nav .links > div { - display: inline-block; - vertical-align: top; -} -#nav #sibs { - width: 8rem; - transition: margin-top 0.3s ease-in-out; - overflow: hidden; -} -#nav #sibs > div { - height: 20px; - margin-bottom: 4px; -} -.focus #sibs { - margin-top: 0 !important; - transition: margin-top 0.3s ease-in-out; -} -#nav a, -.list > li > a { - text-transform: uppercase; - font-size: 0.7rem; - font-weight: 200; - letter-spacing: 1px; - white-space: nowrap; -} -.list > li > a { - border-bottom: none; - margin-bottom: 0.3rem; -} -#nav a, -.list > li > a h1 { - border-bottom: 1px solid #000; - margin-right: 0.3rem; -} -#nav .active a { - font-weight: 500; - text-decoration: none; -} -#up { - padding-right: 1rem; - margin-top: -0.3rem; -} -#sides { - float: right; -} -#sides a { - margin-right: 0.6rem; -} -#nav .arow-up, -#nav .arow-next, -#nav .arow-prev { - width: 0; - height: 0; - border: 0.4rem solid transparent; -} -#nav .arow-up { - border-bottom: 0.6rem solid #000; -} -#nav .arow-next { - border-left: 0.6rem solid #000; -} -#nav .arow-prev { - border-right: 0.6rem solid #000; -} -#bred { - width: 5rem; - padding-right: 1rem; - text-align: right; - font-size: 0.6rem; - white-space: nowrap; - overflow: hidden; -} -#bred a { - text-transform: lowercase; - vertical-align: top; -} -#bred > div { - float: right; -} -#bred > div > div { - display: inline-block; - margin-top: -0.2rem; -} -#bred a, -#kids a { - margin-right: 0.3rem; -} -#bred a { - margin-left: 0.3rem; -} -.short { - width: 32rem; -} -.list h1, -.list li a > div p { - margin: 0; -} -.list li a > div, -.list li a > div p { - display: inline; -} -.list li a > div p { - margin-left: 0.3rem; -} -.list li a > div p:first-child { - margin-left: 0; -} -.list li a > div p code { - font-size: 0.7rem; - font-weight: 400; - text-transform: none; -} -.list li a h1 code { - text-transform: lowercase; - border-bottom: 1px solid #000; -} -.list li a code { - padding: 0.2rem; -} -.list h1, -.list li a > div div { - display: inline; -} -.list li a > div div { - margin-left: 0.6rem; - overflow: hidden; -} -.list h1 { - font-size: 0.7rem; -} -.list.posts .post { - margin-bottom: 2rem; -} -.list.posts .post h1 { - text-transform: none; + +h1 { font-size: 1.6rem; - line-height: 1.8rem; - margin-bottom: 1rem; - display: block; -} -.list.posts .post h2 { - font-size: 0.7rem; - font-weight: 400; - line-height: 1rem; - margin-top: 0; -} -.list.posts li.post:before { - content: ""; -} -div.root h1 { - margin-bottom: 2rem; -} -div.root .list .sub { - margin-left: 0; - margin-right: 0.6rem; -} -div.root > p { - width: 27rem; - margin-top: 2rem; -} -h2.sub { - font-size: 0.7rem; - font-weight: 400; - line-height: 1rem; - letter-spacing: 1px; - margin-top: 0; - text-transform: uppercase; -} -div.post h1 { - font-size: 2.8rem; - line-height: 4rem; - display: block; - margin-top: 1rem; - margin-bottom: 1rem; -} -div.post h2 { - line-height: 1rem; - letter-spacing: 1px; -} -div.post h2 { - margin-top: 4rem; -} -div.post h2 { - font-size: 1.2rem; font-weight: 500; } -div.post p { - font-size: 1.2rem; - line-height: 2.2rem; -} -div.post li p { - display: inline; -} -div.toc { - margin-top: 3rem; - margin-bottom: 3rem; -} -div.toc h1, -div.toc h2, -div.toc h3, -div.toc h4 { - font-weight: 400; - cursor: pointer; - text-decoration: underline; - font-size: 1.2rem; - margin-top: 0.3rem; - margin-bottom: 0.3rem; -} -div.toc h2 { + +h1:after { + content: "\2014"; margin-left: 1rem; } -div.toc h3 { - margin-left: 2rem; + +#c pre { + font-size: .6rem; + margin-top: 2rem; } -div.toc h4 { - margin-left: 3rem; + +#pass { + width: 32rem; } -div.toc h1.t { - font-weight: 500; - font-size: 2rem; - text-decoration: none; - margin-bottom: 2rem; -} -#body .CodeMirror { - font-size: 0.8rem; - line-height: 1rem; -} -#body .CodeMirror .cm-header { - font-weight: 200; -} -#body .CodeMirror-gutters { + +button { + border: .3rem solid #000; background-color: #fff; - padding-right: 1rem; - margin-left: -1rem; -} -.error { - color: #f91733; -} -.warning { - background-color: #ff3537; - padding: 1rem; - width: 18rem; - margin: 2rem 0; - color: #fff; -} -.warning a { - color: inherit; - border-color: #fff; -} -.warning h1 { font-size: 1rem; + padding: .3rem; + font-weight: 500; } -.warning h1, -.warning p { - margin: 0 0.3rem; + +.sig { + font-weight: 400; + font-size: 2rem; + display: inline; + vertical-align: middle; } -.warning.w { - width: auto; + +span#ship { + font-family: 'bau'; + font-weight: 400; + font-size: 1.2rem; + text-transform: uppercase; + letter-spacing: .1rem; + display: inline-block; + min-width: 1rem; } -@media only screen and (max-width: 1170px) { - #nav, - #nav > div, - #nav.up, - #nav.top, - #nav > .focus { - transform: translate3d(0, 0, 0); - -webkit-transform: translate3d(0, 0, 0); - } - #nav { - position: fixed; - top: 0; - opacity: 1; - width: 42rem; - margin-left: -21rem; - background-color: #fff; - z-index: 2; - } - #nav.m-down, - #nav.m-up { - position: absolute; - } - #nav.m-down.m-fixed { - position: fixed; - top: 0; - } - #nav > div { - max-height: 1rem; - overflow: hidden; - transition: max-height 0.3s ease-in-out; - } - #nav > .focus { - max-height: 40rem; - transition: max-height 0.3s ease-in-out; - } - #cont { - top: 3rem; - } + +input { + font-family: 'scp'; + display: inline; } -@media only screen and (min-width: 320px) and (max-width: 1024px) { - body, - html { - font-size: 21px; - } - #nav, - #cont { - width: 94%; - padding-left: 3%; - margin-left: 0; - } - #nav { - position: fixed; - padding-top: 0; - opacity: 1; - left: 0; - background-color: #fff; - z-index: 2; - } - #nav > div { - max-height: 1.4rem; - } - #nav > div { - padding-top: 0.6rem; - } - #nav #sibs { - width: 18rem; - } - #nav #sibs > div { - height: 20px; - line-height: 20px; - } - #nav a { - display: inline-block; - font-size: 0.7rem; - } - #nav #sides { - float: right; - } - #nav .arow-up, - #nav .arow-next, - #nav .arow-prev { - margin-right: 0; - border: 0.4rem solid transparent; - } - #nav .arow-up { - border-bottom: 0.6rem solid #000; - } - #nav .arow-next { - border-left: 0.6rem solid #000; - } - #nav .arow-prev { - margin-right: 1rem; - border-right: 0.6rem solid #000; - } - #cont { - top: 3rem; - left: 0; - padding-bottom: 9rem; - } - #cont h1:first-child { - margin-top: 0; - } - .short { - width: 100%; - } + +span#ship, +input { + border: none; + padding: .3rem; + outline: none; + border-bottom: 3px solid #555; } + @media only screen and (min-device-width: 320px) and (max-device-width: 480px) { - #nav > div { - max-height: 1.6rem; + #c { + width: 16rem; + margin-left: -8rem; } - #nav a { - font-size: 0.7rem; + #pass { + width: 16rem; } - #nav #sibs > div { - height: 20px; - line-height: 20px; + input { + -webkit-appearance: none; + border-radius: 0; } } \ No newline at end of file From 1a02d31022f5567c111788ff25f85151cc048af0 Mon Sep 17 00:00:00 2001 From: Philip C Monk Date: Mon, 28 Sep 2015 20:48:30 -0400 Subject: [PATCH 2/9] fix timers --- arvo/hoon.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index fbdaf7cda5..48cae2e745 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -10557,7 +10557,7 @@ [@ %sync *] %c [@ %term *] %d [@ %http *] %e - [@ %temp *] %t + [@ %behn *] %b == :: ++ doos :: sleep until From f2e959aff2468da176f2fd1d05cf4a6bc9098354 Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Thu, 1 Oct 2015 17:21:52 -0700 Subject: [PATCH 3/9] dates and previews in lists --- .../src/js/components/ListComponent.coffee | 20 +++++++- pub/tree/src/js/main.js | 49 ++++++++++++++----- 2 files changed, 54 insertions(+), 15 deletions(-) diff --git a/pub/tree/src/js/components/ListComponent.coffee b/pub/tree/src/js/components/ListComponent.coffee index 8aead25033..5a9236261a 100644 --- a/pub/tree/src/js/components/ListComponent.coffee +++ b/pub/tree/src/js/components/ListComponent.coffee @@ -48,13 +48,29 @@ module.exports = query { title = gn: 'h1' c: [item] + unless @props.titlesOnly # redundant? this seems familiar + if @props.dataDates + _date = elem.meta.date + if not _date or _date.length is 0 then _date = "" + date = + gn: 'div' + ga: + className: 'date' + c: [_date] + parts.push date parts.push title unless @props.titlesOnly # redundant? this seems familiar if @props.dataPreview - if @props.dataType is 'post' + if @props.dataType is 'post' and not elem.meta.preview parts.push (elem.snip.c.slice 0,2)... else - parts.push elem.snip + if elem.meta.preview + preview = + gn: 'p' + c: [elem.meta.preview] + else + preview = elem.snip + parts.push preview li {key:item,className:@props.dataType ? ""}, a {href,className:(clas preview: @props.dataPreview?)}, reactify diff --git a/pub/tree/src/js/main.js b/pub/tree/src/js/main.js index 16b13a605f..c4dc3e4099 100644 --- a/pub/tree/src/js/main.js +++ b/pub/tree/src/js/main.js @@ -610,7 +610,7 @@ module.exports = query({ }, this.renderList()); }, renderList: function() { - var _keys, elem, href, i, item, k, len, parts, path, ref1, ref2, ref3, ref4, ref5, results, sorted, title, v; + var _date, _keys, date, elem, href, i, item, k, len, parts, path, preview, ref1, ref2, ref3, ref4, ref5, results, sorted, title, v; sorted = true; _keys = []; ref1 = this.props.kids; @@ -650,13 +650,37 @@ module.exports = query({ c: [item] }; } + if (!this.props.titlesOnly) { + if (this.props.dataDates) { + _date = elem.meta.date; + if (!_date || _date.length === 0) { + _date = ""; + } + date = { + gn: 'div', + ga: { + className: 'date' + }, + c: [_date] + }; + parts.push(date); + } + } parts.push(title); if (!this.props.titlesOnly) { if (this.props.dataPreview) { - if (this.props.dataType === 'post') { + if (this.props.dataType === 'post' && !elem.meta.preview) { parts.push.apply(parts, elem.snip.c.slice(0, 2)); } else { - parts.push(elem.snip); + if (elem.meta.preview) { + preview = { + gn: 'p', + c: [elem.meta.preview] + }; + } else { + preview = elem.snip; + } + parts.push(preview); } } } @@ -1228,12 +1252,14 @@ $(function() { Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ +/* global define */ (function () { 'use strict'; - function classNames () { + var hasOwn = {}.hasOwnProperty; + function classNames () { var classes = ''; for (var i = 0; i < arguments.length; i++) { @@ -1242,15 +1268,13 @@ $(function() { var argType = typeof arg; - if ('string' === argType || 'number' === argType) { + if (argType === 'string' || argType === 'number') { classes += ' ' + arg; - } else if (Array.isArray(arg)) { classes += ' ' + classNames.apply(null, arg); - - } else if ('object' === argType) { + } else if (argType === 'object') { for (var key in arg) { - if (arg.hasOwnProperty(key) && arg[key]) { + if (hasOwn.call(arg, key) && arg[key]) { classes += ' ' + key; } } @@ -1262,15 +1286,14 @@ $(function() { if (typeof module !== 'undefined' && module.exports) { module.exports = classNames; - } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd){ - // AMD. Register as an anonymous module. - define(function () { + } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) { + // register as 'classnames', consistent with npm package name + define('classnames', function () { return classNames; }); } else { window.classNames = classNames; } - }()); },{}],17:[function(require,module,exports){ From eb7a01354d93b0fd1da4fde76f40c16a2a6f72b8 Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Fri, 2 Oct 2015 15:25:01 -0700 Subject: [PATCH 4/9] sort by date, almost --- .../src/js/components/ListComponent.coffee | 12 ++++-- pub/tree/src/js/main.js | 37 +++++++------------ 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/pub/tree/src/js/components/ListComponent.coffee b/pub/tree/src/js/components/ListComponent.coffee index 5a9236261a..0fec7f7684 100644 --- a/pub/tree/src/js/components/ListComponent.coffee +++ b/pub/tree/src/js/components/ListComponent.coffee @@ -26,9 +26,15 @@ module.exports = query { # check if kids all have a sort meta tag sorted = true _keys = [] - for k,v of @props.kids - if not v.meta?.sort? then sorted = false - _keys[Number(v.meta?.sort)] = k + if not @props.sortBy + for k,v of @props.kids + if not v.meta?.sort? then sorted = false + _keys[Number(v.meta?.sort)] = k + else + sorted = true + _keys = _.keys _.sortBy _.clone(@props.kids),(kid) -> + Number kid.meta.date.slice(1).replace /\./g,"" + _keys.reverse() if sorted isnt true _keys = _.keys(@props.kids).sort() if @props.dataType is 'post' then _keys=_keys.reverse() diff --git a/pub/tree/src/js/main.js b/pub/tree/src/js/main.js index 4c9a6b1f28..01220016a6 100644 --- a/pub/tree/src/js/main.js +++ b/pub/tree/src/js/main.js @@ -35,7 +35,6 @@ module.exports = { }; - },{"../dispatcher/Dispatcher.coffee":14,"../persistence/TreePersistence.coffee":20}],2:[function(require,module,exports){ var BodyComponent, CLICK, Links, TreeActions, TreeStore, a, clas, div, query, reactify, recl, ref; @@ -289,7 +288,6 @@ module.exports = query({ })); - },{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":21,"./Async.coffee":3,"./BodyComponent.coffee":4,"./Reactify.coffee":11,"classnames":16}],3:[function(require,module,exports){ var TreeActions, TreeStore, _load, code, div, recl, ref, span; @@ -393,7 +391,6 @@ module.exports = function(queries, Child, load) { }; - },{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":21,"./LoadComponent.coffee":10}],4:[function(require,module,exports){ var div, query, reactify, recl; @@ -419,7 +416,6 @@ module.exports = query({ })); - },{"./Async.coffee":3,"./Reactify.coffee":11}],5:[function(require,module,exports){ var div, recl, ref, textarea; @@ -443,7 +439,6 @@ module.exports = recl({ }); - },{}],6:[function(require,module,exports){ var div, recl; @@ -466,7 +461,6 @@ module.exports = { }; - },{"./CodeMirror.coffee":5,"./EmailComponent.coffee":7,"./KidsComponent.coffee":8,"./ListComponent.coffee":9,"./SearchComponent.coffee":12,"./TocComponent.coffee":13}],7:[function(require,module,exports){ var button, div, input, p, reactify, recl, ref; @@ -547,7 +541,6 @@ module.exports = recl({ }); - },{"./Reactify.coffee":11}],8:[function(require,module,exports){ var a, div, hr, li, query, reactify, recl, ref, ul; @@ -587,7 +580,6 @@ module.exports = query({ })); - },{"./Async.coffee":3,"./Reactify.coffee":11}],9:[function(require,module,exports){ var a, clas, div, h1, li, query, reactify, recl, ref, ul; @@ -625,13 +617,21 @@ module.exports = query({ var _date, _keys, date, elem, href, i, item, k, len, parts, path, preview, ref1, ref2, ref3, ref4, ref5, results, sorted, title, v; sorted = true; _keys = []; - ref1 = this.props.kids; - for (k in ref1) { - v = ref1[k]; - if (((ref2 = v.meta) != null ? ref2.sort : void 0) == null) { - sorted = false; + if (!this.props.sortBy) { + ref1 = this.props.kids; + for (k in ref1) { + v = ref1[k]; + if (((ref2 = v.meta) != null ? ref2.sort : void 0) == null) { + sorted = false; + } + _keys[Number((ref3 = v.meta) != null ? ref3.sort : void 0)] = k; } - _keys[Number((ref3 = v.meta) != null ? ref3.sort : void 0)] = k; + } else { + sorted = true; + _keys = _.keys(_.sortBy(_.clone(this.props.kids), function(kid) { + return Number(kid.meta.date.slice(1).replace(/\./g, "")); + })); + _keys.reverse(); } if (sorted !== true) { _keys = _.keys(this.props.kids).sort(); @@ -714,7 +714,6 @@ module.exports = query({ })); - },{"./Async.coffee":3,"./Reactify.coffee":11,"classnames":16}],10:[function(require,module,exports){ var div, input, recl, ref, textarea; @@ -755,7 +754,6 @@ module.exports = recl({ }); - },{}],11:[function(require,module,exports){ var Virtual, div, load, reactify, recl, ref, rele, span, walk; @@ -823,7 +821,6 @@ module.exports = _.extend(reactify, { }); - },{"./LoadComponent.coffee":10}],12:[function(require,module,exports){ var a, div, input, query, reactify, recl, ref, slice = [].slice; @@ -962,7 +959,6 @@ module.exports = query({ })); - },{"./Async.coffee":3,"./Reactify.coffee":11}],13:[function(require,module,exports){ var div, query, reactify, recl, slice = [].slice; @@ -1091,7 +1087,6 @@ module.exports = query({ })); - },{"./Async.coffee":3,"./Reactify.coffee":11}],14:[function(require,module,exports){ var Dispatcher; @@ -1113,7 +1108,6 @@ module.exports = _.extend(new Dispatcher(), { }); - },{"flux":17}],15:[function(require,module,exports){ var rend; @@ -1260,7 +1254,6 @@ $(function() { }); - },{"./actions/TreeActions.coffee":1,"./components/AnchorComponent.coffee":2,"./components/BodyComponent.coffee":4,"./components/Components.coffee":6,"./persistence/TreePersistence.coffee":20}],16:[function(require,module,exports){ /*! Copyright (c) 2015 Jed Watson. @@ -1688,7 +1681,6 @@ module.exports = { }; - },{}],21:[function(require,module,exports){ var EventEmitter, MessageDispatcher, QUERIES, TreeStore, _curr, _data, _tree, clog; @@ -1911,7 +1903,6 @@ TreeStore.dispatchToken = MessageDispatcher.register(function(payload) { module.exports = TreeStore; - },{"../dispatcher/Dispatcher.coffee":14,"events":22}],22:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // From 945305804e0373505bc33796446ff2fa8efb9b0a Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Sat, 3 Oct 2015 15:58:06 -0700 Subject: [PATCH 5/9] lists of posts --- .../src/js/components/ListComponent.coffee | 17 +-- pub/tree/src/js/main.js | 105 +++++++++++------- 2 files changed, 74 insertions(+), 48 deletions(-) diff --git a/pub/tree/src/js/components/ListComponent.coffee b/pub/tree/src/js/components/ListComponent.coffee index 0fec7f7684..4a619916ff 100644 --- a/pub/tree/src/js/components/ListComponent.coffee +++ b/pub/tree/src/js/components/ListComponent.coffee @@ -26,19 +26,20 @@ module.exports = query { # check if kids all have a sort meta tag sorted = true _keys = [] - if not @props.sortBy - for k,v of @props.kids + for k,v of @props.kids + if @props.sortBy + if @props.sortBy is 'date' + if not v.meta?.date? then sorted = false + _k = Number v.meta.date.slice(1).replace /\./g,"" + _keys[_k] = k + else if not v.meta?.sort? then sorted = false _keys[Number(v.meta?.sort)] = k - else - sorted = true - _keys = _.keys _.sortBy _.clone(@props.kids),(kid) -> - Number kid.meta.date.slice(1).replace /\./g,"" - _keys.reverse() + if @props.sortBy is 'date' then _keys.reverse() if sorted isnt true _keys = _.keys(@props.kids).sort() if @props.dataType is 'post' then _keys=_keys.reverse() - for item in _keys + for item in _.values _keys path = @props.path+"/"+item elem = @props.kids[item] href = window.tree.basepath path diff --git a/pub/tree/src/js/main.js b/pub/tree/src/js/main.js index 01220016a6..f7cb0a42fb 100644 --- a/pub/tree/src/js/main.js +++ b/pub/tree/src/js/main.js @@ -1,4 +1,4 @@ -(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 Date: Mon, 5 Oct 2015 13:45:40 -0700 Subject: [PATCH 6/9] re-tooling and js merge --- pub/doc/tools.mdy | 4 +-- pub/doc/tools/clay.md | 2 ++ pub/doc/tools/dojo.md | 4 ++- pub/doc/tools/moon.md | 79 +++++++++++++++++++++++++++++++++++++++++ pub/doc/tools/talk.md | 2 ++ pub/doc/tools/tree.md | 2 +- pub/tree/src/js/main.js | 67 +++++++++++++--------------------- 7 files changed, 113 insertions(+), 47 deletions(-) create mode 100644 pub/doc/tools/moon.md diff --git a/pub/doc/tools.mdy b/pub/doc/tools.mdy index a1b0b7cafa..fe245b997c 100644 --- a/pub/doc/tools.mdy +++ b/pub/doc/tools.mdy @@ -2,9 +2,9 @@ sort: 4 --- -tools +Tools ==== User-level tools and utilities. - + diff --git a/pub/doc/tools/clay.md b/pub/doc/tools/clay.md index b48d94ad9d..0c81ff0135 100644 --- a/pub/doc/tools/clay.md +++ b/pub/doc/tools/clay.md @@ -1,6 +1,8 @@ `%clay` ======== +`%clay` filesystem utilities. + ## Paths ### Structure diff --git a/pub/doc/tools/dojo.md b/pub/doc/tools/dojo.md index c273c78ba4..8cb0c414d6 100644 --- a/pub/doc/tools/dojo.md +++ b/pub/doc/tools/dojo.md @@ -1,7 +1,9 @@ # `:dojo` -The dojo is a typed functional shell. Its prompt is: +`:dojo` shell basics. + +Its prompt is: ~urbit-name:dojo> diff --git a/pub/doc/tools/moon.md b/pub/doc/tools/moon.md new file mode 100644 index 0000000000..bc324878fc --- /dev/null +++ b/pub/doc/tools/moon.md @@ -0,0 +1,79 @@ +`+ticket` +=================== + +Connecting your planet to moons. + +The Urbit namespace is designed for you to have a planet in the +cloud and your other devices (pc, laptop, phone) are moons. Once you +have a moon, you can setup 2 way sync of various desks, much like +Dropbox or a reactive git. If you `|mount` the desks, you can +have synchronization between directories on your moon and planet's +systems. + +Creating your moon name +----------------------- + +First, for creating your moon you need to come up with a moon name. +For this you need a number less than 2^32 (since every planet has +2^32 moons) in it's phonemic representation or `@p`: + +``` +> `@p`0x12.3456 +~hobdyl-pontyr +``` + +Take your partial name above and append it with your planet name to +get your full moon name, in this case `~hobdyl-pontyr-matfeb-sablud` for my planet `~matfeb-sablud`. + +Creating your moon +------------------ + +On your planet: + +``` +> |sync %kids our %base :: only have to do this once +> +ticket ~hobdyl-pontyr-matfeb-sablud :: has to be done for every moon +~some-ticket +``` + +On your pc/laptop: + +``` +> bin/urbit -w hobdyl-pontyr-matfeb-sablud -t some-ticket +``` + +Wait for it to boot up and there you have it. You've created your +moon which is tied to your planet. + +When you first boot your moon you will have a shell that is connected +to your planet. This might or might not be what you want. To get a +local shell, type `^d` at the dojo prompt, which should drop you into +the task manager. Then type `*dojo` to get a shell connected to your +moon. + +Setting up 2-way sync +--------------------- + +To create a 2 way syncronized desk between your moon and your +planet, simply do the following: + +On the moon: + +``` +> |sync %home ~matfeb-sablud %home +> |mount /=home= %home :: So you can see the files from Unix +``` + +On the planet: + +``` +> |sync %home ~hobdyl-pontyr-matfeb-sablud %home +``` + +The initial sync takes a little while, but after that you should be +able to create and edit files and have them sync up on the paired +system, much like your own personal Dropbox. + +--- + +[This guide brought to you by `~matfeb-sablud`] \ No newline at end of file diff --git a/pub/doc/tools/talk.md b/pub/doc/tools/talk.md index 04656e1a77..52f630c4b6 100644 --- a/pub/doc/tools/talk.md +++ b/pub/doc/tools/talk.md @@ -1,5 +1,7 @@ # `:talk` +`:talk` messaging interface. + `:talk` is the Urbit appliance for chatter and notifications. For less sophisticated users, Urbit *is* just `:talk`. If you see `:talk` as "like Slack, but distributed," or "like IRC, but diff --git a/pub/doc/tools/tree.md b/pub/doc/tools/tree.md index e170b2eda3..38d6643d35 100644 --- a/pub/doc/tools/tree.md +++ b/pub/doc/tools/tree.md @@ -1,6 +1,6 @@ # `:tree` -`:tree` is the web filesystem interface. +`:tree` static file hosting internals. `:tree` is a single-page app that uses a backend in `/home/tree` to load contents from `%clay` as the user navigates around as `%json`. The frontend lives in `/home/pub/tree` and is a fairly straightforward [React](https://facebook.github.io/react/) / [Flux](https://facebook.github.io/flux/) app. diff --git a/pub/tree/src/js/main.js b/pub/tree/src/js/main.js index f7cb0a42fb..a916c746ca 100644 --- a/pub/tree/src/js/main.js +++ b/pub/tree/src/js/main.js @@ -1,4 +1,4 @@ -(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 Date: Mon, 5 Oct 2015 16:48:55 -0400 Subject: [PATCH 7/9] Create planets with a %kids desk --- arvo/dill.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arvo/dill.hoon b/arvo/dill.hoon index e5ce331270..f3ce1dd0e7 100644 --- a/arvo/dill.hoon +++ b/arvo/dill.hoon @@ -214,7 +214,7 @@ =. +> ?: ?=(%czar can) +> (sync %base (sein our) %kids) =. +> (sync %home our %base) - =. +> ?. ?=(?(%king %czar) can) +> + =. +> ?. ?=(?(%duke %king %czar) can) +> (sync %kids our %base) =. +> autoload =. +> peer From 0b235601f8882e8778b96dee98ff386b0eba779f Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Mon, 5 Oct 2015 16:12:18 -0700 Subject: [PATCH 8/9] some mobile issues --- pub/tree/src/css/main.css | 12 ++++++------ pub/tree/src/css/mobile.styl | 13 +++++++------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/pub/tree/src/css/main.css b/pub/tree/src/css/main.css index b86c52a96d..ae9c3f944f 100644 --- a/pub/tree/src/css/main.css +++ b/pub/tree/src/css/main.css @@ -506,7 +506,7 @@ div.toc h1.t { #nav > div, #nav.up, #nav.top, - #nav > .focus { + #nav .focus { transform: translate3d(0, 0, 0); -webkit-transform: translate3d(0, 0, 0); } @@ -527,12 +527,12 @@ div.toc h1.t { position: fixed; top: 0; } - #nav > div { + #nav > div > div { max-height: 1rem; overflow: hidden; transition: max-height 0.3s ease-in-out; } - #nav > .focus { + #nav .focus { max-height: 40rem; transition: max-height 0.3s ease-in-out; } @@ -559,14 +559,14 @@ div.toc h1.t { background-color: #fff; z-index: 2; } - #nav > div { + #nav > div > div { max-height: 1.4rem; } #nav > div { padding-top: 0.6rem; } #nav #sibs { - width: 18rem; + width: 11rem; } #nav #sibs > div { height: 20px; @@ -608,7 +608,7 @@ div.toc h1.t { } } @media only screen and (min-device-width: 320px) and (max-device-width: 480px) { - #nav > div { + #nav > div > div { max-height: 1.6rem; } #nav a { diff --git a/pub/tree/src/css/mobile.styl b/pub/tree/src/css/mobile.styl index eadecdf67f..9c1e980da2 100644 --- a/pub/tree/src/css/mobile.styl +++ b/pub/tree/src/css/mobile.styl @@ -4,7 +4,7 @@ #nav > div #nav.up #nav.top - #nav > .focus + #nav .focus transform: translate3d(0,0,0); -webkit-transform: translate3d(0,0,0); @@ -25,12 +25,12 @@ position fixed top 0 - #nav > div + #nav > div > div max-height 1rem overflow hidden transition max-height .3s ease-in-out - #nav > .focus + #nav .focus max-height 40rem transition max-height .3s ease-in-out @@ -57,14 +57,14 @@ background-color #fff z-index 2 - #nav > div + #nav > div > div max-height 1.4rem #nav > div padding-top .6rem #nav #sibs - width 18rem + width 11rem #nav #sibs > div height 20px @@ -104,8 +104,9 @@ /* phones portrait and landscape ----------- */ @media only screen and (min-device-width: 320px) and (max-device-width: 480px) - #nav > div + #nav > div > div max-height 1.6rem + #nav a font-size .7rem From 81c15a687de7c13c91a0bc201c4c840977c569cc Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Mon, 5 Oct 2015 16:44:46 -0700 Subject: [PATCH 9/9] moon doc --- pub/doc/tools/moon.md | 58 +++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/pub/doc/tools/moon.md b/pub/doc/tools/moon.md index bc324878fc..53ba9486fa 100644 --- a/pub/doc/tools/moon.md +++ b/pub/doc/tools/moon.md @@ -10,36 +10,52 @@ Dropbox or a reactive git. If you `|mount` the desks, you can have synchronization between directories on your moon and planet's systems. -Creating your moon name ------------------------ - -First, for creating your moon you need to come up with a moon name. -For this you need a number less than 2^32 (since every planet has -2^32 moons) in it's phonemic representation or `@p`: - -``` -> `@p`0x12.3456 -~hobdyl-pontyr -``` - -Take your partial name above and append it with your planet name to -get your full moon name, in this case `~hobdyl-pontyr-matfeb-sablud` for my planet `~matfeb-sablud`. - Creating your moon ------------------ -On your planet: +Each planet can issue 2^32 moons. Moon names look like two planet +names glued together and always end with the signing planet name. So +for the planet `~matfeb-sablud` one could generate a moon `~talsur- +todres-matfeb-sablud`. + +### On your planet + +All of your moons will sync from your `%kids` desk. Your planet +should come with one by default, but let's check to see: ``` -> |sync %kids our %base :: only have to do this once -> +ticket ~hobdyl-pontyr-matfeb-sablud :: has to be done for every moon -~some-ticket +> +ls /=kids= ``` -On your pc/laptop: +You should get a list of directories. If you just get `~` you can +set one up with the following command: ``` -> bin/urbit -w hobdyl-pontyr-matfeb-sablud -t some-ticket +>|sync %kids our %base +``` + +To generate a random moon you can run the following in the `dojo`: + +``` ++ticket =+(`@p`(cat 5 our (mod eny (pow 2 32))) ~&(- -)) +``` + +The output will print your moon name above the line with the +command. It will look something like this: + +``` +~some-moon-some-planet +> +ticket =+(`@p`(cat 5 our (mod eny (pow 2 32))) ~&(- -)) +~some-ticket +``` + +You'll use both of these values to create your moon in the next +step. + +### On your PC/laptop + +``` +> bin/urbit -w some-moon-some-planet -t some-ticket ``` Wait for it to boot up and there you have it. You've created your