|
Tilde Friends
|
Classes | |
| class | TfNavigationElement |
| class | TfFilesElement |
| class | TfFilesPaneElement |
Functions | |
| function | ensureLoaded (nodes, callback) |
| function | editing () |
| function | is_edit_only () |
| function async | edit () |
| function | loadFile (name, id) |
| function async | load (path) |
| function | closeEditor () |
| function async | update_html () |
| function | save (save_to) |
| function async | save_open_direct () |
| function | save_locally () |
| function | save_as () |
| function | changeIcon () |
| function | deleteApp () |
| function | url () |
| function | hash () |
| function | api_setDocument (content) |
| function | api_setTitle (text) |
| function | api_postMessage (message) |
| function | api_error (error) |
| function | api_localStorageSet (key, value) |
| function | api_localStorageGet (key) |
| function | api_requestPermission (permission, description) |
| function | api_print () |
| function | api_getHash (hash) |
| function | api_setHash (hash) |
| function | set_hidden (id, hide) |
| function | update_credentials (credentials) |
| function | _receive_websocket_message (message) |
| function | setStatusMessage (message, color) |
| function | send (value) |
| function | hashChange () |
| function | focus () |
| function | blur () |
| function | visibilitychange () |
| function | message (event) |
| function | reconnect (path) |
| function | connectSocket (path) |
| function | modeFromName (name) |
| function | openFile (name) |
| function | updateFiles () |
| function | makeNewFile (name) |
| function | newFile () |
| function | renameFile () |
| function | removeFile () |
| function async | appExport () |
| function async | save_file_to_blob_id (name, file) |
| function async | appImport () |
| function async | sourcePretty () |
| function | toggleVisibleWhitespace () |
Variables | |
| const | k_api |
Tilde Friends client-side browser JavaScript.
| function _receive_websocket_message | ( | message | ) |
Process an incoming WebSocket message.
| message | The message. |
| function api_error | ( | error | ) |
Show an error.
| error | The error. |
| function api_getHash | ( | hash | ) |
Get the window's location hash.
| function api_localStorageGet | ( | key | ) |
Get a value from local storage.
| key | The key. |
| function api_localStorageSet | ( | key, | |
| value | |||
| ) |
et a value in local storage.
| key | The key. |
| value | The value. |
| function api_postMessage | ( | message | ) |
Send a message to the sandboxed iframe.
| message | The message. |
| function api_print | ( | ) |
Log from the app to the console.
| function api_requestPermission | ( | permission, | |
| description | |||
| ) |
Request a permission
| permission | The permission to request. |
| description | An optional human-readable description of the action for which the permission is being requested. |
| function api_setDocument | ( | content | ) |
Set the iframe document contents.
| content | The contents. |
| function api_setHash | ( | hash | ) |
Set the window's location hash.
| hash | The new hash. |
| function api_setTitle | ( | text | ) |
Set the document title.
| text | The title. |
| function async appExport | ( | ) |
Export the app to a zip file, which is downloaded by the browser.
| function async appImport | ( | ) |
Prompt to import an app from a zip file.
| function blur | ( | ) |
Notify the app of lost focus.
| function changeIcon | ( | ) |
Prompt to set the app icon.
| function closeEditor | ( | ) |
Hide the editor.
| function connectSocket | ( | path | ) |
Connect the WebSocket.
| path | The path to which to connect. |
| function deleteApp | ( | ) |
Prompt to delete the current app.
| function async edit | ( | ) |
Show the editor.
| function editing | ( | ) |
Check whether the editior is currently visible.
| function ensureLoaded | ( | nodes, | |
| callback | |||
| ) |
Make sure a set of dependencies are loaded
| nodes | An array of descriptions of dependencies to load. |
| callback | Called when all dependencies are loaded. |
| function focus | ( | ) |
Make sure the app is connected on window focus, and notify the app.
| function hash | ( | ) |
Get the window hash without the lone '#' if it is empty.
| function hashChange | ( | ) |
Notify the app of the window hash changing.
| function is_edit_only | ( | ) |
Check whether only the editor is visible and the app is hidden.
| function async load | ( | path | ) |
Load files for the app.
| path | The app path to load. |
| function loadFile | ( | name, | |
| id | |||
| ) |
Load a single file.
| name | The name by which the file is known. |
| id | The file's ID. |
| function makeNewFile | ( | name | ) |
Create a new file with the given name.
| name | The file's name. |
| function message | ( | event | ) |
Handle a message.
| event | The message. |
| function modeFromName | ( | name | ) |
Determine a CodeMirror language mode from filename.
| name | Filename. |
| function newFile | ( | ) |
Prompt to create a new file.
| function openFile | ( | name | ) |
Open a file by name.
| name | The file to open. |
| function reconnect | ( | path | ) |
Reconnect the WebSocket.
| path | The path to which the WebSocket should be connected. |
| function removeFile | ( | ) |
Prompt to remove a file.
| function renameFile | ( | ) |
Prompt to rename a file.
| function save | ( | save_to | ) |
Save the app.
| save_to | An optional path to which to save the app. |
| function save_as | ( | ) |
Prompt the user for a path to save the application to, and save there.
| function async save_file_to_blob_id | ( | name, | |
| file | |||
| ) |
Save a file.
| name | The file to svae. |
| file | The file contents. |
| function save_locally | ( | ) |
Save the current application under a standard path for the current user
| function async save_open_direct | ( | ) |
Save the app in-place and then open it by blob ID.
| function send | ( | value | ) |
Send a message to the app.
| value | The message. |
| function set_hidden | ( | id, | |
| hide | |||
| ) |
Hide or unhide a DOM element with the given id.
| id | The element ID. |
| hide | true to hide the element or false to show it. |
| function setStatusMessage | ( | message, | |
| color | |||
| ) |
Set the status message.
| message | The message. |
| color | The message's color. |
| function async sourcePretty | ( | ) |
Prettify the current source file.
| function toggleVisibleWhitespace | ( | ) |
Toggle visible whitespace.
| function update_credentials | ( | credentials | ) |
React to user credentials changing.
| credentials | Credentials object. |
| function async update_html | ( | ) |
Reload any static HTML content in the iframe.
| function updateFiles | ( | ) |
Refresh the files list.
| function url | ( | ) |
Get the current app URL.
| function visibilitychange | ( | ) |
Notify the app of visibility change. Seems to work when changing apps/tabs where focus/blur doesn't on mobile.
| const k_api |
Functions that server-side app code can call through the app object.