diff --git a/editor/extensions/ext-eyedropper.js b/editor/extensions/ext-eyedropper.js index 257650d7..2dd451ba 100644 --- a/editor/extensions/ext-eyedropper.js +++ b/editor/extensions/ext-eyedropper.js @@ -7,12 +7,18 @@ * */ +// Dependencies: +// 1) jQuery +// 2) history.js +// 3) svg_editor.js +// 4) svgcanvas.js + svgEditor.addExtension("eyedropper", function(S) { var svgcontent = S.svgcontent, svgns = "http://www.w3.org/2000/svg", svgdoc = S.svgroot.parentNode.ownerDocument, - ChangeElementCommand = svgCanvas.getPrivateMethods().ChangeElementCommand, - addToHistory = svgCanvas.getPrivateMethods().addCommandToHistory, + ChangeElementCommand = svgedit.history.ChangeElementCommand, + addToHistory = function(cmd) { canvas.undoMgr.addCommandToHistory(cmd); }, currentStyle = {fillPaint: "red", fillOpacity: 1.0, strokePaint: "black", strokeOpacity: 1.0, strokeWidth: 5, strokeDashArray: null, diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 7d5e28ac..01c279b8 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -6404,7 +6404,7 @@ var uniquifyElems = this.uniquifyElems = function(g) { var attrnode = n.getAttributeNode(attr); if (attrnode) { // the incoming file has been sanitized, so we should be able to safely just strip off the leading # - var url = getUrlFromAttr(attrnode.value), + var url = svgedit.utilities.getUrlFromAttr(attrnode.value), refid = url ? url.substr(1) : null; if (refid) { if (!(refid in ids)) { @@ -6458,7 +6458,7 @@ var uniquifyElems = this.uniquifyElems = function(g) { var k = hreffers.length; while (k--) { var hreffer = hreffers[k]; - setHref(hreffer, "#"+newid); + svgedit.utilities.setHref(hreffer, "#"+newid); } } }