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
18f1968d
Commit
18f1968d
authored
Feb 04, 2016
by
carlosperate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ask the user if they are sure they want to load new blocks (replace workspace).
parent
77da5c9e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
20 deletions
+28
-20
ardublockly/ardublockly.js
ardublockly/ardublockly.js
+26
-18
ardublockly/ardublockly_blockly.js
ardublockly/ardublockly_blockly.js
+2
-2
No files found.
ardublockly/ardublockly.js
View file @
18f1968d
...
...
@@ -293,12 +293,13 @@ Ardublockly.changeIdeButtons = function(value) {
};
/**
* Loads an XML file from the server and
adds the blocks into the Blockly
* workspace.
* Loads an XML file from the server and
replaces the current blocks into the
*
Blockly
workspace.
* @param {!string} xmlFile Server location of the XML file to load.
*/
Ardublockly
.
loadServerXmlFile
=
function
(
xmlFile
)
{
// The loadXmlBlockFile loads the file asynchronously and needs a callback
var
loadXmlfileAccepted
=
function
()
{
// loadXmlBlockFile loads the file asynchronously and needs a callback
var
loadXmlCallback
=
function
(
sucess
)
{
if
(
sucess
)
{
Ardublockly
.
renderContent
();
...
...
@@ -315,6 +316,13 @@ Ardublockly.loadServerXmlFile = function(xmlFile) {
};
Ardublockly
.
loadXmlBlockFile
(
xmlFile
,
loadXmlCallback
,
callbackConnectionError
);
};
Ardublockly
.
alertMessage
(
'
Load new blocks?
'
,
'
Loading a new XML file will replace the current blocks from the
'
+
'
workspace.
\n
Are you sure you want to proceed?
'
,
true
,
loadXmlfileAccepted
);
};
/**
...
...
ardublockly/ardublockly_blockly.js
View file @
18f1968d
...
...
@@ -61,8 +61,8 @@ Ardublockly.bindBlocklyEventListeners = function() {
};
/**
* Loads an XML file from the server and
adds the blocks into the Blockly
* workspace.
* Loads an XML file from the server and
replaces the current blocks into the
*
Blockly
workspace.
* @param {!string} xmlFile XML file path in a reachable server (no local path).
* @param {!function} callbackFileLoaded Function to be called once the file is
* loaded.
...
...
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