3.5 Javascript (AJAX) Component of Sage Notebook

Module: sage.server.notebook.js

Javascript (AJAX) Component of Sage Notebook

Author Log:

This file is one big raw triple-quoted string that contains a bunch of javascript. This javascript is inserted into the head of the notebook web page.

Examples in this module are not automatically tested.

Module-level Functions

async_lib( )

javascript( )

Return javascript library for the Sage Notebook.

jmol_lib( )

notebook_lib( )

Class: JSKeyCode

class JSKeyCode
JSKeyCode( self, key, alt, ctrl, shift)

Functions: js_test

Special Functions: __init__

Class: JSKeyHandler

class JSKeyHandler
This class is used to make javascript functions to check for specific keyevents.
JSKeyHandler( self)

Functions: add,$ \,$ all_tests,$ \,$ set

add( self, name, [key=], [alt=False], [ctrl=False], [shift=False])
Similar to set_key(...), but this instead checks if there is an existing keycode by the specified name, and associates the specified key combination to that name in addition. This way, if different browsers don't catch one keycode, multiple keycodes can be assigned to the same test.

all_tests( self)
Builds all tests currently in the handler. Returns a string of javascript code which defines all functions.

set( self, name, [key=], [alt=False], [ctrl=False], [shift=False])
Add a named keycode to the handler. When built by all_tests(), it can be called in javascript by key_<key_name>(event_object). The function returns true if the keycode numbered by the key parameter was pressed with the appropriate modifier keys, false otherwise.

Special Functions: __init__

See About this document... for information on suggesting changes.