A | |
addCommandToHistory, SvgCanvas | |
addSubCommand, SvgCanvas. | |
addSvgElementFromJson, SelectorManager | |
addToSelection, SelectorManager | |
apply | |
assignAttributes, SelectorManager | |
B | |
BatchCommand, SvgCanvas | |
beginUndoableChange, SvgCanvas | |
bind, SelectorManager | |
C | |
ChangeElementCommand, SvgCanvas | |
changeSelectedAttribute, SelectorManager | |
changeSelectedAttributeNoUndo, SelectorManager | |
cleanupElement, SelectorManager | |
clear, SelectorManager | |
clearSelection, SelectorManager | |
convertToNum, SvgCanvas | |
convertToPath, SelectorManager | |
createLayer, SelectorManager | |
D | |
deleteCurrentLayer, SelectorManager | |
deleteSelectedElements, SelectorManager | |
Document functions, SelectorManager | |
E | |
Element Styling, SelectorManager | |
Element Transforms, SelectorManager | |
elements | |
embedImage, SelectorManager | |
F | |
ffClone, SelectorManager | |
findDefs, SelectorManager | |
findDuplicateGradient, SelectorManager | |
finishUndoableChange, SvgCanvas | |
fromXml, SvgCanvas | |
Functions, Selector | |
G | |
getBBox, SelectorManager | |
getBlur, SelectorManager | |
getBold, SelectorManager | |
getColor, SelectorManager | |
getContentElem, SelectorManager | |
getCurrentLayer, SelectorManager | |
getDocumentTitle, SelectorManager | |
getEditorNS, SelectorManager | |
getFontFamily, SelectorManager | |
getFontSize, SelectorManager | |
getId, SelectorManager | |
getItalic, SelectorManager | |
getLayer, SelectorManager | |
getLayerOpacity, SelectorManager | |
getLayerVisibility, SelectorManager | |
getMatrix, SelectorManager | |
getMode, SelectorManager | |
getMouseTarget, SelectorManager | |
getNextId, SelectorManager | |
getNextRedoCommandText, SvgCanvas. | |
getNextUndoCommandText, SvgCanvas. | |
getNumLayers, SelectorManager | |
getOffset, SelectorManager | |
getOpacity, SelectorManager | |
getPathBBox, SelectorManager | |
getRedoStackSize, SvgCanvas. | |
getResolution, SelectorManager | |
getRootElem, SelectorManager | |
getRotationAngle, SelectorManager | |
getRubberBandBox, SelectorManager. | |
getSelectedElems, SelectorManager | |
getStrokeOpacity, SelectorManager | |
getStrokeWidth, SelectorManager | |
getSvgString, SelectorManager | |
getText, SelectorManager | |
getTransformList, SelectorManager | |
getUndoStackSize, SvgCanvas. | |
getUrlFromAttr, SelectorManager | |
getVersion, SelectorManager | |
groupSelectedElements, SelectorManager | |
H | |
hasMatrixTransform, SelectorManager | |
Helper functions, SelectorManager |
Adds a command object to the undo history stack
addCommandToHistory = c.undoCmd.add = function( cmd )
Create a new SVG element based on the given object keys/values and add it to the current layer The element will be ran through cleanupElement before being returned
var addSvgElementFromJson = this.addSvgElementFromJson = function( data )
Adds a list of elements to the selection.
this.addToSelection = function( elemsToAdd, showGrips )
Assigns multiple attributes to an element.
var assignAttributes = this.assignAttributes = function( node, attrs, suspendLength, unitCheck )
History command that can contain/execute multiple other commands
var BatchCommand = this.undoCmd.batch = function( text )
This function tells the canvas to remember the old values of the attrName attribute for each element sent in.
c.beginUndoableChange = function( attrName, elems )
Attaches a callback function to an event
c.bind = function( event, f )
History command to make a change to an element.
var ChangeElementCommand = this.undoCmd.changeElement = function( elem, attrs, text )
Change the given/selected element and add the original value to the history stack If you want to change all selectedElements, ignore the elems argument.
this.changeSelectedAttribute = function( attr, val, elems )
This function makes the changes to the elements.
this.changeSelectedAttributeNoUndo = function( attr, newValue, elems )
Remove unneeded (default) attributes, makes resulting SVG smaller
var cleanupElement = this.cleanupElement = function( element )
Clears the current document.
this.clear = function()
Clears the selection.
this.clearSelection = function( noCall )
Converts given values to numbers.
convertToNum = function( attr, val )
Convert selected element to a path, or get the BBox of an element-as-path
this.convertToPath = function( elem, getBBox )
Creates a new top-level layer in the drawing with the given name, sets the current layer to it, and then clears the selection This function then calls the ‘changed’ handler.
this.createLayer = function( name )
Deletes the current layer from the drawing and then clears the selection.
this.deleteCurrentLayer = function()
Removes all selected elements from the DOM and adds the change to the history stack
this.deleteSelectedElements = function()
Converts a given image file to a data URL when possible, then runs a given callback
this.embedImage = function( val, callback )
Hack for Firefox bugs where text element features aren’t updated.
var ffClone = function( elem )
Return the document’s defs element, create it first if necessary
var findDefs = function()
Check if exact gradient already exists
var findDuplicateGradient = function( grad )
This function returns a BatchCommand object which summarizes the change since beginUndoableChange was called.
c.finishUndoableChange = function()
Converts XML entities in a string to single characters.
fromXml = function( str )
Get the given/selected element’s bounding box object, convert it to be more usable when necessary
this.getBBox = function( elem )
Gets the stdDeviation blur value of the given element
this.getBlur = function( elem )
Check whether selected element is bold or not
this.getBold = function()
Returns the current fill/stroke option
this.getColor = function( type )
Returns the content DOM element
this.getContentElem = function()
Returns the name of the currently selected layer.
this.getCurrentLayer = function()
Returns the current document title or an empty string if not found
this.getDocumentTitle = function()
Returns the editor’s namespace URL, optionally adds it to root element
this.getEditorNS = function( add )
Returns the current font family
this.getFontFamily = function()
Returns the current font size
this.getFontSize = function()
Returns the last created DOM element ID string
getId = c.getId = function()
Check whether selected element is italic or not
this.getItalic = function()
Returns the name of the ith layer.
this.getLayer = function( i )
Returns the opacity of the given layer.
this.getLayerOpacity = function( layername )
Returns whether the layer is visible.
this.getLayerVisibility = function( layername )
Get the matrix object for a given element
var getMatrix = function( elem )
Returns the current editor mode string
this.getMode = function()
Gets the desired element from a mouse event
var getMouseTarget = this.getMouseTarget = function( evt )
Creates and returns a unique ID string for a DOM element
getNextId = c.getNextId = function()
Returns the number of layers in the current drawing.
this.getNumLayers = function()
Returns an object with x, y values indicating the svgcontent element’s position in the editor’s canvas.
this.getOffset = function()
Returns the current opacity
this.getOpacity = function()
Get correct BBox for a path in Webkit Converted from code found here: http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html
var getPathBBox = function( path )
Returns the current dimensions and zoom level in an object
this.getResolution = function()
Returns the root DOM element
this.getRootElem = function()
Get the rotation angle of the given/selected DOM element
this.getRotationAngle = function( elem, to_rad )
Returns the array with selected DOM elements
this.getSelectedElems = function()
Returns the current stroke opacity
this.getStrokeOpacity = function()
Returns the current stroke-width value
this.getStrokeWidth = function()
Returns the current drawing as raw SVG XML text.
this.getSvgString = function()
Returns the current text (textContent) of the selected element
this.getText = function()
Returns an object that behaves like a SVGTransformList for the given DOM element
this.getTransformList = function( elem )
Extracts the URL from the url(...)
var getUrlFromAttr = this.getUrlFromAttr = function( attrVal )
Returns a string which describes the revision number of SvgCanvas.
this.getVersion = function()
Wraps all the selected elements in a group (g) element
this.groupSelectedElements = function()
See if the given transformlist includes a non-indentity matrix transform
var hasMatrixTransform = this.hasMatrixTransform = function( tlist )