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
d5322ab4
Commit
d5322ab4
authored
May 08, 2017
by
carlosperate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Front end: Set better Settings default messages
parent
64c5a9da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
ardublockly/ardublockly.js
ardublockly/ardublockly.js
+4
-6
ardublockly/ardublocklyserver_ajax.js
ardublockly/ardublocklyserver_ajax.js
+10
-5
No files found.
ardublockly/ardublockly.js
View file @
d5322ab4
...
...
@@ -375,9 +375,8 @@ Ardublockly.setCompilerLocationHtml = function(newEl) {
var
compLocIp
=
document
.
getElementById
(
'
settings_compiler_location
'
);
if
(
compLocIp
!=
null
)
{
if
(
newEl
.
value
)
{
compLocIp
.
value
=
newEl
.
value
;
}
compLocIp
.
value
=
newEl
.
value
||
compLocIp
.
value
||
'
Please enter the location of the Arduino IDE executable
'
;
compLocIp
.
style
.
cssText
=
newEl
.
style
.
cssText
;
}
};
...
...
@@ -392,9 +391,8 @@ Ardublockly.setSketchLocationHtml = function(newEl) {
var
sketchLocIp
=
document
.
getElementById
(
'
settings_sketch_location
'
);
if
(
sketchLocIp
!=
null
)
{
if
(
newEl
.
value
)
{
sketchLocIp
.
value
=
newEl
.
value
;
}
sketchLocIp
.
value
=
newEl
.
value
||
sketchLocIp
.
value
||
'
Please enter a folder to store the Arduino Sketch
'
;
sketchLocIp
.
style
.
cssText
=
newEl
.
style
.
cssText
;
}
};
...
...
ardublockly/ardublocklyserver_ajax.js
View file @
d5322ab4
...
...
@@ -187,24 +187,29 @@ ArdublocklyServer.jsonToHtmlTextInput = function(jsonObj) {
ArdublocklyServer
.
jsonToHtmlDropdown
=
function
(
jsonObj
)
{
var
element
=
null
;
if
(
jsonObj
&&
jsonObj
.
selected
&&
jsonObj
.
options
)
{
if
(
!
jsonObj
)
{
console
.
error
(
'
Invalid JSON received from server.
'
);
}
else
if
(
jsonObj
.
errors
)
{
console
.
error
(
'
There are errors in the JSON response from server.
'
);
console
.
error
(
jsonObj
);
}
else
{
// Drop down list of unknown length with a selected item
element
=
document
.
createElement
(
'
select
'
);
element
.
name
=
jsonObj
.
response
_type
;
element
.
name
=
jsonObj
.
settings
_type
;
for
(
var
i
=
0
;
i
<
jsonObj
.
options
.
length
;
i
++
)
{
if
(
jsonObj
.
options
[
i
].
value
&&
jsonObj
.
options
[
i
].
display_text
)
{
var
option
=
document
.
createElement
(
'
option
'
);
option
.
value
=
jsonObj
.
options
[
i
].
value
;
option
.
text
=
jsonObj
.
options
[
i
].
display_text
;
// Check selected option and mark it
option
.
selected
=
jsonObj
.
options
[
i
].
value
==
jsonObj
.
selected
;
if
(
jsonObj
.
selected
)
{
option
.
selected
=
jsonObj
.
options
[
i
].
value
==
jsonObj
.
selected
;
}
element
.
appendChild
(
option
);
}
else
{
console
.
error
(
'
Missing required JSON keys for Drop Down conversion.
'
);
}
}
}
else
{
console
.
error
(
'
Missing required JSON keys for Drop Down conversion.
'
);
}
return
element
;
};
...
...
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