Merge remote-tracking branch 'galen/test' into pending

This commit is contained in:
Philip C Monk 2015-10-05 20:14:42 -04:00
commit fcb5951a9d
12 changed files with 205 additions and 60 deletions

View File

@ -214,7 +214,7 @@
=. +> ?: ?=(%czar can) +> =. +> ?: ?=(%czar can) +>
(sync %base (sein our) %kids) (sync %base (sein our) %kids)
=. +> (sync %home our %base) =. +> (sync %home our %base)
=. +> ?. ?=(?(%king %czar) can) +> =. +> ?. ?=(?(%duke %king %czar) can) +>
(sync %kids our %base) (sync %kids our %base)
=. +> autoload =. +> autoload
=. +> peer =. +> peer

View File

@ -10557,7 +10557,7 @@
[@ %sync *] %c [@ %sync *] %c
[@ %term *] %d [@ %term *] %d
[@ %http *] %e [@ %http *] %e
[@ %temp *] %t [@ %behn *] %b
== ==
:: ::
++ doos :: sleep until ++ doos :: sleep until

View File

@ -2,9 +2,9 @@
sort: 4 sort: 4
--- ---
tools Tools
==== ====
User-level tools and utilities. User-level tools and utilities.
<list></list> <list dataPreview="true"></list>

View File

@ -1,6 +1,8 @@
`%clay` `%clay`
======== ========
`%clay` filesystem utilities.
## Paths ## Paths
### Structure ### Structure

View File

@ -1,7 +1,9 @@
# `:dojo` # `:dojo`
The dojo is a typed functional shell. Its prompt is: `:dojo` shell basics.
Its prompt is:
~urbit-name:dojo> ~urbit-name:dojo>

95
pub/doc/tools/moon.md Normal file
View File

@ -0,0 +1,95 @@
`+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
------------------
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:
```
> +ls /=kids=
```
You should get a list of directories. If you just get `~` you can
set one up with the following command:
```
>|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
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`]

View File

@ -1,5 +1,7 @@
# `:talk` # `:talk`
`:talk` messaging interface.
`:talk` is the Urbit appliance for chatter and notifications. `:talk` is the Urbit appliance for chatter and notifications.
For less sophisticated users, Urbit *is* just `:talk`. If you For less sophisticated users, Urbit *is* just `:talk`. If you
see `:talk` as "like Slack, but distributed," or "like IRC, but see `:talk` as "like Slack, but distributed," or "like IRC, but

View File

@ -1,6 +1,6 @@
# `:tree` # `: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. `: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.

View File

@ -506,7 +506,7 @@ div.toc h1.t {
#nav > div, #nav > div,
#nav.up, #nav.up,
#nav.top, #nav.top,
#nav > .focus { #nav .focus {
transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);
-webkit-transform: translate3d(0, 0, 0); -webkit-transform: translate3d(0, 0, 0);
} }
@ -527,12 +527,12 @@ div.toc h1.t {
position: fixed; position: fixed;
top: 0; top: 0;
} }
#nav > div { #nav > div > div {
max-height: 1rem; max-height: 1rem;
overflow: hidden; overflow: hidden;
transition: max-height 0.3s ease-in-out; transition: max-height 0.3s ease-in-out;
} }
#nav > .focus { #nav .focus {
max-height: 40rem; max-height: 40rem;
transition: max-height 0.3s ease-in-out; transition: max-height 0.3s ease-in-out;
} }
@ -559,14 +559,14 @@ div.toc h1.t {
background-color: #fff; background-color: #fff;
z-index: 2; z-index: 2;
} }
#nav > div { #nav > div > div {
max-height: 1.4rem; max-height: 1.4rem;
} }
#nav > div { #nav > div {
padding-top: 0.6rem; padding-top: 0.6rem;
} }
#nav #sibs { #nav #sibs {
width: 18rem; width: 11rem;
} }
#nav #sibs > div { #nav #sibs > div {
height: 20px; height: 20px;
@ -608,7 +608,7 @@ div.toc h1.t {
} }
} }
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) { @media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
#nav > div { #nav > div > div {
max-height: 1.6rem; max-height: 1.6rem;
} }
#nav a { #nav a {

View File

@ -4,7 +4,7 @@
#nav > div #nav > div
#nav.up #nav.up
#nav.top #nav.top
#nav > .focus #nav .focus
transform: translate3d(0,0,0); transform: translate3d(0,0,0);
-webkit-transform: translate3d(0,0,0); -webkit-transform: translate3d(0,0,0);
@ -25,12 +25,12 @@
position fixed position fixed
top 0 top 0
#nav > div #nav > div > div
max-height 1rem max-height 1rem
overflow hidden overflow hidden
transition max-height .3s ease-in-out transition max-height .3s ease-in-out
#nav > .focus #nav .focus
max-height 40rem max-height 40rem
transition max-height .3s ease-in-out transition max-height .3s ease-in-out
@ -57,14 +57,14 @@
background-color #fff background-color #fff
z-index 2 z-index 2
#nav > div #nav > div > div
max-height 1.4rem max-height 1.4rem
#nav > div #nav > div
padding-top .6rem padding-top .6rem
#nav #sibs #nav #sibs
width 18rem width 11rem
#nav #sibs > div #nav #sibs > div
height 20px height 20px
@ -104,8 +104,9 @@
/* phones portrait and landscape ----------- */ /* phones portrait and landscape ----------- */
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) @media only screen and (min-device-width: 320px) and (max-device-width: 480px)
#nav > div #nav > div > div
max-height 1.6rem max-height 1.6rem
#nav a #nav a
font-size .7rem font-size .7rem

View File

@ -27,12 +27,19 @@ module.exports = query {
sorted = true sorted = true
_keys = [] _keys = []
for k,v of @props.kids for k,v of @props.kids
if not v.meta?.sort? then sorted = false if @props.sortBy
_keys[Number(v.meta?.sort)] = k 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
if @props.sortBy is 'date' then _keys.reverse()
if sorted isnt true if sorted isnt true
_keys = _.keys(@props.kids).sort() _keys = _.keys(@props.kids).sort()
if @props.dataType is 'post' then _keys=_keys.reverse() if @props.dataType is 'post' then _keys=_keys.reverse()
for item in _keys for item in _.values _keys
path = @props.path+"/"+item path = @props.path+"/"+item
elem = @props.kids[item] elem = @props.kids[item]
href = window.tree.basepath path href = window.tree.basepath path
@ -48,13 +55,29 @@ module.exports = query {
title = title =
gn: 'h1' gn: 'h1'
c: [item] 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 parts.push title
unless @props.titlesOnly # redundant? this seems familiar unless @props.titlesOnly # redundant? this seems familiar
if @props.dataPreview 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)... parts.push (elem.snip.c.slice 0,2)...
else 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 ? ""}, li {key:item,className:@props.dataType ? ""},
a {href,className:(clas preview: @props.dataPreview?)}, a {href,className:(clas preview: @props.dataPreview?)},
reactify reactify

View File

@ -35,7 +35,6 @@ module.exports = {
}; };
},{"../dispatcher/Dispatcher.coffee":14,"../persistence/TreePersistence.coffee":20}],2:[function(require,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; 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){ },{"../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; 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){ },{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":21,"./LoadComponent.coffee":10}],4:[function(require,module,exports){
var div, query, reactify, recl; var div, query, reactify, recl;
@ -419,7 +416,6 @@ module.exports = query({
})); }));
},{"./Async.coffee":3,"./Reactify.coffee":11}],5:[function(require,module,exports){ },{"./Async.coffee":3,"./Reactify.coffee":11}],5:[function(require,module,exports){
var div, recl, ref, textarea; var div, recl, ref, textarea;
@ -443,7 +439,6 @@ module.exports = recl({
}); });
},{}],6:[function(require,module,exports){ },{}],6:[function(require,module,exports){
var div, recl; 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){ },{"./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; var button, div, input, p, reactify, recl, ref;
@ -547,7 +541,6 @@ module.exports = recl({
}); });
},{"./Reactify.coffee":11}],8:[function(require,module,exports){ },{"./Reactify.coffee":11}],8:[function(require,module,exports){
var a, div, hr, li, query, reactify, recl, ref, ul; 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){ },{"./Async.coffee":3,"./Reactify.coffee":11}],9:[function(require,module,exports){
var a, clas, div, h1, li, query, reactify, recl, ref, ul; var a, clas, div, h1, li, query, reactify, recl, ref, ul;
@ -622,16 +614,29 @@ module.exports = query({
}, this.renderList()); }, this.renderList());
}, },
renderList: function() { renderList: function() {
var _keys, elem, href, i, item, k, len, parts, path, ref1, ref2, ref3, ref4, ref5, results, sorted, title, v; var _date, _k, _keys, date, elem, href, i, item, k, len, parts, path, preview, ref1, ref2, ref3, ref4, ref5, ref6, ref7, results, sorted, title, v;
sorted = true; sorted = true;
_keys = []; _keys = [];
ref1 = this.props.kids; ref1 = this.props.kids;
for (k in ref1) { for (k in ref1) {
v = ref1[k]; v = ref1[k];
if (((ref2 = v.meta) != null ? ref2.sort : void 0) == null) { if (this.props.sortBy) {
sorted = false; if (this.props.sortBy === 'date') {
if (((ref2 = v.meta) != null ? ref2.date : void 0) == null) {
sorted = false;
}
_k = Number(v.meta.date.slice(1).replace(/\./g, ""));
_keys[_k] = k;
}
} else {
if (((ref3 = v.meta) != null ? ref3.sort : void 0) == null) {
sorted = false;
}
_keys[Number((ref4 = v.meta) != null ? ref4.sort : void 0)] = k;
} }
_keys[Number((ref3 = v.meta) != null ? ref3.sort : void 0)] = k; }
if (this.props.sortBy === 'date') {
_keys.reverse();
} }
if (sorted !== true) { if (sorted !== true) {
_keys = _.keys(this.props.kids).sort(); _keys = _.keys(this.props.kids).sort();
@ -639,15 +644,16 @@ module.exports = query({
if (this.props.dataType === 'post') { if (this.props.dataType === 'post') {
_keys = _keys.reverse(); _keys = _keys.reverse();
} }
ref5 = _.values(_keys);
results = []; results = [];
for (i = 0, len = _keys.length; i < len; i++) { for (i = 0, len = ref5.length; i < len; i++) {
item = _keys[i]; item = ref5[i];
path = this.props.path + "/" + item; path = this.props.path + "/" + item;
elem = this.props.kids[item]; elem = this.props.kids[item];
href = window.tree.basepath(path); href = window.tree.basepath(path);
parts = []; parts = [];
title = null; title = null;
if ((ref4 = elem.meta) != null ? ref4.title : void 0) { if ((ref6 = elem.meta) != null ? ref6.title : void 0) {
title = { title = {
gn: 'h1', gn: 'h1',
c: [elem.meta.title] c: [elem.meta.title]
@ -662,19 +668,43 @@ module.exports = query({
c: [item] 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); parts.push(title);
if (!this.props.titlesOnly) { if (!this.props.titlesOnly) {
if (this.props.dataPreview) { 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)); parts.push.apply(parts, elem.snip.c.slice(0, 2));
} else { } else {
parts.push(elem.snip); if (elem.meta.preview) {
preview = {
gn: 'p',
c: [elem.meta.preview]
};
} else {
preview = elem.snip;
}
parts.push(preview);
} }
} }
} }
results.push(li({ results.push(li({
key: item, key: item,
className: (ref5 = this.props.dataType) != null ? ref5 : "" className: (ref7 = this.props.dataType) != null ? ref7 : ""
}, a({ }, a({
href: href, href: href,
className: clas({ className: clas({
@ -690,7 +720,6 @@ module.exports = query({
})); }));
},{"./Async.coffee":3,"./Reactify.coffee":11,"classnames":16}],10:[function(require,module,exports){ },{"./Async.coffee":3,"./Reactify.coffee":11,"classnames":16}],10:[function(require,module,exports){
var div, input, recl, ref, textarea; var div, input, recl, ref, textarea;
@ -731,7 +760,6 @@ module.exports = recl({
}); });
},{}],11:[function(require,module,exports){ },{}],11:[function(require,module,exports){
var Virtual, div, load, reactify, recl, ref, rele, span, walk; var Virtual, div, load, reactify, recl, ref, rele, span, walk;
@ -799,7 +827,6 @@ module.exports = _.extend(reactify, {
}); });
},{"./LoadComponent.coffee":10}],12:[function(require,module,exports){ },{"./LoadComponent.coffee":10}],12:[function(require,module,exports){
var a, div, input, query, reactify, recl, ref, var a, div, input, query, reactify, recl, ref,
slice = [].slice; slice = [].slice;
@ -938,7 +965,6 @@ module.exports = query({
})); }));
},{"./Async.coffee":3,"./Reactify.coffee":11}],13:[function(require,module,exports){ },{"./Async.coffee":3,"./Reactify.coffee":11}],13:[function(require,module,exports){
var div, query, reactify, recl, var div, query, reactify, recl,
slice = [].slice; slice = [].slice;
@ -1067,7 +1093,6 @@ module.exports = query({
})); }));
},{"./Async.coffee":3,"./Reactify.coffee":11}],14:[function(require,module,exports){ },{"./Async.coffee":3,"./Reactify.coffee":11}],14:[function(require,module,exports){
var Dispatcher; var Dispatcher;
@ -1089,7 +1114,6 @@ module.exports = _.extend(new Dispatcher(), {
}); });
},{"flux":17}],15:[function(require,module,exports){ },{"flux":17}],15:[function(require,module,exports){
var rend; var rend;
@ -1236,19 +1260,20 @@ $(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){ },{"./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. Copyright (c) 2015 Jed Watson.
Licensed under the MIT License (MIT), see Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames http://jedwatson.github.io/classnames
*/ */
/* global define */
(function () { (function () {
'use strict'; 'use strict';
function classNames () { var hasOwn = {}.hasOwnProperty;
function classNames () {
var classes = ''; var classes = '';
for (var i = 0; i < arguments.length; i++) { for (var i = 0; i < arguments.length; i++) {
@ -1257,15 +1282,13 @@ $(function() {
var argType = typeof arg; var argType = typeof arg;
if ('string' === argType || 'number' === argType) { if (argType === 'string' || argType === 'number') {
classes += ' ' + arg; classes += ' ' + arg;
} else if (Array.isArray(arg)) { } else if (Array.isArray(arg)) {
classes += ' ' + classNames.apply(null, arg); classes += ' ' + classNames.apply(null, arg);
} else if (argType === 'object') {
} else if ('object' === argType) {
for (var key in arg) { for (var key in arg) {
if (arg.hasOwnProperty(key) && arg[key]) { if (hasOwn.call(arg, key) && arg[key]) {
classes += ' ' + key; classes += ' ' + key;
} }
} }
@ -1277,15 +1300,14 @@ $(function() {
if (typeof module !== 'undefined' && module.exports) { if (typeof module !== 'undefined' && module.exports) {
module.exports = classNames; module.exports = classNames;
} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd){ } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
// AMD. Register as an anonymous module. // register as 'classnames', consistent with npm package name
define(function () { define('classnames', function () {
return classNames; return classNames;
}); });
} else { } else {
window.classNames = classNames; window.classNames = classNames;
} }
}()); }());
},{}],17:[function(require,module,exports){ },{}],17:[function(require,module,exports){
@ -1665,7 +1687,6 @@ module.exports = {
}; };
},{}],21:[function(require,module,exports){ },{}],21:[function(require,module,exports){
var EventEmitter, MessageDispatcher, QUERIES, TreeStore, _curr, _data, _tree, clog; var EventEmitter, MessageDispatcher, QUERIES, TreeStore, _curr, _data, _tree, clog;
@ -1888,7 +1909,6 @@ TreeStore.dispatchToken = MessageDispatcher.register(function(payload) {
module.exports = TreeStore; module.exports = TreeStore;
},{"../dispatcher/Dispatcher.coffee":14,"events":22}],22:[function(require,module,exports){ },{"../dispatcher/Dispatcher.coffee":14,"events":22}],22:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors. // Copyright Joyent, Inc. and other Node contributors.
// //