Catching up the 3DS version of Juxt with the Wii U version. Things are likely still broken, but it works ¯\_(ツ)_/¯

This commit is contained in:
CaramelKat 2022-01-30 19:09:16 -06:00 committed by Jay
parent b1e5511a34
commit bdac28e637
13 changed files with 3218 additions and 50 deletions

3066
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>3DS Testing</title>
<script src="/js/pjax.js"></script>
<script src="/js/juxt.js"></script>
<link rel="stylesheet" type="text/css" href="/css/juxt.css">
</head>
<body>
<div id="main">
<div class="top-screen" <%if(community.CTR_browser_header) {%>style="background: url('<%=community.CTR_browser_header%>')"<%}%>>
<div class="header-description">
<p>
<% community.description %>
</p>
</div>
<div id="" class="header-icon"><img class="community-page-info-icon" src="<%= cdnURL %>/icons/<%= community.community_id %>.png"></div>
<h2 class="header-title"><%= community.name %></h2>
</div>
<div class="bottom-screen">
<div class="community-page-posts-wrapper">
<div id="community-posts-inner-body">
<% if(totalNumPosts === 0) {%>
<p class="no-posts-text">No Posts</p>
<%} else { %>
<button id="load-more-posts-button" onclick="loadCommunityPosts()" style="background: #1F8A42">Load More Posts</button>
<% newPosts.forEach(function(post) { %>
<%- include('post_template', { post: post, mii_image_CDN: mii_image_CDN, lang: lang, reply: false }); %>
<% }); %>
<%}%>
</div>
</div>
<div class="toolbar-padding"></div>
</div>
<body onload="onStart()"></body>
</body>
</html>

View File

@ -35,7 +35,7 @@
<tr>
<td>
<div class="community-list-wrapper bottom" data-pjax="/communities/<%= popularCommunities[i].community_id %>/new">
<img class="community-list-icon" src="<%= popularCommunities[i].browser_thumbnail %>">
<img class="community-list-icon" src="<%= cdnURL %>/icons/<%= popularCommunities[i].community_id %>.png">
<h2 class="community-list-title"><%= popularCommunities[i].name %></h2>
<h4><%= popularCommunities[i].followers %> followers</h4>
</div>
@ -45,7 +45,7 @@
<tr>
<td>
<div class="community-list-wrapper" data-pjax="/communities/<%= popularCommunities[i].community_id %>/new">
<img class="community-list-icon" src="<%= popularCommunities[i].browser_thumbnail %>">
<img class="community-list-icon" src="<%= cdnURL %>/icons/<%= popularCommunities[i].community_id %>.png">
<h2 class="community-list-title"><%= popularCommunities[i].name %></h2>
<h4><%= popularCommunities[i].followers %> followers</h4>
</div>

View File

@ -15,7 +15,7 @@
<% community.description %>
</p>
</div>
<div id="" class="header-icon"><img class="community-page-info-icon" src="<%= community.browser_thumbnail %>"></div>
<div id="" class="header-icon"><img class="community-page-info-icon" src="<%= cdnURL %>/icons/<%= community.community_id %>.png"></div>
<h2 class="header-title"><%= community.name %></h2>
</div>
<div class="bottom-screen">
@ -153,7 +153,7 @@
<% if(totalNumPosts === 0) {%>
<p class="no-posts-text">No Posts</p>
<%} else { %>
<button id="load-more-posts-button" onclick="loadCommunityPosts()" style="background: #1F8A42">Load More Posts</button>
<button id="load-more-posts-button" data-offset="20" onclick="loadCommunityPosts(this)"><%= lang.global.more %></button>
<% newPosts.forEach(function(post) { %>
<%- include('post_template', { post: post, mii_image_CDN: mii_image_CDN, lang: lang, reply: false }); %>
<% }); %>

View File

@ -746,7 +746,7 @@ h4 {
position: absolute;
text-align: right;
height: 33px;
margin-left: 180px;
right: 65px
}
.community-page-post-user-info-wrapper {

View File

@ -25,7 +25,7 @@
<% if(posts.length === 0) {%>
<p class="no-posts-text"><%= lang.activity_feed.empty %></p>
<%} else { %>
<button id="load-more-posts-button" onclick="loadFeedPosts()"><%= lang.global.more %></button>
<button id="load-more-posts-button" data-offset="20" onclick="loadFeedPosts(this)"><%= lang.global.more %></button>
<% posts.forEach(function(post) { %>
<%- include('post_template', { post: post, mii_image_CDN: mii_image_CDN, lang: lang, reply: false }); %>
<% }); %>

View File

@ -710,6 +710,7 @@ function followCommunity(communityWrapper) {
}
}
function yeah(postNode, postID) {
cave.transition_begin();
var yeahCountElement = document.getElementById('yeah-' + postID);
var yeahcount = yeahCountElement.innerHTML.replace(' Yeahs', '');
if (postNode.className.indexOf("selected") !== -1) {
@ -719,8 +720,9 @@ function yeah(postNode, postID) {
xhr.open("POST", '/posts/empathy', true);
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.send(params);
yeahCountElement.innerHTML = --yeahcount + ' Yeahs';
yeahCountElement.innerHTML = --yeahcount + yeahCountElement.innerHTML.substr(yeahCountElement.innerHTML.indexOf(' '));
cave.snd_playSe('SE_OLV_CANCEL');
cave.transition_end();
}
else {
postNode.className += " selected";
@ -732,18 +734,21 @@ function yeah(postNode, postID) {
xhttp.onreadystatechange = function() {
if (this.readyState === 4 && this.status === 200) {
yeahCountElement.innerHTML = ++yeahcount + ' Yeahs';
//yeahCountElement.innerHTML = ++yeahcount + ' Yeahs';
yeahCountElement.innerHTML = ++yeahcount + yeahCountElement.innerHTML.substr(yeahCountElement.innerHTML.indexOf(' '));
cave.snd_playSe('SE_OLV_MII_ADD');
cave.transition_end();
}
if (this.readyState === 4 && this.status === 423) {
yeahCountElement.innerHTML = ++yeahcount + ' Yeahs';
yeahCountElement.innerHTML = ++yeahcount + yeahCountElement.innerHTML.substr(yeahCountElement.innerHTML.indexOf(' '));
cave.snd_playSe('SE_OLV_MII_ADD');
cave.transition_end();
}
}
xhttp.send(params);
}
}
function loadPosts(type) {
cave.transition_begin();
document.getElementById('recent-tab').className = 'community-page-posts-header-tab';
@ -810,9 +815,9 @@ function loadUserPosts() {
cave.snd_playSe("SE_OLV_OK");
cave.transition_end();
}
function loadCommunityPosts() {
function loadCommunityPosts(element) {
cave.transition_begin();
var postID = document.getElementsByClassName('post-user-info-wrapper')[document.getElementsByClassName('post-user-info-wrapper').length - 1].id
var offset = Number(element.getAttribute('data-offset'));
var id = document.getElementsByClassName('community-page-follow-button')[0].id
var xhttp = new XMLHttpRequest();
var type = 'null';
@ -835,20 +840,22 @@ function loadCommunityPosts() {
cave.error_callFreeErrorViewer(5983000 + this.status, 'Error: "' + this.statusText + '"\nPlease send code to Jemma on Discord with what you were doing');
}
};
xhttp.open("GET", '/communities/' + id + '/' + type + '/loadposts?postID=' + postID, true);
xhttp.open("GET", '/communities/' + id + '/' + type + '/loadposts?offset=' + offset, true);
xhttp.send();
element.setAttribute('data-offset', offset + 10);
cave.snd_playSe("SE_OLV_OK");
cave.transition_end();
}
function loadFeedPosts() {
function loadFeedPosts(element) {
cave.transition_begin();
var postID = document.getElementsByClassName('post-user-info-wrapper')[document.getElementsByClassName('post-user-info-wrapper').length - 1].id
var offset = Number(element.getAttribute('data-offset'));
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState === 4 && this.status === 200) {
document.getElementsByClassName('community-page-posts-wrapper')[0].innerHTML += this.responseText;
initCommunityUsers();
document.getElementById('community-posts-inner-body').innerHTML += this.responseText;
}
else if(this.readyState === 4 && this.status === 204)
{
@ -858,12 +865,14 @@ function loadFeedPosts() {
cave.error_callFreeErrorViewer(5983000 + this.status, 'Error: "' + this.statusText + '"\nPlease send code to Jemma on Discord with what you were doing');
}
};
xhttp.open("GET", '/activity-feed/loadposts?postID=' + postID, true);
xhttp.open("GET", '/activity-feed/loadposts?offset=' + offset, true);
xhttp.send();
element.setAttribute('data-offset', offset + 10);
cave.snd_playSe("SE_OLV_OK");
cave.transition_end();
}
function newPainting(reset) {
if(reset)
cave.memo_clear()

View File

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>3DS Testing</title>
<script src="/js/pjax.js"></script>
<script src="/js/juxt.js"></script>
<link rel="stylesheet" type="text/css" href="/css/juxt.css">
</head>
<body>
<div id="main">
<div class="top-screen">
<div class="header-description">
<p>
</p>
</div>
<div id="" class="header-icon"><img class="community-page-info-icon" src="<%= mii_image_CDN %>/<%= user.pid %>/normal_face.png"></div>
<h2 class="header-title"><%= user.user_id %></h2>
</div>
<div class="bottom-screen">
<%if(user.profile_comment_visibility && user.profile_comment){%>
<div class="communities-wrapper" id="popular-communities" style="margin-top: 10px">
<p class="communities-header"><%=user.profile_comment%></p>
</div>
<%}%>
<table class="community-page-table-wrapper">
<tbody>
<tr>
<td>
<div class="community-page-shaded-info-container">
<h4 class="community-page-table-label">Country</h4>
<h4 class="community-page-table-text"><%if(user.country_visibility){%><%=user.country%><%}else {%>Private<%}%></h4>
</div>
</td>
<td>
<div class="community-page-shaded-info-container">
<h4 class="community-page-table-label">Birthday</h4>
<h4 class="community-page-table-text"><%if(user.birthday_visibility){%><%=moment.utc(user.birthday).format("MMM Do")%><%}else {%>Private<%}%></h4>
</div>
</td>
</tr>
<tr>
<td>
<div class="community-page-shaded-info-container">
<h4 class="community-page-table-label">Game experience</h4>
<h4 class="community-page-table-text">
<%if(user.game_skill === 0) {%>
Beginner
<%} else if(user.game_skill === 1) {%>
Intermediate
<%} else if(user.game_skill === 2) {%>
Expert
<%} else {%>
N/A
<%}%>
</h4>
</div>
</td>
<td>
<div class="community-page-shaded-info-container">
<h4 class="community-page-table-label">Yeahs</h4>
<h4 class="community-page-table-text">N/A</h4>
</div>
</td>
</tr>
</tbody>
</table>
<div class="communities-wrapper" id="popular-communities">
<h1 class="communities-header">User Posts</h1>
</div>
<div class="toolbar-padding"></div>
</div>
<body onload="onStart()"></body>
</body>
</html>

View File

@ -26,13 +26,14 @@
<p class="no-posts-text"><%= lang.notifications.none %></p>
<%} else { %>
<% for(let i = user.notification_list.length - 1; i >= 0; i--) { %>
<% var content; if(user.notification_list[i].content.indexOf('NEW_FOLLOWER') !== -1) content = user.notification_list[i].content.replace('NEW_FOLLOWER', lang.notifications.new_follower); else content = user.notification_list[i].content %>
<% if(i === user.notification_list.length - 1) { %>
<tr class="message-wrapper" data-pjax="<%=user.notification_list[i].link%>">
<td class="messages-unread-badge-wrapper top">
<%if(!user.notification_list[i].read) {%><div class="unread-badge"></div><%}%>
</td>
<td class="messages-list-wrapper top">
<h3 class="notifications-list-content"><%= user.notification_list[i].content %><span style="color: rgba(113,141,148,1)"> - <%= moment(user.notification_list[i].created_at).fromNow() %></span></h3>
<h3 class="notifications-list-content"><%= content %><span style="color: rgba(113,141,148,1)"> - <%= moment(user.notification_list[i].created_at).fromNow() %></span></h3>
</td>
</tr>
<%} else {%>
@ -41,7 +42,7 @@
<%if(!user.notification_list[i].read) {%><div class="unread-badge"></div><%}%>
</td>
<td class="messages-list-wrapper">
<h3 class="notifications-list-content"><%= user.notification_list[i].content %><span style="color: rgba(113,141,148,1)"> - <%= moment(user.notification_list[i].created_at).fromNow() %></span></h3>
<h3 class="notifications-list-content"><%= content %><span style="color: rgba(113,141,148,1)"> - <%= moment(user.notification_list[i].created_at).fromNow() %></span></h3>
</td>
</tr>
<%}%>

View File

@ -1,15 +1,16 @@
<div class="posts-wrapper" id="<%= post.id %>">
<div class="post-user-info-wrapper" id="<%= post.id %>">
<%if(post.verified) {%>
<img class="community-page-post-user-icon verified" src="<%= mii_image_CDN %>/<%= post.pid %>/<% if(post.feeling_id === 1) {%>smile_open_mouth.png<%} else if(post.feeling_id === 2 ) {%>wink_left.png<%} else if(post.feeling_id === 3 ) {%>surprise_open_mouth.png<%} else if(post.feeling_id === 4 ) {%>frustrated.png<%} else if(post.feeling_id === 5 ) {%>sorrow.png<%} else {%>normal_face.png<%}%>" data-pjax="/users/show?pid=<%= post.pid %>">
<span class="community-page-verified-user-badge community-page-verified" style="" data-pjax="/users/show?pid=<%= post.pid %>"></span>
<%} else {%>
<img class="community-page-post-user-icon" src="<%= mii_image_CDN %>/<%= post.pid %>/<% if(post.feeling_id === 1) {%>smile_open_mouth.png<%} else if(post.feeling_id === 2 ) {%>wink_left.png<%} else if(post.feeling_id === 3 ) {%>surprise_open_mouth.png<%} else if(post.feeling_id === 4 ) {%>frustrated.png<%} else if(post.feeling_id === 5 ) {%>sorrow.png<%} else {%>normal_face.png<%}%>" data-pjax="/users/show?pid=<%= post.pid %>">
<span class="community-page-verified-user-badge community-page-verified" style="display: none;" data-pjax="/users/show?pid=<%= post.pid %>"></span>
<%}%>
<h2 class="community-page-post-username" data-pjax="/users/show?pid=<%= post.pid %>"><%= post.screen_name %></h2>
<h4 class="community-page-post-time-stamp"><%= moment(post.created_at).fromNow() %> - <a onclick="cave.snd_playSe('SE_OLV_OK');pjax.loadUrl('/communities/<%= post.community_id %>/new')"><%= communityMap.get(post.community_id) %></a></h4>
<div data-pjax="/users/show?pid=<%= post.pid %>">
<%if(post.verified) {%>
<img class="community-page-post-user-icon verified" src="<%= mii_image_CDN %>/<%= post.pid %>/<% if(post.feeling_id === 1) {%>smile_open_mouth.png<%} else if(post.feeling_id === 2 ) {%>wink_left.png<%} else if(post.feeling_id === 3 ) {%>surprise_open_mouth.png<%} else if(post.feeling_id === 4 ) {%>frustrated.png<%} else if(post.feeling_id === 5 ) {%>sorrow.png<%} else {%>normal_face.png<%}%>" data-pjax="/users/show?pid=<%= post.pid %>">
<span class="community-page-verified-user-badge community-page-verified" style="" data-pjax="/users/show?pid=<%= post.pid %>"></span>
<%} else {%>
<img class="community-page-post-user-icon" src="<%= mii_image_CDN %>/<%= post.pid %>/<% if(post.feeling_id === 1) {%>smile_open_mouth.png<%} else if(post.feeling_id === 2 ) {%>wink_left.png<%} else if(post.feeling_id === 3 ) {%>surprise_open_mouth.png<%} else if(post.feeling_id === 4 ) {%>frustrated.png<%} else if(post.feeling_id === 5 ) {%>sorrow.png<%} else {%>normal_face.png<%}%>" data-pjax="/users/show?pid=<%= post.pid %>">
<span class="community-page-verified-user-badge community-page-verified" style="display: none;" data-pjax="/users/show?pid=<%= post.pid %>"></span>
<%}%>
<h2 class="community-page-post-username" data-pjax="/users/show?pid=<%= post.pid %>"><%= post.screen_name %></h2>
<h4 class="community-page-post-time-stamp"><%= moment(post.created_at).fromNow() %> - <a onclick="cave.snd_playSe('SE_OLV_OK');pjax.loadUrl('/communities/<%= post.community_id %>/new')"><%= communityMap.get(post.community_id) %></a></h4>
</div>
<div class="community-page-post-yeah-button-wrapper <%if(user.likes.indexOf(post.id) !== -1){ %> selected <%}%>">
<div class="community-page-post-yeah-button" onclick="<%if(user.pid !== 1000000000) {%>yeah(this.parentNode, '<%= post.id %>')<%}%>"></div>
</div>

View File

@ -34,7 +34,7 @@
</tr>
<tr>
<td>
<button class="user-menu-button" data-pjax="/users/me">Juxt Announcements</button>
<button class="user-menu-button" data-pjax="/communities/announcements">Juxt Announcements</button>
</td>
</tr>
<tr>

View File

@ -36,7 +36,7 @@
<td>
<div class="community-page-shaded-info-container">
<h4 class="community-page-table-label">Birthday</h4>
<h4 class="community-page-table-text"><%if(user.birthday_visibility){%>N/A<%}else {%>Private<%}%></h4>
<h4 class="community-page-table-text"><%if(user.birthday_visibility){%><%=moment.utc(user.birthday).format("MMM Do")%><%}else {%>Private<%}%></h4>
</div>
</td>
</tr>
@ -67,10 +67,7 @@
</tbody>
</table>
<div class="communities-wrapper" id="popular-communities">
<h1 class="communities-header">Popular Places</h1>
</div>
<div class="communities-wrapper" id="new-communities">
<h1 class="communities-header">New Communities</h1>
<h1 class="communities-header">User Posts</h1>
</div>
<div class="toolbar-padding"></div>
</div>

View File

@ -485,7 +485,7 @@ function loadUserPosts(element, pid) {
xhttp.open("GET", "/users/loadPosts" + '?offset=' + offset + '&pid=' + pid, true);
xhttp.send();
element.dataset.offset = offset + 20;
element.dataset.offset = offset + 10;
wiiuSound.playSoundByName("SE_WAVE_MENU", 1);
wiiuBrowser.showLoadingIcon(!1);
}
@ -517,7 +517,7 @@ function loadCommunityPosts(element, typeCheck) {
xhttp.open("GET", '/communities/' + id + '/' + type + '/loadposts?offset=' + offset, true);
xhttp.send();
element.dataset.offset = offset + 20;
element.dataset.offset = offset + 10;
wiiuSound.playSoundByName("SE_WAVE_MENU", 1);
wiiuBrowser.showLoadingIcon(!1);
}
@ -540,7 +540,7 @@ function loadFeedPosts(element) {
xhttp.open("GET", '/activity-feed/loadposts?offset=' + offset, true);
xhttp.send();
element.dataset.offset = offset + 20;
element.dataset.offset = offset + 10;
wiiuSound.playSoundByName("SE_WAVE_MENU", 1);
wiiuBrowser.showLoadingIcon(!1);
}