Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/web/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ <h2 id="menutitle" class="screenreader-only">Navigation Controls</h2>
aria-label="Contribute detailed usage information"/>
<label for="detailed-logging" id="detailed-logging-label">
Contribute detailed usage information.</label>
<a href="https://www.pyret.org/cpo-faq#(part._logging)" target="_blank" rel="noopener noreferrer" class="focusable info-btn" role="menuitem" tabindex="-1"
<a href="https://code.pyret.org/faq/" target="_blank" rel="noopener noreferrer" class="focusable info-btn" role="menuitem" tabindex="-1"
id="detailed-logging-learn-more"
title="Learn More" aria-label="Learn More">?</a>
</span>
Expand Down
10 changes: 1 addition & 9 deletions src/web/faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,7 @@ <h3>What permissions does code.pyret.org ask for and why?</h3>
<li><em>Know who you are on Google</em> and <em>View your email address</em>:
The site needs to know your Google identity because this allows us to give
persistent access to saving to Drive that doesn't expire or require popping up
new windows while you're editing. </li>

<li><em>Manage your photos and videos</em> and <em>View the photos, videos, and
albums in your Google Drive</em>: This is used to import images into programs
from your Drive (which can be useful for customizing games, for example).
</li>

<li><em>View and manage your spreadsheets on Google Drive</em>: This enables
importing tables and working with data sources in your Drive.</li>
new windows while you're editing.</li>

<li><em>Add itself to Google Drive</em>: This lets you right-click on Pyret
programs in Google Drive and "Open with Pyret."</li>
Expand Down
13 changes: 11 additions & 2 deletions src/web/js/cpo-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@
// NOTE(joe): this function just allocates a closure, so it's stack-safe
var onCompile = gmf(cpo, "make-on-compile").app(runtime.makeFunction(saveGDriveCachedFile, "save-gdrive-cached-file"));

function maybeAppendSlash(s) {
if(s.endsWith("/")) { return s; }
return s + "/";
}

function urlResolve(path, base) {
return new URL(path, base).href;
}

// NOTE(joe/ben): this function _used_ to be trivially stack safe, but files
// need to resolve their absolute path to calculate their URI, which
// requires an RPC, so this function is no-longer trivially flat
Expand Down Expand Up @@ -198,7 +207,7 @@
return arr[0];
}
else if (protocol === "url-file") {
return arr[0] + "/" + arr[1];
return urlResolve(arr[1], maybeAppendSlash(arr[0]));
}
else {
console.error("Unknown import: ", dependency);
Expand Down Expand Up @@ -256,7 +265,7 @@
return runtime.getField(runtime.getField(urlLoc, "values"), "url-locator").app(arr[0], replGlobals);
}
else if (protocol === "url-file") {
const fullUrl = arr[0] + "/" + arr[1];
const fullUrl = urlResolve(arr[1], maybeAppendSlash(arr[0]));
switch(urlFileMode) {
case "all-remote":
fetch(fullUrl).then(async (response) => {
Expand Down
2 changes: 1 addition & 1 deletion src/web/js/dashboard/StudentDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class StudentDashboard extends Component {
</div>
<div className='footer middle'>
<p className='right'>
<a target="_blank" href="https://www.pyret.org">pyret.org</a> | <a target="_blank" href="https://pyret.org/cpo-faq/">Privacy</a> | <a target="_blank" href="https://www.github.com/brownplt/code.pyret.org">Software</a></p>
<a target="_blank" href="https://www.pyret.org">pyret.org</a> | <a target="_blank" href="https://code.pyret.org/faq/">Policies</a> | <a target="_blank" href="https://www.github.com/brownplt/code.pyret.org">Software</a></p>
</div>

</div>
Expand Down