Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Widgets and functions that are useful for web-based editing applications.

Notifications You must be signed in to change notification settings

BYU-ODH/EditorWidgets

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EditorWidgets

Widgets and functions that are useful for web-based editing applications.

##CommandStack Initialize: var stack = new EditorWidgets.CommandStack();
Methods:

  • push(obj) - Takes an object with the following fields:

    • undo - a function to execute to undo an action
    • redo - a function to execute to redo an action
    • context - the this binding for the undo and redo functions

    and adds it to the undo stack and clears the redo stack.

  • undo() - Pops the last command object off the undo stack, executes its undo function, and adds it to the redo stack.

  • redo() - Pops the last command off the redo stack, executes its redo function, and adds it to the undo stack.

##Save(files, target, [success, [error]])

  • files: a list of objects with the following fields:
    • collection - the name of the collection of files this file belongs to, if any
    • name - the name of this file
    • mime - the mime type for the file
    • data - the actual file contents
  • target: the url to upload files to, or 'file' for a local save
  • success(responseText): a callback function for HTTP success response codes; ignored for local saves
  • error(responseText): a callback function for HTTP error response codes; ignored for local saves

About

Widgets and functions that are useful for web-based editing applications.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 86.2%
  • CSS 7.1%
  • Shell 6.7%