Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ardublockly
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
ardublockly
Commits
4a52d8a9
Commit
4a52d8a9
authored
Jul 08, 2015
by
carlosperate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update namespaces and fix lint flags.
parent
60d62ade
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
542 additions
and
591 deletions
+542
-591
ardublockly/ardublockly.css
ardublockly/ardublockly.css
+2
-3
ardublockly/ardublockly.js
ardublockly/ardublockly.js
+150
-156
ardublockly/ardublockly_blockly.js
ardublockly/ardublockly_blockly.js
+74
-104
ardublockly/ardublockly_design.js
ardublockly/ardublockly_design.js
+73
-73
ardublockly/ardublocklyserver_ajax.js
ardublockly/ardublocklyserver_ajax.js
+101
-105
ardublockly/classic/ardublockly_classic.js
ardublockly/classic/ardublockly_classic.js
+117
-119
ardublockly/classic/index.html
ardublockly/classic/index.html
+2
-2
ardublockly/classic/settings.html
ardublockly/classic/settings.html
+1
-1
ardublockly/classic/settings.js
ardublockly/classic/settings.js
+22
-28
No files found.
ardublockly/ardublockly.css
View file @
4a52d8a9
...
...
@@ -620,7 +620,7 @@ ul.side-nav li.side-menu-end {
/* Entire Blockly area, Toolbox dranw on top */
.blocklySvg
{
border-width
:
none
!important
;
border-width
:
0
!important
;
-webkit-border-radius
:
4px
!important
;
-moz-border-radius
:
4px
!important
;
border-radius
:
4px
!important
;
...
...
@@ -821,5 +821,4 @@ ul.side-nav li ul li ul li {
/* Circle clipper (loading animation) thickness */
.circle-clipper
.circle
{
border-width
:
4px
!important
;
}
}
ardublockly/ardublockly.js
View file @
4a52d8a9
This diff is collapsed.
Click to expand it.
ardublockly/ardublockly_blockly.js
View file @
4a52d8a9
This diff is collapsed.
Click to expand it.
ardublockly/ardublockly_design.js
View file @
4a52d8a9
This diff is collapsed.
Click to expand it.
ardublockly/ardublocklyserver_ajax.js
View file @
4a52d8a9
This diff is collapsed.
Click to expand it.
ardublockly/classic/ardublockly_classic.js
View file @
4a52d8a9
This diff is collapsed.
Click to expand it.
ardublockly/classic/index.html
View file @
4a52d8a9
...
...
@@ -43,8 +43,6 @@
<script
src=
"../../blockly/generators/arduino/variables.js"
></script>
<!-- Load Blockly's language strings -->
<script
src=
"../../blockly/msg/js/en.js"
></script>
<!-- Arduino Server Compiler -->
<script
src=
"../ardublocklyserver_ajax.js"
></script>
<!-- Prettify -->
<link
rel=
"stylesheet"
href=
"../../blockly/demos/prettify.css"
>
<script
src=
"../../blockly/demos/prettify.js"
></script>
...
...
@@ -118,6 +116,8 @@
<p>
</div>
<!-- Arduino Server Compiler -->
<script
src=
"../ardublocklyserver_ajax.js"
></script>
<!-- Webapp js -->
<script
src=
"ardublockly_classic.js"
></script>
</body>
...
...
ardublockly/classic/settings.html
View file @
4a52d8a9
...
...
@@ -6,7 +6,7 @@
<title>
Ardublockly: Arduino Code Settings
</title>
<link
rel=
"stylesheet"
href=
"settings.css"
>
<!-- Arduino Server Compiler -->
<script
src=
"../
../ardublocklyserver/js/ArduServerCompiler
.js"
></script>
<script
src=
"../
ardublocklyserver_ajax
.js"
></script>
</head>
<body>
...
...
ardublockly/classic/settings.js
View file @
4a52d8a9
...
...
@@ -2,36 +2,32 @@
* @license Licensed under the Apache License, Version 2.0 (the "License"):
* http://www.apache.org/licenses/LICENSE-2.0
*
* @fileoverview JavaScript for Ardu
Blockly's
Server Compiler settings.
* @fileoverview JavaScript for Ardu
blockly
Server Compiler settings.
*/
'
use strict
'
;
/**
* Create a namespace for the application.
*/
/** Create a namespace for the application. */
var
ArduinoSettings
=
{};
/**
* Initialize the settings form data on page load.
*/
/** Initialize the settings form data on page load. */
window
.
addEventListener
(
'
load
'
,
function
()
{
// Populate the form data
Ardu
ServerCompil
er
.
requestCompilerLocation
(
Ardu
blocklyServ
er
.
requestCompilerLocation
(
ArduinoSettings
.
setCompilerLocationHtml
);
Ardu
ServerCompil
er
.
requestSketchLocation
(
Ardu
blocklyServ
er
.
requestSketchLocation
(
ArduinoSettings
.
setSketchLocationHtml
);
Ardu
ServerCompil
er
.
requestArduinoBoards
(
Ardu
blocklyServ
er
.
requestArduinoBoards
(
ArduinoSettings
.
setArduinoBoardsHtml
);
Ardu
ServerCompil
er
.
requestSerialPorts
(
ArduinoSettings
.
setSerialPortsHtml
);
Ardu
ServerCompil
er
.
requestIdeOptions
(
ArduinoSettings
.
setIdeHtml
);
Ardu
blocklyServ
er
.
requestSerialPorts
(
ArduinoSettings
.
setSerialPortsHtml
);
Ardu
blocklyServ
er
.
requestIdeOptions
(
ArduinoSettings
.
setIdeHtml
);
// Binding clicks to the form items
ArduinoSettings
.
bindClick_
(
'
settings_compiler_location
'
,
function
()
{
Ardu
ServerCompil
er
.
requestNewCompilerLocation
(
Ardu
blocklyServ
er
.
requestNewCompilerLocation
(
ArduinoSettings
.
setCompilerLocationHtml
);
});
ArduinoSettings
.
bindClick_
(
'
settings_sketch_location
'
,
function
()
{
Ardu
ServerCompil
er
.
requestNewSketchLocation
(
Ardu
blocklyServ
er
.
requestNewSketchLocation
(
ArduinoSettings
.
setSketchLocationHtml
);
});
...
...
@@ -51,7 +47,7 @@ window.addEventListener('load', function() {
*/
ArduinoSettings
.
setCompilerLocationHtml
=
function
(
new_el
)
{
if
(
new_el
!=
null
)
{
var
comp_loc_ip
=
document
.
getElementById
(
'
settings_compiler_location
'
)
var
comp_loc_ip
=
document
.
getElementById
(
'
settings_compiler_location
'
)
;
if
(
comp_loc_ip
!=
null
)
{
comp_loc_ip
.
value
=
new_el
.
value
;
}
...
...
@@ -65,7 +61,7 @@ ArduinoSettings.setCompilerLocationHtml = function(new_el) {
*/
ArduinoSettings
.
setSketchLocationHtml
=
function
(
new_el
)
{
if
(
new_el
!=
null
)
{
var
sketch_loc_ip
=
document
.
getElementById
(
'
settings_sketch_location
'
)
var
sketch_loc_ip
=
document
.
getElementById
(
'
settings_sketch_location
'
)
;
if
(
sketch_loc_ip
!=
null
)
{
sketch_loc_ip
.
value
=
new_el
.
value
;
}
...
...
@@ -80,7 +76,7 @@ ArduinoSettings.setSketchLocationHtml = function(new_el) {
*/
ArduinoSettings
.
setArduinoBoardsHtml
=
function
(
new_el
)
{
if
(
new_el
!=
null
)
{
var
board_dropdown
=
document
.
getElementById
(
'
board
'
)
var
board_dropdown
=
document
.
getElementById
(
'
board
'
)
;
if
(
board_dropdown
!=
null
)
{
new_el
.
id
=
'
board
'
;
new_el
.
onchange
=
ArduinoSettings
.
setBoard
;
...
...
@@ -95,8 +91,8 @@ ArduinoSettings.setArduinoBoardsHtml = function(new_el) {
ArduinoSettings
.
setBoard
=
function
()
{
var
el
=
document
.
getElementById
(
'
board
'
);
var
board_value
=
el
.
options
[
el
.
selectedIndex
].
value
;
//TODO: check how Ardu
ServerCompil
er deals with invalid data and sanitise here
Ardu
ServerCompil
er
.
setArduinoBoard
(
//TODO: check how Ardu
blocklyServ
er deals with invalid data and sanitise here
Ardu
blocklyServ
er
.
setArduinoBoard
(
board_value
,
ArduinoSettings
.
setArduinoBoardsHtml
);
};
...
...
@@ -108,7 +104,7 @@ ArduinoSettings.setBoard = function() {
*/
ArduinoSettings
.
setSerialPortsHtml
=
function
(
new_el
)
{
if
(
new_el
!=
null
)
{
var
serial_dropdown
=
document
.
getElementById
(
'
serial_port
'
)
var
serial_dropdown
=
document
.
getElementById
(
'
serial_port
'
)
;
if
(
serial_dropdown
!=
null
)
{
new_el
.
id
=
'
serial_port
'
;
new_el
.
onchange
=
ArduinoSettings
.
setSerial
;
...
...
@@ -117,14 +113,12 @@ ArduinoSettings.setSerialPortsHtml = function(new_el) {
}
};
/**
* Sets the Serial Port with the selected user input from the drop down.
*/
/** Sets the Serial Port with the selected user input from the drop down. */
ArduinoSettings
.
setSerial
=
function
()
{
var
el
=
document
.
getElementById
(
'
serial_port
'
);
var
serial_value
=
el
.
options
[
el
.
selectedIndex
].
value
;
//TODO: check how Ardu
ServerCompil
er deals with invalid data and sanitise
Ardu
ServerCompil
er
.
setSerialPort
(
//TODO: check how Ardu
blocklyServ
er deals with invalid data and sanitise
Ardu
blocklyServ
er
.
setSerialPort
(
serial_value
,
ArduinoSettings
.
setSerialPortsHtml
);
};
...
...
@@ -136,7 +130,7 @@ ArduinoSettings.setSerial = function() {
*/
ArduinoSettings
.
setIdeHtml
=
function
(
new_el
)
{
if
(
new_el
!=
null
)
{
var
ide_dropdown
=
document
.
getElementById
(
'
ide_settings
'
)
var
ide_dropdown
=
document
.
getElementById
(
'
ide_settings
'
)
;
if
(
ide_dropdown
!=
null
)
{
new_el
.
id
=
'
ide_settings
'
;
new_el
.
onchange
=
ArduinoSettings
.
setIdeSettings
;
...
...
@@ -151,8 +145,8 @@ ArduinoSettings.setIdeHtml = function(new_el) {
ArduinoSettings
.
setIdeSettings
=
function
()
{
var
el
=
document
.
getElementById
(
'
ide_settings
'
);
var
ide_value
=
el
.
options
[
el
.
selectedIndex
].
value
;
//TODO: check how Ardu
ServerCompil
er deals with invalid data and sanitise
Ardu
ServerCompil
er
.
setIdeOptions
(
ide_value
,
ArduinoSettings
.
setIdeHtml
);
//TODO: check how Ardu
blocklyServ
er deals with invalid data and sanitise
Ardu
blocklyServ
er
.
setIdeOptions
(
ide_value
,
ArduinoSettings
.
setIdeHtml
);
};
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment