0.1.11 • Published 9 years ago

jsyg-fulleditor-menus v0.1.11

Weekly downloads
1
License
MIT
Repository
-
Last release
9 years ago

JSYG.FullEditor.Menus

Menus plugin for JSYG.FullEditor

Demo

http://yannickbochatay.github.io/JSYG.FullEditor.Menus

Installation
bower install jsyg-fulleditor-menus
Example

HTML

<div id="menuBar"></div>
<svg width="500" height="500" id="editor"></svg>

Javascript

var svgEditor = new JSYG.FullEditor("#editor");

svgEditor.enable();

var fileMenu = svgEditor.createMenu("openFile","print","downloadSVG","downloadPNG").set({title:"File"});

var toolsMenu = svgEditor.createMenu("selectionTool","insertText","insertImageFile","drawRect","drawPolyline","drawPath","drawFreeHandPath").set({"title":"Tools"});

toolsMenu.addItem({
    text:"personal item",
    icon:"ledicon user",
    action : function() {
        //do something great
    }
});
        
new JSYG("#menuBar").menuBar([fileMenu,toolsMenu]);

Full example script

https://github.com/YannickBochatay/JSYG.FullEditor.Menus/blob/master/script.js