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
261e382c
Commit
261e382c
authored
Feb 11, 2015
by
carlosperate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update arduino classic with warning alerts when the server component is not running.
parent
89a6a0f2
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
114 additions
and
88 deletions
+114
-88
apps/arduino_classic/arduino_classic.js
apps/arduino_classic/arduino_classic.js
+74
-66
apps/arduino_classic/arduino_settings.js
apps/arduino_classic/arduino_settings.js
+39
-21
apps/arduino_classic/index.html
apps/arduino_classic/index.html
+1
-1
No files found.
apps/arduino_classic/arduino.js
→
apps/arduino_classic/arduino
_classic
.js
View file @
261e382c
This diff is collapsed.
Click to expand it.
apps/arduino_classic/arduino_settings.js
View file @
261e382c
...
...
@@ -34,6 +34,14 @@ window.addEventListener('load', function() {
ArduServerCompiler
.
requestNewSketchLocation
(
ArduinoSettings
.
setSketchLocationHtml
);
});
// Check if not running locally (including developer's local network IP)
if
(
document
.
location
.
hostname
!=
"
localhost
"
&&
document
.
location
.
hostname
!=
"
192.168.0.7
"
)
{
alert
(
'
Ardublockly not running locally
\n\n
'
+
'
For Ardublockly to work correctly, the Ardublockly server must be
'
+
'
running locally on your computer
'
);
}
});
/**
...
...
@@ -42,9 +50,11 @@ window.addEventListener('load', function() {
* DOM. Should contain a complete input text element.
*/
ArduinoSettings
.
setCompilerLocationHtml
=
function
(
new_el
)
{
var
comp_loc_ip
=
document
.
getElementById
(
'
settings_compiler_location
'
)
if
(
comp_loc_ip
!=
null
)
{
comp_loc_ip
.
value
=
new_el
.
value
;
if
(
new_el
!=
null
)
{
var
comp_loc_ip
=
document
.
getElementById
(
'
settings_compiler_location
'
)
if
(
comp_loc_ip
!=
null
)
{
comp_loc_ip
.
value
=
new_el
.
value
;
}
}
};
...
...
@@ -54,9 +64,11 @@ ArduinoSettings.setCompilerLocationHtml = function(new_el) {
* DOM. Should contain a complete input text element.
*/
ArduinoSettings
.
setSketchLocationHtml
=
function
(
new_el
)
{
var
sketch_loc_ip
=
document
.
getElementById
(
'
settings_sketch_location
'
)
if
(
sketch_loc_ip
!=
null
)
{
sketch_loc_ip
.
value
=
new_el
.
value
;
if
(
new_el
!=
null
)
{
var
sketch_loc_ip
=
document
.
getElementById
(
'
settings_sketch_location
'
)
if
(
sketch_loc_ip
!=
null
)
{
sketch_loc_ip
.
value
=
new_el
.
value
;
}
}
};
...
...
@@ -67,11 +79,13 @@ ArduinoSettings.setSketchLocationHtml = function(new_el) {
* DOM. Should contain a complete select element.
*/
ArduinoSettings
.
setArduinoBoardsHtml
=
function
(
new_el
)
{
var
board_dropdown
=
document
.
getElementById
(
'
board
'
)
if
(
board_dropdown
!=
null
)
{
new_el
.
id
=
'
board
'
;
new_el
.
onchange
=
ArduinoSettings
.
setBoard
;
board_dropdown
.
parentNode
.
replaceChild
(
new_el
,
board_dropdown
);
if
(
new_el
!=
null
)
{
var
board_dropdown
=
document
.
getElementById
(
'
board
'
)
if
(
board_dropdown
!=
null
)
{
new_el
.
id
=
'
board
'
;
new_el
.
onchange
=
ArduinoSettings
.
setBoard
;
board_dropdown
.
parentNode
.
replaceChild
(
new_el
,
board_dropdown
);
}
}
};
...
...
@@ -93,11 +107,13 @@ ArduinoSettings.setBoard = function() {
* DOM. Should contain a complete select element.
*/
ArduinoSettings
.
setSerialPortsHtml
=
function
(
new_el
)
{
var
serial_dropdown
=
document
.
getElementById
(
'
serial_port
'
)
if
(
serial_dropdown
!=
null
)
{
new_el
.
id
=
'
serial_port
'
;
new_el
.
onchange
=
ArduinoSettings
.
setSerial
;
serial_dropdown
.
parentNode
.
replaceChild
(
new_el
,
serial_dropdown
);
if
(
new_el
!=
null
)
{
var
serial_dropdown
=
document
.
getElementById
(
'
serial_port
'
)
if
(
serial_dropdown
!=
null
)
{
new_el
.
id
=
'
serial_port
'
;
new_el
.
onchange
=
ArduinoSettings
.
setSerial
;
serial_dropdown
.
parentNode
.
replaceChild
(
new_el
,
serial_dropdown
);
}
}
};
...
...
@@ -119,11 +135,13 @@ ArduinoSettings.setSerial = function() {
* DOM. Should contain a complete select element.
*/
ArduinoSettings
.
setIdeHtml
=
function
(
new_el
)
{
var
ide_dropdown
=
document
.
getElementById
(
'
ide_settings
'
)
if
(
ide_dropdown
!=
null
)
{
new_el
.
id
=
'
ide_settings
'
;
new_el
.
onchange
=
ArduinoSettings
.
setIdeSettings
;
ide_dropdown
.
parentNode
.
replaceChild
(
new_el
,
ide_dropdown
);
if
(
new_el
!=
null
)
{
var
ide_dropdown
=
document
.
getElementById
(
'
ide_settings
'
)
if
(
ide_dropdown
!=
null
)
{
new_el
.
id
=
'
ide_settings
'
;
new_el
.
onchange
=
ArduinoSettings
.
setIdeSettings
;
ide_dropdown
.
parentNode
.
replaceChild
(
new_el
,
ide_dropdown
);
}
}
};
...
...
apps/arduino_classic/index.html
View file @
261e382c
...
...
@@ -118,6 +118,6 @@
</div>
<!-- Webapp js -->
<script
src=
"arduino.js"
></script>
<script
src=
"arduino
_classic
.js"
></script>
</body>
</html>
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