Skip to content

Commit

Permalink
Fixed a number of whitespace inconsistencies
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan committed Apr 9, 2013
1 parent 70f5ece commit 4c9fee5
Show file tree
Hide file tree
Showing 35 changed files with 1,055 additions and 1,055 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@


Snap! Build Your Own Blocks

http://snap.berkeley.edu

a visual, blocks based programming language
inspired by Scratch

written by Jens Mönig and Brian Harvey
jens@moenig.org, bh@cs.berkeley.edu

http://snap.berkeley.edu

a visual, blocks based programming language
inspired by Scratch

written by Jens Mönig and Brian Harvey
jens@moenig.org, bh@cs.berkeley.edu

Copyright (C) 2013 by Jens Mönig and Brian Harvey

Snap! is free software: you can redistribute it and/or modify
Expand Down
8 changes: 4 additions & 4 deletions blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Copyright (C) 2013 by Jens Mšnig
This file is part of Snap!.
This file is part of Snap!.
Snap! is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
Expand Down Expand Up @@ -1588,9 +1588,9 @@ SyntaxElementMorph.prototype.endLayout = function () {
special form: upvar
%upvar - same as %t (inline variable reporter template)
special form: input name
%inputName - variable blob (used in input type dialog)
examples:
Expand Down Expand Up @@ -4386,7 +4386,7 @@ ScriptsMorph.prototype.reactToDropOf = function (droppedMorph, hand) {
Usually I am just a receptacle for inherited methods and attributes,
however, if my 'type' attribute is set to one of the following
values, I act as an iconic slot myself:
'list' - a list symbol
*/

Expand Down
20 changes: 10 additions & 10 deletions byob.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Copyright (C) 2013 by Jens Mšnig
This file is part of Snap!.
This file is part of Snap!.
Snap! is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
Expand Down Expand Up @@ -57,7 +57,7 @@
ReporterBlockMorph***
CustomReporterBlockMorph
JaggedBlockMorph
StringMorph*
BlockLabelFragmentMorph
Expand Down Expand Up @@ -90,7 +90,7 @@
VariableDialogMorph
BlockExportDialogMorph
BlockImportDialogMorph
*/

/*global modules, CommandBlockMorph, SpriteMorph, TemplateSlotMorph,
Expand Down Expand Up @@ -418,7 +418,7 @@ CustomCommandBlockMorph.prototype.refreshPrototype = function () {
protoSpec = this.specFromFragments();


// update the prototype's type
// update the prototype's type
// and possibly exchange 'this' for 'myself'
if (this instanceof CustomCommandBlockMorph
&& ((hat.type === 'reporter') || (hat.type === 'predicate'))) {
Expand Down Expand Up @@ -1302,7 +1302,7 @@ BlockDialogMorph.prototype.fixLayout = function () {
+ this.padding
);
}
} else if (this.head) { // when changing an existing prototype
} else if (this.head) { // when changing an existing prototype
if (this.types) {
this.types.fixLayout();
this.silentSetWidth(
Expand Down Expand Up @@ -2125,7 +2125,7 @@ InputSlotDialogMorph.uber = DialogBoxMorph.prototype;

// InputSlotDialogMorph preferences settings:

// if "isLaunchingExpanded" is true I always open in the long form
// if "isLaunchingExpanded" is true I always open in the long form
InputSlotDialogMorph.prototype.isLaunchingExpanded = false;

// InputSlotDialogMorph instance creation:
Expand Down Expand Up @@ -2486,13 +2486,13 @@ InputSlotDialogMorph.prototype.addSlotTypeButton = function (
its right.
Note that you can make the slot picture interactive (turn
it into a ToggleElementMorph by changing the
element.fullImage()
line to just
element
I've opted for the simpler representation because it reduces
the duration of time it takes for the InputSlotDialog to load
and show. But in the future computers and browsers may be
Expand Down
2 changes: 1 addition & 1 deletion cloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Copyright (C) 2013 by Jens Mšnig
This file is part of Snap!.
This file is part of Snap!.
Snap! is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
Expand Down
150 changes: 75 additions & 75 deletions contributing to BYOB4.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,54 @@
Contributing to BYOB4 / Snap!
by Jens Mönig
last changed: 12/09/14
*****************************
*****************************

Attached is the current development code base for BYOB4 a.k.a. Snap. It consists of
several JavaScript, HTML and text files, and while some of it may be functional
most parts will be in flux and subject to frequent, even fundamental modifications.
This document lays out a few simple guidelines ensuring that collaborative code
contribution works out.
Working with changesets
-----------------------
contribution works out.


Working with changesets
-----------------------
You'll often want to change or add code in existing JS files. Please don't. Instead
use a changeset. The way I always do it myself is to copy the empty
changeset.js
file and rename it to something like
JensChangesToMorphic.js
use a changeset. The way I always do it myself is to copy the empty

changeset.js

file and rename it to something like

JensChangesToMorphic.js

Into this file I write all the functions I want to add to Morphic. If I want to
change a function in Morphic.js I copy it to the changeset and edit it there. Then
I always validate the changeset with
JSLint.com
Please check your code frequently with JSLint!
For our Snap code set JSLint's settings to:
assume a browser
tolerate missing 'use strict' pragma
[4] indentation
[78] maximum line length
I always validate the changeset with

JSLint.com

Please check your code frequently with JSLint!

For our Snap code set JSLint's settings to:

assume a browser
tolerate missing 'use strict' pragma

[4] indentation
[78] maximum line length

If you're working on the core Morphic library you can also

tolerate eval
tolerate eval
tolerate unfiltered for in

although you'll probably not ever going to need either EVAL or FORIN in your
changesets anyway.
changesets anyway.

There are, of course, other tools - like JSHint and Firebug - that help you debug
your code. Feel free to use whichever suits you best, but let's all agree on
JSLint's (nitpicky!) formatting rules so we get code that's well readable and
easily shareable among ourselves.
easily shareable among ourselves.


Coding style
Expand Down Expand Up @@ -112,62 +112,62 @@ Avoid
- create a new constructor instead


Testing your code
------------------
Testing your code
------------------
(don't worry, I'm not talking about formal UnitTest Suites or other BDSM software
fetishes, just about playing with what you're creating while you're doing it)
fetishes, just about playing with what you're creating while you're doing it)

To test your changesets just add another line in the html stub file with your
changeset. Make sure to put your changeset /after/ Morphic.js and Blocks.js and
whichever libraries are already included, so it'll actually get used.
In your changeset override the world's
customMorphs
whichever libraries are already included, so it'll actually get used.

In your changeset override the world's

customMorphs

function so it returns a list of instances of your Morphs. For "Blocks.js" that
code is:
var BlockMorph;
var ScriptsMorph;
WorldMorph.prototype.customMorphs = function () {
var sm = new ScriptsMorph();
sm.setExtent(new Point(800, 600));
return [
new BlockMorph(),
sm
];
};
code is:

var BlockMorph;
var ScriptsMorph;

WorldMorph.prototype.customMorphs = function () {
var sm = new ScriptsMorph();
sm.setExtent(new Point(800, 600));
return [
new BlockMorph(),
sm
];
};

Just modify this code so it returns your list of sample Morphs instead of
BlockMorph and ScriptsMorph instances.
BlockMorph and ScriptsMorph instances.

Once you've added this code to your changeset you can open your sample html file
in your browser, and you'll find your sample Morphs in the World's DEMO menu.
Inspectors
----------
in your browser, and you'll find your sample Morphs in the World's DEMO menu.


Inspectors
----------
To actually test play with your Morphs you can right-click on them and open an
inspector on them. You can open more than one inspector on each object. The
inspector pretty much works the same as in Smalltalk. It even has an evaluation
pane at the bottom, in which you can type in any JS code, mark it with your mouse
(or select all with ctrl-a), righ-click on the selection and either "do it", "show
it" or "inspect it" (again, like in Squeak).
it" or "inspect it" (again, like in Squeak).

Needless to say, in the evaluation pane "this" always refers to the inspected
object.
Source Code Mgmt
-----------------
object.


Source Code Mgmt
-----------------
The good thing about changesets is that you can continue working on them regardless
of new dev releases that happen in the meantime. When you feel you've got something
that's finished just send me your changeset, and I'll work all the changesets into
the Snap codebase and release another dev version. That way there will always (and
frequently) be a harmonized common code base.
Thanks!
frequently) be a harmonized common code base.

Thanks!

--Jens
10 changes: 5 additions & 5 deletions gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Copyright (C) 2013 by Jens Mšnig
This file is part of Snap!.
This file is part of Snap!.
Snap! is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
Expand Down Expand Up @@ -1227,7 +1227,7 @@ IDE_Morph.prototype.createCorral = function () {
// IDE_Morph layout

IDE_Morph.prototype.fixLayout = function (situation) {
// situation is a string, i.e.
// situation is a string, i.e.
// 'selectSprite' or 'refreshPalette' or 'tabEditor'
var padding = 5;

Expand Down Expand Up @@ -4478,8 +4478,8 @@ SpriteIconMorph.prototype.copySound = function (sound) {

/*
I am a selectable element in the SpriteEditor's "Costumes" tab, keeping
a self-updating thumbnail of the costume I'm respresenting, and a
self-updating label of the costume's name (in case it is changed
a self-updating thumbnail of the costume I'm respresenting, and a
self-updating label of the costume's name (in case it is changed
elsewhere)
*/

Expand Down Expand Up @@ -5300,4 +5300,4 @@ JukeboxMorph.prototype.reactToDropOf = function (icon) {
});
this.sprite.sounds.add(costume, idx);
this.updateList();
};
};
Loading

0 comments on commit 4c9fee5

Please sign in to comment.