mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-02 03:52:13 +03:00
Merge remote-tracking branches 'Fang/talk-at-fix', 'ohaitch/fix-oauth1' and 'ohaitch/fora'
Fix talk @message breaking bugs Fix oauth1 sec driver Forum backend improvements
This commit is contained in:
commit
ab73f364a2
@ -841,14 +841,14 @@
|
||||
?. =(64 len) advance
|
||||
:- (fix(inx brk) (turf '•'))
|
||||
?: isa
|
||||
[[%ins +(inx) (turf '@')] newline(new &)]
|
||||
[[%ins +(brk) (turf '@')] newline(new &)]
|
||||
newline(new &)
|
||||
?: =(64 len)
|
||||
=+ dif=(sub inx brk)
|
||||
?: (lth dif 64)
|
||||
:- (fix(inx brk) (turf '•'))
|
||||
?: isa
|
||||
[[%ins (sub inx 3) (turf '@')] $(len dif, new &)]
|
||||
[[%ins +(brk) (turf '@')] $(len dif, new &)]
|
||||
$(len dif, new &)
|
||||
[[%ins inx (turf '•')] $(len 0, inx +(inx), new &)]
|
||||
?: |((lth cur 32) (gth cur 126))
|
||||
|
@ -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])]
|
||||
--
|
||||
|
@ -2,7 +2,6 @@
|
||||
:::: /hoon/tree/lib
|
||||
::
|
||||
/? 314
|
||||
/- tree-include
|
||||
!:
|
||||
|%
|
||||
++ getall :: search in manx
|
||||
|
@ -88,7 +88,7 @@
|
||||
::
|
||||
++ poke-fora-post
|
||||
|= {sup/spur him/ship hed/@t txt/@t} ^+ abet
|
||||
=+ pax=(welp (flop sup) /posts/(scot %da now))
|
||||
=+ pax=(welp (flop sup) /posts/(cat 3 (scot %da now) '~'))
|
||||
=. txt
|
||||
%- crip
|
||||
"""
|
||||
@ -97,7 +97,8 @@
|
||||
date: {<now>}
|
||||
title: {(trip hed)}
|
||||
author: {<him>}
|
||||
comments: true
|
||||
navuptwo: true
|
||||
comments: reverse
|
||||
---
|
||||
|
||||
{(trip txt)}
|
||||
|
@ -5,4 +5,4 @@
|
||||
/- tree-include
|
||||
|_ tree-include
|
||||
++ grab |% ++ noun tree-include
|
||||
-- --
|
||||
-- --
|
||||
|
@ -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
|
||||
==
|
||||
|
@ -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)))
|
||||
|
@ -11,4 +11,5 @@ $: mime/mime
|
||||
sect/json
|
||||
comt/json
|
||||
plan/json
|
||||
bump/knot
|
||||
==
|
||||
|
166
web/tree/main.js
166
web/tree/main.js
@ -88,7 +88,7 @@ module.exports = {
|
||||
return function(err, res) {
|
||||
if (err == null) {
|
||||
_this.clearData();
|
||||
history.pushState({}, "", pax);
|
||||
history.pushState({}, "", "..");
|
||||
return _this.setCurr(pax);
|
||||
}
|
||||
};
|
||||
@ -588,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');
|
||||
|
||||
@ -629,7 +630,8 @@ Comment = function(arg) {
|
||||
module.exports = query({
|
||||
comt: 'j',
|
||||
path: 't',
|
||||
spur: 't'
|
||||
spur: 't',
|
||||
meta: 'j'
|
||||
}, recl({
|
||||
displayName: "Comments",
|
||||
getInitialState: function() {
|
||||
@ -687,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";
|
||||
@ -703,22 +705,41 @@ 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)
|
||||
]);
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
@ -754,7 +775,7 @@ 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,"./PostComponent.coffee":17,"./ScriptComponent.coffee":19,"./SearchComponent.coffee":20,"./ShipComponent.coffee":21,"./TocComponent.coffee":23}],7:[function(require,module,exports){
|
||||
var a, div, recl, ref, util;
|
||||
var Arrow, Dpad, a, div, recl, ref, util;
|
||||
|
||||
util = require('../utils/util.coffee');
|
||||
|
||||
@ -762,53 +783,26 @@ 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":30}],8:[function(require,module,exports){
|
||||
@ -1032,7 +1026,9 @@ module.exports = query({
|
||||
kids: {
|
||||
snip: 'r',
|
||||
head: 'r',
|
||||
meta: 'j'
|
||||
meta: 'j',
|
||||
bump: 't',
|
||||
name: 't'
|
||||
}
|
||||
}, recl({
|
||||
displayName: "List",
|
||||
@ -1043,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
|
||||
@ -1055,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;
|
||||
@ -1065,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;
|
||||
}
|
||||
@ -1080,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;
|
||||
}
|
||||
@ -1104,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',
|
||||
@ -1660,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({
|
||||
@ -2774,7 +2791,8 @@ QUERIES = {
|
||||
comt: 'j',
|
||||
plan: 'j',
|
||||
beak: 't',
|
||||
spur: 't'
|
||||
spur: 't',
|
||||
bump: 't'
|
||||
};
|
||||
|
||||
TreeStore = _.extend((new EventEmitter).setMaxListeners(50), {
|
||||
|
Loading…
Reference in New Issue
Block a user