waterbearlang / waterbear Goto Github PK
View Code? Open in Web Editor NEWVisual block syntax for programming languages
Home Page: http://waterbearlang.com/
Visual block syntax for programming languages
Home Page: http://waterbearlang.com/
If users hit garden.html with an invalid query string, waterbear just sits there and looks back.
I think that it should throw an error.
If the block you are trying to drag of the workspace is wider than block_menu then it won't disappear.
Could we have a socket type that doesn't care what it recieves or even better one that can recieve any type as long as it is scalar (a single value, no arrays or objects).
This would massively help with printing things to screen etc. where the core language doesn't care but the block currently do.
Often varnames, numbers and other user input outgrows the input field.
I think that they should autogrow as the user types.
We need to be able to define languages across several files so we can pick and choose the features we are using at any one point.
My arduino code will need at least 3 levels of functionality so I can teach kids robotics with really easy instructions for the 8 year olds and gradually get harder and closer to the base language.
I think we could use the jQuery .extend stuff in seperate files possibly using the dependancy code you mentioned
When there are more then one socket in a block the sockets after the first can not be selected by clicking. It seems that the socket becomes selected for a short time, then jumps back to the first socket.
With the new left-aligned code, the insert bar, stays in the scripts workspace when a block is deleted
The links on line 17 and 18 have a / in front of them, whereby only allowing users who download the project and store it under the root directory of the machine will have a valid link.
Changes to make blocks left-aligned also caused the workspace to accumulate cursor blocks, need to clean those up.
invalid property id
local.shape = global.paper.arcslice({{1}}, {{2}}, {{3}});
invalid property id
local.shape = global.paper.arcslice({{1}}, {{2}}, {{3}});
Some languages have a default structure and we need a way to add that from the language file.
I have implemented this in the arduino fork stretchyboy@7809b5f but I don't like what I have very much because it uses a function call in the language defintion and that feels a bit wrong to me.
I'm not as sure about javascript but In java and c there are reserved words and variable names must not have special characters only numbers and letters and can't start with a number.
Is there an elegant way to do this that doesn't require massive amounts of crazy regular expressions.
Most languages will not need to include things like Raphael. Introduce a loader so language files can include their own dependencies.
There are quite a number to choose from now (see http://microjs.com/#loader). YepNope is the one that will be integrated into Modernizr, let's try that and see if it is sufficient.
..So, for example if you create a 50x50 square with a black stroke to show up when program runs, nothing shows up. I tried "When program runs, ask 'Whats your name?'" - an alert came up and asked {1}. Tested http://waterbearlang.com in FF 3.6.16 and Chrome 11.
It sounds like its been working and a tweak might have broken things, it's bad timing though, because you're getting attention on Twitter, Hackernews, and Read Write Hack right now. I've been wondering when something great like this would get created off the back of scratch, and I'm excited to show my kids when you get it working a bit smoother.
Try double clicking multiple times on a block in the main canvas and you will see what is the problem.
I'm usinf FF8 and this version of the code: 3566c35
I did a fresh git pull, but It's still not working in Firefox and Chrome. For example Instead of asking, "What is your name?", it alerts "{{1}}". Boxes and things don't work at all because they throw errors at getting {{1}} for values.
I'm only mentioning it because you mentioned on Twitter you thought the FF and Chrome issues were fixed.
Chrome 11, Firefox 3.1.17, OS X 10.6.7
Languages need to control the workspace chrome. For instance, languages which do not target the browser do not need Run (or a stage).
We need a lightweight way to specify the workspace from the language file.
Blocks that have more than one container, containers after the first should be able to have a label.
@Gissues:{"order":75,"status":"inprogress"}
{
label: 'repeat until [boolean]',
script: 'while(!({{1}})){[[1]]}'
},
Bad things happen when one defines a container [[1]] but doesn't add the container flag 'containers: 1,'
@Gissues:{"order":95.72192513368987,"status":"backlog"}
It would be super usefull to have choice lists insert a value other than what they have as their Human readable text.
In some cases blocks are only good once, or they cause syntax errors. This isn't something that one would get with a regular language implementation.
Except maybe defining the same function twice.
In the case of Arduino and FRCJava, some predefined functions, id: main loop, can only be called once.
formerly: Some blocks can only be used once
I opted to use Google's Chrome Frame to ensure that compatibility is achieved.
http://code.google.com/chrome/chromeframe/
Simply by adding this meta tag to the head section:
and this right after the body tag
<!--[if IE]>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
<style>
/*
CSS rules to use for styling the overlay:
.chromeFrameOverlayContent
.chromeFrameOverlayContent iframe
.chromeFrameOverlayCloseBar
.chromeFrameOverlayUnderlay
*/
</style>
<script>
// You may want to place these lines inside an onload handler
CFInstall.check({
mode: "overlay",
destination: "http://www.waikiki.com"
});
</script>
<![endif]-->
and this where one wants a warning to be input if the user cancels out of the overlay.
Blocks go to funny places when not dragged to scripts workspace. Not sure if there is a way to control this location, but for now I just disabled it.
I added this to line 146 of drag.js (commit 73ddf8a)
var b1 = eT.contained_by($('.block_menu'));
var b2 = $('div.scripts_text_view_tab').hasClass('selected');
if(b1 && b2)
{
alert("Sorry, You need to be on the Block Diagram Tab to add blocks to your program.");
return undefined;
}
If one loads garden with the ?plugin= not set it loads an empty workspace.
I added this to my garden.html to prevent that.
if(!q.plugin)
window.location = "./"
I am trying to figure out what the best way would be to provide help information for each block.
Say a simple alt+click pops up a small menu much like that of the help in scratch. Maybe show a couple of blocks together and explain their usage.
I thought that it might make sense to detail this in the "language def" file (commit 73ddf8a) raphael_demo.js
ie:
{
label: 'Example Label',
script: 'Script Example',
help: 'Help Text Here'
},
The problem I for see is that:
a.) How does one have blocks drawn in the help popup menu?
b.) How can one retrieve the help text from a click event?
Best,
Blake
Hi,
Later we need UNDO and REDO actions ;-)
@Gissues:{"order":75,"status":"notstarted"}
After loading one of the built in demos, if one moves the left column of blocks before one of the right two, the right two move to funny locations.
It would be nice if output code could be autoformatted, tabs and all, without the developer having to add all the foolish \t
I think you are missing a comma on line 355 of javascript.js
Copy a set of blocks by holding the ctrl key and dragging.
I added this to line 130 of drag.js (commit 73ddf8a)
in the start_drag event
//When the CtrlKey is depressed don't drag the target, clone it.
if (event.ctrlKey){
drag_target = drag_target.clone(true);
cloned = true;
}
Best,
Blake
Toolnesse's addition of semi-transparent blocks when dragging is great, but if the user clicks on one of the blocks it gets the transparent class applied to it, and it never gets removed because they didn't drag the block.
What would be the best way to enlarge the snap distance?
Would it be possible to have the block snap into place as long as any part of it was overlapping the .next div?
I think we need a validation module. same as AppInventor that prevents invalid casts and bad combination of blocks.
Ideas: compatible blocks list, Allowed input/outputs, ....
This is largely dethe's call but I hope I'm not presuming too much by raising it and asking opions here.
Dethe has stated that this project is 'to create a visual syntax tool that can be used with a variety of languages and projects.'
I have started a fork looking at creating an visual syntax interface for writing Arduino code and already I am starting to hit places where I have had to make changes outside tindex.php and adding a file to replace rapheal_demo.js.
So my question is where do you want the borders to be?
@Gissues:{"order":93.75,"status":"inprogress"}
for some reason in your newest release it takes a long time to load the blocks menu on the left when using the plugin javascript.
TO my way of thinking, and kinda like in scratch, blocks that aren't attached to triggers don't run.
I think that we should have the option to only build the script from triggers.
Does it make sense to have hooks in the language definition file?
block_created();
block_deleted()
...
I am thinking of implementing a small popup when they start entering text into an input field .focus()
this field will only accept (characters and underscores.)
What is the better kind of language to use the correct technical terms or the nearest normal English word.
So
operators VS maths
translate VS move
Boolean sockets default list does not remove when a socket block is dragged to its place.
I think that this is what you were trying to write:
if (this.is(':input'))
{
if (this.parent().is('.string') || this.parent().is('.color')){
return '"' + this.val() + '"';
}else{
return this.val();
}
}
Javascript.js:20
Hi,
I really love this project.
1-I think we need some service interaction blocks for Web-services (ex: asp.net) or REST services
2-If we go to a form designer we need powerful ajax actions and form processing blocks: ex: Get Control Value and work on it
Just noticed that Waterbear is broken in Chrome (ver. 14), apparently there is no "scrollTo" property on Window in Chrome.
Socket lose there type attribute when a number socket block is inserted then removed.
Not sure what changed, but the "Run" and "Show Stage" buttons no longer work.
Tabs don't switch when one drags a block to the script tab.
Solution, add theses two lines to window.show_workspace in workspace.js
$('.tab_bar .selected').removeClass('selected');
$('.scripts_workspace_tab').addClass('selected');
Sorry. I can't work out what the different commands are really supposed to do. This is probably just down to the labelling.
Greetings,
I noticed that there was an == where an = should be but I wanted to check before making the change:
450202f#L0R94
if (this.is('.int')){desc['type'] == 'int';}
The grey/any socket shouldn't be able to take literals because we wouldn't know what type they are.
I am wondering what it would take to capture error messages (from javascript) that make sense when someone tries to run a script.
I mean jsfiddle does it, so that the error message lines are relative to what you just typed. Is it because they put the output in an iframe?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.