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
12b7dd96
Commit
12b7dd96
authored
Dec 19, 2014
by
carlosperate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed soy template from arduino app
parent
59bd0ef6
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
327 additions
and
446 deletions
+327
-446
apps/arduino/arduino.js
apps/arduino/arduino.js
+16
-18
apps/arduino/generated/en.js
apps/arduino/generated/en.js
+0
-55
apps/arduino/index.html
apps/arduino/index.html
+311
-9
apps/arduino/readonly.html
apps/arduino/readonly.html
+0
-36
apps/arduino/template.soy
apps/arduino/template.soy
+0
-328
No files found.
apps/arduino/arduino.js
View file @
12b7dd96
...
@@ -3,16 +3,17 @@
...
@@ -3,16 +3,17 @@
*
*
* Based on the "Code" app developed by: fraser@google.com (Neil Fraser)
* Based on the "Code" app developed by: fraser@google.com (Neil Fraser)
*
*
* @fileoverview JavaScript for Blockly's Code application.
* @fileoverview JavaScript for Blockly's
Arduino
Code application.
*/
*/
'
use strict
'
;
// Supported languages.
// Supported languages.
BlocklyApps
.
LANGUAGES
=
//
BlocklyApps.LANGUAGES =
[
'
en
'
];
//
['en'];
BlocklyApps
.
LANG
=
BlocklyApps
.
getLang
();
//
BlocklyApps.LANG = BlocklyApps.getLang();
document
.
write
(
'
<script type="text/javascript" src="generated/
'
+
//document.write('<script src="generated/' + BlocklyApps.LANG + '.js"></script>\n');
BlocklyApps
.
LANG
+
'
.js"></script>
\n
'
);
/**
/**
* Create a namespace for the application.
* Create a namespace for the application.
...
@@ -87,7 +88,7 @@ Arduino.renderContent = function() {
...
@@ -87,7 +88,7 @@ Arduino.renderContent = function() {
content
.
textContent
=
code
;
content
.
textContent
=
code
;
if
(
typeof
prettyPrintOne
==
'
function
'
)
{
if
(
typeof
prettyPrintOne
==
'
function
'
)
{
code
=
content
.
innerHTML
;
code
=
content
.
innerHTML
;
code
=
prettyPrintOne
(
code
,
'
js
'
);
code
=
prettyPrintOne
(
code
,
'
cpp
'
);
content
.
innerHTML
=
code
;
content
.
innerHTML
=
code
;
}
}
}
}
...
@@ -97,7 +98,7 @@ Arduino.renderContent = function() {
...
@@ -97,7 +98,7 @@ Arduino.renderContent = function() {
* Initialize Blockly. Called on page load.
* Initialize Blockly. Called on page load.
*/
*/
Arduino
.
init
=
function
()
{
Arduino
.
init
=
function
()
{
BlocklyApps
.
init
();
//
BlocklyApps.init();
var
rtl
=
BlocklyApps
.
isRtl
();
var
rtl
=
BlocklyApps
.
isRtl
();
var
container
=
document
.
getElementById
(
'
content_area
'
);
var
container
=
document
.
getElementById
(
'
content_area
'
);
...
@@ -129,12 +130,12 @@ Arduino.init = function() {
...
@@ -129,12 +130,12 @@ Arduino.init = function() {
rtl
:
rtl
,
rtl
:
rtl
,
toolbox
:
toolbox
});
toolbox
:
toolbox
});
BlocklyApps
.
loadBlocks
(
''
);
//
BlocklyApps.loadBlocks('');
if
(
'
BlocklyStorage
'
in
window
)
{
//
if ('BlocklyStorage' in window) {
// Hook a save function onto unload.
//
// Hook a save function onto unload.
BlocklyStorage
.
backupOnUnload
();
//
BlocklyStorage.backupOnUnload();
}
//
}
Arduino
.
tabClick
(
Arduino
.
selected
);
Arduino
.
tabClick
(
Arduino
.
selected
);
Blockly
.
fireUiEvent
(
window
,
'
resize
'
);
Blockly
.
fireUiEvent
(
window
,
'
resize
'
);
...
@@ -153,15 +154,12 @@ Arduino.init = function() {
...
@@ -153,15 +154,12 @@ Arduino.init = function() {
window
.
setTimeout
(
BlocklyApps
.
importPrettify
,
1
);
window
.
setTimeout
(
BlocklyApps
.
importPrettify
,
1
);
};
};
if
(
window
.
location
.
pathname
.
match
(
/readonly.html$/
))
{
window
.
addEventListener
(
'
load
'
,
BlocklyApps
.
initReadonly
);
}
else
{
window
.
addEventListener
(
'
load
'
,
Arduino
.
init
);
window
.
addEventListener
(
'
load
'
,
Arduino
.
init
);
}
/**
/**
* Execute the user's code.
* Execute the user's code.
* Just a quick and dirty eval. Catch infinite loops.
*/
*/
Arduino
.
loadToArduino
=
function
()
{
Arduino
.
loadToArduino
=
function
()
{
// TODO
// TODO
...
...
apps/arduino/generated/en.js
deleted
100644 → 0
View file @
59bd0ef6
This diff is collapsed.
Click to expand it.
apps/arduino/index.html
View file @
12b7dd96
This diff is collapsed.
Click to expand it.
apps/arduino/readonly.html
deleted
100644 → 0
View file @
59bd0ef6
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"google"
value=
"notranslate"
>
<title>
Blockly : Code Readonly
</title>
<script
type=
"text/javascript"
src=
"../_soy/soyutils.js"
></script>
<script
type=
"text/javascript"
src=
"../common.js"
></script>
<script
type=
"text/javascript"
src=
"code.js"
></script>
<style>
html
,
body
{
background-color
:
#fff
;
margin
:
0
;
padding
:
0
;
overflow
:
hidden
;
height
:
100%
;
}
#blockly
>
svg
{
border
:
none
;
}
#blockly
{
position
:
absolute
;
top
:
0
;
left
:
0
;
height
:
100%
;
width
:
100%
;
}
</style>
</head>
<body>
<script
type=
"text/javascript"
>
document
.
write
(
codepage
.
readonly
({},
null
,
{
langSrc
:
BlocklyApps
.
languagePack
()}));
</script>
</body>
</html>
apps/arduino/template.soy
deleted
100644 → 0
View file @
59bd0ef6
This diff is collapsed.
Click to expand it.
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