2020-06-24 21:34:53 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2021-02-22 03:13:47 +00:00
|
|
|
<link rel=stylesheet href=/style.css />
|
|
|
|
<link rel=stylesheet href=/colors.css />
|
2021-02-23 05:53:03 +00:00
|
|
|
<title><%~ it.config.title.replace('{username}',it.streamerName) %></title>
|
2020-11-01 20:07:16 +00:00
|
|
|
<script>
|
|
|
|
window.loggedIn = <%= it.loggedIn %>;
|
|
|
|
window.validStates = <%~ it.validStates %>;
|
|
|
|
window.isStreamer = <%= it.isStreamer %>;
|
|
|
|
</script>
|
2020-07-04 06:22:28 +00:00
|
|
|
<script src="main.js" defer></script>
|
2020-06-24 21:34:53 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2020-09-13 18:12:52 +00:00
|
|
|
<div id="navbar">
|
2020-11-10 22:09:27 +00:00
|
|
|
<div id="nav-streamerpic"><a href="https://twitch.tv/<%= it.streamerName %>"><img src="<%= it.streamerProfilePicture %>" /></a></div>
|
2021-02-23 05:53:03 +00:00
|
|
|
<div id="nav-title"><%~ it.config.title.replace('{username}',`<a href="https://twitch.tv/${it.streamerName}">${it.streamerName}</a>`) %></div>
|
2020-07-05 00:51:24 +00:00
|
|
|
<div id="nav-requests"><a href="/">Requests</a></div>
|
2020-08-08 04:32:06 +00:00
|
|
|
<%- if (it.loggedIn) { -%>
|
2020-07-05 22:20:22 +00:00
|
|
|
<div id="nav-addrequest"><a href="#" onclick="openAddRequestModal()">Add Request</a></div>
|
2021-02-22 06:25:23 +00:00
|
|
|
<%- if (it.isStreamer) { -%>
|
|
|
|
<div id="nav-streamersettings"><a href="#" onclick="openStreamerSettingsModal()">Streamer Settings</a></div>
|
|
|
|
<%- } %>
|
2020-07-05 21:15:30 +00:00
|
|
|
<div id="nav-userpic"><img src="<%= it.userProfilePicture %>" /></div>
|
|
|
|
<div id="nav-username"><%= it.userName %></div>
|
|
|
|
<div id="nav-logout"><a href="/logout">Logout</a></div>
|
|
|
|
<%- } else { // Not logged in -%>
|
2020-07-07 05:02:19 +00:00
|
|
|
<div id="nav-login"><a href="https://id.twitch.tv/oauth2/authorize?client_id=<%=it.clientId%>&redirect_uri=<%=it.urlPrefix%>/callback&response_type=code">Login</a></div>
|
2020-07-05 21:15:30 +00:00
|
|
|
<%- } %>
|
2020-07-05 00:51:24 +00:00
|
|
|
</div>
|
|
|
|
<div id="main">
|
|
|
|
<div id="requests"></div><br>
|
2021-02-26 02:52:57 +00:00
|
|
|
<div id="tableSettings">
|
|
|
|
<span style="width:420px">
|
|
|
|
Count:
|
|
|
|
<select id="count" value="10" onchange="updateTable()">
|
|
|
|
<option>5</option>
|
|
|
|
<option selected="selected">10</option>
|
|
|
|
<option>25</option>
|
|
|
|
<option>50</option>
|
|
|
|
<option>100</option>
|
|
|
|
</select>
|
|
|
|
</span>
|
|
|
|
<span>
|
|
|
|
<button id="pageBtnFirst" onclick="goToPage(1)"><<</button>
|
|
|
|
<button id="pageBtnPrev" onclick="goToPage(currentPage-1)"><</button>
|
|
|
|
<select id="page" onchange="goToPage(this.value)">
|
|
|
|
<option value=1>1</option>
|
|
|
|
</select>
|
|
|
|
of <span id="totalPages">?</span>
|
|
|
|
<button id="pageBtnNext" onclick="goToPage(currentPage+1)">></button>
|
|
|
|
<button id="pageBtnLast" onclick="goToPage(totalPages)">>></button>
|
|
|
|
</span>
|
|
|
|
<span style="width:420px">
|
|
|
|
<input type="checkbox" id="allRequests" onchange="updateTable()">View learned and rejected requests</input>
|
|
|
|
</span>
|
|
|
|
</div>
|
2020-07-05 00:51:24 +00:00
|
|
|
</div>
|
2020-11-01 20:07:16 +00:00
|
|
|
<div id="modalBackground">
|
2020-07-07 04:24:04 +00:00
|
|
|
<div class="modal" id="messageModal">
|
2021-02-22 06:25:23 +00:00
|
|
|
<div class="modalClose"><a href="#" onclick="closeAllModals()">×</a></div>
|
2020-07-07 04:24:04 +00:00
|
|
|
<span id="messageModalText"></span>
|
|
|
|
</div>
|
|
|
|
<div class="modal" id="addRequestModal">
|
2021-02-22 06:25:23 +00:00
|
|
|
<div class="modalClose"><a href="#" onclick="closeAllModals()">×</a></div>
|
2020-07-05 22:20:22 +00:00
|
|
|
<h1>Add Request</h1>
|
2020-07-07 04:24:04 +00:00
|
|
|
<div class="error" id="addRequestError"></div>
|
2020-07-06 03:16:41 +00:00
|
|
|
<span id="addRequestInputContainer">
|
|
|
|
URL: <input id="addRequestUrl" placeholder="https://www.youtube.com/watch?v=dQw4w9WgXcQ"></input>
|
|
|
|
<button onclick="validateAndSubmitRequest()">Request</button><br>
|
|
|
|
</span>
|
2020-07-05 22:20:22 +00:00
|
|
|
Currently, only Youtube links are accepted.
|
|
|
|
</div>
|
2020-11-01 20:07:16 +00:00
|
|
|
<div class="modal" id="updateRequestModal">
|
2021-02-22 06:25:23 +00:00
|
|
|
<div class="modalClose"><a href="#" onclick="closeAllModals()">×</a></div>
|
2020-11-01 20:07:16 +00:00
|
|
|
<h2>Update Request</h2>
|
|
|
|
<div class="error" id="updateRequestError"></div>
|
|
|
|
<br>
|
|
|
|
<a id="updateRequestUrl"></a>
|
|
|
|
<br>
|
|
|
|
Current Score: <span id="updateRequestModalCurrentScore"></span>
|
|
|
|
<hr>
|
|
|
|
<div>
|
|
|
|
State:
|
|
|
|
<select id="updateRequestStateSelect" onchange="updateRequestState(
|
|
|
|
document.getElementById('updateRequestUrl').innerText,
|
|
|
|
this.value)">Submit</button>
|
|
|
|
)"></select>
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
<div>
|
|
|
|
Modify Score:
|
|
|
|
<input type="number" id="scoreModifierInput"></input>
|
|
|
|
<button onclick="updateRequestScoreModifier(
|
|
|
|
document.getElementById('updateRequestUrl').innerText,
|
|
|
|
document.getElementById('scoreModifierInput').value)">Submit</button>
|
|
|
|
<br>
|
2020-11-10 06:43:16 +00:00
|
|
|
<span id="scoreModifierHelp" class="helptext">
|
2020-11-01 20:07:16 +00:00
|
|
|
Enter a number to add to (or negative to subtract from) the score of
|
|
|
|
a request. Use this for things like donations and channel points
|
|
|
|
redemptions.
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<br>
|
2020-11-10 06:43:16 +00:00
|
|
|
<div>
|
2021-02-22 06:25:23 +00:00
|
|
|
<a href="#" onclick="updateRequestMetadata(
|
2020-11-10 06:43:16 +00:00
|
|
|
document.getElementById('updateRequestUrl').innerText
|
|
|
|
)">Update Request Metadata</a>
|
|
|
|
<br>
|
|
|
|
<span id="updateMetadataHelp" class="helptext">
|
|
|
|
Use this to update metadata about a request (i.e. title) if it
|
|
|
|
is missing (shows URL instead of name) or is outdated.
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<br>
|
2020-11-01 20:07:16 +00:00
|
|
|
<div>
|
|
|
|
<a id="deleteRequestLink" href="#" onclick="openDeleteRequestModal(
|
|
|
|
document.getElementById('updateRequestUrl').innerText
|
|
|
|
)">Delete Request</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal" id="deleteRequestModal">
|
|
|
|
<div class="modalClose"><a href="#" onclick="closeDeleteRequestModal()">×</a></div>
|
|
|
|
<h2>Delete Request</h2>
|
|
|
|
<span style="color: #f00">WARNING:</span>
|
|
|
|
Deleting a request will remove the request and all votes for it from the
|
|
|
|
database. This action is irreversible. It will NOT prevent the request
|
|
|
|
from being made again - use the Rejected state for that. Are you sure
|
|
|
|
you want to delete this request?
|
|
|
|
<br><br>
|
|
|
|
<button onclick="closeDeleteRequestModal()">No</button>
|
|
|
|
<button onclick="deleteRequest(document.getElementById('updateRequestUrl').innerText)">Yes</button>
|
|
|
|
</div>
|
2021-02-22 06:25:23 +00:00
|
|
|
<div class="modal" id="streamerSettingsModal">
|
|
|
|
<div class="modalClose"><a href="#" onclick="closeAllModals()">×</a></div>
|
|
|
|
<h2>Streamer Settings</h2>
|
|
|
|
<div class="error" id="streamerSettingsError"></div>
|
|
|
|
<br>
|
2021-02-23 05:53:03 +00:00
|
|
|
<div id="streamerSettingsMain">
|
|
|
|
<div>
|
|
|
|
<h3 style='margin-bottom: 0.5em'>Vote Point Values</h3>
|
|
|
|
<p>
|
|
|
|
<div id="votepoints">
|
|
|
|
<div style="display: inline-block">User: <input type="number" id="userVotePoints" style="width: 3em" value="<%~ it.config.normaluservotepoints %>"></input></div>
|
|
|
|
<div style="display: inline-block">Follower: <input type="number" id="followerVotePoints" style="width: 3em" value="<%~ it.config.followervotepoints %>"></input></div>
|
|
|
|
<div style="display: inline-block">Subscriber: <input type="number" id="subscriberVotePoints" style="width: 3em" value="<%~ it.config.subscribervotepoints %>"></input></div>
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
<button onclick="updateVotePoints(
|
|
|
|
document.getElementById('userVotePoints').value,
|
|
|
|
document.getElementById('followerVotePoints').value,
|
|
|
|
document.getElementById('subscriberVotePoints').value
|
|
|
|
)">Submit</button>
|
|
|
|
<button onclick="updateVotePoints(10,50,100)">Reset</button>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
<div>
|
|
|
|
<h3 style='margin-bottom: 0.5em'>Customization</h3>
|
|
|
|
<p>
|
|
|
|
Page Title:
|
|
|
|
<input type="text" id="pageTitle" style="width: 15em" value="<%~ it.config.title %>"></input>
|
|
|
|
<button onclick="updatePageTitle(document.getElementById('pageTitle').value)">Submit</button>
|
|
|
|
<button onclick="updatePageTitle('{username}\'s Learn Request Queue')">Reset</button>
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<h3>Colors:</h3>
|
|
|
|
<p>Click a color to change it</p>
|
|
|
|
<b>Background:</b><br>
|
|
|
|
Primary: <input type="color" id="color-bg-primary" value="<%= it.config.colors.bg.primary %>"></input><br>
|
|
|
|
Table: <input type="color" id="color-bg-table" value="<%= it.config.colors.bg.table %>"></input><br>
|
|
|
|
Navbar: <input type="color" id="color-bg-navbar" value="<%= it.config.colors.bg.navbar %>"></input><br>
|
|
|
|
Error: <input type="color" id="color-bg-error" value="<%= it.config.colors.bg.error %>"></input><br>
|
|
|
|
<br>
|
|
|
|
<b>Foreground:</b><br>
|
|
|
|
Primary: <input type="color" id="color-fg-primary" value="<%= it.config.colors.fg.primary %>"></input><br>
|
|
|
|
Link Hover: <input type="color" id="color-fg-ahover" value="<%= it.config.colors.fg.ahover %>"></input><br>
|
|
|
|
Title: <input type="color" id="color-fg-title" value="<%= it.config.colors.fg.title %>"></input><br>
|
|
|
|
<br>
|
|
|
|
<button onclick="updateColors(getColorObject())">Submit</button>
|
|
|
|
<button onclick="updateColors({bg:{error: '#ff0000',table: '#282828',navbar: '#666666',primary: '#444444'},fg: { title: '#eeeeee', ahover: '#ffffff', primary: '#dddddd'}})">Reset</button>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
<div>
|
|
|
|
<h3 style='margin-bottom: 0.5em'>Batch Jobs</h3>
|
|
|
|
<a href="#" onclick="cronRequest('processBans')">Force Refresh Banned Users (NYI)</a>
|
|
|
|
</div>
|
2021-02-22 06:25:23 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-07-05 22:20:22 +00:00
|
|
|
</div>
|
2020-06-24 21:34:53 +00:00
|
|
|
</body>
|
|
|
|
</html>
|