copy of map opacity to iamges
|
@ -155,6 +155,7 @@ svgEditor.addExtension("shapes", function() {
|
|||
type: "mode_flyout", // _flyout
|
||||
position: 6,
|
||||
title: "Shape library",
|
||||
fallback: "extensions/ext-shapes.png",
|
||||
events: {
|
||||
"click": function() {
|
||||
canv.setMode(mode_id);
|
||||
|
|
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 382 B |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 552 B |
After Width: | Height: | Size: 134 B |
After Width: | Height: | Size: 139 B |
After Width: | Height: | Size: 93 B |
After Width: | Height: | Size: 252 B |
After Width: | Height: | Size: 255 B |
After Width: | Height: | Size: 146 B |
After Width: | Height: | Size: 135 B |
After Width: | Height: | Size: 76 B |
After Width: | Height: | Size: 140 B |
|
@ -224,10 +224,10 @@
|
|||
'logo':'logo.png',
|
||||
'select':'select.png',
|
||||
'select_node':'select_node.png',
|
||||
'pencil':'fhpath.png',
|
||||
'pencil':'pencil.png',
|
||||
'pen':'line.png',
|
||||
'square':'square.png',
|
||||
'rect':'rect.png',
|
||||
'rect':'square.png',
|
||||
'fh_rect':'freehand-square.png',
|
||||
'circle':'circle.png',
|
||||
'ellipse':'ellipse.png',
|
||||
|
@ -237,6 +237,7 @@
|
|||
'image':'image.png',
|
||||
'zoom':'zoom.png',
|
||||
'delete':'delete.png',
|
||||
'spapelib':'shapelib.png',
|
||||
'node_delete':'node_delete.png',
|
||||
'align_left':'align-left.png',
|
||||
'align_center':'align-center',
|
||||
|
|
|
@ -385,15 +385,15 @@ Qa[xa]=ab.getContext("2d")}ab[ra]=ga%3E4;ga=3E4}Ba[ra]=ga;ra=S*u;var Wa=50/ra;Ba
|
|||
xa/1E3+"K";if(aa){ua.fillText(xa,cb+2,8);ua.fillStyle="#777"}else{Ma=(xa+"").split("");for(xa=0;xa<Ma.length;xa++){ua.fillText(Ma[xa],1,cb+9+xa*9);ua.fillStyle="#777"}}Ma=Wa/10;for(xa=1;xa<10;xa++){var yb=Math.round(cb+Ma*xa)+0.5;if(Qa&&yb>ga){Sa++;ua.stroke();if(Sa>=Qa.length){xa=10;cb=ha;continue}ua=Qa[Sa];cb-=3E4;yb=Math.round(cb+Ma*xa)+0.5}var Gb=xa%2?12:10;if(aa){ua.moveTo(yb,15);ua.lineTo(yb,Gb)}else{ua.moveTo(15,yb);ua.lineTo(Gb,yb)}}}ua.strokeStyle="#666";ua.stroke()}}(function(){var k=window.opener;
|
||||
if(k)try{var u=k.document.createEvent("Event");u.initEvent("svgEditorReady",true,true);k.document.documentElement.dispatchEvent(u)}catch(C){}})();(function(){a("#canvas_width").val(curConfig.dimensions[0]);a("#canvas_height").val(curConfig.dimensions[1]);a("body").toggleClass("touch",svgedit.browser.isTouch());var k=a.deparam.querystring(true);if(!a.isEmptyObject(k)){if(k.dimensions)k.dimensions=k.dimensions.split(",");if(k.extensions)k.extensions=k.extensions.split(",");if(k.bkgd_color)k.bkgd_color=
|
||||
"#"+k.bkgd_color;svgEditor.setConfig(k);var u=k.source,C=a.param.querystring();if(!u)if(C.indexOf("source=data:")>=0)u=C.match(/source=(data:[^&]*)/)[1];if(u)if(u.indexOf("data:")===0){u=u.replace(/ /g,"+");c.loadFromDataURI(u)}else c.loadFromString(u);else if(C.indexOf("paramurl=")!==-1)svgEditor.loadFromURL(C.substr(9));else k.url&&svgEditor.loadFromURL(k.url)}})();var q=function(){a.each(curConfig.extensions,function(){var k=this;a.getScript(curConfig.extPath+k,function(u){if(!u){u=document.createElement("script");
|
||||
u.src=curConfig.extPath+k;document.querySelector("head").appendChild(u)}})})};document.location.protocol==="file:"?setTimeout(q,100):q();a.svgIcons(curConfig.imgPath+"svg_edit_icons.svg",{w:27,h:27,id_match:false,no_img:!svgedit.browser.isWebkit(),fallback_path:curConfig.imgPath,fallback:{logo:"logo.png",select:"select.png",select_node:"select_node.png",pencil:"fhpath.png",pen:"line.png",square:"square.png",rect:"rect.png",fh_rect:"freehand-square.png",circle:"circle.png",ellipse:"ellipse.png",fh_ellipse:"freehand-circle.png",
|
||||
path:"path.png",text:"text.png",image:"image.png",zoom:"zoom.png","delete":"delete.png",node_delete:"node_delete.png",align_left:"align-left.png",align_center:"align-center",align_right:"align-right",align_top:"align-top",align_middle:"align-middle",align_bottom:"align-bottom",arrow_right:"flyouth.png",arrow_down:"dropdown.gif"},placement:{"#logo":"logo","#tool_select":"select","#tool_fhpath":"pencil","#tool_line":"pen","#tool_rect,#tools_rect_show":"rect","#tool_square":"square","#tool_fhrect":"fh_rect",
|
||||
"#tool_ellipse,#tools_ellipse_show":"ellipse","#tool_circle":"circle","#tool_fhellipse":"fh_ellipse","#tool_path":"path","#tool_text,#layer_rename":"text","#tool_image":"image","#tool_zoom":"zoom","#tool_node_clone":"node_clone","#tool_node_delete":"node_delete","#tool_add_subpath":"add_subpath","#tool_openclose_path":"open_path","#tool_alignleft, #tool_posleft":"align_left","#tool_aligncenter, #tool_poscenter":"align_center","#tool_alignright, #tool_posright":"align_right","#tool_aligntop, #tool_postop":"align_top",
|
||||
"#tool_alignmiddle, #tool_posmiddle":"align_middle","#tool_alignbottom, #tool_posbottom":"align_bottom","#cur_position":"align","#zoomLabel":"zoom","#palette .palette_item:first, #fill_bg, #stroke_bg":"no_color"},resize:{"#logo .svg_icon":15,".flyout_arrow_horiz .svg_icon":5,"#fill_bg .svg_icon, #stroke_bg .svg_icon":svgedit.browser.isTouch()?24:24,".palette_item:first .svg_icon":svgedit.browser.isTouch()?30:16,"#zoomLabel .svg_icon":16,"#zoom_dropdown .svg_icon":7},callback:function(){a(".toolbar_button button > svg, .toolbar_button button > img").each(function(){a(this).parent().prepend(this)});
|
||||
a(".tool_button, .tool_button_current").addClass("loaded");var k=a("#tools_left");if(k.length!=0){k.offset();k.outerHeight()}a(".tools_flyout").each(function(){var u=a("#"+this.id+"_show"),C=u.attr("data-curopt");if(!u.children("svg, img").length){C=a(C).children().clone();if(C.length){C[0].removeAttribute("style");u.append(C)}}});svgEditor.runCallbacks();setTimeout(function(){a(".flyout_arrow_horiz:empty").each(function(){a(this).append(a.getSvgIcon("arrow_right").width(5).height(5))})},1)}});a("#rulers").on("dblclick",
|
||||
function(k){a("#base_unit_container").css({top:k.pageY-10,left:k.pageX-50,display:"block"})});a("#base_unit_container").on("mouseleave mouseenter",function(){t=setTimeout(function(){a("#base_unit_container").fadeOut(500)},200);event.type=="mouseover"&&clearTimeout(t)});a("#base_unit").on("change",function(){savePreferences()});c.canvas=g=new a.SvgCanvas(document.getElementById("svgcanvas"),curConfig);c.show_save_warning=false;c.paintBox={fill:null,stroke:null,canvas:null};q=navigator.platform.indexOf("Mac")>=
|
||||
0;var B=navigator.userAgent.indexOf("AppleWebKit")>=0,o=q?"meta+":"ctrl+",K=g.pathActions,T=g.undoMgr,M=svgedit.utilities,J=curConfig.imgPath+"placeholder.svg",Q=a("#workarea"),Y=a("#cmenu_canvas"),O=null,ia=1,pa="toolbars",fa="";q||a(".shortcut").each(function(){var k=a(this).text();a(this).text(k.split("\u2318").join("Ctrl+"))});(function(){a("#dialog_container").draggable({cancel:"#dialog_content, #dialog_buttons *",containment:"window"});var k=a("#dialog_box"),u=a("#dialog_buttons"),C=function(E,
|
||||
P,U,S){a("#dialog_content").html("<p>"+P.replace(/\n/g,"</p><p>")+"</p>").toggleClass("prompt",E=="prompt");u.empty();var X=a('<input type="button" value="'+uiStrings.common.ok+'">').appendTo(u);E!="alert"&&a('<input type="button" value="'+uiStrings.common.cancel+'">').appendTo(u).on("click, touchstart",function(){k.hide();U(false)});if(E=="prompt"){var aa=a('<input type="text">').prependTo(u);aa.val(S||"");aa.bind("keydown","return",function(){X.trigger("click touchstart")})}E=="process"&&X.hide();
|
||||
k.show();X.on("click touchstart",function(){k.hide();var ga=E=="prompt"?aa.val():true;U&&U(ga)}).focus();E=="prompt"&&aa.focus()};a.alert=function(E,P){C("alert",E,P)};a.confirm=function(E,P){C("confirm",E,P)};a.process_cancel=function(E,P){C("process",E,P)};a.prompt=function(E,P,U){C("prompt",E,U,P)}})();var ba=function(){var k=a(".tool_button_current");if(k.length&&k[0].id!=="tool_select"){k.removeClass("tool_button_current").addClass("tool_button");a("#tool_select").addClass("tool_button_current").removeClass("tool_button")}g.setMode("select")},
|
||||
u.src=curConfig.extPath+k;document.querySelector("head").appendChild(u)}})})};document.location.protocol==="file:"?setTimeout(q,100):q();a.svgIcons(curConfig.imgPath+"svg_edit_icons.svg",{w:27,h:27,id_match:false,no_img:!svgedit.browser.isWebkit(),fallback_path:curConfig.imgPath,fallback:{logo:"logo.png",select:"select.png",select_node:"select_node.png",pencil:"pencil.png",pen:"line.png",square:"square.png",rect:"square.png",fh_rect:"freehand-square.png",circle:"circle.png",ellipse:"ellipse.png",
|
||||
fh_ellipse:"freehand-circle.png",path:"path.png",text:"text.png",image:"image.png",zoom:"zoom.png","delete":"delete.png",spapelib:"shapelib.png",node_delete:"node_delete.png",align_left:"align-left.png",align_center:"align-center",align_right:"align-right",align_top:"align-top",align_middle:"align-middle",align_bottom:"align-bottom",arrow_right:"flyouth.png",arrow_down:"dropdown.gif"},placement:{"#logo":"logo","#tool_select":"select","#tool_fhpath":"pencil","#tool_line":"pen","#tool_rect,#tools_rect_show":"rect",
|
||||
"#tool_square":"square","#tool_fhrect":"fh_rect","#tool_ellipse,#tools_ellipse_show":"ellipse","#tool_circle":"circle","#tool_fhellipse":"fh_ellipse","#tool_path":"path","#tool_text,#layer_rename":"text","#tool_image":"image","#tool_zoom":"zoom","#tool_node_clone":"node_clone","#tool_node_delete":"node_delete","#tool_add_subpath":"add_subpath","#tool_openclose_path":"open_path","#tool_alignleft, #tool_posleft":"align_left","#tool_aligncenter, #tool_poscenter":"align_center","#tool_alignright, #tool_posright":"align_right",
|
||||
"#tool_aligntop, #tool_postop":"align_top","#tool_alignmiddle, #tool_posmiddle":"align_middle","#tool_alignbottom, #tool_posbottom":"align_bottom","#cur_position":"align","#zoomLabel":"zoom","#palette .palette_item:first, #fill_bg, #stroke_bg":"no_color"},resize:{"#logo .svg_icon":15,".flyout_arrow_horiz .svg_icon":5,"#fill_bg .svg_icon, #stroke_bg .svg_icon":svgedit.browser.isTouch()?24:24,".palette_item:first .svg_icon":svgedit.browser.isTouch()?30:16,"#zoomLabel .svg_icon":16,"#zoom_dropdown .svg_icon":7},
|
||||
callback:function(){a(".toolbar_button button > svg, .toolbar_button button > img").each(function(){a(this).parent().prepend(this)});a(".tool_button, .tool_button_current").addClass("loaded");var k=a("#tools_left");if(k.length!=0){k.offset();k.outerHeight()}a(".tools_flyout").each(function(){var u=a("#"+this.id+"_show"),C=u.attr("data-curopt");if(!u.children("svg, img").length){C=a(C).children().clone();if(C.length){C[0].removeAttribute("style");u.append(C)}}});svgEditor.runCallbacks();setTimeout(function(){a(".flyout_arrow_horiz:empty").each(function(){a(this).append(a.getSvgIcon("arrow_right").width(5).height(5))})},
|
||||
1)}});a("#rulers").on("dblclick",function(k){a("#base_unit_container").css({top:k.pageY-10,left:k.pageX-50,display:"block"})});a("#base_unit_container").on("mouseleave mouseenter",function(){t=setTimeout(function(){a("#base_unit_container").fadeOut(500)},200);event.type=="mouseover"&&clearTimeout(t)});a("#base_unit").on("change",function(){savePreferences()});c.canvas=g=new a.SvgCanvas(document.getElementById("svgcanvas"),curConfig);c.show_save_warning=false;c.paintBox={fill:null,stroke:null,canvas:null};
|
||||
q=navigator.platform.indexOf("Mac")>=0;var B=navigator.userAgent.indexOf("AppleWebKit")>=0,o=q?"meta+":"ctrl+",K=g.pathActions,T=g.undoMgr,M=svgedit.utilities,J=curConfig.imgPath+"placeholder.svg",Q=a("#workarea"),Y=a("#cmenu_canvas"),O=null,ia=1,pa="toolbars",fa="";q||a(".shortcut").each(function(){var k=a(this).text();a(this).text(k.split("\u2318").join("Ctrl+"))});(function(){a("#dialog_container").draggable({cancel:"#dialog_content, #dialog_buttons *",containment:"window"});var k=a("#dialog_box"),
|
||||
u=a("#dialog_buttons"),C=function(E,P,U,S){a("#dialog_content").html("<p>"+P.replace(/\n/g,"</p><p>")+"</p>").toggleClass("prompt",E=="prompt");u.empty();var X=a('<input type="button" value="'+uiStrings.common.ok+'">').appendTo(u);E!="alert"&&a('<input type="button" value="'+uiStrings.common.cancel+'">').appendTo(u).on("click, touchstart",function(){k.hide();U(false)});if(E=="prompt"){var aa=a('<input type="text">').prependTo(u);aa.val(S||"");aa.bind("keydown","return",function(){X.trigger("click touchstart")})}E==
|
||||
"process"&&X.hide();k.show();X.on("click touchstart",function(){k.hide();var ga=E=="prompt"?aa.val():true;U&&U(ga)}).focus();E=="prompt"&&aa.focus()};a.alert=function(E,P){C("alert",E,P)};a.confirm=function(E,P){C("confirm",E,P)};a.process_cancel=function(E,P){C("process",E,P)};a.prompt=function(E,P,U){C("prompt",E,U,P)}})();var ba=function(){var k=a(".tool_button_current");if(k.length&&k[0].id!=="tool_select"){k.removeClass("tool_button_current").addClass("tool_button");a("#tool_select").addClass("tool_button_current").removeClass("tool_button")}g.setMode("select")},
|
||||
W=null,sa=false,ka=false,da="",V=function(k,u){var C=g.getResolution();a("#svgcanvas").position();var E=g.setBBoxZoom(u,Q.width()-15,Q.height()-15);if(E){var P=E.zoom;E=E.bbox;if(P<0.0010)wa({value:0.1});else{var U=Date.now(),S=P-C.zoom;a("#zoom");var X=C.zoom,aa=function(ga){ga=(ga-U)/500;ga=Math.pow(ga-1,3)+1;g.setZoom(X+S*ga);F();ga<1?requestAnimationFrame(aa):a("#zoom").val(P*100)};aa(Date.now());g.getMode()=="zoom"&&E.width&&ba();lb()}}};a("#cur_context_panel").delegate("a","click",function(){var k=
|
||||
a(this);k.attr("data-root")?g.leaveContext():g.setContext(k.text());return false});var Z=function(){c.paintBox.fill.prep();c.paintBox.stroke.prep()},oa={},qa=function(k){a.each(k,function(u,C){var E=a(u).children(),P=u+"_show",U=a(P),S=false;E.addClass("tool_button").unbind("click mousedown mouseup").each(function(ga){var ra=C[ga];oa[ra.sel]=ra.fn;if(ra.isDefault)S=ga;ga=function(Ta){var Ba=ra;if(Ta.type==="keydown"){var ha=a(Ba.parent+"_show").hasClass("tool_button_current"),Sa=a(Ba.parent+"_show").attr("data-curopt");
|
||||
a.each(k[ra.parent],function(ua,Ma){if(Ma.sel==Sa)Ba=!Ta.shiftKey||!ha?Ma:k[ra.parent][ua+1]||k[ra.parent][0]})}if(a(this).hasClass("disabled"))return false;$a(P)&&Ba.fn();var Qa=Ba.icon?a.getSvgIcon(Ba.icon,true):a(Ba.sel).children().eq(0).clone();Qa[0].setAttribute("width",U.width());Qa[0].setAttribute("height",U.height());U.children(":not(.flyout_arrow_horiz)").remove();U.append(Qa).attr("data-curopt",Ba.sel)};a(this).mouseup(ga);ra.key&&a(document).bind("keydown",ra.key[0]+" shift+"+ra.key[0],
|
||||
|
@ -671,10 +671,10 @@ heart:"m150,73c61,-175 300,0 0,225c-300,-225 -61,-400 0,-225z",cylinder:"m299.00
|
|||
arrow_u_turn:"m1.00059,299.00055l0,-167.62497l0,0c0,-72.00411 58.37087,-130.37499 130.375,-130.37499l0,0l0,0c34.57759,0 67.73898,13.7359 92.18906,38.18595c24.45006,24.45005 38.18593,57.61144 38.18593,92.18904l0,18.625l37.24997,0l-74.49995,74.50002l-74.50002,-74.50002l37.25,0l0,-18.625c0,-30.8589 -25.0161,-55.87498 -55.87498,-55.87498l0,0l0,0c-30.85892,0 -55.875,25.01608 -55.875,55.87498l0,167.62497z",arrow_left_up:"m0.99865,224.5l74.50004,-74.5l0,37.25l111.74991,0l0,-111.75l-37.25,0l74.5,-74.5l74.5,74.5l-37.25,0l0,186.25l-186.24989,0l0,37.25l-74.50005,-74.5z",
|
||||
plaque:"m-0.00197,49.94376l0,0c27.5829,0 49.94327,-22.36036 49.94327,-49.94327l199.76709,0l0,0c0,27.5829 22.36037,49.94327 49.94325,49.94327l0,199.7671l0,0c-27.58289,0 -49.94325,22.36034 -49.94325,49.94325l-199.76709,0c0,-27.58292 -22.36037,-49.94325 -49.94327,-49.94325z",page:"m249.3298,298.99744l9.9335,-39.73413l39.73413,-9.93355l-49.66763,49.66768l-248.33237,0l0,-298.00001l298.00001,0l0,248.33234",cross:"m0.99844,99.71339l98.71494,0l0,-98.71495l101.26279,0l0,98.71495l98.71495,0l0,101.2628l-98.71495,0l0,98.71494l-101.26279,0l0,-98.71494l-98.71494,0z",
|
||||
divide:"m150,0.99785l0,0c25.17819,0 45.58916,20.41097 45.58916,45.58916c0,25.17821 -20.41096,45.58916 -45.58916,45.58916c-25.17822,0 -45.58916,-20.41093 -45.58916,-45.58916c0,-25.1782 20.41093,-45.58916 45.58916,-45.58916zm0,296.25203c-25.17822,0 -45.58916,-20.41095 -45.58916,-45.58917c0,-25.17819 20.41093,-45.58916 45.58916,-45.58916c25.17819,0 45.58916,20.41096 45.58916,45.58916c0,25.17822 -20.41096,45.58917 -45.58916,45.58917zm-134.06754,-193.71518l268.13507,0l0,91.17833l-268.13507,0z",minus:"m0.99887,102.39503l297.49445,0l0,95.2112l-297.49445,0z",
|
||||
times:"m1.00089,73.36786l72.36697,-72.36697l76.87431,76.87368l76.87431,-76.87368l72.36765,72.36697l-76.87433,76.87431l76.87433,76.87431l-72.36765,72.36765l-76.87431,-76.87433l-76.87431,76.87433l-72.36697,-72.36765l76.87368,-76.87431l-76.87368,-76.87431z"},buttons:[]}},K=o.basic,T="shapelib";return{svgicons:"extensions/ext-shapes.xml",buttons:[{id:"tool_shapelib",type:"mode_flyout",position:6,title:"Shape library",events:{click:function(){s.setMode(T)}}}],callback:function(){var M=$('<div id="shape_buttons">');
|
||||
$("#tools_shapelib > *").wrapAll(M);var J=$("#tools_shapelib_show");p("basic");$("#shape_buttons").mouseup(function(Y){Y=$(Y.target).closest("div.tool_button");if(Y.length){var O=Y.children().clone().attr({width:24,height:24});J.children(":not(.flyout_arrow_horiz)").remove();J.append(O).attr("data-curopt","#"+Y[0].id).mouseup();s.setMode(T);n=Y[0].id.substr((T+"_").length);c=K.data[n];$(".tools_flyout").fadeOut()}});M=$('<div id="shape_cats">');var Q="";$.each(B,function(Y,O){Q+="<div data-cat="+
|
||||
Y+">"+O+"</div>"});M.html(Q).children().bind("mouseup",function(){var Y=$(this);Y.siblings().removeClass("current");Y.addClass("current");p(Y.attr("data-cat"));return false});M.children().eq(0).addClass("current");$("#tools_shapelib").prepend(M);J.mouseup(function(){s.setMode(c?T:"select")});$("#tool_shapelib").remove();M=$("#tools_shapelib").height();$("#tools_shapelib").css({"margin-top":-(M/2),"margin-left":3})},mouseDown:function(M){if(s.getMode()===T){var J=f=M.start_x;M=d=M.start_y;var Q=s.getStyle();
|
||||
b=s.addSvgElementFromJson({element:"path",curStyles:true,attr:{d:c,id:s.getNextId(),opacity:Q.opacity/2,style:"pointer-events:none"}});b.setAttribute("d",c);if(/[a-z]/.test(c)){c=K.data[n]=s.pathActions.convertPath(b);b.setAttribute("d",c);s.pathActions.fixEnd(b)}b.setAttribute("transform","translate("+J+","+M+") scale(0.005) translate("+-J+","+-M+")");s.recalculateDimensions(b);s.getTransformList(b);q=b.getBBox();totalScale={sx:1,sy:1};return{started:true}}},mouseMove:function(M){if(s.getMode()===
|
||||
times:"m1.00089,73.36786l72.36697,-72.36697l76.87431,76.87368l76.87431,-76.87368l72.36765,72.36697l-76.87433,76.87431l76.87433,76.87431l-72.36765,72.36765l-76.87431,-76.87433l-76.87431,76.87433l-72.36697,-72.36765l76.87368,-76.87431l-76.87368,-76.87431z"},buttons:[]}},K=o.basic,T="shapelib";return{svgicons:"extensions/ext-shapes.xml",buttons:[{id:"tool_shapelib",type:"mode_flyout",position:6,title:"Shape library",fallback:"extensions/ext-shapes.png",events:{click:function(){s.setMode(T)}}}],callback:function(){var M=
|
||||
$('<div id="shape_buttons">');$("#tools_shapelib > *").wrapAll(M);var J=$("#tools_shapelib_show");p("basic");$("#shape_buttons").mouseup(function(Y){Y=$(Y.target).closest("div.tool_button");if(Y.length){var O=Y.children().clone().attr({width:24,height:24});J.children(":not(.flyout_arrow_horiz)").remove();J.append(O).attr("data-curopt","#"+Y[0].id).mouseup();s.setMode(T);n=Y[0].id.substr((T+"_").length);c=K.data[n];$(".tools_flyout").fadeOut()}});M=$('<div id="shape_cats">');var Q="";$.each(B,function(Y,
|
||||
O){Q+="<div data-cat="+Y+">"+O+"</div>"});M.html(Q).children().bind("mouseup",function(){var Y=$(this);Y.siblings().removeClass("current");Y.addClass("current");p(Y.attr("data-cat"));return false});M.children().eq(0).addClass("current");$("#tools_shapelib").prepend(M);J.mouseup(function(){s.setMode(c?T:"select")});$("#tool_shapelib").remove();M=$("#tools_shapelib").height();$("#tools_shapelib").css({"margin-top":-(M/2),"margin-left":3})},mouseDown:function(M){if(s.getMode()===T){var J=f=M.start_x;
|
||||
M=d=M.start_y;var Q=s.getStyle();b=s.addSvgElementFromJson({element:"path",curStyles:true,attr:{d:c,id:s.getNextId(),opacity:Q.opacity/2,style:"pointer-events:none"}});b.setAttribute("d",c);if(/[a-z]/.test(c)){c=K.data[n]=s.pathActions.convertPath(b);b.setAttribute("d",c);s.pathActions.fixEnd(b)}b.setAttribute("transform","translate("+J+","+M+") scale(0.005) translate("+-J+","+-M+")");s.recalculateDimensions(b);s.getTransformList(b);q=b.getBBox();totalScale={sx:1,sy:1};return{started:true}}},mouseMove:function(M){if(s.getMode()===
|
||||
T){var J=s.getZoom(),Q=M.event,Y=M.mouse_x/J,O=M.mouse_y/J;M=s.getTransformList(b);var ia=b.getBBox();J=ia.x;var pa=ia.y,fa=ia.width,ba=ia.height,W=Y-f,sa=O-d,ka={x:Math.min(f,Y),y:Math.min(d,O),width:Math.abs(Y-f),height:Math.abs(O-d)},da=ia=0;ba=ba?(ba+sa)/ba:1;fa=fa?(fa+W)/fa:1;fa=ka.width/q.width;ba=ka.height/q.height;fa=fa||1;ba=ba||1;if(Y<f)ia=q.width;if(O<d)da=q.height;Y=l.createSVGTransform();O=l.createSVGTransform();ka=l.createSVGTransform();Y.setTranslate(-(J+ia),-(pa+da));if(Q.shiftKey){replaced=
|
||||
true;Q=Math.min(Math.abs(fa),Math.abs(ba));fa=Q*(fa<0?-1:1);ba=Q*(ba<0?-1:1);if(totalScale.sx!=totalScale.sy){Q=totalScale.sx>totalScale.sy?1:totalScale.sx/totalScale.sy;fa*=totalScale.sy>totalScale.sx?1:totalScale.sy/totalScale.sx;ba*=Q}}totalScale.sx*=fa;totalScale.sy*=ba;O.setScale(fa,ba);ka.setTranslate(J+ia,pa+da);M.appendItem(ka);M.appendItem(O);M.appendItem(Y);s.recalculateDimensions(b);q=b.getBBox()}},mouseUp:function(M){if(s.getMode()===T){if(M.mouse_x==f&&M.mouse_y==d)return{keep:false,
|
||||
element:b,started:false};s.setMode("select");return{keep:true,element:b,started:false}}}}});(function(){for(var a=0,p=["ms","moz","webkit","o"],g=0;g<p.length&&!window.requestAnimationFrame;++g){window.requestAnimationFrame=window[p[g]+"RequestAnimationFrame"];window.cancelAnimationFrame=window[p[g]+"CancelAnimationFrame"]||window[p[g]+"CancelRequestAnimationFrame"]}if(!window.requestAnimationFrame)window.requestAnimationFrame=function(c){var n=(new Date).getTime(),s=Math.max(0,16-(n-a)),b=window.setTimeout(function(){c(n+s)},s);a=n+s;return b};if(!window.cancelAnimationFrame)window.cancelAnimationFrame=
|
||||
|
|
|
@ -155,6 +155,7 @@ svgEditor.addExtension("shapes", function() {
|
|||
type: "mode_flyout", // _flyout
|
||||
position: 6,
|
||||
title: "Shape library",
|
||||
fallback: "extensions/ext-shapes.png",
|
||||
events: {
|
||||
"click": function() {
|
||||
canv.setMode(mode_id);
|
||||
|
|
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 382 B |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 552 B |
After Width: | Height: | Size: 134 B |
After Width: | Height: | Size: 139 B |
After Width: | Height: | Size: 93 B |
After Width: | Height: | Size: 252 B |
After Width: | Height: | Size: 255 B |
After Width: | Height: | Size: 146 B |
After Width: | Height: | Size: 135 B |
After Width: | Height: | Size: 76 B |
After Width: | Height: | Size: 140 B |
|
@ -224,10 +224,10 @@
|
|||
'logo':'logo.png',
|
||||
'select':'select.png',
|
||||
'select_node':'select_node.png',
|
||||
'pencil':'fhpath.png',
|
||||
'pencil':'pencil.png',
|
||||
'pen':'line.png',
|
||||
'square':'square.png',
|
||||
'rect':'rect.png',
|
||||
'rect':'square.png',
|
||||
'fh_rect':'freehand-square.png',
|
||||
'circle':'circle.png',
|
||||
'ellipse':'ellipse.png',
|
||||
|
@ -237,6 +237,7 @@
|
|||
'image':'image.png',
|
||||
'zoom':'zoom.png',
|
||||
'delete':'delete.png',
|
||||
'spapelib':'shapelib.png',
|
||||
'node_delete':'node_delete.png',
|
||||
'align_left':'align-left.png',
|
||||
'align_center':'align-center',
|
||||
|
|
|
@ -385,15 +385,15 @@ Qa[xa]=ab.getContext("2d")}ab[ra]=ga%3E4;ga=3E4}Ba[ra]=ga;ra=S*u;var Wa=50/ra;Ba
|
|||
xa/1E3+"K";if(aa){ua.fillText(xa,cb+2,8);ua.fillStyle="#777"}else{Ma=(xa+"").split("");for(xa=0;xa<Ma.length;xa++){ua.fillText(Ma[xa],1,cb+9+xa*9);ua.fillStyle="#777"}}Ma=Wa/10;for(xa=1;xa<10;xa++){var yb=Math.round(cb+Ma*xa)+0.5;if(Qa&&yb>ga){Sa++;ua.stroke();if(Sa>=Qa.length){xa=10;cb=ha;continue}ua=Qa[Sa];cb-=3E4;yb=Math.round(cb+Ma*xa)+0.5}var Gb=xa%2?12:10;if(aa){ua.moveTo(yb,15);ua.lineTo(yb,Gb)}else{ua.moveTo(15,yb);ua.lineTo(Gb,yb)}}}ua.strokeStyle="#666";ua.stroke()}}(function(){var k=window.opener;
|
||||
if(k)try{var u=k.document.createEvent("Event");u.initEvent("svgEditorReady",true,true);k.document.documentElement.dispatchEvent(u)}catch(C){}})();(function(){a("#canvas_width").val(curConfig.dimensions[0]);a("#canvas_height").val(curConfig.dimensions[1]);a("body").toggleClass("touch",svgedit.browser.isTouch());var k=a.deparam.querystring(true);if(!a.isEmptyObject(k)){if(k.dimensions)k.dimensions=k.dimensions.split(",");if(k.extensions)k.extensions=k.extensions.split(",");if(k.bkgd_color)k.bkgd_color=
|
||||
"#"+k.bkgd_color;svgEditor.setConfig(k);var u=k.source,C=a.param.querystring();if(!u)if(C.indexOf("source=data:")>=0)u=C.match(/source=(data:[^&]*)/)[1];if(u)if(u.indexOf("data:")===0){u=u.replace(/ /g,"+");c.loadFromDataURI(u)}else c.loadFromString(u);else if(C.indexOf("paramurl=")!==-1)svgEditor.loadFromURL(C.substr(9));else k.url&&svgEditor.loadFromURL(k.url)}})();var q=function(){a.each(curConfig.extensions,function(){var k=this;a.getScript(curConfig.extPath+k,function(u){if(!u){u=document.createElement("script");
|
||||
u.src=curConfig.extPath+k;document.querySelector("head").appendChild(u)}})})};document.location.protocol==="file:"?setTimeout(q,100):q();a.svgIcons(curConfig.imgPath+"svg_edit_icons.svg",{w:27,h:27,id_match:false,no_img:!svgedit.browser.isWebkit(),fallback_path:curConfig.imgPath,fallback:{logo:"logo.png",select:"select.png",select_node:"select_node.png",pencil:"fhpath.png",pen:"line.png",square:"square.png",rect:"rect.png",fh_rect:"freehand-square.png",circle:"circle.png",ellipse:"ellipse.png",fh_ellipse:"freehand-circle.png",
|
||||
path:"path.png",text:"text.png",image:"image.png",zoom:"zoom.png","delete":"delete.png",node_delete:"node_delete.png",align_left:"align-left.png",align_center:"align-center",align_right:"align-right",align_top:"align-top",align_middle:"align-middle",align_bottom:"align-bottom",arrow_right:"flyouth.png",arrow_down:"dropdown.gif"},placement:{"#logo":"logo","#tool_select":"select","#tool_fhpath":"pencil","#tool_line":"pen","#tool_rect,#tools_rect_show":"rect","#tool_square":"square","#tool_fhrect":"fh_rect",
|
||||
"#tool_ellipse,#tools_ellipse_show":"ellipse","#tool_circle":"circle","#tool_fhellipse":"fh_ellipse","#tool_path":"path","#tool_text,#layer_rename":"text","#tool_image":"image","#tool_zoom":"zoom","#tool_node_clone":"node_clone","#tool_node_delete":"node_delete","#tool_add_subpath":"add_subpath","#tool_openclose_path":"open_path","#tool_alignleft, #tool_posleft":"align_left","#tool_aligncenter, #tool_poscenter":"align_center","#tool_alignright, #tool_posright":"align_right","#tool_aligntop, #tool_postop":"align_top",
|
||||
"#tool_alignmiddle, #tool_posmiddle":"align_middle","#tool_alignbottom, #tool_posbottom":"align_bottom","#cur_position":"align","#zoomLabel":"zoom","#palette .palette_item:first, #fill_bg, #stroke_bg":"no_color"},resize:{"#logo .svg_icon":15,".flyout_arrow_horiz .svg_icon":5,"#fill_bg .svg_icon, #stroke_bg .svg_icon":svgedit.browser.isTouch()?24:24,".palette_item:first .svg_icon":svgedit.browser.isTouch()?30:16,"#zoomLabel .svg_icon":16,"#zoom_dropdown .svg_icon":7},callback:function(){a(".toolbar_button button > svg, .toolbar_button button > img").each(function(){a(this).parent().prepend(this)});
|
||||
a(".tool_button, .tool_button_current").addClass("loaded");var k=a("#tools_left");if(k.length!=0){k.offset();k.outerHeight()}a(".tools_flyout").each(function(){var u=a("#"+this.id+"_show"),C=u.attr("data-curopt");if(!u.children("svg, img").length){C=a(C).children().clone();if(C.length){C[0].removeAttribute("style");u.append(C)}}});svgEditor.runCallbacks();setTimeout(function(){a(".flyout_arrow_horiz:empty").each(function(){a(this).append(a.getSvgIcon("arrow_right").width(5).height(5))})},1)}});a("#rulers").on("dblclick",
|
||||
function(k){a("#base_unit_container").css({top:k.pageY-10,left:k.pageX-50,display:"block"})});a("#base_unit_container").on("mouseleave mouseenter",function(){t=setTimeout(function(){a("#base_unit_container").fadeOut(500)},200);event.type=="mouseover"&&clearTimeout(t)});a("#base_unit").on("change",function(){savePreferences()});c.canvas=g=new a.SvgCanvas(document.getElementById("svgcanvas"),curConfig);c.show_save_warning=false;c.paintBox={fill:null,stroke:null,canvas:null};q=navigator.platform.indexOf("Mac")>=
|
||||
0;var B=navigator.userAgent.indexOf("AppleWebKit")>=0,o=q?"meta+":"ctrl+",K=g.pathActions,T=g.undoMgr,M=svgedit.utilities,J=curConfig.imgPath+"placeholder.svg",Q=a("#workarea"),Y=a("#cmenu_canvas"),O=null,ia=1,pa="toolbars",fa="";q||a(".shortcut").each(function(){var k=a(this).text();a(this).text(k.split("\u2318").join("Ctrl+"))});(function(){a("#dialog_container").draggable({cancel:"#dialog_content, #dialog_buttons *",containment:"window"});var k=a("#dialog_box"),u=a("#dialog_buttons"),C=function(E,
|
||||
P,U,S){a("#dialog_content").html("<p>"+P.replace(/\n/g,"</p><p>")+"</p>").toggleClass("prompt",E=="prompt");u.empty();var X=a('<input type="button" value="'+uiStrings.common.ok+'">').appendTo(u);E!="alert"&&a('<input type="button" value="'+uiStrings.common.cancel+'">').appendTo(u).on("click, touchstart",function(){k.hide();U(false)});if(E=="prompt"){var aa=a('<input type="text">').prependTo(u);aa.val(S||"");aa.bind("keydown","return",function(){X.trigger("click touchstart")})}E=="process"&&X.hide();
|
||||
k.show();X.on("click touchstart",function(){k.hide();var ga=E=="prompt"?aa.val():true;U&&U(ga)}).focus();E=="prompt"&&aa.focus()};a.alert=function(E,P){C("alert",E,P)};a.confirm=function(E,P){C("confirm",E,P)};a.process_cancel=function(E,P){C("process",E,P)};a.prompt=function(E,P,U){C("prompt",E,U,P)}})();var ba=function(){var k=a(".tool_button_current");if(k.length&&k[0].id!=="tool_select"){k.removeClass("tool_button_current").addClass("tool_button");a("#tool_select").addClass("tool_button_current").removeClass("tool_button")}g.setMode("select")},
|
||||
u.src=curConfig.extPath+k;document.querySelector("head").appendChild(u)}})})};document.location.protocol==="file:"?setTimeout(q,100):q();a.svgIcons(curConfig.imgPath+"svg_edit_icons.svg",{w:27,h:27,id_match:false,no_img:!svgedit.browser.isWebkit(),fallback_path:curConfig.imgPath,fallback:{logo:"logo.png",select:"select.png",select_node:"select_node.png",pencil:"pencil.png",pen:"line.png",square:"square.png",rect:"square.png",fh_rect:"freehand-square.png",circle:"circle.png",ellipse:"ellipse.png",
|
||||
fh_ellipse:"freehand-circle.png",path:"path.png",text:"text.png",image:"image.png",zoom:"zoom.png","delete":"delete.png",spapelib:"shapelib.png",node_delete:"node_delete.png",align_left:"align-left.png",align_center:"align-center",align_right:"align-right",align_top:"align-top",align_middle:"align-middle",align_bottom:"align-bottom",arrow_right:"flyouth.png",arrow_down:"dropdown.gif"},placement:{"#logo":"logo","#tool_select":"select","#tool_fhpath":"pencil","#tool_line":"pen","#tool_rect,#tools_rect_show":"rect",
|
||||
"#tool_square":"square","#tool_fhrect":"fh_rect","#tool_ellipse,#tools_ellipse_show":"ellipse","#tool_circle":"circle","#tool_fhellipse":"fh_ellipse","#tool_path":"path","#tool_text,#layer_rename":"text","#tool_image":"image","#tool_zoom":"zoom","#tool_node_clone":"node_clone","#tool_node_delete":"node_delete","#tool_add_subpath":"add_subpath","#tool_openclose_path":"open_path","#tool_alignleft, #tool_posleft":"align_left","#tool_aligncenter, #tool_poscenter":"align_center","#tool_alignright, #tool_posright":"align_right",
|
||||
"#tool_aligntop, #tool_postop":"align_top","#tool_alignmiddle, #tool_posmiddle":"align_middle","#tool_alignbottom, #tool_posbottom":"align_bottom","#cur_position":"align","#zoomLabel":"zoom","#palette .palette_item:first, #fill_bg, #stroke_bg":"no_color"},resize:{"#logo .svg_icon":15,".flyout_arrow_horiz .svg_icon":5,"#fill_bg .svg_icon, #stroke_bg .svg_icon":svgedit.browser.isTouch()?24:24,".palette_item:first .svg_icon":svgedit.browser.isTouch()?30:16,"#zoomLabel .svg_icon":16,"#zoom_dropdown .svg_icon":7},
|
||||
callback:function(){a(".toolbar_button button > svg, .toolbar_button button > img").each(function(){a(this).parent().prepend(this)});a(".tool_button, .tool_button_current").addClass("loaded");var k=a("#tools_left");if(k.length!=0){k.offset();k.outerHeight()}a(".tools_flyout").each(function(){var u=a("#"+this.id+"_show"),C=u.attr("data-curopt");if(!u.children("svg, img").length){C=a(C).children().clone();if(C.length){C[0].removeAttribute("style");u.append(C)}}});svgEditor.runCallbacks();setTimeout(function(){a(".flyout_arrow_horiz:empty").each(function(){a(this).append(a.getSvgIcon("arrow_right").width(5).height(5))})},
|
||||
1)}});a("#rulers").on("dblclick",function(k){a("#base_unit_container").css({top:k.pageY-10,left:k.pageX-50,display:"block"})});a("#base_unit_container").on("mouseleave mouseenter",function(){t=setTimeout(function(){a("#base_unit_container").fadeOut(500)},200);event.type=="mouseover"&&clearTimeout(t)});a("#base_unit").on("change",function(){savePreferences()});c.canvas=g=new a.SvgCanvas(document.getElementById("svgcanvas"),curConfig);c.show_save_warning=false;c.paintBox={fill:null,stroke:null,canvas:null};
|
||||
q=navigator.platform.indexOf("Mac")>=0;var B=navigator.userAgent.indexOf("AppleWebKit")>=0,o=q?"meta+":"ctrl+",K=g.pathActions,T=g.undoMgr,M=svgedit.utilities,J=curConfig.imgPath+"placeholder.svg",Q=a("#workarea"),Y=a("#cmenu_canvas"),O=null,ia=1,pa="toolbars",fa="";q||a(".shortcut").each(function(){var k=a(this).text();a(this).text(k.split("\u2318").join("Ctrl+"))});(function(){a("#dialog_container").draggable({cancel:"#dialog_content, #dialog_buttons *",containment:"window"});var k=a("#dialog_box"),
|
||||
u=a("#dialog_buttons"),C=function(E,P,U,S){a("#dialog_content").html("<p>"+P.replace(/\n/g,"</p><p>")+"</p>").toggleClass("prompt",E=="prompt");u.empty();var X=a('<input type="button" value="'+uiStrings.common.ok+'">').appendTo(u);E!="alert"&&a('<input type="button" value="'+uiStrings.common.cancel+'">').appendTo(u).on("click, touchstart",function(){k.hide();U(false)});if(E=="prompt"){var aa=a('<input type="text">').prependTo(u);aa.val(S||"");aa.bind("keydown","return",function(){X.trigger("click touchstart")})}E==
|
||||
"process"&&X.hide();k.show();X.on("click touchstart",function(){k.hide();var ga=E=="prompt"?aa.val():true;U&&U(ga)}).focus();E=="prompt"&&aa.focus()};a.alert=function(E,P){C("alert",E,P)};a.confirm=function(E,P){C("confirm",E,P)};a.process_cancel=function(E,P){C("process",E,P)};a.prompt=function(E,P,U){C("prompt",E,U,P)}})();var ba=function(){var k=a(".tool_button_current");if(k.length&&k[0].id!=="tool_select"){k.removeClass("tool_button_current").addClass("tool_button");a("#tool_select").addClass("tool_button_current").removeClass("tool_button")}g.setMode("select")},
|
||||
W=null,sa=false,ka=false,da="",V=function(k,u){var C=g.getResolution();a("#svgcanvas").position();var E=g.setBBoxZoom(u,Q.width()-15,Q.height()-15);if(E){var P=E.zoom;E=E.bbox;if(P<0.0010)wa({value:0.1});else{var U=Date.now(),S=P-C.zoom;a("#zoom");var X=C.zoom,aa=function(ga){ga=(ga-U)/500;ga=Math.pow(ga-1,3)+1;g.setZoom(X+S*ga);F();ga<1?requestAnimationFrame(aa):a("#zoom").val(P*100)};aa(Date.now());g.getMode()=="zoom"&&E.width&&ba();lb()}}};a("#cur_context_panel").delegate("a","click",function(){var k=
|
||||
a(this);k.attr("data-root")?g.leaveContext():g.setContext(k.text());return false});var Z=function(){c.paintBox.fill.prep();c.paintBox.stroke.prep()},oa={},qa=function(k){a.each(k,function(u,C){var E=a(u).children(),P=u+"_show",U=a(P),S=false;E.addClass("tool_button").unbind("click mousedown mouseup").each(function(ga){var ra=C[ga];oa[ra.sel]=ra.fn;if(ra.isDefault)S=ga;ga=function(Ta){var Ba=ra;if(Ta.type==="keydown"){var ha=a(Ba.parent+"_show").hasClass("tool_button_current"),Sa=a(Ba.parent+"_show").attr("data-curopt");
|
||||
a.each(k[ra.parent],function(ua,Ma){if(Ma.sel==Sa)Ba=!Ta.shiftKey||!ha?Ma:k[ra.parent][ua+1]||k[ra.parent][0]})}if(a(this).hasClass("disabled"))return false;$a(P)&&Ba.fn();var Qa=Ba.icon?a.getSvgIcon(Ba.icon,true):a(Ba.sel).children().eq(0).clone();Qa[0].setAttribute("width",U.width());Qa[0].setAttribute("height",U.height());U.children(":not(.flyout_arrow_horiz)").remove();U.append(Qa).attr("data-curopt",Ba.sel)};a(this).mouseup(ga);ra.key&&a(document).bind("keydown",ra.key[0]+" shift+"+ra.key[0],
|
||||
|
@ -671,10 +671,10 @@ heart:"m150,73c61,-175 300,0 0,225c-300,-225 -61,-400 0,-225z",cylinder:"m299.00
|
|||
arrow_u_turn:"m1.00059,299.00055l0,-167.62497l0,0c0,-72.00411 58.37087,-130.37499 130.375,-130.37499l0,0l0,0c34.57759,0 67.73898,13.7359 92.18906,38.18595c24.45006,24.45005 38.18593,57.61144 38.18593,92.18904l0,18.625l37.24997,0l-74.49995,74.50002l-74.50002,-74.50002l37.25,0l0,-18.625c0,-30.8589 -25.0161,-55.87498 -55.87498,-55.87498l0,0l0,0c-30.85892,0 -55.875,25.01608 -55.875,55.87498l0,167.62497z",arrow_left_up:"m0.99865,224.5l74.50004,-74.5l0,37.25l111.74991,0l0,-111.75l-37.25,0l74.5,-74.5l74.5,74.5l-37.25,0l0,186.25l-186.24989,0l0,37.25l-74.50005,-74.5z",
|
||||
plaque:"m-0.00197,49.94376l0,0c27.5829,0 49.94327,-22.36036 49.94327,-49.94327l199.76709,0l0,0c0,27.5829 22.36037,49.94327 49.94325,49.94327l0,199.7671l0,0c-27.58289,0 -49.94325,22.36034 -49.94325,49.94325l-199.76709,0c0,-27.58292 -22.36037,-49.94325 -49.94327,-49.94325z",page:"m249.3298,298.99744l9.9335,-39.73413l39.73413,-9.93355l-49.66763,49.66768l-248.33237,0l0,-298.00001l298.00001,0l0,248.33234",cross:"m0.99844,99.71339l98.71494,0l0,-98.71495l101.26279,0l0,98.71495l98.71495,0l0,101.2628l-98.71495,0l0,98.71494l-101.26279,0l0,-98.71494l-98.71494,0z",
|
||||
divide:"m150,0.99785l0,0c25.17819,0 45.58916,20.41097 45.58916,45.58916c0,25.17821 -20.41096,45.58916 -45.58916,45.58916c-25.17822,0 -45.58916,-20.41093 -45.58916,-45.58916c0,-25.1782 20.41093,-45.58916 45.58916,-45.58916zm0,296.25203c-25.17822,0 -45.58916,-20.41095 -45.58916,-45.58917c0,-25.17819 20.41093,-45.58916 45.58916,-45.58916c25.17819,0 45.58916,20.41096 45.58916,45.58916c0,25.17822 -20.41096,45.58917 -45.58916,45.58917zm-134.06754,-193.71518l268.13507,0l0,91.17833l-268.13507,0z",minus:"m0.99887,102.39503l297.49445,0l0,95.2112l-297.49445,0z",
|
||||
times:"m1.00089,73.36786l72.36697,-72.36697l76.87431,76.87368l76.87431,-76.87368l72.36765,72.36697l-76.87433,76.87431l76.87433,76.87431l-72.36765,72.36765l-76.87431,-76.87433l-76.87431,76.87433l-72.36697,-72.36765l76.87368,-76.87431l-76.87368,-76.87431z"},buttons:[]}},K=o.basic,T="shapelib";return{svgicons:"extensions/ext-shapes.xml",buttons:[{id:"tool_shapelib",type:"mode_flyout",position:6,title:"Shape library",events:{click:function(){s.setMode(T)}}}],callback:function(){var M=$('<div id="shape_buttons">');
|
||||
$("#tools_shapelib > *").wrapAll(M);var J=$("#tools_shapelib_show");p("basic");$("#shape_buttons").mouseup(function(Y){Y=$(Y.target).closest("div.tool_button");if(Y.length){var O=Y.children().clone().attr({width:24,height:24});J.children(":not(.flyout_arrow_horiz)").remove();J.append(O).attr("data-curopt","#"+Y[0].id).mouseup();s.setMode(T);n=Y[0].id.substr((T+"_").length);c=K.data[n];$(".tools_flyout").fadeOut()}});M=$('<div id="shape_cats">');var Q="";$.each(B,function(Y,O){Q+="<div data-cat="+
|
||||
Y+">"+O+"</div>"});M.html(Q).children().bind("mouseup",function(){var Y=$(this);Y.siblings().removeClass("current");Y.addClass("current");p(Y.attr("data-cat"));return false});M.children().eq(0).addClass("current");$("#tools_shapelib").prepend(M);J.mouseup(function(){s.setMode(c?T:"select")});$("#tool_shapelib").remove();M=$("#tools_shapelib").height();$("#tools_shapelib").css({"margin-top":-(M/2),"margin-left":3})},mouseDown:function(M){if(s.getMode()===T){var J=f=M.start_x;M=d=M.start_y;var Q=s.getStyle();
|
||||
b=s.addSvgElementFromJson({element:"path",curStyles:true,attr:{d:c,id:s.getNextId(),opacity:Q.opacity/2,style:"pointer-events:none"}});b.setAttribute("d",c);if(/[a-z]/.test(c)){c=K.data[n]=s.pathActions.convertPath(b);b.setAttribute("d",c);s.pathActions.fixEnd(b)}b.setAttribute("transform","translate("+J+","+M+") scale(0.005) translate("+-J+","+-M+")");s.recalculateDimensions(b);s.getTransformList(b);q=b.getBBox();totalScale={sx:1,sy:1};return{started:true}}},mouseMove:function(M){if(s.getMode()===
|
||||
times:"m1.00089,73.36786l72.36697,-72.36697l76.87431,76.87368l76.87431,-76.87368l72.36765,72.36697l-76.87433,76.87431l76.87433,76.87431l-72.36765,72.36765l-76.87431,-76.87433l-76.87431,76.87433l-72.36697,-72.36765l76.87368,-76.87431l-76.87368,-76.87431z"},buttons:[]}},K=o.basic,T="shapelib";return{svgicons:"extensions/ext-shapes.xml",buttons:[{id:"tool_shapelib",type:"mode_flyout",position:6,title:"Shape library",fallback:"extensions/ext-shapes.png",events:{click:function(){s.setMode(T)}}}],callback:function(){var M=
|
||||
$('<div id="shape_buttons">');$("#tools_shapelib > *").wrapAll(M);var J=$("#tools_shapelib_show");p("basic");$("#shape_buttons").mouseup(function(Y){Y=$(Y.target).closest("div.tool_button");if(Y.length){var O=Y.children().clone().attr({width:24,height:24});J.children(":not(.flyout_arrow_horiz)").remove();J.append(O).attr("data-curopt","#"+Y[0].id).mouseup();s.setMode(T);n=Y[0].id.substr((T+"_").length);c=K.data[n];$(".tools_flyout").fadeOut()}});M=$('<div id="shape_cats">');var Q="";$.each(B,function(Y,
|
||||
O){Q+="<div data-cat="+Y+">"+O+"</div>"});M.html(Q).children().bind("mouseup",function(){var Y=$(this);Y.siblings().removeClass("current");Y.addClass("current");p(Y.attr("data-cat"));return false});M.children().eq(0).addClass("current");$("#tools_shapelib").prepend(M);J.mouseup(function(){s.setMode(c?T:"select")});$("#tool_shapelib").remove();M=$("#tools_shapelib").height();$("#tools_shapelib").css({"margin-top":-(M/2),"margin-left":3})},mouseDown:function(M){if(s.getMode()===T){var J=f=M.start_x;
|
||||
M=d=M.start_y;var Q=s.getStyle();b=s.addSvgElementFromJson({element:"path",curStyles:true,attr:{d:c,id:s.getNextId(),opacity:Q.opacity/2,style:"pointer-events:none"}});b.setAttribute("d",c);if(/[a-z]/.test(c)){c=K.data[n]=s.pathActions.convertPath(b);b.setAttribute("d",c);s.pathActions.fixEnd(b)}b.setAttribute("transform","translate("+J+","+M+") scale(0.005) translate("+-J+","+-M+")");s.recalculateDimensions(b);s.getTransformList(b);q=b.getBBox();totalScale={sx:1,sy:1};return{started:true}}},mouseMove:function(M){if(s.getMode()===
|
||||
T){var J=s.getZoom(),Q=M.event,Y=M.mouse_x/J,O=M.mouse_y/J;M=s.getTransformList(b);var ia=b.getBBox();J=ia.x;var pa=ia.y,fa=ia.width,ba=ia.height,W=Y-f,sa=O-d,ka={x:Math.min(f,Y),y:Math.min(d,O),width:Math.abs(Y-f),height:Math.abs(O-d)},da=ia=0;ba=ba?(ba+sa)/ba:1;fa=fa?(fa+W)/fa:1;fa=ka.width/q.width;ba=ka.height/q.height;fa=fa||1;ba=ba||1;if(Y<f)ia=q.width;if(O<d)da=q.height;Y=l.createSVGTransform();O=l.createSVGTransform();ka=l.createSVGTransform();Y.setTranslate(-(J+ia),-(pa+da));if(Q.shiftKey){replaced=
|
||||
true;Q=Math.min(Math.abs(fa),Math.abs(ba));fa=Q*(fa<0?-1:1);ba=Q*(ba<0?-1:1);if(totalScale.sx!=totalScale.sy){Q=totalScale.sx>totalScale.sy?1:totalScale.sx/totalScale.sy;fa*=totalScale.sy>totalScale.sx?1:totalScale.sy/totalScale.sx;ba*=Q}}totalScale.sx*=fa;totalScale.sy*=ba;O.setScale(fa,ba);ka.setTranslate(J+ia,pa+da);M.appendItem(ka);M.appendItem(O);M.appendItem(Y);s.recalculateDimensions(b);q=b.getBBox()}},mouseUp:function(M){if(s.getMode()===T){if(M.mouse_x==f&&M.mouse_y==d)return{keep:false,
|
||||
element:b,started:false};s.setMode("select");return{keep:true,element:b,started:false}}}}});(function(){for(var a=0,p=["ms","moz","webkit","o"],g=0;g<p.length&&!window.requestAnimationFrame;++g){window.requestAnimationFrame=window[p[g]+"RequestAnimationFrame"];window.cancelAnimationFrame=window[p[g]+"CancelAnimationFrame"]||window[p[g]+"CancelRequestAnimationFrame"]}if(!window.requestAnimationFrame)window.requestAnimationFrame=function(c){var n=(new Date).getTime(),s=Math.max(0,16-(n-a)),b=window.setTimeout(function(){c(n+s)},s);a=n+s;return b};if(!window.cancelAnimationFrame)window.cancelAnimationFrame=
|
||||
|
|