mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-05 13:55:54 +03:00
show work-tasks on talk web frontend, clean up {foo}=React.DOM
This commit is contained in:
parent
b137bcf555
commit
9c1e695e8a
@ -87,11 +87,12 @@
|
||||
|= a=speech
|
||||
%+ joba -.a
|
||||
?+ -.a ~|(stub/-.a !!)
|
||||
%lin (jobe say/[%b p.a] txt/[%s q.a] ~)
|
||||
%url (jobe url/[%s (crip (earf p.a))] ~)
|
||||
%exp (jobe code/[%s p.a] ~)
|
||||
%app (jobe app/[%s p.a] txt/[%s q.a] ~)
|
||||
%fat (jobe fat/(tors p.a) taf/$(a q.a) ~)
|
||||
%lin (jobe txt/[%s q.a] say/[%b p.a] ~)
|
||||
%url (joba txt/[%s (crip (earf p.a))])
|
||||
%exp (joba txt/[%s p.a])
|
||||
%tax (joba txt/(jape <p.a>))
|
||||
%app (jobe txt/[%s q.a] src/[%s p.a] ~)
|
||||
%fat (jobe tor/(tors p.a) taf/$(a q.a) ~)
|
||||
:: %inv (jobe ship/(jope p.a) party/[%s q.a] ~)
|
||||
==
|
||||
::
|
||||
|
@ -1,5 +1,5 @@
|
||||
recl = React.createClass
|
||||
[div,input,textarea] = [React.DOM.div,React.DOM.input,React.DOM.textarea]
|
||||
{div,input,textarea} = React.DOM
|
||||
|
||||
module.exports = recl
|
||||
render: ->
|
||||
|
@ -1,7 +1,7 @@
|
||||
moment = require 'moment-timezone'
|
||||
|
||||
recl = React.createClass
|
||||
[div,pre,br,input,textarea,a] = [React.DOM.div,React.DOM.pre,React.DOM.br,React.DOM.input,React.DOM.textarea,React.DOM.a]
|
||||
{div,pre,br,input,textarea,a} = React.DOM
|
||||
|
||||
MessageActions = require '../actions/MessageActions.coffee'
|
||||
MessageStore = require '../stores/MessageStore.coffee'
|
||||
@ -51,17 +51,19 @@ Message = recl
|
||||
type = ['private','public']
|
||||
type = type[Number(aude.indexOf(window.util.mainStationPath(window.urb.user)) is -1)]
|
||||
|
||||
if speech.lin?.txt then txt = speech.lin.txt
|
||||
if speech.url
|
||||
url = speech.url.url
|
||||
txt = (a {href:url,target:"_blank"}, url)
|
||||
if speech.app
|
||||
txt = speech.app.txt
|
||||
klass += " say"
|
||||
if speech.exp
|
||||
txt = speech.exp.code
|
||||
klass += " exp"
|
||||
|
||||
mess = switch
|
||||
when (con = speech.lin) or (con = speech.app) or
|
||||
(con = speech.exp) or (con = speech.tax)
|
||||
con.txt
|
||||
when (con = speech.url)
|
||||
(a {href:con.txt,target:"_blank"}, con.txt)
|
||||
else "Unknown speech type:" + (" %"+x for x of speech).join ''
|
||||
|
||||
klass += switch
|
||||
when speech.app? then " say"
|
||||
when speech.exp? then " exp"
|
||||
else ""
|
||||
|
||||
div {className:"message#{klass}"}, [
|
||||
(div {className:"attr"}, [
|
||||
div {className:"type #{type}"}, ""
|
||||
@ -69,7 +71,7 @@ Message = recl
|
||||
div {onClick:@_handleAudi,className:"audi"}, audi
|
||||
div {className:"time"}, @convTime @props.thought.statement.date
|
||||
])
|
||||
div {className:"mess"}, txt,
|
||||
div {className:"mess"}, mess,
|
||||
if attachments.length
|
||||
div {className:"fat"}, attachments
|
||||
]
|
||||
|
@ -1,5 +1,5 @@
|
||||
recl = React.createClass
|
||||
[div,input] = [React.DOM.div,React.DOM.input]
|
||||
{div,input} = React.DOM
|
||||
|
||||
StationStore = require '../stores/StationStore.coffee'
|
||||
StationActions = require '../actions/StationActions.coffee'
|
||||
|
@ -1,6 +1,6 @@
|
||||
recl = React.createClass
|
||||
recf = React.createFactory
|
||||
[div] = [React.DOM.div]
|
||||
{div} = React.DOM
|
||||
|
||||
StationComponent = recf require './StationComponent.coffee'
|
||||
MessagesComponent = recf require './MessagesComponent.coffee'
|
||||
|
@ -1,5 +1,5 @@
|
||||
recl = React.createClass
|
||||
[div,br,input,textarea] = [React.DOM.div,React.DOM.br,React.DOM.input,React.DOM.textarea]
|
||||
{div,br,input,textarea} = React.DOM
|
||||
|
||||
MessageActions = require '../actions/MessageActions.coffee'
|
||||
MessageStore = require '../stores/MessageStore.coffee'
|
||||
|
@ -184,7 +184,7 @@ var div, input, recl, ref, textarea;
|
||||
|
||||
recl = React.createClass;
|
||||
|
||||
ref = [React.DOM.div, React.DOM.input, React.DOM.textarea], div = ref[0], input = ref[1], textarea = ref[2];
|
||||
ref = React.DOM, div = ref.div, input = ref.input, textarea = ref.textarea;
|
||||
|
||||
module.exports = recl({
|
||||
render: function() {
|
||||
@ -215,7 +215,7 @@ moment = require('moment-timezone');
|
||||
|
||||
recl = React.createClass;
|
||||
|
||||
ref = [React.DOM.div, React.DOM.pre, React.DOM.br, React.DOM.input, React.DOM.textarea, React.DOM.a], div = ref[0], pre = ref[1], br = ref[2], input = ref[3], textarea = ref[4], a = ref[5];
|
||||
ref = React.DOM, div = ref.div, pre = ref.pre, br = ref.br, input = ref.input, textarea = ref.textarea, a = ref.a;
|
||||
|
||||
MessageActions = require('../actions/MessageActions.coffee');
|
||||
|
||||
@ -262,7 +262,7 @@ Message = recl({
|
||||
return this.props._handlePm(user);
|
||||
},
|
||||
render: function() {
|
||||
var attachments, aude, audi, delivery, klass, name, ref1, ref2, speech, txt, type, url;
|
||||
var attachments, aude, audi, con, delivery, klass, mess, name, ref1, speech, type, x;
|
||||
delivery = _.uniq(_.pluck(this.props.thought.audience, "delivery"));
|
||||
klass = delivery.indexOf("received") !== -1 ? " received" : " pending";
|
||||
speech = this.props.thought.statement.speech;
|
||||
@ -295,24 +295,36 @@ Message = recl({
|
||||
});
|
||||
type = ['private', 'public'];
|
||||
type = type[Number(aude.indexOf(window.util.mainStationPath(window.urb.user)) === -1)];
|
||||
if ((ref2 = speech.lin) != null ? ref2.txt : void 0) {
|
||||
txt = speech.lin.txt;
|
||||
}
|
||||
if (speech.url) {
|
||||
url = speech.url.url;
|
||||
txt = a({
|
||||
href: url,
|
||||
target: "_blank"
|
||||
}, url);
|
||||
}
|
||||
if (speech.app) {
|
||||
txt = speech.app.txt;
|
||||
klass += " say";
|
||||
}
|
||||
if (speech.exp) {
|
||||
txt = speech.exp.code;
|
||||
klass += " exp";
|
||||
}
|
||||
mess = (function() {
|
||||
switch (false) {
|
||||
case !((con = speech.lin) || (con = speech.app) || (con = speech.exp) || (con = speech.tax)):
|
||||
return con.txt;
|
||||
case !(con = speech.url):
|
||||
return a({
|
||||
href: con.txt,
|
||||
target: "_blank"
|
||||
}, con.txt);
|
||||
default:
|
||||
return "Unknown speech type:" + ((function() {
|
||||
var results;
|
||||
results = [];
|
||||
for (x in speech) {
|
||||
results.push(" %" + x);
|
||||
}
|
||||
return results;
|
||||
})()).join('');
|
||||
}
|
||||
})();
|
||||
klass += (function() {
|
||||
switch (false) {
|
||||
case speech.app == null:
|
||||
return " say";
|
||||
case speech.exp == null:
|
||||
return " exp";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
})();
|
||||
return div({
|
||||
className: "message" + klass
|
||||
}, [
|
||||
@ -333,7 +345,7 @@ Message = recl({
|
||||
}, this.convTime(this.props.thought.statement.date))
|
||||
]), div({
|
||||
className: "mess"
|
||||
}, txt, attachments.length ? div({
|
||||
}, mess, attachments.length ? div({
|
||||
className: "fat"
|
||||
}, attachments) : void 0)
|
||||
]);
|
||||
|
Loading…
Reference in New Issue
Block a user