Skip to content

Commit

Permalink
Merge pull request #8 from trinketapp/v3.2.2
Browse files Browse the repository at this point in the history
V3.2.2
  • Loading branch information
brianpmarks committed Jun 11, 2023
2 parents d803dbd + c2a238c commit f1c6d54
Show file tree
Hide file tree
Showing 14 changed files with 3,445 additions and 1,524 deletions.
Binary file added GlowScriptOffline3.2.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion app.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
runtime: python38
runtime: python310

handlers:

Expand Down
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var gulp = require('gulp')
, version
, glowscript_libraries;

version = '3.2.1';
version = '3.2.2';

glowscript_libraries = {
"glow": [
Expand Down Expand Up @@ -52,7 +52,7 @@ glowscript_libraries = {
],
};

gulp.task('default', function() {
gulp.task('default', async function() {
var shaders = []
, shader_key;

Expand Down
6 changes: 3 additions & 3 deletions ide/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_base_url():
"""
Get the base_url from the datastore
"""
return getSetting('auth_base_url')
return getSetting('auth_base_url', default='http://localhost:8080')
#
# Robust way to check for running locally. Also easy to modify.
#
Expand Down Expand Up @@ -121,7 +121,7 @@ def fillCache(self):
from google.cloud import secretmanager
secrets = secretmanager.SecretManagerServiceClient()
secret_path = f"projects/{GOOGLE_PROJECT_ID}/secrets/OAUTH_CLIENT_SECRETS/versions/{CLIENT_SECRET_VERSION}"
theSecret = secrets.access_secret_version(secret_path).payload.data.decode("utf-8")
theSecret = secrets.access_secret_version(name=secret_path).payload.data.decode("utf-8")
client_secrets = json.loads(theSecret)
CLIENT_ID = client_secrets.get("FN_CLIENT_ID")
CLIENT_SECRET = client_secrets.get("FN_CLIENT_SECRET")
Expand Down Expand Up @@ -217,7 +217,7 @@ def auth():

oauth = authNamespace.get('oauth') or fillAuthNamespace()
token = oauth.google.authorize_access_token()
user = oauth.google.parse_id_token(token)
user = token['userinfo']

if check_auth_host_for_preview(auth_host): # are we in a preview version?
if user.get('email') not in get_preview_users(): # only finish login for these guys
Expand Down
6 changes: 3 additions & 3 deletions ide/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,14 @@ def idejs_static():
ide_js = ide_js.replace('WEBSERVER_NAME_TEMPLATE',host_name)
ide_js = ide_js.replace('SANDBOX_PREFIX_TEMPLATE','https://sandbox.')

return ide_js,200
return flask.Response(ide_js, mimetype='text/javascript')

@app.route('/lib/<path:filename>')
def lib_static(filename):
cache_timeout = None
if is_running_locally():
cache_timeout=0
return flask.send_from_directory('../lib', filename, cache_timeout=cache_timeout)
return flask.send_from_directory('../lib', filename, max_age=cache_timeout)

@app.route('/package/<path:filename>')
def package_static(filename):
Expand All @@ -209,7 +209,7 @@ def untrusted_static(filename):
if host_name.startswith('sandbox.'):
host_name = '.'.join(host_name.split('.')[1:]) # take off the sandbox.
run_js = run_js.replace('HOST_NAME_TEMPLATE',host_name)
return run_js, 200, {'content_type':'text/plain'}
return flask.Response(run_js, mimetype='text/javascript')

return flask.send_from_directory('../untrusted', filename)

Expand Down
1 change: 1 addition & 0 deletions lib/glow/api_misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@
}
s += end
printarea.val(printarea.val()+s)
window.postMessage(JSON.stringify({ "glowscript.print" : s }), "*");
// Make the latest addition visible. Does not scroll if entire text is visible,
// and does not move the scroll bar more than is necessary.
printarea.scrollTop(printarea.scrollTop() + 10000)
Expand Down
Loading

0 comments on commit f1c6d54

Please sign in to comment.