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
9d541bae
Commit
9d541bae
authored
Jul 13, 2015
by
carlosperate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix C++ code generation HTML scape characters.
parent
c19569e8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
28 deletions
+8
-28
ardublockly/ardublockly.css
ardublockly/ardublockly.css
+2
-2
ardublockly/ardublockly.js
ardublockly/ardublockly.js
+6
-5
ardublockly/prettify/arduino.css
ardublockly/prettify/arduino.css
+0
-21
No files found.
ardublockly/ardublockly.css
View file @
9d541bae
...
...
@@ -427,8 +427,8 @@ ul.side-nav li.side-menu-end {
position
:
absolute
!important
;
right
:
0px
!important
;
top
:
0px
!important
;
width
:
5
6
px
!important
;
height
:
5
6
px
!important
;
width
:
5
5
px
!important
;
height
:
5
5
px
!important
;
z-index
:
5
;
}
.spinner-orange
{
...
...
ardublockly/ardublockly.js
View file @
9d541bae
...
...
@@ -113,7 +113,7 @@ Ardublockly.ideSendUpload = function() {
Ardublockly
.
showExtraIdeButtons
(
false
);
Ardublockly
.
setIdeSettings
(
null
,
'
upload
'
);
}
Materialize
.
toast
(
'
Opening sketch in the Arduino IDE
...
'
,
4000
);
Materialize
.
toast
(
'
Uploading sketch into Arduino
...
'
,
4000
);
Ardublockly
.
sendCode
();
};
...
...
@@ -135,7 +135,7 @@ Ardublockly.ideSendOpen = function() {
Ardublockly
.
showExtraIdeButtons
(
false
);
Ardublockly
.
setIdeSettings
(
null
,
'
open
'
);
}
Materialize
.
toast
(
'
Uploading sketch into Arduino
...
'
,
4000
);
Materialize
.
toast
(
'
Opening sketch in the Arduino IDE
...
'
,
4000
);
Ardublockly
.
sendCode
();
};
...
...
@@ -527,6 +527,9 @@ Ardublockly.renderContent = function() {
var
arduinoCode
=
Ardublockly
.
generateArduino
();
if
(
arduinoCode
!==
Ardublockly
.
PREVIOUS_ARDUINO_CODE_
)
{
var
arduinoContent
=
document
.
getElementById
(
'
content_arduino
'
);
// Sets content in case of no pretify and serves as a fast way to scape html
arduinoContent
.
textContent
=
arduinoCode
;
arduinoCode
=
arduinoContent
.
innerHTML
;
if
(
typeof
prettyPrintOne
==
'
function
'
)
{
var
diff
=
JsDiff
.
diffWords
(
Ardublockly
.
PREVIOUS_ARDUINO_CODE_
,
arduinoCode
);
...
...
@@ -539,10 +542,8 @@ Ardublockly.renderContent = function() {
resultStringArray
.
push
(
diff
[
i
].
value
);
}
}
var
codeHtml
=
prettyPrintOne
(
resultStringArray
.
join
(
''
),
'
cpp
'
);
var
codeHtml
=
prettyPrintOne
(
resultStringArray
.
join
(
''
),
'
cpp
'
,
false
);
arduinoContent
.
innerHTML
=
codeHtml
;
}
else
{
arduinoContent
.
textContent
=
arduinoCode
;
}
Ardublockly
.
PREVIOUS_ARDUINO_CODE_
=
arduinoCode
;
}
...
...
ardublockly/prettify/arduino.css
View file @
9d541bae
...
...
@@ -17,55 +17,42 @@
.str
{
color
:
#718c00
;
}
.kwd
{
color
:
#5E6D03
;
}
.com
{
color
:
#8e908c
;
}
.typ
{
color
:
#00979C
;
}
.lit
{
color
:
#f5871f
;
}
.pun
{
color
:
#4d4d4c
;
}
.opn
{
color
:
#4d4d4c
;
}
.clo
{
color
:
#4d4d4c
;
}
.tag
{
color
:
#c82829
;
}
.atn
{
color
:
#f5871f
;
}
.atv
{
color
:
#3e999f
;
}
.dec
{
color
:
#f5871f
;
}
.var
{
color
:
#c82829
;
}
.fun
{
color
:
#4271ae
;
}
...
...
@@ -74,39 +61,31 @@
.str
{
color
:
#006600
;
}
.kwd
{
color
:
#006
;
font-weight
:
bold
;
}
.com
{
color
:
#600
;
font-style
:
italic
;
}
.typ
{
color
:
#404
;
font-weight
:
bold
;
}
.lit
{
color
:
#004444
;
}
.pun
,
.opn
,
.clo
{
color
:
#444400
;
}
.tag
{
color
:
#006
;
font-weight
:
bold
;
}
.atn
{
color
:
#440044
;
}
.atv
{
color
:
#006600
;
}
...
...
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