Skip to content
This repository was archived by the owner on May 30, 2021. It is now read-only.
This repository was archived by the owner on May 30, 2021. It is now read-only.

Scratchy Stuff Extension Library doesn't save extensions #7

Open

Description

@TheInitializer

When you put an extension in your project from the Scratchy Stuff extension library, if you save and reload the page, the extension isn't already loaded. Maybe keep a dict of which projects use which extensions and automatically load the extensions when the user goes back to that project?

Activity

  1. MegaApuTurkUltra commented on Oct 17, 2014

    @MegaApuTurkUltra

    I had this problem too while fooling with extensions. Projects don't seem to put extension urls into their json like they do for djdolphin... Idk how to fix this

  2. MegaApuTurkUltra commented on Nov 1, 2014

    @MegaApuTurkUltra

    Any help? Djdolphin?

  3. djdolphin commented on Nov 10, 2014

    @djdolphin

    I'll have this implemented eventually (hopefully soon).

  4. TheInitializer commented on Nov 19, 2014

    @TheInitializer
    Author

    So I looked in the JSON of a project with the PicoBoard extension, and I found this code:

        "savedExtensions": [{
                    "extensionName": "PicoBoard",
                    "blockSpecs": [["h", "when %m.booleanSensor", "whenSensorConnected", "button pressed"],
                        ["h", "when %m.sensor %m.lessMore %n", "whenSensorPass", "slider", ">", 50],
                        ["b", "sensor %m.booleanSensor?", "sensorPressed", "button pressed"],
                        ["rR", "%m.sensor sensor value", "sensor", "slider"]],
                    "menus": {
                        "lessMore": [">", "<"],
                        "sensor": ["slider", "light", "sound", "resistance-A", "resistance-B", "resistance-C", "resistance-D"],
                        "booleanSensor": ["button pressed", "A connected", "B connected", "C connected", "D connected"]
                    },
                    "javascriptURL": "file:\/\/\/C:\\Users\\David\\AppData\\Roaming\\edu.media.mit.Scratch2Editor\\Local Store\\static\\js\\scratch_extensions\\picoExtension.js"
                }]

    So all we need to do to save an extension is modify the JSON in that way! So where is the project file kept on the server?

  5. bates64 commented on Nov 19, 2014

    @bates64
    Contributor

    Wow, clever! I've got a couple questions of my own:
    How do you add css to the MSU settings? I've got a css file ready but how can I apply it? 🍪
    Sorry. 😊

  6. MegaApuTurkUltra commented on Nov 19, 2014

    @MegaApuTurkUltra

    Add CSS to the MSU settings? What do you mean?
    If you want additional CSS to apply to Scratch, right now the only way to do that is
    1) (I recommend this) Add your CSS to a file in resources/<mycssfile>.css, then add // @resource customcssfile resources/<mycssfile>.css to the header on msu-base.user.js, and finally in ScratchUserscript.init(), add the line GM_addStyle(GM_getResourceText("customcssfile"))
    2) (More hacky) Add your CSS to `resources/settings.css
    3) (Most hacky) Paste your code into a string in msu-base.user.js and call GM_addStyle on that directly

    In any case, please don't commit as it would mess up the repo.
    However, a good idea might be a MSU part where you can add custom CSS styles.
    Sorry, I didn't see your commits. So how should we add this? As a new part or as new CSS in the existing theme part?

  7. bates64 commented on Nov 20, 2014

    @bates64
    Contributor

    As new css in the theme part?

  8. djdolphin commented on Nov 20, 2014

    @djdolphin

    @DavidKT Extensions are already saved with projects. They just aren't loaded again unless they're made by someone in the extension developer group and the project is unshared. That could be worked around by grabbing the JSON using a CORS proxy and loading everything in the savedExtensions section.

  9. bates64 commented on Nov 20, 2014

    @bates64
    Contributor

    @djdolphin It would be really cool, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions