Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit e1f81af

Browse files
committed
Merge remote-tracking branch 'upstream/develop-8.1' into merge-develop_8.1_26.03.18
2 parents 757b319 + 8ce3f21 commit e1f81af

File tree

8 files changed

+78
-5
lines changed

8 files changed

+78
-5
lines changed

builder/builder_utilities.livecodescript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ command builderEnsureZip pZipfile, pURL
603603
builderEnsureFolderForFile pZipfile
604604

605605
builderLog "message", "Downloading zip file:" && pZipfile
606-
get shell(merge("curl -o '[[pZipfile]]' '[[pUrl]]'"))
606+
get shell(merge("curl -k -o '[[pZipfile]]' '[[pUrl]]'"))
607607
if the result is not zero then
608608
builderLog "error", "Failed to download zip file:" && it
609609
throw "failure"

docs/notes/bugfix-13180.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Allow GPS access from Android Browser

docs/notes/bugfix-20961.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Clear the menu object when moving from one menu to another

engine/src/button.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,10 @@ Boolean MCButton::mfocus(int2 x, int2 y)
894894
bptr->message_with_args(MCM_mouse_down, menubutton);
895895
MCRedrawUnlockScreen();
896896
bptr->findmenu();
897+
if (menudepth == 0)
898+
{
899+
MCmenuobjectptr = nullptr;
900+
}
897901
bptr->openmenu(False);
898902
return True;
899903
}

engine/src/java/com/runrev/android/libraries/LibBrowser.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.runrev.android.Engine;
2020
import com.runrev.android.nativecontrol.NativeControlModule;
2121

22+
import android.app.AlertDialog;
2223
import android.app.Activity;
2324
import android.content.*;
2425
import android.content.pm.*;
@@ -321,10 +322,43 @@ public void onHideCustomView()
321322
m_custom_view_callback = null;
322323
}
323324
}
325+
326+
327+
public void showRequestAccessDialog(final String origin, final GeolocationPermissions.Callback callback, String p_title, String p_message, String p_ok_button, String p_cancel_button)
328+
{
329+
DialogInterface.OnClickListener t_listener;
330+
t_listener = new DialogInterface.OnClickListener() {
331+
public void onClick(DialogInterface p_dialog, int p_which)
332+
{
333+
boolean t_remember = true;
334+
boolean t_allow = true;
335+
if (p_which == DialogInterface.BUTTON_POSITIVE)
336+
t_allow = true;
337+
else if (p_which == DialogInterface.BUTTON_NEGATIVE)
338+
t_allow = false;
339+
callback.invoke(origin, t_allow, t_remember);
340+
} };
341+
342+
AlertDialog.Builder t_dialog;
343+
t_dialog = new AlertDialog.Builder(getContext());
344+
t_dialog . setTitle(p_title);
345+
t_dialog . setMessage(p_message);
346+
t_dialog . setPositiveButton(p_ok_button, t_listener);
347+
if (p_cancel_button != null)
348+
t_dialog . setNegativeButton(p_cancel_button, t_listener);
349+
350+
t_dialog . show();
351+
}
352+
353+
public void onGeolocationPermissionsShowPrompt( String origin, GeolocationPermissions.Callback callback) {
354+
showRequestAccessDialog(origin, callback, "Location Access", origin + " would like to use your Current Location", "Allow", "Don't Allow");
355+
}
356+
324357
};
325358

326359
setWebChromeClient(m_chrome_client);
327360
getSettings().setJavaScriptEnabled(true);
361+
getSettings().setGeolocationEnabled(true);
328362
getSettings().setDomStorageEnabled(true);
329363
getSettings().setPluginState(WebSettings.PluginState.ON);
330364
getSettings().setBuiltInZoomControls(true);

engine/src/java/com/runrev/android/nativecontrol/BrowserControl.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.runrev.android.nativecontrol;
1818

19+
import android.app.AlertDialog;
1920
import android.content.*;
2021
import android.content.pm.*;
2122
import android.graphics.*;
@@ -287,9 +288,41 @@ public void onHideCustomView()
287288
m_custom_view_callback = null;
288289
}
289290
}
291+
292+
293+
public void showRequestAccessDialog(final String origin, final GeolocationPermissions.Callback callback, String p_title, String p_message, String p_ok_button, String p_cancel_button)
294+
{
295+
DialogInterface.OnClickListener t_listener;
296+
t_listener = new DialogInterface.OnClickListener() {
297+
public void onClick(DialogInterface p_dialog, int p_which)
298+
{
299+
boolean t_remember = true;
300+
boolean t_allow = true;
301+
if (p_which == DialogInterface.BUTTON_POSITIVE)
302+
t_allow = true;
303+
else if (p_which == DialogInterface.BUTTON_NEGATIVE)
304+
t_allow = false;
305+
callback.invoke(origin, t_allow, t_remember);
306+
} };
307+
308+
AlertDialog.Builder t_dialog;
309+
t_dialog = new AlertDialog.Builder(getView().getContext());
310+
t_dialog . setTitle(p_title);
311+
t_dialog . setMessage(p_message);
312+
t_dialog . setPositiveButton(p_ok_button, t_listener);
313+
if (p_cancel_button != null)
314+
t_dialog . setNegativeButton(p_cancel_button, t_listener);
315+
316+
t_dialog . show();
317+
}
318+
319+
public void onGeolocationPermissionsShowPrompt( String origin, GeolocationPermissions.Callback callback) {
320+
showRequestAccessDialog(origin, callback, "Location Access", origin + " would like to use your Current Location", "Allow", "Don't Allow");
321+
}
290322
};
291323
t_view.setWebChromeClient(m_chrome_client);
292324
t_view.getSettings().setJavaScriptEnabled(true);
325+
t_view.getSettings().setGeolocationEnabled(true);
293326
t_view.getSettings().setDomStorageEnabled(true);
294327
t_view.getSettings().setPluginState(WebSettings.PluginState.ON);
295328
t_view.getSettings().setBuiltInZoomControls(true);

prebuilt/fetch-libraries.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
2323
FETCH_DIR="${SCRIPT_DIR}/fetched"
2424
EXTRACT_DIR="${SCRIPT_DIR}"
2525
WIN32_EXTRACT_DIR="${SCRIPT_DIR}/unpacked"
26-
URL="http://downloads.livecode.com/prebuilts"
26+
URL="https://downloads.livecode.com/prebuilts"
2727

2828
# Platform specific settings
2929
if [ "${OS}" = "Windows_NT" ]; then
@@ -79,7 +79,7 @@ function fetchLibrary {
7979

8080
# Download using an HTTP client of some variety
8181
if $(which curl 1>/dev/null 2>/dev/null) ; then
82-
curl --silent "${URL}/${NAME}.tar.bz2" -o "${FETCH_DIR}/${NAME}.tar.bz2" --fail
82+
curl -k "${URL}/${NAME}.tar.bz2" -o "${FETCH_DIR}/${NAME}.tar.bz2" --fail
8383
elif $(which wget 1>/dev/null 2>/dev/null) ; then
8484
wget "${URL}/${NAME}.tar.bz2" -O "${FETCH_DIR}/${NAME}.tar.bz2"
8585
else

tests/lcs/ext/ext-urls.livecodescript

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ on TestMergExtURL
4343
local tURL
4444
put builderMergExtUrl(tVersion,tEdition) into tURL
4545

46-
get shell("curl -s -o /dev/null -IL -w" && quote & "%{http_code}" & quote && tURL)
46+
get shell("curl -k -s -o /dev/null -IL -w" && quote & "%{http_code}" & quote && tURL)
4747
TestAssert "mergExt" && tEdition && "url is valid", it is 200
4848
end repeat
4949
end TestMergExtURL
@@ -57,7 +57,7 @@ on TestTSNetURL
5757
local tURL
5858
put builderTSNetUrl(tVersion, tEdition) into tURL
5959

60-
get shell("curl -s -o /dev/null -IL -w" && quote & "%{http_code}" & quote && tURL)
60+
get shell("curl -k -s -o /dev/null -IL -w" && quote & "%{http_code}" & quote && tURL)
6161
TestAssert "tsNet" && tEdition && "url is valid", it is 200
6262
end repeat
6363
end TestTSNetURL

0 commit comments

Comments
 (0)