Discuss Scratch

Botcho_Otkho
Scratcher
1000+ posts

Chromedials - extension

Warning: there aren't any links on github, just a code that you can copy in the JS console in one of your Scratch projects to add this. I have to get used on Github.
Tested on: Chrome
Hello! I worked on this extension called “Chromedials”. It opens dialogs to have a faster and fancier way to alert people, asking things or confirm things.
Here are the principal blocks:
alert []::extension//opens a basic dialog.
ask for [] with original answer []::extension reporter//opens a dialog with a textbox to receive an input.
confirm []::extension boolean//if "ok" is clicked reports true, otherwise it reports false.
And comes too with other help to manage code:
newline::reporter extension//creates a new line. (it works everywhere, not just in dialogs)
evaluate []::extension//useful for ignoring the "ask for" and the "confirm" dialog when you don't need to receive inputs.
JS code:
(function(ext) {
// Cleanup function when the extension is unloaded
ext._shutdown = function() {};

// Status reporting code
// Use this to report missing hardware, plugin or unsupported browser
ext._getStatus = function() {
return {status: 2, msg: 'Ready'};
};

ext.my_first_block = function() {
// Code that gets executed when the block is run
};

// Block and block menu descriptions
var descriptor = {
blocks: [
// Block type, block name, function name
[' ', 'alert %s', 'alertDial', 'Done.'],
['r', 'ask for %s with original answer %s', 'promptDial', 'What is your name?', 'John Doe'],
['b', 'confirm %s', 'askDial', 'Are you sure?'],
['r', 'newline', 'newlineX', ''],
[' ', 'evaluate %s', 'evaluateX']
]
};
ext.alertDial = function(dialText) {
alert(dialText)
};
ext.promptDial = function(dialText, origAnswer) {
return prompt(dialText, origAnswer)
};
ext.askDial = function(dialText) {
return confirm(dialText)
};
ext.newlineX = function() {
return "\n"
};
ext.evaluateX = function(evaluate) {
eval(evaluate)
};

// Register the extension
ScratchExtensions.register('Chromedials', descriptor, ext);
})({});
(I used ScratchX wiki's template)
Hope you like it!

PS.: let me know if you tested it on other browsers and it worked.

Last edited by Botcho_Otkho (April 4, 2018 17:20:58)


Hello! Moi is Botcho.

About me: Male / Catholic / Italian / Pizza lover / Hater of pineapple pizza / Undertale lover / Sagittarius / 13 years old / Walk-run cycles manager / Guitarist / Forum helper / Wiki Editor


Favourite games: Minecraft, Undertale My profile: click here!

Other: Donate an internet! Favourite communities: Roblox, Scratch Seasonal: nothing
;
mrbumppo
Scratcher
100+ posts

Chromedials - extension

Nice! Could I host code on YourJavascript or repl.it?
I also think we might be able to collaborate on making Chromedials 2.0 or something.

mrbumppo
“You can give up yourself, but doing so will make nature give up on you.”



Ender OS Scratch Wiki Profile
Botcho_Otkho
Scratcher
1000+ posts

Chromedials - extension

mrbumppo wrote:

Nice! Could I host code on YourJavascript or repl.it?
I also think we might be able to collaborate on making Chromedials 2.0 or something.
I'd like that idea

Hello! Moi is Botcho.

About me: Male / Catholic / Italian / Pizza lover / Hater of pineapple pizza / Undertale lover / Sagittarius / 13 years old / Walk-run cycles manager / Guitarist / Forum helper / Wiki Editor


Favourite games: Minecraft, Undertale My profile: click here!

Other: Donate an internet! Favourite communities: Roblox, Scratch Seasonal: nothing
;
mrbumppo
Scratcher
100+ posts

Chromedials - extension

Botcho_Otkho wrote:

mrbumppo wrote:

Nice! Could I host code on YourJavascript or repl.it?
I also think we might be able to collaborate on making Chromedials 2.0 or something.
I'd like that idea
So should I?

mrbumppo
“You can give up yourself, but doing so will make nature give up on you.”



Ender OS Scratch Wiki Profile
Botcho_Otkho
Scratcher
1000+ posts

Chromedials - extension

mrbumppo wrote:

Botcho_Otkho wrote:

mrbumppo wrote:

Nice! Could I host code on YourJavascript or repl.it?
I also think we might be able to collaborate on making Chromedials 2.0 or something.
I'd like that idea
So should I?
Yes!

Hello! Moi is Botcho.

About me: Male / Catholic / Italian / Pizza lover / Hater of pineapple pizza / Undertale lover / Sagittarius / 13 years old / Walk-run cycles manager / Guitarist / Forum helper / Wiki Editor


Favourite games: Minecraft, Undertale My profile: click here!

Other: Donate an internet! Favourite communities: Roblox, Scratch Seasonal: nothing
;
mrbumppo
Scratcher
100+ posts

Chromedials - extension

YourJavascript is done! http://yourjavascript.com/15712442823/chromedials.js

mrbumppo
“You can give up yourself, but doing so will make nature give up on you.”



Ender OS Scratch Wiki Profile
Botcho_Otkho
Scratcher
1000+ posts

Chromedials - extension

mrbumppo wrote:

YourJavascript is done! http://yourjavascript.com/15712442823/chromedials.js
Thanks!

Hello! Moi is Botcho.

About me: Male / Catholic / Italian / Pizza lover / Hater of pineapple pizza / Undertale lover / Sagittarius / 13 years old / Walk-run cycles manager / Guitarist / Forum helper / Wiki Editor


Favourite games: Minecraft, Undertale My profile: click here!

Other: Donate an internet! Favourite communities: Roblox, Scratch Seasonal: nothing
;

Powered by DjangoBB

Standard | Mobile