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
cff6e030
Commit
cff6e030
authored
Dec 29, 2015
by
carlosperate
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix null str issue when no language set in url.
parent
6566c868
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
ardublockly/ardublockly.js
ardublockly/ardublockly.js
+5
-10
No files found.
ardublockly/ardublockly.js
View file @
cff6e030
...
@@ -120,7 +120,7 @@ Ardublockly.initLanguage = function() {
...
@@ -120,7 +120,7 @@ Ardublockly.initLanguage = function() {
// Check server settings and url language, url gets priority
// Check server settings and url language, url gets priority
Ardublockly
.
LANG
=
Ardublockly
.
getUrlLanguage
()
||
Ardublockly
.
LANG
=
Ardublockly
.
getUrlLanguage
()
||
Ardublockly
.
getLanguageSetting
();
Ardublockly
.
getLanguageSetting
()
||
Ardublockly
.
LANG
;
Ardublockly
.
populateLanguageMenu
(
Ardublockly
.
LANG
);
Ardublockly
.
populateLanguageMenu
(
Ardublockly
.
LANG
);
...
@@ -136,7 +136,7 @@ Ardublockly.initLanguage = function() {
...
@@ -136,7 +136,7 @@ Ardublockly.initLanguage = function() {
*/
*/
Ardublockly
.
getLanguageSetting
=
function
()
{
Ardublockly
.
getLanguageSetting
=
function
()
{
//TODO: Server feature still to be implemented, for now return default
//TODO: Server feature still to be implemented, for now return default
return
Ardublockly
.
LANG
;
return
null
;
};
};
/**
/**
...
@@ -148,7 +148,7 @@ Ardublockly.getUrlLanguage = function() {
...
@@ -148,7 +148,7 @@ Ardublockly.getUrlLanguage = function() {
var
val
=
location
.
search
.
match
(
new
RegExp
(
'
[?&]
'
+
langKey
+
'
=([^&]+)
'
));
var
val
=
location
.
search
.
match
(
new
RegExp
(
'
[?&]
'
+
langKey
+
'
=([^&]+)
'
));
var
language
=
val
?
decodeURIComponent
(
val
[
1
].
replace
(
/
\+
/g
,
'
%20
'
))
:
''
;
var
language
=
val
?
decodeURIComponent
(
val
[
1
].
replace
(
/
\+
/g
,
'
%20
'
))
:
''
;
if
(
Ardublockly
.
LANGUAGE_NAME
[
language
]
===
undefined
)
{
if
(
Ardublockly
.
LANGUAGE_NAME
[
language
]
===
undefined
)
{
language
=
'
null
'
;
language
=
null
;
}
}
return
language
;
return
language
;
};
};
...
@@ -510,9 +510,7 @@ Ardublockly.setSerialPortsHtml = function(jsonResponse) {
...
@@ -510,9 +510,7 @@ Ardublockly.setSerialPortsHtml = function(jsonResponse) {
}
}
};
};
/**
/** Sets the Serial Port with the selected user input from the drop down. */
* Sets the Serial Port with the selected user input from the drop down.
*/
Ardublockly
.
setSerial
=
function
()
{
Ardublockly
.
setSerial
=
function
()
{
var
el
=
document
.
getElementById
(
'
serial_port
'
);
var
el
=
document
.
getElementById
(
'
serial_port
'
);
var
serialValue
=
el
.
options
[
el
.
selectedIndex
].
value
;
var
serialValue
=
el
.
options
[
el
.
selectedIndex
].
value
;
...
@@ -676,10 +674,7 @@ Ardublockly.toogleToolbox = function() {
...
@@ -676,10 +674,7 @@ Ardublockly.toogleToolbox = function() {
Ardublockly
.
TOOLBAR_SHOWING_
=
!
Ardublockly
.
TOOLBAR_SHOWING_
;
Ardublockly
.
TOOLBAR_SHOWING_
=
!
Ardublockly
.
TOOLBAR_SHOWING_
;
};
};
/**
/** @return {boolean} Indicates if the toolbox is currently visible. */
* Returns a boolean indicating if the toolbox is currently visible.
* @return {boolean} Indicates if the toolbox is currently visible.
*/
Ardublockly
.
isToolboxVisible
=
function
()
{
Ardublockly
.
isToolboxVisible
=
function
()
{
return
Ardublockly
.
TOOLBAR_SHOWING_
;
return
Ardublockly
.
TOOLBAR_SHOWING_
;
};
};
...
...
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