mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2025-01-19 08:01:07 +00:00
Add teamspeak links
This commit is contained in:
parent
c0d2ae6613
commit
9578b72ac8
2 changed files with 229 additions and 0 deletions
|
@ -263,6 +263,72 @@ var GatherProgress = React.createClass({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var TeamSpeakButton = React.createClass({
|
||||||
|
getDefaultProps() {
|
||||||
|
let password = "ns2gather";
|
||||||
|
return {
|
||||||
|
url: "ts3server://ensl.org/",
|
||||||
|
password: password,
|
||||||
|
alien: {
|
||||||
|
channel: "NS2 Gather/Gather #1/Alien (Team Y)",
|
||||||
|
password: password
|
||||||
|
},
|
||||||
|
marine: {
|
||||||
|
channel: "NS2 Gather/Gather #1/Marine (Team X)",
|
||||||
|
password: password
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
marineUrl() {
|
||||||
|
this.teamSpeakUrl(this.props.marine);
|
||||||
|
},
|
||||||
|
alienUrl() {
|
||||||
|
this.teamSpeakUrl(this.props.alien);
|
||||||
|
},
|
||||||
|
teamSpeakUrl(conn) {
|
||||||
|
let params = `channel=${encodeURIComponent(conn.channel)}&channelpassword=${encodeURIComponent(conn.password)}`;
|
||||||
|
return (`${this.props.url}?${params}`);
|
||||||
|
},
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<div className="btn-group dropup">
|
||||||
|
<button type="button" className="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
Teamspeak <span className="caret"></span>
|
||||||
|
</button>
|
||||||
|
<ul className="dropdown-menu">
|
||||||
|
<li><a href={this.props.url}>Join Teamspeak Lobby</a></li>
|
||||||
|
<li><a href={this.marineUrl()}>Join Marine Teamspeak</a></li>
|
||||||
|
<li><a href={this.alienUrl()}>Join Alien Teamspeak</a></li>
|
||||||
|
<li role="separator" className="divider"></li>
|
||||||
|
<li><a href="#" data-toggle="modal" data-target="#teamspeakmodal">Get Teamspeak Info</a></li>
|
||||||
|
</ul>
|
||||||
|
<div className="modal fade text-left" id="teamspeakmodal">
|
||||||
|
<div className="modal-dialog">
|
||||||
|
<div className="modal-content">
|
||||||
|
<div className="modal-header">
|
||||||
|
<button type="button" className="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
|
<h4 className="modal-title">Teamspeak Server Information</h4>
|
||||||
|
</div>
|
||||||
|
<div className="modal-body">
|
||||||
|
<dl className="dl-horizontal">
|
||||||
|
<dt>Server</dt>
|
||||||
|
<dd>{this.props.url}</dd>
|
||||||
|
<dt>Password</dt>
|
||||||
|
<dd>{this.props.password}</dd>
|
||||||
|
<dt>Marine Channel</dt>
|
||||||
|
<dd>{this.props.marine.channel}</dd>
|
||||||
|
<dt>Alien Channel</dt>
|
||||||
|
<dd>{this.props.alien.channel}</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var GatherActions = React.createClass({
|
var GatherActions = React.createClass({
|
||||||
joinGather(e) {
|
joinGather(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -338,6 +404,7 @@ var GatherActions = React.createClass({
|
||||||
return (
|
return (
|
||||||
<div className="panel-footer text-right">
|
<div className="panel-footer text-right">
|
||||||
<ul className="list-inline no-bottom">
|
<ul className="list-inline no-bottom">
|
||||||
|
<TeamSpeakButton />
|
||||||
{confirmTeam}
|
{confirmTeam}
|
||||||
{inviteButton}
|
{inviteButton}
|
||||||
{joinButton}
|
{joinButton}
|
||||||
|
|
162
public/js/app.js
162
public/js/app.js
|
@ -328,6 +328,167 @@ var GatherProgress = React.createClass({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var TeamSpeakButton = React.createClass({
|
||||||
|
displayName: "TeamSpeakButton",
|
||||||
|
|
||||||
|
getDefaultProps: function getDefaultProps() {
|
||||||
|
var password = "ns2gather";
|
||||||
|
return {
|
||||||
|
url: "ts3server://ensl.org/",
|
||||||
|
password: password,
|
||||||
|
alien: {
|
||||||
|
channel: "NS2 Gather/Gather #1/Alien (Team Y)",
|
||||||
|
password: password
|
||||||
|
},
|
||||||
|
marine: {
|
||||||
|
channel: "NS2 Gather/Gather #1/Marine (Team X)",
|
||||||
|
password: password
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
marineUrl: function marineUrl() {
|
||||||
|
this.teamSpeakUrl(this.props.marine);
|
||||||
|
},
|
||||||
|
alienUrl: function alienUrl() {
|
||||||
|
this.teamSpeakUrl(this.props.alien);
|
||||||
|
},
|
||||||
|
teamSpeakUrl: function teamSpeakUrl(conn) {
|
||||||
|
var params = "channel=" + encodeURIComponent(conn.channel) + "&channelpassword=" + encodeURIComponent(conn.password);
|
||||||
|
return this.props.url + "?" + params;
|
||||||
|
},
|
||||||
|
render: function render() {
|
||||||
|
return React.createElement(
|
||||||
|
"div",
|
||||||
|
{ className: "btn-group dropup" },
|
||||||
|
React.createElement(
|
||||||
|
"button",
|
||||||
|
{ type: "button", className: "btn btn-primary dropdown-toggle", "data-toggle": "dropdown", "aria-haspopup": "true", "aria-expanded": "false" },
|
||||||
|
"Teamspeak ",
|
||||||
|
React.createElement("span", { className: "caret" })
|
||||||
|
),
|
||||||
|
React.createElement(
|
||||||
|
"ul",
|
||||||
|
{ className: "dropdown-menu" },
|
||||||
|
React.createElement(
|
||||||
|
"li",
|
||||||
|
null,
|
||||||
|
React.createElement(
|
||||||
|
"a",
|
||||||
|
{ href: this.props.url },
|
||||||
|
"Join Teamspeak Lobby"
|
||||||
|
)
|
||||||
|
),
|
||||||
|
React.createElement(
|
||||||
|
"li",
|
||||||
|
null,
|
||||||
|
React.createElement(
|
||||||
|
"a",
|
||||||
|
{ href: this.marineUrl() },
|
||||||
|
"Join Marine Teamspeak"
|
||||||
|
)
|
||||||
|
),
|
||||||
|
React.createElement(
|
||||||
|
"li",
|
||||||
|
null,
|
||||||
|
React.createElement(
|
||||||
|
"a",
|
||||||
|
{ href: this.alienUrl() },
|
||||||
|
"Join Alien Teamspeak"
|
||||||
|
)
|
||||||
|
),
|
||||||
|
React.createElement("li", { role: "separator", className: "divider" }),
|
||||||
|
React.createElement(
|
||||||
|
"li",
|
||||||
|
null,
|
||||||
|
React.createElement(
|
||||||
|
"a",
|
||||||
|
{ href: "#", "data-toggle": "modal", "data-target": "#teamspeakmodal" },
|
||||||
|
"Get Teamspeak Info"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
React.createElement(
|
||||||
|
"div",
|
||||||
|
{ className: "modal fade text-left", id: "teamspeakmodal" },
|
||||||
|
React.createElement(
|
||||||
|
"div",
|
||||||
|
{ className: "modal-dialog" },
|
||||||
|
React.createElement(
|
||||||
|
"div",
|
||||||
|
{ className: "modal-content" },
|
||||||
|
React.createElement(
|
||||||
|
"div",
|
||||||
|
{ className: "modal-header" },
|
||||||
|
React.createElement(
|
||||||
|
"button",
|
||||||
|
{ type: "button", className: "close", "data-dismiss": "modal", "aria-label": "Close" },
|
||||||
|
React.createElement(
|
||||||
|
"span",
|
||||||
|
{ "aria-hidden": "true" },
|
||||||
|
"×"
|
||||||
|
)
|
||||||
|
),
|
||||||
|
React.createElement(
|
||||||
|
"h4",
|
||||||
|
{ className: "modal-title" },
|
||||||
|
"Teamspeak Server Information"
|
||||||
|
)
|
||||||
|
),
|
||||||
|
React.createElement(
|
||||||
|
"div",
|
||||||
|
{ className: "modal-body" },
|
||||||
|
React.createElement(
|
||||||
|
"dl",
|
||||||
|
{ className: "dl-horizontal" },
|
||||||
|
React.createElement(
|
||||||
|
"dt",
|
||||||
|
null,
|
||||||
|
"Server"
|
||||||
|
),
|
||||||
|
React.createElement(
|
||||||
|
"dd",
|
||||||
|
null,
|
||||||
|
this.props.url
|
||||||
|
),
|
||||||
|
React.createElement(
|
||||||
|
"dt",
|
||||||
|
null,
|
||||||
|
"Password"
|
||||||
|
),
|
||||||
|
React.createElement(
|
||||||
|
"dd",
|
||||||
|
null,
|
||||||
|
this.props.password
|
||||||
|
),
|
||||||
|
React.createElement(
|
||||||
|
"dt",
|
||||||
|
null,
|
||||||
|
"Marine Channel"
|
||||||
|
),
|
||||||
|
React.createElement(
|
||||||
|
"dd",
|
||||||
|
null,
|
||||||
|
this.props.marine.channel
|
||||||
|
),
|
||||||
|
React.createElement(
|
||||||
|
"dt",
|
||||||
|
null,
|
||||||
|
"Alien Channel"
|
||||||
|
),
|
||||||
|
React.createElement(
|
||||||
|
"dd",
|
||||||
|
null,
|
||||||
|
this.props.alien.channel
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var GatherActions = React.createClass({
|
var GatherActions = React.createClass({
|
||||||
displayName: "GatherActions",
|
displayName: "GatherActions",
|
||||||
|
|
||||||
|
@ -429,6 +590,7 @@ var GatherActions = React.createClass({
|
||||||
React.createElement(
|
React.createElement(
|
||||||
"ul",
|
"ul",
|
||||||
{ className: "list-inline no-bottom" },
|
{ className: "list-inline no-bottom" },
|
||||||
|
React.createElement(TeamSpeakButton, null),
|
||||||
confirmTeam,
|
confirmTeam,
|
||||||
inviteButton,
|
inviteButton,
|
||||||
joinButton
|
joinButton
|
||||||
|
|
Loading…
Reference in a new issue