Skip to content

Commit

Permalink
Add SVG "save" interface for shared SVG
Browse files Browse the repository at this point in the history
..and make it less picky about available libs
  • Loading branch information
techninja committed Oct 25, 2014
1 parent a375fb9 commit 52b5bf3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions resources/scripts/robopaint.mode.svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ $(function() {
// Handle buffer status messages
robopaint.socket.on('message update', messageUpdateEvent);
function messageUpdateEvent(data){
cncserver.wcb.status(data.message);
if (cncserver.wcb) cncserver.wcb.status(data.message);
}

// Remove globalized listeners from this local container/window
Expand Down Expand Up @@ -183,7 +183,7 @@ $(function() {
});

robopaint.cncserver.api.pen.stat(function(d){
cncserver.wcb.status(['Connected Successfully!'], d);
if (cncserver.wcb) cncserver.wcb.status(['Connected Successfully!'], d);
cncserver.state.pen.state = 1; // Assume down
robopaint.cncserver.api.pen.up(); // Send to put up
cncserver.state.pen.state = 0; // Assume it's up (doesn't return til later)
Expand Down Expand Up @@ -235,6 +235,11 @@ $(function() {
}
}

// Public function to save SVG to the global localStorage area
cncserver.canvas.saveSVG = function(svgText) {
window.localStorage.setItem('svgedit-default', svgText);
};

});

// Triggered on before close or switch mode, call callback to complete operation
Expand Down

0 comments on commit 52b5bf3

Please sign in to comment.