Note inclusion in the API

main
Isaiah Odhner 2022-08-02 03:44:19 -04:00
parent 548fb6197a
commit 65266a18ce
2 changed files with 5 additions and 0 deletions

View File

@ -129,6 +129,7 @@ let enable_fs_access_api = false;
// The methods in systemHooks can be overridden by a containing page like 98.js.org which hosts jspaint in a same-origin iframe.
// This allows integrations like setting the wallpaper as the background of the host page, or saving files to a server.
// This API may be removed at any time (and perhaps replaced by something based around postMessage)
// The API is documented in the README.md file.
window.systemHooks = window.systemHooks || {};
window.systemHookDefaults = {
// named to be distinct from various platform APIs (showSaveFilePicker, saveAs, electron's showSaveDialog; and saveFile is too ambiguous)

View File

@ -844,6 +844,7 @@ function open_from_image_info(info, callback, canceled, into_existing_session, f
}, canceled, from_session_load);
}
// Note: This function is part of the API.
function open_from_file(file, source_file_handle) {
// The browser isn't very smart about MIME types.
// It seems to look at the file extension, but not the actual file contents.
@ -1140,6 +1141,7 @@ function please_enter_a_number() {
});
}
// Note: This function is part of the API.
function show_error_message(message, error) {
// Test global error handling resiliency by enabling one or both of these:
// Promise.reject(new Error("EMIT EMIT EMIT"));
@ -1823,6 +1825,8 @@ function go_to_history_node(target_history_node, canceling, discard_document_sta
$G.triggerHandler("session-update"); // autosave
$G.triggerHandler("history-update"); // update history view
}
// Note: This function is part of the API.
function undoable({ name, icon, use_loose_canvas_changes, soft }, callback) {
if (!use_loose_canvas_changes) {
/* For performance (especially with two finger panning), I'm disabling this safety check that preserves certain document states in the history.