mirror of
https://github.com/PretendoNetwork/juxtaposition-ui.git
synced 2026-09-08 17:35:32 -05:00
Added support for posting in announcements channel in Admin panel
Added CDN to header whitelist
This commit is contained in:
committed by
jay.poff@outlook.com
parent
8faf55643f
commit
633f74aac8
@@ -4,6 +4,7 @@ const logger = require('../../../../logger');
|
||||
const util = require('../../../../authentication');
|
||||
const config = require('../../../../config.json');
|
||||
const { COMMUNITY } = require('../../../../models/communities');
|
||||
const { POST } = require('../../../../models/post');
|
||||
var router = express.Router();
|
||||
const moment = require('moment');
|
||||
var multer = require('multer');
|
||||
@@ -591,4 +592,79 @@ router.get('/notifications', function (req, res) {
|
||||
});
|
||||
});
|
||||
|
||||
router.post('/posts/new', upload.none(), function (req, res) {
|
||||
database.connect().then(async e => {
|
||||
if(req.cookies.token === null)
|
||||
throw new Error('No service token supplied');
|
||||
|
||||
let pid = util.data.processServiceToken(req.cookies.token);
|
||||
|
||||
if(pid === null)
|
||||
throw new Error('Invalid credentials supplied');
|
||||
|
||||
let user = await database.getUserByPID(pid);
|
||||
|
||||
if(user !== null)
|
||||
{
|
||||
if(config.authorized_PNIDs.indexOf(user.pid) === -1) {
|
||||
logger.audit('[' + user.user_id + ' - ' + user.pid + '] attempted to create a community and is not authorized');
|
||||
throw new Error('Invalid credentials supplied');
|
||||
}
|
||||
let community = await database.getCommunityByID(req.body.olive_community_id);
|
||||
let appData = "";
|
||||
if (req.body.app_data) {
|
||||
appData = req.body.app_data.replace(/\0/g, "").trim();
|
||||
}
|
||||
let painting = "", paintingURI = "";
|
||||
if (req.body.painting && req.body.painting !== 'eJztwTEBACAMA7DCNRlIQRbu4ZoEviTJTNvjZNUFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL55fYLL3w==') {
|
||||
painting = req.body.painting.replace(/\0/g, "").trim();
|
||||
paintingURI = await util.data.processPainting(painting);
|
||||
}
|
||||
let screenshot = "";
|
||||
if (req.body.screenshot) {
|
||||
screenshot = req.body.screenshot.replace(/\0/g, "").trim();
|
||||
}
|
||||
const document = {
|
||||
title_id: community.title_id[0],
|
||||
community_id: community.community_id,
|
||||
screen_name: user.user_id,
|
||||
body: req.body.body,
|
||||
app_data: appData,
|
||||
painting: painting,
|
||||
painting_uri: paintingURI,
|
||||
screenshot: screenshot,
|
||||
country_id: 49,
|
||||
created_at: new Date(),
|
||||
feeling_id: req.body.emotion,
|
||||
id: snowflake.nextId(),
|
||||
is_autopost: req.body.is_autopost,
|
||||
is_spoiler: req.body.is_spoiler,
|
||||
is_app_jumpable: req.body.is_app_jumpable,
|
||||
language_id: req.body.language_id,
|
||||
mii: user.mii,
|
||||
mii_face_url: user.pfp_uri,
|
||||
pid: pid,
|
||||
platform_id: 0,
|
||||
region_id: 2,
|
||||
verified: user.official
|
||||
};
|
||||
const newPost = new POST(document);
|
||||
newPost.save();
|
||||
res.sendStatus(200);
|
||||
logger.audit('[' + user.user_id + ' - ' + user.pid + '] created community ' + newCommunity.name);
|
||||
}
|
||||
else
|
||||
throw new Error('Invalid account ID or password');
|
||||
|
||||
}).catch(error =>
|
||||
{
|
||||
res.statusCode = 400;
|
||||
let response = {
|
||||
error_code: 400,
|
||||
message: error.message
|
||||
};
|
||||
res.send(response);
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
@@ -220,6 +220,51 @@ router.get('/audit', upload.none(), function (req, res) {
|
||||
|
||||
});
|
||||
|
||||
router.get('/announcements', upload.none(), function (req, res) {
|
||||
|
||||
database.connect().then(async e => {
|
||||
if(req.cookies.token === null)
|
||||
{
|
||||
res.redirect('/login');
|
||||
return;
|
||||
}
|
||||
let pid = util.data.processServiceToken(req.cookies.token);
|
||||
if(pid === null)
|
||||
{
|
||||
res.redirect('/login');
|
||||
return;
|
||||
}
|
||||
let user = await database.getUserByPID(pid);
|
||||
let community = await database.getCommunityByID('announcements');
|
||||
let newPosts = await database.getNewPostsByCommunity(community, 100);
|
||||
let totalNumPosts = await database.getTotalPostsByCommunity(community);
|
||||
|
||||
res.render('admin/admin_announcements.ejs', {
|
||||
community: community,
|
||||
newPosts: newPosts,
|
||||
totalNumPosts: totalNumPosts,
|
||||
user: user,
|
||||
account_server: config.account_server_domain.slice(8),
|
||||
});
|
||||
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 15,
|
||||
message: "SERVER_ERROR"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
router.get('/communities/new', upload.none(), function (req, res) {
|
||||
var communityID = req.query.CID;
|
||||
database.connect().then(async e => {
|
||||
@@ -563,6 +608,47 @@ router.get('/users/:userID/edit', upload.none(), function (req, res) {
|
||||
|
||||
});
|
||||
|
||||
router.get('/posts/new', upload.none(), function (req, res) {
|
||||
|
||||
database.connect().then(async e => {
|
||||
if(req.cookies.token === null)
|
||||
{
|
||||
res.redirect('/login');
|
||||
return;
|
||||
}
|
||||
let pid = util.data.processServiceToken(req.cookies.token);
|
||||
if(pid === null)
|
||||
{
|
||||
res.redirect('/login');
|
||||
return;
|
||||
}
|
||||
let user = await database.getUserByPID(pid);
|
||||
let community = await database.getCommunityByID('announcements');
|
||||
|
||||
res.render('admin/admin_new_post.ejs', {
|
||||
community: community,
|
||||
user: user,
|
||||
account_server: config.account_server_domain.slice(8),
|
||||
});
|
||||
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
res.set("Content-Type", "application/xml");
|
||||
res.statusCode = 400;
|
||||
response = {
|
||||
result: {
|
||||
has_error: 1,
|
||||
version: 1,
|
||||
code: 400,
|
||||
error_code: 15,
|
||||
message: "SERVER_ERROR"
|
||||
}
|
||||
};
|
||||
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
router.get('/login', upload.none(), function (req, res) {
|
||||
|
||||
database.connect().then(async e => {
|
||||
@@ -638,7 +724,7 @@ router.post('/login', upload.none(), function (req, res) {
|
||||
|
||||
let password_hash = await util.data.nintendoPasswordHash(password, user.pid);
|
||||
await request.post({
|
||||
url: "https://" + config.account_server_domain + "/v1/api/oauth20/access_token/generate",
|
||||
url: "http://" + config.account_server_domain + "/v1/api/oauth20/access_token/generate",
|
||||
headers: {
|
||||
'X-Nintendo-Client-ID': config["X-Nintendo-Client-ID"],
|
||||
'X-Nintendo-Client-Secret': config["X-Nintendo-Client-Secret"],
|
||||
@@ -658,9 +744,9 @@ router.post('/login', upload.none(), function (req, res) {
|
||||
else
|
||||
{
|
||||
console.log(body)
|
||||
res.statusCode = 400;
|
||||
res.statusCode = 403;
|
||||
let response = {
|
||||
error_code: 400,
|
||||
error_code: 403,
|
||||
message: 'Invalid account ID or password'
|
||||
};
|
||||
res.send(response);
|
||||
@@ -673,9 +759,9 @@ router.post('/login', upload.none(), function (req, res) {
|
||||
|
||||
}).catch(error =>
|
||||
{
|
||||
res.statusCode = 400;
|
||||
res.statusCode = 504;
|
||||
let response = {
|
||||
error_code: 400,
|
||||
error_code: 504,
|
||||
message: error.message
|
||||
};
|
||||
res.send(response);
|
||||
|
||||
@@ -100,6 +100,7 @@ router.post('/new', upload.none(), async function (req, res, next) {
|
||||
pid: pid,
|
||||
platform_id: paramPackData.platform_id,
|
||||
region_id: paramPackData.region_id,
|
||||
verified: usrObj.official
|
||||
};
|
||||
const newPost = new POST(document);
|
||||
newPost.save();
|
||||
|
||||
@@ -7,7 +7,7 @@ var moment = require('moment');
|
||||
var router = express.Router();
|
||||
|
||||
router.get('/', function (req, res) {
|
||||
res.header('X-Nintendo-WhiteList','1|http,youtube.com,,2|https,youtube.com,,2|http,.youtube.com,,2|https,.youtube.com,,2|http,.ytimg.com,,2|https,.ytimg.com,,2|http,.googlevideo.com,,2|https,.googlevideo.com,,2|https,youtube.com,/embed/,6|https,youtube.com,/e/,6|https,youtube.com,/v/,6|https,www.youtube.com,/embed/,6|https,www.youtube.com,/e/,6|https,www.youtube.com,/v/,6|https,youtube.googleapis.com,/e/,6|https,youtube.googleapis.com,/v/,6|http,maps.googleapis.com,/maps/api/streetview,2|https,maps.googleapis.com,/maps/api/streetview,2|http,cbk0.google.com,/cbk,2|https,cbk0.google.com,/cbk,2|http,cbk1.google.com,/cbk,2|https,cbk1.google.com,/cbk,2|http,cbk2.google.com,/cbk,2|https,cbk2.google.com,/cbk,2|http,cbk3.google.com,/cbk,2|https,cbk3.google.com,/cbk,2|https,.cloudfront.net,,2|https,www.google-analytics.com,/,2|https,stats.g.doubleclick.net,,2|https,www.google.com,/ads/,2|https,ssl.google-analytics.com,,2|http,fonts.googleapis.com,,2|fonts.googleapis.com,,2|https,www.googletagmanager.com,,2|http,miiverse.cc,,2|https,miiverse.cc,,2');
|
||||
res.header('X-Nintendo-WhiteList','1|http,youtube.com,,2|http,portal.cdn.pretendo.cc,,2|https,portal.cdn.pretendo.cc,,2|https,youtube.com,,2|http,.youtube.com,,2|https,.youtube.com,,2|http,.ytimg.com,,2|https,.ytimg.com,,2|http,.googlevideo.com,,2|https,.googlevideo.com,,2|https,youtube.com,/embed/,6|https,youtube.com,/e/,6|https,youtube.com,/v/,6|https,www.youtube.com,/embed/,6|https,www.youtube.com,/e/,6|https,www.youtube.com,/v/,6|https,youtube.googleapis.com,/e/,6|https,youtube.googleapis.com,/v/,6|http,maps.googleapis.com,/maps/api/streetview,2|https,maps.googleapis.com,/maps/api/streetview,2|http,cbk0.google.com,/cbk,2|https,cbk0.google.com,/cbk,2|http,cbk1.google.com,/cbk,2|https,cbk1.google.com,/cbk,2|http,cbk2.google.com,/cbk,2|https,cbk2.google.com,/cbk,2|http,cbk3.google.com,/cbk,2|https,cbk3.google.com,/cbk,2|https,.cloudfront.net,,2|https,www.google-analytics.com,/,2|https,stats.g.doubleclick.net,,2|https,www.google.com,/ads/,2|https,ssl.google-analytics.com,,2|http,fonts.googleapis.com,,2|fonts.googleapis.com,,2|https,www.googletagmanager.com,,2|http,miiverse.cc,,2|https,miiverse.cc,,2');
|
||||
let lang = util.data.processLanguage(req.headers["x-nintendo-parampack"]);
|
||||
database.connect().then(async e => {
|
||||
let pid = util.data.processServiceToken(req.headers["x-nintendo-servicetoken"]);
|
||||
@@ -82,7 +82,7 @@ router.get('/', function (req, res) {
|
||||
});
|
||||
|
||||
router.get('/first', function (req, res) {
|
||||
res.header('X-Nintendo-WhiteList','1|http,youtube.com,,2|https,youtube.com,,2|http,.youtube.com,,2|https,.youtube.com,,2|http,.ytimg.com,,2|https,.ytimg.com,,2|http,.googlevideo.com,,2|https,.googlevideo.com,,2|https,youtube.com,/embed/,6|https,youtube.com,/e/,6|https,youtube.com,/v/,6|https,www.youtube.com,/embed/,6|https,www.youtube.com,/e/,6|https,www.youtube.com,/v/,6|https,youtube.googleapis.com,/e/,6|https,youtube.googleapis.com,/v/,6|http,maps.googleapis.com,/maps/api/streetview,2|https,maps.googleapis.com,/maps/api/streetview,2|http,cbk0.google.com,/cbk,2|https,cbk0.google.com,/cbk,2|http,cbk1.google.com,/cbk,2|https,cbk1.google.com,/cbk,2|http,cbk2.google.com,/cbk,2|https,cbk2.google.com,/cbk,2|http,cbk3.google.com,/cbk,2|https,cbk3.google.com,/cbk,2|https,.cloudfront.net,,2|https,www.google-analytics.com,/,2|https,stats.g.doubleclick.net,,2|https,www.google.com,/ads/,2|https,ssl.google-analytics.com,,2|http,fonts.googleapis.com,,2|fonts.googleapis.com,,2|https,www.googletagmanager.com,,2|http,pretendo.cc,,2|https,pretendo.cc,,2');
|
||||
res.header('X-Nintendo-WhiteList','1|http,youtube.com,,2|http,portal.cdn.pretendo.cc,,2|https,portal.cdn.pretendo.cc,,2|https,youtube.com,,2|http,.youtube.com,,2|https,.youtube.com,,2|http,.ytimg.com,,2|https,.ytimg.com,,2|http,.googlevideo.com,,2|https,.googlevideo.com,,2|https,youtube.com,/embed/,6|https,youtube.com,/e/,6|https,youtube.com,/v/,6|https,www.youtube.com,/embed/,6|https,www.youtube.com,/e/,6|https,www.youtube.com,/v/,6|https,youtube.googleapis.com,/e/,6|https,youtube.googleapis.com,/v/,6|http,maps.googleapis.com,/maps/api/streetview,2|https,maps.googleapis.com,/maps/api/streetview,2|http,cbk0.google.com,/cbk,2|https,cbk0.google.com,/cbk,2|http,cbk1.google.com,/cbk,2|https,cbk1.google.com,/cbk,2|http,cbk2.google.com,/cbk,2|https,cbk2.google.com,/cbk,2|http,cbk3.google.com,/cbk,2|https,cbk3.google.com,/cbk,2|https,.cloudfront.net,,2|https,www.google-analytics.com,/,2|https,stats.g.doubleclick.net,,2|https,www.google.com,/ads/,2|https,ssl.google-analytics.com,,2|http,fonts.googleapis.com,,2|fonts.googleapis.com,,2|https,www.googletagmanager.com,,2|http,pretendo.cc,,2|https,pretendo.cc,,2');
|
||||
let lang = util.data.processLanguage(req.headers["x-nintendo-parampack"]);
|
||||
res.render('portal/first_run.ejs', {
|
||||
cdnURL: config.CDN_domain,
|
||||
|
||||
164
src/webfiles/admin/admin_announcements.ejs
Normal file
164
src/webfiles/admin/admin_announcements.ejs
Normal file
@@ -0,0 +1,164 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Juxt Admin Panel</title>
|
||||
<link rel="stylesheet" type="text/css" href="/css/juxt.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h2 style="display: inline-block; margin-left: 20px">Juxt Admin Panel - <%= user.user_id %></h2> <img style="width: 57px; display: inline-block; position: absolute; right: 8px;" src="http://mii-images.cdn.<%= account_server %>/<%= user.pid %>/normal_face.png">
|
||||
|
||||
<div class="row">
|
||||
<div class="left" style="background-color:#bbb;max-width: 10%;">
|
||||
<ul id="myMenu">
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/communities">Communities</a></li>
|
||||
<li><a href="/audit">Audit Log</a></li>
|
||||
<li><a href="/announcements">Announcements</a></li>
|
||||
<li><a href="/users">Users</a></li>
|
||||
<li><a href="/discovery">Discovery</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="right" style="background-color:#ddd;">
|
||||
<h2><%= community.name %></h2>
|
||||
<div class="community-page-info-container">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<img class="community-page-info-icon" src="/icons/<%= community.community_id %>.png">
|
||||
</td>
|
||||
<td>
|
||||
<h4 class="community-page-description"><%= community.description %></h4>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<button type="button" style="margin-left: 20px; width: 760px; <%if(community.type === 1){%>display: none;<%}%>" onclick="window.location='/posts/new'">New Post</button>
|
||||
<button type="button" style="margin-left: 20px; width: 760px" onclick="window.location='/communities/<%= community.community_id %>/edit'">Edit</button>
|
||||
<div class="community-page-margin-line"></div>
|
||||
<table class="community-page-table-wrapper">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="community-page-shaded-info-container">
|
||||
<h4 class="community-page-table-label">Followers</h4>
|
||||
<h4 class="community-page-table-text"><%= community.followers %></h4>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="community-page-shaded-info-container">
|
||||
<h4 class="community-page-table-label">Posts</h4>
|
||||
<h4 class="community-page-table-text"><%=totalNumPosts%></h4>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="community-page-shaded-info-container" style="width: 275px;">
|
||||
<h4 class="community-page-table-label">Tags</h4>
|
||||
<h4 class="community-page-table-text">N/A</h4>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="community-page-posts-wrapper">
|
||||
<% newPosts.forEach(function(post) { %>
|
||||
<div id="<%= post.id %>">
|
||||
<div class="post-user-info-wrapper">
|
||||
<%if(post.verified) {%>
|
||||
<img class="community-page-post-user-icon verified" src=http://mii-images.cdn.<%= account_server %>/<%= 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<%}%>" onclick="loadUserProfile(<%=post.pid%>)">
|
||||
<span class="community-page-verified-user-badge community-page-verified" style=""></span>
|
||||
<%} else {%>
|
||||
<img class="community-page-post-user-icon" src=http://mii-images.cdn.<%= account_server %>/<%= 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<%}%>" onclick="loadUserProfile(<%=post.pid%>)">
|
||||
<span class="community-page-verified-user-badge community-page-verified" style="display: none;"></span>
|
||||
<%}%>
|
||||
<h2 class="community-page-post-username" onclick="loadUserProfile(<%=post.pid%>)"><%= post.screen_name %></h2>
|
||||
<h4 class="community-page-post-time-stamp"><%= post.created_at %></h4>
|
||||
|
||||
<div class="community-page-post-yeah-button-wrapper">
|
||||
<div class="community-page-post-yeah-button" onclick="deletePost(event, '<%= post.id %>')"></div>
|
||||
</div>
|
||||
<div id="yeah-<%= post.id %>" class="community-page-post-yeah-count"><%= post.empathy_count %> Yeahs</div>
|
||||
</div>
|
||||
<div class="community-page-post-wrapper">
|
||||
<% if(post.body !== '' && post.painting === '' && post.screenshot === '' && !post.url) { %>
|
||||
<h3><%= post.body %></h3>
|
||||
<%} else { %>
|
||||
<% if(post.screenshot !== '') { %>
|
||||
<img class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
|
||||
<%}%>
|
||||
<% if(post.painting !== '') { %>
|
||||
<img class="community-page-post-painting" src="<%= post.painting_uri %>">
|
||||
<%}%>
|
||||
<% if(post.url) { %>
|
||||
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
||||
<%}%>
|
||||
<% if(post.body) { %>
|
||||
<div class="community-page-post-text-overlay">
|
||||
<h3><%= post.body %></h3>
|
||||
</div>
|
||||
<%}%>
|
||||
<%}%>
|
||||
</div>
|
||||
</div>
|
||||
<% }); %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function deletePost(event, postID) {
|
||||
if (event.shiftKey) {
|
||||
var post = document.getElementById(postID);
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState === 4 && this.status === 200) {
|
||||
post.style.display = 'none';
|
||||
}
|
||||
else if (this.readyState === 4){
|
||||
alert('Error: "' + this.statusText + '"\nPlease send code to Jemma on Discord with what you were doing');
|
||||
}
|
||||
};
|
||||
xhttp.open("POST", "/v1/posts/" + postID + '/delete', true);
|
||||
xhttp.send();
|
||||
} else {
|
||||
if(confirm('Delete post?')) {
|
||||
var post = document.getElementById(postID);
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState === 4 && this.status === 200) {
|
||||
post.style.display = 'none';
|
||||
}
|
||||
else if (this.readyState === 4){
|
||||
alert('Error: "' + this.statusText + '"\nPlease send code to Jemma on Discord with what you were doing');
|
||||
}
|
||||
};
|
||||
xhttp.open("POST", "/v1/posts/" + postID + '/delete', true);
|
||||
xhttp.send();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function loadUserPosts() {
|
||||
var id = document.getElementsByClassName('post-user-info-wrapper')[document.getElementsByClassName('post-user-info-wrapper').length - 1].id
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState === 4 && this.status === 200) {
|
||||
document.getElementsByClassName('community-page-posts-wrapper')[0].innerHTML += this.responseText;
|
||||
}
|
||||
else if(this.readyState === 4 && this.status === 204)
|
||||
{
|
||||
document.getElementById('load-more-posts-button').style.display = 'none';
|
||||
}
|
||||
else if (this.readyState === 4){
|
||||
alert('Error: "' + this.statusText + '"\nPlease send code to Jemma on Discord with what you were doing');
|
||||
}
|
||||
};
|
||||
xhttp.open("GET", "/users/loadPosts" + '?postID=' + id, true);
|
||||
xhttp.send();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -15,6 +15,7 @@
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/communities">Communities</a></li>
|
||||
<li><a href="/audit">Audit Log</a></li>
|
||||
<li><a href="/announcements">Announcements</a></li>
|
||||
<li><a href="/users">Users</a></li>
|
||||
<li><a href="/discovery">Discovery</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/communities">Communities</a></li>
|
||||
<li><a href="/audit">Audit Log</a></li>
|
||||
<li><a href="/announcements">Announcements</a></li>
|
||||
<li><a href="/users">Users</a></li>
|
||||
<li><a href="/discovery">Discovery</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/communities">Communities</a></li>
|
||||
<li><a href="/audit">Audit Log</a></li>
|
||||
<li><a href="/announcements">Announcements</a></li>
|
||||
<li><a href="/users">Users</a></li>
|
||||
<li><a href="/discovery">Discovery</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/communities">Communities</a></li>
|
||||
<li><a href="/audit">Audit Log</a></li>
|
||||
<li><a href="/announcements">Announcements</a></li>
|
||||
<li><a href="/users">Users</a></li>
|
||||
<li><a href="/discovery">Discovery</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/communities">Communities</a></li>
|
||||
<li><a href="/audit">Audit Log</a></li>
|
||||
<li><a href="/announcements">Announcements</a></li>
|
||||
<li><a href="/users">Users</a></li>
|
||||
<li><a href="/discovery">Discovery</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/communities">Communities</a></li>
|
||||
<li><a href="/audit">Audit Log</a></li>
|
||||
<li><a href="/announcements">Announcements</a></li>
|
||||
<li><a href="/users">Users</a></li>
|
||||
<li><a href="/discovery">Discovery</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/communities">Communities</a></li>
|
||||
<li><a href="/audit">Audit Log</a></li>
|
||||
<li><a href="/announcements">Announcements</a></li>
|
||||
<li><a href="/users">Users</a></li>
|
||||
<li><a href="/discovery">Discovery</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/communities">Communities</a></li>
|
||||
<li><a href="/audit">Audit Log</a></li>
|
||||
<li><a href="/announcements">Announcements</a></li>
|
||||
<li><a href="/users">Users</a></li>
|
||||
<li><a href="/discovery">Discovery</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/communities">Communities</a></li>
|
||||
<li><a href="/audit">Audit Log</a></li>
|
||||
<li><a href="/announcements">Announcements</a></li>
|
||||
<li><a href="/users">Users</a></li>
|
||||
<li><a href="/discovery">Discovery</a></li>
|
||||
</ul>
|
||||
|
||||
103
src/webfiles/admin/admin_new_post.ejs
Normal file
103
src/webfiles/admin/admin_new_post.ejs
Normal file
@@ -0,0 +1,103 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Edit - <%= community.name %></title>
|
||||
<link rel="stylesheet" type="text/css" href="/css/juxt.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h2 style="display: inline-block; margin-left: 20px">Juxt Admin Panel - <%= user.user_id %></h2> <img style="width: 57px; display: inline-block; position: absolute; right: 8px;" src="http://mii-images.cdn.<%= account_server %>/<%= user.pid %>/normal_face.png">
|
||||
|
||||
<div class="row">
|
||||
<div class="left" style="background-color:#bbb;max-width: 10%;">
|
||||
<ul id="myMenu">
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/communities">Communities</a></li>
|
||||
<li><a href="/audit">Audit Log</a></li>
|
||||
<li><a href="/announcements">Announcements</a></li>
|
||||
<li><a href="/users">Users</a></li>
|
||||
<li><a href="/discovery">Discovery</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="right" style="background-color:#ddd;">
|
||||
<h2>New Announcement</h2>
|
||||
<form action="/v1/posts/new" class="post-emotion-radio" enctype="multipart/form-data" target="formSubmitFrame" method="post">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<img class="post-user-icon" src="https://mii-images.cdn.<%= account_server %>/<%= user.pid %>/normal_face.png">
|
||||
<input type="hidden" id="olive_title_id" name="olive_title_id" value="<%= community.title_id[0] %>">
|
||||
<input type="hidden" id="olive_community_id" name="olive_community_id" value="<%= community.community_id %>">
|
||||
<input type="hidden" id="_post_type" name="_post_type" value="body">
|
||||
</td>
|
||||
<td>
|
||||
<div class="post-emotions-wrapper">
|
||||
<label for="post-emotion-0">
|
||||
<input type="radio" name="emotion" id="post-emotion-0" value="0" onclick="changeMiiImageReaction(this)" checked>
|
||||
<span class="post-emotion-0"></span>
|
||||
</label>
|
||||
<label for="post-emotion-1">
|
||||
<input type="radio" name="emotion" id="post-emotion-1" value="1" onclick="changeMiiImageReaction(this)">
|
||||
<span class="post-emotion-1"></span>
|
||||
</label>
|
||||
<label for="post-emotion-2">
|
||||
<input type="radio" name="emotion" id="post-emotion-2" value="2" onclick="changeMiiImageReaction(this)">
|
||||
<span class="post-emotion-2"></span>
|
||||
</label>
|
||||
<label for="post-emotion-3">
|
||||
<input type="radio" name="emotion" id="post-emotion-3" value="3" onclick="changeMiiImageReaction(this)">
|
||||
<span class="post-emotion-3"></span>
|
||||
</label>
|
||||
<label for="post-emotion-4">
|
||||
<input type="radio" name="emotion" id="post-emotion-4" value="4" onclick="changeMiiImageReaction(this)">
|
||||
<span class="post-emotion-4"></span>
|
||||
</label>
|
||||
<label for="post-emotion-5">
|
||||
<input type="radio" name="emotion" id="post-emotion-5" value="5" onclick="changeMiiImageReaction(this)">
|
||||
<span class="post-emotion-5"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="post-emotions-arrow-left"></div>
|
||||
</td>
|
||||
<td>
|
||||
<label class="checkbox-container checkbox-post">Spoilers
|
||||
<input type="checkbox" id="spoiler" name="spoiler" value="true" onclick="wiiuSound.playSoundByName('SE_WAVE_MENU', 1);">
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
<div class="post-screenshot-picker" onclick="loadScreenshots()">
|
||||
<div class="post-screenshot-picker-icon"></div>
|
||||
<div class="post-screenshot-picker-dropdown">
|
||||
<div><img src="" class="post-screenshot-preview" id="post-top-screen-preview" onclick="document.getElementById('screenshot-value').value = wiiuMainApplication.getScreenShot(true);"></div>
|
||||
<div><img src="" class="post-screenshot-preview" id="post-bottom-screen-preview" onclick="document.getElementById('screenshot-value').value = wiiuMainApplication.getScreenShot(false);"></div>
|
||||
<div onclick="document.getElementById('screenshot-value').value = ''; loadScreenshots()">No Screenshot</div>
|
||||
<input type="hidden" id="screenshot-value" name="screenshot" value="">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2" id="post-text-input">
|
||||
<textarea class="post-textarea" id="comment" name="body" placeholder="Enter text here" rows="4" cols="50"></textarea>
|
||||
</td>
|
||||
<td rowspan="2" id="post-painting-input" style="display: none;">
|
||||
<div class="post-memo">
|
||||
<img class="post-memo-preview" id="memo" width="640px" height="240px" src="" style="display: none;" onclick="newPainting(false)">
|
||||
<input type="hidden" id="memo-value" name="painting" value="">
|
||||
</div>
|
||||
</td>
|
||||
<br>
|
||||
</tr>
|
||||
<tr style="height: 70px">
|
||||
<td>
|
||||
<input type="submit" value="Post" class="submit-button" style="margin-left: -124px;" onclick="wiiuSound.playSoundByName('SE_WAVE_MENU', 1);wiiuSound.playSoundByName('BGM_OLV_MAIN_LOOP_NOWAIT', 3);">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<iframe name="formSubmitFrame"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -34,6 +34,7 @@
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/communities">Communities</a></li>
|
||||
<li><a href="/audit">Audit Log</a></li>
|
||||
<li><a href="/announcements">Announcements</a></li>
|
||||
<li><a href="/users">Users</a></li>
|
||||
<li><a href="/discovery">Discovery</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/communities">Communities</a></li>
|
||||
<li><a href="/audit">Audit Log</a></li>
|
||||
<li><a href="/announcements">Announcements</a></li>
|
||||
<li><a href="/users">Users</a></li>
|
||||
<li><a href="/discovery">Discovery</a></li>
|
||||
</ul>
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/communities">Communities</a></li>
|
||||
<li><a href="/audit">Audit Log</a></li>
|
||||
<li><a href="/announcements">Announcements</a></li>
|
||||
<li><a href="/users">Users</a></li>
|
||||
<li><a href="/discovery">Discovery</a></li>
|
||||
</ul>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -7,7 +7,7 @@
|
||||
@font-face {
|
||||
font-family: 'Conv_Poppins-Light';
|
||||
src: url('https://portal.cdn.olv.pretendo.cc/fonts/Poppins-Light.eot');
|
||||
src: local('☺'), url('https://portal.cdn.pretendo.cc/fonts/Poppins-Light.woff') format('woff'), url('https://portal.cdn.pretendo.cc/fonts/Poppins-Light.ttf') format('truetype'), url('https://portal.cdn.olv.pretendo.cc/fonts/Poppins-Light.svg') format('svg');
|
||||
src: local('☺'), url('http://portal.cdn.pretendo.cc/fonts/Poppins-Light.woff') format('woff'), url('http://portal.cdn.pretendo.cc/fonts/Poppins-Light.ttf') format('truetype'), url('http://portal.cdn.olv.pretendo.cc/fonts/Poppins-Light.svg') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user