Merge branch 'master' of https://github.com/urbit/urbit into nobreach

This commit is contained in:
Anton Dyudin 2015-10-09 10:56:57 -07:00
commit e5ff969867
12 changed files with 205 additions and 60 deletions

View File

@ -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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,9 @@
# `:dojo`
The dojo is a typed functional shell. Its prompt is:
`:dojo` shell basics.
Its prompt is:
~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` 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

View File

@ -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.

View File

@ -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 {

View File

@ -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

View File

@ -27,12 +27,19 @@ module.exports = query {
sorted = true
_keys = []
for k,v of @props.kids
if not v.meta?.sort? then sorted = false
_keys[Number(v.meta?.sort)] = k
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
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
@ -48,13 +55,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

View File

@ -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;
@ -622,16 +614,29 @@ 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, _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;
_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) {
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) {
_keys = _.keys(this.props.kids).sort();
@ -639,15 +644,16 @@ module.exports = query({
if (this.props.dataType === 'post') {
_keys = _keys.reverse();
}
ref5 = _.values(_keys);
results = [];
for (i = 0, len = _keys.length; i < len; i++) {
item = _keys[i];
for (i = 0, len = ref5.length; i < len; i++) {
item = ref5[i];
path = this.props.path + "/" + item;
elem = this.props.kids[item];
href = window.tree.basepath(path);
parts = [];
title = null;
if ((ref4 = elem.meta) != null ? ref4.title : void 0) {
if ((ref6 = elem.meta) != null ? ref6.title : void 0) {
title = {
gn: 'h1',
c: [elem.meta.title]
@ -662,19 +668,43 @@ 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);
}
}
}
results.push(li({
key: item,
className: (ref5 = this.props.dataType) != null ? ref5 : ""
className: (ref7 = this.props.dataType) != null ? ref7 : ""
}, a({
href: href,
className: clas({
@ -690,7 +720,6 @@ module.exports = query({
}));
},{"./Async.coffee":3,"./Reactify.coffee":11,"classnames":16}],10:[function(require,module,exports){
var div, input, recl, ref, textarea;
@ -731,7 +760,6 @@ module.exports = recl({
});
},{}],11:[function(require,module,exports){
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){
var a, div, input, query, reactify, recl, ref,
slice = [].slice;
@ -938,7 +965,6 @@ module.exports = query({
}));
},{"./Async.coffee":3,"./Reactify.coffee":11}],13:[function(require,module,exports){
var div, query, reactify, recl,
slice = [].slice;
@ -1067,7 +1093,6 @@ module.exports = query({
}));
},{"./Async.coffee":3,"./Reactify.coffee":11}],14:[function(require,module,exports){
var Dispatcher;
@ -1089,7 +1114,6 @@ module.exports = _.extend(new Dispatcher(), {
});
},{"flux":17}],15:[function(require,module,exports){
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){
/*!
Copyright (c) 2015 Jed Watson.
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++) {
@ -1257,15 +1282,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;
}
}
@ -1277,15 +1300,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){
@ -1665,7 +1687,6 @@ module.exports = {
};
},{}],21:[function(require,module,exports){
var EventEmitter, MessageDispatcher, QUERIES, TreeStore, _curr, _data, _tree, clog;
@ -1888,7 +1909,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.
//