Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
appinventor-sources
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
appinventor-sources
Commits
849f18fe
Unverified
Commit
849f18fe
authored
Jan 20, 2021
by
Pavitra Golchha
Committed by
GitHub
Jan 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow loading Tutorial URLs with https (#2353)
parent
4e4cc5f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
appinventor/appengine/src/com/google/appinventor/client/Ode.java
...ntor/appengine/src/com/google/appinventor/client/Ode.java
+10
-3
No files found.
appinventor/appengine/src/com/google/appinventor/client/Ode.java
View file @
849f18fe
...
...
@@ -2431,16 +2431,23 @@ public class Ode implements EntryPoint {
}
public
void
setTutorialURL
(
String
newURL
)
{
if
(
newURL
.
isEmpty
()
||
(!
newURL
.
startsWith
(
"http://appinventor.mit.edu/"
)
&&
!
newURL
.
startsWith
(
"http://appinv.us/"
)))
{
boolean
isUrlAllowed
=
!
newURL
.
isEmpty
()
&&
(
newURL
.
startsWith
(
"http://appinventor.mit.edu/"
)
||
newURL
.
startsWith
(
"https://appinventor.mit.edu/"
)
||
newURL
.
startsWith
(
"http://appinv.us/"
));
if
(!
isUrlAllowed
)
{
designToolbar
.
setTutorialToggleVisible
(
false
);
setTutorialVisible
(
false
);
}
else
{
String
[]
urlSplits
=
newURL
.
split
(
"//"
);
// [protocol, rest]
boolean
isHttps
=
Window
.
Location
.
getProtocol
()
==
"https:"
||
urlSplits
[
0
]
==
"https:"
;
String
locale
=
Window
.
Location
.
getParameter
(
"locale"
);
if
(
locale
!=
null
)
{
newURL
+=
(
newURL
.
contains
(
"?"
)
?
"&"
:
"?"
)
+
"locale="
+
locale
;
}
tutorialPanel
.
setUrl
(
newURL
);
String
effectiveUrl
=
(
isHttps
?
"https://"
:
"http://"
)
+
urlSplits
[
1
];
tutorialPanel
.
setUrl
(
effectiveUrl
);
designToolbar
.
setTutorialToggleVisible
(
true
);
setTutorialVisible
(
true
);
}
...
...
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