Merge remote-tracking branch 'origin/master' into neoames

This commit is contained in:
C. Guy Yarvin 2016-08-05 09:25:03 -07:00
commit 858f0c7fe4
17 changed files with 467 additions and 155 deletions

View File

@ -149,6 +149,7 @@
++ poke-write-sec-atom (wrap poke-sec-atom):from-write
++ poke-write-paste (wrap poke-paste):from-write
++ poke-write-comment (wrap poke-comment):from-write
++ poke-write-fora-post (wrap poke-fora-post):from-write
++ poke-write-plan-info (wrap poke-plan-info):from-write
++ poke-write-plan-account (wrap poke-plan-account):from-write
++ poke-write-tree (wrap poke-tree):from-write

View File

@ -73,6 +73,7 @@
++ pear :: poke fruit
$% {$talk-command command} ::
{$write-comment spur ship cord} ::
{$write-fora-post spur ship cord cord} ::
== ::
++ card :: general card
$% {$diff lime} ::
@ -825,6 +826,7 @@
|= buf/(list @c)
^- (list sole-edit)
?~ buf ~
=+ isa==(i.buf (turf '@'))
=+ [[pre=*@c cur=i.buf buf=t.buf] inx=0 brk=0 len=0 new=|]
=* txt -<
|^ ^- (list sole-edit)
@ -837,11 +839,17 @@
?: =(cur `@`' ')
=. brk ?:(=(pre `@`' ') brk inx)
?. =(64 len) advance
[(fix(inx brk) (turf '•')) newline(new &)]
:- (fix(inx brk) (turf '•'))
?: isa
[[%ins +(brk) (turf '@')] newline(new &)]
newline(new &)
?: =(64 len)
=+ dif=(sub inx brk)
?: (lth dif 64)
[(fix(inx brk) (turf '•')) $(len dif, new &)]
:- (fix(inx brk) (turf '•'))
?: isa
[[%ins +(brk) (turf '@')] $(len dif, new &)]
$(len dif, new &)
[[%ins inx (turf '•')] $(len 0, inx +(inx), new &)]
?: |((lth cur 32) (gth cur 126))
[(fix '?') advance]
@ -1324,6 +1332,47 @@
?:(neu +>.$ ra-homes)
::
++ ra-base-hart .^(hart %e /(scot %p our.hid)/host/(scot %da now.hid))
++ ra-fora-post
|= {pax/path sup/spur hed/@t txt/@t}
=. ..ra-emit
%+ ra-emit ost.hid
:* %poke
/fora-post
[our.hid %hood]
[%write-fora-post sup src.hid hed txt]
==
=+ man=%posts
?: (~(has by stories) man)
(ra-consume-fora-post man pax sup hed txt)
=; new (ra-consume-fora-post:new man pax sup hed txt)
=. ..ra-apply
%+ ra-apply our.hid
:+ %design man
:- ~ :- ~
:- 'towards a community'
[%brown ~]
%^ ra-consume & our.hid
:^ (shaf %init eny.hid)
(my [[%& our.hid (main our.hid)] *envelope %pending] ~)
now.hid
[~ %app %tree 'receiving forum posts, ;join %posts for details']
::
++ ra-consume-fora-post
|= {man/knot pax/path sup/spur hed/@t txt/@t} ^+ +>
=+ nam=?~(sup "" (trip i.sup)) :: file name
=+ fra=(crip (time-to-id now.hid)) :: url fragment
%^ ra-consume &
src.hid
:* (shaf %comt eny.hid)
(my [[%& our.hid man] *envelope %pending] ~)
now.hid
(sy /fora-post eyre+pax ~)
:- %mor :~
[%fat text+(lore txt) [%url [ra-base-hart `pax ~] `fra]]
[%app %tree (crip "forum post: '{(trip hed)}'")]
==
==
::
++ ra-comment
|= {pax/path sup/spur txt/@t}
=. ..ra-emit
@ -1336,19 +1385,18 @@
=+ man=%comments
?: (~(has by stories) man)
(ra-consume-comment man pax sup txt)
=; new (ra-consume-comment:new man pax sup txt)
=. ..ra-apply
%+ ra-apply our.hid
:+ %design man
:- ~ :- ~
:- 'letters to the editor'
[%brown ~]
=. ..ra-consume
%^ ra-consume & our.hid
:^ (shaf %init eny.hid)
(my [[%& our.hid (main our.hid)] *envelope %pending] ~)
now.hid
[~ %app %tree 'receiving comments, ;join %comments for details']
(ra-consume-comment man pax sup txt)
%^ ra-consume & our.hid
:^ (shaf %init eny.hid)
(my [[%& our.hid (main our.hid)] *envelope %pending] ~)
now.hid
[~ %app %tree 'receiving comments, ;join %comments for details']
::
++ ra-consume-comment
|= {man/knot pax/path sup/spur txt/@t} ^+ +>
@ -2252,6 +2300,10 @@
|= {pax/path sup/spur txt/@t} ^- (quip move +>)
ra-abet:(ra-comment:ra pax sup txt)
::
++ poke-talk-fora-post
|= {pax/path sup/spur hed/@t txt/@t} ^- (quip move +>)
ra-abet:(ra-fora-post:ra pax sup hed txt)
::
++ poke-talk-save
|= man/knot
^- (quip move +>)

View File

@ -4,13 +4,12 @@
/? 310
:- %say
|= {^ {input/path output/path $~} $~}
:- %kiln-info
?. =(-:(flop input) -:(flop output))
~& "Can't move to a different mark"
~
["Can't move to a different mark" ~]
=+ dir=.^(arch %cy input)
?~ fil.dir
~& "No such file:"
~& <input>
~
:+ %kiln-info "copied"
(foal output -:(flop input) [%atom %t ~] .^(* %cx input)) :: XX type
[<input> ~]
:- "copied"
`(foal output -:(flop input) [%atom %t ~] .^(* %cx input)) :: XX type

View File

@ -4,14 +4,13 @@
/? 310
:- %say
|= {^ {input/path output/path $~} $~}
:- %kiln-info
?. =(-:(flop input) -:(flop output))
~& "Can't move to a different mark"
~
["Can't move to a different mark" ~]
=+ dir=.^(arch %cy input)
?~ fil.dir
~& "No such file:"
~& <input>
~
:+ %kiln-info "moved"
[<input> ~]
:- "moved" :- ~
%+ furl (fray input)
(foal output -:(flop input) [%noun .^(* %cx input)])

View File

@ -47,8 +47,6 @@
cas/case ::
gim/?($auto germ) ::
== ::
++ kiln-cp {input/path output/path} ::
++ kiln-mv {input/path output/path} ::
-- ::
:: :: ::
:::: :: ::
@ -154,8 +152,10 @@
abet:(emit %drop /cancel our syd)
::
++ poke-info
|= {mez/tape tor/toro}
abet:(emit:(spam leaf+mez ~) %info /kiln our tor)
|= {mez/tape tor/(unit toro)}
?~ tor
abet:(spam leaf+mez ~)
abet:(emit:(spam leaf+mez ~) %info /kiln our u.tor)
::
++ poke-rm
|= a/path
@ -163,19 +163,19 @@
?~ fil.b
=+ ~[leaf+"No such file:" leaf+"{<a>}"]
abet:(spam -)
(poke-info "removed" (fray a))
(poke-info "removed" `(fray a))
::
++ poke-label
|= {syd/desk lab/@tas}
=+ pax=/(scot %p our)/[syd]/[lab]
(poke-info "labeled {(spud pax)}" [syd %| lab])
(poke-info "labeled {(spud pax)}" `[syd %| lab])
::
++ poke-schedule
|= {where/path tym/@da eve/@t}
=. where (welp where /sched)
%+ poke-info "scheduled"
=+ old=;;((map @da cord) (fall (file where) ~))
(foal where %sched !>((~(put by old) tym eve)))
`(foal where %sched !>((~(put by old) tym eve)))
::
++ poke-autoload
|= lod/(unit ?)

View File

@ -102,7 +102,7 @@
~& [%oauth-warning "Make sure this urbit ".
"is running on {(earn our-host `~ ~)}"]
%- crip %- earn
%^ interpolate 'https://our-host/~/ac/:domain/:user/in'
%^ into-url:interpolate 'https://our-host/~/ac/:domain/:user/in'
`our-host
:~ domain+(join '.' (flop dom))
user+(scot %ta usr)
@ -251,7 +251,7 @@
?: (bad-response p.a)
[%give a] :: [%redo ~] :: handle 4xx?
?. (check-screen-name a)
[[%redo ~] (handle `token`~)]
[[%redo ~] (save `token`~)]
=+ access-token=(grab-token-response a)
[[%redo ~] (save `token`[%access-token access-token])]
--

View File

@ -2,7 +2,6 @@
:::: /hoon/tree/lib
::
/? 314
/- tree-include
!:
|%
++ getall :: search in manx

View File

@ -86,6 +86,25 @@
==
(poke--data [`%md pax] %mime / (taco txt))
::
++ poke-fora-post
|= {sup/spur him/ship hed/@t txt/@t} ^+ abet
=+ pax=(welp (flop sup) /posts/(cat 3 (scot %da now) '~'))
=. txt
%- crip
"""
---
type: post
date: {<now>}
title: {(trip hed)}
author: {<him>}
navuptwo: true
comments: reverse
---
{(trip txt)}
"""
(poke--data [`%md pax] %mime / (taco txt))
::
++ ames-secret
^- @t
=- (crip +:<.^(@p %a pax)>)

13
mar/talk/fora-post.hoon Normal file
View File

@ -0,0 +1,13 @@
::
:::: /hoon/fora-post/talk/mar
::
/? 310
!:
|_ {pax/path sup/spur hed/@t txt/@t}
++ grab
|%
++ noun {path spur @t @t}
++ json
(corl need =>(jo (ot pax+(su fel:stab) sup+(su fel:stab) hed+so txt+so ~)))
--
--

View File

@ -5,4 +5,4 @@
/- tree-include
|_ tree-include
++ grab |% ++ noun tree-include
-- --
-- --

View File

@ -11,6 +11,8 @@
/= meta /&json&front&/|(/front/ /~[~])
/= plan /^ json /|(/plan-json/ /~[~])
/= comt /&json&/tree-comments/
/= bump /; |=(a/(list {p/time *}) =.(a (flop a) ?~(a '' (scot %da p.i.a))))
/tree-comments/
!:
^- tree-include
=+ rj=react-to-json:react
@ -22,4 +24,5 @@
sect
comt
plan
bump
==

View File

@ -2,6 +2,7 @@
:::: /hoon/json/tree/ren
::
/? 310
/- tree-include
/+ tree
/= gas /$ fuel
/= dat /^ tree-include /tree-include/
@ -20,6 +21,7 @@
{$path $t}
{$spur $t}
::
{$bump $t}
{$beak $t}
{$comt $j}
{$plan $j}
@ -56,6 +58,7 @@
$beak (from-type +.a (crip (spud (tope bem(s /)))))
$path (from-type +.a (crip (spud (flop s.bem))))
$spur (from-type +.a (crip (spud s.bem)))
$bump (from-type +.a bump.dat)
$plan (from-type +.a plan.dat)
$comt (from-type +.a comt.dat)
$head (from-type +.a head.dat)
@ -75,7 +78,7 @@
::
[tree .]
^- json
=+ default='spur.t_body.r_comt.j_plan.j_beak.t_meta.j_kids_meta.j_head.r'
=+ default='spur.t_body.r_comt.j_plan.j_beak.t_meta.j_kids_meta.j_head.r_bump.t'
=+ ^= schem
=+ seh=(fall (~(get by qix.gas) 'q') default)
~|(bad-noun+seh ;;(schema (rash seh read-schem)))

View File

@ -11,4 +11,5 @@ $: mime/mime
sect/json
comt/json
plan/json
bump/knot
==

View File

@ -3,8 +3,8 @@
font-family: 'scp'; }
div.input.valid-false {
color: #FF0808;
border-color: #FF0808; }
color: #E20B0B;
border-color: #E20B0B; }
.grams {
list-style-type: none;
@ -14,7 +14,8 @@ div.input.valid-false {
.grams .meta {
max-height: 1.6rem;
overflow: hidden; }
overflow: hidden;
width: 100%; }
.grams .meta label {
margin-right: 0.9375rem;
height: 0.9375rem;
@ -31,7 +32,8 @@ div.input.valid-false {
.grams .meta label,
.grams .meta h2,
.grams .meta h3 {
display: inline-block; }
display: inline-block;
vertical-align: top; }
.grams .meta h2,
.grams .meta h3 {
font-family: 'scp';
@ -43,11 +45,11 @@ div.input.valid-false {
margin-left: 2rem;
line-height: 1rem; }
.grams .meta .time {
padding-right: 2rem; }
padding-right: 2rem;
float: right; }
div.gram.same .meta {
max-height: none;
overflow: auto; }
.grams .meta:hover {
overflow: visible; }
div.gram.first:first-of-type {
margin-top: 0; }
@ -61,12 +63,17 @@ div.gram.same div.meta {
div.gram.same:hover div.meta {
display: block;
position: absolute;
background-color: #fff;
margin-top: -2.5rem;
padding-top: 1rem;
white-space: nowrap; }
z-index: 0; }
div.gram.same:hover div.meta label, div.gram.same:hover div.meta h2, div.gram.same:hover div.meta h3 {
display: none; }
div.gram.same:hover div.meta h3.time {
display: block;
opacity: .6;
padding-right: 3.8rem; }
.speech {
position: absolute;
z-index: 1;
margin-left: 1.875rem; }
.exp {
@ -108,7 +115,7 @@ div.gram.same:hover div.meta {
background-color: transparent; }
div.gram label {
background-color: #0500F0; }
background-color: #000; }
div.gram.say .speech {
font-style: italic; }
@ -127,7 +134,7 @@ input.action {
font-size: .8rem; }
input.action.valid-false {
color: #FF0808; }
color: #E20B0B; }
input.action::-webkit-input-placeholder {
color: #000;
@ -185,7 +192,7 @@ input.action:focus:-ms-input-placeholder {
margin-left: .6rem;
font-weight: 600;
font-size: .8rem;
color: #FF0808; }
color: #E20B0B; }
.menu .room:hover .close {
display: inline; }
.menu .room.disabled {

View File

@ -288,9 +288,6 @@ module.exports = recl({
render: function() {
var k, ship;
ship = this.props.ship;
if (ship[0] === "~") {
this.props.ship = ship.slice(1);
}
k = "ship";
if (this.props.presence) {
k += " " + this.props.presence;
@ -351,6 +348,9 @@ module.exports = recl({
return;
}
user = $(e.target).closest('.iden').text();
if (user[0] === "~") {
user = user.slice(1);
}
if (user.toLowerCase() === 'system') {
return;
}
@ -445,7 +445,7 @@ module.exports = recl({
audi = util.clipAudi(aude).map(function(_audi) {
return div({
key: _audi
}, _audi.slice(1));
}, _audi);
});
mainStation = util.mainStationPath(window.urb.user);
type = indexOf.call(aude, mainStation) >= 0 ? 'private' : 'public';
@ -968,7 +968,7 @@ module.exports = recl({
className: (this.state.open === source ? "selected" : ""),
onClick: this._openStation,
"data-station": source
}, source.slice(1)), div({
}, source), div({
className: "close",
onClick: this._remove,
"data-station": source
@ -1054,6 +1054,62 @@ Audience = recl({
return false;
}
}
if (e.keyCode === 9) {
e.preventDefault();
this._autoCompleteAudience();
return false;
} else if ((this.tabAudList != null) && e.keyCode !== 16) {
this.tabAudList = null;
return this.tabAudIndex = null;
}
},
_autoCompleteAudience: function() {
var aud, g, i, j, len, len1, ref1, ref2, s, stations, txt;
txt = $('#audience .input').text().trim();
if (this.tabAudList == null) {
this.tabAudList = [];
if (txt.length === 1 && StationStore.getGlyphs()[txt[0]]) {
ref1 = this._getGlyphExpansions(txt[0]);
for (i = 0, len = ref1.length; i < len; i++) {
s = ref1[i];
this.tabAudList.push(s[0]);
}
} else {
if (!(txt[0] === '~')) {
txt = '~' + txt;
}
ref2 = StationStore.getGlyphs();
for (g in ref2) {
stations = ref2[g];
for (j = 0, len1 = stations.length; j < len1; j++) {
aud = stations[j];
if (aud[0].indexOf(txt) === 0 && this.tabAudList.indexOf(aud[0]) < 0) {
this.tabAudList.push(aud[0]);
}
}
}
}
}
if ((this.tabAudList != null) && this.tabAudList.length > 0) {
if (this.tabAudIndex != null) {
if (event.shiftKey) {
this.tabAudIndex--;
} else {
this.tabAudIndex++;
}
this.tabAudIndex = (this.tabAudIndex % this.tabAudList.length + this.tabAudList.length) % this.tabAudList.length;
} else {
this.tabAudIndex = 0;
}
return StationActions.setAudience(this.tabAudList[this.tabAudIndex].split(/\ +/));
}
},
_getGlyphExpansions: function(g) {
var glyphs;
glyphs = StationStore.getGlyphs();
if (glyphs[g]) {
return glyphs[g];
}
},
render: function() {
return div({
@ -1351,7 +1407,9 @@ module.exports = recl({
audi = util.clipAudi(audi);
for (k in audi) {
v = audi[k];
audi[k] = v.slice(1);
if (audi[k].indexOf('~~') === 0) {
audi[k] = v.slice(1);
}
}
return div({
className: 'writing',
@ -1519,9 +1577,7 @@ module.exports = function(arg) {
}
if ((ref = res.data) != null ? (ref1 = ref.grams) != null ? ref1.tele : void 0 : void 0) {
ref3 = (ref2 = res.data) != null ? ref2.grams : void 0, tele = ref3.tele, num = ref3.num;
return setTimeout((function() {
return MessageActions.loadMessages(tele, num);
}), 5000);
return MessageActions.loadMessages(tele, num);
}
});
},
@ -1962,6 +2018,9 @@ StationStore = _.merge(new EventEmitter, {
}
return results;
},
getGlyphs: function() {
return _glyphs;
},
getStations: function() {
return _stations;
},

View File

@ -934,9 +934,11 @@ ol > li:before {
overflow: hidden;
white-space: nowrap; }
.ship span {
display: none; }
.ship:before {
content: attr(data-alias);
margin-right: 2rem;
color: #000; }
.ship:hover {
@ -947,6 +949,9 @@ ol > li:before {
.ship:hover:before {
display: none; }
.ship:hover span {
display: inline; }
@media (max-width: 767px) {
.iden,
.path {

View File

@ -78,6 +78,22 @@ module.exports = {
};
})(this));
},
addPost: function(pax, sup, hed, txt) {
return TreePersistence.put({
pax: pax,
sup: sup,
hed: hed,
txt: txt
}, "talk-fora-post", "talk", (function(_this) {
return function(err, res) {
if (err == null) {
_this.clearData();
history.pushState({}, "", "..");
return _this.setCurr(pax);
}
};
})(this));
},
setPlanInfo: function(arg) {
var loc, who;
who = arg.who, loc = arg.loc;
@ -125,7 +141,7 @@ module.exports = {
};
},{"../dispatcher/Dispatcher.coffee":24,"../persistence/TreePersistence.coffee":26}],2:[function(require,module,exports){
},{"../dispatcher/Dispatcher.coffee":25,"../persistence/TreePersistence.coffee":27}],2:[function(require,module,exports){
var TreeActions, TreeStore, _load, code, div, fragsrc, recl, ref, span, util;
util = require('../utils/util.coffee');
@ -299,7 +315,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){
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":28,"../utils/util.coffee":30,"./LoadComponent.coffee":12}],3:[function(require,module,exports){
var Comments, TreeActions, TreeStore, a, clas, div, extras, h1, h3, img, input, load, name, p, query, reactify, recl, ref, rele, util;
clas = require('classnames');
@ -548,7 +564,7 @@ module.exports = query({
}));
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":27,"../utils/util.coffee":29,"./Async.coffee":2,"./CommentsComponent.coffee":5,"./LoadComponent.coffee":12,"./Reactify.coffee":17,"classnames":30}],4:[function(require,module,exports){
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":28,"../utils/util.coffee":30,"./Async.coffee":2,"./CommentsComponent.coffee":5,"./LoadComponent.coffee":12,"./Reactify.coffee":18,"classnames":31}],4:[function(require,module,exports){
var div, recl, ref, textarea;
recl = React.createClass;
@ -572,7 +588,8 @@ module.exports = recl({
},{}],5:[function(require,module,exports){
var Comment, DEFER_USER, 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,
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
clas = require('classnames');
@ -613,7 +630,8 @@ Comment = function(arg) {
module.exports = query({
comt: 'j',
path: 't',
spur: 't'
spur: 't',
meta: 'j'
}, recl({
displayName: "Comments",
getInitialState: function() {
@ -671,7 +689,7 @@ module.exports = query({
});
},
render: function() {
var _attr, inputAttr, textareaAttr;
var _attr, addComment, comments, inputAttr, ref1, ref2, textareaAttr;
_attr = {};
if (this.state.loading === true) {
_attr.disabled = "true";
@ -687,27 +705,46 @@ module.exports = query({
value: "Add comment",
className: "btn btn-primary"
});
return div({}, div({
addComment = div({
key: 'add-comment',
className: "add-comment"
}, form({
ref: "in",
onSubmit: this.onSubmit
}, rele(Ship, {
ship: this.state.user
}), textarea(textareaAttr), input(inputAttr))), div({
className: "comments"
}, (this.state.loading != null ? rele(Comment, _.extend({}, this.state.loading, {
user: this.state.user
})) : void 0), this.props.comt.map(function(props, key) {
}), textarea(textareaAttr), input(inputAttr)));
comments = this.props.comt.map(function(props, key) {
return rele(Comment, _.extend({
key: key
}, props));
})));
});
comments.unshift((this.state.loading != null ? rele(Comment, _.extend({
key: 'loading'
}, this.state.loading, {
user: this.state.user
})) : void 0));
if (indexOf.call((ref1 = (ref2 = this.props.meta.comments) != null ? ref2.split(" ") : void 0) != null ? ref1 : [], "reverse") >= 0) {
comments = comments.reverse();
return div({}, [
div({
key: 'comments',
className: "comments"
}, comments), addComment
]);
} else {
return div({}, [
addComment, div({
key: 'comments',
className: "comments"
}, comments)
]);
}
}
}));
},{"../actions/TreeActions.coffee":1,"../utils/util.coffee":29,"./Async.coffee":2,"./LoadComponent.coffee":12,"./Reactify.coffee":17,"./ShipComponent.coffee":20,"classnames":30}],6:[function(require,module,exports){
},{"../actions/TreeActions.coffee":1,"../utils/util.coffee":30,"./Async.coffee":2,"./LoadComponent.coffee":12,"./Reactify.coffee":18,"./ShipComponent.coffee":21,"classnames":31}],6:[function(require,module,exports){
var div, recl;
recl = React.createClass;
@ -725,6 +762,7 @@ module.exports = {
script: require('./ScriptComponent.coffee'),
plan: require('./PlanComponent.coffee'),
panel: require('./PanelComponent.coffee'),
post: require('./PostComponent.coffee'),
imagepanel: require('./ImagepanelComponent.coffee'),
load: require('./LoadComponent.coffee'),
ship: require('./ShipComponent.coffee'),
@ -736,8 +774,8 @@ module.exports = {
};
},{"./CodeMirror.coffee":4,"./EmailComponent.coffee":8,"./ImagepanelComponent.coffee":9,"./KidsComponent.coffee":10,"./ListComponent.coffee":11,"./LoadComponent.coffee":12,"./ModuleComponent.coffee":13,"./PanelComponent.coffee":15,"./PlanComponent.coffee":16,"./ScriptComponent.coffee":18,"./SearchComponent.coffee":19,"./ShipComponent.coffee":20,"./TocComponent.coffee":22}],7:[function(require,module,exports){
var a, div, recl, ref, util;
},{"./CodeMirror.coffee":4,"./EmailComponent.coffee":8,"./ImagepanelComponent.coffee":9,"./KidsComponent.coffee":10,"./ListComponent.coffee":11,"./LoadComponent.coffee":12,"./ModuleComponent.coffee":13,"./PanelComponent.coffee":15,"./PlanComponent.coffee":16,"./PostComponent.coffee":17,"./ScriptComponent.coffee":19,"./SearchComponent.coffee":20,"./ShipComponent.coffee":21,"./TocComponent.coffee":23}],7:[function(require,module,exports){
var Arrow, Dpad, a, div, recl, ref, util;
util = require('../utils/util.coffee');
@ -745,56 +783,29 @@ recl = React.createClass;
ref = React.DOM, div = ref.div, a = ref.a;
module.exports = recl({
displayName: "Dpad",
renderUp: function() {
if (this.props.sein) {
return this.renderArrow("up", this.props.sein);
}
},
renderArrow: function(name, path) {
var href;
href = util.basepath(path);
return a({
href: href,
key: "" + name,
className: "" + name
}, "");
},
renderArrows: function() {
var index, keys, next, prev, sein;
keys = util.getKeys(this.props.kids);
if (keys.length > 1) {
index = keys.indexOf(this.props.curr);
prev = index - 1;
next = index + 1;
if (prev < 0) {
prev = keys.length - 1;
}
if (next === keys.length) {
next = 0;
}
prev = keys[prev];
next = keys[next];
}
if (this.props.sein) {
sein = this.props.sein;
if (sein === "/") {
sein = "";
}
return div({}, prev ? this.renderArrow("prev", sein + "/" + prev) : void 0, next ? this.renderArrow("next", sein + "/" + next) : void 0);
}
},
render: function() {
return div({
className: 'dpad',
key: 'dpad'
}, this.renderUp(), this.renderArrows());
}
});
Arrow = function(name, path) {
var href;
href = util.basepath(path);
return a({
href: href,
key: "" + name,
className: "" + name
}, "");
};
module.exports = Dpad = function(arg) {
var arrowSibs, arrowUp, curr, index, keys, kids, meta, next, prev, sein;
sein = arg.sein, curr = arg.curr, kids = arg.kids, meta = arg.meta;
arrowUp = sein ? meta.navuptwo ? Arrow("up", sein.replace(/\/[^\/]*$/, "")) : Arrow("up", sein) : void 0;
arrowSibs = (keys = util.getKeys(kids), keys.length > 1 ? (index = keys.indexOf(curr), prev = index - 1, next = index + 1, prev < 0 ? prev = keys.length - 1 : void 0, next === keys.length ? next = 0 : void 0, prev = keys[prev], next = keys[next]) : void 0, sein ? (sein === "/" ? sein = "" : void 0, div({}, prev ? Arrow("prev", sein + "/" + prev) : void 0, next ? Arrow("next", sein + "/" + next) : void 0)) : void 0);
return div({
className: 'dpad',
key: 'dpad'
}, arrowUp, arrowSibs);
};
},{"../utils/util.coffee":29}],8:[function(require,module,exports){
},{"../utils/util.coffee":30}],8:[function(require,module,exports){
var button, div, input, p, recl, ref;
recl = React.createClass;
@ -995,7 +1006,7 @@ module.exports = query({
}));
},{"./Async.coffee":2,"./Reactify.coffee":17,"classnames":30}],11:[function(require,module,exports){
},{"./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');
@ -1015,7 +1026,9 @@ module.exports = query({
kids: {
snip: 'r',
head: 'r',
meta: 'j'
meta: 'j',
bump: 't',
name: 't'
}
}, recl({
displayName: "List",
@ -1026,7 +1039,7 @@ module.exports = query({
}, this.props.dataType, {
"default": this.props['data-source'] === 'default'
}, this.props.className);
kids = this.renderList();
kids = this.renderList(this.sortedKids());
if (!(kids.length === 0 && (this.props.is404 != null))) {
return ul({
className: k
@ -1038,8 +1051,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.')));
},
renderList: function() {
var _date, _k, _keys, author, cont, date, elem, href, i, image, item, k, len, linked, node, parts, path, preview, ref1, ref2, ref3, ref4, ref5, ref6, results, sorted, title, v;
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;
@ -1048,14 +1068,14 @@ module.exports = query({
if (this.props.sortBy) {
if (this.props.sortBy === 'date') {
if (((ref2 = v.meta) != null ? ref2.date : void 0) == null) {
sorted = false;
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) {
sorted = false;
return _.keys(this.props.kids).sort();
}
_keys[Number((ref4 = v.meta) != null ? ref4.sort : void 0)] = k;
}
@ -1063,15 +1083,15 @@ module.exports = query({
if (this.props.sortBy === 'date') {
_keys.reverse();
}
if (sorted !== true) {
_keys = _.keys(this.props.kids).sort();
}
ref5 = _.values(_keys);
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;
results = [];
for (i = 0, len = ref5.length; i < len; i++) {
item = ref5[i];
for (i = 0, len = elems.length; i < len; i++) {
elem = elems[i];
item = elem.name;
path = this.props.path + "/" + item;
elem = this.props.kids[item];
if (elem.meta.hide != null) {
continue;
}
@ -1087,7 +1107,7 @@ module.exports = query({
}
parts = [];
title = null;
if ((ref6 = elem.meta) != null ? ref6.title : void 0) {
if ((ref1 = elem.meta) != null ? ref1.title : void 0) {
if (this.props.dataType === 'post') {
title = {
gn: 'a',
@ -1223,7 +1243,7 @@ module.exports = query({
}));
},{"../utils/util.coffee":29,"./Async.coffee":2,"./Reactify.coffee":17,"classnames":30}],12:[function(require,module,exports){
},{"../utils/util.coffee":30,"./Async.coffee":2,"./Reactify.coffee":18,"classnames":31}],12:[function(require,module,exports){
var div, recl, ref, span;
recl = React.createClass;
@ -1521,6 +1541,9 @@ module.exports = query({
_this = this;
$('body').on('click', 'a', function(e) {
var basepath, href, url;
if (e.shiftKey || e.ctrlKey || e.metaKey) {
return true;
}
href = $(this).attr('href');
if ((href != null ? href[0] : void 0) === "#") {
return true;
@ -1630,7 +1653,7 @@ module.exports = query({
}));
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":27,"../utils/util.coffee":29,"./Async.coffee":2,"./BodyComponent.coffee":3,"./DpadComponent.coffee":7,"./Reactify.coffee":17,"./SibsComponent.coffee":21,"classnames":30}],15:[function(require,module,exports){
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":28,"../utils/util.coffee":30,"./Async.coffee":2,"./BodyComponent.coffee":3,"./DpadComponent.coffee":7,"./Reactify.coffee":18,"./SibsComponent.coffee":22,"classnames":31}],15:[function(require,module,exports){
var a, li, nav, recl, ref, rele, ul;
recl = React.createClass;
@ -1640,6 +1663,20 @@ rele = React.createElement;
ref = React.DOM, nav = ref.nav, ul = ref.ul, li = ref.li, a = ref.a;
module.exports = recl({
getInitialState: function() {
return {
loaded: urb.ship != null
};
},
componentDidMount: function() {
return urb.init((function(_this) {
return function() {
return _this.setState({
'loaded': 'loaded'
});
};
})(this));
},
render: function() {
if ((urb.user == null) || urb.user !== urb.ship) {
return nav({
@ -1878,6 +1915,116 @@ module.exports = query({
},{"../actions/TreeActions.coffee":1,"./Async.coffee":2,"./LoadComponent.coffee":12}],17:[function(require,module,exports){
var DEFER_USER, Ship, TreeActions, a, clas, code, div, form, h2, img, input, load, p, query, reactify, recl, ref, rele, textarea, util;
clas = require('classnames');
load = require('./LoadComponent.coffee');
query = require('./Async.coffee');
reactify = require('./Reactify.coffee');
TreeActions = require('../actions/TreeActions.coffee');
util = require('../utils/util.coffee');
Ship = require('./ShipComponent.coffee');
recl = React.createClass;
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 = false;
module.exports = query({
comt: 'j',
path: 't',
spur: 't'
}, recl({
displayName: "Post",
getInitialState: function() {
var ref1;
return {
loading: null,
value: "",
user: (ref1 = urb.user) != null ? ref1 : ""
};
},
componentDidMount: function() {
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
});
}
},
onSubmit: function(e) {
var comment, path, title;
title = this.refs["in"].title.value;
comment = this.refs["in"].comment.value;
path = this.props.path || "/";
TreeActions.addPost(path, this.props.spur, title, comment);
return e.preventDefault();
},
onChange: function(e) {
return this.setState({
value: e.target.value
});
},
render: function() {
var _attr, bodyTextArea, postButton, titleInput;
_attr = {};
if (this.state.loading === true) {
_attr.disabled = "true";
}
titleInput = input(_.create(_attr, {
type: "text",
name: "title",
placeholder: "Title"
}));
bodyTextArea = textarea(_.create(_attr, {
type: "text",
name: "comment",
value: this.state.value,
onChange: this.onChange
}));
postButton = input(_.create(_attr, {
type: "submit",
value: "Post",
className: "btn btn-primary"
}));
return div({}, div({
className: "add-post"
}, form({
ref: "in",
onSubmit: this.onSubmit
}, rele(Ship, {
ship: this.state.user
}), titleInput, bodyTextArea, postButton)));
}
}));
},{"../actions/TreeActions.coffee":1,"../utils/util.coffee":30,"./Async.coffee":2,"./LoadComponent.coffee":12,"./Reactify.coffee":18,"./ShipComponent.coffee":21,"classnames":31}],18:[function(require,module,exports){
var DynamicVirtual, TreeStore, Virtual, div, load, name, reactify, recl, ref, rele, span, walk;
recl = React.createClass;
@ -2001,7 +2148,7 @@ module.exports = _.extend(reactify, {
});
},{"../stores/TreeStore.coffee":27,"./LoadComponent.coffee":12}],18:[function(require,module,exports){
},{"../stores/TreeStore.coffee":28,"./LoadComponent.coffee":12}],19:[function(require,module,exports){
var TreeActions, appendNext, recl, rele, waitingScripts;
recl = React.createClass;
@ -2050,7 +2197,7 @@ module.exports = recl({
});
},{"../actions/TreeActions.coffee":1}],19:[function(require,module,exports){
},{"../actions/TreeActions.coffee":1}],20:[function(require,module,exports){
var a, div, input, query, reactify, recl, ref,
slice = [].slice;
@ -2188,7 +2335,7 @@ module.exports = query({
}));
},{"./Async.coffee":2,"./Reactify.coffee":17}],20:[function(require,module,exports){
},{"./Async.coffee":2,"./Reactify.coffee":18}],21:[function(require,module,exports){
var div, recl;
recl = React.createClass;
@ -2207,7 +2354,7 @@ module.exports = recl({
});
},{}],21:[function(require,module,exports){
},{}],22:[function(require,module,exports){
var a, clas, li, query, reactify, recl, ref, ul, util;
util = require('../utils/util.coffee');
@ -2291,7 +2438,7 @@ module.exports = query({
}));
},{"../utils/util.coffee":29,"./Async.coffee":2,"./Reactify.coffee":17,"classnames":30}],22:[function(require,module,exports){
},{"../utils/util.coffee":30,"./Async.coffee":2,"./Reactify.coffee":18,"classnames":31}],23:[function(require,module,exports){
var div, query, reactify, recl,
slice = [].slice;
@ -2428,7 +2575,7 @@ module.exports = query({
}));
},{"./Async.coffee":2,"./Reactify.coffee":17}],23:[function(require,module,exports){
},{"./Async.coffee":2,"./Reactify.coffee":18}],24:[function(require,module,exports){
var body, clas, div, head, query, recf, recl;
query = require('./Async.coffee');
@ -2471,7 +2618,7 @@ module.exports = query({
}));
},{"./Async.coffee":2,"./BodyComponent.coffee":3,"./NavComponent.coffee":14,"classnames":30}],24:[function(require,module,exports){
},{"./Async.coffee":2,"./BodyComponent.coffee":3,"./NavComponent.coffee":14,"classnames":31}],25:[function(require,module,exports){
module.exports = _.extend(new Flux.Dispatcher(), {
handleServerAction: function(action) {
return this.dispatch({
@ -2488,7 +2635,7 @@ module.exports = _.extend(new Flux.Dispatcher(), {
});
},{}],25:[function(require,module,exports){
},{}],26:[function(require,module,exports){
var rend;
rend = ReactDOM.render;
@ -2521,7 +2668,7 @@ $(function() {
});
},{"./actions/TreeActions.coffee":1,"./components/Components.coffee":6,"./components/TreeComponent.coffee":23,"./utils/scroll.coffee":28,"./utils/util.coffee":29}],26:[function(require,module,exports){
},{"./actions/TreeActions.coffee":1,"./components/Components.coffee":6,"./components/TreeComponent.coffee":24,"./utils/scroll.coffee":29,"./utils/util.coffee":30}],27:[function(require,module,exports){
var dedup, pending, util, waspWait;
util = require('../utils/util.coffee');
@ -2616,7 +2763,7 @@ module.exports = {
};
},{"../utils/util.coffee":29}],27:[function(require,module,exports){
},{"../utils/util.coffee":30}],28:[function(require,module,exports){
var EventEmitter, MessageDispatcher, QUERIES, TreeStore, _curr, _data, _nav, _tree, _virt, clog;
EventEmitter = require('events').EventEmitter.EventEmitter;
@ -2644,7 +2791,8 @@ QUERIES = {
comt: 'j',
plan: 'j',
beak: 't',
spur: 't'
spur: 't',
bump: 't'
};
TreeStore = _.extend((new EventEmitter).setMaxListeners(50), {
@ -2909,7 +3057,7 @@ TreeStore.dispatchToken = MessageDispatcher.register(function(p) {
module.exports = TreeStore;
},{"../dispatcher/Dispatcher.coffee":24,"events":31}],28:[function(require,module,exports){
},{"../dispatcher/Dispatcher.coffee":25,"events":32}],29:[function(require,module,exports){
var TreeActions, scroll;
TreeActions = require('../actions/TreeActions.coffee');
@ -3019,7 +3167,7 @@ scroll.init();
module.exports = scroll;
},{"../actions/TreeActions.coffee":1}],29:[function(require,module,exports){
},{"../actions/TreeActions.coffee":1}],30:[function(require,module,exports){
var _basepath;
_basepath = window.urb.util.basepath("/");
@ -3083,7 +3231,7 @@ module.exports = {
};
},{"../components/ShipComponent.coffee":20}],30:[function(require,module,exports){
},{"../components/ShipComponent.coffee":21}],31:[function(require,module,exports){
/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
@ -3133,7 +3281,7 @@ module.exports = {
}
}());
},{}],31:[function(require,module,exports){
},{}],32:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
@ -3193,8 +3341,12 @@ 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.');
}
}
@ -3433,4 +3585,4 @@ function isUndefined(arg) {
return arg === void 0;
}
},{}]},{},[25]);
},{}]},{},[26]);