SlideShare a Scribd company logo
Лабораторная работа № 1
на тему «Фабрика Blockly»
Выполнила студентка группы ПОС-10А
Дрозд Юлия
Страница
Blockly.Language.webgl_a09_html = {
category: 'WebGL',
helpUrl: 'http://www.example.com/',
init: function() {
this.setColour(330);
this.appendValueInput("HTML")
.setAlign(Blockly.ALIGN_CENTRE)
.appendTitle("HTML");
this.appendStatementInput("HTML");
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setTooltip('');
this.appendValueInput("VALUE")
.appendTitle(new Blockly.FieldImage("../../media/html.svg", 64, 48));
} };
Blockly.JavaScript.webgl_a09_html = function() {
var value_html =
Blockly.JavaScript.valueToCode(this, 'HTML', Blockly.JavaScript.ORDER_ATOMIC);
var statements_html = Blockly.JavaScript.statementToCode(this, 'HTML');
var code = '<html>'/* + value_html + '< html>' */
return code;
};
Тело
Blockly.Language.webgl_a09_body = {
category: 'WebGL',
helpUrl:
'file://localhost/C:/blockly/demos/webgl/webgl_a09_headerhtml5.help.html',
init: function () {
this.setColour(65);
this.appendStatementInput("BODY")
.appendTitle("Body");
this.appendStatementInput("NAME");
this.appendStatementInput("NAME");
this.appendDummyInput()
.appendTitle("canvas id=")
.appendTitle(new Blockly.FieldTextInput("canv"), "canv")
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setTooltip('');
}
};
Blockly.JavaScript.webgl_a09_body = function() {
var statements_body = Blockly.JavaScript.statementToCode(this, 'BODY');
var statements_name = Blockly.JavaScript.statementToCode(this, 'NAME');
var statements_name = Blockly.JavaScript.statementToCode(this, 'NAME');
var code = '<body>&lt"'+statements_body+'"></body>n';
return code;
};
Blockly.Language.webgl_a09_header = {
category: 'WebGL',
helpUrl:
'file://localhost/C:/blockly/demos/webgl/webgl_a09_headerhtml5.help.html',
init: function() {
this.setColour(65);
this.appendStatementInput("HEADER")
.appendTitle("Header");
this.setOutput(true);
this.setTooltip('');
}
};
Blockly.JavaScript.webgl_a09_header = function() {
var statements_header = Blockly.JavaScript.statementToCode(this, 'HEADER');
// TODO: Assemble JavaScript into code variable.
var code = 'n<header>n' + value_header + 'n</header>'
// TODO: Change ORDER_NONE to the correct strength.
return [code, Blockly.JavaScript.ORDER_NONE];
};
Голова
Заголовок
Blockly.Language.webgl_a09_title = {
category: 'WebGL',
helpUrl: 'file://localhost/C:/blockly/demos/webgl/webgl_a09_headerhtml5.help.html',
init: function() {
this.setColour(160);
this.appendDummyInput()
.appendTitle("title")
.appendTitle(new Blockly.FieldTextInput("Blockly"), "NAME");
this.setPreviousStatement(true);
this.setNextStatement(true);
//this.appendValueInput("TITLE")
// .appendTitle("Title");
// this.setOutput(true);
this.setTooltip('');
}
};
Blockly.JavaScript.webgl_a09_title = function() {
var value_title = Blockly.JavaScript.valueToCode(this, 'TITLE', Blockly.JavaScript.ORDER_ATOMIC);
// TODO: Assemble JavaScript into code variable.
//var code = 'n<title&gtn;' + statements_title + 'n</title>'
var code = "'<title&gt'" + value_title.toString() +"'&lt Blockly ></canvas>"
//return [code, Blockly.JavaScript.ORDER_NONE];
return code;
};
Blockly.Language.a09_img = {
category: 'WebGL',
helpUrl:
'file://localhost/C:/blockly/demos/webgl/webgl_a09_headerhtml5.help.html',
init: function() {
this.setColour(280);
this.appendDummyInput()
.appendTitle("img")
.appendTitle(new Blockly.FieldTextInput("canvas"), "NAME");
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setTooltip(''); }
};
Blockly.JavaScript.a09_canvas = function() {
var text_name_canvas = this.getTitleValue('NAME');
var code = "<canvas id='" + text_name_canvas.toString() +"' width="120"
height="120" ></canvas>"
canvas_name = text_name_canvas;
return code;
};
Canvas
Отрисовкакруга
Blockly.Language.webgl_a09_circle = {
category: 'WebGL_2d',
helpUrl: '../webgl/webgl_a08_headerhtml5.help.html',
init: function() {
this.setColour(350);
this.appendDummyInput()
.appendTitle(new
Blockly.FieldImage("../../media/html1.svg", 64, 48))
.appendTitle("Set coordinates A(x,y)& radius of the
round:");
this.appendValueInput("x")
.setCheck(Number)
.setAlign(Blockly.ALIGN_RIGHT)
.appendTitle("x");
this.appendValueInput("y")
.setCheck(Number)
.setAlign(Blockly.ALIGN_RIGHT)
.appendTitle("y");
this.appendValueInput("r")
.setCheck(Number)
.setAlign(Blockly.ALIGN_RIGHT)
.appendTitle("radius");
this.setPreviousStatement(true);
this.setNextStatement(true);
this.setTooltip('');
}
};
Blockly.JavaScript.webgl_a09_circle = function() {
var value_canv_id =
Blockly.JavaScript.valueToCode(this, 'canv_id', Blockly.Java
Script.ORDER_ATOMIC);
var value_x =
Blockly.JavaScript.valueToCode(this, 'x', Blockly.JavaScript.
ORDER_ATOMIC);
var value_y =
Blockly.JavaScript.valueToCode(this, 'y', Blockly.JavaScript.
ORDER_ATOMIC);
var value_w =
Blockly.JavaScript.valueToCode(this, 'radius', Blockly.JavaSc
ript.ORDER_ATOMIC);
// TODO: Assemble JavaScript into code variable.
var code="var ctx = document.getElementById("+
value_canv_id + ").getContext('2d');n"
code += 'ctx.save();n';
code += 'ctx.beginPath();n';
code += 'ctx.translate('+ value_x+',' + value_y+');n';
code += 'ctx.scale('+value_w +', 1);n';
code += "n gl.arc(" + parseInt(text_x) +
", "+parseInt(text_y)+", "+parseInt(text_radius)+", 0, 2 *
Math.PI, false);";
code += 'ctx.restore();n';
code += 'ctx.closePath();n';
code += 'ctx.fill();n';
return code;
};
html>
<head>
<title> Blockly</title>
</head>
<body>
<canvas id ='canvas' width="1000" height=“800">
</canvas>
<script>
if (window.WebGLRenderingContext){
var c = document.getElementById('canvas');
var gl = c.getContext('2d');
gl.beginPath();
gl.arc(75,75, 37, 0, 2 * Math.PI, false);
gl.lineWidth = 1;
gl.strokeStyle = '#FFFFFF';
gl.stroke();
}
</script>
</body>
JavaScriptкодпрограммы
иеерезультат
Блок-представление
программы
ИсходныйтекстSVG-файла
<svg width="120" height="120" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Created with SVG-edit - http://svg-edit.googlecode.com/ -->
<g>
<title>Layer 1</title>
<image xlink:href="images/logo.png" opacity="0.5" id="svg_1" height="0" width="0" y="279" x="422"/>
<image xlink:href="images/logo.png" opacity="0.5" id="svg_2" height="0" width="0" y="305" x="450"/>
<polyline id="svg_3" points="630,301 " opacity="0.5" stroke-linecap="round" stroke-width="5" stroke="#000000" fill="none"/>
<polyline id="svg_4" points="612,296 " opacity="0.5" stroke-linecap="round" stroke-width="5" stroke="#000000" fill="none"/>
<polyline id="svg_6" points="637,303 " opacity="0.5" stroke-linecap="round" stroke-width="5" stroke="#000000" fill="none"/>
<polyline id="svg_7" points="684,348 " opacity="0.5" stroke-linecap="round" stroke-width="5" stroke="#000000" fill="none"/>
<line id="svg_9" y2="242" x2="394" y1="242" x1="394" opacity="0.5" stroke-width="5" stroke="#000000" fill="none"/>
<polyline id="svg_36" points="625,301 " opacity="0.5" stroke-linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" stroke="#000000" fill="none"/>
<polyline id="svg_37" points="650,269 " opacity="0.5" stroke-linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" stroke="#000000" fill="none"/>
<ellipse stroke="#000000" ry="32" rx="35" id="svg_54" cy="61" cx="61" stroke-linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#7f007f"/>
<rect stroke="#000000" id="svg_63" height="41" width="44" y="41" x="39" stroke-linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00"/>
<ellipse stroke="#000000" ry="16" rx="17" id="svg_64" cy="62" cx="61" stroke-linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#7f007f"/>
<path stroke="#000000" id="svg_66" d="m58.93317,57.45358c-36.4599,27.56387 23.01157,5.06276 12.85065,0.56253c-10.16098,-4.50021 -2.09198,4.78149 -13.74719,14.62572" stroke-linecap="round" stroke-
linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00"/>
<path transform="rotate(-128.608 103.024 53.9096)" id="svg_69" d="m106.69904,45.42442c27.60645,12.37745 -13.16621,19.80392 -13.16621,19.80392c0,0 -14.44026,-32.18137 13.16621,-19.80392z" stroke-
linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00" stroke="#000000"/>
<path transform="rotate(-83.13 102.338 84.342)" id="svg_70" d="m105.51985,74.63885c23.89774,14.15408 -11.39735,22.64655 -11.39735,22.64655c0,0 -12.50031,-36.80064 11.39735,-22.64655z" stroke-
linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00" stroke="#000000"/>
<path stroke="#000000" transform="rotate(-49.8739 78 103)" id="svg_71" d="m81.56476,94.13998c26.77625,12.92422 -12.77014,20.67876 -12.77014,20.67876c0,0 -14.00601,-33.60297 12.77014,-20.67876z" stroke-
linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00"/>
<path stroke="#000000" transform="rotate(-12.1443 48 103.5)" id="svg_72" d="m51.33182,94.45209c25.02625,13.19833 -11.93561,21.11731 -11.93561,21.11731c0,0 -13.09064,-34.31563 11.93561,-21.11731z" stroke-
linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00"/>
<path stroke="#000000" transform="rotate(59.3227 16.5 64.5)" id="svg_73" d="m19.88998,57.05505c25.46347,10.86002 -12.1441,17.37604 -12.1441,17.37604c0,0 -13.31931,-28.23602 12.1441,-17.37604z" stroke-
linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00"/>
<path stroke="#000000" transform="rotate(7.12499 25.5 89)" id="svg_74" d="m28.36844,80.64304c21.54562,12.19043 -10.2756,19.50465 -10.2756,19.50465c0,0 -11.27005,-31.69504 10.2756,-19.50465z" stroke-
linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00"/>
<path stroke="#000000" transform="rotate(88.1524 22 38)" id="svg_79" d="m25.13297,29.83795c23.5329,11.90613 -11.22336,19.0498 -11.22336,19.0498c0,0 -12.30951,-30.95595 11.22336,-19.0498z" stroke-
linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00"/>
<path stroke="#000000" id="svg_80" transform="rotate(151.221 63.9286 17.1252)" d="m66.61398,8.423c20.17049,12.69402 -9.61975,20.31042 -9.61975,20.31042c0,0 -10.55069,-33.00444 9.61975,-20.31042z" stroke-
linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00"/>
<path id="svg_81" transform="rotate(-170.073 92.9287 26.1252)" d="m96.8252,16.2766c29.2678,14.3662 -13.9586,22.986 -13.9586,22.986c0,0 -15.3091,-37.35224 13.9586,-22.986z" stroke-linecap="round" stroke-
linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00" stroke="#000000"/>
<path stroke="#000000" id="svg_83" transform="rotate(138.983 41.9287 22.6252)" d="m44.97488,13.80811c22.88126,12.86157 -10.91257,20.57852 -10.91257,20.57852c0,0 -11.96866,-33.44011 10.91257,-20.57852z"
stroke-linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00"/>
</g>
</svg>
ИзображениеSVG-файла
МасштабированиеSVG-
файла
100% 175% 250%
Спасибо за внимание!

More Related Content

What's hot

Reactive Type-safe WebComponents
Reactive Type-safe WebComponentsReactive Type-safe WebComponents
Reactive Type-safe WebComponents
Martin Hochel
 
javascript examples
javascript examplesjavascript examples
javascript examples
Egerton University
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVC
pootsbook
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
Nagaraju Sangam
 
Browsers with Wings
Browsers with WingsBrowsers with Wings
Browsers with Wings
Remy Sharp
 
Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007Netvibes
 
HTML,CSS Next
HTML,CSS NextHTML,CSS Next
HTML,CSS Next
지수 윤
 
UA Testing with Selenium and PHPUnit - ZendCon 2013
UA Testing with Selenium and PHPUnit - ZendCon 2013UA Testing with Selenium and PHPUnit - ZendCon 2013
UA Testing with Selenium and PHPUnit - ZendCon 2013
Michelangelo van Dam
 
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....Patrick Lauke
 
Data binding w Androidzie
Data binding w AndroidzieData binding w Androidzie
Data binding w Androidzie
The Software House
 
Nagios Conference 2014 - Troy Lea - JavaScript and jQuery - Nagios XI Tips, T...
Nagios Conference 2014 - Troy Lea - JavaScript and jQuery - Nagios XI Tips, T...Nagios Conference 2014 - Troy Lea - JavaScript and jQuery - Nagios XI Tips, T...
Nagios Conference 2014 - Troy Lea - JavaScript and jQuery - Nagios XI Tips, T...
Nagios
 
https://www.facebook.com/valdyna.monna?fref=ts
https://www.facebook.com/valdyna.monna?fref=tshttps://www.facebook.com/valdyna.monna?fref=ts
https://www.facebook.com/valdyna.monna?fref=tsArif Alexi
 
AngularJS and SPA
AngularJS and SPAAngularJS and SPA
AngularJS and SPA
Lorenzo Dematté
 
Discontinuing Reader Matches
Discontinuing Reader MatchesDiscontinuing Reader Matches
Discontinuing Reader Matches
chicagonewsonlineradio
 
YUI 3
YUI 3YUI 3
YUI 3
Dav Glass
 
What the FUF?
What the FUF?What the FUF?
What the FUF?
An Doan
 
DOSUG Intro to JQuery JavaScript Framework
DOSUG Intro to JQuery JavaScript FrameworkDOSUG Intro to JQuery JavaScript Framework
DOSUG Intro to JQuery JavaScript Framework
Matthew McCullough
 
Knockout.js presentation
Knockout.js presentationKnockout.js presentation
Knockout.js presentationScott Messinger
 
Mad Max is back, plus the rest of our new reviews and notable screenings
Mad Max is back, plus the rest of our new reviews and notable screeningsMad Max is back, plus the rest of our new reviews and notable screenings
Mad Max is back, plus the rest of our new reviews and notable screenings
chicagonewsonlineradio
 

What's hot (20)

Reactive Type-safe WebComponents
Reactive Type-safe WebComponentsReactive Type-safe WebComponents
Reactive Type-safe WebComponents
 
javascript examples
javascript examplesjavascript examples
javascript examples
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVC
 
Introduction to jQuery
Introduction to jQueryIntroduction to jQuery
Introduction to jQuery
 
Browsers with Wings
Browsers with WingsBrowsers with Wings
Browsers with Wings
 
Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007
 
HTML,CSS Next
HTML,CSS NextHTML,CSS Next
HTML,CSS Next
 
UA Testing with Selenium and PHPUnit - ZendCon 2013
UA Testing with Selenium and PHPUnit - ZendCon 2013UA Testing with Selenium and PHPUnit - ZendCon 2013
UA Testing with Selenium and PHPUnit - ZendCon 2013
 
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
 
Data binding w Androidzie
Data binding w AndroidzieData binding w Androidzie
Data binding w Androidzie
 
Nagios Conference 2014 - Troy Lea - JavaScript and jQuery - Nagios XI Tips, T...
Nagios Conference 2014 - Troy Lea - JavaScript and jQuery - Nagios XI Tips, T...Nagios Conference 2014 - Troy Lea - JavaScript and jQuery - Nagios XI Tips, T...
Nagios Conference 2014 - Troy Lea - JavaScript and jQuery - Nagios XI Tips, T...
 
https://www.facebook.com/valdyna.monna?fref=ts
https://www.facebook.com/valdyna.monna?fref=tshttps://www.facebook.com/valdyna.monna?fref=ts
https://www.facebook.com/valdyna.monna?fref=ts
 
AngularJS and SPA
AngularJS and SPAAngularJS and SPA
AngularJS and SPA
 
Send.php
Send.phpSend.php
Send.php
 
Discontinuing Reader Matches
Discontinuing Reader MatchesDiscontinuing Reader Matches
Discontinuing Reader Matches
 
YUI 3
YUI 3YUI 3
YUI 3
 
What the FUF?
What the FUF?What the FUF?
What the FUF?
 
DOSUG Intro to JQuery JavaScript Framework
DOSUG Intro to JQuery JavaScript FrameworkDOSUG Intro to JQuery JavaScript Framework
DOSUG Intro to JQuery JavaScript Framework
 
Knockout.js presentation
Knockout.js presentationKnockout.js presentation
Knockout.js presentation
 
Mad Max is back, plus the rest of our new reviews and notable screenings
Mad Max is back, plus the rest of our new reviews and notable screeningsMad Max is back, plus the rest of our new reviews and notable screenings
Mad Max is back, plus the rest of our new reviews and notable screenings
 

Viewers also liked

Learning to Mod Minecraft: A Father/Daughter Retrospective
Learning to Mod Minecraft: A Father/Daughter RetrospectiveLearning to Mod Minecraft: A Father/Daughter Retrospective
Learning to Mod Minecraft: A Father/Daughter Retrospective
Kevin Hakanson
 
лр1
лр1лр1
Scratch: School and Programming Languages
Scratch: School and Programming Languages Scratch: School and Programming Languages
Scratch: School and Programming Languages
2YOUNG2FAIL
 
Scratch
ScratchScratch
Coding 101
Coding 101Coding 101
Coding 101
Michelle Meracis
 
Programming&amp;coding
Programming&amp;codingProgramming&amp;coding
Programming&amp;coding
Barbara M. King
 
расчетная работа
расчетная работарасчетная работа
расчетная работаJuliaDrozd
 
2015 JSDC Build Anything with JavaScript
2015 JSDC Build Anything with JavaScript2015 JSDC Build Anything with JavaScript
2015 JSDC Build Anything with JavaScript
Web Arduino
 
Alternative ways of learning programming from scratch – first steps in automa...
Alternative ways of learning programming from scratch – first steps in automa...Alternative ways of learning programming from scratch – first steps in automa...
Alternative ways of learning programming from scratch – first steps in automa...
COMAQA.BY
 
Python test-automation
Python test-automationPython test-automation
Python test-automation
COMAQA.BY
 
Emerging Technologies in Banking and Finance
Emerging Technologies in Banking and FinanceEmerging Technologies in Banking and Finance
Emerging Technologies in Banking and Financeamit_singh87
 
Programming with Scratch
Programming with ScratchProgramming with Scratch
Programming with Scratch
Cort1026
 
Programming from scratch™
Programming from scratch™Programming from scratch™
Programming from scratch™
Highbury College and New Horizons
 
Primary Programming and Scratch
Primary Programming and ScratchPrimary Programming and Scratch
Primary Programming and Scratch
Miles Berry
 
Scratch - Intuitive and Accessible Programming
Scratch - Intuitive and Accessible ProgrammingScratch - Intuitive and Accessible Programming
Scratch - Intuitive and Accessible Programming
Gigi Gilbert-Igelsrud
 
Programació amb Blockly Games Turtle
Programació amb Blockly Games TurtleProgramació amb Blockly Games Turtle
Programació amb Blockly Games Turtle
Xavier Rosell
 
Programming in scratch
Programming in scratchProgramming in scratch
Programming in scratch
Hussam Mostafa
 
Intro To Scratch
Intro To ScratchIntro To Scratch
Intro To Scratch
Patrick Woessner
 
Scratch: Programming for everyone
Scratch: Programming for everyoneScratch: Programming for everyone
Scratch: Programming for everyone
Akshar Desai
 

Viewers also liked (20)

Learning to Mod Minecraft: A Father/Daughter Retrospective
Learning to Mod Minecraft: A Father/Daughter RetrospectiveLearning to Mod Minecraft: A Father/Daughter Retrospective
Learning to Mod Minecraft: A Father/Daughter Retrospective
 
лр1
лр1лр1
лр1
 
Scratch: School and Programming Languages
Scratch: School and Programming Languages Scratch: School and Programming Languages
Scratch: School and Programming Languages
 
Scratch
ScratchScratch
Scratch
 
Coding 101
Coding 101Coding 101
Coding 101
 
Programming&amp;coding
Programming&amp;codingProgramming&amp;coding
Programming&amp;coding
 
Picaxe manual5
Picaxe manual5Picaxe manual5
Picaxe manual5
 
расчетная работа
расчетная работарасчетная работа
расчетная работа
 
2015 JSDC Build Anything with JavaScript
2015 JSDC Build Anything with JavaScript2015 JSDC Build Anything with JavaScript
2015 JSDC Build Anything with JavaScript
 
Alternative ways of learning programming from scratch – first steps in automa...
Alternative ways of learning programming from scratch – first steps in automa...Alternative ways of learning programming from scratch – first steps in automa...
Alternative ways of learning programming from scratch – first steps in automa...
 
Python test-automation
Python test-automationPython test-automation
Python test-automation
 
Emerging Technologies in Banking and Finance
Emerging Technologies in Banking and FinanceEmerging Technologies in Banking and Finance
Emerging Technologies in Banking and Finance
 
Programming with Scratch
Programming with ScratchProgramming with Scratch
Programming with Scratch
 
Programming from scratch™
Programming from scratch™Programming from scratch™
Programming from scratch™
 
Primary Programming and Scratch
Primary Programming and ScratchPrimary Programming and Scratch
Primary Programming and Scratch
 
Scratch - Intuitive and Accessible Programming
Scratch - Intuitive and Accessible ProgrammingScratch - Intuitive and Accessible Programming
Scratch - Intuitive and Accessible Programming
 
Programació amb Blockly Games Turtle
Programació amb Blockly Games TurtleProgramació amb Blockly Games Turtle
Programació amb Blockly Games Turtle
 
Programming in scratch
Programming in scratchProgramming in scratch
Programming in scratch
 
Intro To Scratch
Intro To ScratchIntro To Scratch
Intro To Scratch
 
Scratch: Programming for everyone
Scratch: Programming for everyoneScratch: Programming for everyone
Scratch: Programming for everyone
 

Similar to Blockly

Private slideshow
Private slideshowPrivate slideshow
Private slideshowsblackman
 
Human Talks - StencilJS
Human Talks - StencilJSHuman Talks - StencilJS
Human Talks - StencilJS
Alexandre Koelsch
 
лукьянченко л.а. пос 10а
лукьянченко л.а. пос 10алукьянченко л.а. пос 10а
лукьянченко л.а. пос 10а
l10bov
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" Domino
Rob Bontekoe
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentation
Mevin Mohan
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
Igor Bronovskyy
 
AngularJS Mobile Warsaw 20-10-2014
AngularJS Mobile Warsaw 20-10-2014AngularJS Mobile Warsaw 20-10-2014
AngularJS Mobile Warsaw 20-10-2014
Dariusz Kalbarczyk
 
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Ayes Chinmay
 
Speed up your GWT coding with gQuery
Speed up your GWT coding with gQuerySpeed up your GWT coding with gQuery
Speed up your GWT coding with gQuery
Manuel Carrasco Moñino
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Dan Wahlin
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Chris Alfano
 
Elinvoimaa hunajasta-yleist-hunajatietoa-ja-kyttvinkkej
Elinvoimaa hunajasta-yleist-hunajatietoa-ja-kyttvinkkejElinvoimaa hunajasta-yleist-hunajatietoa-ja-kyttvinkkej
Elinvoimaa hunajasta-yleist-hunajatietoa-ja-kyttvinkkejPertti Paavola
 
JSMVCOMFG - To sternly look at JavaScript MVC and Templating Frameworks
JSMVCOMFG - To sternly look at JavaScript MVC and Templating FrameworksJSMVCOMFG - To sternly look at JavaScript MVC and Templating Frameworks
JSMVCOMFG - To sternly look at JavaScript MVC and Templating FrameworksMario Heiderich
 
CSS3 Takes on the World
CSS3 Takes on the WorldCSS3 Takes on the World
CSS3 Takes on the World
Jonathan Snook
 
JavaFX in Action (devoxx'16)
JavaFX in Action (devoxx'16)JavaFX in Action (devoxx'16)
JavaFX in Action (devoxx'16)
Alexander Casall
 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
Shumpei Shiraishi
 

Similar to Blockly (20)

Private slideshow
Private slideshowPrivate slideshow
Private slideshow
 
Human Talks - StencilJS
Human Talks - StencilJSHuman Talks - StencilJS
Human Talks - StencilJS
 
лукьянченко л.а. пос 10а
лукьянченко л.а. пос 10алукьянченко л.а. пос 10а
лукьянченко л.а. пос 10а
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" Domino
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentation
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
 
AngularJS Mobile Warsaw 20-10-2014
AngularJS Mobile Warsaw 20-10-2014AngularJS Mobile Warsaw 20-10-2014
AngularJS Mobile Warsaw 20-10-2014
 
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
 
Speed up your GWT coding with gQuery
Speed up your GWT coding with gQuerySpeed up your GWT coding with gQuery
Speed up your GWT coding with gQuery
 
Upload[1]
Upload[1]Upload[1]
Upload[1]
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
 
Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011Jarv.us Showcase — SenchaCon 2011
Jarv.us Showcase — SenchaCon 2011
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
smoke1272528461
smoke1272528461smoke1272528461
smoke1272528461
 
Elinvoimaa hunajasta-yleist-hunajatietoa-ja-kyttvinkkej
Elinvoimaa hunajasta-yleist-hunajatietoa-ja-kyttvinkkejElinvoimaa hunajasta-yleist-hunajatietoa-ja-kyttvinkkej
Elinvoimaa hunajasta-yleist-hunajatietoa-ja-kyttvinkkej
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
 
JSMVCOMFG - To sternly look at JavaScript MVC and Templating Frameworks
JSMVCOMFG - To sternly look at JavaScript MVC and Templating FrameworksJSMVCOMFG - To sternly look at JavaScript MVC and Templating Frameworks
JSMVCOMFG - To sternly look at JavaScript MVC and Templating Frameworks
 
CSS3 Takes on the World
CSS3 Takes on the WorldCSS3 Takes on the World
CSS3 Takes on the World
 
JavaFX in Action (devoxx'16)
JavaFX in Action (devoxx'16)JavaFX in Action (devoxx'16)
JavaFX in Action (devoxx'16)
 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
 

More from JuliaDrozd

концептуальное моделирование!
концептуальное моделирование!концептуальное моделирование!
концептуальное моделирование!JuliaDrozd
 
концептуальное моделирование
концептуальное моделированиеконцептуальное моделирование
концептуальное моделированиеJuliaDrozd
 
дрозд ю.в. пос 10а
дрозд ю.в. пос 10адрозд ю.в. пос 10а
дрозд ю.в. пос 10аJuliaDrozd
 

More from JuliaDrozd (6)

Guid studio
Guid studioGuid studio
Guid studio
 
Uml
UmlUml
Uml
 
Dfd и idef0
Dfd и idef0Dfd и idef0
Dfd и idef0
 
концептуальное моделирование!
концептуальное моделирование!концептуальное моделирование!
концептуальное моделирование!
 
концептуальное моделирование
концептуальное моделированиеконцептуальное моделирование
концептуальное моделирование
 
дрозд ю.в. пос 10а
дрозд ю.в. пос 10адрозд ю.в. пос 10а
дрозд ю.в. пос 10а
 

Recently uploaded

Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 

Recently uploaded (20)

Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 

Blockly

  • 1. Лабораторная работа № 1 на тему «Фабрика Blockly» Выполнила студентка группы ПОС-10А Дрозд Юлия
  • 2. Страница Blockly.Language.webgl_a09_html = { category: 'WebGL', helpUrl: 'http://www.example.com/', init: function() { this.setColour(330); this.appendValueInput("HTML") .setAlign(Blockly.ALIGN_CENTRE) .appendTitle("HTML"); this.appendStatementInput("HTML"); this.setPreviousStatement(true); this.setNextStatement(true); this.setTooltip(''); this.appendValueInput("VALUE") .appendTitle(new Blockly.FieldImage("../../media/html.svg", 64, 48)); } }; Blockly.JavaScript.webgl_a09_html = function() { var value_html = Blockly.JavaScript.valueToCode(this, 'HTML', Blockly.JavaScript.ORDER_ATOMIC); var statements_html = Blockly.JavaScript.statementToCode(this, 'HTML'); var code = '&lt;html&gt;'/* + value_html + '&lt; html&gt;' */ return code; };
  • 3. Тело Blockly.Language.webgl_a09_body = { category: 'WebGL', helpUrl: 'file://localhost/C:/blockly/demos/webgl/webgl_a09_headerhtml5.help.html', init: function () { this.setColour(65); this.appendStatementInput("BODY") .appendTitle("Body"); this.appendStatementInput("NAME"); this.appendStatementInput("NAME"); this.appendDummyInput() .appendTitle("canvas id=") .appendTitle(new Blockly.FieldTextInput("canv"), "canv") this.setPreviousStatement(true); this.setNextStatement(true); this.setTooltip(''); } }; Blockly.JavaScript.webgl_a09_body = function() { var statements_body = Blockly.JavaScript.statementToCode(this, 'BODY'); var statements_name = Blockly.JavaScript.statementToCode(this, 'NAME'); var statements_name = Blockly.JavaScript.statementToCode(this, 'NAME'); var code = '&lt;body&gt;&lt"'+statements_body+'"&gt;&lt;/body&gt;n'; return code; };
  • 4. Blockly.Language.webgl_a09_header = { category: 'WebGL', helpUrl: 'file://localhost/C:/blockly/demos/webgl/webgl_a09_headerhtml5.help.html', init: function() { this.setColour(65); this.appendStatementInput("HEADER") .appendTitle("Header"); this.setOutput(true); this.setTooltip(''); } }; Blockly.JavaScript.webgl_a09_header = function() { var statements_header = Blockly.JavaScript.statementToCode(this, 'HEADER'); // TODO: Assemble JavaScript into code variable. var code = 'n&lt;header&gt;n' + value_header + 'n&lt;/header&gt;' // TODO: Change ORDER_NONE to the correct strength. return [code, Blockly.JavaScript.ORDER_NONE]; }; Голова
  • 5. Заголовок Blockly.Language.webgl_a09_title = { category: 'WebGL', helpUrl: 'file://localhost/C:/blockly/demos/webgl/webgl_a09_headerhtml5.help.html', init: function() { this.setColour(160); this.appendDummyInput() .appendTitle("title") .appendTitle(new Blockly.FieldTextInput("Blockly"), "NAME"); this.setPreviousStatement(true); this.setNextStatement(true); //this.appendValueInput("TITLE") // .appendTitle("Title"); // this.setOutput(true); this.setTooltip(''); } }; Blockly.JavaScript.webgl_a09_title = function() { var value_title = Blockly.JavaScript.valueToCode(this, 'TITLE', Blockly.JavaScript.ORDER_ATOMIC); // TODO: Assemble JavaScript into code variable. //var code = 'n&lt;title&gtn;' + statements_title + 'n&lt;/title&gt;' var code = "'&lt;title&gt'" + value_title.toString() +"'&lt Blockly &gt;&lt;/canvas&gt;" //return [code, Blockly.JavaScript.ORDER_NONE]; return code; };
  • 6. Blockly.Language.a09_img = { category: 'WebGL', helpUrl: 'file://localhost/C:/blockly/demos/webgl/webgl_a09_headerhtml5.help.html', init: function() { this.setColour(280); this.appendDummyInput() .appendTitle("img") .appendTitle(new Blockly.FieldTextInput("canvas"), "NAME"); this.setPreviousStatement(true); this.setNextStatement(true); this.setTooltip(''); } }; Blockly.JavaScript.a09_canvas = function() { var text_name_canvas = this.getTitleValue('NAME'); var code = "&lt;canvas id='" + text_name_canvas.toString() +"' width="120" height="120" &gt;&lt;/canvas&gt;" canvas_name = text_name_canvas; return code; }; Canvas
  • 7. Отрисовкакруга Blockly.Language.webgl_a09_circle = { category: 'WebGL_2d', helpUrl: '../webgl/webgl_a08_headerhtml5.help.html', init: function() { this.setColour(350); this.appendDummyInput() .appendTitle(new Blockly.FieldImage("../../media/html1.svg", 64, 48)) .appendTitle("Set coordinates A(x,y)& radius of the round:"); this.appendValueInput("x") .setCheck(Number) .setAlign(Blockly.ALIGN_RIGHT) .appendTitle("x"); this.appendValueInput("y") .setCheck(Number) .setAlign(Blockly.ALIGN_RIGHT) .appendTitle("y"); this.appendValueInput("r") .setCheck(Number) .setAlign(Blockly.ALIGN_RIGHT) .appendTitle("radius"); this.setPreviousStatement(true); this.setNextStatement(true); this.setTooltip(''); } }; Blockly.JavaScript.webgl_a09_circle = function() { var value_canv_id = Blockly.JavaScript.valueToCode(this, 'canv_id', Blockly.Java Script.ORDER_ATOMIC); var value_x = Blockly.JavaScript.valueToCode(this, 'x', Blockly.JavaScript. ORDER_ATOMIC); var value_y = Blockly.JavaScript.valueToCode(this, 'y', Blockly.JavaScript. ORDER_ATOMIC); var value_w = Blockly.JavaScript.valueToCode(this, 'radius', Blockly.JavaSc ript.ORDER_ATOMIC); // TODO: Assemble JavaScript into code variable. var code="var ctx = document.getElementById("+ value_canv_id + ").getContext('2d');n" code += 'ctx.save();n'; code += 'ctx.beginPath();n'; code += 'ctx.translate('+ value_x+',' + value_y+');n'; code += 'ctx.scale('+value_w +', 1);n'; code += "n gl.arc(" + parseInt(text_x) + ", "+parseInt(text_y)+", "+parseInt(text_radius)+", 0, 2 * Math.PI, false);"; code += 'ctx.restore();n'; code += 'ctx.closePath();n'; code += 'ctx.fill();n'; return code; };
  • 8. html> <head> <title> Blockly</title> </head> <body> <canvas id ='canvas' width="1000" height=“800"> </canvas> <script> if (window.WebGLRenderingContext){ var c = document.getElementById('canvas'); var gl = c.getContext('2d'); gl.beginPath(); gl.arc(75,75, 37, 0, 2 * Math.PI, false); gl.lineWidth = 1; gl.strokeStyle = '#FFFFFF'; gl.stroke(); } </script> </body> JavaScriptкодпрограммы иеерезультат
  • 10. ИсходныйтекстSVG-файла <svg width="120" height="120" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- Created with SVG-edit - http://svg-edit.googlecode.com/ --> <g> <title>Layer 1</title> <image xlink:href="images/logo.png" opacity="0.5" id="svg_1" height="0" width="0" y="279" x="422"/> <image xlink:href="images/logo.png" opacity="0.5" id="svg_2" height="0" width="0" y="305" x="450"/> <polyline id="svg_3" points="630,301 " opacity="0.5" stroke-linecap="round" stroke-width="5" stroke="#000000" fill="none"/> <polyline id="svg_4" points="612,296 " opacity="0.5" stroke-linecap="round" stroke-width="5" stroke="#000000" fill="none"/> <polyline id="svg_6" points="637,303 " opacity="0.5" stroke-linecap="round" stroke-width="5" stroke="#000000" fill="none"/> <polyline id="svg_7" points="684,348 " opacity="0.5" stroke-linecap="round" stroke-width="5" stroke="#000000" fill="none"/> <line id="svg_9" y2="242" x2="394" y1="242" x1="394" opacity="0.5" stroke-width="5" stroke="#000000" fill="none"/> <polyline id="svg_36" points="625,301 " opacity="0.5" stroke-linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" stroke="#000000" fill="none"/> <polyline id="svg_37" points="650,269 " opacity="0.5" stroke-linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" stroke="#000000" fill="none"/> <ellipse stroke="#000000" ry="32" rx="35" id="svg_54" cy="61" cx="61" stroke-linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#7f007f"/> <rect stroke="#000000" id="svg_63" height="41" width="44" y="41" x="39" stroke-linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00"/> <ellipse stroke="#000000" ry="16" rx="17" id="svg_64" cy="62" cx="61" stroke-linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#7f007f"/> <path stroke="#000000" id="svg_66" d="m58.93317,57.45358c-36.4599,27.56387 23.01157,5.06276 12.85065,0.56253c-10.16098,-4.50021 -2.09198,4.78149 -13.74719,14.62572" stroke-linecap="round" stroke- linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00"/> <path transform="rotate(-128.608 103.024 53.9096)" id="svg_69" d="m106.69904,45.42442c27.60645,12.37745 -13.16621,19.80392 -13.16621,19.80392c0,0 -14.44026,-32.18137 13.16621,-19.80392z" stroke- linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00" stroke="#000000"/> <path transform="rotate(-83.13 102.338 84.342)" id="svg_70" d="m105.51985,74.63885c23.89774,14.15408 -11.39735,22.64655 -11.39735,22.64655c0,0 -12.50031,-36.80064 11.39735,-22.64655z" stroke- linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00" stroke="#000000"/> <path stroke="#000000" transform="rotate(-49.8739 78 103)" id="svg_71" d="m81.56476,94.13998c26.77625,12.92422 -12.77014,20.67876 -12.77014,20.67876c0,0 -14.00601,-33.60297 12.77014,-20.67876z" stroke- linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00"/> <path stroke="#000000" transform="rotate(-12.1443 48 103.5)" id="svg_72" d="m51.33182,94.45209c25.02625,13.19833 -11.93561,21.11731 -11.93561,21.11731c0,0 -13.09064,-34.31563 11.93561,-21.11731z" stroke- linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00"/> <path stroke="#000000" transform="rotate(59.3227 16.5 64.5)" id="svg_73" d="m19.88998,57.05505c25.46347,10.86002 -12.1441,17.37604 -12.1441,17.37604c0,0 -13.31931,-28.23602 12.1441,-17.37604z" stroke- linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00"/> <path stroke="#000000" transform="rotate(7.12499 25.5 89)" id="svg_74" d="m28.36844,80.64304c21.54562,12.19043 -10.2756,19.50465 -10.2756,19.50465c0,0 -11.27005,-31.69504 10.2756,-19.50465z" stroke- linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00"/> <path stroke="#000000" transform="rotate(88.1524 22 38)" id="svg_79" d="m25.13297,29.83795c23.5329,11.90613 -11.22336,19.0498 -11.22336,19.0498c0,0 -12.30951,-30.95595 11.22336,-19.0498z" stroke- linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00"/> <path stroke="#000000" id="svg_80" transform="rotate(151.221 63.9286 17.1252)" d="m66.61398,8.423c20.17049,12.69402 -9.61975,20.31042 -9.61975,20.31042c0,0 -10.55069,-33.00444 9.61975,-20.31042z" stroke- linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00"/> <path id="svg_81" transform="rotate(-170.073 92.9287 26.1252)" d="m96.8252,16.2766c29.2678,14.3662 -13.9586,22.986 -13.9586,22.986c0,0 -15.3091,-37.35224 13.9586,-22.986z" stroke-linecap="round" stroke- linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00" stroke="#000000"/> <path stroke="#000000" id="svg_83" transform="rotate(138.983 41.9287 22.6252)" d="m44.97488,13.80811c22.88126,12.86157 -10.91257,20.57852 -10.91257,20.57852c0,0 -11.96866,-33.44011 10.91257,-20.57852z" stroke-linecap="round" stroke-linejoin="null" stroke-dasharray="null" stroke-width="5" fill="#ffff00"/> </g> </svg>