diff --git a/CHANGES b/CHANGES index 1742bc09..9472fcc2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,16 @@ +2.8 (Ellipse) - November 24th, 2015 +----------------------------------------------------------- +For a complete list of changes run: + git log 4bb15e0..253b4bf + +* Added PathSeg polyfill to workaround pathseg removal in browsers. +* Fixed pathtool bug where paths were erroneously deleted. +* Fixed bug where context menu did not work for groups. +* Updated Slovenian locale. +* Fixed unicode encoding issue for icons. +* Added custom.css stylesheet for customization without changing the main editor. +* Improved PDF export. + 2.7.1 (applied to 2.7 branch) - April 17, 2014 ----------------------------------------------------------- * Fix important ID situation with embedded API diff --git a/Makefile b/Makefile index 46a6b016..a8e3dff7 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ NAME=svg-edit -VERSION=2.7.1 +VERSION=2.8 PACKAGE=$(NAME)-$(VERSION) MAKEDOCS=naturaldocs/NaturalDocs CLOSURE=build/tools/closure-compiler.jar diff --git a/README.md b/README.md index 7c3546d8..0f2d23b8 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,39 @@ -SVG-edit, a web based SVG editor +![alt text](https://progers.github.io/svgedit/images/logo48x48.svg "svg-edit logo of a pencil") SVG-edit === +SVG-edit is a fast, web-based, javascript-driven SVG drawing editor that works in any modern browser. -Source code lives on GitHub: -https://github.com/SVG-Edit/svgedit +### [Try SVG-edit here](http://progers.github.io/svgedit/releases/svg-edit-2.8/svg-editor.html) -Issue tracking and previewing remains on Google Code: -https://code.google.com/p/svg-edit/ +(Also available as a [download](https://github.com/progers/svgedit/releases/download/Releasev2.8/svg-edit-2.8.zip)). -See AUTHORS file for authors. +## Recent news + * 2015-11-24 SVG-edit 2.8 was released. + * 2015-11-24 Code, issue tracking, and docs are being moved to github (previously [code.google.com](https://code.google.com/p/svg-edit)). + * 2014-04-17 2.7 and stable branches updated to reflect 2.7.1 important bug fixes for the embedded editor. + * 2014-04-07 SVG-edit 2.7 was released. + * 2013-01-15 SVG-edit 2.6 was released. ------ +## Videos -SVG-edit contains code from these projects: + * [SVG-edit 2.4 Part 1](http://www.youtube.com/watch?v=zpC7b1ZJvvM) + * [SVG-edit 2.4 Part 2](http://www.youtube.com/watch?v=mDzZEoGUDe8) + * [SVG-edit 2.3 Features](http://www.youtube.com/watch?v=RVIcIy5fXOc) + * [Introduction to SVG-edit](http://www.youtube.com/watch?v=ZJKmEI06YiY) (Version 2.2) -jQuery JavaScript Library v1.3.2 -http://jquery.com/ -Copyright (c) 2009 John Resig +## Supported browsers -jQuery js-Hotkeys -http://code.google.com/p/js-hotkeys/ -Copyright (c) 2008 Tzury Bar Yochay +The following browsers had been tested for 2.6 or earlier and will probably continue to work with 2.8. + * Firefox 1.5+ + * Opera 9.50+ + * Safari 4+ + * Chrome 1+ + * IE 9+ and Edge -jPicker -http://www.digitalmagicpro.com/jPicker/ -Copyright (c) 2009 Christopher T. Tillman +## Further reading and more information + + * See [docs](docs/) for more documentation. + * [Acknowledgements](docs/Acknowledgements.md) lists open source projects used in svg-edit. + * See [AUTHORS](AUTHORS) file for authors. + * [Stackoverflow](http://stackoverflow.com/tags/svg-edit) group. + * Join the [svg-edit mailing list](https://groups.google.com/forum/#!forum/svg-edit). + * Join us on `#svg-edit` on `freenode.net` (or use the [web client](http://webchat.freenode.net/?channels=svg-edit)). diff --git a/docs/Acknowledgements.md b/docs/Acknowledgements.md new file mode 100644 index 00000000..91b95896 --- /dev/null +++ b/docs/Acknowledgements.md @@ -0,0 +1,37 @@ +Projects used by SVG-edit +=== + +Like many open source projects, SVG-edit depends on other open source projects. This page acknowledges these projects and the many software developers across the globe without which our software would be sorely lacking. + +#### jQuery +Jonathan Resig's [jQuery library](https://jquery.com) was chosen as a basis for the project since the beginning. The power of jQuery really lets us focus on the functionality and not worry about all the intricacies of mixing with the HTML, CSS and SVG DOM. + +#### jPicker +Christopher Tillman's awesome [jPicker](http://www.digitalmagicpro.com/jPicker) is used as our fill/stroke picker. The source code repository is now hosted at GoogleCode. + +Christopher was gracious enough to take suggestions from Pavol on how to incorporate opacity and some callback functionality back upstream into jPicker. + +#### jGraduate +Jeff Schiller created the excellent [jGraduate](https://code.google.com/p/jgraduate/) plugin to select SVG gradients in SVG-edit. + +#### canvg +Gabe Lerner's excellent [canvg](https://github.com/gabelerner/canvg) library has helped us bypass browsers' inability to save SVG files an PNGs, by first rendering SVG images in an HTML5 Canvas element. + +####jQuery UI + +We use [jQuery-UI](http://jqueryui.com) for making the dialog boxes (color picker, document properties) draggable, as well as for the opacity slider. + +####js-hotkeys + +[js-hotkeys](https://github.com/jeresig/jquery.hotkeys) is used to bind all keyboard events in the editor. + +####JQuery Web Spin-Button + +George Adamson's [Web Spin-Button](http://www.softwareunity.com/jquery/JQuerySpinBtn) provided a starting point to implementing a cross-browser spin control in SVG-edit. A few bugs were fixed with compatibility and sent back to George for hopeful inclusion in the next version of his jQuery plugin. + +####SVG Icon Loader +Alexis Deveria's [svg-icon-loader](https://code.google.com/p/svg-icon-loader/) is used to load in all the SVG icons for the SVG-edit user interface. + +####Icons + +Many of the icons used in SVG-edit come from the [Tango Desktop Project](http://tango.freedesktop.org/Tango_Desktop_Project) which are released into the public domain. We also used a couple of icons from the [Silk Icon Project](http://famfamfam.com/lab/icons/silk), which is licensed under the Creative Commons Attribution 2.5 License. Finally, some of the icons were hand-drawn (in SVG-edit itself). diff --git a/docs/ReleaseInstructions.md b/docs/ReleaseInstructions.md new file mode 100644 index 00000000..e650f586 --- /dev/null +++ b/docs/ReleaseInstructions.md @@ -0,0 +1,38 @@ +Creating a new svg-edit release +============ + +## Update the main project + + 1. Update the VERSION variable in Makefile. + 2. Update the CHANGES file with a summary of all changes. + 3. Commit these changes with `git commit -m "Updating Makefile and CHANGES for release X.Y"`. + +The above steps can be done on a fork and committed via a pull request. + +## Create the release binaries + + 1. Ensure you are on the `master` branch with `git checkout master`. + 2. From the root directory run `make`. + 3. Copy `build/svg-edit-X.Y/`, `build/svg-edit-X.Y-src.tar.gz`, and `build/svg-edit-X.Y.zip` to a temporary directory. + 4. Switch to the `gh-pages` branch with `git checkout gh-pages`. + 5. Copy the `svg-edit-X.Y` directory to `releases/svg-edit-X.Y`. + 6. Commit these changes with `git commit -m "Updating binary files for release X.Y"`. + 7. Switch back to the `master` branch with `git checkout master`. + 8. Ensure this step worked by visiting https://svgedit.github.io/svgedit/releases/svg-edit-X.Y/svg-editor.html + +The above steps can be done on a fork and committed via a pull request. + +## Create the release on GitHub + + 1. Go to `https://github.com/SVG-Edit/svgedit/releases` and select `Draft a new release`. + 2. Make the release target point at the commit where the makefile and changes were updated. + 3. Write a short description of the release and include a link to the live version: + https://svgedit.github.io/svgedit/releases/svg-edit-X.Y/svg-editor.html + 4. Attach the `svg-edit-X.Y-src.tar.gz` and `build/svg-edit-X.Y.zip` files to the release. + 5. Create the release! + +You will need to be a member of the SVGEdit GitHub group to do this step. + +## Update the project docs + + Update `README.md` with references and links to the shiny new release. diff --git a/docs/files/svgcanvas-js.html b/docs/files/svgcanvas-js.html deleted file mode 100644 index 6f1b0b36..00000000 --- a/docs/files/svgcanvas-js.html +++ /dev/null @@ -1,426 +0,0 @@ - - -SvgCanvas - - - - - - - - - -

SvgCanvas

The main SvgCanvas class that manages all SVG-related functions

Parameters

containerThe container HTML element that should hold the SVG root element
configAn object that contains configuration data
Summary
SvgCanvasThe main SvgCanvas class that manages all SVG-related functions
Utils.toXmlConverts characters in a string to XML-friendly entities.
Utils.fromXmlConverts XML entities in a string to single characters.
Utils.encode64Converts a string to base64
Utils.decode64Converts a string from base64
Utils.convertToXMLReferencesConverts a string to use XML references
rectsIntersectCheck if two rectangles (BBoxes objects) intersect each other
snapToAngleReturns a 45 degree angle coordinate associated with the two given coordinates
text2xmlCross-browser compatible method of converting a string to an XML tree found this function here: http://groups.google.com/group/jquery-dev/browse_thread/thread/c6d11387c580a77f
Unit conversion functions
convertToNumConverts given values to numbers.
setUnitAttrSets an element’s attribute based on the unit in its current value.
isValidUnitCheck if an attribute’s value is in a valid format
Undo/Redo history management
ChangeElementCommandHistory command to make a change to an element.
ChangeElementCommand.applyPerforms the stored change action
ChangeElementCommand.unapplyReverses the stored change action
ChangeElementCommand.elementsReturns array with element associated with this command
InsertElementCommandHistory command for an element that was added to the DOM
InsertElementCommand.applyRe-Inserts the new element
InsertElementCommand.unapplyRemoves the element
InsertElementCommand.elementsReturns array with element associated with this command
RemoveElementCommandHistory command for an element removed from the DOM
RemoveElementCommand.applyRe-removes the new element
RemoveElementCommand.unapplyRe-adds the new element
RemoveElementCommand.elementsReturns array with element associated with this command
MoveElementCommandHistory command for an element that had its DOM position changed
MoveElementCommand.unapplyRe-positions the element
MoveElementCommand.unapplyPositions the element back to its original location
MoveElementCommand.elementsReturns array with element associated with this command
BatchCommandHistory command that can contain/execute multiple other commands
BatchCommand.applyRuns “apply” on all subcommands
BatchCommand.unapplyRuns “unapply” on all subcommands
BatchCommand.elementsIterate through all our subcommands and returns all the elements we are changing
BatchCommand.addSubCommandAdds a given command to the history stack
BatchCommand.isEmptyReturns a boolean indicating whether or not the batch command is empty
resetUndoStackResets the undo stack, effectively clearing the undo/redo history
undoMgr.getUndoStackSizeInteger with the current size of the undo history stack
undoMgr.getRedoStackSizeInteger with the current size of the redo history stack
undoMgr.getNextUndoCommandTextString associated with the next undo command
undoMgr.getNextRedoCommandTextString associated with the next redo command
undoMgr.undoPerforms an undo step
undoMgr.redoPerforms a redo step
addCommandToHistoryAdds a command object to the undo history stack
beginUndoableChangeThis function tells the canvas to remember the old values of the attrName attribute for each element sent in.
finishUndoableChangeThis function returns a BatchCommand object which summarizes the change since beginUndoableChange was called.
SelectorPrivate class for DOM element selection boxes
Functions
Selector.resetUsed to reset the id and element that the selector is attached to
Selector.showGripsShow the resize grips of this selector
Selector.updateGripCursorsUpdates cursors for corner grips on rotation so arrows point the right way
Selector.resizeUpdates the selector to match the element’s size
SelectorManagerPublic class to manage all selector objects (selection boxes)
SelectorManager.initGroupResets the parent selector group element
SelectorManager.requestSelectorReturns the selector based on the given element
SelectorManager.releaseSelectorRemoves the selector of the given element (hides selection box)
SelectorManager.getRubberBandBoxReturns the rubberBandBox DOM element.
Helper functions
walkTreeWalks the tree and executes the callback on each element in a top-down fashion
walkTreePostWalks the tree and executes the callback on each element in a depth-first fashion
assignAttributesAssigns multiple attributes to an element.
cleanupElementRemove unneeded (default) attributes, makes resulting SVG smaller
addSvgElementFromJsonCreate 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
addExtensionAdd an extension to the editor
shortFloatRounds a given value to a float with number of digits defined in save_options
getStrokedBBoxGet the bounding box for one or more stroked and/or transformed elements
getVisibleElementsGet all elements that have a BBox (excludes <defs>, <title>, etc).
copyElemCreate a clone of an element, updating its ID and its children’s IDs when needed
getElemGet a DOM element by ID within the SVG root element.
getIdReturns the last created DOM element ID string
getNextIdCreates and returns a unique ID string for a DOM element
bindAttaches a callback function to an event
setIdPrefixChanges the ID prefix to the given value
sanitizeSvgSanitizes the input node and its children It only keeps what is allowed from our whitelist defined above
getUrlFromAttrExtracts the URL from the url(...)
getBBoxGet the given/selected element’s bounding box object, convert it to be more usable when necessary
ffCloneHack for Firefox bugs where text element features aren’t updated.
getPathBBoxGet 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
Element Transforms
getRotationAngleGet the rotation angle of the given/selected DOM element
setRotationAngleRemoves any old rotations if present, prepends a new rotation at the transformed center
getTransformListReturns an object that behaves like a SVGTransformList for the given DOM element
recalculateAllSelectedDimensionsRuns recalculateDimensions on the selected elements, adding the changes to a single batch command
remapElementApplies coordinate changes to an element based on the given matrix
recalculateDimensionsDecides the course of action based on the element’s transform list
transformPointA (hopefully) quicker function to transform a point by a matrix (this function avoids any DOM calls and just does the math)
isIdentityHelper function to check if the matrix performs no actual transform (i.e.
matrixMultiplyThis function tries to return a SVGMatrix that is the multiplication m1*m2.
transformListToTransformThis returns a single matrix Transform for a given Transform List (this is the equivalent of SVGTransformList.consolidate() but unlike that method, this one does not modify the actual SVGTransformList) This function is very liberal with its min,max arguments
hasMatrixTransformSee if the given transformlist includes a non-indentity matrix transform
getMatrixGet the matrix object for a given element
transformBoxTransforms a rectangle based on the given matrix
Selection
clearSelectionClears the selection.
addToSelectionAdds a list of elements to the selection.
removeFromSelectionRemoves elements from the selection.
selectAllInCurrentLayerClears the selection, then adds all elements in the current layer to the selection.
smoothControlPointsTakes three points and creates a smoother line based on them
getMouseTargetGets the desired element from a mouse event
preventClickDefaultPrevents default browser click behaviour on the given element
Text edit functionsFunctions relating to editing text elements
Path edit functionsFunctions relating to editing path elements
Serialization
removeUnusedDefElemsLooks at DOM elements inside the <defs> to see if they are referred to, removes them from the DOM if they are not.
svgCanvasToStringMain function to set up the SVG content for output
svgToStringSub function ran on each SVG element to convert it to a string as desired
embedImageConverts a given image file to a data URL when possible, then runs a given callback
saveSerializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.
rasterExportGenerates a PNG Data URL based on the current image, then calls “exported” with an object including the string and any issues found
getSvgStringReturns the current drawing as raw SVG XML text.
setSvgStringThis function sets the current drawing as the input SVG XML.
importSvgStringThis function imports the input SVG XML into the current layer in the drawing
Layers
identifyLayersUpdates layer system
createLayerCreates 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.
deleteCurrentLayerDeletes the current layer from the drawing and then clears the selection.
getNumLayersReturns the number of layers in the current drawing.
getLayerReturns the name of the ith layer.
getCurrentLayerReturns the name of the currently selected layer.
setCurrentLayerSets the current layer.
renameCurrentLayerRenames the current layer.
setCurrentLayerPositionChanges the position of the current layer to the new value.
getLayerVisibilityReturns whether the layer is visible.
setLayerVisibilitySets the visibility of the layer.
moveSelectedToLayerMoves the selected elements to layername.
getLayerOpacityReturns the opacity of the given layer.
setLayerOpacitySets the opacity of the given layer.
Document functions
clearClears the current document.
linkControlPointsAlias function
getContentElemReturns the content DOM element
getRootElemReturns the root DOM element
getSelectedElemsReturns the array with selected DOM elements
getResolutionReturns the current dimensions and zoom level in an object
getZoomReturns the current zoom level
getVersionReturns a string which describes the revision number of SvgCanvas.
setUiStringsUpdate interface strings with given values
setConfigUpdate configuration options with given values
getDocumentTitleReturns the current document title or an empty string if not found
setDocumentTitleAdds/updates a title element for the document with the given name.
getEditorNSReturns the editor’s namespace URL, optionally adds it to root element
setResolutionChanges the document’s dimensions to the given size
getOffsetReturns an object with x, y values indicating the svgcontent element’s position in the editor’s canvas.
setBBoxZoomSets the zoom level on the canvas-side based on the given value
setZoomSets the zoom to the given level
getModeReturns the current editor mode string
setModeSets the editor’s mode to the given string
Element Styling
getColorReturns the current fill/stroke option
setColorChange the current stroke/fill color/gradient value
findDefsReturn the document’s <defs> element, create it first if necessary
setGradientApply the current gradient to selected element’s fill or stroke
findDuplicateGradientCheck if exact gradient already exists
setPaintSet a color/gradient to a fill/stroke
getStrokeWidthReturns the current stroke-width value
setStrokeWidthSets the stroke width for the current selected elements When attempting to set a line’s width to 0, this changes it to 1 instead
setStrokeAttrSet the given stroke-related attribute the given value for selected elements
getOpacityReturns the current opacity
setOpacitySets the given opacity to the current selected elements
getOpacityReturns the current fill opacity
getStrokeOpacityReturns the current stroke opacity
setPaintOpacitySets the current fill/stroke opacity
getBlurGets the stdDeviation blur value of the given element
setBlurNoUndoSets the stdDeviation blur value on the selected element without being undoable
setBlurOffsetsSets the x, y, with, height values of the filter element in order to make the blur not be clipped.
setBlurAdds/updates the blur filter to the selected element
getBoldCheck whether selected element is bold or not
setBoldMake the selected element bold or normal
getItalicCheck whether selected element is italic or not
setItalicMake the selected element italic or normal
getFontFamilyReturns the current font family
setFontFamilySet the new font family
getFontSizeReturns the current font size
setFontSizeApplies the given font size to the selected element
getTextReturns the current text (textContent) of the selected element
setTextContentUpdates the text element with the given string
setImageURLSets the new image URL for the selected image element.
setRectRadiusSets the rx & ry values to the selected rect element to change its corner radius
Element manipulation
setSegTypeSets the new segment type to the selected segment(s).
convertToPathConvert selected element to a path, or get the BBox of an element-as-path
changeSelectedAttributeNoUndoThis function makes the changes to the elements.
changeSelectedAttributeChange the given/selected element and add the original value to the history stack If you want to change all selectedElements, ignore the elems argument.
deleteSelectedElementsRemoves all selected elements from the DOM and adds the change to the history stack
groupSelectedElementsWraps all the selected elements in a group (g) element
ungroupSelectedElementUnwraps all the elements in a selected group (g) element.
moveToTopSelectedElementRepositions the selected element to the bottom in the DOM to appear on top of other elements
moveToBottomSelectedElementRepositions the selected element to the top in the DOM to appear under other elements
moveSelectedElementsMoves selected elements on the X/Y axis
cloneSelectedElementsCreate deep DOM copies (clones) of all selected elements and move them slightly from their originals
alignSelectedElementsAligns selected elements
Additional editor tools
updateCanvasUpdates the editor canvas width/height/position after a zoom has occurred
setBackgroundSet the background of the editor (NOT the actual document)
cycleElementSelect the next/previous element within the current layer
- -

Utils.toXml

Converts characters in a string to XML-friendly entities.

Example: “&” becomes “&amp;”

Parameters

strThe string to be converted

Returns

The converted string

- -

Utils.fromXml

Converts XML entities in a string to single characters.  Example: “&amp;” becomes “&”

Parameters

strThe string to be converted

Returns

The converted string

- -

Utils.encode64

Converts a string to base64

- -

Utils.decode64

Converts a string from base64

- -

Utils.convertToXMLReferences

Converts a string to use XML references

- -

rectsIntersect

"rectsIntersect": function(r1,
r2)

Check if two rectangles (BBoxes objects) intersect each other

Paramaters

r1The first BBox-like object
r2The second BBox-like object

Returns

Boolean that’s true if rectangles intersect

- -

snapToAngle

"snapToAngle": function(x1,
y1,
x2,
y2)

Returns a 45 degree angle coordinate associated with the two given coordinates

Parameters

x1First coordinate’s x value
x2Second coordinate’s x value
y1First coordinate’s y value
y2Second coordinate’s y value

Returns

Object with the following values: x - The angle-snapped x value y - The angle-snapped y value snapangle - The angle at which to snap

- -

text2xml

"text2xml": function(sXML)

Cross-browser compatible method of converting a string to an XML tree found this function here: http://groups.google.com/group/jquery-dev/browse_thread/thread/c6d11387c580a77f

- -

Unit conversion functions

- -

convertToNum

convertToNum = function(attr,
val)

Converts given values to numbers.  Attributes must be supplied in case a percentage is given

Parameters

attrString with the name of the attribute associated with the value
valString with the attribute value to convert
- -

setUnitAttr

setUnitAttr = function(elem,
attr,
val)

Sets an element’s attribute based on the unit in its current value.

Parameters

elemDOM element to be changed
attrString with the name of the attribute associated with the value
valString with the attribute value to convert
- -

isValidUnit

canvas.isValidUnit = function(attr,
val)

Check if an attribute’s value is in a valid format

Parameters

attrString with the name of the attribute associated with the value
valString with the attribute value to check
- -

Undo/Redo history management

- -

ChangeElementCommand

var ChangeElementCommand = this.undoCmd.changeElement = function(elem,
attrs,
text)

History command to make a change to an element.  Usually an attribute change, but can also be textcontent.

Parameters

elemThe DOM element that was changed
attrsAn object with the attributes to be changed and the values they had before the change
textAn optional string visible to user related to this change
- -

ChangeElementCommand.apply

Performs the stored change action

- -

ChangeElementCommand.unapply

Reverses the stored change action

- -

ChangeElementCommand.elements

Returns array with element associated with this command

- -

InsertElementCommand

var InsertElementCommand = this.undoCmd.insertElement = function(elem,
text)

History command for an element that was added to the DOM

Parameters

elemThe newly added DOM element
textAn optional string visible to user related to this change
- -

InsertElementCommand.apply

Re-Inserts the new element

- -

InsertElementCommand.unapply

Removes the element

- -

InsertElementCommand.elements

Returns array with element associated with this command

- -

RemoveElementCommand

var RemoveElementCommand = this.undoCmd.removeElement = function(elem,
parent,
text)

History command for an element removed from the DOM

Parameters

elemThe removed DOM element
parentThe DOM element’s parent
textAn optional string visible to user related to this change
- -

RemoveElementCommand.apply

Re-removes the new element

- -

RemoveElementCommand.unapply

Re-adds the new element

- -

RemoveElementCommand.elements

Returns array with element associated with this command

- -

MoveElementCommand

var MoveElementCommand = this.undoCmd.moveElement = function(elem,
oldNextSibling,
oldParent,
text)

History command for an element that had its DOM position changed

Parameters

elemThe DOM element that was moved
oldNextSiblingThe element’s next sibling before it was moved
oldParentThe element’s parent before it was moved
textAn optional string visible to user related to this change
- -

MoveElementCommand.unapply

Re-positions the element

- -

MoveElementCommand.unapply

Positions the element back to its original location

- -

MoveElementCommand.elements

Returns array with element associated with this command

- -

BatchCommand

var BatchCommand = this.undoCmd.batch = function(text)

History command that can contain/execute multiple other commands

Parameters

textAn optional string visible to user related to this change
- -

BatchCommand.apply

Runs “apply” on all subcommands

- -

BatchCommand.unapply

Runs “unapply” on all subcommands

- -

BatchCommand.elements

Iterate through all our subcommands and returns all the elements we are changing

- -

BatchCommand.addSubCommand

Adds a given command to the history stack

Parameters

cmdThe undo command object to add
- -

BatchCommand.isEmpty

Returns a boolean indicating whether or not the batch command is empty

- -

resetUndoStack

resetUndoStack = function()

Resets the undo stack, effectively clearing the undo/redo history

- -

undoMgr.getUndoStackSize

Returns

Integer with the current size of the undo history stack

- -

undoMgr.getRedoStackSize

Returns

Integer with the current size of the redo history stack

- -

undoMgr.getNextUndoCommandText

Returns

String associated with the next undo command

- -

undoMgr.getNextRedoCommandText

Returns

String associated with the next redo command

- -

undoMgr.undo

Performs an undo step

- -

undoMgr.redo

Performs a redo step

- -

addCommandToHistory

addCommandToHistory = c.undoCmd.add = function(cmd)

Adds a command object to the undo history stack

Parameters

cmdThe command object to add
- -

beginUndoableChange

c.beginUndoableChange = function(attrName,
elems)

This function tells the canvas to remember the old values of the attrName attribute for each element sent in.  The elements and values are stored on a stack, so the next call to finishUndoableChange() will pop the elements and old values off the stack, gets the current values from the DOM and uses all of these to construct the undo-able command.

Parameters

attrNameThe name of the attribute being changed
elemsArray of DOM elements being changed
- -

finishUndoableChange

c.finishUndoableChange = function()

This function returns a BatchCommand object which summarizes the change since beginUndoableChange was called.  The command can then be added to the command history

Returns

Batch command object with resulting changes

- -

Selector

Private class for DOM element selection boxes

Parameters

idinteger to internally indentify the selector
elemDOM element associated with this selector
Summary
Functions
Selector.resetUsed to reset the id and element that the selector is attached to
Selector.showGripsShow the resize grips of this selector
Selector.updateGripCursorsUpdates cursors for corner grips on rotation so arrows point the right way
Selector.resizeUpdates the selector to match the element’s size
- -

Functions

- -

Selector.reset

Used to reset the id and element that the selector is attached to

Parameters

eDOM element associated with this selector
- -

Selector.showGrips

Show the resize grips of this selector

Parameters

showboolean indicating whether grips should be shown or not
- -

Selector.updateGripCursors

Updates cursors for corner grips on rotation so arrows point the right way

Parameters

angleFloat indicating current rotation angle in degrees
- -

Selector.resize

Updates the selector to match the element’s size

- -

SelectorManager

Public class to manage all selector objects (selection boxes)

Summary
SelectorManager.initGroupResets the parent selector group element
SelectorManager.requestSelectorReturns the selector based on the given element
SelectorManager.releaseSelectorRemoves the selector of the given element (hides selection box)
SelectorManager.getRubberBandBoxReturns the rubberBandBox DOM element.
Helper functions
walkTreeWalks the tree and executes the callback on each element in a top-down fashion
walkTreePostWalks the tree and executes the callback on each element in a depth-first fashion
assignAttributesAssigns multiple attributes to an element.
cleanupElementRemove unneeded (default) attributes, makes resulting SVG smaller
addSvgElementFromJsonCreate 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
addExtensionAdd an extension to the editor
shortFloatRounds a given value to a float with number of digits defined in save_options
getStrokedBBoxGet the bounding box for one or more stroked and/or transformed elements
getVisibleElementsGet all elements that have a BBox (excludes <defs>, <title>, etc).
copyElemCreate a clone of an element, updating its ID and its children’s IDs when needed
getElemGet a DOM element by ID within the SVG root element.
getIdReturns the last created DOM element ID string
getNextIdCreates and returns a unique ID string for a DOM element
bindAttaches a callback function to an event
setIdPrefixChanges the ID prefix to the given value
sanitizeSvgSanitizes the input node and its children It only keeps what is allowed from our whitelist defined above
getUrlFromAttrExtracts the URL from the url(...)
getBBoxGet the given/selected element’s bounding box object, convert it to be more usable when necessary
ffCloneHack for Firefox bugs where text element features aren’t updated.
getPathBBoxGet 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
Element Transforms
getRotationAngleGet the rotation angle of the given/selected DOM element
setRotationAngleRemoves any old rotations if present, prepends a new rotation at the transformed center
getTransformListReturns an object that behaves like a SVGTransformList for the given DOM element
recalculateAllSelectedDimensionsRuns recalculateDimensions on the selected elements, adding the changes to a single batch command
remapElementApplies coordinate changes to an element based on the given matrix
recalculateDimensionsDecides the course of action based on the element’s transform list
transformPointA (hopefully) quicker function to transform a point by a matrix (this function avoids any DOM calls and just does the math)
isIdentityHelper function to check if the matrix performs no actual transform (i.e.
matrixMultiplyThis function tries to return a SVGMatrix that is the multiplication m1*m2.
transformListToTransformThis returns a single matrix Transform for a given Transform List (this is the equivalent of SVGTransformList.consolidate() but unlike that method, this one does not modify the actual SVGTransformList) This function is very liberal with its min,max arguments
hasMatrixTransformSee if the given transformlist includes a non-indentity matrix transform
getMatrixGet the matrix object for a given element
transformBoxTransforms a rectangle based on the given matrix
Selection
clearSelectionClears the selection.
addToSelectionAdds a list of elements to the selection.
removeFromSelectionRemoves elements from the selection.
selectAllInCurrentLayerClears the selection, then adds all elements in the current layer to the selection.
smoothControlPointsTakes three points and creates a smoother line based on them
getMouseTargetGets the desired element from a mouse event
preventClickDefaultPrevents default browser click behaviour on the given element
Text edit functionsFunctions relating to editing text elements
Path edit functionsFunctions relating to editing path elements
Serialization
removeUnusedDefElemsLooks at DOM elements inside the <defs> to see if they are referred to, removes them from the DOM if they are not.
svgCanvasToStringMain function to set up the SVG content for output
svgToStringSub function ran on each SVG element to convert it to a string as desired
embedImageConverts a given image file to a data URL when possible, then runs a given callback
saveSerializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.
rasterExportGenerates a PNG Data URL based on the current image, then calls “exported” with an object including the string and any issues found
getSvgStringReturns the current drawing as raw SVG XML text.
setSvgStringThis function sets the current drawing as the input SVG XML.
importSvgStringThis function imports the input SVG XML into the current layer in the drawing
Layers
identifyLayersUpdates layer system
createLayerCreates 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.
deleteCurrentLayerDeletes the current layer from the drawing and then clears the selection.
getNumLayersReturns the number of layers in the current drawing.
getLayerReturns the name of the ith layer.
getCurrentLayerReturns the name of the currently selected layer.
setCurrentLayerSets the current layer.
renameCurrentLayerRenames the current layer.
setCurrentLayerPositionChanges the position of the current layer to the new value.
getLayerVisibilityReturns whether the layer is visible.
setLayerVisibilitySets the visibility of the layer.
moveSelectedToLayerMoves the selected elements to layername.
getLayerOpacityReturns the opacity of the given layer.
setLayerOpacitySets the opacity of the given layer.
Document functions
clearClears the current document.
linkControlPointsAlias function
getContentElemReturns the content DOM element
getRootElemReturns the root DOM element
getSelectedElemsReturns the array with selected DOM elements
getResolutionReturns the current dimensions and zoom level in an object
getZoomReturns the current zoom level
getVersionReturns a string which describes the revision number of SvgCanvas.
setUiStringsUpdate interface strings with given values
setConfigUpdate configuration options with given values
getDocumentTitleReturns the current document title or an empty string if not found
setDocumentTitleAdds/updates a title element for the document with the given name.
getEditorNSReturns the editor’s namespace URL, optionally adds it to root element
setResolutionChanges the document’s dimensions to the given size
getOffsetReturns an object with x, y values indicating the svgcontent element’s position in the editor’s canvas.
setBBoxZoomSets the zoom level on the canvas-side based on the given value
setZoomSets the zoom to the given level
getModeReturns the current editor mode string
setModeSets the editor’s mode to the given string
Element Styling
getColorReturns the current fill/stroke option
setColorChange the current stroke/fill color/gradient value
findDefsReturn the document’s <defs> element, create it first if necessary
setGradientApply the current gradient to selected element’s fill or stroke
findDuplicateGradientCheck if exact gradient already exists
setPaintSet a color/gradient to a fill/stroke
getStrokeWidthReturns the current stroke-width value
setStrokeWidthSets the stroke width for the current selected elements When attempting to set a line’s width to 0, this changes it to 1 instead
setStrokeAttrSet the given stroke-related attribute the given value for selected elements
getOpacityReturns the current opacity
setOpacitySets the given opacity to the current selected elements
getOpacityReturns the current fill opacity
getStrokeOpacityReturns the current stroke opacity
setPaintOpacitySets the current fill/stroke opacity
getBlurGets the stdDeviation blur value of the given element
setBlurNoUndoSets the stdDeviation blur value on the selected element without being undoable
setBlurOffsetsSets the x, y, with, height values of the filter element in order to make the blur not be clipped.
setBlurAdds/updates the blur filter to the selected element
getBoldCheck whether selected element is bold or not
setBoldMake the selected element bold or normal
getItalicCheck whether selected element is italic or not
setItalicMake the selected element italic or normal
getFontFamilyReturns the current font family
setFontFamilySet the new font family
getFontSizeReturns the current font size
setFontSizeApplies the given font size to the selected element
getTextReturns the current text (textContent) of the selected element
setTextContentUpdates the text element with the given string
setImageURLSets the new image URL for the selected image element.
setRectRadiusSets the rx & ry values to the selected rect element to change its corner radius
Element manipulation
setSegTypeSets the new segment type to the selected segment(s).
convertToPathConvert selected element to a path, or get the BBox of an element-as-path
changeSelectedAttributeNoUndoThis function makes the changes to the elements.
changeSelectedAttributeChange the given/selected element and add the original value to the history stack If you want to change all selectedElements, ignore the elems argument.
deleteSelectedElementsRemoves all selected elements from the DOM and adds the change to the history stack
groupSelectedElementsWraps all the selected elements in a group (g) element
ungroupSelectedElementUnwraps all the elements in a selected group (g) element.
moveToTopSelectedElementRepositions the selected element to the bottom in the DOM to appear on top of other elements
moveToBottomSelectedElementRepositions the selected element to the top in the DOM to appear under other elements
moveSelectedElementsMoves selected elements on the X/Y axis
cloneSelectedElementsCreate deep DOM copies (clones) of all selected elements and move them slightly from their originals
alignSelectedElementsAligns selected elements
Additional editor tools
updateCanvasUpdates the editor canvas width/height/position after a zoom has occurred
setBackgroundSet the background of the editor (NOT the actual document)
cycleElementSelect the next/previous element within the current layer
- -

SelectorManager.initGroup

Resets the parent selector group element

- -

SelectorManager.requestSelector

Returns the selector based on the given element

Parameters

elemDOM element to get the selector for
- -

SelectorManager.releaseSelector

Removes the selector of the given element (hides selection box)

Parameters

elemDOM element to remove the selector for
- -

SelectorManager.getRubberBandBox

Returns the rubberBandBox DOM element.  This is the rectangle drawn by the user for selecting/zooming

- -

Helper functions

- -

walkTree

function walkTree(elem,
cbFn)

Walks the tree and executes the callback on each element in a top-down fashion

Parameters

elemDOM element to traverse
cbFnCallback function to run on each element
- -

walkTreePost

function walkTreePost(elem,
cbFn)

Walks the tree and executes the callback on each element in a depth-first fashion

Parameters

elemDOM element to traverse
cbFnCallback function to run on each element
- -

assignAttributes

var assignAttributes = this.assignAttributes = function(node,
attrs,
suspendLength,
unitCheck)

Assigns multiple attributes to an element.

Parameters

nodeDOM element to apply new attribute values to
attrsObject with attribute keys/values
suspendLengthOptional integer of milliseconds to suspend redraw
unitCheckBoolean to indicate the need to use setUnitAttr
- -

cleanupElement

var cleanupElement = this.cleanupElement = function(element)

Remove unneeded (default) attributes, makes resulting SVG smaller

Parameters

elementDOM element to clean up
- -

addSvgElementFromJson

var addSvgElementFromJson = this.addSvgElementFromJson = function(data)

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

Parameters

dataObject with the following keys/values:
  • element - DOM element to create
  • attr - Object with attributes/values to assign to the new element
  • curStyles - Boolean indicating that current style attributes should be applied first

Returns: The new element

- -

addExtension

this.addExtension = function(name,
ext_func)

Add an extension to the editor

Parameters

nameString with the ID of the extension
ext_funcFunction supplied by the extension with its data
- -

shortFloat

var shortFloat = function(val)

Rounds a given value to a float with number of digits defined in save_options

Parameters

valThe value as a String, Number or Array of two numbers to be rounded

Returns

If a string/number was given, returns a Float.  If an array, return a string with comma-seperated floats

- -

getStrokedBBox

var getStrokedBBox = this.getStrokedBBox = function(elems)

Get the bounding box for one or more stroked and/or transformed elements

Parameters

elemsArray with DOM elements to check

Returns

A single bounding box object

- -

getVisibleElements

var getVisibleElements = this.getVisibleElements = function(parent,
includeBBox)

Get all elements that have a BBox (excludes <defs>, <title>, etc).  Note that 0-opacity, off-screen etc elements are still considered “visible” for this function

Parameters

parentThe parent DOM element to search within
includeBBoxBoolean to indicate that an object should return with the element and its bbox

Returns

An array with all “visible” elements, or if includeBBox is true, an array with objects that include:

  • elem - The element
  • bbox - The element’s BBox as retrieved from getStrokedBBox
- -

copyElem

var copyElem = function(el)

Create a clone of an element, updating its ID and its children’s IDs when needed

Parameters

elDOM element to clone

Returns: The cloned element

- -

getElem

function getElem(id)

Get a DOM element by ID within the SVG root element.

Parameters

idString with the element’s new ID
- -

getId

getId = c.getId = function()

Returns the last created DOM element ID string

- -

getNextId

getNextId = c.getNextId = function()

Creates and returns a unique ID string for a DOM element

- -

bind

c.bind = function(event,
f)

Attaches a callback function to an event

Parameters

eventString indicating the name of the event
fThe callback function to bind to the event

Return

The previous event

- -

setIdPrefix

c.setIdPrefix = function(p)

Changes the ID prefix to the given value

Parameters

pString with the new prefix
- -

sanitizeSvg

var sanitizeSvg = this.sanitizeSvg = function(node)

Sanitizes the input node and its children It only keeps what is allowed from our whitelist defined above

Parameters

nodeThe DOM element to be checked, will also check its children
- -

getUrlFromAttr

var getUrlFromAttr = this.getUrlFromAttr = function(attrVal)

Extracts the URL from the url(...) syntax of some attributes.  Three variants:

  • <circle fill=”url(someFile.svg#foo)” />
  • <circle fill=”url(‘someFile.svg#foo’)” />
  • <circle fill=’url(“someFile.svg#foo”)’ />

Parameters

attrValThe attribute value as a string

Returns

String with just the URL, like someFile.svg#foo

- -

getBBox

var getBBox = this.getBBox = function(elem)

Get the given/selected element’s bounding box object, convert it to be more usable when necessary

Parameters

elemOptional DOM element to get the BBox for
- -

ffClone

var ffClone = function(elem)

Hack for Firefox bugs where text element features aren’t updated.  This function clones the element and re-selects it TODO: Test for this bug on load and add it to “support” object instead of browser sniffing

Parameters

elemThe (text) DOM element to clone
- -

getPathBBox

var getPathBBox = function(path)

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

Parameters

pathThe path DOM element to get the BBox for

Returns

A BBox-like object

- -

Element Transforms

- -

getRotationAngle

var getRotationAngle = this.getRotationAngle = function(elem,
to_rad)

Get the rotation angle of the given/selected DOM element

Parameters

elemOptional DOM element to get the angle for
to_radBoolean that when true returns the value in radians rather than degrees

Returns

Float with the angle in degrees or radians

- -

setRotationAngle

this.setRotationAngle = function(val,
preventUndo)

Removes any old rotations if present, prepends a new rotation at the transformed center

Parameters

valThe new rotation angle in degrees
preventUndoBoolean indicating whether the action should be undoable or not
- -

getTransformList

var getTransformList = this.getTransformList = function(elem)

Returns an object that behaves like a SVGTransformList for the given DOM element

Parameters

elemDOM element to get a transformlist from
- -

recalculateAllSelectedDimensions

var recalculateAllSelectedDimensions = this.recalculateAllSelectedDimensions = function()

Runs recalculateDimensions on the selected elements, adding the changes to a single batch command

- -

remapElement

var remapElement = this.remapElement = function(selected,
changes,
m)

Applies coordinate changes to an element based on the given matrix

Parameters

selectedDOM element to be changed
changesObject with changes to be remapped
mMatrix object to use for remapping coordinates
- -

recalculateDimensions

var recalculateDimensions = this.recalculateDimensions = function(selected)

Decides the course of action based on the element’s transform list

Parameters

selectedThe DOM element to recalculate

Returns

Undo command object with the resulting change

- -

transformPoint

var transformPoint = function(x,
y,
m)

A (hopefully) quicker function to transform a point by a matrix (this function avoids any DOM calls and just does the math)

Parameters

xFloat representing the x coordinate
yFloat representing the y coordinate
mMatrix object to transform the point with Returns a x,y object representing the transformed point
- -

isIdentity

var isIdentity = function(m)

Helper function to check if the matrix performs no actual transform (i.e. exists for identity purposes)

Parameters

mThe matrix object to check

Returns

Boolean indicating whether or not the matrix is 1,0,0,1,0,0

- -

matrixMultiply

var matrixMultiply = this.matrixMultiply = function()

This function tries to return a SVGMatrix that is the multiplication m1*m2.  We also round to zero when it’s near zero

Parameters

= 2 Matrix objects to multiply

Returns

The matrix object resulting from the calculation

- -

transformListToTransform

var transformListToTransform = this.transformListToTransform = function(tlist,
min,
max)

This returns a single matrix Transform for a given Transform List (this is the equivalent of SVGTransformList.consolidate() but unlike that method, this one does not modify the actual SVGTransformList) This function is very liberal with its min,max arguments

Parameters

tlistThe transformlist object
minOptional integer indicating start transform position
maxOptional integer indicating end transform position

Returns

A single matrix transform object

- -

hasMatrixTransform

var hasMatrixTransform = this.hasMatrixTransform = function(tlist)

See if the given transformlist includes a non-indentity matrix transform

Parameters

tlistThe transformlist to check

Returns

Boolean on whether or not a matrix transform was found

- -

getMatrix

var getMatrix = function(elem)

Get the matrix object for a given element

Parameters

elemThe DOM element to check

Returns

The matrix object associated with the element’s transformlist

- -

transformBox

var transformBox = this.transformBox = function(l,
t,
w,
h,
m)

Transforms a rectangle based on the given matrix

Parameters

lFloat with the box’s left coordinate
tFloat with the box’s top coordinate
wFloat with the box width
hFloat with the box height
mMatrix object to transform the box by

Returns

An object with the following values:

  • tl - The top left coordinate (x,y object)
  • tr - The top right coordinate (x,y object)
  • bl - The bottom left coordinate (x,y object)
  • br - The bottom right coordinate (x,y object)
  • aabox - Object with the following values:
  • Float with the axis-aligned x coordinate
  • Float with the axis-aligned y coordinate
  • Float with the axis-aligned width coordinate
  • Float with the axis-aligned height coordinate
- -

Selection

- -

clearSelection

var clearSelection = this.clearSelection = function(noCall)

Clears the selection.  The ‘selected’ handler is then called.  Parameters: noCall - Optional boolean that when true does not call the “selected” handler

- -

addToSelection

var addToSelection = this.addToSelection = function(elemsToAdd,
showGrips)

Adds a list of elements to the selection.  The ‘selected’ handler is then called.

Parameters

elemsToAddan array of DOM elements to add to the selection
showGripsa boolean flag indicating whether the resize grips should be shown
- -

removeFromSelection

var removeFromSelection = this.removeFromSelection = function(elemsToRemove)

Removes elements from the selection.

Parameters

elemsToRemovean array of elements to remove from selection
- -

selectAllInCurrentLayer

this.selectAllInCurrentLayer = function()

Clears the selection, then adds all elements in the current layer to the selection.  This function then fires the selected event.

- -

smoothControlPoints

var smoothControlPoints = this.smoothControlPoints = function(ct1,
ct2,
pt)

Takes three points and creates a smoother line based on them

Parameters

ct1Object with x and y values (first control point)
ct2Object with x and y values (second control point)
ptObject with x and y values (third point)

Returns

Array of two “smoothed” point objects

- -

getMouseTarget

var getMouseTarget = this.getMouseTarget = function(evt)

Gets the desired element from a mouse event

Parameters

evtEvent object from the mouse event

Returns

DOM element we want

- -

preventClickDefault

var preventClickDefault = function(img)

Prevents default browser click behaviour on the given element

Parameters

imgThe DOM element to prevent the cilck on
- -

Text edit functions

Functions relating to editing text elements

- -

Path edit functions

Functions relating to editing path elements

- -

Serialization

- -

removeUnusedDefElems

var removeUnusedDefElems = this.removeUnusedDefElems = function()

Looks at DOM elements inside the <defs> to see if they are referred to, removes them from the DOM if they are not.

Returns

The amount of elements that were removed

- -

svgCanvasToString

var svgCanvasToString = this.svgCanvasToString = function()

Main function to set up the SVG content for output

Returns

String containing the SVG image for output

- -

svgToString

var svgToString = this.svgToString = function(elem,
indent)

Sub function ran on each SVG element to convert it to a string as desired

Parameters

elemThe SVG element to convert
indentInteger with the amount of spaces to indent this tag

Returns

String with the given element as an SVG tag

- -

embedImage

this.embedImage = function(val,
callback)

Converts a given image file to a data URL when possible, then runs a given callback

Parameters

valString with the path/URL of the image
callbackOptional function to run when image data is found, supplies the result (data URL or false) as first parameter.
- -

save

this.save = function(opts)

Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.  This function also includes the XML prolog.  Clients of the SvgCanvas bind their save function to the ‘saved’ event.

Returns

Nothing

- -

rasterExport

this.rasterExport = function()

Generates a PNG Data URL based on the current image, then calls “exported” with an object including the string and any issues found

- -

getSvgString

this.getSvgString = function()

Returns the current drawing as raw SVG XML text.

Returns

The current drawing as raw SVG XML text.

- -

setSvgString

this.setSvgString = function(xmlString)

This function sets the current drawing as the input SVG XML.

Parameters

xmlStringThe SVG as XML text.

Returns

This function returns false if the set was unsuccessful, true otherwise.

- -

importSvgString

this.importSvgString = function(xmlString)

This function imports the input SVG XML into the current layer in the drawing

Parameters

xmlStringThe SVG as XML text.

Returns

This function returns false if the import was unsuccessful, true otherwise.  TODO:

  • properly handle if namespace is introduced by imported content (must add to svgcontent and update all prefixes in the imported node)
  • properly handle recalculating dimensions, recalculateDimensions() doesn’t handle arbitrary transform lists, but makes some assumptions about how the transform list was obtained
  • import should happen in top-left of current zoomed viewport
  • create a new layer for the imported SVG
- -

Layers

- -

identifyLayers

var identifyLayers = function()

Updates layer system

- -

createLayer

this.createLayer = function(name)

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 is an undoable action.

Parameters

nameThe given name
- -

deleteCurrentLayer

this.deleteCurrentLayer = function()

Deletes the current layer from the drawing and then clears the selection.  This function then calls the ‘changed’ handler.  This is an undoable action.

- -

getNumLayers

this.getNumLayers = function()

Returns the number of layers in the current drawing.

Returns

The number of layers in the current drawing.

- -

getLayer

this.getLayer = function(i)

Returns the name of the ith layer.  If the index is out of range, an empty string is returned.

Parameters

ithe zero-based index of the layer you are querying.

Returns

The name of the ith layer

- -

getCurrentLayer

this.getCurrentLayer = function()

Returns the name of the currently selected layer.  If an error occurs, an empty string is returned.

Returns

The name of the currently active layer.

- -

setCurrentLayer

this.setCurrentLayer = function(name)

Sets the current layer.  If the name is not a valid layer name, then this function returns false.  Otherwise it returns true.  This is not an undo-able action.

Parameters

namethe name of the layer you want to switch to.

Returns

true if the current layer was switched, otherwise false

- -

renameCurrentLayer

this.renameCurrentLayer = function(newname)

Renames the current layer.  If the layer name is not valid (i.e. unique), then this function does nothing and returns false, otherwise it returns true.  This is an undo-able action.

Parameters

newnamethe new name you want to give the current layer.  This name must be unique among all layer names.

Returns

true if the rename succeeded, false otherwise.

- -

setCurrentLayerPosition

this.setCurrentLayerPosition = function(newpos)

Changes the position of the current layer to the new value.  If the new index is not valid, this function does nothing and returns false, otherwise it returns true.  This is an undo-able action.

Parameters

newposThe zero-based index of the new position of the layer.  This should be between
0 and (number of layers1)

Returns

true if the current layer position was changed, false otherwise.

- -

getLayerVisibility

this.getLayerVisibility = function(layername)

Returns whether the layer is visible.  If the layer name is not valid, then this function returns false.

Parameters

layernamethe name of the layer which you want to query.

Returns

The visibility state of the layer, or false if the layer name was invalid.

- -

setLayerVisibility

this.setLayerVisibility = function(layername,
bVisible)

Sets the visibility of the layer.  If the layer name is not valid, this function return false, otherwise it returns true.  This is an undo-able action.

Parameters

layernamethe name of the layer to change the visibility
bVisibletrue/false, whether the layer should be visible

Returns

true if the layer’s visibility was set, false otherwise

- -

moveSelectedToLayer

this.moveSelectedToLayer = function(layername)

Moves the selected elements to layername.  If the name is not a valid layer name, then false is returned.  Otherwise it returns true.  This is an undo-able action.

Parameters

layernamethe name of the layer you want to which you want to move the selected elements

Returns

true if the selected elements were moved to the layer, false otherwise.

- -

getLayerOpacity

this.getLayerOpacity = function(layername)

Returns the opacity of the given layer.  If the input name is not a layer, null is returned.

Parameters

layernamename of the layer on which to get the opacity

Returns

The opacity value of the given layer.  This will be a value between 0.0 and 1.0, or null if layername is not a valid layer

- -

setLayerOpacity

this.setLayerOpacity = function(layername,
opacity)

Sets the opacity of the given layer.  If the input name is not a layer, nothing happens.  This is not an undo-able action.  NOTE: this function exists solely to apply a highlighting/de-emphasis effect to a layer, when it is possible for a user to affect the opacity of a layer, we will need to allow this function to produce an undo-able action.  If opacity is not a value between 0.0 and 1.0, then nothing happens.

Parameters

layernamename of the layer on which to set the opacity
opacitya float value in the range 0.0-1.0
- -

Document functions

- -

clear

this.clear = function()

Clears the current document.  This is not an undoable action.

- -

linkControlPoints

Alias function

- -

getContentElem

this.getContentElem = function()

Returns the content DOM element

- -

getRootElem

this.getRootElem = function()

Returns the root DOM element

- -

getSelectedElems

this.getSelectedElems = function()

Returns the array with selected DOM elements

- -

getResolution

var getResolution = this.getResolution = function()

Returns the current dimensions and zoom level in an object

- -

getZoom

this.getZoom = function()

Returns the current zoom level

- -

getVersion

this.getVersion = function()

Returns a string which describes the revision number of SvgCanvas.

- -

setUiStrings

this.setUiStrings = function(strs)

Update interface strings with given values

Parameters

strsObject with strings (see uiStrings for examples)
- -

setConfig

this.setConfig = function(opts)

Update configuration options with given values

Parameters

optsObject with options (see curConfig for examples)
- -

getDocumentTitle

this.getDocumentTitle = function()

Returns the current document title or an empty string if not found

- -

setDocumentTitle

this.setDocumentTitle = function(newtitle)

Adds/updates a title element for the document with the given name.  This is an undoable action

Parameters

newtitleString with the new title
- -

getEditorNS

this.getEditorNS = function(add)

Returns the editor’s namespace URL, optionally adds it to root element

Parameters

addBoolean to indicate whether or not to add the namespace value
- -

setResolution

this.setResolution = function(x,
y)

Changes the document’s dimensions to the given size

Parameters

xNumber with the width of the new dimensions in user units.  Can also be the string “fit” to indicate “fit to content”
yNumber with the height of the new dimensions in user units.

Returns

Boolean to indicate if resolution change was succesful.  It will fail on “fit to content” option with no content to fit to.

- -

getOffset

this.getOffset = function()

Returns an object with x, y values indicating the svgcontent element’s position in the editor’s canvas.

- -

setBBoxZoom

this.setBBoxZoom = function(val,
editor_w,
editor_h)

Sets the zoom level on the canvas-side based on the given value

Parameters

valBounding box object to zoom to or string indicating zoom option
editor_wInteger with the editor’s workarea box’s width
editor_hInteger with the editor’s workarea box’s height
- -

setZoom

this.setZoom = function(zoomlevel)

Sets the zoom to the given level

Parameters

zoomlevelFloat indicating the zoom level to change to
- -

getMode

this.getMode = function()

Returns the current editor mode string

- -

setMode

this.setMode = function(name)

Sets the editor’s mode to the given string

Parameters

nameString with the new mode to change to
- -

Element Styling

- -

getColor

this.getColor = function(type)

Returns the current fill/stroke option

- -

setColor

this.setColor = function(type,
val,
preventUndo)

Change the current stroke/fill color/gradient value

Parameters

typeString indicating fill or stroke
valThe value to set the stroke attribute to
preventUndoBoolean indicating whether or not this should be and undoable option
- -

findDefs

var findDefs = function()

Return the document’s <defs> element, create it first if necessary

- -

setGradient

var setGradient = this.setGradient = function(type)

Apply the current gradient to selected element’s fill or stroke

Parameters type - String indicating “fill” or “stroke” to apply to an element

- -

findDuplicateGradient

var findDuplicateGradient = function(grad)

Check if exact gradient already exists

Parameters

gradThe gradient DOM element to compare to others

Returns

The existing gradient if found, null if not

- -

setPaint

this.setPaint = function(type,
paint)

Set a color/gradient to a fill/stroke

Parameters

typeString with “fill” or “stroke”
paintThe jGraduate paint object to apply
- -

getStrokeWidth

this.getStrokeWidth = function()

Returns the current stroke-width value

- -

setStrokeWidth

this.setStrokeWidth = function(val)

Sets the stroke width for the current selected elements When attempting to set a line’s width to 0, this changes it to 1 instead

Parameters

valA Float indicating the new stroke width value
- -

setStrokeAttr

this.setStrokeAttr = function(attr,
val)

Set the given stroke-related attribute the given value for selected elements

Parameters

attrString with the attribute name
valString or number with the attribute value
- -

getOpacity

this.getOpacity = function()

Returns the current opacity

- -

setOpacity

this.setOpacity = function(val)

Sets the given opacity to the current selected elements

- -

getOpacity

Returns the current fill opacity

- -

getStrokeOpacity

this.getStrokeOpacity = function()

Returns the current stroke opacity

- -

setPaintOpacity

this.setPaintOpacity = function(type,
val,
preventUndo)

Sets the current fill/stroke opacity

Parameters

typeString with “fill” or “stroke”
valFloat with the new opacity value
preventUndoBoolean indicating whether or not this should be an undoable action
- -

getBlur

this.getBlur = function(elem)

Gets the stdDeviation blur value of the given element

Parameters

elemThe element to check the blur value for
- -

setBlurNoUndo

canvas.setBlurNoUndo = function(val)

Sets the stdDeviation blur value on the selected element without being undoable

Parameters

valThe new stdDeviation value
- -

setBlurOffsets

canvas.setBlurOffsets = function(filter,
stdDev)

Sets the x, y, with, height values of the filter element in order to make the blur not be clipped.  Removes them if not neeeded

Parameters

filterThe filter DOM element to update
stdDevThe standard deviation value on which to base the offset size
- -

setBlur

canvas.setBlur = function(val,
complete)

Adds/updates the blur filter to the selected element

Parameters

valFloat with the new stdDeviation blur value
completeBoolean indicating whether or not the action should be completed (to add to the undo manager)
- -

getBold

this.getBold = function()

Check whether selected element is bold or not

Returns

Boolean indicating whether or not element is bold

- -

setBold

this.setBold = function(b)

Make the selected element bold or normal

Parameters

bBoolean indicating bold (true) or normal (false)
- -

getItalic

this.getItalic = function()

Check whether selected element is italic or not

Returns

Boolean indicating whether or not element is italic

- -

setItalic

this.setItalic = function(i)

Make the selected element italic or normal

Parameters

bBoolean indicating italic (true) or normal (false)
- -

getFontFamily

this.getFontFamily = function()

Returns the current font family

- -

setFontFamily

this.setFontFamily = function(val)

Set the new font family

Parameters

valString with the new font family
- -

getFontSize

this.getFontSize = function()

Returns the current font size

- -

setFontSize

this.setFontSize = function(val)

Applies the given font size to the selected element

Parameters

valFloat with the new font size
- -

getText

this.getText = function()

Returns the current text (textContent) of the selected element

- -

setTextContent

this.setTextContent = function(val)

Updates the text element with the given string

Parameters

valString with the new text
- -

setImageURL

this.setImageURL = function(val)

Sets the new image URL for the selected image element.  Updates its size if a new URL is given

Parameters

valString with the image URL/path
- -

setRectRadius

this.setRectRadius = function(val)

Sets the rx & ry values to the selected rect element to change its corner radius

Parameters

valThe new radius
- -

Element manipulation

- -

setSegType

this.setSegType = function(new_type)

Sets the new segment type to the selected segment(s).

Parameters

new_typeInteger with the new segment type See http://www.w3.org/TR/SVG/paths.html#InterfaceSVGPathSeg for list
- -

convertToPath

this.convertToPath = function(elem,
getBBox)

Convert selected element to a path, or get the BBox of an element-as-path

Parameters

elemThe DOM element to be converted
getBBoxBoolean on whether or not to only return the path’s BBox

Returns

If the getBBox flag is true, the resulting path’s bounding box object.  Otherwise the resulting path element is returned.

- -

changeSelectedAttributeNoUndo

var changeSelectedAttributeNoUndo = function(attr,
newValue,
elems)

This function makes the changes to the elements.  It does not add the change to the history stack.

Parameters

attrString with the attribute name
newValueString or number with the new attribute value
elemsThe DOM elements to apply the change to
- -

changeSelectedAttribute

var changeSelectedAttribute = this.changeSelectedAttribute = function(attr,
val,
elems)

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.  If you want to change only a subset of selectedElements, then send the subset to this function in the elems argument.

Parameters

attrString with the attribute name
newValueString or number with the new attribute value
elemsThe DOM elements to apply the change to
- -

deleteSelectedElements

this.deleteSelectedElements = function()

Removes all selected elements from the DOM and adds the change to the history stack

- -

groupSelectedElements

this.groupSelectedElements = function()

Wraps all the selected elements in a group (g) element

- -

ungroupSelectedElement

this.ungroupSelectedElement = function()

Unwraps all the elements in a selected group (g) element.  This requires significant recalculations to apply group’s transforms, etc to its children

- -

moveToTopSelectedElement

this.moveToTopSelectedElement = function()

Repositions the selected element to the bottom in the DOM to appear on top of other elements

- -

moveToBottomSelectedElement

this.moveToBottomSelectedElement = function()

Repositions the selected element to the top in the DOM to appear under other elements

- -

moveSelectedElements

this.moveSelectedElements = function(dx,
dy,
undoable)

Moves selected elements on the X/Y axis

Parameters

dxFloat with the distance to move on the x-axis
dyFloat with the distance to move on the y-axis
undoableBoolean indicating whether or not the action should be undoable

Returns

Batch command for the move

- -

cloneSelectedElements

this.cloneSelectedElements = function()

Create deep DOM copies (clones) of all selected elements and move them slightly from their originals

- -

alignSelectedElements

this.alignSelectedElements = function(type,
relative_to)

Aligns selected elements

Parameters

typeString with single character indicating the alignment type
relative_toString that must be one of the following: “selected”, “largest”, “smallest”, “page”
- -

Additional editor tools

- -

updateCanvas

this.updateCanvas = function(w,
h)

Updates the editor canvas width/height/position after a zoom has occurred

Parameters

wFloat with the new width
hFloat with the new height

Returns

Object with the following values:

  • x - The canvas’ new x coordinate
  • y - The canvas’ new y coordinate
  • old_x - The canvas’ old x coordinate
  • old_y - The canvas’ old y coordinate
  • d_x - The x position difference
  • d_y - The y position difference
- -

setBackground

this.setBackground = function(color,
url)

Set the background of the editor (NOT the actual document)

Parameters

colorString with fill color to apply
urlURL or path to image to use
- -

cycleElement

this.cycleElement = function(next)

Select the next/previous element within the current layer

Parameters

nextBoolean where true = next and false = previous element
- -
- - - - - - - - - - -
"rectsIntersect": function(r1,
r2)
Check if two rectangles (BBoxes objects) intersect each other
"snapToAngle": function(x1,
y1,
x2,
y2)
Returns a 45 degree angle coordinate associated with the two given coordinates
"text2xml": function(sXML)
Cross-browser compatible method of converting a string to an XML tree found this function here: http://groups.google.com/group/jquery-dev/browse_thread/thread/c6d11387c580a77f
convertToNum = function(attr,
val)
Converts given values to numbers.
setUnitAttr = function(elem,
attr,
val)
Sets an element’s attribute based on the unit in its current value.
canvas.isValidUnit = function(attr,
val)
Check if an attribute’s value is in a valid format
var ChangeElementCommand = this.undoCmd.changeElement = function(elem,
attrs,
text)
History command to make a change to an element.
var InsertElementCommand = this.undoCmd.insertElement = function(elem,
text)
History command for an element that was added to the DOM
var RemoveElementCommand = this.undoCmd.removeElement = function(elem,
parent,
text)
History command for an element removed from the DOM
var MoveElementCommand = this.undoCmd.moveElement = function(elem,
oldNextSibling,
oldParent,
text)
History command for an element that had its DOM position changed
var BatchCommand = this.undoCmd.batch = function(text)
History command that can contain/execute multiple other commands
resetUndoStack = function()
Resets the undo stack, effectively clearing the undo/redo history
addCommandToHistory = c.undoCmd.add = function(cmd)
Adds a command object to the undo history stack
c.beginUndoableChange = function(attrName,
elems)
This function tells the canvas to remember the old values of the attrName attribute for each element sent in.
c.finishUndoableChange = function()
This function returns a BatchCommand object which summarizes the change since beginUndoableChange was called.
function walkTree(elem,
cbFn)
Walks the tree and executes the callback on each element in a top-down fashion
function walkTreePost(elem,
cbFn)
Walks the tree and executes the callback on each element in a depth-first fashion
var assignAttributes = this.assignAttributes = function(node,
attrs,
suspendLength,
unitCheck)
Assigns multiple attributes to an element.
var cleanupElement = this.cleanupElement = function(element)
Remove unneeded (default) attributes, makes resulting SVG smaller
var addSvgElementFromJson = this.addSvgElementFromJson = function(data)
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
this.addExtension = function(name,
ext_func)
Add an extension to the editor
var shortFloat = function(val)
Rounds a given value to a float with number of digits defined in save_options
var getStrokedBBox = this.getStrokedBBox = function(elems)
Get the bounding box for one or more stroked and/or transformed elements
var getVisibleElements = this.getVisibleElements = function(parent,
includeBBox)
Get all elements that have a BBox (excludes defs, title, etc).
var copyElem = function(el)
Create a clone of an element, updating its ID and its children’s IDs when needed
function getElem(id)
Get a DOM element by ID within the SVG root element.
getId = c.getId = function()
Returns the last created DOM element ID string
getNextId = c.getNextId = function()
Creates and returns a unique ID string for a DOM element
c.bind = function(event,
f)
Attaches a callback function to an event
c.setIdPrefix = function(p)
Changes the ID prefix to the given value
var sanitizeSvg = this.sanitizeSvg = function(node)
Sanitizes the input node and its children It only keeps what is allowed from our whitelist defined above
var getUrlFromAttr = this.getUrlFromAttr = function(attrVal)
Extracts the URL from the url(...)
var getBBox = this.getBBox = function(elem)
Get the given/selected element’s bounding box object, convert it to be more usable when necessary
var ffClone = function(elem)
Hack for Firefox bugs where text element features aren’t updated.
var getPathBBox = function(path)
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 getRotationAngle = this.getRotationAngle = function(elem,
to_rad)
Get the rotation angle of the given/selected DOM element
this.setRotationAngle = function(val,
preventUndo)
Removes any old rotations if present, prepends a new rotation at the transformed center
var getTransformList = this.getTransformList = function(elem)
Returns an object that behaves like a SVGTransformList for the given DOM element
var recalculateAllSelectedDimensions = this.recalculateAllSelectedDimensions = function()
Runs recalculateDimensions on the selected elements, adding the changes to a single batch command
var remapElement = this.remapElement = function(selected,
changes,
m)
Applies coordinate changes to an element based on the given matrix
var recalculateDimensions = this.recalculateDimensions = function(selected)
Decides the course of action based on the element’s transform list
var transformPoint = function(x,
y,
m)
A (hopefully) quicker function to transform a point by a matrix (this function avoids any DOM calls and just does the math)
var isIdentity = function(m)
Helper function to check if the matrix performs no actual transform (i.e.
var matrixMultiply = this.matrixMultiply = function()
This function tries to return a SVGMatrix that is the multiplication m1*m2.
var transformListToTransform = this.transformListToTransform = function(tlist,
min,
max)
This returns a single matrix Transform for a given Transform List (this is the equivalent of SVGTransformList.consolidate() but unlike that method, this one does not modify the actual SVGTransformList) This function is very liberal with its min,max arguments
var hasMatrixTransform = this.hasMatrixTransform = function(tlist)
See if the given transformlist includes a non-indentity matrix transform
var getMatrix = function(elem)
Get the matrix object for a given element
var transformBox = this.transformBox = function(l,
t,
w,
h,
m)
Transforms a rectangle based on the given matrix
var clearSelection = this.clearSelection = function(noCall)
Clears the selection.
var addToSelection = this.addToSelection = function(elemsToAdd,
showGrips)
Adds a list of elements to the selection.
var removeFromSelection = this.removeFromSelection = function(elemsToRemove)
Removes elements from the selection.
this.selectAllInCurrentLayer = function()
Clears the selection, then adds all elements in the current layer to the selection.
var smoothControlPoints = this.smoothControlPoints = function(ct1,
ct2,
pt)
Takes three points and creates a smoother line based on them
var getMouseTarget = this.getMouseTarget = function(evt)
Gets the desired element from a mouse event
var preventClickDefault = function(img)
Prevents default browser click behaviour on the given element
var removeUnusedDefElems = this.removeUnusedDefElems = function()
Looks at DOM elements inside the defs to see if they are referred to, removes them from the DOM if they are not.
var svgCanvasToString = this.svgCanvasToString = function()
Main function to set up the SVG content for output
var svgToString = this.svgToString = function(elem,
indent)
Sub function ran on each SVG element to convert it to a string as desired
this.embedImage = function(val,
callback)
Converts a given image file to a data URL when possible, then runs a given callback
this.save = function(opts)
Serializes the current drawing into SVG XML text and returns it to the ‘saved’ handler.
this.rasterExport = function()
Generates a PNG Data URL based on the current image, then calls “exported” with an object including the string and any issues found
this.getSvgString = function()
Returns the current drawing as raw SVG XML text.
this.setSvgString = function(xmlString)
This function sets the current drawing as the input SVG XML.
this.importSvgString = function(xmlString)
This function imports the input SVG XML into the current layer in the drawing
var identifyLayers = function()
Updates layer system
this.createLayer = function(name)
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.deleteCurrentLayer = function()
Deletes the current layer from the drawing and then clears the selection.
this.getNumLayers = function()
Returns the number of layers in the current drawing.
this.getLayer = function(i)
Returns the name of the ith layer.
this.getCurrentLayer = function()
Returns the name of the currently selected layer.
this.setCurrentLayer = function(name)
Sets the current layer.
this.renameCurrentLayer = function(newname)
Renames the current layer.
this.setCurrentLayerPosition = function(newpos)
Changes the position of the current layer to the new value.
this.getLayerVisibility = function(layername)
Returns whether the layer is visible.
this.setLayerVisibility = function(layername,
bVisible)
Sets the visibility of the layer.
this.moveSelectedToLayer = function(layername)
Moves the selected elements to layername.
this.getLayerOpacity = function(layername)
Returns the opacity of the given layer.
this.setLayerOpacity = function(layername,
opacity)
Sets the opacity of the given layer.
this.clear = function()
Clears the current document.
this.getContentElem = function()
Returns the content DOM element
this.getRootElem = function()
Returns the root DOM element
this.getSelectedElems = function()
Returns the array with selected DOM elements
var getResolution = this.getResolution = function()
Returns the current dimensions and zoom level in an object
this.getZoom = function()
Returns the current zoom level
this.getVersion = function()
Returns a string which describes the revision number of SvgCanvas.
this.setUiStrings = function(strs)
Update interface strings with given values
this.setConfig = function(opts)
Update configuration options with given values
this.getDocumentTitle = function()
Returns the current document title or an empty string if not found
this.setDocumentTitle = function(newtitle)
Adds/updates a title element for the document with the given name.
this.getEditorNS = function(add)
Returns the editor’s namespace URL, optionally adds it to root element
this.setResolution = function(x,
y)
Changes the document’s dimensions to the given size
this.getOffset = function()
Returns an object with x, y values indicating the svgcontent element’s position in the editor’s canvas.
this.setBBoxZoom = function(val,
editor_w,
editor_h)
Sets the zoom level on the canvas-side based on the given value
this.setZoom = function(zoomlevel)
Sets the zoom to the given level
this.getMode = function()
Returns the current editor mode string
this.setMode = function(name)
Sets the editor’s mode to the given string
this.getColor = function(type)
Returns the current fill/stroke option
this.setColor = function(type,
val,
preventUndo)
Change the current stroke/fill color/gradient value
var findDefs = function()
Return the document’s defs element, create it first if necessary
var setGradient = this.setGradient = function(type)
Apply the current gradient to selected element’s fill or stroke
var findDuplicateGradient = function(grad)
Check if exact gradient already exists
this.setPaint = function(type,
paint)
Set a color/gradient to a fill/stroke
this.getStrokeWidth = function()
Returns the current stroke-width value
this.setStrokeWidth = function(val)
Sets the stroke width for the current selected elements When attempting to set a line’s width to 0, this changes it to 1 instead
this.setStrokeAttr = function(attr,
val)
Set the given stroke-related attribute the given value for selected elements
this.getOpacity = function()
Returns the current opacity
this.setOpacity = function(val)
Sets the given opacity to the current selected elements
this.getStrokeOpacity = function()
Returns the current stroke opacity
this.setPaintOpacity = function(type,
val,
preventUndo)
Sets the current fill/stroke opacity
this.getBlur = function(elem)
Gets the stdDeviation blur value of the given element
canvas.setBlurNoUndo = function(val)
Sets the stdDeviation blur value on the selected element without being undoable
canvas.setBlurOffsets = function(filter,
stdDev)
Sets the x, y, with, height values of the filter element in order to make the blur not be clipped.
canvas.setBlur = function(val,
complete)
Adds/updates the blur filter to the selected element
this.getBold = function()
Check whether selected element is bold or not
this.setBold = function(b)
Make the selected element bold or normal
this.getItalic = function()
Check whether selected element is italic or not
this.setItalic = function(i)
Make the selected element italic or normal
this.getFontFamily = function()
Returns the current font family
this.setFontFamily = function(val)
Set the new font family
this.getFontSize = function()
Returns the current font size
this.setFontSize = function(val)
Applies the given font size to the selected element
this.getText = function()
Returns the current text (textContent) of the selected element
this.setTextContent = function(val)
Updates the text element with the given string
this.setImageURL = function(val)
Sets the new image URL for the selected image element.
this.setRectRadius = function(val)
Sets the rx & ry values to the selected rect element to change its corner radius
this.setSegType = function(new_type)
Sets the new segment type to the selected segment(s).
this.convertToPath = function(elem,
getBBox)
Convert selected element to a path, or get the BBox of an element-as-path
var changeSelectedAttributeNoUndo = function(attr,
newValue,
elems)
This function makes the changes to the elements.
var changeSelectedAttribute = this.changeSelectedAttribute = function(attr,
val,
elems)
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.deleteSelectedElements = function()
Removes all selected elements from the DOM and adds the change to the history stack
this.groupSelectedElements = function()
Wraps all the selected elements in a group (g) element
this.ungroupSelectedElement = function()
Unwraps all the elements in a selected group (g) element.
this.moveToTopSelectedElement = function()
Repositions the selected element to the bottom in the DOM to appear on top of other elements
this.moveToBottomSelectedElement = function()
Repositions the selected element to the top in the DOM to appear under other elements
this.moveSelectedElements = function(dx,
dy,
undoable)
Moves selected elements on the X/Y axis
this.cloneSelectedElements = function()
Create deep DOM copies (clones) of all selected elements and move them slightly from their originals
this.alignSelectedElements = function(type,
relative_to)
Aligns selected elements
this.updateCanvas = function(w,
h)
Updates the editor canvas width/height/position after a zoom has occurred
this.setBackground = function(color,
url)
Set the background of the editor (NOT the actual document)
this.cycleElement = function(next)
Select the next/previous element within the current layer
- - - - -
Close
- - - \ No newline at end of file diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 635c3177..00000000 --- a/docs/index.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/index/Files.html b/docs/index/Files.html deleted file mode 100644 index 9ebbb55f..00000000 --- a/docs/index/Files.html +++ /dev/null @@ -1,37 +0,0 @@ - - -File Index - - - - - - - - - -
File Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
M
 my_svgcanvas.js
S
 svgcanvas-latest copy.js
 svgcanvas-mine.js
 svgcanvas-textanchor-experiment.js
 svgcanvas.js
 svgcanvas_subpaths.js
 svgcanvas_temp.js
- - - - - - - -
- - - - - - - - -
Close
- - - \ No newline at end of file diff --git a/docs/index/Functions.html b/docs/index/Functions.html deleted file mode 100644 index 9c282c28..00000000 --- a/docs/index/Functions.html +++ /dev/null @@ -1,53 +0,0 @@ - - -Function Index - - - - - - - - - -
Function Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
A
 addCommandToHistory, SvgCanvas
 addExtension, SelectorManager
 addSubCommand, SvgCanvas.BatchCommand
 addSvgElementFromJson, SelectorManager
 addToSelection, SelectorManager
 alignSelectedElements, SelectorManager
 apply
 assignAttributes, SelectorManager
B
 BatchCommand, SvgCanvas
 beginUndoableChange, SvgCanvas
 bind, SelectorManager
C
 ChangeElementCommand, SvgCanvas
 changeSelectedAttribute, SelectorManager
 changeSelectedAttributeNoUndo, SelectorManager
 cleanupElement, SelectorManager
 clear, SelectorManager
 clearSelection, SelectorManager
 cloneSelectedElements, SelectorManager
 convertToNum, SvgCanvas
 convertToPath, SelectorManager
 convertToXMLReferences, SvgCanvas.Utils
 copyElem, SelectorManager
 createLayer, SelectorManager
 cycleElement, SelectorManager
D
 decode64, SvgCanvas.Utils
 deleteCurrentLayer, SelectorManager
 deleteSelectedElements, SelectorManager
E
 elements
 embedImage, SelectorManager
 encode64, SvgCanvas.Utils
F
 ffClone, SelectorManager
 findDefs, SelectorManager
 findDuplicateGradient, SelectorManager
 finishUndoableChange, SvgCanvas
 fromXml, SvgCanvas.Utils
- -
addCommandToHistory = c.undoCmd.add = function(cmd)
Adds a command object to the undo history stack
this.addExtension = function(name,
ext_func)
Add an extension to the editor
Adds a given command to the history stack
var addSvgElementFromJson = this.addSvgElementFromJson = function(data)
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 addToSelection = this.addToSelection = function(elemsToAdd,
showGrips)
Adds a list of elements to the selection.
this.alignSelectedElements = function(type,
relative_to)
Aligns selected elements
Runs “apply” on all subcommands
Performs the stored change action
Re-Inserts the new element
Re-removes the new element
var assignAttributes = this.assignAttributes = function(node,
attrs,
suspendLength,
unitCheck)
Assigns multiple attributes to an element.
- - - -
var BatchCommand = this.undoCmd.batch = function(text)
History command that can contain/execute multiple other commands
c.beginUndoableChange = function(attrName,
elems)
This function tells the canvas to remember the old values of the attrName attribute for each element sent in.
c.bind = function(event,
f)
Attaches a callback function to an event
- - - -
var ChangeElementCommand = this.undoCmd.changeElement = function(elem,
attrs,
text)
History command to make a change to an element.
var changeSelectedAttribute = this.changeSelectedAttribute = function(attr,
val,
elems)
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.
var changeSelectedAttributeNoUndo = function(attr,
newValue,
elems)
This function makes the changes to the elements.
var cleanupElement = this.cleanupElement = function(element)
Remove unneeded (default) attributes, makes resulting SVG smaller
this.clear = function()
Clears the current document.
var clearSelection = this.clearSelection = function(noCall)
Clears the selection.
this.cloneSelectedElements = function()
Create deep DOM copies (clones) of all selected elements and move them slightly from their originals
convertToNum = function(attr,
val)
Converts given values to numbers.
this.convertToPath = function(elem,
getBBox)
Convert selected element to a path, or get the BBox of an element-as-path
Converts a string to use XML references
var copyElem = function(el)
Create a clone of an element, updating its ID and its children’s IDs when needed
this.createLayer = function(name)
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.cycleElement = function(next)
Select the next/previous element within the current layer
- - - -
Converts a string from base64
this.deleteCurrentLayer = function()
Deletes the current layer from the drawing and then clears the selection.
this.deleteSelectedElements = function()
Removes all selected elements from the DOM and adds the change to the history stack
- - - -
Iterate through all our subcommands and returns all the elements we are changing
Returns array with element associated with this command
Returns array with element associated with this command
Returns array with element associated with this command
Returns array with element associated with this command
this.embedImage = function(val,
callback)
Converts a given image file to a data URL when possible, then runs a given callback
Converts a string to base64
- - - -
var ffClone = function(elem)
Hack for Firefox bugs where text element features aren’t updated.
var findDefs = function()
Return the document’s defs element, create it first if necessary
var findDuplicateGradient = function(grad)
Check if exact gradient already exists
c.finishUndoableChange = function()
This function returns a BatchCommand object which summarizes the change since beginUndoableChange was called.
Converts XML entities in a string to single characters.
- -
- - - - - - - - -
Close
- - - \ No newline at end of file diff --git a/docs/index/General.html b/docs/index/General.html deleted file mode 100644 index 69d5a0b5..00000000 --- a/docs/index/General.html +++ /dev/null @@ -1,53 +0,0 @@ - - -Index - - - - - - - - - -
Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
A
 addCommandToHistory, SvgCanvas
 addExtension, SelectorManager
 Additional editor tools, SelectorManager
 addSubCommand, SvgCanvas.BatchCommand
 addSvgElementFromJson, SelectorManager
 addToSelection, SelectorManager
 alignSelectedElements, SelectorManager
 apply
 assignAttributes, SelectorManager
B
 BatchCommand, SvgCanvas
 beginUndoableChange, SvgCanvas
 bind, SelectorManager
C
 ChangeElementCommand, SvgCanvas
 changeSelectedAttribute, SelectorManager
 changeSelectedAttributeNoUndo, SelectorManager
 cleanupElement, SelectorManager
 clear, SelectorManager
 clearSelection, SelectorManager
 cloneSelectedElements, SelectorManager
 convertToNum, SvgCanvas
 convertToPath, SelectorManager
 convertToXMLReferences, SvgCanvas.Utils
 copyElem, SelectorManager
 createLayer, SelectorManager
 cycleElement, SelectorManager
D
 decode64, SvgCanvas.Utils
 deleteCurrentLayer, SelectorManager
 deleteSelectedElements, SelectorManager
 Document functions, SelectorManager
E
 Element manipulation, SelectorManager
 Element Styling, SelectorManager
 Element Transforms, SelectorManager
 elements
 embedImage, SelectorManager
 encode64, SvgCanvas.Utils
F
 ffClone, SelectorManager
 findDefs, SelectorManager
 findDuplicateGradient, SelectorManager
 finishUndoableChange, SvgCanvas
 fromXml, SvgCanvas.Utils
 Functions, Selector
- -
addCommandToHistory = c.undoCmd.add = function(cmd)
Adds a command object to the undo history stack
this.addExtension = function(name,
ext_func)
Add an extension to the editor
Adds a given command to the history stack
var addSvgElementFromJson = this.addSvgElementFromJson = function(data)
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 addToSelection = this.addToSelection = function(elemsToAdd,
showGrips)
Adds a list of elements to the selection.
this.alignSelectedElements = function(type,
relative_to)
Aligns selected elements
Runs “apply” on all subcommands
Performs the stored change action
Re-Inserts the new element
Re-removes the new element
var assignAttributes = this.assignAttributes = function(node,
attrs,
suspendLength,
unitCheck)
Assigns multiple attributes to an element.
- - - -
var BatchCommand = this.undoCmd.batch = function(text)
History command that can contain/execute multiple other commands
c.beginUndoableChange = function(attrName,
elems)
This function tells the canvas to remember the old values of the attrName attribute for each element sent in.
c.bind = function(event,
f)
Attaches a callback function to an event
- - - -
var ChangeElementCommand = this.undoCmd.changeElement = function(elem,
attrs,
text)
History command to make a change to an element.
var changeSelectedAttribute = this.changeSelectedAttribute = function(attr,
val,
elems)
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.
var changeSelectedAttributeNoUndo = function(attr,
newValue,
elems)
This function makes the changes to the elements.
var cleanupElement = this.cleanupElement = function(element)
Remove unneeded (default) attributes, makes resulting SVG smaller
this.clear = function()
Clears the current document.
var clearSelection = this.clearSelection = function(noCall)
Clears the selection.
this.cloneSelectedElements = function()
Create deep DOM copies (clones) of all selected elements and move them slightly from their originals
convertToNum = function(attr,
val)
Converts given values to numbers.
this.convertToPath = function(elem,
getBBox)
Convert selected element to a path, or get the BBox of an element-as-path
Converts a string to use XML references
var copyElem = function(el)
Create a clone of an element, updating its ID and its children’s IDs when needed
this.createLayer = function(name)
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.cycleElement = function(next)
Select the next/previous element within the current layer
- - - -
Converts a string from base64
this.deleteCurrentLayer = function()
Deletes the current layer from the drawing and then clears the selection.
this.deleteSelectedElements = function()
Removes all selected elements from the DOM and adds the change to the history stack
- - - -
Iterate through all our subcommands and returns all the elements we are changing
Returns array with element associated with this command
Returns array with element associated with this command
Returns array with element associated with this command
Returns array with element associated with this command
this.embedImage = function(val,
callback)
Converts a given image file to a data URL when possible, then runs a given callback
Converts a string to base64
- - - -
var ffClone = function(elem)
Hack for Firefox bugs where text element features aren’t updated.
var findDefs = function()
Return the document’s defs element, create it first if necessary
var findDuplicateGradient = function(grad)
Check if exact gradient already exists
c.finishUndoableChange = function()
This function returns a BatchCommand object which summarizes the change since beginUndoableChange was called.
Converts XML entities in a string to single characters.
- -
- - - - - - - - -
Close
- - - \ No newline at end of file diff --git a/docs/javascript/main.js b/docs/javascript/main.js deleted file mode 100644 index 3cd85971..00000000 --- a/docs/javascript/main.js +++ /dev/null @@ -1,842 +0,0 @@ -// This file is part of Natural Docs, which is Copyright (C) 2003-2008 Greg Valure -// Natural Docs is licensed under the GPL - - -// -// Browser Styles -// ____________________________________________________________________________ - -var agt=navigator.userAgent.toLowerCase(); -var browserType; -var browserVer; - -if (agt.indexOf("opera") != -1) - { - browserType = "Opera"; - - if (agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1) - { browserVer = "Opera7"; } - else if (agt.indexOf("opera 8") != -1 || agt.indexOf("opera/8") != -1) - { browserVer = "Opera8"; } - else if (agt.indexOf("opera 9") != -1 || agt.indexOf("opera/9") != -1) - { browserVer = "Opera9"; } - } - -else if (agt.indexOf("applewebkit") != -1) - { - browserType = "Safari"; - - if (agt.indexOf("version/3") != -1) - { browserVer = "Safari3"; } - else if (agt.indexOf("safari/4") != -1) - { browserVer = "Safari2"; } - } - -else if (agt.indexOf("khtml") != -1) - { - browserType = "Konqueror"; - } - -else if (agt.indexOf("msie") != -1) - { - browserType = "IE"; - - if (agt.indexOf("msie 6") != -1) - { browserVer = "IE6"; } - else if (agt.indexOf("msie 7") != -1) - { browserVer = "IE7"; } - } - -else if (agt.indexOf("gecko") != -1) - { - browserType = "Firefox"; - - if (agt.indexOf("rv:1.7") != -1) - { browserVer = "Firefox1"; } - else if (agt.indexOf("rv:1.8)") != -1 || agt.indexOf("rv:1.8.0") != -1) - { browserVer = "Firefox15"; } - else if (agt.indexOf("rv:1.8.1") != -1) - { browserVer = "Firefox2"; } - } - - -// -// Support Functions -// ____________________________________________________________________________ - - -function GetXPosition(item) - { - var position = 0; - - if (item.offsetWidth != null) - { - while (item != document.body && item != null) - { - position += item.offsetLeft; - item = item.offsetParent; - }; - }; - - return position; - }; - - -function GetYPosition(item) - { - var position = 0; - - if (item.offsetWidth != null) - { - while (item != document.body && item != null) - { - position += item.offsetTop; - item = item.offsetParent; - }; - }; - - return position; - }; - - -function MoveToPosition(item, x, y) - { - // Opera 5 chokes on the px extension, so it can use the Microsoft one instead. - - if (item.style.left != null) - { - item.style.left = x + "px"; - item.style.top = y + "px"; - } - else if (item.style.pixelLeft != null) - { - item.style.pixelLeft = x; - item.style.pixelTop = y; - }; - }; - - -// -// Menu -// ____________________________________________________________________________ - - -function ToggleMenu(id) - { - if (!window.document.getElementById) - { return; }; - - var display = window.document.getElementById(id).style.display; - - if (display == "none") - { display = "block"; } - else - { display = "none"; } - - window.document.getElementById(id).style.display = display; - } - -function HideAllBut(ids, max) - { - if (document.getElementById) - { - ids.sort( function(a,b) { return a - b; } ); - var number = 1; - - while (number < max) - { - if (ids.length > 0 && number == ids[0]) - { ids.shift(); } - else - { - document.getElementById("MGroupContent" + number).style.display = "none"; - }; - - number++; - }; - }; - } - - -// -// Tooltips -// ____________________________________________________________________________ - - -var tooltipTimer = 0; - -function ShowTip(event, tooltipID, linkID) - { - if (tooltipTimer) - { clearTimeout(tooltipTimer); }; - - var docX = event.clientX + window.pageXOffset; - var docY = event.clientY + window.pageYOffset; - - tooltipTimer = setTimeout(function () { - ReallyShowTip(tooltipID, linkID, docX, docY); - }, 1000); - } - -function ReallyShowTip(tooltipID, linkID, docX, docY) - { - tooltipTimer = 0; - - var tooltip; - var link; - - if (document.getElementById) - { - tooltip = document.getElementById(tooltipID); - link = document.getElementById(linkID); - } -/* else if (document.all) - { - tooltip = document.all[tooltipID]); - link = document.all[linkID]); - } -*/ - if (tooltip) - { - var left = GetXPosition(link); - var top = GetYPosition(link); - top += link.offsetHeight; - - - // The fallback method is to use the mouse X and Y relative to the document. We use a separate if and test if its a number - // in case some browser snuck through the above if statement but didn't support everything. - - if (!isFinite(top) || top == 0) - { - left = docX; - top = docY; - } - - // Some spacing to get it out from under the cursor. - - top += 10; - - // Make sure the tooltip doesnt get smushed by being too close to the edge, or in some browsers, go off the edge of the - // page. We do it here because Konqueror does get offsetWidth right even if it doesnt get the positioning right. - - if (tooltip.offsetWidth != null) - { - var width = tooltip.offsetWidth; - var docWidth = document.body.clientWidth; - - if (left + width > docWidth) - { left = docWidth - width - 1; } - - // If there's a horizontal scroll bar we could go past zero because it's using the page width, not the window width. - if (left < 0) - { left = 0; }; - } - - MoveToPosition(tooltip, left, top); - tooltip.style.visibility = "visible"; - } - } - -function HideTip(tooltipID) - { - if (tooltipTimer) - { - clearTimeout(tooltipTimer); - tooltipTimer = 0; - } - - var tooltip; - - if (document.getElementById) - { tooltip = document.getElementById(tooltipID); } - else if (document.all) - { tooltip = document.all[tooltipID]; } - - if (tooltip) - { tooltip.style.visibility = "hidden"; } - } - - -// -// Blockquote fix for IE -// ____________________________________________________________________________ - - -function NDOnLoad() - { - if (browserVer == "IE6") - { - var scrollboxes = document.getElementsByTagName('blockquote'); - - if (scrollboxes.item(0)) - { - NDDoResize(); - window.onresize=NDOnResize; - }; - }; - }; - - -var resizeTimer = 0; - -function NDOnResize() - { - if (resizeTimer != 0) - { clearTimeout(resizeTimer); }; - - resizeTimer = setTimeout(NDDoResize, 250); - } - - -function NDDoResize() - { - var scrollboxes = document.getElementsByTagName('blockquote'); - - var i; - var item; - - i = 0; - while (item = scrollboxes.item(i)) - { - item.style.width = 100; - i++; - }; - - i = 0; - while (item = scrollboxes.item(i)) - { - item.style.width = item.parentNode.offsetWidth; - i++; - }; - - clearTimeout(resizeTimer); - resizeTimer = 0; - } - - - -/* ________________________________________________________________________________________________________ - - Class: SearchPanel - ________________________________________________________________________________________________________ - - A class handling everything associated with the search panel. - - Parameters: - - name - The name of the global variable that will be storing this instance. Is needed to be able to set timeouts. - mode - The mode the search is going to work in. Pass CommandLineOption()>, so the - value will be something like "HTML" or "FramedHTML". - - ________________________________________________________________________________________________________ -*/ - - -function SearchPanel(name, mode, resultsPath) - { - if (!name || !mode || !resultsPath) - { alert("Incorrect parameters to SearchPanel."); }; - - - // Group: Variables - // ________________________________________________________________________ - - /* - var: name - The name of the global variable that will be storing this instance of the class. - */ - this.name = name; - - /* - var: mode - The mode the search is going to work in, such as "HTML" or "FramedHTML". - */ - this.mode = mode; - - /* - var: resultsPath - The relative path from the current HTML page to the results page directory. - */ - this.resultsPath = resultsPath; - - /* - var: keyTimeout - The timeout used between a keystroke and when a search is performed. - */ - this.keyTimeout = 0; - - /* - var: keyTimeoutLength - The length of in thousandths of a second. - */ - this.keyTimeoutLength = 500; - - /* - var: lastSearchValue - The last search string executed, or an empty string if none. - */ - this.lastSearchValue = ""; - - /* - var: lastResultsPage - The last results page. The value is only relevant if is set. - */ - this.lastResultsPage = ""; - - /* - var: deactivateTimeout - - The timeout used between when a control is deactivated and when the entire panel is deactivated. Is necessary - because a control may be deactivated in favor of another control in the same panel, in which case it should stay - active. - */ - this.deactivateTimout = 0; - - /* - var: deactivateTimeoutLength - The length of in thousandths of a second. - */ - this.deactivateTimeoutLength = 200; - - - - - // Group: DOM Elements - // ________________________________________________________________________ - - - // Function: DOMSearchField - this.DOMSearchField = function() - { return document.getElementById("MSearchField"); }; - - // Function: DOMSearchType - this.DOMSearchType = function() - { return document.getElementById("MSearchType"); }; - - // Function: DOMPopupSearchResults - this.DOMPopupSearchResults = function() - { return document.getElementById("MSearchResults"); }; - - // Function: DOMPopupSearchResultsWindow - this.DOMPopupSearchResultsWindow = function() - { return document.getElementById("MSearchResultsWindow"); }; - - // Function: DOMSearchPanel - this.DOMSearchPanel = function() - { return document.getElementById("MSearchPanel"); }; - - - - - // Group: Event Handlers - // ________________________________________________________________________ - - - /* - Function: OnSearchFieldFocus - Called when focus is added or removed from the search field. - */ - this.OnSearchFieldFocus = function(isActive) - { - this.Activate(isActive); - }; - - - /* - Function: OnSearchFieldChange - Called when the content of the search field is changed. - */ - this.OnSearchFieldChange = function() - { - var t = this; - if (this.keyTimeout) - { - clearTimeout(this.keyTimeout); - this.keyTimeout = 0; - }; - - var searchValue = this.DOMSearchField().value.replace(/ +/g, ""); - - if (searchValue != this.lastSearchValue) - { - if (searchValue != "") - { - this.keyTimeout = setTimeout(function () { - t.name.Search(); - }, this.keyTimeoutLength); - } - else - { - if (this.mode == "HTML") - { this.DOMPopupSearchResultsWindow().style.display = "none"; }; - this.lastSearchValue = ""; - }; - }; - }; - - - /* - Function: OnSearchTypeFocus - Called when focus is added or removed from the search type. - */ - this.OnSearchTypeFocus = function(isActive) - { - this.Activate(isActive); - }; - - - /* - Function: OnSearchTypeChange - Called when the search type is changed. - */ - this.OnSearchTypeChange = function() - { - var searchValue = this.DOMSearchField().value.replace(/ +/g, ""); - - if (searchValue != "") - { - this.Search(); - }; - }; - - - - // Group: Action Functions - // ________________________________________________________________________ - - - /* - Function: CloseResultsWindow - Closes the results window. - */ - this.CloseResultsWindow = function() - { - this.DOMPopupSearchResultsWindow().style.display = "none"; - this.Activate(false, true); - }; - - - /* - Function: Search - Performs a search. - */ - this.Search = function() - { - this.keyTimeout = 0; - - var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); - var searchTopic = this.DOMSearchType().value; - - var pageExtension = searchValue.substr(0,1); - - if (pageExtension.match(/^[a-z]/i)) - { pageExtension = pageExtension.toUpperCase(); } - else if (pageExtension.match(/^[0-9]/)) - { pageExtension = 'Numbers'; } - else - { pageExtension = "Symbols"; }; - - var resultsPage; - var resultsPageWithSearch; - var hasResultsPage; - - // indexSectionsWithContent is defined in searchdata.js - if (indexSectionsWithContent[searchTopic][pageExtension] == true) - { - resultsPage = this.resultsPath + '/' + searchTopic + pageExtension + '.html'; - resultsPageWithSearch = resultsPage+'?'+escape(searchValue); - hasResultsPage = true; - } - else - { - resultsPage = this.resultsPath + '/NoResults.html'; - resultsPageWithSearch = resultsPage; - hasResultsPage = false; - }; - - var resultsFrame; - if (this.mode == "HTML") - { resultsFrame = window.frames.MSearchResults; } - else if (this.mode == "FramedHTML") - { resultsFrame = window.top.frames['Content']; }; - - - if (resultsPage != this.lastResultsPage || - - // Bug in IE. If everything becomes hidden in a run, none of them will be able to be reshown in the next for some - // reason. It counts the right number of results, and you can even read the display as "block" after setting it, but it - // just doesn't work in IE 6 or IE 7. So if we're on the right page but the previous search had no results, reload the - // page anyway to get around the bug. - (browserType == "IE" && hasResultsPage && - (!resultsFrame.searchResults || resultsFrame.searchResults.lastMatchCount == 0)) ) - - { - resultsFrame.location.href = resultsPageWithSearch; - } - - // So if the results page is right and there's no IE bug, reperform the search on the existing page. We have to check if there - // are results because NoResults.html doesn't have any JavaScript, and it would be useless to do anything on that page even - // if it did. - else if (hasResultsPage) - { - // We need to check if this exists in case the frame is present but didn't finish loading. - if (resultsFrame.searchResults) - { resultsFrame.searchResults.Search(searchValue); } - - // Otherwise just reload instead of waiting. - else - { resultsFrame.location.href = resultsPageWithSearch; }; - }; - - - var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); - - if (this.mode == "HTML" && domPopupSearchResultsWindow.style.display != "block") - { - var domSearchType = this.DOMSearchType(); - - var left = GetXPosition(domSearchType); - var top = GetYPosition(domSearchType) + domSearchType.offsetHeight; - - MoveToPosition(domPopupSearchResultsWindow, left, top); - domPopupSearchResultsWindow.style.display = 'block'; - }; - - - this.lastSearchValue = searchValue; - this.lastResultsPage = resultsPage; - }; - - - - // Group: Activation Functions - // Functions that handle whether the entire panel is active or not. - // ________________________________________________________________________ - - - /* - Function: Activate - - Activates or deactivates the search panel, resetting things to their default values if necessary. You can call this on every - control's OnBlur() and it will handle not deactivating the entire panel when focus is just switching between them transparently. - - Parameters: - - isActive - Whether you're activating or deactivating the panel. - ignoreDeactivateDelay - Set if you're positive the action will deactivate the panel and thus want to skip the delay. - */ - this.Activate = function(isActive, ignoreDeactivateDelay) - { - var t = this; - // We want to ignore isActive being false while the results window is open. - if (isActive || (this.mode == "HTML" && this.DOMPopupSearchResultsWindow().style.display == "block")) - { - if (this.inactivateTimeout) - { - clearTimeout(this.inactivateTimeout); - this.inactivateTimeout = 0; - }; - - this.DOMSearchPanel().className = 'MSearchPanelActive'; - - var searchField = this.DOMSearchField(); - - if (searchField.value == 'Search') - { searchField.value = ""; } - } - else if (!ignoreDeactivateDelay) - { - this.inactivateTimeout = setTimeout(function () { - t.name.InactivateAfterTimeout(); - }, this.inactivateTimeoutLength); - } - else - { - this.InactivateAfterTimeout(); - }; - }; - - - /* - Function: InactivateAfterTimeout - - Called by , which is set by . Inactivation occurs on a timeout because a control may - receive OnBlur() when focus is really transferring to another control in the search panel. In this case we don't want to - actually deactivate the panel because not only would that cause a visible flicker but it could also reset the search value. - So by doing it on a timeout instead, there's a short period where the second control's OnFocus() can cancel the deactivation. - */ - this.InactivateAfterTimeout = function() - { - this.inactivateTimeout = 0; - - this.DOMSearchPanel().className = 'MSearchPanelInactive'; - this.DOMSearchField().value = "Search"; - - this.lastSearchValue = ""; - this.lastResultsPage = ""; - }; - }; - - - - -/* ________________________________________________________________________________________________________ - - Class: SearchResults - _________________________________________________________________________________________________________ - - The class that handles everything on the search results page. - _________________________________________________________________________________________________________ -*/ - - -function SearchResults(name, mode) - { - /* - var: mode - The mode the search is going to work in, such as "HTML" or "FramedHTML". - */ - this.mode = mode; - - /* - var: lastMatchCount - The number of matches from the last run of . - */ - this.lastMatchCount = 0; - - - /* - Function: Toggle - Toggles the visibility of the passed element ID. - */ - this.Toggle = function(id) - { - if (this.mode == "FramedHTML") - { return; }; - - var parentElement = document.getElementById(id); - - var element = parentElement.firstChild; - - while (element && element != parentElement) - { - if (element.nodeName == 'DIV' && element.className == 'ISubIndex') - { - if (element.style.display == 'block') - { element.style.display = "none"; } - else - { element.style.display = 'block'; } - }; - - if (element.nodeName == 'DIV' && element.hasChildNodes()) - { element = element.firstChild; } - else if (element.nextSibling) - { element = element.nextSibling; } - else - { - do - { - element = element.parentNode; - } - while (element && element != parentElement && !element.nextSibling); - - if (element && element != parentElement) - { element = element.nextSibling; }; - }; - }; - }; - - - /* - Function: Search - - Searches for the passed string. If there is no parameter, it takes it from the URL query. - - Always returns true, since other documents may try to call it and that may or may not be possible. - */ - this.Search = function(search) - { - if (!search) - { - search = window.location.search; - search = search.substring(1); // Remove the leading ? - search = unescape(search); - }; - - search = search.replace(/^ +/, ""); - search = search.replace(/ +$/, ""); - search = search.toLowerCase(); - - if (search.match(/[^a-z0-9]/)) // Just a little speedup so it doesn't have to go through the below unnecessarily. - { - search = search.replace(/\_/g, "_und"); - search = search.replace(/\ +/gi, "_spc"); - search = search.replace(/\~/g, "_til"); - search = search.replace(/\!/g, "_exc"); - search = search.replace(/\@/g, "_att"); - search = search.replace(/\#/g, "_num"); - search = search.replace(/\$/g, "_dol"); - search = search.replace(/\%/g, "_pct"); - search = search.replace(/\^/g, "_car"); - search = search.replace(/\&/g, "_amp"); - search = search.replace(/\*/g, "_ast"); - search = search.replace(/\(/g, "_lpa"); - search = search.replace(/\)/g, "_rpa"); - search = search.replace(/\-/g, "_min"); - search = search.replace(/\+/g, "_plu"); - search = search.replace(/\=/g, "_equ"); - search = search.replace(/\{/g, "_lbc"); - search = search.replace(/\}/g, "_rbc"); - search = search.replace(/\[/g, "_lbk"); - search = search.replace(/\]/g, "_rbk"); - search = search.replace(/\:/g, "_col"); - search = search.replace(/\;/g, "_sco"); - search = search.replace(/\"/g, "_quo"); - search = search.replace(/\'/g, "_apo"); - search = search.replace(/\/g, "_ran"); - search = search.replace(/\,/g, "_com"); - search = search.replace(/\./g, "_per"); - search = search.replace(/\?/g, "_que"); - search = search.replace(/\//g, "_sla"); - search = search.replace(/[^a-z0-9\_]i/gi, "_zzz"); - }; - - var resultRows = document.getElementsByTagName("div"); - var matches = 0; - - var i = 0; - while (i < resultRows.length) - { - var row = resultRows.item(i); - - if (row.className == "SRResult") - { - var rowMatchName = row.id.toLowerCase(); - rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); - - if (search.length <= rowMatchName.length && rowMatchName.substr(0, search.length) == search) - { - row.style.display = "block"; - matches++; - } - else - { row.style.display = "none"; }; - }; - - i++; - }; - - document.getElementById("Searching").style.display="none"; - - if (matches == 0) - { document.getElementById("NoMatches").style.display="block"; } - else - { document.getElementById("NoMatches").style.display="none"; } - - this.lastMatchCount = matches; - - return true; - }; - }; - diff --git a/docs/javascript/searchdata.js b/docs/javascript/searchdata.js deleted file mode 100644 index eac176a3..00000000 --- a/docs/javascript/searchdata.js +++ /dev/null @@ -1,122 +0,0 @@ -var indexSectionsWithContent = { - "General": { - "Symbols": false, - "Numbers": false, - "A": true, - "B": false, - "C": true, - "D": true, - "E": false, - "F": true, - "G": true, - "H": true, - "I": true, - "J": false, - "K": false, - "L": true, - "M": true, - "N": false, - "O": true, - "P": false, - "Q": false, - "R": true, - "S": true, - "T": false, - "U": false, - "V": false, - "W": false, - "X": false, - "Y": false, - "Z": false - }, - "Functions": { - "Symbols": false, - "Numbers": false, - "A": true, - "B": true, - "C": true, - "D": true, - "E": true, - "F": true, - "G": true, - "H": true, - "I": true, - "J": false, - "K": false, - "L": true, - "M": true, - "N": false, - "O": false, - "P": true, - "Q": false, - "R": true, - "S": true, - "T": true, - "U": true, - "V": false, - "W": true, - "X": false, - "Y": false, - "Z": false - }, - "Interfaces": { - "Symbols": false, - "Numbers": false, - "A": false, - "B": false, - "C": false, - "D": false, - "E": false, - "F": false, - "G": false, - "H": false, - "I": false, - "J": false, - "K": false, - "L": false, - "M": false, - "N": false, - "O": false, - "P": false, - "Q": false, - "R": false, - "S": true, - "T": false, - "U": false, - "V": false, - "W": false, - "X": false, - "Y": false, - "Z": false - }, - "Classes": { - "Symbols": false, - "Numbers": false, - "A": false, - "B": false, - "C": false, - "D": false, - "E": false, - "F": false, - "G": false, - "H": false, - "I": false, - "J": false, - "K": false, - "L": false, - "M": false, - "N": false, - "O": false, - "P": false, - "Q": false, - "R": false, - "S": true, - "T": false, - "U": false, - "V": false, - "W": false, - "X": false, - "Y": false, - "Z": false - } - } \ No newline at end of file diff --git a/docs/search/FilesS.html b/docs/search/FilesS.html deleted file mode 100644 index 690d961d..00000000 --- a/docs/search/FilesS.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/search/FunctionsA.html b/docs/search/FunctionsA.html deleted file mode 100644 index de24e1f5..00000000 --- a/docs/search/FunctionsA.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
addExtension, SelectorManager
addSubCommand, SvgCanvas.BatchCommand
addSvgElementFromJson, SelectorManager
addToSelection, SelectorManager
alignSelectedElements, SelectorManager
assignAttributes, SelectorManager
Searching...
No Matches
\ No newline at end of file diff --git a/docs/search/FunctionsC.html b/docs/search/FunctionsC.html deleted file mode 100644 index eb4b747c..00000000 --- a/docs/search/FunctionsC.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
changeSelectedAttribute, SelectorManager
cleanupElement, SelectorManager
clear, SelectorManager
clearSelection, SelectorManager
cloneSelectedElements, SelectorManager
convertToNum, SvgCanvas
convertToPath, SelectorManager
convertToXMLReferences, SvgCanvas.Utils
copyElem, SelectorManager
createLayer, SelectorManager
cycleElement, SelectorManager
Searching...
No Matches
\ No newline at end of file diff --git a/docs/search/FunctionsD.html b/docs/search/FunctionsD.html deleted file mode 100644 index 1c28ffcf..00000000 --- a/docs/search/FunctionsD.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
decode64, SvgCanvas.Utils
deleteCurrentLayer, SelectorManager
deleteSelectedElements, SelectorManager
Searching...
No Matches
\ No newline at end of file diff --git a/docs/search/FunctionsG.html b/docs/search/FunctionsG.html deleted file mode 100644 index c7e504e9..00000000 --- a/docs/search/FunctionsG.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
getBBox, SelectorManager
getBlur, SelectorManager
getBold, SelectorManager
getColor, SelectorManager
getContentElem, SelectorManager
getCurrentLayer, SelectorManager
getDocumentTitle, SelectorManager
getEditorNS, SelectorManager
getElem, 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.undoMgr
getNextUndoCommandText, SvgCanvas.undoMgr
getNumLayers, SelectorManager
getOffset, SelectorManager
getOpacity, SelectorManager
getPathBBox, SelectorManager
getRedoStackSize, SvgCanvas.undoMgr
getResolution, SelectorManager
getRootElem, SelectorManager
getRotationAngle, SelectorManager
getRubberBandBox, SelectorManager.SelectorManager
getSelectedElems, SelectorManager
getStrokedBBox, SelectorManager
getStrokeOpacity, SelectorManager
getStrokeWidth, SelectorManager
getSvgString, SelectorManager
getText, SelectorManager
getTransformList, SelectorManager
getUndoStackSize, SvgCanvas.undoMgr
getUrlFromAttr, SelectorManager
getVersion, SelectorManager
getVisibleElements, SelectorManager
getZoom, SelectorManager
groupSelectedElements, SelectorManager
Searching...
No Matches
\ No newline at end of file diff --git a/docs/search/FunctionsM.html b/docs/search/FunctionsM.html deleted file mode 100644 index fbb3112a..00000000 --- a/docs/search/FunctionsM.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
matrixMultiply, SelectorManager
moveSelectedElements, SelectorManager
moveSelectedToLayer, SelectorManager
moveToTopSelectedElement, SelectorManager
Searching...
No Matches
\ No newline at end of file diff --git a/docs/search/FunctionsO.html b/docs/search/FunctionsO.html deleted file mode 100644 index 76f92f65..00000000 --- a/docs/search/FunctionsO.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
Searching...
No Matches
\ No newline at end of file diff --git a/docs/search/FunctionsR.html b/docs/search/FunctionsR.html deleted file mode 100644 index 3153d9df..00000000 --- a/docs/search/FunctionsR.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
rasterExport, SelectorManager
recalculateDimensions, SelectorManager
rectsIntersect, SvgCanvas
redo, SvgCanvas.undoMgr
releaseSelector, SelectorManager.SelectorManager
remapElement, SelectorManager
removeFromSelection, SelectorManager
removeUnusedDefElems, SelectorManager
renameCurrentLayer, SelectorManager
requestSelector, SelectorManager.SelectorManager
reset, Selector.Selector
resetUndoStack, SvgCanvas
resize, Selector.Selector
Searching...
No Matches
\ No newline at end of file diff --git a/docs/search/FunctionsS.html b/docs/search/FunctionsS.html deleted file mode 100644 index 13e33384..00000000 --- a/docs/search/FunctionsS.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
sanitizeSvg, SelectorManager
save, SelectorManager
selectAllInCurrentLayer, SelectorManager
setBackground, SelectorManager
setBBoxZoom, SelectorManager
setBlur, SelectorManager
setBlurNoUndo, SelectorManager
setBlurOffsets, SelectorManager
setBold, SelectorManager
setColor, SelectorManager
setConfig, SelectorManager
setCurrentLayer, SelectorManager
setCurrentLayerPosition, SelectorManager
setDocumentTitle, SelectorManager
setFontFamily, SelectorManager
setFontSize, SelectorManager
setGradient, SelectorManager
setIdPrefix, SelectorManager
setImageURL, SelectorManager
setItalic, SelectorManager
setLayerOpacity, SelectorManager
setLayerVisibility, SelectorManager
setMode, SelectorManager
setOpacity, SelectorManager
setPaint, SelectorManager
setPaintOpacity, SelectorManager
setRectRadius, SelectorManager
setResolution, SelectorManager
setRotationAngle, SelectorManager
setSegType, SelectorManager
setStrokeAttr, SelectorManager
setStrokeWidth, SelectorManager
setSvgString, SelectorManager
setTextContent, SelectorManager
setUiStrings, SelectorManager
setUnitAttr, SvgCanvas
setZoom, SelectorManager
shortFloat, SelectorManager
showGrips, Selector.Selector
smoothControlPoints, SelectorManager
snapToAngle, SvgCanvas
svgCanvasToString, SelectorManager
svgToString, SelectorManager
Searching...
No Matches
\ No newline at end of file diff --git a/docs/search/GeneralA.html b/docs/search/GeneralA.html deleted file mode 100644 index f3ee0f68..00000000 --- a/docs/search/GeneralA.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
addExtension, SelectorManager
Additional editor tools, SelectorManager
addSubCommand, SvgCanvas.BatchCommand
addSvgElementFromJson, SelectorManager
addToSelection, SelectorManager
alignSelectedElements, SelectorManager
assignAttributes, SelectorManager
Searching...
No Matches
\ No newline at end of file diff --git a/docs/search/GeneralC.html b/docs/search/GeneralC.html deleted file mode 100644 index eb4b747c..00000000 --- a/docs/search/GeneralC.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
changeSelectedAttribute, SelectorManager
cleanupElement, SelectorManager
clear, SelectorManager
clearSelection, SelectorManager
cloneSelectedElements, SelectorManager
convertToNum, SvgCanvas
convertToPath, SelectorManager
convertToXMLReferences, SvgCanvas.Utils
copyElem, SelectorManager
createLayer, SelectorManager
cycleElement, SelectorManager
Searching...
No Matches
\ No newline at end of file diff --git a/docs/search/GeneralD.html b/docs/search/GeneralD.html deleted file mode 100644 index 67353008..00000000 --- a/docs/search/GeneralD.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
decode64, SvgCanvas.Utils
deleteCurrentLayer, SelectorManager
deleteSelectedElements, SelectorManager
Document functions, SelectorManager
Searching...
No Matches
\ No newline at end of file diff --git a/docs/search/GeneralF.html b/docs/search/GeneralF.html deleted file mode 100644 index 55c21a89..00000000 --- a/docs/search/GeneralF.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
ffClone, SelectorManager
findDefs, SelectorManager
findDuplicateGradient, SelectorManager
fromXml, SvgCanvas.Utils
Functions, Selector
Searching...
No Matches
\ No newline at end of file diff --git a/docs/search/GeneralG.html b/docs/search/GeneralG.html deleted file mode 100644 index c7e504e9..00000000 --- a/docs/search/GeneralG.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
getBBox, SelectorManager
getBlur, SelectorManager
getBold, SelectorManager
getColor, SelectorManager
getContentElem, SelectorManager
getCurrentLayer, SelectorManager
getDocumentTitle, SelectorManager
getEditorNS, SelectorManager
getElem, 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.undoMgr
getNextUndoCommandText, SvgCanvas.undoMgr
getNumLayers, SelectorManager
getOffset, SelectorManager
getOpacity, SelectorManager
getPathBBox, SelectorManager
getRedoStackSize, SvgCanvas.undoMgr
getResolution, SelectorManager
getRootElem, SelectorManager
getRotationAngle, SelectorManager
getRubberBandBox, SelectorManager.SelectorManager
getSelectedElems, SelectorManager
getStrokedBBox, SelectorManager
getStrokeOpacity, SelectorManager
getStrokeWidth, SelectorManager
getSvgString, SelectorManager
getText, SelectorManager
getTransformList, SelectorManager
getUndoStackSize, SvgCanvas.undoMgr
getUrlFromAttr, SelectorManager
getVersion, SelectorManager
getVisibleElements, SelectorManager
getZoom, SelectorManager
groupSelectedElements, SelectorManager
Searching...
No Matches
\ No newline at end of file diff --git a/docs/search/GeneralL.html b/docs/search/GeneralL.html deleted file mode 100644 index 09038de3..00000000 --- a/docs/search/GeneralL.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
Layers, SelectorManager
linkControlPoints, SelectorManager
Searching...
No Matches
\ No newline at end of file diff --git a/docs/search/GeneralM.html b/docs/search/GeneralM.html deleted file mode 100644 index fbb3112a..00000000 --- a/docs/search/GeneralM.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
matrixMultiply, SelectorManager
moveSelectedElements, SelectorManager
moveSelectedToLayer, SelectorManager
moveToTopSelectedElement, SelectorManager
Searching...
No Matches
\ No newline at end of file diff --git a/docs/search/GeneralO.html b/docs/search/GeneralO.html deleted file mode 100644 index 76f92f65..00000000 --- a/docs/search/GeneralO.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
Searching...
No Matches
\ No newline at end of file diff --git a/docs/search/GeneralR.html b/docs/search/GeneralR.html deleted file mode 100644 index 3153d9df..00000000 --- a/docs/search/GeneralR.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
rasterExport, SelectorManager
recalculateDimensions, SelectorManager
rectsIntersect, SvgCanvas
redo, SvgCanvas.undoMgr
releaseSelector, SelectorManager.SelectorManager
remapElement, SelectorManager
removeFromSelection, SelectorManager
removeUnusedDefElems, SelectorManager
renameCurrentLayer, SelectorManager
requestSelector, SelectorManager.SelectorManager
reset, Selector.Selector
resetUndoStack, SvgCanvas
resize, Selector.Selector
Searching...
No Matches
\ No newline at end of file diff --git a/docs/search/GeneralS.html b/docs/search/GeneralS.html deleted file mode 100644 index 11769862..00000000 --- a/docs/search/GeneralS.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - -
Loading...
sanitizeSvg, SelectorManager
save, SelectorManager
selectAllInCurrentLayer, SelectorManager
Selection, SelectorManager
Serialization, SelectorManager
setBackground, SelectorManager
setBBoxZoom, SelectorManager
setBlur, SelectorManager
setBlurNoUndo, SelectorManager
setBlurOffsets, SelectorManager
setBold, SelectorManager
setColor, SelectorManager
setConfig, SelectorManager
setCurrentLayer, SelectorManager
setCurrentLayerPosition, SelectorManager
setDocumentTitle, SelectorManager
setFontFamily, SelectorManager
setFontSize, SelectorManager
setGradient, SelectorManager
setIdPrefix, SelectorManager
setImageURL, SelectorManager
setItalic, SelectorManager
setLayerOpacity, SelectorManager
setLayerVisibility, SelectorManager
setMode, SelectorManager
setOpacity, SelectorManager
setPaint, SelectorManager
setPaintOpacity, SelectorManager
setRectRadius, SelectorManager
setResolution, SelectorManager
setRotationAngle, SelectorManager
setSegType, SelectorManager
setStrokeAttr, SelectorManager
setStrokeWidth, SelectorManager
setSvgString, SelectorManager
setTextContent, SelectorManager
setUiStrings, SelectorManager
setUnitAttr, SvgCanvas
setZoom, SelectorManager
shortFloat, SelectorManager
showGrips, Selector.Selector
smoothControlPoints, SelectorManager
snapToAngle, SvgCanvas
svgCanvasToString, SelectorManager
svgToString, SelectorManager
Searching...
No Matches
\ No newline at end of file diff --git a/docs/search/NoResults.html b/docs/search/NoResults.html deleted file mode 100644 index 02ce8886..00000000 --- a/docs/search/NoResults.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - -
No Matches
\ No newline at end of file diff --git a/docs/styles/main.css b/docs/styles/main.css deleted file mode 100644 index 17e9cbc3..00000000 --- a/docs/styles/main.css +++ /dev/null @@ -1,767 +0,0 @@ -/* - IMPORTANT: If you're editing this file in the output directory of one of - your projects, your changes will be overwritten the next time you run - Natural Docs. Instead, copy this file to your project directory, make your - changes, and you can use it with -s. Even better would be to make a CSS - file in your project directory with only your changes, which you can then - use with -s [original style] [your changes]. - - On the other hand, if you're editing this file in the Natural Docs styles - directory, the changes will automatically be applied to all your projects - that use this style the next time Natural Docs is run on them. - - This file is part of Natural Docs, which is Copyright (C) 2003-2008 Greg Valure - Natural Docs is licensed under the GPL -*/ - -body { - font: 10pt Verdana, Arial, sans-serif; - color: #000000; - margin: 0; padding: 0; - } - -.ContentPage, -.IndexPage, -.FramedMenuPage { - background-color: #E8E8E8; - } -.FramedContentPage, -.FramedIndexPage, -.FramedSearchResultsPage, -.PopupSearchResultsPage { - background-color: #FFFFFF; - } - - -a:link, -a:visited { color: #900000; text-decoration: none } -a:hover { color: #900000; text-decoration: underline } -a:active { color: #FF0000; text-decoration: underline } - -td { - vertical-align: top } - -img { border: 0; } - - -/* - Comment out this line to use web-style paragraphs (blank line between - paragraphs, no indent) instead of print-style paragraphs (no blank line, - indented.) -*/ -p { - text-indent: 5ex; margin: 0 } - - -/* Opera doesn't break with just wbr, but will if you add this. */ -.Opera wbr:after { - content: "\00200B"; - } - - -/* Blockquotes are used as containers for things that may need to scroll. */ -blockquote { - padding: 0; - margin: 0; - overflow: auto; - } - - -.Firefox1 blockquote { - padding-bottom: .5em; - } - -/* Turn off scrolling when printing. */ -@media print { - blockquote { - overflow: visible; - } - .IE blockquote { - width: auto; - } - } - - - -#Menu { - font-size: 9pt; - padding: 10px 0 0 0; - } -.ContentPage #Menu, -.IndexPage #Menu { - position: absolute; - top: 0; - left: 0; - width: 31ex; - overflow: hidden; - } -.ContentPage .Firefox #Menu, -.IndexPage .Firefox #Menu { - width: 27ex; - } - - - .MTitle { - font-size: 16pt; font-weight: bold; font-variant: small-caps; - text-align: center; - padding: 5px 10px 15px 10px; - border-bottom: 1px dotted #000000; - margin-bottom: 15px } - - .MSubTitle { - font-size: 9pt; font-weight: normal; font-variant: normal; - margin-top: 1ex; margin-bottom: 5px } - - - .MEntry a:link, - .MEntry a:hover, - .MEntry a:visited { color: #606060; margin-right: 0 } - .MEntry a:active { color: #A00000; margin-right: 0 } - - - .MGroup { - font-variant: small-caps; font-weight: bold; - margin: 1em 0 1em 10px; - } - - .MGroupContent { - font-variant: normal; font-weight: normal } - - .MGroup a:link, - .MGroup a:hover, - .MGroup a:visited { color: #545454; margin-right: 10px } - .MGroup a:active { color: #A00000; margin-right: 10px } - - - .MFile, - .MText, - .MLink, - .MIndex { - padding: 1px 17px 2px 10px; - margin: .25em 0 .25em 0; - } - - .MText { - font-size: 8pt; font-style: italic } - - .MLink { - font-style: italic } - - #MSelected { - color: #000000; background-color: #FFFFFF; - /* Replace padding with border. */ - padding: 0 10px 0 10px; - border-width: 1px 2px 2px 0; border-style: solid; border-color: #000000; - margin-right: 5px; - } - - /* Close off the left side when its in a group. */ - .MGroup #MSelected { - padding-left: 9px; border-left-width: 1px } - - /* A treat for Mozilla users. Blatantly non-standard. Will be replaced with CSS 3 attributes when finalized/supported. */ - .Firefox #MSelected { - -moz-border-radius-topright: 10px; - -moz-border-radius-bottomright: 10px } - .Firefox .MGroup #MSelected { - -moz-border-radius-topleft: 10px; - -moz-border-radius-bottomleft: 10px } - - - #MSearchPanel { - padding: 0px 6px; - margin: .25em 0; - } - - - #MSearchField { - font: italic 9pt Verdana, sans-serif; - color: #606060; - background-color: #E8E8E8; - border: none; - padding: 2px 4px; - width: 100%; - } - /* Only Opera gets it right. */ - .Firefox #MSearchField, - .IE #MSearchField, - .Safari #MSearchField { - width: 94%; - } - .Opera9 #MSearchField, - .Konqueror #MSearchField { - width: 97%; - } - .FramedMenuPage .Firefox #MSearchField, - .FramedMenuPage .Safari #MSearchField, - .FramedMenuPage .Konqueror #MSearchField { - width: 98%; - } - - /* Firefox doesn't do this right in frames without #MSearchPanel added on. - It's presence doesn't hurt anything other browsers. */ - #MSearchPanel.MSearchPanelInactive:hover #MSearchField { - background-color: #FFFFFF; - border: 1px solid #C0C0C0; - padding: 1px 3px; - } - .MSearchPanelActive #MSearchField { - background-color: #FFFFFF; - border: 1px solid #C0C0C0; - font-style: normal; - padding: 1px 3px; - } - - #MSearchType { - visibility: hidden; - font: 8pt Verdana, sans-serif; - width: 98%; - padding: 0; - border: 1px solid #C0C0C0; - } - .MSearchPanelActive #MSearchType, - /* As mentioned above, Firefox doesn't do this right in frames without #MSearchPanel added on. */ - #MSearchPanel.MSearchPanelInactive:hover #MSearchType, - #MSearchType:focus { - visibility: visible; - color: #606060; - } - #MSearchType option#MSearchEverything { - font-weight: bold; - } - - .Opera8 .MSearchPanelInactive:hover, - .Opera8 .MSearchPanelActive { - margin-left: -1px; - } - - - iframe#MSearchResults { - width: 60ex; - height: 15em; - } - #MSearchResultsWindow { - display: none; - position: absolute; - left: 0; top: 0; - border: 1px solid #000000; - background-color: #E8E8E8; - } - #MSearchResultsWindowClose { - font-weight: bold; - font-size: 8pt; - display: block; - padding: 2px 5px; - } - #MSearchResultsWindowClose:link, - #MSearchResultsWindowClose:visited { - color: #000000; - text-decoration: none; - } - #MSearchResultsWindowClose:active, - #MSearchResultsWindowClose:hover { - color: #800000; - text-decoration: none; - background-color: #F4F4F4; - } - - - - -#Content { - padding-bottom: 15px; - } - -.ContentPage #Content { - border-width: 0 0 1px 1px; - border-style: solid; - border-color: #000000; - background-color: #FFFFFF; - font-size: 9pt; /* To make 31ex match the menu's 31ex. */ - margin-left: 31ex; - } -.ContentPage .Firefox #Content { - margin-left: 27ex; - } - - - - .CTopic { - font-size: 10pt; - margin-bottom: 3em; - } - - - .CTitle { - font-size: 12pt; font-weight: bold; - border-width: 0 0 1px 0; border-style: solid; border-color: #A0A0A0; - margin: 0 15px .5em 15px } - - .CGroup .CTitle { - font-size: 16pt; font-variant: small-caps; - padding-left: 15px; padding-right: 15px; - border-width: 0 0 2px 0; border-color: #000000; - margin-left: 0; margin-right: 0 } - - .CClass .CTitle, - .CInterface .CTitle, - .CDatabase .CTitle, - .CDatabaseTable .CTitle, - .CSection .CTitle { - font-size: 18pt; - color: #FFFFFF; background-color: #A0A0A0; - padding: 10px 15px 10px 15px; - border-width: 2px 0; border-color: #000000; - margin-left: 0; margin-right: 0 } - - #MainTopic .CTitle { - font-size: 20pt; - color: #FFFFFF; background-color: #7070C0; - padding: 10px 15px 10px 15px; - border-width: 0 0 3px 0; border-color: #000000; - margin-left: 0; margin-right: 0 } - - .CBody { - margin-left: 15px; margin-right: 15px } - - - .CToolTip { - position: absolute; visibility: hidden; - left: 0; top: 0; - background-color: #FFFFE0; - padding: 5px; - border-width: 1px 2px 2px 1px; border-style: solid; border-color: #000000; - font-size: 8pt; - } - - .Opera .CToolTip { - max-width: 98%; - } - - /* Scrollbars would be useless. */ - .CToolTip blockquote { - overflow: hidden; - } - .IE6 .CToolTip blockquote { - overflow: visible; - } - - .CHeading { - font-weight: bold; font-size: 10pt; - margin: 1.5em 0 .5em 0; - } - - .CBody pre { - font: 10pt "Courier New", Courier, monospace; - margin: 1em 0; - } - - .CBody ul { - /* I don't know why CBody's margin doesn't apply, but it's consistent across browsers so whatever. - Reapply it here as padding. */ - padding-left: 15px; padding-right: 15px; - margin: .5em 5ex .5em 5ex; - } - - .CDescriptionList { - margin: .5em 5ex 0 5ex } - - .CDLEntry { - font: 10pt "Courier New", Courier, monospace; color: #808080; - padding-bottom: .25em; - white-space: nowrap } - - .CDLDescription { - font-size: 10pt; /* For browsers that don't inherit correctly, like Opera 5. */ - padding-bottom: .5em; padding-left: 5ex } - - - .CTopic img { - text-align: center; - display: block; - margin: 1em auto; - } - .CImageCaption { - font-variant: small-caps; - font-size: 8pt; - color: #808080; - text-align: center; - position: relative; - top: 1em; - } - - .CImageLink { - color: #808080; - font-style: italic; - } - a.CImageLink:link, - a.CImageLink:visited, - a.CImageLink:hover { color: #808080 } - - - - - -.Prototype { - font: 10pt "Courier New", Courier, monospace; - padding: 5px 3ex; - border-width: 1px; border-style: solid; - margin: 0 5ex 1.5em 5ex; - } - - .Prototype td { - font-size: 10pt; - } - - .PDefaultValue, - .PDefaultValuePrefix, - .PTypePrefix { - color: #8F8F8F; - } - .PTypePrefix { - text-align: right; - } - .PAfterParameters { - vertical-align: bottom; - } - - .IE .Prototype table { - padding: 0; - } - - .CFunction .Prototype { - background-color: #F4F4F4; border-color: #D0D0D0 } - .CProperty .Prototype { - background-color: #F4F4FF; border-color: #C0C0E8 } - .CVariable .Prototype { - background-color: #FFFFF0; border-color: #E0E0A0 } - - .CClass .Prototype { - border-width: 1px 2px 2px 1px; border-style: solid; border-color: #A0A0A0; - background-color: #F4F4F4; - } - .CInterface .Prototype { - border-width: 1px 2px 2px 1px; border-style: solid; border-color: #A0A0D0; - background-color: #F4F4FF; - } - - .CDatabaseIndex .Prototype, - .CConstant .Prototype { - background-color: #D0D0D0; border-color: #000000 } - .CType .Prototype, - .CEnumeration .Prototype { - background-color: #FAF0F0; border-color: #E0B0B0; - } - .CDatabaseTrigger .Prototype, - .CEvent .Prototype, - .CDelegate .Prototype { - background-color: #F0FCF0; border-color: #B8E4B8 } - - .CToolTip .Prototype { - margin: 0 0 .5em 0; - white-space: nowrap; - } - - - - - -.Summary { - margin: 1.5em 5ex 0 5ex } - - .STitle { - font-size: 12pt; font-weight: bold; - margin-bottom: .5em } - - - .SBorder { - background-color: #FFFFF0; - padding: 15px; - border: 1px solid #C0C060 } - - /* In a frame IE 6 will make them too long unless you set the width to 100%. Without frames it will be correct without a width - or slightly too long (but not enough to scroll) with a width. This arbitrary weirdness simply astounds me. IE 7 has the same - problem with frames, haven't tested it without. */ - .FramedContentPage .IE .SBorder { - width: 100% } - - /* A treat for Mozilla users. Blatantly non-standard. Will be replaced with CSS 3 attributes when finalized/supported. */ - .Firefox .SBorder { - -moz-border-radius: 20px } - - - .STable { - font-size: 9pt; width: 100% } - - .SEntry { - width: 30% } - .SDescription { - width: 70% } - - - .SMarked { - background-color: #F8F8D8 } - - .SDescription { padding-left: 2ex } - .SIndent1 .SEntry { padding-left: 1.5ex } .SIndent1 .SDescription { padding-left: 3.5ex } - .SIndent2 .SEntry { padding-left: 3.0ex } .SIndent2 .SDescription { padding-left: 5.0ex } - .SIndent3 .SEntry { padding-left: 4.5ex } .SIndent3 .SDescription { padding-left: 6.5ex } - .SIndent4 .SEntry { padding-left: 6.0ex } .SIndent4 .SDescription { padding-left: 8.0ex } - .SIndent5 .SEntry { padding-left: 7.5ex } .SIndent5 .SDescription { padding-left: 9.5ex } - - .SDescription a { color: #800000} - .SDescription a:active { color: #A00000 } - - .SGroup td { - padding-top: .5em; padding-bottom: .25em } - - .SGroup .SEntry { - font-weight: bold; font-variant: small-caps } - - .SGroup .SEntry a { color: #800000 } - .SGroup .SEntry a:active { color: #F00000 } - - - .SMain td, - .SClass td, - .SDatabase td, - .SDatabaseTable td, - .SSection td { - font-size: 10pt; - padding-bottom: .25em } - - .SClass td, - .SDatabase td, - .SDatabaseTable td, - .SSection td { - padding-top: 1em } - - .SMain .SEntry, - .SClass .SEntry, - .SDatabase .SEntry, - .SDatabaseTable .SEntry, - .SSection .SEntry { - font-weight: bold; - } - - .SMain .SEntry a, - .SClass .SEntry a, - .SDatabase .SEntry a, - .SDatabaseTable .SEntry a, - .SSection .SEntry a { color: #000000 } - - .SMain .SEntry a:active, - .SClass .SEntry a:active, - .SDatabase .SEntry a:active, - .SDatabaseTable .SEntry a:active, - .SSection .SEntry a:active { color: #A00000 } - - - - - -.ClassHierarchy { - margin: 0 15px 1em 15px } - - .CHEntry { - border-width: 1px 2px 2px 1px; border-style: solid; border-color: #A0A0A0; - margin-bottom: 3px; - padding: 2px 2ex; - font-size: 10pt; - background-color: #F4F4F4; color: #606060; - } - - .Firefox .CHEntry { - -moz-border-radius: 4px; - } - - .CHCurrent .CHEntry { - font-weight: bold; - border-color: #000000; - color: #000000; - } - - .CHChildNote .CHEntry { - font-style: italic; - font-size: 8pt; - } - - .CHIndent { - margin-left: 3ex; - } - - .CHEntry a:link, - .CHEntry a:visited, - .CHEntry a:hover { - color: #606060; - } - .CHEntry a:active { - color: #800000; - } - - - - - -#Index { - background-color: #FFFFFF; - } - -/* As opposed to .PopupSearchResultsPage #Index */ -.IndexPage #Index, -.FramedIndexPage #Index, -.FramedSearchResultsPage #Index { - padding: 15px; - } - -.IndexPage #Index { - border-width: 0 0 1px 1px; - border-style: solid; - border-color: #000000; - font-size: 9pt; /* To make 27ex match the menu's 27ex. */ - margin-left: 27ex; - } - - - .IPageTitle { - font-size: 20pt; font-weight: bold; - color: #FFFFFF; background-color: #7070C0; - padding: 10px 15px 10px 15px; - border-width: 0 0 3px 0; border-color: #000000; border-style: solid; - margin: -15px -15px 0 -15px } - - .FramedSearchResultsPage .IPageTitle { - margin-bottom: 15px; - } - - .INavigationBar { - font-size: 10pt; - text-align: center; - background-color: #FFFFF0; - padding: 5px; - border-bottom: solid 1px black; - margin: 0 -15px 15px -15px; - } - - .INavigationBar a { - font-weight: bold } - - .IHeading { - font-size: 16pt; font-weight: bold; - padding: 2.5em 0 .5em 0; - text-align: center; - width: 3.5ex; - } - #IFirstHeading { - padding-top: 0; - } - - .IEntry { - font-size: 10pt; - padding-left: 1ex; - } - .PopupSearchResultsPage .IEntry { - font-size: 8pt; - padding: 1px 5px; - } - .PopupSearchResultsPage .Opera9 .IEntry, - .FramedSearchResultsPage .Opera9 .IEntry { - text-align: left; - } - .FramedSearchResultsPage .IEntry { - padding: 0; - } - - .ISubIndex { - padding-left: 3ex; padding-bottom: .5em } - .PopupSearchResultsPage .ISubIndex { - display: none; - } - - /* While it may cause some entries to look like links when they aren't, I found it's much easier to read the - index if everything's the same color. */ - .ISymbol { - font-weight: bold; color: #900000 } - - .IndexPage .ISymbolPrefix, - .FramedIndexPage .ISymbolPrefix { - font-size: 10pt; - text-align: right; - color: #C47C7C; - background-color: #F8F8F8; - border-right: 3px solid #E0E0E0; - border-left: 1px solid #E0E0E0; - padding: 0 1px 0 2px; - } - .PopupSearchResultsPage .ISymbolPrefix, - .FramedSearchResultsPage .ISymbolPrefix { - color: #900000; - } - .PopupSearchResultsPage .ISymbolPrefix { - font-size: 8pt; - } - - .IndexPage #IFirstSymbolPrefix, - .FramedIndexPage #IFirstSymbolPrefix { - border-top: 1px solid #E0E0E0; - } - .IndexPage #ILastSymbolPrefix, - .FramedIndexPage #ILastSymbolPrefix { - border-bottom: 1px solid #E0E0E0; - } - .IndexPage #IOnlySymbolPrefix, - .FramedIndexPage #IOnlySymbolPrefix { - border-top: 1px solid #E0E0E0; - border-bottom: 1px solid #E0E0E0; - } - - a.IParent, - a.IFile { - display: block; - } - - .PopupSearchResultsPage .SRStatus { - padding: 2px 5px; - font-size: 8pt; - font-style: italic; - } - .FramedSearchResultsPage .SRStatus { - font-size: 10pt; - font-style: italic; - } - - .SRResult { - display: none; - } - - - -#Footer { - font-size: 8pt; - color: #989898; - text-align: right; - } - -#Footer p { - text-indent: 0; - margin-bottom: .5em; - } - -.ContentPage #Footer, -.IndexPage #Footer { - text-align: right; - margin: 2px; - } - -.FramedMenuPage #Footer { - text-align: center; - margin: 5em 10px 10px 10px; - padding-top: 1em; - border-top: 1px solid #C8C8C8; - } - - #Footer a:link, - #Footer a:hover, - #Footer a:visited { color: #989898 } - #Footer a:active { color: #A00000 } -