Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sitebuilder extension #11

Draft
wants to merge 727 commits into
base: main
Choose a base branch
from
Draft

sitebuilder extension #11

wants to merge 727 commits into from

Conversation

minidogg
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Aug 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
penguinmod-extensions-gallery ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 25, 2024 2:07pm

@JeremyGamer13
Copy link
Member

JeremyGamer13 commented Aug 24, 2023

  • the extension color is invalid which causes it to break the category in PM (remove the extra ff at the end of color1)
  • move init stuffs to the top of the category if it needs to be ran before most of the blocks
  • can the Advanced Stuffs section update the HTML whenever one of the Set or Add blocks are used? right now it looks like the changes only apply when the window is created
  • the extension leaves a warning to load it unsandboxed when it already is unsandboxed by default whenever the extension gets merged

i think this block could benefit from using isTypeable: true in the menu instead of accept reporters
image
image

Comment on lines 38 to 43
name: "Site Builder", // The name of the extension.
description: "Extension for making basic websites with PenguinMod blocks. Do know that this extension isn't completely done yet, I have plans to add more blocks to simplify making sites.", // The description for the extension.
code: "minidogg/sitebuilder.js", // The folder and file name for the code of the extension.
banner: "minidogg/site builder extension banner.png",
creator: "minidogg", // Your username. Adds a link to your profile.
isGitHub: true, // Optional. false means this is your Scratch username, true means this is your GitHub username.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: "Site Builder", // The name of the extension.
description: "Extension for making basic websites with PenguinMod blocks. Do know that this extension isn't completely done yet, I have plans to add more blocks to simplify making sites.", // The description for the extension.
code: "minidogg/sitebuilder.js", // The folder and file name for the code of the extension.
banner: "minidogg/site builder extension banner.png",
creator: "minidogg", // Your username. Adds a link to your profile.
isGitHub: true, // Optional. false means this is your Scratch username, true means this is your GitHub username.
name: "Site Builder",
description: "Extension for making basic websites with PenguinMod blocks.",
code: "minidogg/sitebuilder.js",
banner: "minidogg/site builder extension banner.png",
creator: "minidogg",
isGitHub: true,

No need to leave all these comments in here, it'd just be more information to send

//colors
color1: '#7e69beff',
color2: '#3a286f',
docsURI: 'https://github.com/minidogg/my-penguinmod-extensions/blob/88ff87b8fff13b4e601415d94b201f12c6d475fc/site%20builder/docs/home.md',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
docsURI: 'https://github.com/minidogg/my-penguinmod-extensions/blob/88ff87b8fff13b4e601415d94b201f12c6d475fc/site%20builder/docs/home.md',
// docsURI: 'https://github.com/minidogg/my-penguinmod-extensions/blob/88ff87b8fff13b4e601415d94b201f12c6d475fc/site%20builder/docs/home.md',

If this is still work and progress, might as well comment it out.

Copy link
Collaborator

@NexusKitten NexusKitten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding suggestions for the changes listed in #11 (comment)

id: 'sitebuilder',
name: 'Site Builder',
//colors
color1: '#7e69beff',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
color1: '#7e69beff',
color1: '#7e69be',

Comment on lines 16 to 19
{
blockType: Scratch.BlockType.LABEL,
text: "Note: Extension must be unsandboxed to work in its entirety."
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{
blockType: Scratch.BlockType.LABEL,
text: "Note: Extension must be unsandboxed to work in its entirety."
},

Comment on lines 20 to 75
{
blockType: Scratch.BlockType.LABEL,
text: "Advanced Stuffs"
},
{
opcode: 'site',
blockType: Scratch.BlockType.REPORTER,
text: 'Site HTML'
},
{
opcode: 'setHtml',
blockType: Scratch.BlockType.COMMAND,
text: 'Set Site HTML[html]',
arguments:{
html: {
type: Scratch.ArgumentType.STRING,
defaultValue:"<h1>Hello</h1>"
},
}
},
{
opcode: 'addHtml',
blockType: Scratch.BlockType.COMMAND,
text: 'Add to Site HTML[html]',
arguments:{
html: {
type: Scratch.ArgumentType.STRING,
defaultValue:"<p>World</p>"
},
}
},

{
blockType: Scratch.BlockType.LABEL,
text: "Init stuffs"
},
{
opcode: 'resetHtml',
blockType: Scratch.BlockType.COMMAND,
text: 'Reset Site HTML',
},
{
opcode: 'openSiteWindow',
blockType: Scratch.BlockType.COMMAND,
text: 'Open Site Window',
},
// {
// opcode: 'closeSiteWindow',
// blockType: Scratch.BlockType.COMMAND,
// text: 'Close Site Window',
// },
// {
// opcode: 'updateSiteWindow',
// blockType: Scratch.BlockType.COMMAND,
// text: 'Update Site Window',
// },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{
blockType: Scratch.BlockType.LABEL,
text: "Advanced Stuffs"
},
{
opcode: 'site',
blockType: Scratch.BlockType.REPORTER,
text: 'Site HTML'
},
{
opcode: 'setHtml',
blockType: Scratch.BlockType.COMMAND,
text: 'Set Site HTML[html]',
arguments:{
html: {
type: Scratch.ArgumentType.STRING,
defaultValue:"<h1>Hello</h1>"
},
}
},
{
opcode: 'addHtml',
blockType: Scratch.BlockType.COMMAND,
text: 'Add to Site HTML[html]',
arguments:{
html: {
type: Scratch.ArgumentType.STRING,
defaultValue:"<p>World</p>"
},
}
},
{
blockType: Scratch.BlockType.LABEL,
text: "Init stuffs"
},
{
opcode: 'resetHtml',
blockType: Scratch.BlockType.COMMAND,
text: 'Reset Site HTML',
},
{
opcode: 'openSiteWindow',
blockType: Scratch.BlockType.COMMAND,
text: 'Open Site Window',
},
// {
// opcode: 'closeSiteWindow',
// blockType: Scratch.BlockType.COMMAND,
// text: 'Close Site Window',
// },
// {
// opcode: 'updateSiteWindow',
// blockType: Scratch.BlockType.COMMAND,
// text: 'Update Site Window',
// },
{
blockType: Scratch.BlockType.LABEL,
text: "Init stuffs"
},
{
opcode: 'resetHtml',
blockType: Scratch.BlockType.COMMAND,
text: 'Reset Site HTML',
},
{
opcode: 'openSiteWindow',
blockType: Scratch.BlockType.COMMAND,
text: 'Open Site Window',
},
// {
// opcode: 'closeSiteWindow',
// blockType: Scratch.BlockType.COMMAND,
// text: 'Close Site Window',
// },
// {
// opcode: 'updateSiteWindow',
// blockType: Scratch.BlockType.COMMAND,
// text: 'Update Site Window',
// },
{
blockType: Scratch.BlockType.LABEL,
text: "Advanced Stuffs"
},
{
opcode: 'site',
blockType: Scratch.BlockType.REPORTER,
text: 'Site HTML'
},
{
opcode: 'setHtml',
blockType: Scratch.BlockType.COMMAND,
text: 'Set Site HTML[html]',
arguments:{
html: {
type: Scratch.ArgumentType.STRING,
defaultValue:"<h1>Hello</h1>"
},
}
},
{
opcode: 'addHtml',
blockType: Scratch.BlockType.COMMAND,
text: 'Add to Site HTML[html]',
arguments:{
html: {
type: Scratch.ArgumentType.STRING,
defaultValue:"<p>World</p>"
},
}
},

items: ["top","bottom","left","right"]
},
numType: {
acceptReporters: true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
acceptReporters: true,
isTypeable: true,

Comment on lines 255 to 303
setHtml(args) {
this.siteHtml = args.html
}
addHtml(args) {
this.siteHtml += args.html
}
resetHtml(args) {
this.siteHtml = ""
}
openSiteWindow(){
this.siteWindow = window.open("", "", "width=1000,height=1000")
this.siteWindow.document.write(this.siteHtml)
}
closeSiteWindow(){
this.siteWindow.close()
}
updateSiteWindow(){
this.siteWindow.document.body.innerHTML = ""
this.siteWindow.document.write(this.siteHtml)
}
addHeader(args){
var items = {"big":"h1","medium":"h2","small":"h3","tiny":"h4","even tinier":"h5","tiniest":"h6"}
this.siteHtml += `<${items[args.SIZE]} id="${args.ID}" class="${args.CLASS}">${args.TEXT}</${items[args.SIZE]}>`
}
addPara(args){
this.siteHtml += `<p id="${args.ID}" class="${args.CLASS}">${args.TEXT}</p>`
}
addColorStyle(args){
var items = {"id":"#","class":"."}
this.siteHtml += `<style>${items[args.type]}${args.name}{background-color:${args.value}}</style>`
}
addTextColorStyle(args){
var items = {"id":"#","class":"."}
this.siteHtml += `<style>${items[args.type]}${args.name}{color:${args.value}}</style>`
}
addPositionStyle(args){
var items = {"id":"#","class":"."}
this.siteHtml += `<style>${items[args.type]}${args.name}{position:${args.posType};${args.dir}:${args.num}${args.numType}}</style>`
}
setInnerHtml(args){
if(args.type = "id"){
this.siteWindow.document.getElementById(args.name).innerHTML = args.text

return;
}
for(let el of this.siteWindow.document.getElementsByClassName(args.name)){
el.innerHTML = args.text
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
setHtml(args) {
this.siteHtml = args.html
}
addHtml(args) {
this.siteHtml += args.html
}
resetHtml(args) {
this.siteHtml = ""
}
openSiteWindow(){
this.siteWindow = window.open("", "", "width=1000,height=1000")
this.siteWindow.document.write(this.siteHtml)
}
closeSiteWindow(){
this.siteWindow.close()
}
updateSiteWindow(){
this.siteWindow.document.body.innerHTML = ""
this.siteWindow.document.write(this.siteHtml)
}
addHeader(args){
var items = {"big":"h1","medium":"h2","small":"h3","tiny":"h4","even tinier":"h5","tiniest":"h6"}
this.siteHtml += `<${items[args.SIZE]} id="${args.ID}" class="${args.CLASS}">${args.TEXT}</${items[args.SIZE]}>`
}
addPara(args){
this.siteHtml += `<p id="${args.ID}" class="${args.CLASS}">${args.TEXT}</p>`
}
addColorStyle(args){
var items = {"id":"#","class":"."}
this.siteHtml += `<style>${items[args.type]}${args.name}{background-color:${args.value}}</style>`
}
addTextColorStyle(args){
var items = {"id":"#","class":"."}
this.siteHtml += `<style>${items[args.type]}${args.name}{color:${args.value}}</style>`
}
addPositionStyle(args){
var items = {"id":"#","class":"."}
this.siteHtml += `<style>${items[args.type]}${args.name}{position:${args.posType};${args.dir}:${args.num}${args.numType}}</style>`
}
setInnerHtml(args){
if(args.type = "id"){
this.siteWindow.document.getElementById(args.name).innerHTML = args.text
return;
}
for(let el of this.siteWindow.document.getElementsByClassName(args.name)){
el.innerHTML = args.text
}
}
setHtml(args) {
this.siteHtml = args.html;
this.updateSiteWindow()
}
addHtml(args) {
this.siteHtml += args.html
this.updateSiteWindow()
}
resetHtml() {
this.siteHtml = ""
this.updateSiteWindow();
}
openSiteWindow(){
this.siteWindow = window.open("", "", "width=1000,height=1000")
this.siteWindow.document.write(this.siteHtml)
}
closeSiteWindow(){
this.siteWindow.close()
}
updateSiteWindow(){
this.siteWindow.document.body.innerHTML = ""
this.siteWindow.document.write(this.siteHtml)
}
addHeader(args){
var items = {"big":"h1","medium":"h2","small":"h3","tiny":"h4","even tinier":"h5","tiniest":"h6"}
this.siteHtml += `<${items[args.SIZE]} id="${args.ID}" class="${args.CLASS}">${args.TEXT}</${items[args.SIZE]}>`
}
addPara(args){
this.siteHtml += `<p id="${args.ID}" class="${args.CLASS}">${args.TEXT}</p>`
this.updateSiteWindow()
}
addColorStyle(args){
var items = {"id":"#","class":"."}
this.siteHtml += `<style>${items[args.type]}${args.name}{background-color:${args.value}}</style>`
this.updateSiteWindow()
}
addTextColorStyle(args){
var items = {"id":"#","class":"."}
this.siteHtml += `<style>${items[args.type]}${args.name}{color:${args.value}}</style>`
this.updateSiteWindow()
}
addPositionStyle(args){
var items = {"id":"#","class":"."}
this.siteHtml += `<style>${items[args.type]}${args.name}{position:${args.posType};${args.dir}:${args.num}${args.numType}}</style>`
this.updateSiteWindow()
}
setInnerHtml(args){
if(args.type = "id"){
this.siteWindow.document.getElementById(args.name).innerHTML = args.text
return;
}
for(let el of this.siteWindow.document.getElementsByClassName(args.name)){
el.innerHTML = args.text
}
this.updateSiteWindow();
}

@RedMan13
Copy link
Contributor

RedMan13 commented Nov 6, 2023

rewal

@JeremyGamer13 JeremyGamer13 marked this pull request as draft February 9, 2024 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.