How to load a default project at startup

BTW, as I need the answer to my setting problem at most by monday, is there a very quick hack that I can apply to the V8+ code to define the zoom, zebra and flat settings when they first run Snap?

@s_federici
Everyone wants their own version of Snap! to do what they want/need it to do

Jens doesn't have the time to provide infinite variations of Snap! to suit all our purposes.

If we have the skills to modify the source code to bend it to our needs/wants then we can go and do that.

If we don't have the necessary skills and knowledge, then we should just accept that fact

Are teachers writing to Guido to ask for Python to be changed to suit their lessons? I think not :slight_smile:

:slight_smile:

Stefano, look at how I made the Pyret POC page, you can find the source for this experiment here: Snap/inline.html at master · jmoenig/Snap · GitHub
You can pass in a configuration object that lets you set all of what you want, read this: Snap/gui.js at master · jmoenig/Snap · GitHub
But not disable zebra coloring.

I have to admit, Stefano, that your request are making me quite angry, and I'm not sure about the consequences yet.

edit, I probably should explain why it's making me angry. We made Snap! to let kids experience powerful concepts of programming such as recursion and higher order functions, not to let them program fancy BASIC. What we're seeing is a lot of educators who don't share your enthusiasm about recursion and higher order functions, and don't agree that those are powerful ideas, but instead want to "do a little coding", or teach inferior "computational thinking" concepts based on loops, variables and conditionals, C-like thinking and generally vocational skills. That's all fine, but if you're going to take away Snap's very core we will not like your pedagogy. Problem is that friends are using such dumbed down versions of Snap to teach - not programming! - but mathematics for elementary school kids. For this very specific case we agreed to encourage them to build microworlds that disable some of Snap's core features and modify the UI for those little kids. They key here is that they do not teach programming but mathematics. If you teach programming and you don't let kids build their own blocks, don't let them enjoy recursion, don't show them the awesomeness of higher order functions, it feels like you're betraying computer science, and you reduce Snap to syntax highlighting. Ugh, this is hard to explain, maybe Brian would like to chime in.

I’m sure Brian fully agrees with you (even more than you :slightly_smiling_face:). I have to admit that, discussing with you and Brian back on 2010-ish, I didn’t think that Snap would have ever implemented a perfect mechanism to hide blocks. That is why I had developed my BloP extension.

But, your effort is not diminished by me (and other teachers) using Snap without teaching all the powerful features it has. Indeed, using Snap in a “minor” version at start is good for us. Then, gradually, we can add back all the initially hidden features. Graduality, as I have learned in teaching CS for 33 years, is very important. And, if Snap wouldn’t have all the incredible power it has, our students would move to real CS with a lot of difficulties. So, long life to Snap

Sigh. Because you asked nicely for it I've just now added another option for you to configure zebra contrast. The configuration key is zebra and you can give it a percentage, 0 is off, default it 40. Enjoy! :slight_smile:

Hooray!!! Thanks a lot Jens! :slightly_smiling_face:

If you are busy (as I guess you are) and there is no "look there" answer, just ignore this. I'm looking for a "look there" answer to this weird behavior:

  • everything worked well: if I run snap.html in Firefox inside the folder I'm working on, I now get a Snap GUI with flat design, no zebra, 1.2 zoom and my default project already open. Excellent
  • problem 1: if I open the same snap.html in Chrome, I see the default project only for a split second, and then it goes back to the usual empty Snap GUI
  • problem 2: if I duplicate my work folder and I open the duplicate snap.html in FireFox, again I see the default project for just a split second and then it goes back to the usual empty Snap GUI

I'm at a loss

To be clear: this happens even in the version that only aims at opening the default project (that is, without default settings yet)

This instead happens only in the version that also applies the default settings

you must be having different user preferences for that same (local) url, such as a default language, which get applied after the configuration ones. Make sure to use a different location for you fork if you have user settings. User settings are saved per browser and url. You probably have all kinds of settings in Chrome but not in Firefox.

gui.js
line 705: //change ---->this.loadNewProject = true; this.loadNewProject = false;

no, no, don't do that, that's a kludge. Use the new noUserSettings configuration key in dev instead. Sigh.

First of all: thanks a lor for all this incredible support. I really appreciate it!

I started this time from the last source code, the one containing the noUserSettings configuration, and I added back the possibility to define a default project via startup.js. It keeps working perfectly in Firefox (even when I duplicate the folder), but when I open snap.html in Chrome I can just see the default project for a split second, and then the standard empty project immediately overrides it.

I tried both

noUserSettings: true,

(that I guess is the correct settings for me?), and

noUserSettings: false,

Can I run pyret locally? I downloaded the source, but I keep getting the message that it is unable to retrieve transpile.xml. I tried:

  1. running inline.html in the pyret folder
  2. running inline.html in the Snap! folder (copying transpile.xml both to the Snap! folder and to the upper folder, as I have seen path: '../' in inline.html)

Have you tried running it in a loclhost?

Dumb me: I hadn't. Now it works as expected. Thanks!