This commit is contained in:
Galen Wolfe-Pauly 2015-03-04 17:51:03 -08:00
parent ec2b8f56fd
commit bda5010311
9 changed files with 119 additions and 137 deletions

View File

@ -0,0 +1,12 @@
# installing
`npm install`
# building
in `src/js/`:
`watchify -v -t coffeeify -o main.js main.coffee`
in `src/css/`:
`stylus -w main.styl`

View File

@ -70,3 +70,15 @@
font-weight: 500; font-weight: 500;
font-style: normal; font-style: normal;
} }
@font-face {
font-family: "scp";
src: url("http://storage.googleapis.com/urbit-extra/scp-bold.woff");
font-weight: 600;
font-style: normal;
}
@font-face {
font-family: "scp";
src: url("http://storage.googleapis.com/urbit-extra/scp-black.woff");
font-weight: 700;
font-style: normal;
}

View File

@ -202,7 +202,9 @@ body
vertical-align top vertical-align top
.attr .attr
color #D7D7D7 text-align right
display inline-block
margin-right .3rem
.attr .iden .attr .iden
color #000 color #000
@ -212,7 +214,6 @@ body
.mess .mess
font-size .9rem font-size .9rem
line-height 1.6rem
letter-spacing .03rem letter-spacing .03rem
word-wrap break-word word-wrap break-word
max-width 31rem max-width 31rem

View File

@ -1,7 +1,7 @@
moment = require 'moment-timezone' moment = require 'moment-timezone'
recl = React.createClass recl = React.createClass
[div,input,textarea] = [React.DOM.div,React.DOM.input,React.DOM.textarea] [div,br,input,textarea] = [React.DOM.div,React.DOM.br,React.DOM.input,React.DOM.textarea]
MessageStore = require '../stores/MessageStore.coffee' MessageStore = require '../stores/MessageStore.coffee'
StationStore = require '../stores/StationStore.coffee' StationStore = require '../stores/StationStore.coffee'
@ -29,14 +29,16 @@ Message = recl
console.log delivery console.log delivery
name = if @props.name then @props.name else "" name = if @props.name then @props.name else ""
audi = _.remove _.keys(@props.thought.audience), (stat) => audi = _.keys(@props.thought.audience)
stat isnt "~"+window.urb.ship+"/"+@props.station # audi = _.remove _.keys(@props.thought.audience), (stat) =>
# stat isnt "~"+window.urb.ship+"/"+@props.station
audi = audi.join " " audi = audi.join " "
div {className:"message "+pendingClass}, [ div {className:"message "+pendingClass}, [
(div {className:"attr"}, [ (div {className:"attr"}, [
(Member {ship:@props.ship}, "")
div {className:"audi"}, "#{audi}" div {className:"audi"}, "#{audi}"
(Member {ship:@props.ship}, "")
(br {},"")
div {className:"time"}, @convTime @props.thought.statement.date div {className:"time"}, @convTime @props.thought.statement.date
]) ])
div {className:"mess"}, @props.thought.statement.speech.lin.txt div {className:"mess"}, @props.thought.statement.speech.lin.txt
@ -51,7 +53,7 @@ module.exports = recl
last:MessageStore.getLast() last:MessageStore.getLast()
fetching:MessageStore.getFetching() fetching:MessageStore.getFetching()
listening:MessageStore.getListening() listening:MessageStore.getListening()
station:StationStore.getStation() station:"court"
stations:StationStore.getStations() stations:StationStore.getStations()
configs:StationStore.getConfigs() configs:StationStore.getConfigs()
typing:MessageStore.getTyping() typing:MessageStore.getTyping()
@ -106,9 +108,10 @@ module.exports = recl
_station = "~"+window.urb.ship+"/"+station _station = "~"+window.urb.ship+"/"+station
sources = _.clone @state.configs[@state.station]?.sources ? [] sources = _.clone @state.configs[@state.station]?.sources ? []
sources.push _station sources.push _station
_messages = _.filter @state.messages, (_message) -> _messages = @state.messages
audience = _.keys(_message.thought.audience) # _messages = _.filter @state.messages, (_message) ->
_.intersection(sources,audience).length > 0 # audience = _.keys(_message.thought.audience)
# _.intersection(sources,audience).length > 0
_messages = _.sortBy _messages, (_message) -> _messages = _.sortBy _messages, (_message) ->
_message.pending = _message.thought.audience[station] _message.pending = _message.thought.audience[station]
_message.thought.statement.time _message.thought.statement.time

View File

@ -15,7 +15,7 @@ module.exports = recl
stateFromStore: -> { stateFromStore: -> {
audi:StationStore.getAudience() audi:StationStore.getAudience()
members:StationStore.getMembers() members:StationStore.getMembers()
station:StationStore.getStation() station:"court"
stations:StationStore.getStations() stations:StationStore.getStations()
configs:StationStore.getConfigs() configs:StationStore.getConfigs()
typing:StationStore.getTyping() typing:StationStore.getTyping()
@ -91,8 +91,8 @@ module.exports = recl
sources = "" sources = ""
station = [] station = []
station.push (a {className:"up",href:"\#/"}, [(div {className:"arow-up"}, "")]) # station.push (a {className:"up",href:"\#/"}, [(div {className:"arow-up"}, "")])
station.push (h1 {},@state.station) # station.push (h1 {},@state.station)
station.push (div {id:"members"},members) station.push (div {id:"members"},members)
parts.push (div {id:"station-container"}, (div {id:"station-meta"},station)) parts.push (div {id:"station-container"}, (div {id:"station-meta"},station))

View File

@ -7,7 +7,7 @@ StationActions = require '../actions/StationActions.coffee'
module.exports = recl module.exports = recl
stateFromStore: -> { stateFromStore: -> {
stations: StationStore.getStations() stations: StationStore.getStations()
station: StationStore.getStation() station: "~zod/court"
} }
getInitialState: -> @stateFromStore() getInitialState: -> @stateFromStore()

View File

@ -14,10 +14,9 @@ module.exports = recl
if window.localStorage then window.localStorage.getItem 'writing' if window.localStorage then window.localStorage.getItem 'writing'
stateFromStore: -> { stateFromStore: -> {
audi:StationStore.getAudience() audi:["~zod/court"]
members:StationStore.getMembers() members:StationStore.getMembers()
typing:StationStore.getTyping() typing:StationStore.getTyping()
station:StationStore.getStation()
} }
getInitialState: -> @stateFromStore() getInitialState: -> @stateFromStore()
@ -35,7 +34,7 @@ module.exports = recl
@typing true @typing true
sendMessage: -> sendMessage: ->
MessageActions.sendMessage @state.station,@$writing.text(),@state.audi MessageActions.sendMessage @state.audi,@$writing.text(),@state.audi
@$length.text "0/69" @$length.text "0/69"
@$writing.text('') @$writing.text('')
@set() @set()
@ -109,13 +108,16 @@ module.exports = recl
name = if iden then iden.name else "" name = if iden then iden.name else ""
k = "writing" k = "writing"
k+= " hidden" if not @state?.station
div {className:k,onClick:@_setFocus}, [ div {className:k}, [
(div {className:"attr"}, [ (div {className:"attr"}, [
(Member iden, "") (Member iden, "")
(div {className:"time"}, @getTime()) (div {className:"time"}, @getTime())
]) ])
(div {
id:"audi"
contentEditable:true
}, "~zod/court")
(div { (div {
id:"writing" id:"writing"
contentEditable:true contentEditable:true

View File

@ -86,26 +86,14 @@ $(() ->
React.unmountComponentAtNode $('#writing-container')[0] React.unmountComponentAtNode $('#writing-container')[0]
React.unmountComponentAtNode $('#messages-container')[0] React.unmountComponentAtNode $('#messages-container')[0]
routes = $c.html ""
'': -> $c.append("<div id='messaging-container'></div>")
clean() $d = $('#messaging-container')
$c.html "<div id='stations-container'></div>" $d.append("<div id='messages-container'></div>")
rend (StationsComponent {}, ""),$('#stations-container')[0] $d.append("<div id='writing-container'></div>")
'/:station': (station) -> $d.append("<div id='station-parts-container'></div>")
clean() $c.append("<div id='scrolling'>BOTTOM</div>")
StationActions.switchStation station rend (StationComponent {}, ""),$('#station-parts-container')[0]
$c.html "" rend (MessagesComponent {}, ""),$('#messages-container')[0]
$c.append("<div id='messaging-container'></div>") rend (WritingComponent {}, ""),$('#writing-container')[0]
$d = $('#messaging-container')
$d.append("<div id='messages-container'></div>")
$d.append("<div id='writing-container'></div>")
$d.append("<div id='station-parts-container'></div>")
$c.append("<div id='scrolling'>BOTTOM</div>")
rend (StationComponent {}, ""),$('#station-parts-container')[0]
rend (MessagesComponent {}, ""),$('#messages-container')[0]
rend (WritingComponent {}, ""),$('#writing-container')[0]
router = Router routes
if not window.location.hash then window.location.hash = "/"
router.init()
) )

View File

@ -37,7 +37,7 @@ module.exports = {
return window.chat.MessagePersistence.get(station, start, end); return window.chat.MessagePersistence.get(station, start, end);
}, },
sendMessage: function(station, message, audience) { sendMessage: function(station, message, audience) {
var k, serial, v, _audi, _message; var _audi, _message, k, serial, v;
serial = window.util.uuid32(); serial = window.util.uuid32();
if (station[0] !== "~") { if (station[0] !== "~") {
station = "~" + window.urb.ship + "/" + station; station = "~" + window.urb.ship + "/" + station;
@ -167,11 +167,11 @@ module.exports = {
},{"../dispatcher/Dispatcher.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/dispatcher/Dispatcher.coffee"}],"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/components/MemberComponent.coffee":[function(require,module,exports){ },{"../dispatcher/Dispatcher.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/dispatcher/Dispatcher.coffee"}],"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/components/MemberComponent.coffee":[function(require,module,exports){
var div, input, recl, textarea, _ref; var div, input, recl, ref, textarea;
recl = React.createClass; 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, React.DOM.input, React.DOM.textarea], div = ref[0], input = ref[1], textarea = ref[2];
module.exports = recl({ module.exports = recl({
render: function() { render: function() {
@ -196,13 +196,13 @@ module.exports = recl({
},{}],"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/components/MessagesComponent.coffee":[function(require,module,exports){ },{}],"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/components/MessagesComponent.coffee":[function(require,module,exports){
var Member, Message, MessageActions, MessageStore, StationActions, StationStore, div, input, moment, recl, textarea, _ref; var Member, Message, MessageActions, MessageStore, StationActions, StationStore, br, div, input, moment, recl, ref, textarea;
moment = require('moment-timezone'); moment = require('moment-timezone');
recl = React.createClass; 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, React.DOM.br, React.DOM.input, React.DOM.textarea], div = ref[0], br = ref[1], input = ref[2], textarea = ref[3];
MessageStore = require('../stores/MessageStore.coffee'); MessageStore = require('../stores/MessageStore.coffee');
@ -239,11 +239,7 @@ Message = recl({
console.log(delivery); console.log(delivery);
} }
name = this.props.name ? this.props.name : ""; name = this.props.name ? this.props.name : "";
audi = _.remove(_.keys(this.props.thought.audience), (function(_this) { audi = _.keys(this.props.thought.audience);
return function(stat) {
return stat !== "~" + window.urb.ship + "/" + _this.props.station;
};
})(this));
audi = audi.join(" "); audi = audi.join(" ");
return div({ return div({
className: "message " + pendingClass className: "message " + pendingClass
@ -251,11 +247,11 @@ Message = recl({
div({ div({
className: "attr" className: "attr"
}, [ }, [
Member({ div({
ship: this.props.ship
}, ""), div({
className: "audi" className: "audi"
}, "" + audi), div({ }, "" + audi), Member({
ship: this.props.ship
}, ""), br({}, ""), div({
className: "time" className: "time"
}, this.convTime(this.props.thought.statement.date)) }, this.convTime(this.props.thought.statement.date))
]), div({ ]), div({
@ -274,7 +270,7 @@ module.exports = recl({
last: MessageStore.getLast(), last: MessageStore.getLast(),
fetching: MessageStore.getFetching(), fetching: MessageStore.getFetching(),
listening: MessageStore.getListening(), listening: MessageStore.getListening(),
station: StationStore.getStation(), station: "court",
stations: StationStore.getStations(), stations: StationStore.getStations(),
configs: StationStore.getConfigs(), configs: StationStore.getConfigs(),
typing: MessageStore.getTyping() typing: MessageStore.getTyping()
@ -335,16 +331,12 @@ module.exports = recl({
return this.setState(this.stateFromStore()); return this.setState(this.stateFromStore());
}, },
render: function() { render: function() {
var messages, sources, station, _messages, _ref1, _ref2, _station; var _messages, _station, messages, ref1, ref2, sources, station;
station = this.state.station; station = this.state.station;
_station = "~" + window.urb.ship + "/" + station; _station = "~" + window.urb.ship + "/" + station;
sources = _.clone((_ref1 = (_ref2 = this.state.configs[this.state.station]) != null ? _ref2.sources : void 0) != null ? _ref1 : []); sources = _.clone((ref1 = (ref2 = this.state.configs[this.state.station]) != null ? ref2.sources : void 0) != null ? ref1 : []);
sources.push(_station); sources.push(_station);
_messages = _.filter(this.state.messages, function(_message) { _messages = this.state.messages;
var audience;
audience = _.keys(_message.thought.audience);
return _.intersection(sources, audience).length > 0;
});
_messages = _.sortBy(_messages, function(_message) { _messages = _.sortBy(_messages, function(_message) {
_message.pending = _message.thought.audience[station]; _message.pending = _message.thought.audience[station];
return _message.thought.statement.time; return _message.thought.statement.time;
@ -373,11 +365,11 @@ module.exports = recl({
},{"../actions/MessageActions.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/actions/MessageActions.coffee","../actions/StationActions.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/actions/StationActions.coffee","../stores/MessageStore.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/stores/MessageStore.coffee","../stores/StationStore.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/stores/StationStore.coffee","./MemberComponent.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/components/MemberComponent.coffee","moment-timezone":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/node_modules/moment-timezone/index.js"}],"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/components/StationComponent.coffee":[function(require,module,exports){ },{"../actions/MessageActions.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/actions/MessageActions.coffee","../actions/StationActions.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/actions/StationActions.coffee","../stores/MessageStore.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/stores/MessageStore.coffee","../stores/StationStore.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/stores/StationStore.coffee","./MemberComponent.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/components/MemberComponent.coffee","moment-timezone":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/node_modules/moment-timezone/index.js"}],"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/components/StationComponent.coffee":[function(require,module,exports){
var Member, StationActions, StationStore, a, div, h1, input, recl, textarea, _ref; var Member, StationActions, StationStore, a, div, h1, input, recl, ref, textarea;
recl = React.createClass; recl = React.createClass;
_ref = [React.DOM.div, React.DOM.input, React.DOM.textarea, React.DOM.h1, React.DOM.a], div = _ref[0], input = _ref[1], textarea = _ref[2], h1 = _ref[3], a = _ref[4]; ref = [React.DOM.div, React.DOM.input, React.DOM.textarea, React.DOM.h1, React.DOM.a], div = ref[0], input = ref[1], textarea = ref[2], h1 = ref[3], a = ref[4];
StationStore = require('../stores/StationStore.coffee'); StationStore = require('../stores/StationStore.coffee');
@ -390,7 +382,7 @@ module.exports = recl({
return { return {
audi: StationStore.getAudience(), audi: StationStore.getAudience(),
members: StationStore.getMembers(), members: StationStore.getMembers(),
station: StationStore.getStation(), station: "court",
stations: StationStore.getStations(), stations: StationStore.getStations(),
configs: StationStore.getConfigs(), configs: StationStore.getConfigs(),
typing: StationStore.getTyping(), typing: StationStore.getTyping(),
@ -421,7 +413,7 @@ module.exports = recl({
return this.setState(this.stateFromStore()); return this.setState(this.stateFromStore());
}, },
_keyUp: function(e) { _keyUp: function(e) {
var v, _sources; var _sources, v;
if (e.keyCode === 13) { if (e.keyCode === 13) {
v = this.$input.val(); v = this.$input.val();
if (this.state.configs[this.state.station].sources.indexOf(v) === -1) { if (this.state.configs[this.state.station].sources.indexOf(v) === -1) {
@ -442,7 +434,7 @@ module.exports = recl({
return StationActions.setSources(this.state.station, _sources); return StationActions.setSources(this.state.station, _sources);
}, },
render: function() { render: function() {
var members, parts, sourceCtrl, sourceInput, sources, station, _remove, _sources; var _remove, _sources, members, parts, sourceCtrl, sourceInput, sources, station;
parts = []; parts = [];
members = []; members = [];
if (this.state.station && this.state.members[this.state.station]) { if (this.state.station && this.state.members[this.state.station]) {
@ -497,15 +489,6 @@ module.exports = recl({
sources = ""; sources = "";
} }
station = []; station = [];
station.push(a({
className: "up",
href: "\#/"
}, [
div({
className: "arow-up"
}, "")
]));
station.push(h1({}, this.state.station));
station.push(div({ station.push(div({
id: "members" id: "members"
}, members)); }, members));
@ -530,11 +513,11 @@ module.exports = recl({
},{"../actions/StationActions.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/actions/StationActions.coffee","../stores/StationStore.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/stores/StationStore.coffee","./MemberComponent.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/components/MemberComponent.coffee"}],"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/components/StationsComponent.coffee":[function(require,module,exports){ },{"../actions/StationActions.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/actions/StationActions.coffee","../stores/StationStore.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/stores/StationStore.coffee","./MemberComponent.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/components/MemberComponent.coffee"}],"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/components/StationsComponent.coffee":[function(require,module,exports){
var StationActions, StationStore, div, input, recl, _ref; var StationActions, StationStore, div, input, recl, ref;
recl = React.createClass; recl = React.createClass;
_ref = [React.DOM.div, React.DOM.input], div = _ref[0], input = _ref[1]; ref = [React.DOM.div, React.DOM.input], div = ref[0], input = ref[1];
StationStore = require('../stores/StationStore.coffee'); StationStore = require('../stores/StationStore.coffee');
@ -544,7 +527,7 @@ module.exports = recl({
stateFromStore: function() { stateFromStore: function() {
return { return {
stations: StationStore.getStations(), stations: StationStore.getStations(),
station: StationStore.getStation() station: "~zod/court"
}; };
}, },
getInitialState: function() { getInitialState: function() {
@ -587,7 +570,7 @@ module.exports = recl({
return e.preventDefault(); return e.preventDefault();
}, },
render: function() { render: function() {
var station, stations, _click, _remove; var _click, _remove, station, stations;
station = this.state.station; station = this.state.station;
_click = this._click; _click = this._click;
_remove = this._remove; _remove = this._remove;
@ -632,11 +615,11 @@ module.exports = recl({
},{"../actions/StationActions.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/actions/StationActions.coffee","../stores/StationStore.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/stores/StationStore.coffee"}],"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/components/WritingComponent.coffee":[function(require,module,exports){ },{"../actions/StationActions.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/actions/StationActions.coffee","../stores/StationStore.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/stores/StationStore.coffee"}],"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/components/WritingComponent.coffee":[function(require,module,exports){
var Member, MessageActions, StationActions, StationStore, div, input, recl, textarea, _ref; var Member, MessageActions, StationActions, StationStore, div, input, recl, ref, textarea;
recl = React.createClass; 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, React.DOM.input, React.DOM.textarea], div = ref[0], input = ref[1], textarea = ref[2];
MessageActions = require('../actions/MessageActions.coffee'); MessageActions = require('../actions/MessageActions.coffee');
@ -659,10 +642,9 @@ module.exports = recl({
}, },
stateFromStore: function() { stateFromStore: function() {
return { return {
audi: StationStore.getAudience(), audi: ["~zod/court"],
members: StationStore.getMembers(), members: StationStore.getMembers(),
typing: StationStore.getTyping(), typing: StationStore.getTyping()
station: StationStore.getStation()
}; };
}, },
getInitialState: function() { getInitialState: function() {
@ -682,7 +664,7 @@ module.exports = recl({
return this.typing(true); return this.typing(true);
}, },
sendMessage: function() { sendMessage: function() {
MessageActions.sendMessage(this.state.station, this.$writing.text(), this.state.audi); MessageActions.sendMessage(this.state.audi, this.$writing.text(), this.state.audi);
this.$length.text("0/69"); this.$length.text("0/69");
this.$writing.text(''); this.$writing.text('');
this.set(); this.set();
@ -698,14 +680,14 @@ module.exports = recl({
return this.set(); return this.set();
}, },
_input: function(e) { _input: function(e) {
var geturl, length, text, url, urls, _i, _len; var geturl, i, len, length, text, url, urls;
text = this.$writing.text(); text = this.$writing.text();
length = text.length; length = text.length;
geturl = new RegExp("(^|[ \t\r\n])((ftp|http|https|gopher|mailto|news|nntp|telnet|wais|file|prospero|aim|webcal):(([A-Za-z0-9$_.+!*(),;/?:@&~=-])|%[A-Fa-f0-9]{2}){2,}(#([a-zA-Z0-9][a-zA-Z0-9$_.+!*(),;/?:@&~=%-]*))?([A-Za-z0-9$_+!*();/?:~-]))", "g"); geturl = new RegExp("(^|[ \t\r\n])((ftp|http|https|gopher|mailto|news|nntp|telnet|wais|file|prospero|aim|webcal):(([A-Za-z0-9$_.+!*(),;/?:@&~=-])|%[A-Fa-f0-9]{2}){2,}(#([a-zA-Z0-9][a-zA-Z0-9$_.+!*(),;/?:@&~=%-]*))?([A-Za-z0-9$_+!*();/?:~-]))", "g");
urls = text.match(geturl); urls = text.match(geturl);
if (urls !== null && urls.length > 0) { if (urls !== null && urls.length > 0) {
for (_i = 0, _len = urls.length; _i < _len; _i++) { for (i = 0, len = urls.length; i < len; i++) {
url = urls[_i]; url = urls[i];
length -= url.length; length -= url.length;
length += 10; length += 10;
} }
@ -766,18 +748,14 @@ module.exports = recl({
return this.setState(this.stateFromStore()); return this.setState(this.stateFromStore());
}, },
render: function() { render: function() {
var iden, k, name, ship, user, _ref1; var iden, k, name, ship, user;
user = "~" + window.urb.user; user = "~" + window.urb.user;
iden = StationStore.getMember(user); iden = StationStore.getMember(user);
ship = iden ? iden.ship : user; ship = iden ? iden.ship : user;
name = iden ? iden.name : ""; name = iden ? iden.name : "";
k = "writing"; k = "writing";
if (!((_ref1 = this.state) != null ? _ref1.station : void 0)) {
k += " hidden";
}
return div({ return div({
className: k, className: k
onClick: this._setFocus
}, [ }, [
div({ div({
className: "attr" className: "attr"
@ -786,6 +764,9 @@ module.exports = recl({
className: "time" className: "time"
}, this.getTime()) }, this.getTime())
]), div({ ]), div({
id: "audi",
contentEditable: true
}, "~zod/court"), div({
id: "writing", id: "writing",
contentEditable: true, contentEditable: true,
onFocus: this._focus, onFocus: this._focus,
@ -827,7 +808,7 @@ module.exports = _.merge(new Dispatcher(), {
},{"flux":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/node_modules/flux/index.js"}],"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/main.coffee":[function(require,module,exports){ },{"flux":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/node_modules/flux/index.js"}],"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/main.coffee":[function(require,module,exports){
$(function() { $(function() {
var $c, MessagesComponent, StationActions, StationComponent, StationsComponent, WritingComponent, clean, rend, router, routes; var $c, $d, MessagesComponent, StationActions, StationComponent, StationsComponent, WritingComponent, clean, rend;
StationActions = require('./actions/StationActions.coffee'); StationActions = require('./actions/StationActions.coffee');
rend = React.render; rend = React.render;
window.chat = {}; window.chat = {};
@ -851,10 +832,10 @@ $(function() {
return window.chat.StationPersistence.addSource("main", window.urb.ship, ["~zod/" + name]); return window.chat.StationPersistence.addSource("main", window.urb.ship, ["~zod/" + name]);
}, },
uuid32: function() { uuid32: function() {
var i, str, _i, _str; var _str, i, j, str;
str = "0v"; str = "0v";
str += Math.ceil(Math.random() * 8) + "."; str += Math.ceil(Math.random() * 8) + ".";
for (i = _i = 0; _i <= 5; i = ++_i) { for (i = j = 0; j <= 5; i = ++j) {
_str = Math.ceil(Math.random() * 10000000).toString(32); _str = Math.ceil(Math.random() * 10000000).toString(32);
_str = ("00000" + _str).substr(-5, 5); _str = ("00000" + _str).substr(-5, 5);
str += _str + "."; str += _str + ".";
@ -920,33 +901,16 @@ $(function() {
React.unmountComponentAtNode($('#writing-container')[0]); React.unmountComponentAtNode($('#writing-container')[0]);
return React.unmountComponentAtNode($('#messages-container')[0]); return React.unmountComponentAtNode($('#messages-container')[0]);
}; };
routes = { $c.html("");
'': function() { $c.append("<div id='messaging-container'></div>");
clean(); $d = $('#messaging-container');
$c.html("<div id='stations-container'></div>"); $d.append("<div id='messages-container'></div>");
return rend(StationsComponent({}, ""), $('#stations-container')[0]); $d.append("<div id='writing-container'></div>");
}, $d.append("<div id='station-parts-container'></div>");
'/:station': function(station) { $c.append("<div id='scrolling'>BOTTOM</div>");
var $d; rend(StationComponent({}, ""), $('#station-parts-container')[0]);
clean(); rend(MessagesComponent({}, ""), $('#messages-container')[0]);
StationActions.switchStation(station); return rend(WritingComponent({}, ""), $('#writing-container')[0]);
$c.html("");
$c.append("<div id='messaging-container'></div>");
$d = $('#messaging-container');
$d.append("<div id='messages-container'></div>");
$d.append("<div id='writing-container'></div>");
$d.append("<div id='station-parts-container'></div>");
$c.append("<div id='scrolling'>BOTTOM</div>");
rend(StationComponent({}, ""), $('#station-parts-container')[0]);
rend(MessagesComponent({}, ""), $('#messages-container')[0]);
return rend(WritingComponent({}, ""), $('#writing-container')[0]);
}
};
router = Router(routes);
if (!window.location.hash) {
window.location.hash = "/";
}
return router.init();
}); });
@ -5325,13 +5289,13 @@ module.exports = {
appl: "rodeo", appl: "rodeo",
path: "/f/" + station + "/" + since path: "/f/" + station + "/" + since
}, function(err, res) { }, function(err, res) {
var _ref, _ref1; var ref, ref1;
console.log('m subscription updates'); console.log('m subscription updates');
console.log(res.data); console.log(res.data);
if (res.data.ok === true) { if (res.data.ok === true) {
MessageActions.listeningStation(station); MessageActions.listeningStation(station);
} }
if ((_ref = res.data) != null ? (_ref1 = _ref.grams) != null ? _ref1.tele : void 0 : void 0) { if ((ref = res.data) != null ? (ref1 = ref.grams) != null ? ref1.tele : void 0 : void 0) {
return MessageActions.loadMessages(res.data.grams); return MessageActions.loadMessages(res.data.grams);
} }
}); });
@ -5341,10 +5305,10 @@ module.exports = {
appl: "rodeo", appl: "rodeo",
path: "/f/" + station + "/" + end + "/" + start path: "/f/" + station + "/" + end + "/" + start
}, function(err, res) { }, function(err, res) {
var _ref, _ref1; var ref, ref1;
console.log('get'); console.log('get');
console.log(res); console.log(res);
if ((_ref = res.data) != null ? (_ref1 = _ref.grams) != null ? _ref1.tele : void 0 : void 0) { if ((ref = res.data) != null ? (ref1 = ref.grams) != null ? ref1.tele : void 0 : void 0) {
MessageActions.loadMessages(res.data.grams, true); MessageActions.loadMessages(res.data.grams, true);
return window.urb.unsubscribe({ return window.urb.unsubscribe({
appl: "rodeo", appl: "rodeo",
@ -5441,10 +5405,10 @@ module.exports = {
appl: "rodeo", appl: "rodeo",
path: "/a/court" path: "/a/court"
}, function(err, res) { }, function(err, res) {
var _ref, _ref1; var ref, ref1;
console.log('membership updates'); console.log('membership updates');
console.log(res.data); console.log(res.data);
if ((_ref = res.data) != null ? (_ref1 = _ref.group) != null ? _ref1.global : void 0 : void 0) { if ((ref = res.data) != null ? (ref1 = ref.group) != null ? ref1.global : void 0 : void 0) {
return StationActions.loadMembers(res.data.group.global); return StationActions.loadMembers(res.data.group.global);
} }
}); });
@ -5466,13 +5430,13 @@ module.exports = {
appl: "rodeo", appl: "rodeo",
path: "/ax/" + station path: "/ax/" + station
}, function(err, res) { }, function(err, res) {
var _ref; var ref;
console.log('station subscription updates'); console.log('station subscription updates');
console.log(res.data); console.log(res.data);
if (res.data.ok === true) { if (res.data.ok === true) {
StationActions.listeningStation(station); StationActions.listeningStation(station);
} }
if ((_ref = res.data.group) != null ? _ref.local : void 0) { if ((ref = res.data.group) != null ? ref.local : void 0) {
StationActions.loadMembers(station, res.data.group.local); StationActions.loadMembers(station, res.data.group.local);
} }
if (res.data.config) { if (res.data.config) {
@ -5485,7 +5449,7 @@ module.exports = {
},{"../actions/StationActions.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/actions/StationActions.coffee"}],"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/stores/MessageStore.coffee":[function(require,module,exports){ },{"../actions/StationActions.coffee":"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/actions/StationActions.coffee"}],"/Users/galen/Documents/src/urbit-test/urb/zod/main/pub/talk/src/js/stores/MessageStore.coffee":[function(require,module,exports){
var EventEmitter, MessageDispatcher, MessageStore, moment, _fetching, _last, _listening, _messages, _station, _typing; var EventEmitter, MessageDispatcher, MessageStore, _fetching, _last, _listening, _messages, _station, _typing, moment;
moment = require('moment-timezone'); moment = require('moment-timezone');
@ -5730,8 +5694,8 @@ StationStore = _.merge(new EventEmitter, {
return _station; return _station;
}, },
joinStation: function(station) { joinStation: function(station) {
var _ref; var ref;
if (((_ref = _config.court) != null ? _ref.sources.indexOf(station) : void 0) === -1) { if (((ref = _config.court) != null ? ref.sources.indexOf(station) : void 0) === -1) {
return _config.court.sources.push(station); return _config.court.sources.push(station);
} }
}, },