Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
da07e30
new extension.zip
MeechaPooch Feb 19, 2023
f177f56
default chat message
MeechaPooch Feb 19, 2023
5249e4c
chat filtering and logging
MeechaPooch Feb 19, 2023
36cfb53
trim changes in ram on project save
MeechaPooch Feb 19, 2023
c7b23b6
chat into message fix
MeechaPooch Feb 19, 2023
87420f7
load chat on bl share
MeechaPooch Feb 19, 2023
7b92912
dont err msg on couldnt read project
MeechaPooch Feb 19, 2023
d5557d7
truely update extension.zip and version #
MeechaPooch Feb 19, 2023
8aa10e5
log sent messages to discord
MeechaPooch Feb 19, 2023
b4920b0
chat banning
MeechaPooch Feb 19, 2023
10b7fd3
print storage stats
Feb 19, 2023
97253e9
Merge branch 'deploy' of https://github.com/BlockliveScratch/Blockliv…
MeechaPooch Feb 19, 2023
fa8d3ec
nicer looking chat logging
MeechaPooch Feb 19, 2023
729a6fe
dont spam the console with project jsons
MeechaPooch Feb 19, 2023
ea77732
ibid.
MeechaPooch Feb 19, 2023
87aef62
closing bracket
MeechaPooch Feb 20, 2023
cd317da
smooth scale chatbox in and out
MeechaPooch Feb 20, 2023
c2ba0c3
even out share dropdown padding
MeechaPooch Feb 20, 2023
73264ad
increase socket maxHttpBufferSize
MeechaPooch Feb 20, 2023
2494f19
catch move events on workspace refresh
MeechaPooch Feb 20, 2023
9d06489
Merge branch 'deploy'
MeechaPooch Feb 20, 2023
b1e9720
display active user buble on sprite button
MeechaPooch Feb 20, 2023
b1e7395
fix typeo
MeechaPooch Feb 20, 2023
98d3e35
dont show user's own sprite bubble
MeechaPooch Feb 20, 2023
40a892b
lighter box shadow on chat box
MeechaPooch Feb 20, 2023
646befc
why the sockets wonky?
MeechaPooch Feb 21, 2023
f085521
offload stale projects automatically and save less frequently
MeechaPooch Feb 22, 2023
a61ecd6
lower max http buffer again
MeechaPooch Feb 22, 2023
afe6533
actually proxy addsprite properly
MeechaPooch Feb 22, 2023
e80234a
use better overflow-wrap for text bubbles
MeechaPooch Feb 22, 2023
230b15a
add notification of chat bug
MeechaPooch Feb 22, 2023
e672013
empty change list if it is too large
MeechaPooch Feb 22, 2023
e78dd5b
update profanity filter
MeechaPooch Feb 22, 2023
8a91f93
add async saveFolder function (not in use yet)
MeechaPooch Feb 22, 2023
8781c3d
lowercase username chat log compairing
MeechaPooch Feb 22, 2023
5641934
better thing
MeechaPooch Feb 22, 2023
4b7e57e
import blob
MeechaPooch Feb 22, 2023
cfb22fc
dont print reloading
MeechaPooch Feb 22, 2023
0151168
only print for succesful reloads
MeechaPooch Feb 22, 2023
e5cb007
actually use overflow-wrap: anywhere; in the right place
MeechaPooch Feb 22, 2023
e23a024
update filter
MeechaPooch Feb 22, 2023
09786f8
update profanity filter
MeechaPooch Feb 27, 2023
bbf5858
update profanity filter
MeechaPooch Feb 27, 2023
136c982
unshare project from user before sessions
MeechaPooch Mar 2, 2023
2648f43
add 'it'
MeechaPooch Mar 2, 2023
798a3f3
WAY BETTER PROFANITY FILTER
MeechaPooch Mar 10, 2023
fb017f1
backspace FIX????
MeechaPooch Mar 11, 2023
4b1dcc5
actual working backspace (and other key event) fix
MeechaPooch Mar 11, 2023
165a18f
its all better now
MeechaPooch Mar 11, 2023
ced4b19
update for scratch addsprite change
MeechaPooch Mar 11, 2023
5a7fbce
fix oversuppression of move to parent events
Mar 14, 2023
2eb45eb
update badwords
Mar 14, 2023
ead41f3
debug prints
Mar 14, 2023
99fa711
chat notifications and unread counter
Mar 21, 2023
c6242fb
new extension.zip
Mar 21, 2023
7f099d4
update welcome chat message
Mar 23, 2023
7b46463
fix chat emoji showing up on non-blocklive projects
Mar 23, 2023
688e81a
make addsprite proxy both sprite object and arraybuffer inputs
Mar 26, 2023
aae4afa
update extension.zip
Mar 26, 2023
15768d4
rm .DS_Store
Mar 26, 2023
da84be9
mild restyling of popup
Mar 28, 2023
cbc689c
fix the popup
Mar 30, 2023
9128420
add line to project credits
Apr 23, 2023
6b84c8f
update manifest and extension zip
Apr 23, 2023
0b93410
set chat input scrollbar to auto
May 22, 2023
dedd74f
increase chat max length to 500
May 22, 2023
c9f21e9
predeclare uname and upk to hopefully fix cannot read undefined error
May 28, 2023
7eaae5e
Project page
rgantzos May 31, 2023
47e08f4
better list format
rgantzos May 31, 2023
60bfe2c
click on allowed users to open their profile in new tab
Jun 3, 2023
86036f6
move logo to background to make more space
Jun 3, 2023
62e2acd
icnrease manifest version
Jun 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
80 changes: 80 additions & 0 deletions backend/discord-webhook.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import fetch from "node-fetch";

export function postText(text) {// node.js versions pre-v0.18.0 do not support the fetch api and require a polyfill
// const fetch = require('node-fetch');
fetch(
'https://discord.com/api/webhooks/1076983740036816987/_fZ1dIz6L9LcE_im64L9T-vS_F6PyBp7REaW8nexbZ70bu_rFUp9gFE2bX2Baw_8fjNK',
{
method: 'post',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
// the username to be displayed
// username: 'webhook',
// the avatar to be displayed
// avatar_url:'https://cdn.discordapp.com/avatars/411256446638882837/9a12fc7810795ded801fdb0401db0be6.png',
// contents of the message to be sent
content:
text,
// 'user mention: <@279098137484722176>, role mention: <@&496160161459863552>, channel mention: <#508500699458306049>',
// enable mentioning of individual users or roles, but not @everyone/@here
// allowed_mentions: {
// parse: ['users', 'roles'],
// },
// embeds to be sent
// embeds: [
// {
// // decimal number colour of the side of the embed
// color: 11730954,
// // author
// // - icon next to text at top (text is a link)
// author: {
// name: 'dragonwocky',
// url: 'https://dragonwocky.me/',
// icon_url: 'https://dragonwocky.me/assets/avatar.jpg',
// },
// // embed title
// // - link on 2nd row
// title: 'title',
// url:
// 'https://gist.github.com/dragonwocky/ea61c8d21db17913a43da92efe0de634',
// // thumbnail
// // - small image in top right corner.
// thumbnail: {
// url:
// 'https://cdn.discordapp.com/avatars/411256446638882837/9a12fc7810795ded801fdb0401db0be6.png',
// },
// // embed description
// // - text on 3rd row
// description: 'description',
// // custom embed fields: bold title/name, normal content/value below title
// // - located below description, above image.
// fields: [
// {
// name: 'field 1',
// value: 'value',
// },
// {
// name: 'field 2',
// value: 'other value',
// },
// ],
// // image
// // - picture below description(and fields)
// image: {
// url:
// 'http://tolkiengateway.net/w/images/thumb/7/75/J.R.R._Tolkien_-_Ring_verse.jpg/300px-J.R.R._Tolkien_-_Ring_verse.jpg',
// },
// // footer
// // - icon next to text at bottom
// footer: {
// text: 'footer',
// icon_url:
// 'https://cdn.discordapp.com/avatars/411256446638882837/9a12fc7810795ded801fdb0401db0be6.png',
// },
// },
// ],
}),
}
);}
14 changes: 14 additions & 0 deletions backend/filesave.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fs from 'fs'
import fsp from 'fs/promises'
import path from 'path';
import sanitize from 'sanitize-filename';

Expand Down Expand Up @@ -32,6 +33,19 @@ export function saveMapToFolder(obj, dir) {
}
})
}
export async function saveMapToFolderAsync(obj, dir) {
// if obj is null, return
if(!obj) {console.warn('tried to save null object to dir: ' + dir); return}
// make directory if it doesnt exist
if (!fs.existsSync(dir)){fs.mkdirSync(dir,{recursive:true})}
let promises = []
Object.entries(obj).forEach(entry=>{
entry[0] = sanitize(entry[0] + '')
if(entry[0] == '') {return}
promises.push(fsp.writeFile(dir+path.sep+entry[0],JSON.stringify(entry[1])).catch(e=>console.error('Error when saving filename: ' + e)))
});
await Promise.all(promises)
}
export function loadMapFromFolder(dir) {
let obj = {}
// check that directory exists, otherwise return empty obj
Expand Down
Loading