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

View File

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

View File

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

View File

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

View File

@ -86,26 +86,14 @@ $(() ->
React.unmountComponentAtNode $('#writing-container')[0]
React.unmountComponentAtNode $('#messages-container')[0]
routes =
'': ->
clean()
$c.html "<div id='stations-container'></div>"
rend (StationsComponent {}, ""),$('#stations-container')[0]
'/:station': (station) ->
clean()
StationActions.switchStation station
$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]
rend (WritingComponent {}, ""),$('#writing-container')[0]
router = Router routes
if not window.location.hash then window.location.hash = "/"
router.init()
$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]
rend (WritingComponent {}, ""),$('#writing-container')[0]
)

View File

@ -37,7 +37,7 @@ module.exports = {
return window.chat.MessagePersistence.get(station, start, end);
},
sendMessage: function(station, message, audience) {
var k, serial, v, _audi, _message;
var _audi, _message, k, serial, v;
serial = window.util.uuid32();
if (station[0] !== "~") {
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){
var div, input, recl, textarea, _ref;
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, React.DOM.input, React.DOM.textarea], div = ref[0], input = ref[1], textarea = ref[2];
module.exports = recl({
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){
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');
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');
@ -239,11 +239,7 @@ Message = recl({
console.log(delivery);
}
name = this.props.name ? this.props.name : "";
audi = _.remove(_.keys(this.props.thought.audience), (function(_this) {
return function(stat) {
return stat !== "~" + window.urb.ship + "/" + _this.props.station;
};
})(this));
audi = _.keys(this.props.thought.audience);
audi = audi.join(" ");
return div({
className: "message " + pendingClass
@ -251,11 +247,11 @@ Message = recl({
div({
className: "attr"
}, [
Member({
ship: this.props.ship
}, ""), div({
div({
className: "audi"
}, "" + audi), div({
}, "" + audi), Member({
ship: this.props.ship
}, ""), br({}, ""), div({
className: "time"
}, this.convTime(this.props.thought.statement.date))
]), div({
@ -274,7 +270,7 @@ module.exports = recl({
last: MessageStore.getLast(),
fetching: MessageStore.getFetching(),
listening: MessageStore.getListening(),
station: StationStore.getStation(),
station: "court",
stations: StationStore.getStations(),
configs: StationStore.getConfigs(),
typing: MessageStore.getTyping()
@ -335,16 +331,12 @@ module.exports = recl({
return this.setState(this.stateFromStore());
},
render: function() {
var messages, sources, station, _messages, _ref1, _ref2, _station;
var _messages, _station, messages, ref1, ref2, sources, station;
station = this.state.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);
_messages = _.filter(this.state.messages, function(_message) {
var audience;
audience = _.keys(_message.thought.audience);
return _.intersection(sources, audience).length > 0;
});
_messages = this.state.messages;
_messages = _.sortBy(_messages, function(_message) {
_message.pending = _message.thought.audience[station];
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){
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;
_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');
@ -390,7 +382,7 @@ module.exports = recl({
return {
audi: StationStore.getAudience(),
members: StationStore.getMembers(),
station: StationStore.getStation(),
station: "court",
stations: StationStore.getStations(),
configs: StationStore.getConfigs(),
typing: StationStore.getTyping(),
@ -421,7 +413,7 @@ module.exports = recl({
return this.setState(this.stateFromStore());
},
_keyUp: function(e) {
var v, _sources;
var _sources, v;
if (e.keyCode === 13) {
v = this.$input.val();
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);
},
render: function() {
var members, parts, sourceCtrl, sourceInput, sources, station, _remove, _sources;
var _remove, _sources, members, parts, sourceCtrl, sourceInput, sources, station;
parts = [];
members = [];
if (this.state.station && this.state.members[this.state.station]) {
@ -497,15 +489,6 @@ module.exports = recl({
sources = "";
}
station = [];
station.push(a({
className: "up",
href: "\#/"
}, [
div({
className: "arow-up"
}, "")
]));
station.push(h1({}, this.state.station));
station.push(div({
id: "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){
var StationActions, StationStore, div, input, recl, _ref;
var StationActions, StationStore, div, input, recl, ref;
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');
@ -544,7 +527,7 @@ module.exports = recl({
stateFromStore: function() {
return {
stations: StationStore.getStations(),
station: StationStore.getStation()
station: "~zod/court"
};
},
getInitialState: function() {
@ -587,7 +570,7 @@ module.exports = recl({
return e.preventDefault();
},
render: function() {
var station, stations, _click, _remove;
var _click, _remove, station, stations;
station = this.state.station;
_click = this._click;
_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){
var Member, MessageActions, StationActions, StationStore, div, input, recl, textarea, _ref;
var Member, MessageActions, StationActions, StationStore, 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, React.DOM.input, React.DOM.textarea], div = ref[0], input = ref[1], textarea = ref[2];
MessageActions = require('../actions/MessageActions.coffee');
@ -659,10 +642,9 @@ module.exports = recl({
},
stateFromStore: function() {
return {
audi: StationStore.getAudience(),
audi: ["~zod/court"],
members: StationStore.getMembers(),
typing: StationStore.getTyping(),
station: StationStore.getStation()
typing: StationStore.getTyping()
};
},
getInitialState: function() {
@ -682,7 +664,7 @@ module.exports = recl({
return this.typing(true);
},
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.$writing.text('');
this.set();
@ -698,14 +680,14 @@ module.exports = recl({
return this.set();
},
_input: function(e) {
var geturl, length, text, url, urls, _i, _len;
var geturl, i, len, length, text, url, urls;
text = this.$writing.text();
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");
urls = text.match(geturl);
if (urls !== null && urls.length > 0) {
for (_i = 0, _len = urls.length; _i < _len; _i++) {
url = urls[_i];
for (i = 0, len = urls.length; i < len; i++) {
url = urls[i];
length -= url.length;
length += 10;
}
@ -766,18 +748,14 @@ module.exports = recl({
return this.setState(this.stateFromStore());
},
render: function() {
var iden, k, name, ship, user, _ref1;
var iden, k, name, ship, user;
user = "~" + window.urb.user;
iden = StationStore.getMember(user);
ship = iden ? iden.ship : user;
name = iden ? iden.name : "";
k = "writing";
if (!((_ref1 = this.state) != null ? _ref1.station : void 0)) {
k += " hidden";
}
return div({
className: k,
onClick: this._setFocus
className: k
}, [
div({
className: "attr"
@ -786,6 +764,9 @@ module.exports = recl({
className: "time"
}, this.getTime())
]), div({
id: "audi",
contentEditable: true
}, "~zod/court"), div({
id: "writing",
contentEditable: true,
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){
$(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');
rend = React.render;
window.chat = {};
@ -851,10 +832,10 @@ $(function() {
return window.chat.StationPersistence.addSource("main", window.urb.ship, ["~zod/" + name]);
},
uuid32: function() {
var i, str, _i, _str;
var _str, i, j, str;
str = "0v";
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 = ("00000" + _str).substr(-5, 5);
str += _str + ".";
@ -920,33 +901,16 @@ $(function() {
React.unmountComponentAtNode($('#writing-container')[0]);
return React.unmountComponentAtNode($('#messages-container')[0]);
};
routes = {
'': function() {
clean();
$c.html("<div id='stations-container'></div>");
return rend(StationsComponent({}, ""), $('#stations-container')[0]);
},
'/:station': function(station) {
var $d;
clean();
StationActions.switchStation(station);
$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();
$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]);
});
@ -5325,13 +5289,13 @@ module.exports = {
appl: "rodeo",
path: "/f/" + station + "/" + since
}, function(err, res) {
var _ref, _ref1;
var ref, ref1;
console.log('m subscription updates');
console.log(res.data);
if (res.data.ok === true) {
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);
}
});
@ -5341,10 +5305,10 @@ module.exports = {
appl: "rodeo",
path: "/f/" + station + "/" + end + "/" + start
}, function(err, res) {
var _ref, _ref1;
var ref, ref1;
console.log('get');
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);
return window.urb.unsubscribe({
appl: "rodeo",
@ -5441,10 +5405,10 @@ module.exports = {
appl: "rodeo",
path: "/a/court"
}, function(err, res) {
var _ref, _ref1;
var ref, ref1;
console.log('membership updates');
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);
}
});
@ -5466,13 +5430,13 @@ module.exports = {
appl: "rodeo",
path: "/ax/" + station
}, function(err, res) {
var _ref;
var ref;
console.log('station subscription updates');
console.log(res.data);
if (res.data.ok === true) {
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);
}
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){
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');
@ -5730,8 +5694,8 @@ StationStore = _.merge(new EventEmitter, {
return _station;
},
joinStation: function(station) {
var _ref;
if (((_ref = _config.court) != null ? _ref.sources.indexOf(station) : void 0) === -1) {
var ref;
if (((ref = _config.court) != null ? ref.sources.indexOf(station) : void 0) === -1) {
return _config.court.sources.push(station);
}
},