Skip to content

Commit f1c6d54

Browse files
authored
Merge pull request #8 from trinketapp/v3.2.2
V3.2.2
2 parents d803dbd + c2a238c commit f1c6d54

14 files changed

Lines changed: 3445 additions & 1524 deletions

GlowScriptOffline3.2.zip

6.33 MB
Binary file not shown.

app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
runtime: python38
1+
runtime: python310
22

33
handlers:
44

gulpfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var gulp = require('gulp')
99
, version
1010
, glowscript_libraries;
1111

12-
version = '3.2.1';
12+
version = '3.2.2';
1313

1414
glowscript_libraries = {
1515
"glow": [
@@ -52,7 +52,7 @@ glowscript_libraries = {
5252
],
5353
};
5454

55-
gulp.task('default', function() {
55+
gulp.task('default', async function() {
5656
var shaders = []
5757
, shader_key;
5858

ide/auth.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def get_base_url():
8989
"""
9090
Get the base_url from the datastore
9191
"""
92-
return getSetting('auth_base_url')
92+
return getSetting('auth_base_url', default='http://localhost:8080')
9393
#
9494
# Robust way to check for running locally. Also easy to modify.
9595
#
@@ -121,7 +121,7 @@ def fillCache(self):
121121
from google.cloud import secretmanager
122122
secrets = secretmanager.SecretManagerServiceClient()
123123
secret_path = f"projects/{GOOGLE_PROJECT_ID}/secrets/OAUTH_CLIENT_SECRETS/versions/{CLIENT_SECRET_VERSION}"
124-
theSecret = secrets.access_secret_version(secret_path).payload.data.decode("utf-8")
124+
theSecret = secrets.access_secret_version(name=secret_path).payload.data.decode("utf-8")
125125
client_secrets = json.loads(theSecret)
126126
CLIENT_ID = client_secrets.get("FN_CLIENT_ID")
127127
CLIENT_SECRET = client_secrets.get("FN_CLIENT_SECRET")
@@ -217,7 +217,7 @@ def auth():
217217

218218
oauth = authNamespace.get('oauth') or fillAuthNamespace()
219219
token = oauth.google.authorize_access_token()
220-
user = oauth.google.parse_id_token(token)
220+
user = token['userinfo']
221221

222222
if check_auth_host_for_preview(auth_host): # are we in a preview version?
223223
if user.get('email') not in get_preview_users(): # only finish login for these guys

ide/routes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,14 @@ def idejs_static():
176176
ide_js = ide_js.replace('WEBSERVER_NAME_TEMPLATE',host_name)
177177
ide_js = ide_js.replace('SANDBOX_PREFIX_TEMPLATE','https://sandbox.')
178178

179-
return ide_js,200
179+
return flask.Response(ide_js, mimetype='text/javascript')
180180

181181
@app.route('/lib/<path:filename>')
182182
def lib_static(filename):
183183
cache_timeout = None
184184
if is_running_locally():
185185
cache_timeout=0
186-
return flask.send_from_directory('../lib', filename, cache_timeout=cache_timeout)
186+
return flask.send_from_directory('../lib', filename, max_age=cache_timeout)
187187

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

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

lib/glow/api_misc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@
284284
}
285285
s += end
286286
printarea.val(printarea.val()+s)
287+
window.postMessage(JSON.stringify({ "glowscript.print" : s }), "*");
287288
// Make the latest addition visible. Does not scroll if entire text is visible,
288289
// and does not move the scroll bar more than is necessary.
289290
printarea.scrollTop(printarea.scrollTop() + 10000)

0 commit comments

Comments
 (0)