Permalink
Browse files

From week 10, timestamps for all the things, and profiles.

  • Loading branch information...
roncli committed May 19, 2017
1 parent ccb491c commit 807c61344afe3124f4dbc4613f7998d101ee696b
Showing with 404 additions and 132 deletions.
  1. +6 −0 app/site/css/index.css
  2. +231 −131 app/site/js/index.js
  3. +64 −0 app/site/js/profile.js
  4. +71 −0 app/site/modules/chat/twitch/index.js
  5. +31 −0 app/site/profile.htm
  6. +1 −1 app/site/settings.htm
@@ -107,3 +107,9 @@ body {
overflow-y: none;
resize: none;
}

a.userlink, a.userlink:hover, a.userlink:visited {
text-decoration: none;
color: inherit;
cursor: pointer;
}

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,64 @@
const electron = require("electron"),
win = electron.remote.getCurrentWindow();

// # # # ## #
// # # # #
// # # ## ### ## ### ### ### ## # ## # ## ### ## ###
// # # # # # # # # # # # # # # # ### # # # ## #### ## # ## #
// #### # # # # # # # # # # # # # # # ## ## ## #
// #### ### # # ## # # ### # ## # ### ### ## ### ## ##
// #
win.on("profile-set", (channel, username) => {
win.channel = channel;
win.username = username;

document.title = `Hyperdrive Toolkit - Profile - ${username} on ${channel}`;
$(".username").text(username);
});

// # # # # #
// ### # # # # #
// # # # ### ## ## # # # # ## ### ### # ### ## ### ### # #
// ### # # # # # # # # #### # ## # # # # # # # ## # # # # # #
// # # # # # # # # # # # # ## # # # # ## # ## # ## # # # #
// ### # ### ## ## ### # # ## # # ## # ## # ## # # ### #
// #
$(document).ready(() => {
win.emit("profile-get");

$("#ban").on("click", () => {
win.emit("command", "ban", win.channel, win.username, $("#ban-reason").val());
});

$("#unban").on("click", () => {
win.emit("command", "unban", win.channel, win.username);
});

$("#timeout").on("click", () => {
win.emit("command", "timeout", win.channel, win.username, $("#timeout-time").val(), $("#ban-reason").val());
});

$("#mod").on("click", () => {
win.emit("command", "mod", win.channel, win.username);
});

$("#unmod").on("click", () => {
win.emit("command", "unmod", win.channel, win.username);
});

$("#twitch").on("click", () => {
electron.shell.openExternal(`http://twitch.tv/${win.username}`);
});

$("#join").on("click", () => {
win.emit("command", "join", `#${win.username}`);
});

$("#follow").on("click", () => {
win.emit("command", "follow", win.username);
});

$("#unfollow").on("click", () => {
win.emit("command", "unfollow", win.username);
});
});
@@ -323,6 +323,77 @@ class Twitch extends Chat {
return this.tmi.say(channel, command);
}

// #
// #
// ### ### ###
// # # # # # #
// # # # ## # #
// ### # # # #
ban(channel, username, reason) {
return this.tmi.ban(channel, username, reason);
}

// #
// #
// # # ### ### ### ###
// # # # # # # # # # #
// # # # # # # # ## # #
// ### # # ### # # # #
unban(channel, username) {
return this.tmi.unban(channel, username);
}

// # # #
// # #
// ### ## # # ## ## # # ###
// # # #### # ## # # # # #
// # # # # ## # # # # #
// ## ### # # ## ## ### ##
timeout(channel, username, seconds, reason) {
return this.tmi.timeout(channel, username, seconds, reason);
}

// #
// #
// # # ## ###
// #### # # # #
// # # # # # #
// # # ## ###
mod(channel, username) {
return this.tmi.mod(channel, username);
}

// #
// #
// # # ### # # ## ###
// # # # # #### # # # #
// # # # # # # # # # #
// ### # # # # ## ###
unmod(channel, username) {
return this.tmi.unmod(channel, username);
}

// # ## ##
// # # # #
// # ## # # ## # #
// ### # # # # # # # #
// # # # # # # # ####
// # ## ### ### ## ####
follow(username) {
// TODO: Allow user to set whether they receive notifications when the channel goes live.
return this.api.userFollowChannel(this.username, username, this.accessToken);
}

// # ## ##
// # # # #
// # # ### # ## # # ## # #
// # # # # ### # # # # # # # #
// # # # # # # # # # # # ####
// ### # # # ## ### ### ## ####
unfollow(username) {
return this.api.userUnfollowChannel(this.username, username, this.accessToken);
}

// # ## #
// # # # #
// ### ## ### # ### ### ## ### # #
@@ -0,0 +1,31 @@
<html>
<head>
<script src="../node_modules/jquery/dist/jquery.min.js"></script>
<script>$ = jQuery = require("jquery")</script>
<script src="js/profile.js"></script>
</head>
<body>
<button id="ban">Ban</button>
<button id="unban">Unban</button>
Timeout:
<select id="timeout-time">
<option value="1">Purge</option>
<option value="60">1 minute</option>
<option value="300">5 minutes</option>
<option value="900">15 minutes</option>
<option value="1800">30 minutes</option>
</select>
<button id="timeout">Timeout</button>
<br />
Ban Reason: <input type="text" id="ban-reason" />
<br /><br />
<button id="mod">Mod</button>
<button id="unmod">Unmod</button>
<br /><br />
<button id="twitch">twitch.tv/<span class="username"></span></button>
<button id="join">Join #<span class="username"></span></button>
<br /><br />
<button id="follow">Follow</button>
<button id="unfollow">Unfollow</button>
</body>
</html>
@@ -51,7 +51,7 @@
<div id="colors-chat-highlight" data-format="hex" class="input-group colorpicker-component">
<input type="text" class="form-control" />
<span class="input-group-addon"><i></i></span>
</div>
</div><br />
</div>
<div class="col-sm-6">
<div>Font:</div>

0 comments on commit 807c613

Please sign in to comment.