From 785e79d2974798497272873b11c8bc051216f181 Mon Sep 17 00:00:00 2001 From: Mark MacKay Date: Tue, 17 Jul 2012 20:03:31 -0500 Subject: [PATCH] building correctly --- .DS_Store | Bin 15364 -> 15364 bytes Makefile | 6 +- editor/.DS_Store | Bin 21508 -> 21508 bytes editor/svg-editor.css | 6 +- editor/svg-editor.html | 32 ++--- editor/svg-editor.js | 18 +-- editor/svgedit.compiled.css | 2 +- editor/svgedit.compiled.js | 220 +++++++++++++++---------------- method-draw/svg-editor.css | 6 +- method-draw/svg-editor.html | 32 ++--- method-draw/svg-editor.js | 18 +-- method-draw/svgedit.compiled.css | 2 +- method-draw/svgedit.compiled.js | 220 +++++++++++++++---------------- method-draw/temp.compiled.css | 1 + 14 files changed, 276 insertions(+), 287 deletions(-) create mode 100644 method-draw/temp.compiled.css diff --git a/.DS_Store b/.DS_Store index 78d40fa372f75aca182176ca33b52118eef4fd40..f8073039840a48c29cd736d3bb483ffca327c0a6 100644 GIT binary patch delta 1581 zcmdUuOKc2r9LM+jD>W0wOuOBVR!z53RkdEFO|`1}NL#88vfHX|%hn7g+O2dJjYn3Z ziN^&Q4i4f#D#8JcIFJYuj|d0;4ia(jI*CUd1PA`JZM3>vCFU^y!}t69KYpL@ufMOq z@8XkWB-$)F-#((OvOCio?E$w+2?6_tI|FU@bN7vCcHV-bvg&$2^Q5X%(xfCQu*1|N zn_ISX&qJN7S)oQ)`#Y zb#W%%1YymFp6+hmA4_Bnn%dYTua3X-J)y&S+{%y@Y20dro%aPawYf!Zb-ea*&#LHW z*LNgBfg36CKtncsC`1t!qZ&16LNnGQgl>ef1ADL^2XP38aReuD3g>Vh7jOxeaSb=| z01xp93{UX_ukjuq@d;n?jS@&CH>HwFUdp08noq^Fgi2{8)l;*Ng0zt~lSvjuT(OTZ zw7P=B>+nK*?4HzgN~nw_D996Z-Tf>jDVCk|sTnioEGj9lX$aW6)vC!cR6He4NTh80 zLdq0RfTJ<`M8y)7aV%$Mu2;&Fe2x+oolGe%Hg_JkFOV0GARUUAsOW++o)r{wxkxUK zlN}n$1h%9!(<_%r6UXWT4>zKrX*h1+X|7LG5#w zP|K4b+oSjclA=jAuw+Es(8C-sf_fdUZdVSo{Kl%oQbs6#y((S$B+M=$nZFAm}mWb{G7 zQAChH62ln9ah$?9CU71Xa0OR!6Sr^=_c4Pfc#3(v!3TWA0zTn0lRY|UmGNn{Jl8T< zq_1U+!~_|ci7{a&qD12Z0VNz@7~RFJD?aMVBa=~2tthpWS=X$q@ic5{YRmFdtzyfv zw9UT4A*g-g$`nh%lDw?IQ_dWvO7hbVdzH;u&GSokF&P&*ZOkof;3#TRptaS4mt#qx z_U9(Ph^5}<8ljP8iB2197Fs#tV@Ym#yU@W>)UzzWeZgGaI`m)rVQV>Fz z5*)%YO78?tVhpFD;tbB>94_H9rFe}pyp1W`!2`_VAs%Cn(tL*Jc!5`VjkkD*_Zqe( znw`HeY84B=!;J5Wgp}~~m}R(NYNP|xg^tDi)IUw+-v?6vKPA%k$3#x+E54LWjPO4J DZJi#~ diff --git a/Makefile b/Makefile index 478d4fb..8331596 100644 --- a/Makefile +++ b/Makefile @@ -73,9 +73,9 @@ $(PACKAGE): $(COMPILED_JS) $(COMPILED_CSS) # NOTE: WHITESPACE_ONLY and --formatting PRETTY_PRINT is helpful for debugging. $(COMPILED_CSS): - java -jar $(YUICOMPRESSOR) \ - $(CSS_INPUT_FILES) \ - -o $(COMPILED_CSS) + cat $(CSS_INPUT_FILES) > editor/temp.css; + java -jar $(YUICOMPRESSOR) editor/temp.css -o $(COMPILED_CSS); + rm editor/temp.css; $(COMPILED_JS): java -jar $(CLOSURE) \ diff --git a/editor/.DS_Store b/editor/.DS_Store index b255071ea496e186de438f5d3ad6b5b5abaa4843..f806abd7435dfc4d2c2a0dc5a994366d0f3fb57c 100644 GIT binary patch delta 680 zcmZo!!Pv5bQGtPhfzhcn#gKtP1IXk6Vh}CB0~7{w6u2iU=!=>HMVNtt3=D}3=?tk1 z#YyGG1rskWo@`*kGO=59a)A1-$?FufHeO_A+sw|v!ojF8ae@RR!)6|V77kHfhFpex zhEj%NpvH2B3?P}xkTW?^N`i?gVsonmBa^xaP_7JYa0){vLkWW(Lo!fDE<*v3mjhIt z0v0Kryg^Y!k166m7ywIH$Or-Dt!VFyF8XHI@{ zQcivn(0HJKnc_ftk*wrEF`*b;J>v~5>OsCw2KroYbBuHhv#toxXf|L-0yP62Q-W>; z(-WY)2F%LMJPKD?rBNLPvV>soQ7!-IWD(H*q0y)e;K?a6IhIEEh zhT@dsn;%PjW1O5WeRA_6nM~%*3QWO_j6$0&6t1#vc2r|xoLs7&FnOgq z?_>qWUECQ!6H6GffhJZ?Zj=$3>?Dznq1~TRk`?GkATZzt60XQT*euBOo_R9AjxHx7 lQ0f2>GfcMOk>+87c-I0fkfAeivZm@2blZ1sRxtQ24FEKOL!bZv diff --git a/editor/svg-editor.css b/editor/svg-editor.css index babb60a..e69d364 100644 --- a/editor/svg-editor.css +++ b/editor/svg-editor.css @@ -874,10 +874,14 @@ box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.1), stroke: transparent !important; } -#tools_top div[id$="_panel"]:not(#canvas_panel) { +.context_panel { display: none; } +#canvas_panel { + display: block; +} + #svg_editor #multiselected_panel .selected_tool { vertical-align: 12px; } diff --git a/editor/svg-editor.html b/editor/svg-editor.html index 2b0b4ba..e29212b 100644 --- a/editor/svg-editor.html +++ b/editor/svg-editor.html @@ -222,7 +222,7 @@ $(function(){
-
+

Canvas

@@ -251,7 +251,7 @@ $(function(){
-
+

Rectangle

-
+

Path

-
+

Image

-
+
-
+

Ellipse

-
+

Line

-
+

Text

@@ -390,7 +390,7 @@ $(function(){
-
+
@@ -401,23 +401,23 @@ $(function(){
-
+
-
+

Group

-
+
-
+

Edit Path

@@ -441,7 +441,7 @@ $(function(){
-
+
-
+

Position

-
+

Multiple Elements

diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 9402b62..1e3e57b 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -1039,7 +1039,7 @@ // create the panel if it doesn't exist if(!panel.length) - panel = $('
', {id: tool.panel}).appendTo("#tools_top"); + panel = $('
', {id: tool.panel}).appendTo("#tools_top").hide(); // TODO: Allow support for other types, or adding to existing tool switch (tool.type) { @@ -1409,7 +1409,7 @@ "stroke": "none", "id": "canvas_background", "opacity": 1, - "fill": fill || $.pref('bkgd_color'), + "fill": fill || "#fff", "style": "pointer-events:none" } }); @@ -1419,16 +1419,7 @@ // create a new layer background if it doesn't exist if (!document.getElementById('canvas_background')) createBackground(); - else { - var fill = document.getElementById('canvas_background').getAttribute("fill"); - - } - if($.pref('bkgd_color')) { - setBackground($.pref('bkgd_color'), $.pref('bkgd_url')); - } else if($.pref('bkgd_url')) { - // No color set, only URL - setBackground(defaultPrefs.bkgd_color, $.pref('bkgd_url')); - } + var fill = document.getElementById('canvas_background').getAttribute("fill"); // updates the toolbar (colors, opacity, etc) based on the selected element // This function also updates the opacity and id elements that are in the context panel @@ -3525,7 +3516,7 @@ var PaintBox = function(container, type) { var background = document.getElementById("canvas_background"); - var cur = {color: "#fff", opacity: 1} + var cur = {color: "fff", opacity: 1} if (type == "stroke") cur = curConfig['initStroke']; if (type == "fill") cur = curConfig['initFill']; if (type == "canvas" && background) { @@ -3538,7 +3529,6 @@ } } - // set up gradients to be used for the buttons var svgdocbox = new DOMParser().parseFromString( '*{display:table-cell;vertical-align:middle;margin:0;float:none;}#svg_editor .jGraduate_gradPick .jGraduate_Form_Section{padding-top:9px;}#svg_editor .jGraduate_Slider{text-align:center;float:left;width:100%;position:relative;margin:5px 0;}#svg_editor .jGraduate_Slider .jGraduate_Form_Section{border:none;width:250px;padding:0 2px;overflow:visible;}#svg_editor .jGraduate_Slider label.prelabel{width:40px;text-align:left;}#svg_editor .jGraduate_SliderBar{width:140px;float:left;margin:0 5px;border:1px solid #BBB;height:20px;position:relative;}#svg_editor div.jGraduate_Slider input{margin-top:5px;}#svg_editor div.jGraduate_Slider img{top:0;left:0;position:absolute;cursor:ew-resize;}#svg_editor .jPicker .Button .Ok,#svg_editor .jGraduate_Picker .jGraduate_OkCancel .jGraduate_Ok{margin:0;position:absolute;bottom:15px;right:15px;}#svg_editor .jPicker .Button .Cancel,#svg_editor .jGraduate_Picker .jGraduate_OkCancel .jGraduate_Cancel{margin:0;position:absolute;bottom:15px;left:15px;}body{background:#2F2F2C;font:13px/120% 'Lucida Sans','Lucida Grande','Lucida Sans Unicode',sans-serif;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin:0;padding:0;}::selection{background:#000;color:#fff;}::-moz-selection{background:#000;color:#fff;}html,body{overflow:hidden;width:100%;height:100%;}::-webkit-scrollbar{width:5px;height:5px;background:#444;}::-webkit-scrollbar-track{border-radius:10px;background:#444;}::-webkit-scrollbar-thumb{border-radius:10px;background:#666;}::-webkit-scrollbar-corner{background:#444;}#browser-not-supported{font-size:.8em;font-family:Verdana,Helvetica,Arial;color:#000;}#svg_editor hr{border:none;border-bottom:1px solid #808080;}#svg_editor select{margin-top:4px;}#svg_editor #svgroot{-moz-user-select:none;-webkit-user-select:none;position:absolute;top:0;left:0;}#svg_editor #menu_bar{margin:0 0 0 50px;}#svg_editor #menu_bar.active .menu.open .menu_list{display:block;}#svg_editor .menu{position:relative;z-index:5;color:#333;display:inline-block;}#svg_editor .menu_title{cursor:pointer;display:inline-block;padding:7px 10px;z-index:10;color:#fff;position:relative;height:16px;vertical-align:top;}#svg_editor .menu .menu_title:hover{background:rgba(255,255,255,0.1);}#svg_editor .menu_list .separator{margin:5px 0;border-top:solid #ddd 1px;}#svg_editor .menu_list{display:none;position:absolute;top:28px;left:0;white-space:nowrap;background:white;padding:7px 0;border-radius:0 3px 3px 3px;box-shadow:0 0 20px rgba(0,0,0,0.8);}#svg_editor #menu_bar.active .menu.open .menu_title{background:white;color:#333;}#svg_editor .menu_list .menu_item{position:relative;overflow:hidden;line-height:22px;padding:5px 69px 5px 25px;cursor:default;color:#333;}#svg_editor .menu_list .menu_item.tool_button{background:transparent;border:none;margin:0;padding:5px 55px 5px 25px;height:auto;width:auto;}#svg_editor .menu_list .menu_item.push_button_pressed:before{content:'✔';position:absolute;display:block;left:7px;top:3px;width:20px;height:20px;}#svg_editor .menu_list .menu_item:hover,#svg_editor .menu_list .menu_item.push_button_pressed:hover{background:rgba(0,0,0,0.1);color:#000;}#svg_editor .menu_list .menu_item.disabled:hover,#svg_editor .menu_list .menu_item.push_button_pressed.disabled:hover{background:transparent;color:#333;}#svg_editor .menu_list .menu_item.push_button_pressed{background:transparent;border:none;width:auto;height:auto;margin:0;}#svg_editor .menu_list .menu_item span{display:block;position:absolute;right:10px;padding:5px;background:rgba(0,0,0,0.1);top:6px;height:10px;text-align:center;font-size:10px;line-height:120%;}#svg_editor #svgcanvas{line-height:normal;display:inline-block;background-color:#A0A0A0;text-align:center;vertical-align:middle;width:640px;height:480px;position:relative;background:#3F3F3C;}#rulers>div{position:absolute;background:#2f2f2c;z-index:1;overflow:hidden;-webkit-font-smoothing:none;}#rulers #ruler_corner{top:30px;left:50px;width:15px;height:15px;border:solid #444 1px;z-index:2;}#ruler_x{height:15px;top:30px;left:66px;right:200px;border-top:solid #444 1px;border-right:solid #444 1px;}#ruler_x_cursor{height:15px;border-right:dotted #999 1px;position:absolute;background:#2f2f2c;}#ruler_y_cursor{width:15px;border-top:dotted #999 1px;position:absolute;background:#2f2f2c;}#rulers.moved #ruler_corner,#rulers.moved #ruler_x{top:101px;}#ruler_y{width:15px;top:46px;left:50px;bottom:40px;border-left:solid #444 1px;border-bottom:solid #444 1px;}#rulers.moved #ruler_y{top:116px;}#ruler_x canvas:first-child{margin-left:-16px;}#ruler_x canvas{float:left;}#ruler_y canvas{margin-top:-16px;}#ruler_x>div,#ruler_y>div{overflow:hidden;}#svg_editor div#palette_holder{display:block;overflow:hidden;height:31px;margin-top:10px;position:relative;z-index:2;float:left;}#svg_editor div#palette_holder #palette .palette_item:first-child{background:#fff;}#svg_editor div#palette_holder #palette .palette_item{cursor:pointer;}#tool_stroke select{margin-top:0;}#svg_editor #color_tools,#color_canvas_tools{position:relative;width:48px;height:48px;margin:6px 6px 0 6px;}#svg_editor #color_tools #tool_fill,#tool_canvas{position:absolute;top:0;left:0;z-index:1;}#tool_fill.active,#tool_stroke.active{z-index:2;}#tool_fill,#tool_stroke,#tool_canvas{box-shadow:0 0 0 1px #2f2f2c;}#color_canvas_tools{float:left;cursor:pointer;}#tool_fill .color_block,#tool_canvas .color_block{width:24px;height:24px;overflow:hidden;border:solid #ccc 1px;}#svg_editor #path_node_panel .tool_button{color:#999;border:solid #3F3F3C 1px;border-radius:3px;padding:3px 10px 3px 40px;background:transparent;position:relative;margin-top:10px;width:90px;height:23px;line-height:24px;}#svg_editor #path_node_panel .tool_button img{position:absolute;left:5px;top:3px;}#svg_editor #path_node_panel #tool_node_link{border:none;padding:3px 0;width:auto;margin:0 0 10px 0;background:transparent;color:#ccc;height:auto;line-height:130%;}#svg_editor #path_node_panel #segment_type{margin-top:10px;}#svg_editor #color_tools #tool_fill .color_block:hover,#svg_editor #color_tools #tool_stroke .color_block:hover{border-color:#fff;}#svg_editor #color_tools #tool_fill .color_block>div{position:absolute;top:0;left:0;}#svg_editor #color_tools #tool_fill .color_block #fill_bg,#svg_editor #color_tools #tool_stroke .color_block #stroke_bg{position:absolute;top:1px;left:1px;bottom:1px;right:1px;background:#fff;}#tool_stroke{position:absolute;top:12px;left:12px;z-index:0;}#stroke_color:after{content:'';position:absolute;display:block;width:8px;height:8px;left:8px;top:8px;background:#ccc;box-shadow:0 0 0 1px #000;}#svg_editor #color_tools #tool_switch{cursor:pointer;opacity:.7;width:11px;height:11px;background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABV0RVh0Q3JlYXRpb24gVGltZQA2LzE0LzEyP6j5+gAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNXG14zYAAAB4SURBVBiVjZHRCYUwDEVvxIF0kZKN7EjiIrrReR/PSNSKXiikcE5JUtMeADMzXQIcdRfgFWqlyyB7ap1wL+0HAnIv1DqRJUBxTkLUWXIvh9AHkIeb58UkIUnDMH4ZR0otCfhv4ynbtp7ut722ZniFG8L9xx4Ek6QfN9huARmYwR0AAAAASUVORK5CYII=) top left no-repeat;position:absolute;top:-2px;left:28px;}#svg_editor #color_tools #cross:hover{opacity:1;}#svg_editor #color_tools #tool_stroke:hover #stroke_color:after{background:#fff;}#svg_editor #color_tools #tool_stroke .color_block{width:24px;height:24px;overflow:hidden;border:solid #ccc 1px;}#svg_editor #color_tools #tool_stroke .color_block>div{position:absolute;bottom:0;right:0;}#svg_editor #color_tools .icon_label{padding:0;width:24px;height:100%;cursor:pointer;}#svg_editor #zoomLabel{cursor:pointer;margin-right:5px;}#svg_editor #linkLabel>svg{height:20px;padding-top:4px;}#svg_editor div#palette{float:left;width:672px;height:16px;}#svg_editor div#workarea{display:inline-table-cell;position:absolute;top:30px;left:50px;bottom:40px;right:200px;background-color:#444;overflow:auto;text-align:center;}#svg_editor #sidepanels{display:none;position:absolute;top:75px;bottom:60px;right:0;width:2px;padding:10px;border-left:none;z-index:10;}#svg_editor #layerpanel{display:inline-block;position:absolute;top:1px;bottom:0;right:0;width:0;overflow:auto;margin:0;-moz-user-select:none;-webkit-user-select:none;}#svg_editor #sidepanel_handle{display:inline-block;position:absolute;background-color:#D0D0D0;font-weight:bold;left:0;top:40%;width:1em;padding:5px 1px 5px 5px;margin-left:3px;cursor:pointer;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-moz-user-select:none;-webkit-user-select:none;}#svg_editor #sidepanel_handle:hover{font-weight:bold;}#svg_editor #sidepanel_handle *{cursor:pointer;-moz-user-select:none;-webkit-user-select:none;}#svg_editor #layerbuttons{margin:0;padding:0;padding-left:2px;padding-right:2px;width:125px;height:20px;border-right:1px solid #FFF;border-bottom:1px solid #FFF;border-left:1px solid #808080;border-top:1px solid #808080;overflow:hidden;}#svg_editor .layer_button{width:14px;height:14px;padding:1px;border-left:1px solid #FFF;border-top:1px solid #FFF;border-right:1px solid #808080;border-bottom:1px solid #808080;cursor:pointer;float:left;margin-right:3px;}#svg_editor .layer_button:last-child{margin-right:0;}#svg_editor .layer_buttonpressed{width:14px;height:14px;padding:1px;border-right:1px solid #FFF;border-bottom:1px solid #FFF;border-left:1px solid #808080;border-top:1px solid #808080;cursor:pointer;}#svg_editor #layerlist{margin:1px;padding:0;width:127px;border-collapse:collapse;border:1px solid #808080;background-color:#FFF;}#svg_editor #layerlist tr.layer{background-color:#FFF;margin:0;padding:0;}#svg_editor #layerlist tr.layersel{border:1px solid #808080;background-color:#CCC;}#svg_editor #layerlist td.layervis{width:22px;cursor:pointer;}#svg_editor #layerlist td.layerinvis{background-image:none;cursor:pointer;}#svg_editor #layerlist td.layervis *{display:block;}#svg_editor #layerlist td.layerinvis *{display:none;}#svg_editor #layerlist td.layername{cursor:pointer;}#svg_editor #layerlist tr.layersel td.layername{font-weight:bold;}#svg_editor #selLayerLabel{white-space:nowrap;}#svg_editor #selLayerNames{display:block;}#svg_editor div.palette_item{height:16px;width:16px;float:left;}#svg_editor .menu .menu_list{display:none;position:absolute;}#svg_editor .tool_button:hover,#svg_editor .push_button:hover,#svg_editor .buttonup:hover,#svg_editor .buttondown,#svg_editor .tool_button_current,#svg_editor .push_button_pressed{background-color:#fff;}#svg_editor .tool_button.disabled,#svg_editor .tool_button.disabled:hover{opacity:.3;background-color:#aaa;}#svg_editor #tools_left .tool_button{background:#2f2f2c;}#svg_editor #tools_left .tool_button.loaded{background:#ccc;}#svg_editor #tools_left .tool_button.loaded:hover{background:#fff;}#tools_top .padded{padding:10px 0;}#svg_editor #tools_left .tool_button_current{background-color:#0cf;}#svg_editor #main_icon span{position:absolute;width:100%;height:100%;display:block;z-index:2;}#svg_editor #tools_top{position:absolute;width:170px;right:2px;top:10px;border-bottom:none;overflow:visible;padding:0 10px;}#svg_editor label{display:block;color:#999;}div#font-selector{width:140px;height:300px;overflow:auto;margin:0 auto;position:absolute;top:27px;right:0;border:1px solid black;padding:10px;display:none;background-color:white;z-index:10;border-radius:3px;box-shadow:0 5px 10px rgba(0,0,0,0.7);}div#font-selector img{width:100%;}div#font-selector .font-item{border-bottom:solid #ddd 1px;padding:5px 10px;margin:0 -10px;}div#font-selector .font-item:hover{background-color:#eee;}#svg_editor #tools_top label:before,#svg_editor #tools_top label:after{content:"";display:table;}#svg_editor #tools_top label:after{clear:both;}#svg_editor #tools_top label span,#svg_editor #tools_top label select{display:block;width:80px;float:left;line-height:185%;}#svg_editor #tools_top label span.tuco{width:100%;float:none;}#svg_editor #tools_top #marker_panel *{float:left;}#svg_editor #tools_top #marker_panel h4{float:none;}#svg_editor #tools_top #marker_panel .dropdown .icon_label{width:36px;height:20px;margin-top:2px;border:solid #3f3f3c 1px;text-align:center;}#svg_editor #font_family_dropdown-list{border-radius:3px;box-shadow:0 5px 10px #000;}#svg_editor #font_family_dropdown-list li{cursor:pointer;}#svg_editor #tools_top #marker_panel .dropdown button{margin-top:2px;}#svg_editor #tools_top #marker_panel #marker_panel_title{float:none;color:#fff;margin-bottom:3px;}#svg_editor #tools_top #marker_panel .dropdown .icon_label img{float:none;}#svg_editor input[type=text],#svg_editor input[type=number]{border:solid #3f3f3c 1px;background-color:transparent;color:#09f;display:block;float:left;font-size:13px;padding:2px 5px;width:70px;-webkit-appearance:none;border-radius:2px;margin:0;-webkit-touch-callout:text;-webkit-user-select:text;-khtml-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;}#svg_editor #color_picker input[type=text],#color_picker #svg_editor input[type=number]{width:30px;background:#fff;}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0;}#svg_editor .dropdown_set input[type=text],#svg_editor .dropdown_set input[type=number]{width:50px;}#svg_editor input[type=text].wide,#svg_editor input[type=number].wide{width:110px;}#svg_editor input[type=text].tuco,#svg_editor input[type=number].tuco{width:150px;}#svg_editor input[type=submit],#svg_editor input[type=button],button{background:#2C7BB3;color:#fff;border-radius:2px;padding:5px 10px;border:none;line-height:140%;border-bottom:solid transparent 1px;}#svg_editor input[type=submit]:hover,#svg_editor button:hover{box-shadow:inset 0 3px 10px rgba(255,255,255,0.1),inset 0 -3px 10px rgba(0,0,0,0.2);}#svg_editor input[type=submit]:hover,#svg_editor button:hover{background:#2F84C1;}#svg_editor input[type=submit]:active,#svg_editor button:active{padding:6px 10px 4px 10px;box-shadow:inset 0 2px 2px rgba(0,0,0,0.2);border-bottom:solid rgba(255,255,255,0.1) 1px;}#svg_editor input[type=text]:focus,#svg_editor input[type=number]:focus{border:solid rgba(0,120,255,0.3) 1px;outline:none;}#svg_editor input[readonly=readonly],#svg_editor input[readonly=readonly]:focus{background:transparent;color:#fff;border:none;outline:none;}#svg_editor #tools_left{position:absolute;border-right:none;width:50px;top:30px;left:0;background:#2F2F2C;z-index:4;}#workarea.wireframe #svgcontent *{fill:none;stroke:#000;stroke-width:1px;stroke-opacity:1.0;stroke-dasharray:0;opacity:1;pointer-events:stroke;vector-effect:non-scaling-stroke;filter:none;}#workarea.wireframe #svgcontent text{fill:#000;stroke:none;}#workarea.wireframe #canvasBackground>rect{fill:#FFF!important;}#workarea #canvasBackground>rect{stroke:transparent!important;}.context_panel{display:none;}#canvas_panel{display:block;}#svg_editor #multiselected_panel .selected_tool{vertical-align:12px;}#cur_context_panel{position:absolute;top:47px;left:68px;line-height:22px;overflow:auto;border-bottom:none;border-right:none;padding-left:5px;font-size:12px;background:black;color:#999;opacity:.5;padding:0 10px;border-radius:0 10px 10px 0;}#svg_editor #cur_context_panel a{float:none;text-decoration:none;color:#fff;}#svg_editor #cur_context_panel a:hover{text-decoration:underline;}#svg_editor #tools_left .tool_button,#svg_editor #tools_left .tool_button_current{position:relative;z-index:11;}#svg_editor .flyout_arrow_horiz{position:absolute;bottom:-1px;right:0;z-index:10;}span.zoom_tool{line-height:16px;background:#ccc;display:block;width:18px;height:18px;margin-top:2px;float:left;}span.zoom_tool img{vertical-align:top;}#zoom_panel{margin-top:9px;right:200px;position:absolute;}.dropdown{position:relative;float:left;}#svg_editor .dropdown button{width:21px;height:22px;padding:0 3px 0 3px;border:none;background-color:#555;border-radius:0 2px 2px 0;margin-left:-1px;position:relative;}#svg_editor .dropdown button:hover{background-color:#666;}#svg_editor .dropdown button:after{content:'';position:absolute;border:solid transparent 4px;border-top-color:#999;top:9px;left:6px;}.dropdown button.down{border-left:1px solid #808080;border-top:1px solid #808080;border-right:1px solid #FFF;border-bottom:1px solid #FFF;background-color:#B0B0B0;}.dropdown ul{list-style:none;position:absolute;margin:0;padding:0;left:-80px;top:26px;z-index:4;display:none;}.dropup ul{top:auto;bottom:26px;border-radius:3px;box-shadow:0 5px 10px #000;}.dropup ul:after{content:'';display:block;position:absolute;bottom:-10px;right:50%;top:auto;width:0;height:0;border:solid transparent 5px;border-top-color:#fff;}.dropdown li{display:block;width:120px;padding:5px 10px;color:#333;background:#fff;margin:0;line-height:16px;}.dropdown li:first-child{border-radius:3px 3px 0 0;}.dropdown li:last-child{border-radius:0 0 3px 3px;}.dropdown li:hover{background-color:#ddd;color:#000;}.dropdown li.special{padding:10px;background:white;border:none;box-shadow:0 3px 10px black;border-radius:3px!important;}.dropdown li.special:after{content:'';display:block;position:absolute;top:-10px;right:50%;border:solid transparent 5px;border-bottom-color:#fff;}.dropdown li.special.down:after{bottom:-10px;right:50%;top:auto;border:solid transparent 5px;border-top-color:#fff;}#font_family_dropdown-list li{font-size:1.4em;}#font_family{margin-left:5px;margin-right:0;}#svg_editor .tool_button,#svg_editor .push_button,#svg_editor .tool_button_current,#svg_editor .push_button_pressed{height:27px;width:27px;border:solid #2f2f2c 8px;border-left-width:13px;margin:0;background-color:#ddd;cursor:pointer;}#svg_editor #main_menu li#tool_open,#svg_editor #main_menu li#tool_import{position:relative;overflow:hidden;}#tool_image{overflow:hidden;}#tool_open input,#tool_import input,#tool_image input{position:absolute;opacity:0;font-size:10em;top:-5px;right:-5px;margin:0;cursor:pointer;}#svg_editor .disabled{opacity:.5;cursor:default;}#svg_editor .width_label{padding-right:5px;}#svg_editor #tool_bold,#svg_editor #tool_italic{font:bold 2.1em/1.1em serif;text-align:center;padding:0 2px 5px 2px;position:relative;float:left;margin:5px 10px 0 0;color:#ccc;background:#2f2f2c;border:solid #3f3f3c 1px;}#svg_editor #tool_bold:hover,#svg_editor #tool_italic:hover{color:#fff;}#svg_editor #tool_font_size{clear:both;padding-top:8px;}#text{position:absolute;left:-9999px;}#svg_editor #tool_bold span,#svg_editor #tool_italic span{position:absolute;width:100%;height:100%;top:0;left:0;background:#ccc;opacity:0;}#svg_editor #tool_italic{font-weight:normal;font-style:italic;}#url_notice{padding-top:4px;display:none;}#svg_editor #color_picker{position:absolute;display:none;background:#fff;height:350px;border-radius:3px;z-index:5;box-shadow:0 5px 10px #000;width:530px;}#svg_editor .tools_flyout{position:absolute;display:none;cursor:pointer;width:385px;z-index:10;left:47px!important;height:324px;background:#fff;border-radius:5px;box-shadow:0 5px 10px rgba(0,0,0,0.5);}#svg_editor .tools_flyout_v{position:absolute;display:none;cursor:pointer;width:30px;}#svg_editor .tools_flyout .tool_button{float:left;background-color:#fff;height:24px;width:24px;}#svg_editor #tools_bottom{position:absolute;left:50px;right:0;bottom:0;height:40px;overflow:visible;}#svg_editor #tools_bottom_1{width:115px;float:left;}#svg_editor #tools_bottom_2{position:relative;float:left;margin-top:5px;}#tools_bottom input[type=text]{width:3.2em;}#svg_editor .stroke_tool .dropdown button{margin-top:0;}#svg_editor .stroke_tool div div{-moz-user-select:none;-webkit-user-select:none;width:20px;height:20px;margin:0;padding:1px;background:rgba(255,255,255,0.3);}#svg_editor #tools_bottom .stroke_tool .dropdown button{background-color:#555;margin-top:0;}#svg_editor #tools_top h4{color:#fff;font-weight:normal;margin:0;padding:20px 0 5px 0;}.stroke_tool>div{width:42px;}.stroke_tool>div>*{float:left;}#tools_top .dropdown .icon_label{border:1px solid transparent;height:auto;}.align_buttons .push_button,.align_buttons .push_button_pressed{display:block;float:left;}#option_lists ul{display:none;position:absolute;height:auto;z-index:3;margin:0;list-style:none;padding-left:0;}#option_lists .optcols2{width:70px;margin-left:-15px;}#option_lists .optcols3{width:192px;margin-left:-105px;margin-top:-25px;background:#fff;padding:5px;box-shadow:0 5px 10px #000;border-radius:3px;}#option_lists .optcols3:after{content:'';display:block;position:absolute;top:-10px;right:70px;border:solid transparent 5px;border-bottom-color:#fff;}#svg_editor #option_lists .tool_button,#svg_editor #option_lists .push_button,#svg_editor #option_lists .tool_button_current,#svg_editor #option_lists .push_button_pressed{border:none;background:transparent;}#svg_editor #option_lists .tool_button:hover{background:#ddd;}#svg_editor #option_lists ul li.current{background-color:#F4E284;}#option_lists .optcols4{width:130px;margin-left:-44px;}#option_lists ul[class^=optcols] li{float:left;}#svg_editor ul li.current{background-color:#F4E284;}#svg_editor #option_lists ul li{margin:0;border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;}#svg_editor #tool_stroke label input{margin-top:0;}#svg_editor #copyright{text-align:right;padding-right:.3em;}#svg_source_editor{display:none;}#svg_source_editor #svg_source_overlay{position:absolute;top:0;right:0;left:0;bottom:0;background-color:black;opacity:.6;z-index:5;}#svg_source_editor #svg_source_container{position:absolute;top:30px;left:30px;right:30px;bottom:30px;background-color:#fff;border-radius:3px;opacity:1.0;text-align:center;z-index:6;padding:20px 0;}#save_output_btns{display:none;text-align:left;}#save_output_btns p{margin:.5em 1.5em;display:inline-block;}#bg_blocks{overflow:auto;}#bg_blocks div{box-shadow:0 2px 3px rgba(0,0,0,0.3);margin-right:10px;}#svg_docprops #svg_docprops_container,#svg_prefs #svg_prefs_container{position:absolute;top:50%;width:300px;height:200px;margin-top:-140px;margin-left:-250px;border-radius:3px;padding:20px;left:50%;background-color:#fff;box-shadow:0 3px 10px rgba(0,0,0,0.3);opacity:1.0;z-index:20001;}#svg_docprops .error{border:1px solid red;padding:3px;}#svg_docprops #resolution{max-width:14em;}#tool_docprops_back,#tool_prefs_back{margin-left:1em;overflow:auto;}#svg_docprops_container #svg_docprops_docprops,#svg_prefs #svg_docprops_prefs{float:left;width:221px;margin:5px .7em;overflow:hidden;}#svg_prefs #svg_prefs_container{width:500px;height:320px;margin:-180px 0 0 -350px;}#svg_docprops legend,#svg_prefs legend{font-weight:bold;font-size:18px;padding:0 0 20px 0;display:block;font-family:sans-serif;}#svg_docprops_docprops>legend,#svg_prefs_container>fieldset>legend{font-weight:bold;font-size:1.1em;}#svg_docprops_container fieldset,#svg_prefs fieldset{margin:0;padding:0;border:none;}#svg_docprops_container label,#svg_prefs_container label{display:block;margin:.5em;}#svg_prefs_container label{margin:10px 0;}#svginfo_bg_note{font-size:.9em;font-style:italic;color:#444;}#canvas_title,#canvas_bg_url{display:block;width:96%;}#svg_source_editor #svg_source_textarea{position:relative;width:95%;top:5px;height:250px;padding:5px;font-size:12px;}#svg_source_editor #tool_source_back{text-align:left;padding:10px 0 0 20px;position:relative;}#svg_source_editor #tool_source_back #tool_source_save{position:absolute;right:20px;top:7px;}#svg_prefs_container div.color_block{float:left;margin:2px;padding:20px;}#svg_prefs_container div.cur_background{box-shadow:0 0 8px rgba(0,50,255,1);}#background_img{position:absolute;top:0;left:0;text-align:left;}#svg_docprops input,#svg_prefs input,#svg_docprops select,#svg_prefs select{font-size:15px;border-radius:3px;border:solid #aaa 1px;background-color:#eee;padding:5px 10px;}#svg_docprops select,#svg_prefs select{height:30px;width:210px;}#svg_docprops label,#svg_prefs label{display:inline-block;width:100px;vertical-align:top;}#svg_prefs .subtitle{margin-bottom:10px;}#svg_prefs label{width:200px;}#svg_docprops label span,#svg_prefs label span{display:inline-block;padding-bottom:5px;}#svg_docprops button,#svg_prefs button{position:absolute;font-size:15px;}#svg_editor button.cancel,#svg_editor input.Cancel,#svg_editor input.cancel,#svg_editor input.jGraduate_Cancel,button.cancel{background-color:#999;box-shadow:0 0 1px rgba(0,0,0,0.5);margin:0;}#svg_docprops button:first-child,#svg_prefs button:first-child{bottom:15px;left:15px;right:auto;}#svg_docprops button:last-child,#svg_prefs button:last-child{bottom:15px;right:15px;left:auto;}#svg_docprops button img,#svg_prefs button img{display:none;}#svg_editor button#docprops_button{background:#444;}#svg_editor button#docprops_button:hover{background:#555;}#svg_docprops,#svg_prefs{display:none;}#image_save_opts label{font-size:.9em;}#image_save_opts input{margin-left:0;}#svg_docprops #svg_docprops_overlay,#svg_prefs #svg_prefs_overlay{position:absolute;top:0;right:0;left:0;bottom:0;background-color:black;opacity:.6;z-index:20000;}#shape_buttons{overflow:auto;top:0;bottom:0;left:110px;right:0;position:absolute;vertical-align:top;}#shape_cats{min-width:110px;display:block;position:absolute;left:0;top:0;height:300px;background:#eee;border-radius:3px 0 0 3px;z-index:2;}#shape_cats>div{line-height:1em;padding:0 .5em;border-bottom:1px solid #ddd;background:#E8E8E8;color:#444;height:26px;line-height:26px;}#shape_cats>div:first-child{border-radius:3px 0 0 0;}#shape_cats>div:last-child{border-radius:0 0 0 3px;}#shape_cats div:hover{background:#efefef;color:#000;}#shape_cats div.current{font-weight:bold;background:#3f3f3c;color:#fff;position:relative;}#shape_cats div.current:after{content:'';position:absolute;right:-26px;top:0;border:solid transparent 13px;border-left-color:#3f3f3c;}.toolbar_button button .svg_icon{display:none;}#dialog_box{display:none;}#dialog_box_overlay{background:black;opacity:.5;height:100%;left:0;position:absolute;top:0;width:100%;z-index:6;}#dialog_content{height:95px;margin:10px 10px 5px 10px;background:#DDD;overflow:auto;text-align:left;border:1px solid #B0B0B0;}#dialog_content.prompt{height:75px;}#dialog_content p{margin:10px;line-height:1.3em;}#dialog_container{position:absolute;font-family:Verdana;text-align:center;left:50%;top:50%;width:300px;margin-left:-150px;height:150px;margin-top:-80px;position:fixed;z-index:50001;background:#CCC;border:1px outset #777;font-family:Verdana,Helvetica,sans-serif;font-size:.8em;}#dialog_container,#dialog_content{border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;}#dialog_buttons input[type=text]{width:90%;display:block;margin:0 0 5px 11px;}#dialog_buttons input[type=button]{margin:0 1em;}.invisible{visibility:none;}.ui-slider{position:relative;text-align:left;}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;}.ui-slider-horizontal{height:.8em;}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em;}.ui-slider-horizontal .ui-slider-range{top:0;height:100%;}.ui-slider-horizontal .ui-slider-range-min{left:0;}.ui-slider-horizontal .ui-slider-range-max{right:0;}.ui-slider-vertical{width:.8em;height:100px;}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em;}.ui-slider-vertical .ui-slider-range{left:0;width:100%;}.ui-slider-vertical .ui-slider-range-min{bottom:0;}.ui-slider-vertical .ui-slider-range-max{top:0;}.ui-slider{background:#3F3F3C;border-radius:10px;}.ui-slider-handle{box-shadow:0 3px 3px rgba(0,0,0,0.3);border-radius:30px;background:#fff;background-image:-ms-linear-gradient(top,#ccc 0,#fff 100%);background-image:-moz-linear-gradient(top,#ccc 0,#fff 100%);background-image:-o-linear-gradient(top,#ccc 0,#fff 100%);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#ccc),color-stop(1,#fff));background-image:-webkit-linear-gradient(top,#ccc 0,#fff 100%);background-image:linear-gradient(top,#ccc 0,#fff 100%);}.ui-slider-handle:focus{outline:none;}#shape_buttons{background:#fff;border-radius:0 3px 3px 0;padding:10px;}#svg_editor .tools_flyout .tool_button,#svg_editor .tools_flyout .tool_flyout{background:#fff;width:40px;height:40px;margin:5px;border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-width:0;}.contextMenu{position:absolute;z-index:99999;border:solid 1px rgba(0,0,0,.33);background:rgba(255,255,255,.95);padding:5px 0;margin:0;display:none;font:12px/15px Lucida Sans,Helvetica,Verdana,sans-serif;border-radius:5px;-moz-border-radius:5px;-moz-box-shadow:2px 5px 10px rgba(0,0,0,.3);-webkit-box-shadow:2px 5px 10px rgba(0,0,0,.3);box-shadow:2px 5px 10px rgba(0,0,0,.3);}.contextMenu LI{list-style:none;padding:0;margin:0;}.contextMenu .shortcut{width:115px;text-align:right;float:right;}.contextMenu A{-moz-user-select:none;-webkit-user-select:none;color:#222;text-decoration:none;display:block;line-height:20px;height:20px;background-position:6px center;background-repeat:no-repeat;outline:none;padding:0 15px 1px 20px;}.contextMenu LI.hover A{background-color:#2e5dea;color:white;cursor:default;}.contextMenu LI.disabled A{color:#999;}.contextMenu LI.hover.disabled A{background-color:transparent;}.contextMenu LI.separator{border-top:solid 1px #E3E3E3;padding-top:5px;margin-top:5px;}#menu{display:none;position:absolute;top:0;left:0;right:0;height:30px;background:#000;z-index:10;color:#fff;}#workarea.rect,#workarea.line,#workarea.ellipse,#workarea.path,#workarea.shapelib{cursor:crosshair;}#workarea.text{cursor:text;}#workarea.eyedropper{cursor:url(images/eyedropper.png),crosshair;}#workarea.fhpath{cursor:url(images/pencil_cursor.png) 0 20,crosshair;}#workarea.rotate *{cursor:url(images/rotate.png) 12 12,auto;}#workarea.n-resize *{cursor:n-resize!important;}#workarea.e-resize *{cursor:e-resize!important;}#workarea.w-resize *{cursor:w-resize!important;}#workarea.s-resize *{cursor:s-resize!important;}#workarea.ne-resize *{cursor:ne-resize!important;}#workarea.se-resize *{cursor:se-resize!important;}#workarea.nw-resize *{cursor:nw-resize!important;}#workarea.sw-resize *{cursor:sw-resize!important;}#workarea.zoom{cursor:crosshair;cursor:-moz-zoom-in;cursor:-webkit-zoom-in;}#workarea.zoom.out{cursor:crosshair;cursor:-moz-zoom-out;cursor:-webkit-zoom-out;}#selectorRubberBand{shape-rendering:crispEdges;}.clearfix:before,.clearfix:after{content:"";display:table;}.clearfix:after{clear:both;}.clearfix{*zoom:1;}#svg_editor #group_title{display:none;}INPUT.spin-button{padding:2px 20px 2px 2px;background-repeat:no-repeat;background-position:100% 0;background-image:url('spinbtn_updn.png');background-color:white;}INPUT.spin-button.up{cursor:pointer;background-position:100% -18px;}INPUT.spin-button.down{cursor:pointer;background-position:100% -36px;} \ No newline at end of file diff --git a/editor/svgedit.compiled.js b/editor/svgedit.compiled.js index 6c597d5..98f1e81 100644 --- a/editor/svgedit.compiled.js +++ b/editor/svgedit.compiled.js @@ -406,116 +406,116 @@ q/2,y:A.y*q+A.height*q/2});f.getMode()=="zoom"&&A.width&&oa();B()}}};a("#cur_con a(this).mouseup(Ca);Ba.key&&a(document).bind("keydown",Ba.key[0]+" shift+"+Ba.key[0],Ca)});if(va)ja.attr("data-curopt",I[va].sel);else ja.attr("data-curopt")||ja.attr("data-curopt",I[0].sel);var ya,Da=a(X).position();a(A).css({left:Da.left+34,top:Da.top+77});ja.mousedown(function(Ca){a("#tools_shapelib").is(":visible")&&xa(X,false);if(ja.hasClass("disabled"))return false;var Ba=a(A),tb=Da.left+34,Ta=Ba.width()*-1,ia=Ba.data("shown_popop")?200:0;ya=setTimeout(function(){ja.data("isLibrary")?Ba.css("left", tb).show():Ba.css("left",Ta).show().animate({left:tb},150);Ba.data("shown_popop",true)},ia);Ca.preventDefault()}).mouseup(function(){clearTimeout(ya);var Ca=a(this).attr("data-curopt");if(ja.data("isLibrary")&&a(X.replace("_show","")).is(":visible"))xa(X,true);else xa(X)&&Ca in Ia&&Ia[Ca]()})});Kb()},Ga=function(q,A){return a("
",{"class":"tools_flyout",id:q}).appendTo("#svg_editor").append(A)},Cb=function(){a(".tools_flyout").each(function(){var q=a("#"+this.id+"_show"),A=q.offset();q=q.outerWidth(); a(this).css({left:(A.left+q)*S,top:A.top})})},Kb=function(){a(".tools_flyout").each(function(){var q=a("#"+this.id+"_show");if(!q.data("isLibrary")){var A=[];a(this).children().each(function(){A.push(this.title)});q[0].title=A.join(" / ")}})},nb,ab=function(q,A,I){var R=null;if(q.indexOf("url(#")===0){q=(q=f.getRefElem(q))?q.cloneNode(true):a("#"+I+"_color defs *")[0];R={alpha:A};R[q.tagName]=q}else R=q.indexOf("#")===0?{alpha:A,solidColor:q.substr(1)}:{alpha:A,solidColor:"none"};return new a.jGraduate.Paint(R)}, -Ya=f.getResolution();if(d.baseUnit!=="px"){Ya.w=svgedit.units.convertUnit(Ya.w)+d.baseUnit;Ya.h=svgedit.units.convertUnit(Ya.h)+d.baseUnit}a(".canvas_width").val(Ya.w);a(".canvas_height").val(Ya.h);a("#docprops_button").on("click",function(){H()});var La=function(q){f.createLayer("background");cur_shape=f.addSvgElementFromJson({element:"rect",attr:{x:-1,y:-1,width:Ya.w+2,height:Ya.h+2,stroke:"none",id:"canvas_background",opacity:1,fill:q||a.pref("bkgd_color"),style:"pointer-events:none"}});f.setCurrentLayer("Layer 1"); -f.setCurrentLayerPosition("1")};document.getElementById("canvas_background")?document.getElementById("canvas_background").getAttribute("fill"):La();if(a.pref("bkgd_color"))p(a.pref("bkgd_color"),a.pref("bkgd_url"));else a.pref("bkgd_url")&&p(o.bkgd_color,a.pref("bkgd_url"));var Ea=c.setImageURL=function(q){q||(q=ea);f.setImageURL(q);a("#image_url").val(q);if(q.indexOf("data:")===0){a("#image_url").hide();a("#change_image_url").show()}else{f.embedImage(q,function(A){A?a("#url_notice").hide():a("#url_notice").show(); -ea=q});a("#image_url").show();a("#change_image_url").hide()}},qb=function(q){var A=Math.min(Math.max(12+q.value.length*6,50),300);a(q).width(A)},Ja=function(){var q=Z;if(q!=null&&!q.parentNode)q=null;var A=f.getCurrentDrawing().getCurrentLayerName(),I=f.getMode(),R=d.baseUnit!=="px"?d.baseUnit:null,X=I=="pathedit",ja=a("#cmenu_canvas li");a("#selected_panel, #multiselected_panel, #g_panel, #path_panel, #rect_panel, #canvas_panel, #circle_panel,\t\t\t\t\t#ellipse_panel, #line_panel, #text_panel, #image_panel, #container_panel, #use_panel, #a_panel").hide(); -a(".menu_item","#edit_menu").addClass("disabled");a(".menu_item","#object_menu").addClass("disabled");!q&&!Aa&&a("#canvas_panel").show();if(q!=null){var va=q.nodeName,ya=f.getRotationAngle(q);a("#angle").val(Math.round(ya));ya=f.getBlur(q);a("#blur").val(ya);a("#blur_slider").slider("option","value",ya);f.addedNew&&va==="image"&&f.getHref(q).indexOf("data:")!==0&&L();if(!X&&I!="pathedit"){a("#selected_panel").show();a(".action_selected").removeClass("disabled");if(["line","circle","ellipse"].indexOf(va)>= -0)a("#xy_panel").hide();else{var Da,Ca;if(["g","polyline","path"].indexOf(va)>=0){if(I=f.getStrokedBBox([q])){Da=I.x;Ca=I.y}}else{Da=q.getAttribute("x");Ca=q.getAttribute("y")}if(R){Da=svgedit.units.convertUnit(Da);Ca=svgedit.units.convertUnit(Ca)}a("#selected_x").val(Math.round(Ca)||0);a("#selected_y").val(Math.round(Da)||0);a("#xy_panel").show()}["image","text","path","g","use"].indexOf(va)==-1&&a(".action_path_convert_selected").removeClass("disabled");va==="path"&&a(".action_path_selected").removeClass("disabled")}else{A= -ta.getNodePoint();a("#tool_add_subpath").removeClass("push_button_pressed").addClass("tool_button");a("#tool_node_delete").toggleClass("disabled",!ta.canDeleteNodes);fa("#tool_openclose_path",ta.closed_subpath?"open_path":"close_path");if(A){X=a("#seg_type");if(R){A.x=svgedit.units.convertUnit(A.x);A.y=svgedit.units.convertUnit(A.y)}a("#path_node_x").val(Math.round(A.x));a("#path_node_y").val(Math.round(A.y));A.type?X.val(A.type).removeAttr("disabled"):X.val(4).attr("disabled","disabled")}return}R= -{g:[],a:[],rect:["rx","width","height"],image:["width","height"],circle:["cx","cy","r"],ellipse:["cx","cy","rx","ry"],line:["x1","y1","x2","y2"],text:[],use:[]};var Ba=q.tagName;a(q).data("gsvg")&&a("#g_panel").show();Ba=="path"&&a("#path_panel").show();if(R[Ba]){R=R[Ba];a("#"+Ba+"_panel").show();a.each(R,function(tb,Ta){var ia=q.getAttribute(Ta);if(d.baseUnit!=="px"&&q[Ta])ia=svgedit.units.convertUnit(q[Ta].baseVal.value);a("#"+Ba+"_"+Ta).val(Math.round(ia)||0)});if(Ba=="text"){a("#text_panel").css("display", -"inline");f.getItalic()?a("#tool_italic").addClass("push_button_pressed").removeClass("tool_button"):a("#tool_italic").removeClass("push_button_pressed").addClass("tool_button");f.getBold()?a("#tool_bold").addClass("push_button_pressed").removeClass("tool_button"):a("#tool_bold").removeClass("push_button_pressed").addClass("tool_button");a("#font_family").val(q.getAttribute("font-family"));a("#font_size").val(q.getAttribute("font-size"));a("#text").val(q.textContent);f.addedNew&&setTimeout(function(){a("#text").focus().select()}, -100)}else if(Ba=="image")Ea(f.getHref(q));else if(Ba==="g"||Ba==="use"){a("#container_panel").show();a(".action_group_selected").removeClass("disabled");R=f.getTitle();va=a("#g_title")[0];va.value=R;qb(va);Ba=="use"?va.setAttribute("disabled","disabled"):va.removeAttribute("disabled")}}ja[(Ba==="g"?"en":"dis")+"ableContextMenuItems"]("#ungroup");ja[(Ba==="g"||!Aa?"dis":"en")+"ableContextMenuItems"]("#group")}else if(Aa){a("#multiselected_panel").show();a(".action_multi_selected").removeClass("disabled"); -ja.enableContextMenuItems("#group").disableContextMenuItems("#ungroup")}else ja.disableContextMenuItems("#delete,#cut,#copy,#group,#ungroup,#move_front,#move_up,#move_down,#move_back");ha.getUndoStackSize()>0?a("#tool_undo").removeClass("disabled"):a("#tool_undo").addClass("disabled");ha.getRedoStackSize()>0?a("#tool_redo").removeClass("disabled"):a("#tool_redo").addClass("disabled");f.addedNew=false;if(q&&!X||Aa){a("#selLayerNames").removeAttr("disabled").val(A);pa.enableContextMenuItems("#delete,#cut,#copy,#move_front,#move_up,#move_down,#move_back")}else a("#selLayerNames").attr("disabled", -"disabled")};a("#text").focus(function(){});a("#text").blur(function(){});f.bind("selected",function(q,A){var I=f.getMode();I==="select"&&oa();I=I=="pathedit";Z=A.length==1||A[1]==null?A[0]:null;Aa=A.length>=2&&A[1]!=null;if(Z!=null)if(!I){if(Z!=null)switch(Z.tagName){case "use":case "image":case "foreignObject":break;case "g":case "a":for(var R=null,X=Z.getElementsByTagName("*"),ja=0,va=X.length;ja=2&&A[1]!=null;if(!Aa)switch(I){case "rotate":I=f.getRotationAngle(R);a("#angle").val(Math.round(I));a("#tool_reorient").toggleClass("disabled",I==0)}f.runExtensions("elementTransition",{elems:A})}});f.bind("changed",function(q,A){var I=f.getMode();I==="select"&&oa();for(var R=0;R\n'+A;var I=navigator.userAgent;if(~I.indexOf("Chrome")&&a.browser.version>=533||~I.indexOf("MSIE"))D(0,true);else{var R=q.open("data:image/svg+xml;base64,"+ca.encode64(A)),X=a.pref("save_notice_done");if(X!=="all"){var ja=e.notification.saveFromBrowser.replace("%s", -"SVG");if(I.indexOf("Gecko/")!==-1)if(A.indexOf("",{id:"export_canvas"}).hide().appendTo("body");var R=a("#export_canvas")[0];R.width=f.contentW;R.height=f.contentH;canvg(R,A.svg,{renderCallback:function(){var X=R.toDataURL("image/png"); -ba.location.href=X;if(a.pref("export_notice_done")!=="all"){X=e.notification.saveFromBrowser.replace("%s","PNG");if(I.length)X+="\n\n"+e.notification.noteTheseIssues+"\n \u2022 "+I.join("\n \u2022 ");a.pref("export_notice_done","all");ba.alert(X)}}})});f.bind("zoomed",Oa);f.bind("contextset",function(q,A){var I="";if(A){var R="";I=''+f.getCurrentDrawing().getCurrentLayerName()+"";a(A).parentsUntil("#svgcontent > g").andSelf().each(function(){if(this.id){R+=" > "+this.id; -I+=this!==A?' > '+this.id+"":" > "+this.id}});Sa=R}else Sa=null;a("#cur_context_panel").toggle(!!A).html(I);W()});f.bind("extension_added",function(q,A){function I(){if(nb){clearTimeout(nb);nb=null}X||(nb=setTimeout(function(){X=true;za(b.iconsize)},50))}var R=false,X=false,ja=true,va=function(){if(A.callback&&!R&&ja){R=true;A.callback()}},ya=[];A.context_tools&&a.each(A.context_tools,function(Ta,ia){var wb=ia.container_id?' id="'+ia.container_id+'"':"",bb=a("#"+ia.panel);bb.length|| -(bb=a("
",{id:ia.panel}).appendTo("#tools_top"));switch(ia.type){case "tool_button":var Fa='
'+ia.id+"
",Va=a(Fa).appendTo(bb);ia.events&&a.each(ia.events,function(eb,lb){a(Va).bind(eb,lb)});break;case "select":Fa="";var Ha=a(Fa).appendTo(bb).find("select");a.each(ia.events,function(eb,lb){a(Ha).bind(eb, -lb)});break;case "button-select":Fa='';wb=a('
    ').appendTo("#option_lists");ia.colnum&&wb.addClass("optcols"+ia.colnum);a(Fa).appendTo(bb).children();ya.push({elem:"#"+ia.id,list:"#"+ia.id+"_opts",title:ia.title,callback:ia.events.change,cur:"#cur_"+ia.id});break;case "input":Fa="'+ia.label+':';var kb=a(Fa).appendTo(bb).find("input");ia.spindata&&kb.SpinButton(ia.spindata);ia.events&&a.each(ia.events,function(eb,lb){kb.bind(eb,lb)})}});if(A.buttons){var Da={},Ca={},Ba=A.svgicons,tb={};a.each(A.buttons,function(Ta,ia){for(var wb,bb=ia.id,Fa=Ta;a("#"+bb).length;)bb=ia.id+"_"+ ++Fa;if(Ba){Da[bb]=ia.icon;Fa=ia.svgicon?ia.svgicon:ia.id;if(ia.type=="app_menu")Ca["#"+bb+" > div"]=Fa;else Ca["#"+ -bb]=Fa}else wb=ia.type=="menu"?"":a('');var Va,Ha;switch(ia.type){case "mode_flyout":case "mode":Va="tool_button";if(ia.cls)Va+=" "+ia.cls;Ha="#tools_left";break;case "context":Va="tool_button";Ha="#"+ia.panel;a(Ha).length||a("
    ",{id:ia.panel}).appendTo("#tools_top");break;case "menu":Va="menu_item tool_button";Ha="#"+(ia.after||ia.panel);break;case "app_menu":Va="";Ha=ia.parent||"#main_menu ul";a(Ha).length||a("
    ",{id:ia.panel}).appendTo("#tools_top")}var kb=a(ia.list|| -ia.type=="app_menu"?"
  • ":"
    ").attr("id",bb).attr("title",ia.title).addClass(Va);if(!ia.includeWith&&!ia.list){if("position"in ia)a(Ha).children().eq(ia.position).before(kb);else ia.type!="menu"||!ia.after?kb.appendTo(Ha):a(Ha).after(kb);if(ia.type=="mode_flyout"){Fa=a(kb);Va=Fa.parent();if(!Fa.parent().hasClass("tools_flyout")){var eb=Fa[0].id.replace("tool_","tools_"),lb=Fa.clone().attr("id",eb+"_show").append(a("
    ",{"class":"flyout_arrow_horiz"}));Fa.before(lb);Va=Ga(eb,Fa);Va.data("isLibrary", -true);lb.data("isLibrary",true)}Ca["#"+eb+"_show"]=ia.id;bb=tb["#"+Va[0].id]=[{sel:"#"+bb,fn:ia.events.click,icon:ia.id,isDefault:true},Yb]}else if(ia.type=="app_menu"||ia.type=="menu")kb.append(ia.title)}else if(ia.list){kb.addClass("push_button");a("#"+ia.list+"_opts").append(kb);if(ia.isDefault){a("#cur_"+ia.list).append(kb.children().clone());Fa=ia.svgicon?ia.svgicon:ia.id;Ca["#cur_"+ia.list]=Fa}}else if(ia.includeWith){Ha=ia.includeWith;Fa=a(Ha.button);Va=Fa.parent();if(!Fa.parent().hasClass("tools_flyout")){eb= -Fa[0].id.replace("tool_","tools_");lb=Fa.clone().attr("id",eb+"_show").append(a("
    ",{"class":"flyout_arrow_horiz"}));Fa.before(lb);Va=Ga(eb,Fa)}var Yb=oc.getButtonData(Ha.button);if(Ha.isDefault)Ca["#"+eb+"_show"]=ia.id;bb=tb["#"+Va[0].id]=[{sel:"#"+bb,fn:ia.events.click,icon:ia.id,key:ia.key,isDefault:ia.includeWith?ia.includeWith.isDefault:0},Yb];eb="position"in Ha?Ha.position:"last";Yb=Va.children().length;if(!isNaN(eb)&&eb>=0&&eb
    '});a("#palette").append(Za);Za="";a.each(["#FFF","#888","#000"],function(){Za+='
    '});a("#bg_blocks").append(Za);var Ma=a("#bg_blocks div");Ma.each(function(){a(this).click(function(){Ma.removeClass("cur_background");a(this).addClass("cur_background")})});if(a.pref("bkgd_color"))p(a.pref("bkgd_color"),a.pref("bkgd_url")); -else a.pref("bkgd_url")&&p(o.bkgd_color,a.pref("bkgd_url"));if(a.pref("img_save")){b.img_save=a.pref("img_save");a("#image_save_opts input").val([b.img_save])}var ob=function(q){var A=q.value/100;if(A<0.0010)q.value=0.1;else{q=f.getZoom();Oa(window,{width:0,height:0,x:(ra[0].scrollLeft+ra.width()/2)/q,y:(ra[0].scrollTop+ra.height()/2)/q,zoom:A},true)}},xb=function(q,A){if(A==null)A=q.value;a("#group_opacity").val(A);if(!q||!q.handle)a("#opac_slider").slider("option","value",A);f.setOpacity(A/100)}, -fb=function(q,A,I){if(A==null)A=q.value;a("#blur").val(A);var R=false;if(!q||!q.handle){a("#blur_slider").slider("option","value",A);R=true}I?f.setBlurNoUndo(A):f.setBlur(A,R)},ib=function(){window.opera&&a("

    ").hide().appendTo("body").remove()};a("#stroke_style").change(function(){f.setStrokeAttr("stroke-dasharray",a(this).val());ib()});a("#stroke_linejoin").change(function(){f.setStrokeAttr("stroke-linejoin",a(this).val());ib()});a("select").change(function(){a(this).blur()});var Lb=false;a("#selLayerNames").change(function(){var q= -this.options[this.selectedIndex].value,A=e.notification.QmoveElemsToLayer.replace("%s",q),I=function(R){if(R){Lb=true;f.moveSelectedToLayer(q);f.clearSelection();Ab()}};if(q)Lb?I(true):a.confirm(A,I)});a("#font_family").change(function(){f.setFontFamily(this.value)});a("#seg_type").change(function(){f.setSegType(a(this).val())});a("#text").keyup(function(){f.setTextContent(this.value)});a("#image_url").change(function(){Ea(this.value)});a("#link_url").change(function(){this.value.length?f.setLinkURL(this.value): -f.removeHyperlink()});a("#g_title").change(function(){f.setGroupTitle(this.value)});a(".attr_changer").change(function(){var q=this.getAttribute("data-attr"),A=this.value;if(svgedit.units.isValidUnit(q,A,Z))this.blur();else{a.alert(e.notification.invalidAttrValGiven);this.value=Z.getAttribute(q);return false}if(q!=="id")if(isNaN(A))A=f.convertToNum(q,A);else if(d.baseUnit!=="px"){var I=svgedit.units.getTypeMap();if(Z[q]||f.getMode()==="pathedit"||q==="x"||q==="y")A*=I[d.baseUnit]}if(q==="id"){q=Z; -f.clearSelection();q.id=A;f.addToSelection([q],true)}else f.changeSelectedAttribute(q,A);this.blur()});a("#palette").mouseover(function(){var q=a('');a(this).append(q);q.focus().remove()});a(".palette_item").mousedown(function(){var q=a("#tool_stroke").hasClass("active"),A=q?"stroke":"fill",I=a(this).attr("data-rgb"),R=null;if(I==="transparent"||I==="initial"||I==="#none"){I="none";R=new a.jGraduate.Paint}else R=new a.jGraduate.Paint({alpha:100,solidColor:I.substr(1)});la[A].setPaint(R); -if(q){f.setColor("stroke",I);I!="none"&&f.getStrokeOpacity()!=1&&f.setPaintOpacity("stroke",1)}else{f.setColor("fill",I);I!="none"&&f.getFillOpacity()!=1&&f.setPaintOpacity("fill",1)}}).bind("contextmenu",function(q){q.preventDefault()});a("#toggle_stroke_tools").toggle(function(){a(".stroke_tool").css("display","table-cell");a(this).addClass("expanded");Ub()},function(){a(".stroke_tool").css("display","none");a(this).removeClass("expanded");Ub()});var xa=function(q,A){if(a(q).hasClass("disabled"))return false; -if(a(q).parent().hasClass("tools_flyout"))return true;var I=I||"normal";A||a(".tools_flyout").fadeOut(I);a("#styleoverrides").text("");a(".tool_button_current").removeClass("tool_button_current").addClass("tool_button");a(q).addClass("tool_button_current").removeClass("tool_button");return true};(function(){var q=null,A=null,I=ra[0],R=false,X=false;a("#svgcanvas").bind("mousemove mouseup",function(ja){if(R!==false){I.scrollLeft-=ja.clientX-q;I.scrollTop-=ja.clientY-A;q=ja.clientX;A=ja.clientY;if(ja.type=== -"mouseup")R=false;return false}}).mousedown(function(ja){if(ja.button===1||X===true){R=true;q=ja.clientX;A=ja.clientY;return false}});a(window).mouseup(function(){R=false});a(document).bind("keydown","space",function(ja){f.spaceKey=X=true;ja.preventDefault()}).bind("keyup","space",function(ja){ja.preventDefault();f.spaceKey=X=false}).bind("keydown","alt",function(){f.getMode()==="zoom"&&ra.addClass("out")}).bind("keyup","alt",function(){f.getMode()==="zoom"&&ra.removeClass("out")})})();var ub=a(".menu"), -rb=function(q){q.target.style.background="#fff";setTimeout(function(){q.target.style.background="#ddd"},50);setTimeout(function(){q.target.style.background="#fff"},150);setTimeout(function(){q.target.style.background="#ddd"},200);setTimeout(function(){q.target.style.background=""},200);setTimeout(function(){a("#menu_bar").removeClass("active")},220);return false};a(".menu_item").live("click",function(q){rb(q)});a("svg, body").on("mousedown",function(q){top!=self&&!q.isTrigger&&typeof top.exports.setEditorFocus== -"function"&&top.exports.setEditorFocus();if(!a(q.target).hasClass("menu_title"))if(!a(q.target).hasClass("disabled")&&a(q.target).hasClass("menu_item"))rb(q);else{a("#menu_bar").removeClass("active");a("#tools_shapelib").is(":visible")&&!a(q.target).parents("#tools_shapelib_show, #tools_shapelib").length&&a("#tools_shapelib").hide();q.target.nodeName.toLowerCase()!="input"&&a("input").blur()}});var yb=[6,12,16,33,50,66,100,150,200,300,400,600,800,1200];a("#workarea").on("mousewheel",function(q,A, -I,R){if(q.altKey){q.preventDefault();q=f.getZoom()*100;A=yb.length;for(Bb=0;Bb0)zoom=yb[Bb]<=q?yb[I]:zoom;if(R<0)zoom=yb[Bb]"+q+"

    "+ -q+"

    ")}window.canvg?f.rasterExport():a.getScript("canvg/rgbcolor.js",function(){a.getScript("canvg/canvg.js",function(){f.rasterExport()})})},jc=function(){f.open()},Wb=function(){},db=function(q){var A=q.prev();A.css("background","#09f");setTimeout(function(){A.css("background","")},200)},dc=function(){if(ha.getUndoStackSize()>0){window.event.type==="keydown"&&db(a("#edit_menu"));ha.undo();Ab()}},g=function(){if(ha.getRedoStackSize()>0){window.event.type==="keydown"&&db(a("#edit_menu"));ha.redo(); -Ab()}},h=function(){if(Aa)f.groupSelectedElements();else Z&&f.ungroupSelectedElement()},k=function(){window.event.type==="keydown"&&db(a("#edit_menu"));f.cloneSelectedElements(20,20)},v=function(){var q=this.id.replace("tool_align","").charAt(0);f.alignSelectedElements(q,a("#align_relative_to").val())},s=function(){var q=document.querySelector("#tool_stroke rect"),A=document.querySelector("#tool_fill rect"),I=A.getAttribute("fill"),R=q.getAttribute("fill");q=parseFloat(q.getAttribute("stroke-opacity")); -if(isNaN(q))q=100;A=parseFloat(A.getAttribute("fill-opacity"));if(isNaN(A))A=100;R=ab(R,q,"stroke");I=ab(I,A,"fill");la.fill.setPaint(R,true);la.stroke.setPaint(I,true)},E=function(q){var A=f.getResolution();q=q?A.zoom*q:1;a("#zoom").val(q*100);f.setZoom(q);B();Rb(true)},z=function(){!a("#tool_wireframe").hasClass("push_button_pressed")?a("#tool_wireframe").addClass("push_button_pressed"):a("#tool_wireframe").removeClass("push_button_pressed");ra.toggleClass("wireframe");if(!tc){var q=a("#wireframe_rules"); -q.length?q.empty():a('').appendTo("head");B()}},t=function(){f.clearSelection();a("#tool_canvas").trigger("click")},C=function(){window.self!=window.top&&top.exports.setEditorFocus(false)},F=function(){if(a("#tool_rulers").hasClass("push_button_pressed")){a("#tool_rulers").removeClass("push_button_pressed");a("#show_rulers").attr("checked",false);d.showRulers=false}else{a("#tool_rulers").addClass("push_button_pressed");a("#show_rulers").attr("checked",true);d.showRulers= -true}a("#rulers").toggle(!!d.showRulers)},B=function(){if(!tc){var q="#workarea.wireframe #svgcontent * { stroke-width: "+1/f.getZoom()+"px; }";a("#wireframe_rules").text(ra.hasClass("wireframe")?q:"")}},D=function(q,A){if(!Ka){Ka=true;a("#save_output_btns").toggle(!!A);a("#tool_source_back").toggle(!A);var I=sa=f.getSvgString();a("#svg_source_textarea").val(I);a("#svg_source_editor").fadeIn();P();a("#svg_source_textarea").focus()}},H=function(){if(!Ra){Ra=true;a("#image_save_opts input").val([b.img_save]); -var q=f.getResolution();if(d.baseUnit!=="px"){q.w=svgedit.units.convertUnit(q.w)+d.baseUnit;q.h=svgedit.units.convertUnit(q.h)+d.baseUnit}a(".canvas_width").val(q.w);a(".canvas_height").val(q.h);a("#canvas_title").val(f.getDocumentTitle());a("#svg_docprops").show()}},G=function(){if(!Na){Na=true;var q=a("#bg_blocks div"),A=a.pref("bkgd_color"),I=a.pref("bkgd_url");q.each(function(){var R=a(this),X=R.css("background-color")==A;R.toggleClass("cur_background",X);X&&a("#canvas_bg_url").removeClass("cur_background")}); -A||q.eq(0).addClass("cur_background");I&&a("#canvas_bg_url").val(I);a("grid_snapping_step").attr("value",d.snappingStep);d.gridSnapping==true?a("#grid_snapping_on").attr("checked","checked"):a("#grid_snapping_on").removeAttr("checked");a("#svg_prefs").show()}},P=function(){var q=a("#svg_source_container").height()-50;a("#svg_source_textarea").css("height",q)},Q=function(){if(Ka){var q=function(){f.clearSelection();zb();E();Ab();W();la.fill.prep();la.stroke.prep()};f.setSvgString(a("#svg_source_textarea").val())? -q():a.confirm(e.notification.QerrorsRevertToSource,function(A){if(!A)return false;q()});oa()}},W=function(q){q=q||f.getDocumentTitle();q=Wa+(q?": "+q:"");a("title:first").text(q)},ua=function(){var q=a("#canvas_width"),A=q.val(),I=a("#canvas_height"),R=I.val();if(A!="fit"&&!svgedit.units.isValidUnit("width",A)){a.alert(e.notification.invalidAttrValGiven);q.parent().addClass("error");return false}q.parent().removeClass("error");if(R!="fit"&&!svgedit.units.isValidUnit("height",R)){a.alert(e.notification.invalidAttrValGiven); -I.parent().addClass("error");return false}I.parent().removeClass("error");if(!f.setResolution(A,R)){a.alert(e.notification.noContentToFitTo);return false}b.img_save=a("#image_save_opts :checked").val();a.pref("img_save",b.img_save);Rb();Qb()},wa=function(){var q=a("#bg_blocks div.cur_background").css("background-color")||"#FFF";p(q,a("#canvas_bg_url").val());q=a("#lang_select").val();q!=b.lang&&c.putLocale(q);za(a("#iconsize").val());d.gridSnapping=a("#grid_snapping_on")[0].checked;d.snappingStep= -a("#grid_snapping_step").val();d.showRulers=a("#show_rulers")[0].checked;a("#rulers").toggle(d.showRulers);d.showRulers&&da();d.baseUnit=a("#base_unit").val();f.setConfig(d);Rb();Ib()},fa=c.setIcon=function(q,A){var I=typeof A==="string"?a.getSvgIcon(A,true):A.clone();I?a(q).find("img").replaceWith(I):console.log("NOTE: Icon image missing: "+A)},ka;ka=function(){var q=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,A=document.getElementsByTagName("script")[0],I;for(I in A.style)if(q.test(I))return I.match(q)[0]; -if("WebkitOpacity"in A.style)return"Webkit";if("KhtmlOpacity"in A.style)return"Khtml";return""}();var qa=function(q,A){ka.toLowerCase();var I=["top","left","bottom","right"];q.each(function(){for(var R=a(this),X=R.outerWidth()*(A-1),ja=R.outerHeight()*(A-1),va=0;va<4;va++){var ya=I[va],Da=R.data("orig_margin-"+ya);if(Da==null){Da=parseInt(R.css("margin-"+ya));R.data("orig_margin-"+ya,Da)}Da=Da*A;if(ya==="right")Da+=X;else if(ya==="bottom")Da+=ja;R.css("margin-"+ya,Da)}})},za=c.setIconSize=function(q, -A){if(!(q==b.size&&!A)){var I=a("#tools_top .toolset, #editor_panel > *, #history_panel > *,\t\t\t\t#main_button, #tools_left > *, #path_node_panel > *, #multiselected_panel > *,\t\t\t\t#g_panel > *, #tool_font_size > *, .tools_flyout"),R=1;R=typeof q=="number"?q:{s:0.75,m:1,l:1.25,xl:1.5}[q];c.tool_scale=S=R;Cb();var X=I.parents(":hidden");X.css("visibility","hidden").show();qa(I,R);X.css("visibility","visible").hide();a.pref("iconsize",q);a("#iconsize").val(q);X={"#tools_top":{left:50,height:72}, -"#tools_left":{width:31,top:74},"div#workarea":{left:38,top:74}};I=a("#tool_size_rules");if(I.length)I.empty();else I=a('').appendTo("head");if(q!="m"){var ja="";a.each(X,function(va,ya){va="#svg_editor "+va.replace(/,/g,", #svg_editor");ja+=va+"{";a.each(ya,function(Da,Ca){if(typeof Ca==="number")var Ba=Ca*R+"px";else if(Ca[q]||Ca.all)Ba=Ca[q]||Ca.all;ja+=Da+":"+Ba+";"});ja+="}"});X="-"+ka.toLowerCase()+"-";ja+="#tools_top .toolset, #editor_panel > *, #history_panel > *,\t\t\t\t#main_button, #tools_left > *, #path_node_panel > *, #multiselected_panel > *,\t\t\t\t#g_panel > *, #tool_font_size > *, .tools_flyout{"+ -X+"transform: scale("+R+");} #svg_editor div.toolset .toolset {"+X+"transform: scale(1); margin: 1px !important;} #svg_editor .ui-slider {"+X+"transform: scale("+1/R+");}";I.text(ja)}Cb()}},jb=function(){a("#dialog_box").hide();if(!Ka&&!Ra&&!Na)Sa&&f.leaveContext();else{if(Ka)sa!==a("#svg_source_textarea").val()?a.confirm(e.notification.QignoreSourceChanges,function(q){q&&zb()}):zb();else if(Ra)Qb();else Na&&Ib();Ub()}},zb=function(){a("#svg_source_editor").hide();Ka=false;a("#svg_source_textarea").blur()}, -Qb=function(){a("#svg_docprops").hide();a("#canvas_width,#canvas_height").removeAttr("disabled");a("#resolution")[0].selectedIndex=0;a("#image_save_opts input").val([b.img_save]);Ra=false},Ib=function(){a("#svg_prefs").hide();Na=false},Ob={width:a(window).width(),height:a(window).height()},Ub=a.noop,ac;svgedit.browser.isIE()&&function(){Ub=function(){if(ra[0].scrollLeft===0&&ra[0].scrollTop===0){ra[0].scrollLeft=ac.left;ra[0].scrollTop=ac.top}};ac={left:ra[0].scrollLeft,top:ra[0].scrollTop};a(window).resize(Ub); -svgEditor.ready(function(){setTimeout(function(){Ub()},500)});ra.scroll(function(){ac={left:ra[0].scrollLeft,top:ra[0].scrollTop}})}();a(window).resize(function(){Ka&&P();a.each(Ob,function(q,A){var I=a(window)[q]();ra[0]["scroll"+(q==="width"?"Left":"Top")]-=(I-A)/2;Ob[q]=I})});(function(){ra.scroll(function(){if(a("#ruler_x").length!=0)a("#ruler_x")[0].scrollLeft=ra[0].scrollLeft;if(a("#ruler_y").length!=0)a("#ruler_y")[0].scrollTop=ra[0].scrollTop})})();a("#url_notice").click(function(){a.alert(this.title)}); -a("#change_image_url").click(L);(function(){var q=["clear","open","save","source","delete","delete_multi","paste","clone","clone_multi","move_top","move_bottom"],A="";a.each(q,function(I,R){A+="#tool_"+R+(I==q.length-1?",":"")});a(A).mousedown(function(){a(this).addClass("tool_button_current")}).bind("mousedown mouseout",function(){a(this).removeClass("tool_button_current")});a("#tool_undo, #tool_redo").mousedown(function(){a(this).hasClass("disabled")||a(this).addClass("tool_button_current")}).bind("mousedown mouseout", -function(){a(this).removeClass("tool_button_current")})})();if(V&&!window.opera){V=["tool_clear","tool_save","tool_source","tool_undo","tool_redo","tool_clone"];for(var Bb=V.length;Bb--;){var pc=document.getElementById(V[Bb]);if(pc!=null){var qc=pc.title,uc=qc.indexOf("Ctrl+");pc.title=[qc.substr(0,uc),"Cmd+",qc.substr(uc+5)].join("")}}}var rc=function(q){var A=q[0].id=="stroke_color"?"stroke":"fill",I=q[0].id=="canvas_color";if(I)A="canvas";var R=la[A].paint;q=A=="stroke"?"Pick a Stroke Paint and Opacity": -"Pick a Fill Paint and Opacity";I=I?{right:200,top:50}:{left:45,bottom:50};a("#color_picker").draggable({cancel:".jGraduate_tabs, .jGraduate_colPick, .jGraduate_gradPick, .jPicker",containment:"window"}).css(I).jGraduate({paint:R,window:{pickerTitle:q},images:{clientPath:d.jGraduatePath},newstop:"inverse"},function(X){R=new a.jGraduate.Paint(X);la[A].setPaint(R);f.setPaint(A,R);a("#color_picker").hide()},function(){a("#color_picker").hide()})};V=function(q,A){var I=document.getElementById("canvas_background"), -R={color:"#fff",opacity:1};if(A=="stroke")R=d.initStroke;if(A=="fill")R=d.initFill;if(A=="canvas"&&I)if(I=I.getAttribute("fill").match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))R={color:("0"+parseInt(I[1],10).toString(16)).slice(-2)+("0"+parseInt(I[2],10).toString(16)).slice(-2)+("0"+parseInt(I[3],10).toString(16)).slice(-2),opacity:1};I=(new DOMParser).parseFromString('\t\t\t\t\t', -"text/xml").documentElement;I=a(q)[0].appendChild(document.importNode(I,true));I.setAttribute("width",24.5);this.rect=I.firstChild;this.defs=I.getElementsByTagName("defs")[0];this.grad=this.defs.firstChild;this.paint=new a.jGraduate.Paint({solidColor:R.color});this.type=A;this.setPaint=function(X,ja){this.paint=X;var va="none",ya=X.type,Da=X.alpha/100;switch(ya){case "solidColor":va=X[ya]=="none"||X[ya]=="one"?"none":"#"+X[ya];break;case "linearGradient":case "radialGradient":this.defs.removeChild(this.grad); -this.grad=this.defs.appendChild(X[ya]);va="url(#"+(this.grad.id="gradbox_"+this.type)+")"}this.rect.setAttribute("fill",va);this.rect.setAttribute("opacity",Da);if(ja){f.setColor(this.type,va,true);f.setPaintOpacity(this.type,Da,true)}if(this.type=="canvas"){(ya=document.getElementById("canvas_background"))?ya.setAttribute("fill",va):La(va);console.log(ya.getAttribute("fill"))}};this.update=function(X){if(Z){var ja=this.type;switch(Z.tagName){case "use":case "image":case "foreignObject":return;case "g":case "a":for(var va= -null,ya=Z.getElementsByTagName("*"),Da=0,Ca=ya.length;Da300)q=300-I;else if(I+q<2)q=2-I;if(q!=0){bc-=q;I=a("#layerpanel");ra.css("right",parseInt(ra.css("right"))+q);A.css("width", -parseInt(A.css("width"))+q);I.css("width",parseInt(I.css("width"))+q);A=a("#ruler_x");A.css("right",parseInt(A.css("right"))+q)}}};a("#sidepanel_handle").mousedown(function(q){bc=q.pageX;a(window).mousemove(vc);sc=false;setTimeout(function(){sc=true},20)}).mouseup(function(){lc||wc();bc=-1;lc=false});a(window).mouseup(function(){bc=-1;lc=false;a("#svg_editor").unbind("mousemove",vc)});var wc=function(q){var A=parseInt(a("#sidepanels").css("width"));q=(A>2||q?2:150)-A;A=a("#sidepanels");var I=a("#layerpanel"), -R=a("#ruler_x");ra.css("right",parseInt(ra.css("right"))+q);A.css("width",parseInt(A.css("width"))+q);I.css("width",parseInt(I.css("width"))+q);R.css("right",parseInt(R.css("right"))+q)},xc=function(q){for(var A=Array(f.getCurrentDrawing().getNumLayers()),I=0;I'+ja+"":''+ja+"";q.append(va);A.append('")}if(X!==undefined){X.clone();a("td.layervis",q).append(X.clone());a.resizeSvgIcons({"td.layervis .svg_icon":14})}a("#layerlist td.layername").mouseup(function(ya){a("#layerlist tr.layer").removeClass("layersel");a(this.parentNode).addClass("layersel");f.setCurrentLayer(this.textContent);ya.preventDefault()}).mouseover(function(){a(this).css({"font-style":"italic",color:"blue"});xc(this.textContent)}).mouseout(function(){a(this).css({"font-style":"normal",color:"black"});xc()});a("#layerlist td.layervis").click(function(){var ya= -a(this.parentNode).prevAll().length;ya=a("#layerlist tr.layer:eq("+ya+") td.layername").text();var Da=a(this).hasClass("layerinvis");f.setLayerVisibility(ya,Da);Da?a(this).removeClass("layerinvis"):a(this).addClass("layerinvis")});for(A=5-a("#layerlist tr.layer").size();A-- >0;)q.append('_')};Ab();a(window).bind("load resize",function(){ra.css("line-height",ra.height()+"px")});a("#resolution").change(function(){var q=a("#canvas_width,#canvas_height");if(this.selectedIndex)if(this.value== -"content")q.val("fit").attr("disabled","disabled");else{var A=this.value.split("x");a("#canvas_width").val(A[0]);a("#canvas_height").val(A[1]);q.removeAttr("disabled")}else a("#canvas_width").val()=="fit"&&q.removeAttr("disabled").val(100)});a("input,select").attr("autocomplete","off");var oc=function(){var q=[{sel:"#tool_select",fn:Gb,evt:"click",key:["V",true]},{sel:"#tool_fhpath",fn:Hb,evt:"click",key:["Q",true]},{sel:"#tool_line",fn:Mb,evt:"click",key:["L",true]},{sel:"#tool_rect",fn:Nb,evt:"click", -key:["R",true],icon:"rect"},{sel:"#tool_ellipse",fn:ma,evt:"mouseup",key:["C",true],icon:"ellipse"},{sel:"#tool_path",fn:aa,evt:"click",key:["P",true]},{sel:"#tool_text",fn:N,evt:"click",key:["T",true]},{sel:"#tool_image",fn:Y,evt:"mouseup"},{sel:"#tool_zoom",fn:na,evt:"mouseup",key:["Z",true]},{sel:"#tool_clear",fn:mc,evt:"mouseup",key:[ga+"N",true]},{sel:"#tool_save",fn:function(){Ka?Q():f.save({images:b.img_save,round_digits:6})},evt:"mouseup",key:[ga+"S",true]},{sel:"#tool_export",fn:kc,evt:"mouseup"}, -{sel:"#tool_open",fn:jc,evt:"mouseup"},{sel:"#tool_import",fn:Wb,evt:"mouseup"},{sel:"#tool_source",fn:D,evt:"click",key:[ga+"U",true]},{sel:"#tool_wireframe",fn:z,evt:"click"},{sel:"#tool_rulers",fn:F,evt:"click"},{sel:"#tool_source_cancel,#svg_source_overlay,#tool_docprops_cancel,#tool_prefs_cancel",fn:jb,evt:"click",key:["esc",false,false],hidekey:true},{sel:"#tool_source_save",fn:Q,evt:"click"},{sel:"#tool_docprops_save",fn:ua,evt:"click"},{sel:"#tool_docprops",fn:H,evt:"mouseup"},{sel:"#tool_prefs_save", -fn:wa,evt:"click"},{sel:"#tool_prefs_option",fn:function(){G();return false},evt:"mouseup"},{sel:"#tool_delete,#tool_delete_multi",fn:Pa,evt:"click",key:["del/backspace",true]},{sel:"#tool_reorient",fn:$b,evt:"click"},{sel:"#tool_node_link",fn:Ua,evt:"click"},{sel:"#tool_node_clone",fn:ic,evt:"click"},{sel:"#tool_node_delete",fn:ec,evt:"click"},{sel:"#tool_openclose_path",fn:fc,evt:"click"},{sel:"#tool_add_subpath",fn:cc,evt:"click"},{sel:"#tool_move_top",fn:Db,evt:"click",key:ga+"shift+up"},{sel:"#tool_move_bottom", -fn:cb,evt:"click",key:ga+"shift+down"},{sel:"#tool_move_up",fn:Eb,evt:"click",key:[ga+"up",true]},{sel:"#tool_move_down",fn:$a,evt:"click",key:[ga+"down",true]},{sel:"#tool_topath",fn:Pb,evt:"click"},{sel:"#tool_make_link,#tool_make_link_multi",fn:Zb,evt:"click"},{sel:"#tool_clone,#tool_clone_multi",fn:k,evt:"click",key:[ga+"D",true]},{sel:"#tool_group",fn:h,evt:"click",key:[ga+"G",true]},{sel:"#tool_ungroup",fn:h,evt:"click",key:ga+"shift+G"},{sel:"#tool_unlink_use",fn:h,evt:"click"},{sel:"[id^=tool_align]", -fn:v,evt:"click"},{sel:"#tool_switch",fn:s,evt:"click",key:["shift+x",true]},{sel:"#tool_undo",fn:dc,evt:"click",key:ga+"z"},{sel:"#tool_redo",fn:g,evt:"click",key:["y",true]},{sel:"#tool_canvas_color_menu",fn:t,evt:"click"},{sel:"#tool_cut",fn:Xa,evt:"click",key:ga+"x"},{sel:"#tool_copy",fn:hb,evt:"click",key:ga+"c"},{sel:"#tool_paste",fn:pb,evt:"click",key:ga+"v"},{sel:"#tool_bold",fn:Vb,evt:"mousedown",key:[ga+"B",true]},{sel:"#tool_italic",fn:vb,evt:"mousedown",key:[ga+"I",true]},{sel:"#copy_save_done", -fn:jb,evt:"click"},{key:"ctrl+left",fn:function(){Sb(0,1)}},{key:"ctrl+right",fn:function(){Sb(1,1)}},{key:"ctrl+shift+left",fn:function(){Sb(0,5)}},{key:"ctrl+shift+right",fn:function(){Sb(1,5)}},{key:"shift+O",fn:Tb},{key:"shift+P",fn:gc},{key:[ga+"+",true],fn:function(){E(2)}},{key:[ga+"-",true],fn:function(){E(0.5)}},{key:["up",true],fn:function(){gb(0,-1)}},{key:["down",true],fn:function(){gb(0,1)}},{key:["left",true],fn:function(){gb(-1,0)}},{key:["right",true],fn:function(){gb(1,0)}},{key:"shift+up", -fn:function(){gb(0,-10)}},{key:"shift+down",fn:function(){gb(0,10)}},{key:"shift+left",fn:function(){gb(-10,0)}},{key:"shift+right",fn:function(){gb(10,0)}},{key:["alt+up",true],fn:function(){f.cloneSelectedElements(0,-1)}},{key:["alt+down",true],fn:function(){f.cloneSelectedElements(0,1)}},{key:["alt+left",true],fn:function(){f.cloneSelectedElements(-1,0)}},{key:["alt+right",true],fn:function(){f.cloneSelectedElements(1,0)}},{key:["alt+shift+up",true],fn:function(){f.cloneSelectedElements(0,-10)}}, -{key:["alt+shift+down",true],fn:function(){f.cloneSelectedElements(0,10)}},{key:["alt+shift+left",true],fn:function(){f.cloneSelectedElements(-10,0)}},{key:["alt+shift+right",true],fn:function(){f.cloneSelectedElements(10,0)}},{key:ga+"A",fn:function(){f.selectAllInCurrentLayer()}},{key:ga+"shift+z",fn:g},{key:"esc",fn:C}],A={"4/Shift+4":"#tools_rect_show","5/Shift+5":"#tools_ellipse_show"};return{setAll:function(){var I={};a.each(q,function(R,X){if(X.sel){var ja=a(X.sel);if(ja.length==0)return true; -if(X.evt){if(svgedit.browser.isTouch()&&X.evt==="click")X.evt="mousedown";ja[X.evt](X.fn)}if(X.parent&&a(X.parent+"_show").length!=0){var va=a(X.parent);va.length||(va=Ga(X.parent.substr(1)));va.append(ja);a.isArray(I[X.parent])||(I[X.parent]=[]);I[X.parent].push(X)}}if(X.key){var ya=X.fn,Da=false;if(a.isArray(X.key)){va=X.key[0];if(X.key.length>1)Da=X.key[1]}else va=X.key;va+="";svgedit.browser.isMac&&va.indexOf("+")!=-1&&va.split("+")[0]=="ctrl"&&va.replace("ctrl","cmd");a.each(va.split("/"),function(Ba, -tb){a(document).bind("keydown",tb,function(Ta){ya();Da&&Ta.preventDefault();return false})});if(X.sel&&!X.hidekey&&ja.attr("title")){var Ca=ja.attr("title").split("[")[0]+" ("+va+")";A[va]=X.sel;ja.parents("#main_menu").length||ja.attr("title",Ca)}}});Qa(I);a(".attr_changer, #image_url").bind("keydown","return",function(R){a(this).change();R.preventDefault()});a(window).bind("keydown","tab",function(R){if(U==="canvas"){R.preventDefault();gc()}}).bind("keydown","shift+tab",function(R){if(U==="canvas"){R.preventDefault(); -Tb()}});a("#tool_zoom").dblclick(K)},setTitles:function(){a.each(A,function(I,R){var X=a(R).parents("#main_menu").length;a(R).each(function(){var ja=X?a(this).text().split(" [")[0]:this.title.split(" [")[0],va="";a.each(I.split("/"),function(ya,Da){var Ca=Da.split("+"),Ba="";if(Ca.length>1){Ba=Ca[0]+"+";Da=Ca[1]}va+=(ya?"/":"")+Ba+(e["key_"+Da]||Da)});if(X)this.lastChild.textContent=ja+" ["+va+"]";else this.title=ja+" ["+va+"]"})})},getButtonData:function(I){var R;a.each(q,function(X,ja){if(ja.sel=== -I)R=ja});return R}}}();oc.setAll();c.ready(function(){var q=d.initTool,A=a("#tools_left, #svg_editor .tools_flyout"),I=A.find("#tool_"+q);q=A.find("#"+q);(I.length?I:q.length?q:a("#tool_select")).click().mouseup();d.wireframe&&a("#tool_wireframe").click();d.showlayers&&wc();a("#rulers").toggle(!!d.showRulers);if(d.showRulers)a("#show_rulers")[0].checked=true;if(d.gridSnapping)a("#grid_snapping_on")[0].checked=true;d.baseUnit&&a("#base_unit").val(d.baseUnit);d.snappingStep&&a("#grid_snapping_step").val(d.snappingStep)}); -a("#rect_rx").SpinButton({min:0,max:1E3,step:1,callback:function(q){f.setRectRadius(q.value)}});a("#stroke_width").SpinButton({min:0,max:99,step:1,smallStep:0.1,callback:function(q){var A=q.value;if(A==0&&Z&&["line","polyline"].indexOf(Z.nodeName)>=0)A=q.value=1;f.setStrokeWidth(A)}});a("#angle").SpinButton({min:-180,max:180,step:5,callback:function(q){f.setRotationAngle(q.value);a("#tool_reorient").toggleClass("disabled",q.value==0)}});a("#font_size").SpinButton({step:1,min:0.0010,stepfunc:function(q, -A){var I=q.value-0,R=I+A,X=R>=I;if(A===0)return I;return I>=24?X?Math.round(I*1.1):Math.round(I/1.1):I<=1?X?I*2:I/2:R},callback:function(q){f.setFontSize(q.value)}});a("#group_opacity").SpinButton({step:5,min:0,max:100,callback:xb});a("#blur").SpinButton({step:0.1,min:0,max:10,callback:fb});a("#zoom").SpinButton({min:0.0010,max:1E4,step:50,stepfunc:function(q,A){var I=q.value-0;if(I===0)return 100;var R=I+A;if(A===0)return I;return I>=100?R:R>=I?I*2:I/2},callback:ob}).val(f.getZoom()*100);a("#workarea").contextMenu({menu:"cmenu_canvas", -inSpeed:0},function(q){switch(q){case "delete":Pa();break;case "cut":Xa();break;case "copy":hb();break;case "paste":f.pasteElements();break;case "paste_in_place":f.pasteElements("in_place");break;case "group":f.groupSelectedElements();break;case "ungroup":f.ungroupSelectedElement();break;case "move_front":Db();break;case "move_up":Fb("Up");break;case "move_down":Fb("Down");break;case "move_back":cb();break;default:svgedit.contextmenu&&svgedit.contextmenu.hasCustomHandler(q)&&svgedit.contextmenu.getCustomHandler(q).call()}f.clipBoard.length&& -pa.enableContextMenuItems("#paste,#paste_in_place")});V=function(q){switch(q){case "dupe":M();break;case "delete":T();break;case "merge_down":if(a("#layerlist tr.layersel").index()!=f.getCurrentDrawing().getNumLayers()-1){f.mergeLayer();Ja();Ab()}break;case "merge_all":f.mergeAllLayers();Ja();Ab()}};a("#layerlist").contextMenu({menu:"cmenu_layers",inSpeed:0},V);a("#layer_moreopts").contextMenu({menu:"cmenu_layers",inSpeed:0,allowLeft:true},V);a(".contextMenu li").mousedown(function(q){q.preventDefault()}); -a("#cmenu_canvas li").disableContextMenu();pa.enableContextMenuItems("#delete,#cut,#copy");window.onbeforeunload=function(){if(ha.getUndoStackSize()===0)c.show_save_warning=false;if(!d.no_save_warning&&c.show_save_warning)return e.notification.unsavedChanges};c.openPrep=function(q){a("#main_menu").hide();ha.getUndoStackSize()===0?q(true):a.confirm(e.notification.QwantToOpen,q)};if(window.FileReader){V=a('').change(function(){var q=this;c.openPrep(function(A){if(A){f.clear();if(q.files.length== -1){A=new FileReader;A.onloadend=function(I){n(I.target.result);Rb()};A.readAsText(q.files[0])}}})});a("#tool_open").show().prepend(V);V=a('').change(function(){a("#main_menu").hide();if(this.files.length==1){var q=new FileReader;q.onloadend=function(A){f.importSvgString(A.target.result,true);Rb()};q.readAsText(this.files[0])}});a("#tool_import").show().prepend(V)}var Rb=c.updateCanvas=function(q,A){var I=ra.width(),R=ra.height(),X=I,ja=R,va=f.getZoom(),ya=a("#svgcanvas"),Da={x:ra[0].scrollLeft+ -X/2,y:ra[0].scrollTop+ja/2},Ca=d.canvas_expansion;I=Math.max(X,f.contentW*va*Ca);R=Math.max(ja,f.contentH*va*Ca);I==X&&R==ja?ra.css("overflow","hidden"):ra.css("overflow","scroll");Ca=ya.height()/2;var Ba=ya.width()/2;ya.width(I).height(R);var tb=R/2,Ta=I/2,ia=f.updateCanvas(I,R),wb=Ta/Ba;I=I/2-X/2;R=R/2-ja/2;if(A){A.x+=ia.x;A.y+=ia.y}else A={x:Ta+(Da.x-Ba)*wb,y:tb+(Da.y-Ca)*wb};if(q)if(f.contentW>ra.width()){ra[0].scrollLeft=ia.x-10;ra[0].scrollTop=ia.y-10}else{ra[0].scrollLeft=I;ra[0].scrollTop= -R}else{ra[0].scrollLeft=A.x-X/2;ra[0].scrollTop=A.y-ja/2}if(d.showRulers){da(ya,va);ra.scroll()}},hc=[];for(Bb=0.1;Bb<1E5;Bb*=10){hc.push(1*Bb);hc.push(2*Bb);hc.push(5*Bb)}Rb(true);try{var yc=function(q){if(window.JSON&&JSON.stringify)return JSON.stringify(q);var A=arguments.callee;if(typeof q=="boolean"||typeof q=="number")return q+"";else if(typeof q=="string")return'"'+q.replace(/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, -function(X){return"\\u"+("0000"+X.charCodeAt(0).toString(16)).slice(-4)})+'"';else if(q.length){for(var I=0;I=0)a("#xy_panel").hide();else{var Da,Ca;if(["g","polyline", +"path"].indexOf(va)>=0){if(I=f.getStrokedBBox([q])){Da=I.x;Ca=I.y}}else{Da=q.getAttribute("x");Ca=q.getAttribute("y")}if(R){Da=svgedit.units.convertUnit(Da);Ca=svgedit.units.convertUnit(Ca)}a("#selected_x").val(Math.round(Ca)||0);a("#selected_y").val(Math.round(Da)||0);a("#xy_panel").show()}["image","text","path","g","use"].indexOf(va)==-1&&a(".action_path_convert_selected").removeClass("disabled");va==="path"&&a(".action_path_selected").removeClass("disabled")}else{A=ta.getNodePoint();a("#tool_add_subpath").removeClass("push_button_pressed").addClass("tool_button"); +a("#tool_node_delete").toggleClass("disabled",!ta.canDeleteNodes);fa("#tool_openclose_path",ta.closed_subpath?"open_path":"close_path");if(A){X=a("#seg_type");if(R){A.x=svgedit.units.convertUnit(A.x);A.y=svgedit.units.convertUnit(A.y)}a("#path_node_x").val(Math.round(A.x));a("#path_node_y").val(Math.round(A.y));A.type?X.val(A.type).removeAttr("disabled"):X.val(4).attr("disabled","disabled")}return}R={g:[],a:[],rect:["rx","width","height"],image:["width","height"],circle:["cx","cy","r"],ellipse:["cx", +"cy","rx","ry"],line:["x1","y1","x2","y2"],text:[],use:[]};var Ba=q.tagName;a(q).data("gsvg")&&a("#g_panel").show();Ba=="path"&&a("#path_panel").show();if(R[Ba]){R=R[Ba];a("#"+Ba+"_panel").show();a.each(R,function(tb,Ta){var ia=q.getAttribute(Ta);if(d.baseUnit!=="px"&&q[Ta])ia=svgedit.units.convertUnit(q[Ta].baseVal.value);a("#"+Ba+"_"+Ta).val(Math.round(ia)||0)});if(Ba=="text"){a("#text_panel").css("display","inline");f.getItalic()?a("#tool_italic").addClass("push_button_pressed").removeClass("tool_button"): +a("#tool_italic").removeClass("push_button_pressed").addClass("tool_button");f.getBold()?a("#tool_bold").addClass("push_button_pressed").removeClass("tool_button"):a("#tool_bold").removeClass("push_button_pressed").addClass("tool_button");a("#font_family").val(q.getAttribute("font-family"));a("#font_size").val(q.getAttribute("font-size"));a("#text").val(q.textContent);f.addedNew&&setTimeout(function(){a("#text").focus().select()},100)}else if(Ba=="image")Ea(f.getHref(q));else if(Ba==="g"||Ba==="use"){a("#container_panel").show(); +a(".action_group_selected").removeClass("disabled");R=f.getTitle();va=a("#g_title")[0];va.value=R;qb(va);Ba=="use"?va.setAttribute("disabled","disabled"):va.removeAttribute("disabled")}}ja[(Ba==="g"?"en":"dis")+"ableContextMenuItems"]("#ungroup");ja[(Ba==="g"||!Aa?"dis":"en")+"ableContextMenuItems"]("#group")}else if(Aa){a("#multiselected_panel").show();a(".action_multi_selected").removeClass("disabled");ja.enableContextMenuItems("#group").disableContextMenuItems("#ungroup")}else ja.disableContextMenuItems("#delete,#cut,#copy,#group,#ungroup,#move_front,#move_up,#move_down,#move_back"); +ha.getUndoStackSize()>0?a("#tool_undo").removeClass("disabled"):a("#tool_undo").addClass("disabled");ha.getRedoStackSize()>0?a("#tool_redo").removeClass("disabled"):a("#tool_redo").addClass("disabled");f.addedNew=false;if(q&&!X||Aa){a("#selLayerNames").removeAttr("disabled").val(A);pa.enableContextMenuItems("#delete,#cut,#copy,#move_front,#move_up,#move_down,#move_back")}else a("#selLayerNames").attr("disabled","disabled")};a("#text").focus(function(){});a("#text").blur(function(){});f.bind("selected", +function(q,A){var I=f.getMode();I==="select"&&oa();I=I=="pathedit";Z=A.length==1||A[1]==null?A[0]:null;Aa=A.length>=2&&A[1]!=null;if(Z!=null)if(!I){if(Z!=null)switch(Z.tagName){case "use":case "image":case "foreignObject":break;case "g":case "a":for(var R=null,X=Z.getElementsByTagName("*"),ja=0,va=X.length;ja=2&&A[1]!=null;if(!Aa)switch(I){case "rotate":I=f.getRotationAngle(R);a("#angle").val(Math.round(I));a("#tool_reorient").toggleClass("disabled",I==0)}f.runExtensions("elementTransition",{elems:A})}});f.bind("changed",function(q,A){var I=f.getMode();I==="select"&&oa();for(var R=0;R\n'+A;var I=navigator.userAgent;if(~I.indexOf("Chrome")&&a.browser.version>=533||~I.indexOf("MSIE"))D(0,true);else{var R=q.open("data:image/svg+xml;base64,"+ca.encode64(A)),X=a.pref("save_notice_done");if(X!=="all"){var ja=e.notification.saveFromBrowser.replace("%s","SVG");if(I.indexOf("Gecko/")!==-1)if(A.indexOf("",{id:"export_canvas"}).hide().appendTo("body");var R=a("#export_canvas")[0];R.width=f.contentW;R.height=f.contentH;canvg(R,A.svg,{renderCallback:function(){var X=R.toDataURL("image/png");ba.location.href=X;if(a.pref("export_notice_done")!=="all"){X=e.notification.saveFromBrowser.replace("%s", +"PNG");if(I.length)X+="\n\n"+e.notification.noteTheseIssues+"\n \u2022 "+I.join("\n \u2022 ");a.pref("export_notice_done","all");ba.alert(X)}}})});f.bind("zoomed",Oa);f.bind("contextset",function(q,A){var I="";if(A){var R="";I=''+f.getCurrentDrawing().getCurrentLayerName()+"";a(A).parentsUntil("#svgcontent > g").andSelf().each(function(){if(this.id){R+=" > "+this.id;I+=this!==A?' > '+this.id+"":" > "+this.id}});Sa=R}else Sa=null;a("#cur_context_panel").toggle(!!A).html(I); +W()});f.bind("extension_added",function(q,A){function I(){if(nb){clearTimeout(nb);nb=null}X||(nb=setTimeout(function(){X=true;za(b.iconsize)},50))}var R=false,X=false,ja=true,va=function(){if(A.callback&&!R&&ja){R=true;A.callback()}},ya=[];A.context_tools&&a.each(A.context_tools,function(Ta,ia){var wb=ia.container_id?' id="'+ia.container_id+'"':"",bb=a("#"+ia.panel);bb.length||(bb=a("
    ",{id:ia.panel}).appendTo("#tools_top").hide());switch(ia.type){case "tool_button":var Fa='
    '+ +ia.id+"
    ",Va=a(Fa).appendTo(bb);ia.events&&a.each(ia.events,function(eb,lb){a(Va).bind(eb,lb)});break;case "select":Fa="";var Ha=a(Fa).appendTo(bb).find("select");a.each(ia.events,function(eb,lb){a(Ha).bind(eb,lb)});break;case "button-select":Fa='';wb=a('
      ').appendTo("#option_lists");ia.colnum&&wb.addClass("optcols"+ia.colnum);a(Fa).appendTo(bb).children();ya.push({elem:"#"+ia.id,list:"#"+ia.id+"_opts",title:ia.title,callback:ia.events.change,cur:"#cur_"+ia.id});break;case "input":Fa="'+ia.label+':'; +var kb=a(Fa).appendTo(bb).find("input");ia.spindata&&kb.SpinButton(ia.spindata);ia.events&&a.each(ia.events,function(eb,lb){kb.bind(eb,lb)})}});if(A.buttons){var Da={},Ca={},Ba=A.svgicons,tb={};a.each(A.buttons,function(Ta,ia){for(var wb,bb=ia.id,Fa=Ta;a("#"+bb).length;)bb=ia.id+"_"+ ++Fa;if(Ba){Da[bb]=ia.icon;Fa=ia.svgicon?ia.svgicon:ia.id;if(ia.type=="app_menu")Ca["#"+bb+" > div"]=Fa;else Ca["#"+bb]=Fa}else wb=ia.type=="menu"?"":a('');var Va,Ha;switch(ia.type){case "mode_flyout":case "mode":Va= +"tool_button";if(ia.cls)Va+=" "+ia.cls;Ha="#tools_left";break;case "context":Va="tool_button";Ha="#"+ia.panel;a(Ha).length||a("
      ",{id:ia.panel}).appendTo("#tools_top");break;case "menu":Va="menu_item tool_button";Ha="#"+(ia.after||ia.panel);break;case "app_menu":Va="";Ha=ia.parent||"#main_menu ul";a(Ha).length||a("
      ",{id:ia.panel}).appendTo("#tools_top")}var kb=a(ia.list||ia.type=="app_menu"?"
    • ":"
      ").attr("id",bb).attr("title",ia.title).addClass(Va);if(!ia.includeWith&&!ia.list){if("position"in +ia)a(Ha).children().eq(ia.position).before(kb);else ia.type!="menu"||!ia.after?kb.appendTo(Ha):a(Ha).after(kb);if(ia.type=="mode_flyout"){Fa=a(kb);Va=Fa.parent();if(!Fa.parent().hasClass("tools_flyout")){var eb=Fa[0].id.replace("tool_","tools_"),lb=Fa.clone().attr("id",eb+"_show").append(a("
      ",{"class":"flyout_arrow_horiz"}));Fa.before(lb);Va=Ga(eb,Fa);Va.data("isLibrary",true);lb.data("isLibrary",true)}Ca["#"+eb+"_show"]=ia.id;bb=tb["#"+Va[0].id]=[{sel:"#"+bb,fn:ia.events.click,icon:ia.id,isDefault:true}, +Yb]}else if(ia.type=="app_menu"||ia.type=="menu")kb.append(ia.title)}else if(ia.list){kb.addClass("push_button");a("#"+ia.list+"_opts").append(kb);if(ia.isDefault){a("#cur_"+ia.list).append(kb.children().clone());Fa=ia.svgicon?ia.svgicon:ia.id;Ca["#cur_"+ia.list]=Fa}}else if(ia.includeWith){Ha=ia.includeWith;Fa=a(Ha.button);Va=Fa.parent();if(!Fa.parent().hasClass("tools_flyout")){eb=Fa[0].id.replace("tool_","tools_");lb=Fa.clone().attr("id",eb+"_show").append(a("
      ",{"class":"flyout_arrow_horiz"})); +Fa.before(lb);Va=Ga(eb,Fa)}var Yb=oc.getButtonData(Ha.button);if(Ha.isDefault)Ca["#"+eb+"_show"]=ia.id;bb=tb["#"+Va[0].id]=[{sel:"#"+bb,fn:ia.events.click,icon:ia.id,key:ia.key,isDefault:ia.includeWith?ia.includeWith.isDefault:0},Yb];eb="position"in Ha?Ha.position:"last";Yb=Va.children().length;if(!isNaN(eb)&&eb>=0&&eb
      '});a("#palette").append(Za); +Za="";a.each(["#FFF","#888","#000"],function(){Za+='
      '});a("#bg_blocks").append(Za);var Ma=a("#bg_blocks div");Ma.each(function(){a(this).click(function(){Ma.removeClass("cur_background");a(this).addClass("cur_background")})});if(a.pref("bkgd_color"))p(a.pref("bkgd_color"),a.pref("bkgd_url"));else a.pref("bkgd_url")&&p(o.bkgd_color,a.pref("bkgd_url"));if(a.pref("img_save")){b.img_save=a.pref("img_save");a("#image_save_opts input").val([b.img_save])}var ob= +function(q){var A=q.value/100;if(A<0.0010)q.value=0.1;else{q=f.getZoom();Oa(window,{width:0,height:0,x:(ra[0].scrollLeft+ra.width()/2)/q,y:(ra[0].scrollTop+ra.height()/2)/q,zoom:A},true)}},xb=function(q,A){if(A==null)A=q.value;a("#group_opacity").val(A);if(!q||!q.handle)a("#opac_slider").slider("option","value",A);f.setOpacity(A/100)},fb=function(q,A,I){if(A==null)A=q.value;a("#blur").val(A);var R=false;if(!q||!q.handle){a("#blur_slider").slider("option","value",A);R=true}I?f.setBlurNoUndo(A):f.setBlur(A, +R)},ib=function(){window.opera&&a("

      ").hide().appendTo("body").remove()};a("#stroke_style").change(function(){f.setStrokeAttr("stroke-dasharray",a(this).val());ib()});a("#stroke_linejoin").change(function(){f.setStrokeAttr("stroke-linejoin",a(this).val());ib()});a("select").change(function(){a(this).blur()});var Lb=false;a("#selLayerNames").change(function(){var q=this.options[this.selectedIndex].value,A=e.notification.QmoveElemsToLayer.replace("%s",q),I=function(R){if(R){Lb=true;f.moveSelectedToLayer(q); +f.clearSelection();Ab()}};if(q)Lb?I(true):a.confirm(A,I)});a("#font_family").change(function(){f.setFontFamily(this.value)});a("#seg_type").change(function(){f.setSegType(a(this).val())});a("#text").keyup(function(){f.setTextContent(this.value)});a("#image_url").change(function(){Ea(this.value)});a("#link_url").change(function(){this.value.length?f.setLinkURL(this.value):f.removeHyperlink()});a("#g_title").change(function(){f.setGroupTitle(this.value)});a(".attr_changer").change(function(){var q= +this.getAttribute("data-attr"),A=this.value;if(svgedit.units.isValidUnit(q,A,Z))this.blur();else{a.alert(e.notification.invalidAttrValGiven);this.value=Z.getAttribute(q);return false}if(q!=="id")if(isNaN(A))A=f.convertToNum(q,A);else if(d.baseUnit!=="px"){var I=svgedit.units.getTypeMap();if(Z[q]||f.getMode()==="pathedit"||q==="x"||q==="y")A*=I[d.baseUnit]}if(q==="id"){q=Z;f.clearSelection();q.id=A;f.addToSelection([q],true)}else f.changeSelectedAttribute(q,A);this.blur()});a("#palette").mouseover(function(){var q= +a('');a(this).append(q);q.focus().remove()});a(".palette_item").mousedown(function(){var q=a("#tool_stroke").hasClass("active"),A=q?"stroke":"fill",I=a(this).attr("data-rgb"),R=null;if(I==="transparent"||I==="initial"||I==="#none"){I="none";R=new a.jGraduate.Paint}else R=new a.jGraduate.Paint({alpha:100,solidColor:I.substr(1)});la[A].setPaint(R);if(q){f.setColor("stroke",I);I!="none"&&f.getStrokeOpacity()!=1&&f.setPaintOpacity("stroke",1)}else{f.setColor("fill",I);I!="none"&& +f.getFillOpacity()!=1&&f.setPaintOpacity("fill",1)}}).bind("contextmenu",function(q){q.preventDefault()});a("#toggle_stroke_tools").toggle(function(){a(".stroke_tool").css("display","table-cell");a(this).addClass("expanded");Ub()},function(){a(".stroke_tool").css("display","none");a(this).removeClass("expanded");Ub()});var xa=function(q,A){if(a(q).hasClass("disabled"))return false;if(a(q).parent().hasClass("tools_flyout"))return true;var I=I||"normal";A||a(".tools_flyout").fadeOut(I);a("#styleoverrides").text(""); +a(".tool_button_current").removeClass("tool_button_current").addClass("tool_button");a(q).addClass("tool_button_current").removeClass("tool_button");return true};(function(){var q=null,A=null,I=ra[0],R=false,X=false;a("#svgcanvas").bind("mousemove mouseup",function(ja){if(R!==false){I.scrollLeft-=ja.clientX-q;I.scrollTop-=ja.clientY-A;q=ja.clientX;A=ja.clientY;if(ja.type==="mouseup")R=false;return false}}).mousedown(function(ja){if(ja.button===1||X===true){R=true;q=ja.clientX;A=ja.clientY;return false}}); +a(window).mouseup(function(){R=false});a(document).bind("keydown","space",function(ja){f.spaceKey=X=true;ja.preventDefault()}).bind("keyup","space",function(ja){ja.preventDefault();f.spaceKey=X=false}).bind("keydown","alt",function(){f.getMode()==="zoom"&&ra.addClass("out")}).bind("keyup","alt",function(){f.getMode()==="zoom"&&ra.removeClass("out")})})();var ub=a(".menu"),rb=function(q){q.target.style.background="#fff";setTimeout(function(){q.target.style.background="#ddd"},50);setTimeout(function(){q.target.style.background= +"#fff"},150);setTimeout(function(){q.target.style.background="#ddd"},200);setTimeout(function(){q.target.style.background=""},200);setTimeout(function(){a("#menu_bar").removeClass("active")},220);return false};a(".menu_item").live("click",function(q){rb(q)});a("svg, body").on("mousedown",function(q){top!=self&&!q.isTrigger&&typeof top.exports.setEditorFocus=="function"&&top.exports.setEditorFocus();if(!a(q.target).hasClass("menu_title"))if(!a(q.target).hasClass("disabled")&&a(q.target).hasClass("menu_item"))rb(q); +else{a("#menu_bar").removeClass("active");a("#tools_shapelib").is(":visible")&&!a(q.target).parents("#tools_shapelib_show, #tools_shapelib").length&&a("#tools_shapelib").hide();q.target.nodeName.toLowerCase()!="input"&&a("input").blur()}});var yb=[6,12,16,33,50,66,100,150,200,300,400,600,800,1200];a("#workarea").on("mousewheel",function(q,A,I,R){if(q.altKey){q.preventDefault();q=f.getZoom()*100;A=yb.length;for(Bb=0;Bb0)zoom=yb[Bb]<=q?yb[I]:zoom;if(R<0)zoom=yb[Bb]< +q?yb[Bb]:zoom}zoom&&ob({value:zoom})}});a(".menu_title").on("click",function(){a("#menu_bar").toggleClass("active")});a(".menu_title").on("mouseover",function(){ub.removeClass("open");a(this).parent().addClass("open")});c.addDropDown=function(q,A,I){if(a(q).length!=0){var R=a(q).find("button"),X=a(q).find("ul").attr("id",a(q)[0].id+"-list");I||a("#option_lists").append(X);var ja=false;I&&a(q).addClass("dropup");X.find("li").bind("mouseup",A);a(window).mouseup(function(){if(!ja){R.removeClass("down"); +X.hide()}ja=false});R.bind("mousedown",function(){if(R.hasClass("down")){R.removeClass("down");X.hide()}else{R.addClass("down");if(!I){var va=a(q).offset();X.css({top:va.top,left:va.left-110})}X.show();ja=true}}).hover(function(){ja=true}).mouseout(function(){ja=false})}};var sb=function(q,A,I,R){var X=a(q);A=a(A);var ja=false,va=R.dropUp;va&&a(q).addClass("dropup");A.find("li").bind("mouseup",function(){if(R.seticon){fa("#cur_"+X[0].id,a(this).children());a(this).addClass("current").siblings().removeClass("current")}I.apply(this, +arguments)});a(window).mouseup(function(){if(!ja){X.removeClass("down");A.hide();A.css({top:0,left:0})}ja=false});A.height();a(q).bind("mousedown",function(){var ya=a(q).offset();if(va){ya.top-=A.height();ya.left+=8}else ya.top+=a(q).height();a(A).offset(ya);if(X.hasClass("down")){X.removeClass("down");A.hide();A.css({top:0,left:0})}else{X.addClass("down");A.show();ja=true;return false}}).hover(function(){ja=true}).mouseout(function(){ja=false});R.multiclick&&A.mousedown(function(){ja=true})};c.addDropDown("#font_family_dropdown", +function(){a(this).text();a("#font_family").val(a(this).text()).change()});c.addDropDown("#opacity_dropdown",function(){if(!a(this).find("div").length){var q=parseInt(a(this).text().split("%")[0]);xb(false,q)}},false);a("#opac_slider").slider({start:function(){a("#opacity_dropdown li:not(.special)").hide()},stop:function(){a("#opacity_dropdown li").show();a(window).mouseup()},slide:function(q,A){xb(A)}});c.addDropDown("#blur_dropdown",a.noop);var mb=false;a("#blur_slider").slider({max:10,step:0.1, +stop:function(q,A){mb=false;fb(A);a("#blur_dropdown li").show();a(window).mouseup()},start:function(){mb=true},slide:function(q,A){fb(A,null,mb)}});c.addDropDown("#zoom_dropdown",function(){var q=a(this),A=q.attr("data-val");A?Oa(window,A):ob({value:parseInt(q.text())})},true);sb("#stroke_linecap","#linecap_opts",function(){w(this,true)},{dropUp:true});sb("#stroke_linejoin","#linejoin_opts",function(){w(this,true)},{dropUp:true});a("div","#position_opts").each(function(){this.addEventListener("mouseup", +function(){var q=this.id.replace("tool_pos","").charAt(0);f.alignSelectedElements(q,"page")})});(function(){var q,A=function(){a(q).blur()};a("#svg_editor").find("button, select, input:not(#text)").focus(function(){q=this;U="toolbars";ra.mousedown(A)}).blur(function(){U="canvas";ra.unbind("mousedown",A);f.getMode()=="textedit"&&a("#text").focus()})})();var Gb=function(){if(xa("#tool_select")){f.setMode("select");a("#styleoverrides").text("#svgcanvas svg *{cursor:move;pointer-events:all}, #svgcanvas svg{cursor:default}")}}, +Hb=function(){xa("#tool_fhpath")&&f.setMode("fhpath")},Mb=function(){xa("#tool_line")&&f.setMode("line")},Nb=function(){xa("#tool_rect")&&f.setMode("rect")},ma=function(){xa("#tool_ellipse")&&f.setMode("ellipse")},Y=function(){xa("#tool_image")&&f.setMode("image")},na=function(){xa("#tool_zoom")&&f.setMode("zoom")},K=function(){if(xa("#tool_zoom")){E();oa()}},N=function(){xa("#tool_text")&&f.setMode("text")},aa=function(){xa("#tool_path")&&f.setMode("path")},Pa=function(){if(Z!=null||Aa)f.deleteSelectedElements()}, +Xa=function(){if(Z!=null||Aa){window.event.type==="keydown"&&db(a("#edit_menu"));f.cutSelectedElements()}},hb=function(){if(Z!=null||Aa){window.event.type==="keydown"&&db(a("#edit_menu"));f.copySelectedElements()}},pb=function(){window.event.type==="keydown"&&db(a("#edit_menu"));var q=f.getZoom(),A=(ra[0].scrollLeft+ra.width()/2)/q-f.contentW;q=(ra[0].scrollTop+ra.height()/2)/q-f.contentH;f.pasteElements("point",A,q)},Db=function(){if(Z!=null){window.event.type==="keydown"&&db(a("#object_menu")); +f.moveToTopSelectedElement()}},cb=function(){if(Z!=null){window.event.type==="keydown"&&db(a("#object_menu"));f.moveToBottomSelectedElement()}},Eb=function(){if(Z!=null){window.event.type==="keydown"&&db(a("#object_menu"));f.moveUpDownSelected("Up")}},$a=function(){if(Z!=null){window.event.type==="keydown"&&db(a("#object_menu"));f.moveUpDownSelected("Down")}},Fb=function(q){if(Z!=null){window.event.type==="keydown"&&db(a("#object_menu"));f.moveUpDownSelected(q)}},Pb=function(){if(Z!=null){f.convertToPath(); +elems=f.getSelectedElems();f.selectorManager.requestSelector(elems[0]).selectorRect.setAttribute("display","none");f.setMode("pathedit");ta.toEditMode(elems[0]);f.clearSelection()}},$b=function(){Z!=null&&ta.reorient()},Zb=function(){if(Z!=null||Aa)a.prompt(e.notification.enterNewLinkURL,"http://",function(q){q&&f.makeHyperlink(q)})},gb=function(q,A){if(Z!=null||Aa){if(d.gridSnapping){var I=f.getZoom()*d.snappingStep;q*=I;A*=I}a("input").blur();f.moveSelectedElements(q,A)}},Ua=function(){var q=!a("#tool_node_link").hasClass("push_button_pressed"); +q?a("#tool_node_link").addClass("push_button_pressed").removeClass("tool_button").find("input").attr("checked",true):a("#tool_node_link").removeClass("push_button_pressed").addClass("tool_button").find("input").attr("checked",false);ta.linkControlPoints(q)},ic=function(){ta.getNodePoint()&&ta.clonePathNode()},ec=function(){ta.getNodePoint()&&ta.deletePathNode()},cc=function(){var q=a("#tool_add_subpath"),A=!q.hasClass("push_button_pressed");A?q.addClass("push_button_pressed").removeClass("tool_button"): +q.removeClass("push_button_pressed").addClass("tool_button");ta.addSubPath(A)},fc=function(){ta.opencloseSubPath()},gc=function(){f.cycleElement(1)},Tb=function(){f.cycleElement(0)},Sb=function(q,A){if(!(Z==null||Aa)){q||(A*=-1);var I=a("#angle").val()*1+A;f.setRotationAngle(I);Ja()}},mc=function(){var q=d.dimensions;a.confirm(e.notification.QwantToClear,function(A){if(A){oa();f.clear();f.setResolution(q[0],q[1]);Rb(true);E();Ab();Ja();la.fill.prep();la.stroke.prep();f.runExtensions("onNewDocument")}})}, +Vb=function(){f.setBold(!f.getBold());Ja();return false},vb=function(){f.setItalic(!f.getItalic());Ja();return false},kc=function(){if(!l.pngsave){var q=e.notification.loadingImage;ba=window.open("data:text/html;charset=utf-8,"+q+"

      "+q+"

      ")}window.canvg?f.rasterExport():a.getScript("canvg/rgbcolor.js",function(){a.getScript("canvg/canvg.js",function(){f.rasterExport()})})},jc=function(){f.open()},Wb=function(){},db=function(q){var A=q.prev();A.css("background","#09f");setTimeout(function(){A.css("background", +"")},200)},dc=function(){if(ha.getUndoStackSize()>0){window.event.type==="keydown"&&db(a("#edit_menu"));ha.undo();Ab()}},g=function(){if(ha.getRedoStackSize()>0){window.event.type==="keydown"&&db(a("#edit_menu"));ha.redo();Ab()}},h=function(){if(Aa)f.groupSelectedElements();else Z&&f.ungroupSelectedElement()},k=function(){window.event.type==="keydown"&&db(a("#edit_menu"));f.cloneSelectedElements(20,20)},v=function(){var q=this.id.replace("tool_align","").charAt(0);f.alignSelectedElements(q,a("#align_relative_to").val())}, +s=function(){var q=document.querySelector("#tool_stroke rect"),A=document.querySelector("#tool_fill rect"),I=A.getAttribute("fill"),R=q.getAttribute("fill");q=parseFloat(q.getAttribute("stroke-opacity"));if(isNaN(q))q=100;A=parseFloat(A.getAttribute("fill-opacity"));if(isNaN(A))A=100;R=ab(R,q,"stroke");I=ab(I,A,"fill");la.fill.setPaint(R,true);la.stroke.setPaint(I,true)},E=function(q){var A=f.getResolution();q=q?A.zoom*q:1;a("#zoom").val(q*100);f.setZoom(q);B();Rb(true)},z=function(){!a("#tool_wireframe").hasClass("push_button_pressed")? +a("#tool_wireframe").addClass("push_button_pressed"):a("#tool_wireframe").removeClass("push_button_pressed");ra.toggleClass("wireframe");if(!tc){var q=a("#wireframe_rules");q.length?q.empty():a('').appendTo("head");B()}},t=function(){f.clearSelection();a("#tool_canvas").trigger("click")},C=function(){window.self!=window.top&&top.exports.setEditorFocus(false)},F=function(){if(a("#tool_rulers").hasClass("push_button_pressed")){a("#tool_rulers").removeClass("push_button_pressed"); +a("#show_rulers").attr("checked",false);d.showRulers=false}else{a("#tool_rulers").addClass("push_button_pressed");a("#show_rulers").attr("checked",true);d.showRulers=true}a("#rulers").toggle(!!d.showRulers)},B=function(){if(!tc){var q="#workarea.wireframe #svgcontent * { stroke-width: "+1/f.getZoom()+"px; }";a("#wireframe_rules").text(ra.hasClass("wireframe")?q:"")}},D=function(q,A){if(!Ka){Ka=true;a("#save_output_btns").toggle(!!A);a("#tool_source_back").toggle(!A);var I=sa=f.getSvgString();a("#svg_source_textarea").val(I); +a("#svg_source_editor").fadeIn();P();a("#svg_source_textarea").focus()}},H=function(){if(!Ra){Ra=true;a("#image_save_opts input").val([b.img_save]);var q=f.getResolution();if(d.baseUnit!=="px"){q.w=svgedit.units.convertUnit(q.w)+d.baseUnit;q.h=svgedit.units.convertUnit(q.h)+d.baseUnit}a(".canvas_width").val(q.w);a(".canvas_height").val(q.h);a("#canvas_title").val(f.getDocumentTitle());a("#svg_docprops").show()}},G=function(){if(!Na){Na=true;var q=a("#bg_blocks div"),A=a.pref("bkgd_color"),I=a.pref("bkgd_url"); +q.each(function(){var R=a(this),X=R.css("background-color")==A;R.toggleClass("cur_background",X);X&&a("#canvas_bg_url").removeClass("cur_background")});A||q.eq(0).addClass("cur_background");I&&a("#canvas_bg_url").val(I);a("grid_snapping_step").attr("value",d.snappingStep);d.gridSnapping==true?a("#grid_snapping_on").attr("checked","checked"):a("#grid_snapping_on").removeAttr("checked");a("#svg_prefs").show()}},P=function(){var q=a("#svg_source_container").height()-50;a("#svg_source_textarea").css("height", +q)},Q=function(){if(Ka){var q=function(){f.clearSelection();zb();E();Ab();W();la.fill.prep();la.stroke.prep()};f.setSvgString(a("#svg_source_textarea").val())?q():a.confirm(e.notification.QerrorsRevertToSource,function(A){if(!A)return false;q()});oa()}},W=function(q){q=q||f.getDocumentTitle();q=Wa+(q?": "+q:"");a("title:first").text(q)},ua=function(){var q=a("#canvas_width"),A=q.val(),I=a("#canvas_height"),R=I.val();if(A!="fit"&&!svgedit.units.isValidUnit("width",A)){a.alert(e.notification.invalidAttrValGiven); +q.parent().addClass("error");return false}q.parent().removeClass("error");if(R!="fit"&&!svgedit.units.isValidUnit("height",R)){a.alert(e.notification.invalidAttrValGiven);I.parent().addClass("error");return false}I.parent().removeClass("error");if(!f.setResolution(A,R)){a.alert(e.notification.noContentToFitTo);return false}b.img_save=a("#image_save_opts :checked").val();a.pref("img_save",b.img_save);Rb();Qb()},wa=function(){var q=a("#bg_blocks div.cur_background").css("background-color")||"#FFF"; +p(q,a("#canvas_bg_url").val());q=a("#lang_select").val();q!=b.lang&&c.putLocale(q);za(a("#iconsize").val());d.gridSnapping=a("#grid_snapping_on")[0].checked;d.snappingStep=a("#grid_snapping_step").val();d.showRulers=a("#show_rulers")[0].checked;a("#rulers").toggle(d.showRulers);d.showRulers&&da();d.baseUnit=a("#base_unit").val();f.setConfig(d);Rb();Ib()},fa=c.setIcon=function(q,A){var I=typeof A==="string"?a.getSvgIcon(A,true):A.clone();I?a(q).find("img").replaceWith(I):console.log("NOTE: Icon image missing: "+ +A)},ka;ka=function(){var q=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,A=document.getElementsByTagName("script")[0],I;for(I in A.style)if(q.test(I))return I.match(q)[0];if("WebkitOpacity"in A.style)return"Webkit";if("KhtmlOpacity"in A.style)return"Khtml";return""}();var qa=function(q,A){ka.toLowerCase();var I=["top","left","bottom","right"];q.each(function(){for(var R=a(this),X=R.outerWidth()*(A-1),ja=R.outerHeight()*(A-1),va=0;va<4;va++){var ya=I[va],Da=R.data("orig_margin-"+ya);if(Da==null){Da=parseInt(R.css("margin-"+ +ya));R.data("orig_margin-"+ya,Da)}Da=Da*A;if(ya==="right")Da+=X;else if(ya==="bottom")Da+=ja;R.css("margin-"+ya,Da)}})},za=c.setIconSize=function(q,A){if(!(q==b.size&&!A)){var I=a("#tools_top .toolset, #editor_panel > *, #history_panel > *,\t\t\t\t#main_button, #tools_left > *, #path_node_panel > *, #multiselected_panel > *,\t\t\t\t#g_panel > *, #tool_font_size > *, .tools_flyout"),R=1;R=typeof q=="number"?q:{s:0.75,m:1,l:1.25,xl:1.5}[q];c.tool_scale=S=R;Cb();var X=I.parents(":hidden");X.css("visibility", +"hidden").show();qa(I,R);X.css("visibility","visible").hide();a.pref("iconsize",q);a("#iconsize").val(q);X={"#tools_top":{left:50,height:72},"#tools_left":{width:31,top:74},"div#workarea":{left:38,top:74}};I=a("#tool_size_rules");if(I.length)I.empty();else I=a('').appendTo("head");if(q!="m"){var ja="";a.each(X,function(va,ya){va="#svg_editor "+va.replace(/,/g,", #svg_editor");ja+=va+"{";a.each(ya,function(Da,Ca){if(typeof Ca==="number")var Ba=Ca*R+"px";else if(Ca[q]|| +Ca.all)Ba=Ca[q]||Ca.all;ja+=Da+":"+Ba+";"});ja+="}"});X="-"+ka.toLowerCase()+"-";ja+="#tools_top .toolset, #editor_panel > *, #history_panel > *,\t\t\t\t#main_button, #tools_left > *, #path_node_panel > *, #multiselected_panel > *,\t\t\t\t#g_panel > *, #tool_font_size > *, .tools_flyout{"+X+"transform: scale("+R+");} #svg_editor div.toolset .toolset {"+X+"transform: scale(1); margin: 1px !important;} #svg_editor .ui-slider {"+X+"transform: scale("+1/R+");}";I.text(ja)}Cb()}},jb=function(){a("#dialog_box").hide(); +if(!Ka&&!Ra&&!Na)Sa&&f.leaveContext();else{if(Ka)sa!==a("#svg_source_textarea").val()?a.confirm(e.notification.QignoreSourceChanges,function(q){q&&zb()}):zb();else if(Ra)Qb();else Na&&Ib();Ub()}},zb=function(){a("#svg_source_editor").hide();Ka=false;a("#svg_source_textarea").blur()},Qb=function(){a("#svg_docprops").hide();a("#canvas_width,#canvas_height").removeAttr("disabled");a("#resolution")[0].selectedIndex=0;a("#image_save_opts input").val([b.img_save]);Ra=false},Ib=function(){a("#svg_prefs").hide(); +Na=false},Ob={width:a(window).width(),height:a(window).height()},Ub=a.noop,ac;svgedit.browser.isIE()&&function(){Ub=function(){if(ra[0].scrollLeft===0&&ra[0].scrollTop===0){ra[0].scrollLeft=ac.left;ra[0].scrollTop=ac.top}};ac={left:ra[0].scrollLeft,top:ra[0].scrollTop};a(window).resize(Ub);svgEditor.ready(function(){setTimeout(function(){Ub()},500)});ra.scroll(function(){ac={left:ra[0].scrollLeft,top:ra[0].scrollTop}})}();a(window).resize(function(){Ka&&P();a.each(Ob,function(q,A){var I=a(window)[q](); +ra[0]["scroll"+(q==="width"?"Left":"Top")]-=(I-A)/2;Ob[q]=I})});(function(){ra.scroll(function(){if(a("#ruler_x").length!=0)a("#ruler_x")[0].scrollLeft=ra[0].scrollLeft;if(a("#ruler_y").length!=0)a("#ruler_y")[0].scrollTop=ra[0].scrollTop})})();a("#url_notice").click(function(){a.alert(this.title)});a("#change_image_url").click(L);(function(){var q=["clear","open","save","source","delete","delete_multi","paste","clone","clone_multi","move_top","move_bottom"],A="";a.each(q,function(I,R){A+="#tool_"+ +R+(I==q.length-1?",":"")});a(A).mousedown(function(){a(this).addClass("tool_button_current")}).bind("mousedown mouseout",function(){a(this).removeClass("tool_button_current")});a("#tool_undo, #tool_redo").mousedown(function(){a(this).hasClass("disabled")||a(this).addClass("tool_button_current")}).bind("mousedown mouseout",function(){a(this).removeClass("tool_button_current")})})();if(V&&!window.opera){V=["tool_clear","tool_save","tool_source","tool_undo","tool_redo","tool_clone"];for(var Bb=V.length;Bb--;){var pc= +document.getElementById(V[Bb]);if(pc!=null){var qc=pc.title,uc=qc.indexOf("Ctrl+");pc.title=[qc.substr(0,uc),"Cmd+",qc.substr(uc+5)].join("")}}}var rc=function(q){var A=q[0].id=="stroke_color"?"stroke":"fill",I=q[0].id=="canvas_color";if(I)A="canvas";var R=la[A].paint;q=A=="stroke"?"Pick a Stroke Paint and Opacity":"Pick a Fill Paint and Opacity";I=I?{right:200,top:50}:{left:45,bottom:50};a("#color_picker").draggable({cancel:".jGraduate_tabs, .jGraduate_colPick, .jGraduate_gradPick, .jPicker",containment:"window"}).css(I).jGraduate({paint:R, +window:{pickerTitle:q},images:{clientPath:d.jGraduatePath},newstop:"inverse"},function(X){R=new a.jGraduate.Paint(X);la[A].setPaint(R);f.setPaint(A,R);a("#color_picker").hide()},function(){a("#color_picker").hide()})};V=function(q,A){var I=document.getElementById("canvas_background"),R={color:"fff",opacity:1};if(A=="stroke")R=d.initStroke;if(A=="fill")R=d.initFill;if(A=="canvas"&&I)if(I=I.getAttribute("fill").match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))R={color:("0"+parseInt(I[1],10).toString(16)).slice(-2)+ +("0"+parseInt(I[2],10).toString(16)).slice(-2)+("0"+parseInt(I[3],10).toString(16)).slice(-2),opacity:1};I=(new DOMParser).parseFromString('\t\t\t\t\t',"text/xml").documentElement;I=a(q)[0].appendChild(document.importNode(I,true));I.setAttribute("width",24.5);this.rect=I.firstChild;this.defs=I.getElementsByTagName("defs")[0]; +this.grad=this.defs.firstChild;this.paint=new a.jGraduate.Paint({solidColor:R.color});this.type=A;this.setPaint=function(X,ja){this.paint=X;var va="none",ya=X.type,Da=X.alpha/100;switch(ya){case "solidColor":va=X[ya]=="none"||X[ya]=="one"?"none":"#"+X[ya];break;case "linearGradient":case "radialGradient":this.defs.removeChild(this.grad);this.grad=this.defs.appendChild(X[ya]);va="url(#"+(this.grad.id="gradbox_"+this.type)+")"}this.rect.setAttribute("fill",va);this.rect.setAttribute("opacity",Da);if(ja){f.setColor(this.type, +va,true);f.setPaintOpacity(this.type,Da,true)}if(this.type=="canvas"){(ya=document.getElementById("canvas_background"))?ya.setAttribute("fill",va):La(va);console.log(ya.getAttribute("fill"))}};this.update=function(X){if(Z){var ja=this.type;switch(Z.tagName){case "use":case "image":case "foreignObject":return;case "g":case "a":for(var va=null,ya=Z.getElementsByTagName("*"),Da=0,Ca=ya.length;Da300)q=300-I;else if(I+q<2)q=2-I;if(q!=0){bc-=q;I=a("#layerpanel");ra.css("right",parseInt(ra.css("right"))+q);A.css("width",parseInt(A.css("width"))+q);I.css("width",parseInt(I.css("width"))+q);A=a("#ruler_x");A.css("right",parseInt(A.css("right"))+q)}}};a("#sidepanel_handle").mousedown(function(q){bc=q.pageX;a(window).mousemove(vc); +sc=false;setTimeout(function(){sc=true},20)}).mouseup(function(){lc||wc();bc=-1;lc=false});a(window).mouseup(function(){bc=-1;lc=false;a("#svg_editor").unbind("mousemove",vc)});var wc=function(q){var A=parseInt(a("#sidepanels").css("width"));q=(A>2||q?2:150)-A;A=a("#sidepanels");var I=a("#layerpanel"),R=a("#ruler_x");ra.css("right",parseInt(ra.css("right"))+q);A.css("width",parseInt(A.css("width"))+q);I.css("width",parseInt(I.css("width"))+q);R.css("right",parseInt(R.css("right"))+q)},xc=function(q){for(var A= +Array(f.getCurrentDrawing().getNumLayers()),I=0;I'+ja+"":''+ja+"";q.append(va);A.append('")}if(X!==undefined){X.clone();a("td.layervis",q).append(X.clone());a.resizeSvgIcons({"td.layervis .svg_icon":14})}a("#layerlist td.layername").mouseup(function(ya){a("#layerlist tr.layer").removeClass("layersel"); +a(this.parentNode).addClass("layersel");f.setCurrentLayer(this.textContent);ya.preventDefault()}).mouseover(function(){a(this).css({"font-style":"italic",color:"blue"});xc(this.textContent)}).mouseout(function(){a(this).css({"font-style":"normal",color:"black"});xc()});a("#layerlist td.layervis").click(function(){var ya=a(this.parentNode).prevAll().length;ya=a("#layerlist tr.layer:eq("+ya+") td.layername").text();var Da=a(this).hasClass("layerinvis");f.setLayerVisibility(ya,Da);Da?a(this).removeClass("layerinvis"): +a(this).addClass("layerinvis")});for(A=5-a("#layerlist tr.layer").size();A-- >0;)q.append('_')};Ab();a(window).bind("load resize",function(){ra.css("line-height",ra.height()+"px")});a("#resolution").change(function(){var q=a("#canvas_width,#canvas_height");if(this.selectedIndex)if(this.value=="content")q.val("fit").attr("disabled","disabled");else{var A=this.value.split("x");a("#canvas_width").val(A[0]);a("#canvas_height").val(A[1]);q.removeAttr("disabled")}else a("#canvas_width").val()== +"fit"&&q.removeAttr("disabled").val(100)});a("input,select").attr("autocomplete","off");var oc=function(){var q=[{sel:"#tool_select",fn:Gb,evt:"click",key:["V",true]},{sel:"#tool_fhpath",fn:Hb,evt:"click",key:["Q",true]},{sel:"#tool_line",fn:Mb,evt:"click",key:["L",true]},{sel:"#tool_rect",fn:Nb,evt:"click",key:["R",true],icon:"rect"},{sel:"#tool_ellipse",fn:ma,evt:"mouseup",key:["C",true],icon:"ellipse"},{sel:"#tool_path",fn:aa,evt:"click",key:["P",true]},{sel:"#tool_text",fn:N,evt:"click",key:["T", +true]},{sel:"#tool_image",fn:Y,evt:"mouseup"},{sel:"#tool_zoom",fn:na,evt:"mouseup",key:["Z",true]},{sel:"#tool_clear",fn:mc,evt:"mouseup",key:[ga+"N",true]},{sel:"#tool_save",fn:function(){Ka?Q():f.save({images:b.img_save,round_digits:6})},evt:"mouseup",key:[ga+"S",true]},{sel:"#tool_export",fn:kc,evt:"mouseup"},{sel:"#tool_open",fn:jc,evt:"mouseup"},{sel:"#tool_import",fn:Wb,evt:"mouseup"},{sel:"#tool_source",fn:D,evt:"click",key:[ga+"U",true]},{sel:"#tool_wireframe",fn:z,evt:"click"},{sel:"#tool_rulers", +fn:F,evt:"click"},{sel:"#tool_source_cancel,#svg_source_overlay,#tool_docprops_cancel,#tool_prefs_cancel",fn:jb,evt:"click",key:["esc",false,false],hidekey:true},{sel:"#tool_source_save",fn:Q,evt:"click"},{sel:"#tool_docprops_save",fn:ua,evt:"click"},{sel:"#tool_docprops",fn:H,evt:"mouseup"},{sel:"#tool_prefs_save",fn:wa,evt:"click"},{sel:"#tool_prefs_option",fn:function(){G();return false},evt:"mouseup"},{sel:"#tool_delete,#tool_delete_multi",fn:Pa,evt:"click",key:["del/backspace",true]},{sel:"#tool_reorient", +fn:$b,evt:"click"},{sel:"#tool_node_link",fn:Ua,evt:"click"},{sel:"#tool_node_clone",fn:ic,evt:"click"},{sel:"#tool_node_delete",fn:ec,evt:"click"},{sel:"#tool_openclose_path",fn:fc,evt:"click"},{sel:"#tool_add_subpath",fn:cc,evt:"click"},{sel:"#tool_move_top",fn:Db,evt:"click",key:ga+"shift+up"},{sel:"#tool_move_bottom",fn:cb,evt:"click",key:ga+"shift+down"},{sel:"#tool_move_up",fn:Eb,evt:"click",key:[ga+"up",true]},{sel:"#tool_move_down",fn:$a,evt:"click",key:[ga+"down",true]},{sel:"#tool_topath", +fn:Pb,evt:"click"},{sel:"#tool_make_link,#tool_make_link_multi",fn:Zb,evt:"click"},{sel:"#tool_clone,#tool_clone_multi",fn:k,evt:"click",key:[ga+"D",true]},{sel:"#tool_group",fn:h,evt:"click",key:[ga+"G",true]},{sel:"#tool_ungroup",fn:h,evt:"click",key:ga+"shift+G"},{sel:"#tool_unlink_use",fn:h,evt:"click"},{sel:"[id^=tool_align]",fn:v,evt:"click"},{sel:"#tool_switch",fn:s,evt:"click",key:["shift+x",true]},{sel:"#tool_undo",fn:dc,evt:"click",key:ga+"z"},{sel:"#tool_redo",fn:g,evt:"click",key:["y", +true]},{sel:"#tool_canvas_color_menu",fn:t,evt:"click"},{sel:"#tool_cut",fn:Xa,evt:"click",key:ga+"x"},{sel:"#tool_copy",fn:hb,evt:"click",key:ga+"c"},{sel:"#tool_paste",fn:pb,evt:"click",key:ga+"v"},{sel:"#tool_bold",fn:Vb,evt:"mousedown",key:[ga+"B",true]},{sel:"#tool_italic",fn:vb,evt:"mousedown",key:[ga+"I",true]},{sel:"#copy_save_done",fn:jb,evt:"click"},{key:"ctrl+left",fn:function(){Sb(0,1)}},{key:"ctrl+right",fn:function(){Sb(1,1)}},{key:"ctrl+shift+left",fn:function(){Sb(0,5)}},{key:"ctrl+shift+right", +fn:function(){Sb(1,5)}},{key:"shift+O",fn:Tb},{key:"shift+P",fn:gc},{key:[ga+"+",true],fn:function(){E(2)}},{key:[ga+"-",true],fn:function(){E(0.5)}},{key:["up",true],fn:function(){gb(0,-1)}},{key:["down",true],fn:function(){gb(0,1)}},{key:["left",true],fn:function(){gb(-1,0)}},{key:["right",true],fn:function(){gb(1,0)}},{key:"shift+up",fn:function(){gb(0,-10)}},{key:"shift+down",fn:function(){gb(0,10)}},{key:"shift+left",fn:function(){gb(-10,0)}},{key:"shift+right",fn:function(){gb(10,0)}},{key:["alt+up", +true],fn:function(){f.cloneSelectedElements(0,-1)}},{key:["alt+down",true],fn:function(){f.cloneSelectedElements(0,1)}},{key:["alt+left",true],fn:function(){f.cloneSelectedElements(-1,0)}},{key:["alt+right",true],fn:function(){f.cloneSelectedElements(1,0)}},{key:["alt+shift+up",true],fn:function(){f.cloneSelectedElements(0,-10)}},{key:["alt+shift+down",true],fn:function(){f.cloneSelectedElements(0,10)}},{key:["alt+shift+left",true],fn:function(){f.cloneSelectedElements(-10,0)}},{key:["alt+shift+right", +true],fn:function(){f.cloneSelectedElements(10,0)}},{key:ga+"A",fn:function(){f.selectAllInCurrentLayer()}},{key:ga+"shift+z",fn:g},{key:"esc",fn:C}],A={"4/Shift+4":"#tools_rect_show","5/Shift+5":"#tools_ellipse_show"};return{setAll:function(){var I={};a.each(q,function(R,X){if(X.sel){var ja=a(X.sel);if(ja.length==0)return true;if(X.evt){if(svgedit.browser.isTouch()&&X.evt==="click")X.evt="mousedown";ja[X.evt](X.fn)}if(X.parent&&a(X.parent+"_show").length!=0){var va=a(X.parent);va.length||(va=Ga(X.parent.substr(1))); +va.append(ja);a.isArray(I[X.parent])||(I[X.parent]=[]);I[X.parent].push(X)}}if(X.key){var ya=X.fn,Da=false;if(a.isArray(X.key)){va=X.key[0];if(X.key.length>1)Da=X.key[1]}else va=X.key;va+="";svgedit.browser.isMac&&va.indexOf("+")!=-1&&va.split("+")[0]=="ctrl"&&va.replace("ctrl","cmd");a.each(va.split("/"),function(Ba,tb){a(document).bind("keydown",tb,function(Ta){ya();Da&&Ta.preventDefault();return false})});if(X.sel&&!X.hidekey&&ja.attr("title")){var Ca=ja.attr("title").split("[")[0]+" ("+va+")"; +A[va]=X.sel;ja.parents("#main_menu").length||ja.attr("title",Ca)}}});Qa(I);a(".attr_changer, #image_url").bind("keydown","return",function(R){a(this).change();R.preventDefault()});a(window).bind("keydown","tab",function(R){if(U==="canvas"){R.preventDefault();gc()}}).bind("keydown","shift+tab",function(R){if(U==="canvas"){R.preventDefault();Tb()}});a("#tool_zoom").dblclick(K)},setTitles:function(){a.each(A,function(I,R){var X=a(R).parents("#main_menu").length;a(R).each(function(){var ja=X?a(this).text().split(" [")[0]: +this.title.split(" [")[0],va="";a.each(I.split("/"),function(ya,Da){var Ca=Da.split("+"),Ba="";if(Ca.length>1){Ba=Ca[0]+"+";Da=Ca[1]}va+=(ya?"/":"")+Ba+(e["key_"+Da]||Da)});if(X)this.lastChild.textContent=ja+" ["+va+"]";else this.title=ja+" ["+va+"]"})})},getButtonData:function(I){var R;a.each(q,function(X,ja){if(ja.sel===I)R=ja});return R}}}();oc.setAll();c.ready(function(){var q=d.initTool,A=a("#tools_left, #svg_editor .tools_flyout"),I=A.find("#tool_"+q);q=A.find("#"+q);(I.length?I:q.length?q: +a("#tool_select")).click().mouseup();d.wireframe&&a("#tool_wireframe").click();d.showlayers&&wc();a("#rulers").toggle(!!d.showRulers);if(d.showRulers)a("#show_rulers")[0].checked=true;if(d.gridSnapping)a("#grid_snapping_on")[0].checked=true;d.baseUnit&&a("#base_unit").val(d.baseUnit);d.snappingStep&&a("#grid_snapping_step").val(d.snappingStep)});a("#rect_rx").SpinButton({min:0,max:1E3,step:1,callback:function(q){f.setRectRadius(q.value)}});a("#stroke_width").SpinButton({min:0,max:99,step:1,smallStep:0.1, +callback:function(q){var A=q.value;if(A==0&&Z&&["line","polyline"].indexOf(Z.nodeName)>=0)A=q.value=1;f.setStrokeWidth(A)}});a("#angle").SpinButton({min:-180,max:180,step:5,callback:function(q){f.setRotationAngle(q.value);a("#tool_reorient").toggleClass("disabled",q.value==0)}});a("#font_size").SpinButton({step:1,min:0.0010,stepfunc:function(q,A){var I=q.value-0,R=I+A,X=R>=I;if(A===0)return I;return I>=24?X?Math.round(I*1.1):Math.round(I/1.1):I<=1?X?I*2:I/2:R},callback:function(q){f.setFontSize(q.value)}}); +a("#group_opacity").SpinButton({step:5,min:0,max:100,callback:xb});a("#blur").SpinButton({step:0.1,min:0,max:10,callback:fb});a("#zoom").SpinButton({min:0.0010,max:1E4,step:50,stepfunc:function(q,A){var I=q.value-0;if(I===0)return 100;var R=I+A;if(A===0)return I;return I>=100?R:R>=I?I*2:I/2},callback:ob}).val(f.getZoom()*100);a("#workarea").contextMenu({menu:"cmenu_canvas",inSpeed:0},function(q){switch(q){case "delete":Pa();break;case "cut":Xa();break;case "copy":hb();break;case "paste":f.pasteElements(); +break;case "paste_in_place":f.pasteElements("in_place");break;case "group":f.groupSelectedElements();break;case "ungroup":f.ungroupSelectedElement();break;case "move_front":Db();break;case "move_up":Fb("Up");break;case "move_down":Fb("Down");break;case "move_back":cb();break;default:svgedit.contextmenu&&svgedit.contextmenu.hasCustomHandler(q)&&svgedit.contextmenu.getCustomHandler(q).call()}f.clipBoard.length&&pa.enableContextMenuItems("#paste,#paste_in_place")});V=function(q){switch(q){case "dupe":M(); +break;case "delete":T();break;case "merge_down":if(a("#layerlist tr.layersel").index()!=f.getCurrentDrawing().getNumLayers()-1){f.mergeLayer();Ja();Ab()}break;case "merge_all":f.mergeAllLayers();Ja();Ab()}};a("#layerlist").contextMenu({menu:"cmenu_layers",inSpeed:0},V);a("#layer_moreopts").contextMenu({menu:"cmenu_layers",inSpeed:0,allowLeft:true},V);a(".contextMenu li").mousedown(function(q){q.preventDefault()});a("#cmenu_canvas li").disableContextMenu();pa.enableContextMenuItems("#delete,#cut,#copy"); +window.onbeforeunload=function(){if(ha.getUndoStackSize()===0)c.show_save_warning=false;if(!d.no_save_warning&&c.show_save_warning)return e.notification.unsavedChanges};c.openPrep=function(q){a("#main_menu").hide();ha.getUndoStackSize()===0?q(true):a.confirm(e.notification.QwantToOpen,q)};if(window.FileReader){V=a('').change(function(){var q=this;c.openPrep(function(A){if(A){f.clear();if(q.files.length==1){A=new FileReader;A.onloadend=function(I){n(I.target.result);Rb()};A.readAsText(q.files[0])}}})}); +a("#tool_open").show().prepend(V);V=a('').change(function(){a("#main_menu").hide();if(this.files.length==1){var q=new FileReader;q.onloadend=function(A){f.importSvgString(A.target.result,true);Rb()};q.readAsText(this.files[0])}});a("#tool_import").show().prepend(V)}var Rb=c.updateCanvas=function(q,A){var I=ra.width(),R=ra.height(),X=I,ja=R,va=f.getZoom(),ya=a("#svgcanvas"),Da={x:ra[0].scrollLeft+X/2,y:ra[0].scrollTop+ja/2},Ca=d.canvas_expansion;I=Math.max(X,f.contentW*va*Ca);R= +Math.max(ja,f.contentH*va*Ca);I==X&&R==ja?ra.css("overflow","hidden"):ra.css("overflow","scroll");Ca=ya.height()/2;var Ba=ya.width()/2;ya.width(I).height(R);var tb=R/2,Ta=I/2,ia=f.updateCanvas(I,R),wb=Ta/Ba;I=I/2-X/2;R=R/2-ja/2;if(A){A.x+=ia.x;A.y+=ia.y}else A={x:Ta+(Da.x-Ba)*wb,y:tb+(Da.y-Ca)*wb};if(q)if(f.contentW>ra.width()){ra[0].scrollLeft=ia.x-10;ra[0].scrollTop=ia.y-10}else{ra[0].scrollLeft=I;ra[0].scrollTop=R}else{ra[0].scrollLeft=A.x-X/2;ra[0].scrollTop=A.y-ja/2}if(d.showRulers){da(ya,va); +ra.scroll()}},hc=[];for(Bb=0.1;Bb<1E5;Bb*=10){hc.push(1*Bb);hc.push(2*Bb);hc.push(5*Bb)}Rb(true);try{var yc=function(q){if(window.JSON&&JSON.stringify)return JSON.stringify(q);var A=arguments.callee;if(typeof q=="boolean"||typeof q=="number")return q+"";else if(typeof q=="string")return'"'+q.replace(/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,function(X){return"\\u"+("0000"+X.charCodeAt(0).toString(16)).slice(-4)})+'"'; +else if(q.length){for(var I=0;I");var f=n.shortcut||"";$("#cmenu_canvas").append("
    • "+n.label+""+f+"
    • ")}});svgedit.contextmenu.resetCustomMenus=function(){a.contextMenuExtensions= {}};svgedit.contextmenu.add=function(n){if(n&&n.id&&n.label&&n.action&&typeof n.action=="function")if(n.id in a.contextMenuExtensions)console.error('Cannot add extension "'+n.id+'", an extension by that name already exists"');else{console.log("Registed contextmenu item: {id:"+n.id+", label:"+n.label+"}");a.contextMenuExtensions[n.id]=n}else console.error("Menu items must be defined and have at least properties: id, label, action, where action must be a function")};svgedit.contextmenu.hasCustomHandler= function(n){return a.contextMenuExtensions[n]&&true};svgedit.contextmenu.getCustomHandler=function(n){return a.contextMenuExtensions[n].action}})();var svgEditor=function(a,n){function f(m,o,b){var d=a("#svg_editor").parent(),e;for(e in o){var l=o[e];l||console.log(e);if(b)e="#"+e;if(d.find(e).length){var u=d.find(e)[0];switch(m){case "content":for(var w=0;w -
      +

      Canvas

      @@ -251,7 +251,7 @@ $(function(){
      -
      +

      Rectangle

      -
      +

      Path

      -
      +

      Image

      -
      +
      -
      +

      Ellipse

      -
      +

      Line

      -
      +

      Text

      @@ -390,7 +390,7 @@ $(function(){
      -
      +
      @@ -401,23 +401,23 @@ $(function(){
      -
      +
      -
      +

      Group

      -
      +
      -
      +

      Edit Path

      @@ -441,7 +441,7 @@ $(function(){
      -
      +
      -
      +

      Position

      -
      +

      Multiple Elements

      diff --git a/method-draw/svg-editor.js b/method-draw/svg-editor.js index 9402b62..1e3e57b 100644 --- a/method-draw/svg-editor.js +++ b/method-draw/svg-editor.js @@ -1039,7 +1039,7 @@ // create the panel if it doesn't exist if(!panel.length) - panel = $('
      ', {id: tool.panel}).appendTo("#tools_top"); + panel = $('
      ', {id: tool.panel}).appendTo("#tools_top").hide(); // TODO: Allow support for other types, or adding to existing tool switch (tool.type) { @@ -1409,7 +1409,7 @@ "stroke": "none", "id": "canvas_background", "opacity": 1, - "fill": fill || $.pref('bkgd_color'), + "fill": fill || "#fff", "style": "pointer-events:none" } }); @@ -1419,16 +1419,7 @@ // create a new layer background if it doesn't exist if (!document.getElementById('canvas_background')) createBackground(); - else { - var fill = document.getElementById('canvas_background').getAttribute("fill"); - - } - if($.pref('bkgd_color')) { - setBackground($.pref('bkgd_color'), $.pref('bkgd_url')); - } else if($.pref('bkgd_url')) { - // No color set, only URL - setBackground(defaultPrefs.bkgd_color, $.pref('bkgd_url')); - } + var fill = document.getElementById('canvas_background').getAttribute("fill"); // updates the toolbar (colors, opacity, etc) based on the selected element // This function also updates the opacity and id elements that are in the context panel @@ -3525,7 +3516,7 @@ var PaintBox = function(container, type) { var background = document.getElementById("canvas_background"); - var cur = {color: "#fff", opacity: 1} + var cur = {color: "fff", opacity: 1} if (type == "stroke") cur = curConfig['initStroke']; if (type == "fill") cur = curConfig['initFill']; if (type == "canvas" && background) { @@ -3538,7 +3529,6 @@ } } - // set up gradients to be used for the buttons var svgdocbox = new DOMParser().parseFromString( '*{display:table-cell;vertical-align:middle;margin:0;float:none;}#svg_editor .jGraduate_gradPick .jGraduate_Form_Section{padding-top:9px;}#svg_editor .jGraduate_Slider{text-align:center;float:left;width:100%;position:relative;margin:5px 0;}#svg_editor .jGraduate_Slider .jGraduate_Form_Section{border:none;width:250px;padding:0 2px;overflow:visible;}#svg_editor .jGraduate_Slider label.prelabel{width:40px;text-align:left;}#svg_editor .jGraduate_SliderBar{width:140px;float:left;margin:0 5px;border:1px solid #BBB;height:20px;position:relative;}#svg_editor div.jGraduate_Slider input{margin-top:5px;}#svg_editor div.jGraduate_Slider img{top:0;left:0;position:absolute;cursor:ew-resize;}#svg_editor .jPicker .Button .Ok,#svg_editor .jGraduate_Picker .jGraduate_OkCancel .jGraduate_Ok{margin:0;position:absolute;bottom:15px;right:15px;}#svg_editor .jPicker .Button .Cancel,#svg_editor .jGraduate_Picker .jGraduate_OkCancel .jGraduate_Cancel{margin:0;position:absolute;bottom:15px;left:15px;}body{background:#2F2F2C;font:13px/120% 'Lucida Sans','Lucida Grande','Lucida Sans Unicode',sans-serif;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin:0;padding:0;}::selection{background:#000;color:#fff;}::-moz-selection{background:#000;color:#fff;}html,body{overflow:hidden;width:100%;height:100%;}::-webkit-scrollbar{width:5px;height:5px;background:#444;}::-webkit-scrollbar-track{border-radius:10px;background:#444;}::-webkit-scrollbar-thumb{border-radius:10px;background:#666;}::-webkit-scrollbar-corner{background:#444;}#browser-not-supported{font-size:.8em;font-family:Verdana,Helvetica,Arial;color:#000;}#svg_editor hr{border:none;border-bottom:1px solid #808080;}#svg_editor select{margin-top:4px;}#svg_editor #svgroot{-moz-user-select:none;-webkit-user-select:none;position:absolute;top:0;left:0;}#svg_editor #menu_bar{margin:0 0 0 50px;}#svg_editor #menu_bar.active .menu.open .menu_list{display:block;}#svg_editor .menu{position:relative;z-index:5;color:#333;display:inline-block;}#svg_editor .menu_title{cursor:pointer;display:inline-block;padding:7px 10px;z-index:10;color:#fff;position:relative;height:16px;vertical-align:top;}#svg_editor .menu .menu_title:hover{background:rgba(255,255,255,0.1);}#svg_editor .menu_list .separator{margin:5px 0;border-top:solid #ddd 1px;}#svg_editor .menu_list{display:none;position:absolute;top:28px;left:0;white-space:nowrap;background:white;padding:7px 0;border-radius:0 3px 3px 3px;box-shadow:0 0 20px rgba(0,0,0,0.8);}#svg_editor #menu_bar.active .menu.open .menu_title{background:white;color:#333;}#svg_editor .menu_list .menu_item{position:relative;overflow:hidden;line-height:22px;padding:5px 69px 5px 25px;cursor:default;color:#333;}#svg_editor .menu_list .menu_item.tool_button{background:transparent;border:none;margin:0;padding:5px 55px 5px 25px;height:auto;width:auto;}#svg_editor .menu_list .menu_item.push_button_pressed:before{content:'✔';position:absolute;display:block;left:7px;top:3px;width:20px;height:20px;}#svg_editor .menu_list .menu_item:hover,#svg_editor .menu_list .menu_item.push_button_pressed:hover{background:rgba(0,0,0,0.1);color:#000;}#svg_editor .menu_list .menu_item.disabled:hover,#svg_editor .menu_list .menu_item.push_button_pressed.disabled:hover{background:transparent;color:#333;}#svg_editor .menu_list .menu_item.push_button_pressed{background:transparent;border:none;width:auto;height:auto;margin:0;}#svg_editor .menu_list .menu_item span{display:block;position:absolute;right:10px;padding:5px;background:rgba(0,0,0,0.1);top:6px;height:10px;text-align:center;font-size:10px;line-height:120%;}#svg_editor #svgcanvas{line-height:normal;display:inline-block;background-color:#A0A0A0;text-align:center;vertical-align:middle;width:640px;height:480px;position:relative;background:#3F3F3C;}#rulers>div{position:absolute;background:#2f2f2c;z-index:1;overflow:hidden;-webkit-font-smoothing:none;}#rulers #ruler_corner{top:30px;left:50px;width:15px;height:15px;border:solid #444 1px;z-index:2;}#ruler_x{height:15px;top:30px;left:66px;right:200px;border-top:solid #444 1px;border-right:solid #444 1px;}#ruler_x_cursor{height:15px;border-right:dotted #999 1px;position:absolute;background:#2f2f2c;}#ruler_y_cursor{width:15px;border-top:dotted #999 1px;position:absolute;background:#2f2f2c;}#rulers.moved #ruler_corner,#rulers.moved #ruler_x{top:101px;}#ruler_y{width:15px;top:46px;left:50px;bottom:40px;border-left:solid #444 1px;border-bottom:solid #444 1px;}#rulers.moved #ruler_y{top:116px;}#ruler_x canvas:first-child{margin-left:-16px;}#ruler_x canvas{float:left;}#ruler_y canvas{margin-top:-16px;}#ruler_x>div,#ruler_y>div{overflow:hidden;}#svg_editor div#palette_holder{display:block;overflow:hidden;height:31px;margin-top:10px;position:relative;z-index:2;float:left;}#svg_editor div#palette_holder #palette .palette_item:first-child{background:#fff;}#svg_editor div#palette_holder #palette .palette_item{cursor:pointer;}#tool_stroke select{margin-top:0;}#svg_editor #color_tools,#color_canvas_tools{position:relative;width:48px;height:48px;margin:6px 6px 0 6px;}#svg_editor #color_tools #tool_fill,#tool_canvas{position:absolute;top:0;left:0;z-index:1;}#tool_fill.active,#tool_stroke.active{z-index:2;}#tool_fill,#tool_stroke,#tool_canvas{box-shadow:0 0 0 1px #2f2f2c;}#color_canvas_tools{float:left;cursor:pointer;}#tool_fill .color_block,#tool_canvas .color_block{width:24px;height:24px;overflow:hidden;border:solid #ccc 1px;}#svg_editor #path_node_panel .tool_button{color:#999;border:solid #3F3F3C 1px;border-radius:3px;padding:3px 10px 3px 40px;background:transparent;position:relative;margin-top:10px;width:90px;height:23px;line-height:24px;}#svg_editor #path_node_panel .tool_button img{position:absolute;left:5px;top:3px;}#svg_editor #path_node_panel #tool_node_link{border:none;padding:3px 0;width:auto;margin:0 0 10px 0;background:transparent;color:#ccc;height:auto;line-height:130%;}#svg_editor #path_node_panel #segment_type{margin-top:10px;}#svg_editor #color_tools #tool_fill .color_block:hover,#svg_editor #color_tools #tool_stroke .color_block:hover{border-color:#fff;}#svg_editor #color_tools #tool_fill .color_block>div{position:absolute;top:0;left:0;}#svg_editor #color_tools #tool_fill .color_block #fill_bg,#svg_editor #color_tools #tool_stroke .color_block #stroke_bg{position:absolute;top:1px;left:1px;bottom:1px;right:1px;background:#fff;}#tool_stroke{position:absolute;top:12px;left:12px;z-index:0;}#stroke_color:after{content:'';position:absolute;display:block;width:8px;height:8px;left:8px;top:8px;background:#ccc;box-shadow:0 0 0 1px #000;}#svg_editor #color_tools #tool_switch{cursor:pointer;opacity:.7;width:11px;height:11px;background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABV0RVh0Q3JlYXRpb24gVGltZQA2LzE0LzEyP6j5+gAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNXG14zYAAAB4SURBVBiVjZHRCYUwDEVvxIF0kZKN7EjiIrrReR/PSNSKXiikcE5JUtMeADMzXQIcdRfgFWqlyyB7ap1wL+0HAnIv1DqRJUBxTkLUWXIvh9AHkIeb58UkIUnDMH4ZR0otCfhv4ynbtp7ut722ZniFG8L9xx4Ek6QfN9huARmYwR0AAAAASUVORK5CYII=) top left no-repeat;position:absolute;top:-2px;left:28px;}#svg_editor #color_tools #cross:hover{opacity:1;}#svg_editor #color_tools #tool_stroke:hover #stroke_color:after{background:#fff;}#svg_editor #color_tools #tool_stroke .color_block{width:24px;height:24px;overflow:hidden;border:solid #ccc 1px;}#svg_editor #color_tools #tool_stroke .color_block>div{position:absolute;bottom:0;right:0;}#svg_editor #color_tools .icon_label{padding:0;width:24px;height:100%;cursor:pointer;}#svg_editor #zoomLabel{cursor:pointer;margin-right:5px;}#svg_editor #linkLabel>svg{height:20px;padding-top:4px;}#svg_editor div#palette{float:left;width:672px;height:16px;}#svg_editor div#workarea{display:inline-table-cell;position:absolute;top:30px;left:50px;bottom:40px;right:200px;background-color:#444;overflow:auto;text-align:center;}#svg_editor #sidepanels{display:none;position:absolute;top:75px;bottom:60px;right:0;width:2px;padding:10px;border-left:none;z-index:10;}#svg_editor #layerpanel{display:inline-block;position:absolute;top:1px;bottom:0;right:0;width:0;overflow:auto;margin:0;-moz-user-select:none;-webkit-user-select:none;}#svg_editor #sidepanel_handle{display:inline-block;position:absolute;background-color:#D0D0D0;font-weight:bold;left:0;top:40%;width:1em;padding:5px 1px 5px 5px;margin-left:3px;cursor:pointer;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-moz-user-select:none;-webkit-user-select:none;}#svg_editor #sidepanel_handle:hover{font-weight:bold;}#svg_editor #sidepanel_handle *{cursor:pointer;-moz-user-select:none;-webkit-user-select:none;}#svg_editor #layerbuttons{margin:0;padding:0;padding-left:2px;padding-right:2px;width:125px;height:20px;border-right:1px solid #FFF;border-bottom:1px solid #FFF;border-left:1px solid #808080;border-top:1px solid #808080;overflow:hidden;}#svg_editor .layer_button{width:14px;height:14px;padding:1px;border-left:1px solid #FFF;border-top:1px solid #FFF;border-right:1px solid #808080;border-bottom:1px solid #808080;cursor:pointer;float:left;margin-right:3px;}#svg_editor .layer_button:last-child{margin-right:0;}#svg_editor .layer_buttonpressed{width:14px;height:14px;padding:1px;border-right:1px solid #FFF;border-bottom:1px solid #FFF;border-left:1px solid #808080;border-top:1px solid #808080;cursor:pointer;}#svg_editor #layerlist{margin:1px;padding:0;width:127px;border-collapse:collapse;border:1px solid #808080;background-color:#FFF;}#svg_editor #layerlist tr.layer{background-color:#FFF;margin:0;padding:0;}#svg_editor #layerlist tr.layersel{border:1px solid #808080;background-color:#CCC;}#svg_editor #layerlist td.layervis{width:22px;cursor:pointer;}#svg_editor #layerlist td.layerinvis{background-image:none;cursor:pointer;}#svg_editor #layerlist td.layervis *{display:block;}#svg_editor #layerlist td.layerinvis *{display:none;}#svg_editor #layerlist td.layername{cursor:pointer;}#svg_editor #layerlist tr.layersel td.layername{font-weight:bold;}#svg_editor #selLayerLabel{white-space:nowrap;}#svg_editor #selLayerNames{display:block;}#svg_editor div.palette_item{height:16px;width:16px;float:left;}#svg_editor .menu .menu_list{display:none;position:absolute;}#svg_editor .tool_button:hover,#svg_editor .push_button:hover,#svg_editor .buttonup:hover,#svg_editor .buttondown,#svg_editor .tool_button_current,#svg_editor .push_button_pressed{background-color:#fff;}#svg_editor .tool_button.disabled,#svg_editor .tool_button.disabled:hover{opacity:.3;background-color:#aaa;}#svg_editor #tools_left .tool_button{background:#2f2f2c;}#svg_editor #tools_left .tool_button.loaded{background:#ccc;}#svg_editor #tools_left .tool_button.loaded:hover{background:#fff;}#tools_top .padded{padding:10px 0;}#svg_editor #tools_left .tool_button_current{background-color:#0cf;}#svg_editor #main_icon span{position:absolute;width:100%;height:100%;display:block;z-index:2;}#svg_editor #tools_top{position:absolute;width:170px;right:2px;top:10px;border-bottom:none;overflow:visible;padding:0 10px;}#svg_editor label{display:block;color:#999;}div#font-selector{width:140px;height:300px;overflow:auto;margin:0 auto;position:absolute;top:27px;right:0;border:1px solid black;padding:10px;display:none;background-color:white;z-index:10;border-radius:3px;box-shadow:0 5px 10px rgba(0,0,0,0.7);}div#font-selector img{width:100%;}div#font-selector .font-item{border-bottom:solid #ddd 1px;padding:5px 10px;margin:0 -10px;}div#font-selector .font-item:hover{background-color:#eee;}#svg_editor #tools_top label:before,#svg_editor #tools_top label:after{content:"";display:table;}#svg_editor #tools_top label:after{clear:both;}#svg_editor #tools_top label span,#svg_editor #tools_top label select{display:block;width:80px;float:left;line-height:185%;}#svg_editor #tools_top label span.tuco{width:100%;float:none;}#svg_editor #tools_top #marker_panel *{float:left;}#svg_editor #tools_top #marker_panel h4{float:none;}#svg_editor #tools_top #marker_panel .dropdown .icon_label{width:36px;height:20px;margin-top:2px;border:solid #3f3f3c 1px;text-align:center;}#svg_editor #font_family_dropdown-list{border-radius:3px;box-shadow:0 5px 10px #000;}#svg_editor #font_family_dropdown-list li{cursor:pointer;}#svg_editor #tools_top #marker_panel .dropdown button{margin-top:2px;}#svg_editor #tools_top #marker_panel #marker_panel_title{float:none;color:#fff;margin-bottom:3px;}#svg_editor #tools_top #marker_panel .dropdown .icon_label img{float:none;}#svg_editor input[type=text],#svg_editor input[type=number]{border:solid #3f3f3c 1px;background-color:transparent;color:#09f;display:block;float:left;font-size:13px;padding:2px 5px;width:70px;-webkit-appearance:none;border-radius:2px;margin:0;-webkit-touch-callout:text;-webkit-user-select:text;-khtml-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;}#svg_editor #color_picker input[type=text],#color_picker #svg_editor input[type=number]{width:30px;background:#fff;}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0;}#svg_editor .dropdown_set input[type=text],#svg_editor .dropdown_set input[type=number]{width:50px;}#svg_editor input[type=text].wide,#svg_editor input[type=number].wide{width:110px;}#svg_editor input[type=text].tuco,#svg_editor input[type=number].tuco{width:150px;}#svg_editor input[type=submit],#svg_editor input[type=button],button{background:#2C7BB3;color:#fff;border-radius:2px;padding:5px 10px;border:none;line-height:140%;border-bottom:solid transparent 1px;}#svg_editor input[type=submit]:hover,#svg_editor button:hover{box-shadow:inset 0 3px 10px rgba(255,255,255,0.1),inset 0 -3px 10px rgba(0,0,0,0.2);}#svg_editor input[type=submit]:hover,#svg_editor button:hover{background:#2F84C1;}#svg_editor input[type=submit]:active,#svg_editor button:active{padding:6px 10px 4px 10px;box-shadow:inset 0 2px 2px rgba(0,0,0,0.2);border-bottom:solid rgba(255,255,255,0.1) 1px;}#svg_editor input[type=text]:focus,#svg_editor input[type=number]:focus{border:solid rgba(0,120,255,0.3) 1px;outline:none;}#svg_editor input[readonly=readonly],#svg_editor input[readonly=readonly]:focus{background:transparent;color:#fff;border:none;outline:none;}#svg_editor #tools_left{position:absolute;border-right:none;width:50px;top:30px;left:0;background:#2F2F2C;z-index:4;}#workarea.wireframe #svgcontent *{fill:none;stroke:#000;stroke-width:1px;stroke-opacity:1.0;stroke-dasharray:0;opacity:1;pointer-events:stroke;vector-effect:non-scaling-stroke;filter:none;}#workarea.wireframe #svgcontent text{fill:#000;stroke:none;}#workarea.wireframe #canvasBackground>rect{fill:#FFF!important;}#workarea #canvasBackground>rect{stroke:transparent!important;}.context_panel{display:none;}#canvas_panel{display:block;}#svg_editor #multiselected_panel .selected_tool{vertical-align:12px;}#cur_context_panel{position:absolute;top:47px;left:68px;line-height:22px;overflow:auto;border-bottom:none;border-right:none;padding-left:5px;font-size:12px;background:black;color:#999;opacity:.5;padding:0 10px;border-radius:0 10px 10px 0;}#svg_editor #cur_context_panel a{float:none;text-decoration:none;color:#fff;}#svg_editor #cur_context_panel a:hover{text-decoration:underline;}#svg_editor #tools_left .tool_button,#svg_editor #tools_left .tool_button_current{position:relative;z-index:11;}#svg_editor .flyout_arrow_horiz{position:absolute;bottom:-1px;right:0;z-index:10;}span.zoom_tool{line-height:16px;background:#ccc;display:block;width:18px;height:18px;margin-top:2px;float:left;}span.zoom_tool img{vertical-align:top;}#zoom_panel{margin-top:9px;right:200px;position:absolute;}.dropdown{position:relative;float:left;}#svg_editor .dropdown button{width:21px;height:22px;padding:0 3px 0 3px;border:none;background-color:#555;border-radius:0 2px 2px 0;margin-left:-1px;position:relative;}#svg_editor .dropdown button:hover{background-color:#666;}#svg_editor .dropdown button:after{content:'';position:absolute;border:solid transparent 4px;border-top-color:#999;top:9px;left:6px;}.dropdown button.down{border-left:1px solid #808080;border-top:1px solid #808080;border-right:1px solid #FFF;border-bottom:1px solid #FFF;background-color:#B0B0B0;}.dropdown ul{list-style:none;position:absolute;margin:0;padding:0;left:-80px;top:26px;z-index:4;display:none;}.dropup ul{top:auto;bottom:26px;border-radius:3px;box-shadow:0 5px 10px #000;}.dropup ul:after{content:'';display:block;position:absolute;bottom:-10px;right:50%;top:auto;width:0;height:0;border:solid transparent 5px;border-top-color:#fff;}.dropdown li{display:block;width:120px;padding:5px 10px;color:#333;background:#fff;margin:0;line-height:16px;}.dropdown li:first-child{border-radius:3px 3px 0 0;}.dropdown li:last-child{border-radius:0 0 3px 3px;}.dropdown li:hover{background-color:#ddd;color:#000;}.dropdown li.special{padding:10px;background:white;border:none;box-shadow:0 3px 10px black;border-radius:3px!important;}.dropdown li.special:after{content:'';display:block;position:absolute;top:-10px;right:50%;border:solid transparent 5px;border-bottom-color:#fff;}.dropdown li.special.down:after{bottom:-10px;right:50%;top:auto;border:solid transparent 5px;border-top-color:#fff;}#font_family_dropdown-list li{font-size:1.4em;}#font_family{margin-left:5px;margin-right:0;}#svg_editor .tool_button,#svg_editor .push_button,#svg_editor .tool_button_current,#svg_editor .push_button_pressed{height:27px;width:27px;border:solid #2f2f2c 8px;border-left-width:13px;margin:0;background-color:#ddd;cursor:pointer;}#svg_editor #main_menu li#tool_open,#svg_editor #main_menu li#tool_import{position:relative;overflow:hidden;}#tool_image{overflow:hidden;}#tool_open input,#tool_import input,#tool_image input{position:absolute;opacity:0;font-size:10em;top:-5px;right:-5px;margin:0;cursor:pointer;}#svg_editor .disabled{opacity:.5;cursor:default;}#svg_editor .width_label{padding-right:5px;}#svg_editor #tool_bold,#svg_editor #tool_italic{font:bold 2.1em/1.1em serif;text-align:center;padding:0 2px 5px 2px;position:relative;float:left;margin:5px 10px 0 0;color:#ccc;background:#2f2f2c;border:solid #3f3f3c 1px;}#svg_editor #tool_bold:hover,#svg_editor #tool_italic:hover{color:#fff;}#svg_editor #tool_font_size{clear:both;padding-top:8px;}#text{position:absolute;left:-9999px;}#svg_editor #tool_bold span,#svg_editor #tool_italic span{position:absolute;width:100%;height:100%;top:0;left:0;background:#ccc;opacity:0;}#svg_editor #tool_italic{font-weight:normal;font-style:italic;}#url_notice{padding-top:4px;display:none;}#svg_editor #color_picker{position:absolute;display:none;background:#fff;height:350px;border-radius:3px;z-index:5;box-shadow:0 5px 10px #000;width:530px;}#svg_editor .tools_flyout{position:absolute;display:none;cursor:pointer;width:385px;z-index:10;left:47px!important;height:324px;background:#fff;border-radius:5px;box-shadow:0 5px 10px rgba(0,0,0,0.5);}#svg_editor .tools_flyout_v{position:absolute;display:none;cursor:pointer;width:30px;}#svg_editor .tools_flyout .tool_button{float:left;background-color:#fff;height:24px;width:24px;}#svg_editor #tools_bottom{position:absolute;left:50px;right:0;bottom:0;height:40px;overflow:visible;}#svg_editor #tools_bottom_1{width:115px;float:left;}#svg_editor #tools_bottom_2{position:relative;float:left;margin-top:5px;}#tools_bottom input[type=text]{width:3.2em;}#svg_editor .stroke_tool .dropdown button{margin-top:0;}#svg_editor .stroke_tool div div{-moz-user-select:none;-webkit-user-select:none;width:20px;height:20px;margin:0;padding:1px;background:rgba(255,255,255,0.3);}#svg_editor #tools_bottom .stroke_tool .dropdown button{background-color:#555;margin-top:0;}#svg_editor #tools_top h4{color:#fff;font-weight:normal;margin:0;padding:20px 0 5px 0;}.stroke_tool>div{width:42px;}.stroke_tool>div>*{float:left;}#tools_top .dropdown .icon_label{border:1px solid transparent;height:auto;}.align_buttons .push_button,.align_buttons .push_button_pressed{display:block;float:left;}#option_lists ul{display:none;position:absolute;height:auto;z-index:3;margin:0;list-style:none;padding-left:0;}#option_lists .optcols2{width:70px;margin-left:-15px;}#option_lists .optcols3{width:192px;margin-left:-105px;margin-top:-25px;background:#fff;padding:5px;box-shadow:0 5px 10px #000;border-radius:3px;}#option_lists .optcols3:after{content:'';display:block;position:absolute;top:-10px;right:70px;border:solid transparent 5px;border-bottom-color:#fff;}#svg_editor #option_lists .tool_button,#svg_editor #option_lists .push_button,#svg_editor #option_lists .tool_button_current,#svg_editor #option_lists .push_button_pressed{border:none;background:transparent;}#svg_editor #option_lists .tool_button:hover{background:#ddd;}#svg_editor #option_lists ul li.current{background-color:#F4E284;}#option_lists .optcols4{width:130px;margin-left:-44px;}#option_lists ul[class^=optcols] li{float:left;}#svg_editor ul li.current{background-color:#F4E284;}#svg_editor #option_lists ul li{margin:0;border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;}#svg_editor #tool_stroke label input{margin-top:0;}#svg_editor #copyright{text-align:right;padding-right:.3em;}#svg_source_editor{display:none;}#svg_source_editor #svg_source_overlay{position:absolute;top:0;right:0;left:0;bottom:0;background-color:black;opacity:.6;z-index:5;}#svg_source_editor #svg_source_container{position:absolute;top:30px;left:30px;right:30px;bottom:30px;background-color:#fff;border-radius:3px;opacity:1.0;text-align:center;z-index:6;padding:20px 0;}#save_output_btns{display:none;text-align:left;}#save_output_btns p{margin:.5em 1.5em;display:inline-block;}#bg_blocks{overflow:auto;}#bg_blocks div{box-shadow:0 2px 3px rgba(0,0,0,0.3);margin-right:10px;}#svg_docprops #svg_docprops_container,#svg_prefs #svg_prefs_container{position:absolute;top:50%;width:300px;height:200px;margin-top:-140px;margin-left:-250px;border-radius:3px;padding:20px;left:50%;background-color:#fff;box-shadow:0 3px 10px rgba(0,0,0,0.3);opacity:1.0;z-index:20001;}#svg_docprops .error{border:1px solid red;padding:3px;}#svg_docprops #resolution{max-width:14em;}#tool_docprops_back,#tool_prefs_back{margin-left:1em;overflow:auto;}#svg_docprops_container #svg_docprops_docprops,#svg_prefs #svg_docprops_prefs{float:left;width:221px;margin:5px .7em;overflow:hidden;}#svg_prefs #svg_prefs_container{width:500px;height:320px;margin:-180px 0 0 -350px;}#svg_docprops legend,#svg_prefs legend{font-weight:bold;font-size:18px;padding:0 0 20px 0;display:block;font-family:sans-serif;}#svg_docprops_docprops>legend,#svg_prefs_container>fieldset>legend{font-weight:bold;font-size:1.1em;}#svg_docprops_container fieldset,#svg_prefs fieldset{margin:0;padding:0;border:none;}#svg_docprops_container label,#svg_prefs_container label{display:block;margin:.5em;}#svg_prefs_container label{margin:10px 0;}#svginfo_bg_note{font-size:.9em;font-style:italic;color:#444;}#canvas_title,#canvas_bg_url{display:block;width:96%;}#svg_source_editor #svg_source_textarea{position:relative;width:95%;top:5px;height:250px;padding:5px;font-size:12px;}#svg_source_editor #tool_source_back{text-align:left;padding:10px 0 0 20px;position:relative;}#svg_source_editor #tool_source_back #tool_source_save{position:absolute;right:20px;top:7px;}#svg_prefs_container div.color_block{float:left;margin:2px;padding:20px;}#svg_prefs_container div.cur_background{box-shadow:0 0 8px rgba(0,50,255,1);}#background_img{position:absolute;top:0;left:0;text-align:left;}#svg_docprops input,#svg_prefs input,#svg_docprops select,#svg_prefs select{font-size:15px;border-radius:3px;border:solid #aaa 1px;background-color:#eee;padding:5px 10px;}#svg_docprops select,#svg_prefs select{height:30px;width:210px;}#svg_docprops label,#svg_prefs label{display:inline-block;width:100px;vertical-align:top;}#svg_prefs .subtitle{margin-bottom:10px;}#svg_prefs label{width:200px;}#svg_docprops label span,#svg_prefs label span{display:inline-block;padding-bottom:5px;}#svg_docprops button,#svg_prefs button{position:absolute;font-size:15px;}#svg_editor button.cancel,#svg_editor input.Cancel,#svg_editor input.cancel,#svg_editor input.jGraduate_Cancel,button.cancel{background-color:#999;box-shadow:0 0 1px rgba(0,0,0,0.5);margin:0;}#svg_docprops button:first-child,#svg_prefs button:first-child{bottom:15px;left:15px;right:auto;}#svg_docprops button:last-child,#svg_prefs button:last-child{bottom:15px;right:15px;left:auto;}#svg_docprops button img,#svg_prefs button img{display:none;}#svg_editor button#docprops_button{background:#444;}#svg_editor button#docprops_button:hover{background:#555;}#svg_docprops,#svg_prefs{display:none;}#image_save_opts label{font-size:.9em;}#image_save_opts input{margin-left:0;}#svg_docprops #svg_docprops_overlay,#svg_prefs #svg_prefs_overlay{position:absolute;top:0;right:0;left:0;bottom:0;background-color:black;opacity:.6;z-index:20000;}#shape_buttons{overflow:auto;top:0;bottom:0;left:110px;right:0;position:absolute;vertical-align:top;}#shape_cats{min-width:110px;display:block;position:absolute;left:0;top:0;height:300px;background:#eee;border-radius:3px 0 0 3px;z-index:2;}#shape_cats>div{line-height:1em;padding:0 .5em;border-bottom:1px solid #ddd;background:#E8E8E8;color:#444;height:26px;line-height:26px;}#shape_cats>div:first-child{border-radius:3px 0 0 0;}#shape_cats>div:last-child{border-radius:0 0 0 3px;}#shape_cats div:hover{background:#efefef;color:#000;}#shape_cats div.current{font-weight:bold;background:#3f3f3c;color:#fff;position:relative;}#shape_cats div.current:after{content:'';position:absolute;right:-26px;top:0;border:solid transparent 13px;border-left-color:#3f3f3c;}.toolbar_button button .svg_icon{display:none;}#dialog_box{display:none;}#dialog_box_overlay{background:black;opacity:.5;height:100%;left:0;position:absolute;top:0;width:100%;z-index:6;}#dialog_content{height:95px;margin:10px 10px 5px 10px;background:#DDD;overflow:auto;text-align:left;border:1px solid #B0B0B0;}#dialog_content.prompt{height:75px;}#dialog_content p{margin:10px;line-height:1.3em;}#dialog_container{position:absolute;font-family:Verdana;text-align:center;left:50%;top:50%;width:300px;margin-left:-150px;height:150px;margin-top:-80px;position:fixed;z-index:50001;background:#CCC;border:1px outset #777;font-family:Verdana,Helvetica,sans-serif;font-size:.8em;}#dialog_container,#dialog_content{border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;}#dialog_buttons input[type=text]{width:90%;display:block;margin:0 0 5px 11px;}#dialog_buttons input[type=button]{margin:0 1em;}.invisible{visibility:none;}.ui-slider{position:relative;text-align:left;}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;}.ui-slider-horizontal{height:.8em;}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em;}.ui-slider-horizontal .ui-slider-range{top:0;height:100%;}.ui-slider-horizontal .ui-slider-range-min{left:0;}.ui-slider-horizontal .ui-slider-range-max{right:0;}.ui-slider-vertical{width:.8em;height:100px;}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em;}.ui-slider-vertical .ui-slider-range{left:0;width:100%;}.ui-slider-vertical .ui-slider-range-min{bottom:0;}.ui-slider-vertical .ui-slider-range-max{top:0;}.ui-slider{background:#3F3F3C;border-radius:10px;}.ui-slider-handle{box-shadow:0 3px 3px rgba(0,0,0,0.3);border-radius:30px;background:#fff;background-image:-ms-linear-gradient(top,#ccc 0,#fff 100%);background-image:-moz-linear-gradient(top,#ccc 0,#fff 100%);background-image:-o-linear-gradient(top,#ccc 0,#fff 100%);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#ccc),color-stop(1,#fff));background-image:-webkit-linear-gradient(top,#ccc 0,#fff 100%);background-image:linear-gradient(top,#ccc 0,#fff 100%);}.ui-slider-handle:focus{outline:none;}#shape_buttons{background:#fff;border-radius:0 3px 3px 0;padding:10px;}#svg_editor .tools_flyout .tool_button,#svg_editor .tools_flyout .tool_flyout{background:#fff;width:40px;height:40px;margin:5px;border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-width:0;}.contextMenu{position:absolute;z-index:99999;border:solid 1px rgba(0,0,0,.33);background:rgba(255,255,255,.95);padding:5px 0;margin:0;display:none;font:12px/15px Lucida Sans,Helvetica,Verdana,sans-serif;border-radius:5px;-moz-border-radius:5px;-moz-box-shadow:2px 5px 10px rgba(0,0,0,.3);-webkit-box-shadow:2px 5px 10px rgba(0,0,0,.3);box-shadow:2px 5px 10px rgba(0,0,0,.3);}.contextMenu LI{list-style:none;padding:0;margin:0;}.contextMenu .shortcut{width:115px;text-align:right;float:right;}.contextMenu A{-moz-user-select:none;-webkit-user-select:none;color:#222;text-decoration:none;display:block;line-height:20px;height:20px;background-position:6px center;background-repeat:no-repeat;outline:none;padding:0 15px 1px 20px;}.contextMenu LI.hover A{background-color:#2e5dea;color:white;cursor:default;}.contextMenu LI.disabled A{color:#999;}.contextMenu LI.hover.disabled A{background-color:transparent;}.contextMenu LI.separator{border-top:solid 1px #E3E3E3;padding-top:5px;margin-top:5px;}#menu{display:none;position:absolute;top:0;left:0;right:0;height:30px;background:#000;z-index:10;color:#fff;}#workarea.rect,#workarea.line,#workarea.ellipse,#workarea.path,#workarea.shapelib{cursor:crosshair;}#workarea.text{cursor:text;}#workarea.eyedropper{cursor:url(images/eyedropper.png),crosshair;}#workarea.fhpath{cursor:url(images/pencil_cursor.png) 0 20,crosshair;}#workarea.rotate *{cursor:url(images/rotate.png) 12 12,auto;}#workarea.n-resize *{cursor:n-resize!important;}#workarea.e-resize *{cursor:e-resize!important;}#workarea.w-resize *{cursor:w-resize!important;}#workarea.s-resize *{cursor:s-resize!important;}#workarea.ne-resize *{cursor:ne-resize!important;}#workarea.se-resize *{cursor:se-resize!important;}#workarea.nw-resize *{cursor:nw-resize!important;}#workarea.sw-resize *{cursor:sw-resize!important;}#workarea.zoom{cursor:crosshair;cursor:-moz-zoom-in;cursor:-webkit-zoom-in;}#workarea.zoom.out{cursor:crosshair;cursor:-moz-zoom-out;cursor:-webkit-zoom-out;}#selectorRubberBand{shape-rendering:crispEdges;}.clearfix:before,.clearfix:after{content:"";display:table;}.clearfix:after{clear:both;}.clearfix{*zoom:1;}#svg_editor #group_title{display:none;}INPUT.spin-button{padding:2px 20px 2px 2px;background-repeat:no-repeat;background-position:100% 0;background-image:url('spinbtn_updn.png');background-color:white;}INPUT.spin-button.up{cursor:pointer;background-position:100% -18px;}INPUT.spin-button.down{cursor:pointer;background-position:100% -36px;} \ No newline at end of file diff --git a/method-draw/svgedit.compiled.js b/method-draw/svgedit.compiled.js index 6c597d5..98f1e81 100644 --- a/method-draw/svgedit.compiled.js +++ b/method-draw/svgedit.compiled.js @@ -406,116 +406,116 @@ q/2,y:A.y*q+A.height*q/2});f.getMode()=="zoom"&&A.width&&oa();B()}}};a("#cur_con a(this).mouseup(Ca);Ba.key&&a(document).bind("keydown",Ba.key[0]+" shift+"+Ba.key[0],Ca)});if(va)ja.attr("data-curopt",I[va].sel);else ja.attr("data-curopt")||ja.attr("data-curopt",I[0].sel);var ya,Da=a(X).position();a(A).css({left:Da.left+34,top:Da.top+77});ja.mousedown(function(Ca){a("#tools_shapelib").is(":visible")&&xa(X,false);if(ja.hasClass("disabled"))return false;var Ba=a(A),tb=Da.left+34,Ta=Ba.width()*-1,ia=Ba.data("shown_popop")?200:0;ya=setTimeout(function(){ja.data("isLibrary")?Ba.css("left", tb).show():Ba.css("left",Ta).show().animate({left:tb},150);Ba.data("shown_popop",true)},ia);Ca.preventDefault()}).mouseup(function(){clearTimeout(ya);var Ca=a(this).attr("data-curopt");if(ja.data("isLibrary")&&a(X.replace("_show","")).is(":visible"))xa(X,true);else xa(X)&&Ca in Ia&&Ia[Ca]()})});Kb()},Ga=function(q,A){return a("
      ",{"class":"tools_flyout",id:q}).appendTo("#svg_editor").append(A)},Cb=function(){a(".tools_flyout").each(function(){var q=a("#"+this.id+"_show"),A=q.offset();q=q.outerWidth(); a(this).css({left:(A.left+q)*S,top:A.top})})},Kb=function(){a(".tools_flyout").each(function(){var q=a("#"+this.id+"_show");if(!q.data("isLibrary")){var A=[];a(this).children().each(function(){A.push(this.title)});q[0].title=A.join(" / ")}})},nb,ab=function(q,A,I){var R=null;if(q.indexOf("url(#")===0){q=(q=f.getRefElem(q))?q.cloneNode(true):a("#"+I+"_color defs *")[0];R={alpha:A};R[q.tagName]=q}else R=q.indexOf("#")===0?{alpha:A,solidColor:q.substr(1)}:{alpha:A,solidColor:"none"};return new a.jGraduate.Paint(R)}, -Ya=f.getResolution();if(d.baseUnit!=="px"){Ya.w=svgedit.units.convertUnit(Ya.w)+d.baseUnit;Ya.h=svgedit.units.convertUnit(Ya.h)+d.baseUnit}a(".canvas_width").val(Ya.w);a(".canvas_height").val(Ya.h);a("#docprops_button").on("click",function(){H()});var La=function(q){f.createLayer("background");cur_shape=f.addSvgElementFromJson({element:"rect",attr:{x:-1,y:-1,width:Ya.w+2,height:Ya.h+2,stroke:"none",id:"canvas_background",opacity:1,fill:q||a.pref("bkgd_color"),style:"pointer-events:none"}});f.setCurrentLayer("Layer 1"); -f.setCurrentLayerPosition("1")};document.getElementById("canvas_background")?document.getElementById("canvas_background").getAttribute("fill"):La();if(a.pref("bkgd_color"))p(a.pref("bkgd_color"),a.pref("bkgd_url"));else a.pref("bkgd_url")&&p(o.bkgd_color,a.pref("bkgd_url"));var Ea=c.setImageURL=function(q){q||(q=ea);f.setImageURL(q);a("#image_url").val(q);if(q.indexOf("data:")===0){a("#image_url").hide();a("#change_image_url").show()}else{f.embedImage(q,function(A){A?a("#url_notice").hide():a("#url_notice").show(); -ea=q});a("#image_url").show();a("#change_image_url").hide()}},qb=function(q){var A=Math.min(Math.max(12+q.value.length*6,50),300);a(q).width(A)},Ja=function(){var q=Z;if(q!=null&&!q.parentNode)q=null;var A=f.getCurrentDrawing().getCurrentLayerName(),I=f.getMode(),R=d.baseUnit!=="px"?d.baseUnit:null,X=I=="pathedit",ja=a("#cmenu_canvas li");a("#selected_panel, #multiselected_panel, #g_panel, #path_panel, #rect_panel, #canvas_panel, #circle_panel,\t\t\t\t\t#ellipse_panel, #line_panel, #text_panel, #image_panel, #container_panel, #use_panel, #a_panel").hide(); -a(".menu_item","#edit_menu").addClass("disabled");a(".menu_item","#object_menu").addClass("disabled");!q&&!Aa&&a("#canvas_panel").show();if(q!=null){var va=q.nodeName,ya=f.getRotationAngle(q);a("#angle").val(Math.round(ya));ya=f.getBlur(q);a("#blur").val(ya);a("#blur_slider").slider("option","value",ya);f.addedNew&&va==="image"&&f.getHref(q).indexOf("data:")!==0&&L();if(!X&&I!="pathedit"){a("#selected_panel").show();a(".action_selected").removeClass("disabled");if(["line","circle","ellipse"].indexOf(va)>= -0)a("#xy_panel").hide();else{var Da,Ca;if(["g","polyline","path"].indexOf(va)>=0){if(I=f.getStrokedBBox([q])){Da=I.x;Ca=I.y}}else{Da=q.getAttribute("x");Ca=q.getAttribute("y")}if(R){Da=svgedit.units.convertUnit(Da);Ca=svgedit.units.convertUnit(Ca)}a("#selected_x").val(Math.round(Ca)||0);a("#selected_y").val(Math.round(Da)||0);a("#xy_panel").show()}["image","text","path","g","use"].indexOf(va)==-1&&a(".action_path_convert_selected").removeClass("disabled");va==="path"&&a(".action_path_selected").removeClass("disabled")}else{A= -ta.getNodePoint();a("#tool_add_subpath").removeClass("push_button_pressed").addClass("tool_button");a("#tool_node_delete").toggleClass("disabled",!ta.canDeleteNodes);fa("#tool_openclose_path",ta.closed_subpath?"open_path":"close_path");if(A){X=a("#seg_type");if(R){A.x=svgedit.units.convertUnit(A.x);A.y=svgedit.units.convertUnit(A.y)}a("#path_node_x").val(Math.round(A.x));a("#path_node_y").val(Math.round(A.y));A.type?X.val(A.type).removeAttr("disabled"):X.val(4).attr("disabled","disabled")}return}R= -{g:[],a:[],rect:["rx","width","height"],image:["width","height"],circle:["cx","cy","r"],ellipse:["cx","cy","rx","ry"],line:["x1","y1","x2","y2"],text:[],use:[]};var Ba=q.tagName;a(q).data("gsvg")&&a("#g_panel").show();Ba=="path"&&a("#path_panel").show();if(R[Ba]){R=R[Ba];a("#"+Ba+"_panel").show();a.each(R,function(tb,Ta){var ia=q.getAttribute(Ta);if(d.baseUnit!=="px"&&q[Ta])ia=svgedit.units.convertUnit(q[Ta].baseVal.value);a("#"+Ba+"_"+Ta).val(Math.round(ia)||0)});if(Ba=="text"){a("#text_panel").css("display", -"inline");f.getItalic()?a("#tool_italic").addClass("push_button_pressed").removeClass("tool_button"):a("#tool_italic").removeClass("push_button_pressed").addClass("tool_button");f.getBold()?a("#tool_bold").addClass("push_button_pressed").removeClass("tool_button"):a("#tool_bold").removeClass("push_button_pressed").addClass("tool_button");a("#font_family").val(q.getAttribute("font-family"));a("#font_size").val(q.getAttribute("font-size"));a("#text").val(q.textContent);f.addedNew&&setTimeout(function(){a("#text").focus().select()}, -100)}else if(Ba=="image")Ea(f.getHref(q));else if(Ba==="g"||Ba==="use"){a("#container_panel").show();a(".action_group_selected").removeClass("disabled");R=f.getTitle();va=a("#g_title")[0];va.value=R;qb(va);Ba=="use"?va.setAttribute("disabled","disabled"):va.removeAttribute("disabled")}}ja[(Ba==="g"?"en":"dis")+"ableContextMenuItems"]("#ungroup");ja[(Ba==="g"||!Aa?"dis":"en")+"ableContextMenuItems"]("#group")}else if(Aa){a("#multiselected_panel").show();a(".action_multi_selected").removeClass("disabled"); -ja.enableContextMenuItems("#group").disableContextMenuItems("#ungroup")}else ja.disableContextMenuItems("#delete,#cut,#copy,#group,#ungroup,#move_front,#move_up,#move_down,#move_back");ha.getUndoStackSize()>0?a("#tool_undo").removeClass("disabled"):a("#tool_undo").addClass("disabled");ha.getRedoStackSize()>0?a("#tool_redo").removeClass("disabled"):a("#tool_redo").addClass("disabled");f.addedNew=false;if(q&&!X||Aa){a("#selLayerNames").removeAttr("disabled").val(A);pa.enableContextMenuItems("#delete,#cut,#copy,#move_front,#move_up,#move_down,#move_back")}else a("#selLayerNames").attr("disabled", -"disabled")};a("#text").focus(function(){});a("#text").blur(function(){});f.bind("selected",function(q,A){var I=f.getMode();I==="select"&&oa();I=I=="pathedit";Z=A.length==1||A[1]==null?A[0]:null;Aa=A.length>=2&&A[1]!=null;if(Z!=null)if(!I){if(Z!=null)switch(Z.tagName){case "use":case "image":case "foreignObject":break;case "g":case "a":for(var R=null,X=Z.getElementsByTagName("*"),ja=0,va=X.length;ja=2&&A[1]!=null;if(!Aa)switch(I){case "rotate":I=f.getRotationAngle(R);a("#angle").val(Math.round(I));a("#tool_reorient").toggleClass("disabled",I==0)}f.runExtensions("elementTransition",{elems:A})}});f.bind("changed",function(q,A){var I=f.getMode();I==="select"&&oa();for(var R=0;R\n'+A;var I=navigator.userAgent;if(~I.indexOf("Chrome")&&a.browser.version>=533||~I.indexOf("MSIE"))D(0,true);else{var R=q.open("data:image/svg+xml;base64,"+ca.encode64(A)),X=a.pref("save_notice_done");if(X!=="all"){var ja=e.notification.saveFromBrowser.replace("%s", -"SVG");if(I.indexOf("Gecko/")!==-1)if(A.indexOf("",{id:"export_canvas"}).hide().appendTo("body");var R=a("#export_canvas")[0];R.width=f.contentW;R.height=f.contentH;canvg(R,A.svg,{renderCallback:function(){var X=R.toDataURL("image/png"); -ba.location.href=X;if(a.pref("export_notice_done")!=="all"){X=e.notification.saveFromBrowser.replace("%s","PNG");if(I.length)X+="\n\n"+e.notification.noteTheseIssues+"\n \u2022 "+I.join("\n \u2022 ");a.pref("export_notice_done","all");ba.alert(X)}}})});f.bind("zoomed",Oa);f.bind("contextset",function(q,A){var I="";if(A){var R="";I=''+f.getCurrentDrawing().getCurrentLayerName()+"";a(A).parentsUntil("#svgcontent > g").andSelf().each(function(){if(this.id){R+=" > "+this.id; -I+=this!==A?' > '+this.id+"":" > "+this.id}});Sa=R}else Sa=null;a("#cur_context_panel").toggle(!!A).html(I);W()});f.bind("extension_added",function(q,A){function I(){if(nb){clearTimeout(nb);nb=null}X||(nb=setTimeout(function(){X=true;za(b.iconsize)},50))}var R=false,X=false,ja=true,va=function(){if(A.callback&&!R&&ja){R=true;A.callback()}},ya=[];A.context_tools&&a.each(A.context_tools,function(Ta,ia){var wb=ia.container_id?' id="'+ia.container_id+'"':"",bb=a("#"+ia.panel);bb.length|| -(bb=a("
      ",{id:ia.panel}).appendTo("#tools_top"));switch(ia.type){case "tool_button":var Fa='
      '+ia.id+"
      ",Va=a(Fa).appendTo(bb);ia.events&&a.each(ia.events,function(eb,lb){a(Va).bind(eb,lb)});break;case "select":Fa="";var Ha=a(Fa).appendTo(bb).find("select");a.each(ia.events,function(eb,lb){a(Ha).bind(eb, -lb)});break;case "button-select":Fa='';wb=a('
        ').appendTo("#option_lists");ia.colnum&&wb.addClass("optcols"+ia.colnum);a(Fa).appendTo(bb).children();ya.push({elem:"#"+ia.id,list:"#"+ia.id+"_opts",title:ia.title,callback:ia.events.change,cur:"#cur_"+ia.id});break;case "input":Fa="'+ia.label+':';var kb=a(Fa).appendTo(bb).find("input");ia.spindata&&kb.SpinButton(ia.spindata);ia.events&&a.each(ia.events,function(eb,lb){kb.bind(eb,lb)})}});if(A.buttons){var Da={},Ca={},Ba=A.svgicons,tb={};a.each(A.buttons,function(Ta,ia){for(var wb,bb=ia.id,Fa=Ta;a("#"+bb).length;)bb=ia.id+"_"+ ++Fa;if(Ba){Da[bb]=ia.icon;Fa=ia.svgicon?ia.svgicon:ia.id;if(ia.type=="app_menu")Ca["#"+bb+" > div"]=Fa;else Ca["#"+ -bb]=Fa}else wb=ia.type=="menu"?"":a('');var Va,Ha;switch(ia.type){case "mode_flyout":case "mode":Va="tool_button";if(ia.cls)Va+=" "+ia.cls;Ha="#tools_left";break;case "context":Va="tool_button";Ha="#"+ia.panel;a(Ha).length||a("
        ",{id:ia.panel}).appendTo("#tools_top");break;case "menu":Va="menu_item tool_button";Ha="#"+(ia.after||ia.panel);break;case "app_menu":Va="";Ha=ia.parent||"#main_menu ul";a(Ha).length||a("
        ",{id:ia.panel}).appendTo("#tools_top")}var kb=a(ia.list|| -ia.type=="app_menu"?"
      • ":"
        ").attr("id",bb).attr("title",ia.title).addClass(Va);if(!ia.includeWith&&!ia.list){if("position"in ia)a(Ha).children().eq(ia.position).before(kb);else ia.type!="menu"||!ia.after?kb.appendTo(Ha):a(Ha).after(kb);if(ia.type=="mode_flyout"){Fa=a(kb);Va=Fa.parent();if(!Fa.parent().hasClass("tools_flyout")){var eb=Fa[0].id.replace("tool_","tools_"),lb=Fa.clone().attr("id",eb+"_show").append(a("
        ",{"class":"flyout_arrow_horiz"}));Fa.before(lb);Va=Ga(eb,Fa);Va.data("isLibrary", -true);lb.data("isLibrary",true)}Ca["#"+eb+"_show"]=ia.id;bb=tb["#"+Va[0].id]=[{sel:"#"+bb,fn:ia.events.click,icon:ia.id,isDefault:true},Yb]}else if(ia.type=="app_menu"||ia.type=="menu")kb.append(ia.title)}else if(ia.list){kb.addClass("push_button");a("#"+ia.list+"_opts").append(kb);if(ia.isDefault){a("#cur_"+ia.list).append(kb.children().clone());Fa=ia.svgicon?ia.svgicon:ia.id;Ca["#cur_"+ia.list]=Fa}}else if(ia.includeWith){Ha=ia.includeWith;Fa=a(Ha.button);Va=Fa.parent();if(!Fa.parent().hasClass("tools_flyout")){eb= -Fa[0].id.replace("tool_","tools_");lb=Fa.clone().attr("id",eb+"_show").append(a("
        ",{"class":"flyout_arrow_horiz"}));Fa.before(lb);Va=Ga(eb,Fa)}var Yb=oc.getButtonData(Ha.button);if(Ha.isDefault)Ca["#"+eb+"_show"]=ia.id;bb=tb["#"+Va[0].id]=[{sel:"#"+bb,fn:ia.events.click,icon:ia.id,key:ia.key,isDefault:ia.includeWith?ia.includeWith.isDefault:0},Yb];eb="position"in Ha?Ha.position:"last";Yb=Va.children().length;if(!isNaN(eb)&&eb>=0&&eb
        '});a("#palette").append(Za);Za="";a.each(["#FFF","#888","#000"],function(){Za+='
        '});a("#bg_blocks").append(Za);var Ma=a("#bg_blocks div");Ma.each(function(){a(this).click(function(){Ma.removeClass("cur_background");a(this).addClass("cur_background")})});if(a.pref("bkgd_color"))p(a.pref("bkgd_color"),a.pref("bkgd_url")); -else a.pref("bkgd_url")&&p(o.bkgd_color,a.pref("bkgd_url"));if(a.pref("img_save")){b.img_save=a.pref("img_save");a("#image_save_opts input").val([b.img_save])}var ob=function(q){var A=q.value/100;if(A<0.0010)q.value=0.1;else{q=f.getZoom();Oa(window,{width:0,height:0,x:(ra[0].scrollLeft+ra.width()/2)/q,y:(ra[0].scrollTop+ra.height()/2)/q,zoom:A},true)}},xb=function(q,A){if(A==null)A=q.value;a("#group_opacity").val(A);if(!q||!q.handle)a("#opac_slider").slider("option","value",A);f.setOpacity(A/100)}, -fb=function(q,A,I){if(A==null)A=q.value;a("#blur").val(A);var R=false;if(!q||!q.handle){a("#blur_slider").slider("option","value",A);R=true}I?f.setBlurNoUndo(A):f.setBlur(A,R)},ib=function(){window.opera&&a("

        ").hide().appendTo("body").remove()};a("#stroke_style").change(function(){f.setStrokeAttr("stroke-dasharray",a(this).val());ib()});a("#stroke_linejoin").change(function(){f.setStrokeAttr("stroke-linejoin",a(this).val());ib()});a("select").change(function(){a(this).blur()});var Lb=false;a("#selLayerNames").change(function(){var q= -this.options[this.selectedIndex].value,A=e.notification.QmoveElemsToLayer.replace("%s",q),I=function(R){if(R){Lb=true;f.moveSelectedToLayer(q);f.clearSelection();Ab()}};if(q)Lb?I(true):a.confirm(A,I)});a("#font_family").change(function(){f.setFontFamily(this.value)});a("#seg_type").change(function(){f.setSegType(a(this).val())});a("#text").keyup(function(){f.setTextContent(this.value)});a("#image_url").change(function(){Ea(this.value)});a("#link_url").change(function(){this.value.length?f.setLinkURL(this.value): -f.removeHyperlink()});a("#g_title").change(function(){f.setGroupTitle(this.value)});a(".attr_changer").change(function(){var q=this.getAttribute("data-attr"),A=this.value;if(svgedit.units.isValidUnit(q,A,Z))this.blur();else{a.alert(e.notification.invalidAttrValGiven);this.value=Z.getAttribute(q);return false}if(q!=="id")if(isNaN(A))A=f.convertToNum(q,A);else if(d.baseUnit!=="px"){var I=svgedit.units.getTypeMap();if(Z[q]||f.getMode()==="pathedit"||q==="x"||q==="y")A*=I[d.baseUnit]}if(q==="id"){q=Z; -f.clearSelection();q.id=A;f.addToSelection([q],true)}else f.changeSelectedAttribute(q,A);this.blur()});a("#palette").mouseover(function(){var q=a('');a(this).append(q);q.focus().remove()});a(".palette_item").mousedown(function(){var q=a("#tool_stroke").hasClass("active"),A=q?"stroke":"fill",I=a(this).attr("data-rgb"),R=null;if(I==="transparent"||I==="initial"||I==="#none"){I="none";R=new a.jGraduate.Paint}else R=new a.jGraduate.Paint({alpha:100,solidColor:I.substr(1)});la[A].setPaint(R); -if(q){f.setColor("stroke",I);I!="none"&&f.getStrokeOpacity()!=1&&f.setPaintOpacity("stroke",1)}else{f.setColor("fill",I);I!="none"&&f.getFillOpacity()!=1&&f.setPaintOpacity("fill",1)}}).bind("contextmenu",function(q){q.preventDefault()});a("#toggle_stroke_tools").toggle(function(){a(".stroke_tool").css("display","table-cell");a(this).addClass("expanded");Ub()},function(){a(".stroke_tool").css("display","none");a(this).removeClass("expanded");Ub()});var xa=function(q,A){if(a(q).hasClass("disabled"))return false; -if(a(q).parent().hasClass("tools_flyout"))return true;var I=I||"normal";A||a(".tools_flyout").fadeOut(I);a("#styleoverrides").text("");a(".tool_button_current").removeClass("tool_button_current").addClass("tool_button");a(q).addClass("tool_button_current").removeClass("tool_button");return true};(function(){var q=null,A=null,I=ra[0],R=false,X=false;a("#svgcanvas").bind("mousemove mouseup",function(ja){if(R!==false){I.scrollLeft-=ja.clientX-q;I.scrollTop-=ja.clientY-A;q=ja.clientX;A=ja.clientY;if(ja.type=== -"mouseup")R=false;return false}}).mousedown(function(ja){if(ja.button===1||X===true){R=true;q=ja.clientX;A=ja.clientY;return false}});a(window).mouseup(function(){R=false});a(document).bind("keydown","space",function(ja){f.spaceKey=X=true;ja.preventDefault()}).bind("keyup","space",function(ja){ja.preventDefault();f.spaceKey=X=false}).bind("keydown","alt",function(){f.getMode()==="zoom"&&ra.addClass("out")}).bind("keyup","alt",function(){f.getMode()==="zoom"&&ra.removeClass("out")})})();var ub=a(".menu"), -rb=function(q){q.target.style.background="#fff";setTimeout(function(){q.target.style.background="#ddd"},50);setTimeout(function(){q.target.style.background="#fff"},150);setTimeout(function(){q.target.style.background="#ddd"},200);setTimeout(function(){q.target.style.background=""},200);setTimeout(function(){a("#menu_bar").removeClass("active")},220);return false};a(".menu_item").live("click",function(q){rb(q)});a("svg, body").on("mousedown",function(q){top!=self&&!q.isTrigger&&typeof top.exports.setEditorFocus== -"function"&&top.exports.setEditorFocus();if(!a(q.target).hasClass("menu_title"))if(!a(q.target).hasClass("disabled")&&a(q.target).hasClass("menu_item"))rb(q);else{a("#menu_bar").removeClass("active");a("#tools_shapelib").is(":visible")&&!a(q.target).parents("#tools_shapelib_show, #tools_shapelib").length&&a("#tools_shapelib").hide();q.target.nodeName.toLowerCase()!="input"&&a("input").blur()}});var yb=[6,12,16,33,50,66,100,150,200,300,400,600,800,1200];a("#workarea").on("mousewheel",function(q,A, -I,R){if(q.altKey){q.preventDefault();q=f.getZoom()*100;A=yb.length;for(Bb=0;Bb0)zoom=yb[Bb]<=q?yb[I]:zoom;if(R<0)zoom=yb[Bb]"+q+"

        "+ -q+"

        ")}window.canvg?f.rasterExport():a.getScript("canvg/rgbcolor.js",function(){a.getScript("canvg/canvg.js",function(){f.rasterExport()})})},jc=function(){f.open()},Wb=function(){},db=function(q){var A=q.prev();A.css("background","#09f");setTimeout(function(){A.css("background","")},200)},dc=function(){if(ha.getUndoStackSize()>0){window.event.type==="keydown"&&db(a("#edit_menu"));ha.undo();Ab()}},g=function(){if(ha.getRedoStackSize()>0){window.event.type==="keydown"&&db(a("#edit_menu"));ha.redo(); -Ab()}},h=function(){if(Aa)f.groupSelectedElements();else Z&&f.ungroupSelectedElement()},k=function(){window.event.type==="keydown"&&db(a("#edit_menu"));f.cloneSelectedElements(20,20)},v=function(){var q=this.id.replace("tool_align","").charAt(0);f.alignSelectedElements(q,a("#align_relative_to").val())},s=function(){var q=document.querySelector("#tool_stroke rect"),A=document.querySelector("#tool_fill rect"),I=A.getAttribute("fill"),R=q.getAttribute("fill");q=parseFloat(q.getAttribute("stroke-opacity")); -if(isNaN(q))q=100;A=parseFloat(A.getAttribute("fill-opacity"));if(isNaN(A))A=100;R=ab(R,q,"stroke");I=ab(I,A,"fill");la.fill.setPaint(R,true);la.stroke.setPaint(I,true)},E=function(q){var A=f.getResolution();q=q?A.zoom*q:1;a("#zoom").val(q*100);f.setZoom(q);B();Rb(true)},z=function(){!a("#tool_wireframe").hasClass("push_button_pressed")?a("#tool_wireframe").addClass("push_button_pressed"):a("#tool_wireframe").removeClass("push_button_pressed");ra.toggleClass("wireframe");if(!tc){var q=a("#wireframe_rules"); -q.length?q.empty():a('').appendTo("head");B()}},t=function(){f.clearSelection();a("#tool_canvas").trigger("click")},C=function(){window.self!=window.top&&top.exports.setEditorFocus(false)},F=function(){if(a("#tool_rulers").hasClass("push_button_pressed")){a("#tool_rulers").removeClass("push_button_pressed");a("#show_rulers").attr("checked",false);d.showRulers=false}else{a("#tool_rulers").addClass("push_button_pressed");a("#show_rulers").attr("checked",true);d.showRulers= -true}a("#rulers").toggle(!!d.showRulers)},B=function(){if(!tc){var q="#workarea.wireframe #svgcontent * { stroke-width: "+1/f.getZoom()+"px; }";a("#wireframe_rules").text(ra.hasClass("wireframe")?q:"")}},D=function(q,A){if(!Ka){Ka=true;a("#save_output_btns").toggle(!!A);a("#tool_source_back").toggle(!A);var I=sa=f.getSvgString();a("#svg_source_textarea").val(I);a("#svg_source_editor").fadeIn();P();a("#svg_source_textarea").focus()}},H=function(){if(!Ra){Ra=true;a("#image_save_opts input").val([b.img_save]); -var q=f.getResolution();if(d.baseUnit!=="px"){q.w=svgedit.units.convertUnit(q.w)+d.baseUnit;q.h=svgedit.units.convertUnit(q.h)+d.baseUnit}a(".canvas_width").val(q.w);a(".canvas_height").val(q.h);a("#canvas_title").val(f.getDocumentTitle());a("#svg_docprops").show()}},G=function(){if(!Na){Na=true;var q=a("#bg_blocks div"),A=a.pref("bkgd_color"),I=a.pref("bkgd_url");q.each(function(){var R=a(this),X=R.css("background-color")==A;R.toggleClass("cur_background",X);X&&a("#canvas_bg_url").removeClass("cur_background")}); -A||q.eq(0).addClass("cur_background");I&&a("#canvas_bg_url").val(I);a("grid_snapping_step").attr("value",d.snappingStep);d.gridSnapping==true?a("#grid_snapping_on").attr("checked","checked"):a("#grid_snapping_on").removeAttr("checked");a("#svg_prefs").show()}},P=function(){var q=a("#svg_source_container").height()-50;a("#svg_source_textarea").css("height",q)},Q=function(){if(Ka){var q=function(){f.clearSelection();zb();E();Ab();W();la.fill.prep();la.stroke.prep()};f.setSvgString(a("#svg_source_textarea").val())? -q():a.confirm(e.notification.QerrorsRevertToSource,function(A){if(!A)return false;q()});oa()}},W=function(q){q=q||f.getDocumentTitle();q=Wa+(q?": "+q:"");a("title:first").text(q)},ua=function(){var q=a("#canvas_width"),A=q.val(),I=a("#canvas_height"),R=I.val();if(A!="fit"&&!svgedit.units.isValidUnit("width",A)){a.alert(e.notification.invalidAttrValGiven);q.parent().addClass("error");return false}q.parent().removeClass("error");if(R!="fit"&&!svgedit.units.isValidUnit("height",R)){a.alert(e.notification.invalidAttrValGiven); -I.parent().addClass("error");return false}I.parent().removeClass("error");if(!f.setResolution(A,R)){a.alert(e.notification.noContentToFitTo);return false}b.img_save=a("#image_save_opts :checked").val();a.pref("img_save",b.img_save);Rb();Qb()},wa=function(){var q=a("#bg_blocks div.cur_background").css("background-color")||"#FFF";p(q,a("#canvas_bg_url").val());q=a("#lang_select").val();q!=b.lang&&c.putLocale(q);za(a("#iconsize").val());d.gridSnapping=a("#grid_snapping_on")[0].checked;d.snappingStep= -a("#grid_snapping_step").val();d.showRulers=a("#show_rulers")[0].checked;a("#rulers").toggle(d.showRulers);d.showRulers&&da();d.baseUnit=a("#base_unit").val();f.setConfig(d);Rb();Ib()},fa=c.setIcon=function(q,A){var I=typeof A==="string"?a.getSvgIcon(A,true):A.clone();I?a(q).find("img").replaceWith(I):console.log("NOTE: Icon image missing: "+A)},ka;ka=function(){var q=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,A=document.getElementsByTagName("script")[0],I;for(I in A.style)if(q.test(I))return I.match(q)[0]; -if("WebkitOpacity"in A.style)return"Webkit";if("KhtmlOpacity"in A.style)return"Khtml";return""}();var qa=function(q,A){ka.toLowerCase();var I=["top","left","bottom","right"];q.each(function(){for(var R=a(this),X=R.outerWidth()*(A-1),ja=R.outerHeight()*(A-1),va=0;va<4;va++){var ya=I[va],Da=R.data("orig_margin-"+ya);if(Da==null){Da=parseInt(R.css("margin-"+ya));R.data("orig_margin-"+ya,Da)}Da=Da*A;if(ya==="right")Da+=X;else if(ya==="bottom")Da+=ja;R.css("margin-"+ya,Da)}})},za=c.setIconSize=function(q, -A){if(!(q==b.size&&!A)){var I=a("#tools_top .toolset, #editor_panel > *, #history_panel > *,\t\t\t\t#main_button, #tools_left > *, #path_node_panel > *, #multiselected_panel > *,\t\t\t\t#g_panel > *, #tool_font_size > *, .tools_flyout"),R=1;R=typeof q=="number"?q:{s:0.75,m:1,l:1.25,xl:1.5}[q];c.tool_scale=S=R;Cb();var X=I.parents(":hidden");X.css("visibility","hidden").show();qa(I,R);X.css("visibility","visible").hide();a.pref("iconsize",q);a("#iconsize").val(q);X={"#tools_top":{left:50,height:72}, -"#tools_left":{width:31,top:74},"div#workarea":{left:38,top:74}};I=a("#tool_size_rules");if(I.length)I.empty();else I=a('').appendTo("head");if(q!="m"){var ja="";a.each(X,function(va,ya){va="#svg_editor "+va.replace(/,/g,", #svg_editor");ja+=va+"{";a.each(ya,function(Da,Ca){if(typeof Ca==="number")var Ba=Ca*R+"px";else if(Ca[q]||Ca.all)Ba=Ca[q]||Ca.all;ja+=Da+":"+Ba+";"});ja+="}"});X="-"+ka.toLowerCase()+"-";ja+="#tools_top .toolset, #editor_panel > *, #history_panel > *,\t\t\t\t#main_button, #tools_left > *, #path_node_panel > *, #multiselected_panel > *,\t\t\t\t#g_panel > *, #tool_font_size > *, .tools_flyout{"+ -X+"transform: scale("+R+");} #svg_editor div.toolset .toolset {"+X+"transform: scale(1); margin: 1px !important;} #svg_editor .ui-slider {"+X+"transform: scale("+1/R+");}";I.text(ja)}Cb()}},jb=function(){a("#dialog_box").hide();if(!Ka&&!Ra&&!Na)Sa&&f.leaveContext();else{if(Ka)sa!==a("#svg_source_textarea").val()?a.confirm(e.notification.QignoreSourceChanges,function(q){q&&zb()}):zb();else if(Ra)Qb();else Na&&Ib();Ub()}},zb=function(){a("#svg_source_editor").hide();Ka=false;a("#svg_source_textarea").blur()}, -Qb=function(){a("#svg_docprops").hide();a("#canvas_width,#canvas_height").removeAttr("disabled");a("#resolution")[0].selectedIndex=0;a("#image_save_opts input").val([b.img_save]);Ra=false},Ib=function(){a("#svg_prefs").hide();Na=false},Ob={width:a(window).width(),height:a(window).height()},Ub=a.noop,ac;svgedit.browser.isIE()&&function(){Ub=function(){if(ra[0].scrollLeft===0&&ra[0].scrollTop===0){ra[0].scrollLeft=ac.left;ra[0].scrollTop=ac.top}};ac={left:ra[0].scrollLeft,top:ra[0].scrollTop};a(window).resize(Ub); -svgEditor.ready(function(){setTimeout(function(){Ub()},500)});ra.scroll(function(){ac={left:ra[0].scrollLeft,top:ra[0].scrollTop}})}();a(window).resize(function(){Ka&&P();a.each(Ob,function(q,A){var I=a(window)[q]();ra[0]["scroll"+(q==="width"?"Left":"Top")]-=(I-A)/2;Ob[q]=I})});(function(){ra.scroll(function(){if(a("#ruler_x").length!=0)a("#ruler_x")[0].scrollLeft=ra[0].scrollLeft;if(a("#ruler_y").length!=0)a("#ruler_y")[0].scrollTop=ra[0].scrollTop})})();a("#url_notice").click(function(){a.alert(this.title)}); -a("#change_image_url").click(L);(function(){var q=["clear","open","save","source","delete","delete_multi","paste","clone","clone_multi","move_top","move_bottom"],A="";a.each(q,function(I,R){A+="#tool_"+R+(I==q.length-1?",":"")});a(A).mousedown(function(){a(this).addClass("tool_button_current")}).bind("mousedown mouseout",function(){a(this).removeClass("tool_button_current")});a("#tool_undo, #tool_redo").mousedown(function(){a(this).hasClass("disabled")||a(this).addClass("tool_button_current")}).bind("mousedown mouseout", -function(){a(this).removeClass("tool_button_current")})})();if(V&&!window.opera){V=["tool_clear","tool_save","tool_source","tool_undo","tool_redo","tool_clone"];for(var Bb=V.length;Bb--;){var pc=document.getElementById(V[Bb]);if(pc!=null){var qc=pc.title,uc=qc.indexOf("Ctrl+");pc.title=[qc.substr(0,uc),"Cmd+",qc.substr(uc+5)].join("")}}}var rc=function(q){var A=q[0].id=="stroke_color"?"stroke":"fill",I=q[0].id=="canvas_color";if(I)A="canvas";var R=la[A].paint;q=A=="stroke"?"Pick a Stroke Paint and Opacity": -"Pick a Fill Paint and Opacity";I=I?{right:200,top:50}:{left:45,bottom:50};a("#color_picker").draggable({cancel:".jGraduate_tabs, .jGraduate_colPick, .jGraduate_gradPick, .jPicker",containment:"window"}).css(I).jGraduate({paint:R,window:{pickerTitle:q},images:{clientPath:d.jGraduatePath},newstop:"inverse"},function(X){R=new a.jGraduate.Paint(X);la[A].setPaint(R);f.setPaint(A,R);a("#color_picker").hide()},function(){a("#color_picker").hide()})};V=function(q,A){var I=document.getElementById("canvas_background"), -R={color:"#fff",opacity:1};if(A=="stroke")R=d.initStroke;if(A=="fill")R=d.initFill;if(A=="canvas"&&I)if(I=I.getAttribute("fill").match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))R={color:("0"+parseInt(I[1],10).toString(16)).slice(-2)+("0"+parseInt(I[2],10).toString(16)).slice(-2)+("0"+parseInt(I[3],10).toString(16)).slice(-2),opacity:1};I=(new DOMParser).parseFromString('\t\t\t\t\t', -"text/xml").documentElement;I=a(q)[0].appendChild(document.importNode(I,true));I.setAttribute("width",24.5);this.rect=I.firstChild;this.defs=I.getElementsByTagName("defs")[0];this.grad=this.defs.firstChild;this.paint=new a.jGraduate.Paint({solidColor:R.color});this.type=A;this.setPaint=function(X,ja){this.paint=X;var va="none",ya=X.type,Da=X.alpha/100;switch(ya){case "solidColor":va=X[ya]=="none"||X[ya]=="one"?"none":"#"+X[ya];break;case "linearGradient":case "radialGradient":this.defs.removeChild(this.grad); -this.grad=this.defs.appendChild(X[ya]);va="url(#"+(this.grad.id="gradbox_"+this.type)+")"}this.rect.setAttribute("fill",va);this.rect.setAttribute("opacity",Da);if(ja){f.setColor(this.type,va,true);f.setPaintOpacity(this.type,Da,true)}if(this.type=="canvas"){(ya=document.getElementById("canvas_background"))?ya.setAttribute("fill",va):La(va);console.log(ya.getAttribute("fill"))}};this.update=function(X){if(Z){var ja=this.type;switch(Z.tagName){case "use":case "image":case "foreignObject":return;case "g":case "a":for(var va= -null,ya=Z.getElementsByTagName("*"),Da=0,Ca=ya.length;Da300)q=300-I;else if(I+q<2)q=2-I;if(q!=0){bc-=q;I=a("#layerpanel");ra.css("right",parseInt(ra.css("right"))+q);A.css("width", -parseInt(A.css("width"))+q);I.css("width",parseInt(I.css("width"))+q);A=a("#ruler_x");A.css("right",parseInt(A.css("right"))+q)}}};a("#sidepanel_handle").mousedown(function(q){bc=q.pageX;a(window).mousemove(vc);sc=false;setTimeout(function(){sc=true},20)}).mouseup(function(){lc||wc();bc=-1;lc=false});a(window).mouseup(function(){bc=-1;lc=false;a("#svg_editor").unbind("mousemove",vc)});var wc=function(q){var A=parseInt(a("#sidepanels").css("width"));q=(A>2||q?2:150)-A;A=a("#sidepanels");var I=a("#layerpanel"), -R=a("#ruler_x");ra.css("right",parseInt(ra.css("right"))+q);A.css("width",parseInt(A.css("width"))+q);I.css("width",parseInt(I.css("width"))+q);R.css("right",parseInt(R.css("right"))+q)},xc=function(q){for(var A=Array(f.getCurrentDrawing().getNumLayers()),I=0;I'+ja+"":''+ja+"";q.append(va);A.append('")}if(X!==undefined){X.clone();a("td.layervis",q).append(X.clone());a.resizeSvgIcons({"td.layervis .svg_icon":14})}a("#layerlist td.layername").mouseup(function(ya){a("#layerlist tr.layer").removeClass("layersel");a(this.parentNode).addClass("layersel");f.setCurrentLayer(this.textContent);ya.preventDefault()}).mouseover(function(){a(this).css({"font-style":"italic",color:"blue"});xc(this.textContent)}).mouseout(function(){a(this).css({"font-style":"normal",color:"black"});xc()});a("#layerlist td.layervis").click(function(){var ya= -a(this.parentNode).prevAll().length;ya=a("#layerlist tr.layer:eq("+ya+") td.layername").text();var Da=a(this).hasClass("layerinvis");f.setLayerVisibility(ya,Da);Da?a(this).removeClass("layerinvis"):a(this).addClass("layerinvis")});for(A=5-a("#layerlist tr.layer").size();A-- >0;)q.append('_')};Ab();a(window).bind("load resize",function(){ra.css("line-height",ra.height()+"px")});a("#resolution").change(function(){var q=a("#canvas_width,#canvas_height");if(this.selectedIndex)if(this.value== -"content")q.val("fit").attr("disabled","disabled");else{var A=this.value.split("x");a("#canvas_width").val(A[0]);a("#canvas_height").val(A[1]);q.removeAttr("disabled")}else a("#canvas_width").val()=="fit"&&q.removeAttr("disabled").val(100)});a("input,select").attr("autocomplete","off");var oc=function(){var q=[{sel:"#tool_select",fn:Gb,evt:"click",key:["V",true]},{sel:"#tool_fhpath",fn:Hb,evt:"click",key:["Q",true]},{sel:"#tool_line",fn:Mb,evt:"click",key:["L",true]},{sel:"#tool_rect",fn:Nb,evt:"click", -key:["R",true],icon:"rect"},{sel:"#tool_ellipse",fn:ma,evt:"mouseup",key:["C",true],icon:"ellipse"},{sel:"#tool_path",fn:aa,evt:"click",key:["P",true]},{sel:"#tool_text",fn:N,evt:"click",key:["T",true]},{sel:"#tool_image",fn:Y,evt:"mouseup"},{sel:"#tool_zoom",fn:na,evt:"mouseup",key:["Z",true]},{sel:"#tool_clear",fn:mc,evt:"mouseup",key:[ga+"N",true]},{sel:"#tool_save",fn:function(){Ka?Q():f.save({images:b.img_save,round_digits:6})},evt:"mouseup",key:[ga+"S",true]},{sel:"#tool_export",fn:kc,evt:"mouseup"}, -{sel:"#tool_open",fn:jc,evt:"mouseup"},{sel:"#tool_import",fn:Wb,evt:"mouseup"},{sel:"#tool_source",fn:D,evt:"click",key:[ga+"U",true]},{sel:"#tool_wireframe",fn:z,evt:"click"},{sel:"#tool_rulers",fn:F,evt:"click"},{sel:"#tool_source_cancel,#svg_source_overlay,#tool_docprops_cancel,#tool_prefs_cancel",fn:jb,evt:"click",key:["esc",false,false],hidekey:true},{sel:"#tool_source_save",fn:Q,evt:"click"},{sel:"#tool_docprops_save",fn:ua,evt:"click"},{sel:"#tool_docprops",fn:H,evt:"mouseup"},{sel:"#tool_prefs_save", -fn:wa,evt:"click"},{sel:"#tool_prefs_option",fn:function(){G();return false},evt:"mouseup"},{sel:"#tool_delete,#tool_delete_multi",fn:Pa,evt:"click",key:["del/backspace",true]},{sel:"#tool_reorient",fn:$b,evt:"click"},{sel:"#tool_node_link",fn:Ua,evt:"click"},{sel:"#tool_node_clone",fn:ic,evt:"click"},{sel:"#tool_node_delete",fn:ec,evt:"click"},{sel:"#tool_openclose_path",fn:fc,evt:"click"},{sel:"#tool_add_subpath",fn:cc,evt:"click"},{sel:"#tool_move_top",fn:Db,evt:"click",key:ga+"shift+up"},{sel:"#tool_move_bottom", -fn:cb,evt:"click",key:ga+"shift+down"},{sel:"#tool_move_up",fn:Eb,evt:"click",key:[ga+"up",true]},{sel:"#tool_move_down",fn:$a,evt:"click",key:[ga+"down",true]},{sel:"#tool_topath",fn:Pb,evt:"click"},{sel:"#tool_make_link,#tool_make_link_multi",fn:Zb,evt:"click"},{sel:"#tool_clone,#tool_clone_multi",fn:k,evt:"click",key:[ga+"D",true]},{sel:"#tool_group",fn:h,evt:"click",key:[ga+"G",true]},{sel:"#tool_ungroup",fn:h,evt:"click",key:ga+"shift+G"},{sel:"#tool_unlink_use",fn:h,evt:"click"},{sel:"[id^=tool_align]", -fn:v,evt:"click"},{sel:"#tool_switch",fn:s,evt:"click",key:["shift+x",true]},{sel:"#tool_undo",fn:dc,evt:"click",key:ga+"z"},{sel:"#tool_redo",fn:g,evt:"click",key:["y",true]},{sel:"#tool_canvas_color_menu",fn:t,evt:"click"},{sel:"#tool_cut",fn:Xa,evt:"click",key:ga+"x"},{sel:"#tool_copy",fn:hb,evt:"click",key:ga+"c"},{sel:"#tool_paste",fn:pb,evt:"click",key:ga+"v"},{sel:"#tool_bold",fn:Vb,evt:"mousedown",key:[ga+"B",true]},{sel:"#tool_italic",fn:vb,evt:"mousedown",key:[ga+"I",true]},{sel:"#copy_save_done", -fn:jb,evt:"click"},{key:"ctrl+left",fn:function(){Sb(0,1)}},{key:"ctrl+right",fn:function(){Sb(1,1)}},{key:"ctrl+shift+left",fn:function(){Sb(0,5)}},{key:"ctrl+shift+right",fn:function(){Sb(1,5)}},{key:"shift+O",fn:Tb},{key:"shift+P",fn:gc},{key:[ga+"+",true],fn:function(){E(2)}},{key:[ga+"-",true],fn:function(){E(0.5)}},{key:["up",true],fn:function(){gb(0,-1)}},{key:["down",true],fn:function(){gb(0,1)}},{key:["left",true],fn:function(){gb(-1,0)}},{key:["right",true],fn:function(){gb(1,0)}},{key:"shift+up", -fn:function(){gb(0,-10)}},{key:"shift+down",fn:function(){gb(0,10)}},{key:"shift+left",fn:function(){gb(-10,0)}},{key:"shift+right",fn:function(){gb(10,0)}},{key:["alt+up",true],fn:function(){f.cloneSelectedElements(0,-1)}},{key:["alt+down",true],fn:function(){f.cloneSelectedElements(0,1)}},{key:["alt+left",true],fn:function(){f.cloneSelectedElements(-1,0)}},{key:["alt+right",true],fn:function(){f.cloneSelectedElements(1,0)}},{key:["alt+shift+up",true],fn:function(){f.cloneSelectedElements(0,-10)}}, -{key:["alt+shift+down",true],fn:function(){f.cloneSelectedElements(0,10)}},{key:["alt+shift+left",true],fn:function(){f.cloneSelectedElements(-10,0)}},{key:["alt+shift+right",true],fn:function(){f.cloneSelectedElements(10,0)}},{key:ga+"A",fn:function(){f.selectAllInCurrentLayer()}},{key:ga+"shift+z",fn:g},{key:"esc",fn:C}],A={"4/Shift+4":"#tools_rect_show","5/Shift+5":"#tools_ellipse_show"};return{setAll:function(){var I={};a.each(q,function(R,X){if(X.sel){var ja=a(X.sel);if(ja.length==0)return true; -if(X.evt){if(svgedit.browser.isTouch()&&X.evt==="click")X.evt="mousedown";ja[X.evt](X.fn)}if(X.parent&&a(X.parent+"_show").length!=0){var va=a(X.parent);va.length||(va=Ga(X.parent.substr(1)));va.append(ja);a.isArray(I[X.parent])||(I[X.parent]=[]);I[X.parent].push(X)}}if(X.key){var ya=X.fn,Da=false;if(a.isArray(X.key)){va=X.key[0];if(X.key.length>1)Da=X.key[1]}else va=X.key;va+="";svgedit.browser.isMac&&va.indexOf("+")!=-1&&va.split("+")[0]=="ctrl"&&va.replace("ctrl","cmd");a.each(va.split("/"),function(Ba, -tb){a(document).bind("keydown",tb,function(Ta){ya();Da&&Ta.preventDefault();return false})});if(X.sel&&!X.hidekey&&ja.attr("title")){var Ca=ja.attr("title").split("[")[0]+" ("+va+")";A[va]=X.sel;ja.parents("#main_menu").length||ja.attr("title",Ca)}}});Qa(I);a(".attr_changer, #image_url").bind("keydown","return",function(R){a(this).change();R.preventDefault()});a(window).bind("keydown","tab",function(R){if(U==="canvas"){R.preventDefault();gc()}}).bind("keydown","shift+tab",function(R){if(U==="canvas"){R.preventDefault(); -Tb()}});a("#tool_zoom").dblclick(K)},setTitles:function(){a.each(A,function(I,R){var X=a(R).parents("#main_menu").length;a(R).each(function(){var ja=X?a(this).text().split(" [")[0]:this.title.split(" [")[0],va="";a.each(I.split("/"),function(ya,Da){var Ca=Da.split("+"),Ba="";if(Ca.length>1){Ba=Ca[0]+"+";Da=Ca[1]}va+=(ya?"/":"")+Ba+(e["key_"+Da]||Da)});if(X)this.lastChild.textContent=ja+" ["+va+"]";else this.title=ja+" ["+va+"]"})})},getButtonData:function(I){var R;a.each(q,function(X,ja){if(ja.sel=== -I)R=ja});return R}}}();oc.setAll();c.ready(function(){var q=d.initTool,A=a("#tools_left, #svg_editor .tools_flyout"),I=A.find("#tool_"+q);q=A.find("#"+q);(I.length?I:q.length?q:a("#tool_select")).click().mouseup();d.wireframe&&a("#tool_wireframe").click();d.showlayers&&wc();a("#rulers").toggle(!!d.showRulers);if(d.showRulers)a("#show_rulers")[0].checked=true;if(d.gridSnapping)a("#grid_snapping_on")[0].checked=true;d.baseUnit&&a("#base_unit").val(d.baseUnit);d.snappingStep&&a("#grid_snapping_step").val(d.snappingStep)}); -a("#rect_rx").SpinButton({min:0,max:1E3,step:1,callback:function(q){f.setRectRadius(q.value)}});a("#stroke_width").SpinButton({min:0,max:99,step:1,smallStep:0.1,callback:function(q){var A=q.value;if(A==0&&Z&&["line","polyline"].indexOf(Z.nodeName)>=0)A=q.value=1;f.setStrokeWidth(A)}});a("#angle").SpinButton({min:-180,max:180,step:5,callback:function(q){f.setRotationAngle(q.value);a("#tool_reorient").toggleClass("disabled",q.value==0)}});a("#font_size").SpinButton({step:1,min:0.0010,stepfunc:function(q, -A){var I=q.value-0,R=I+A,X=R>=I;if(A===0)return I;return I>=24?X?Math.round(I*1.1):Math.round(I/1.1):I<=1?X?I*2:I/2:R},callback:function(q){f.setFontSize(q.value)}});a("#group_opacity").SpinButton({step:5,min:0,max:100,callback:xb});a("#blur").SpinButton({step:0.1,min:0,max:10,callback:fb});a("#zoom").SpinButton({min:0.0010,max:1E4,step:50,stepfunc:function(q,A){var I=q.value-0;if(I===0)return 100;var R=I+A;if(A===0)return I;return I>=100?R:R>=I?I*2:I/2},callback:ob}).val(f.getZoom()*100);a("#workarea").contextMenu({menu:"cmenu_canvas", -inSpeed:0},function(q){switch(q){case "delete":Pa();break;case "cut":Xa();break;case "copy":hb();break;case "paste":f.pasteElements();break;case "paste_in_place":f.pasteElements("in_place");break;case "group":f.groupSelectedElements();break;case "ungroup":f.ungroupSelectedElement();break;case "move_front":Db();break;case "move_up":Fb("Up");break;case "move_down":Fb("Down");break;case "move_back":cb();break;default:svgedit.contextmenu&&svgedit.contextmenu.hasCustomHandler(q)&&svgedit.contextmenu.getCustomHandler(q).call()}f.clipBoard.length&& -pa.enableContextMenuItems("#paste,#paste_in_place")});V=function(q){switch(q){case "dupe":M();break;case "delete":T();break;case "merge_down":if(a("#layerlist tr.layersel").index()!=f.getCurrentDrawing().getNumLayers()-1){f.mergeLayer();Ja();Ab()}break;case "merge_all":f.mergeAllLayers();Ja();Ab()}};a("#layerlist").contextMenu({menu:"cmenu_layers",inSpeed:0},V);a("#layer_moreopts").contextMenu({menu:"cmenu_layers",inSpeed:0,allowLeft:true},V);a(".contextMenu li").mousedown(function(q){q.preventDefault()}); -a("#cmenu_canvas li").disableContextMenu();pa.enableContextMenuItems("#delete,#cut,#copy");window.onbeforeunload=function(){if(ha.getUndoStackSize()===0)c.show_save_warning=false;if(!d.no_save_warning&&c.show_save_warning)return e.notification.unsavedChanges};c.openPrep=function(q){a("#main_menu").hide();ha.getUndoStackSize()===0?q(true):a.confirm(e.notification.QwantToOpen,q)};if(window.FileReader){V=a('').change(function(){var q=this;c.openPrep(function(A){if(A){f.clear();if(q.files.length== -1){A=new FileReader;A.onloadend=function(I){n(I.target.result);Rb()};A.readAsText(q.files[0])}}})});a("#tool_open").show().prepend(V);V=a('').change(function(){a("#main_menu").hide();if(this.files.length==1){var q=new FileReader;q.onloadend=function(A){f.importSvgString(A.target.result,true);Rb()};q.readAsText(this.files[0])}});a("#tool_import").show().prepend(V)}var Rb=c.updateCanvas=function(q,A){var I=ra.width(),R=ra.height(),X=I,ja=R,va=f.getZoom(),ya=a("#svgcanvas"),Da={x:ra[0].scrollLeft+ -X/2,y:ra[0].scrollTop+ja/2},Ca=d.canvas_expansion;I=Math.max(X,f.contentW*va*Ca);R=Math.max(ja,f.contentH*va*Ca);I==X&&R==ja?ra.css("overflow","hidden"):ra.css("overflow","scroll");Ca=ya.height()/2;var Ba=ya.width()/2;ya.width(I).height(R);var tb=R/2,Ta=I/2,ia=f.updateCanvas(I,R),wb=Ta/Ba;I=I/2-X/2;R=R/2-ja/2;if(A){A.x+=ia.x;A.y+=ia.y}else A={x:Ta+(Da.x-Ba)*wb,y:tb+(Da.y-Ca)*wb};if(q)if(f.contentW>ra.width()){ra[0].scrollLeft=ia.x-10;ra[0].scrollTop=ia.y-10}else{ra[0].scrollLeft=I;ra[0].scrollTop= -R}else{ra[0].scrollLeft=A.x-X/2;ra[0].scrollTop=A.y-ja/2}if(d.showRulers){da(ya,va);ra.scroll()}},hc=[];for(Bb=0.1;Bb<1E5;Bb*=10){hc.push(1*Bb);hc.push(2*Bb);hc.push(5*Bb)}Rb(true);try{var yc=function(q){if(window.JSON&&JSON.stringify)return JSON.stringify(q);var A=arguments.callee;if(typeof q=="boolean"||typeof q=="number")return q+"";else if(typeof q=="string")return'"'+q.replace(/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, -function(X){return"\\u"+("0000"+X.charCodeAt(0).toString(16)).slice(-4)})+'"';else if(q.length){for(var I=0;I=0)a("#xy_panel").hide();else{var Da,Ca;if(["g","polyline", +"path"].indexOf(va)>=0){if(I=f.getStrokedBBox([q])){Da=I.x;Ca=I.y}}else{Da=q.getAttribute("x");Ca=q.getAttribute("y")}if(R){Da=svgedit.units.convertUnit(Da);Ca=svgedit.units.convertUnit(Ca)}a("#selected_x").val(Math.round(Ca)||0);a("#selected_y").val(Math.round(Da)||0);a("#xy_panel").show()}["image","text","path","g","use"].indexOf(va)==-1&&a(".action_path_convert_selected").removeClass("disabled");va==="path"&&a(".action_path_selected").removeClass("disabled")}else{A=ta.getNodePoint();a("#tool_add_subpath").removeClass("push_button_pressed").addClass("tool_button"); +a("#tool_node_delete").toggleClass("disabled",!ta.canDeleteNodes);fa("#tool_openclose_path",ta.closed_subpath?"open_path":"close_path");if(A){X=a("#seg_type");if(R){A.x=svgedit.units.convertUnit(A.x);A.y=svgedit.units.convertUnit(A.y)}a("#path_node_x").val(Math.round(A.x));a("#path_node_y").val(Math.round(A.y));A.type?X.val(A.type).removeAttr("disabled"):X.val(4).attr("disabled","disabled")}return}R={g:[],a:[],rect:["rx","width","height"],image:["width","height"],circle:["cx","cy","r"],ellipse:["cx", +"cy","rx","ry"],line:["x1","y1","x2","y2"],text:[],use:[]};var Ba=q.tagName;a(q).data("gsvg")&&a("#g_panel").show();Ba=="path"&&a("#path_panel").show();if(R[Ba]){R=R[Ba];a("#"+Ba+"_panel").show();a.each(R,function(tb,Ta){var ia=q.getAttribute(Ta);if(d.baseUnit!=="px"&&q[Ta])ia=svgedit.units.convertUnit(q[Ta].baseVal.value);a("#"+Ba+"_"+Ta).val(Math.round(ia)||0)});if(Ba=="text"){a("#text_panel").css("display","inline");f.getItalic()?a("#tool_italic").addClass("push_button_pressed").removeClass("tool_button"): +a("#tool_italic").removeClass("push_button_pressed").addClass("tool_button");f.getBold()?a("#tool_bold").addClass("push_button_pressed").removeClass("tool_button"):a("#tool_bold").removeClass("push_button_pressed").addClass("tool_button");a("#font_family").val(q.getAttribute("font-family"));a("#font_size").val(q.getAttribute("font-size"));a("#text").val(q.textContent);f.addedNew&&setTimeout(function(){a("#text").focus().select()},100)}else if(Ba=="image")Ea(f.getHref(q));else if(Ba==="g"||Ba==="use"){a("#container_panel").show(); +a(".action_group_selected").removeClass("disabled");R=f.getTitle();va=a("#g_title")[0];va.value=R;qb(va);Ba=="use"?va.setAttribute("disabled","disabled"):va.removeAttribute("disabled")}}ja[(Ba==="g"?"en":"dis")+"ableContextMenuItems"]("#ungroup");ja[(Ba==="g"||!Aa?"dis":"en")+"ableContextMenuItems"]("#group")}else if(Aa){a("#multiselected_panel").show();a(".action_multi_selected").removeClass("disabled");ja.enableContextMenuItems("#group").disableContextMenuItems("#ungroup")}else ja.disableContextMenuItems("#delete,#cut,#copy,#group,#ungroup,#move_front,#move_up,#move_down,#move_back"); +ha.getUndoStackSize()>0?a("#tool_undo").removeClass("disabled"):a("#tool_undo").addClass("disabled");ha.getRedoStackSize()>0?a("#tool_redo").removeClass("disabled"):a("#tool_redo").addClass("disabled");f.addedNew=false;if(q&&!X||Aa){a("#selLayerNames").removeAttr("disabled").val(A);pa.enableContextMenuItems("#delete,#cut,#copy,#move_front,#move_up,#move_down,#move_back")}else a("#selLayerNames").attr("disabled","disabled")};a("#text").focus(function(){});a("#text").blur(function(){});f.bind("selected", +function(q,A){var I=f.getMode();I==="select"&&oa();I=I=="pathedit";Z=A.length==1||A[1]==null?A[0]:null;Aa=A.length>=2&&A[1]!=null;if(Z!=null)if(!I){if(Z!=null)switch(Z.tagName){case "use":case "image":case "foreignObject":break;case "g":case "a":for(var R=null,X=Z.getElementsByTagName("*"),ja=0,va=X.length;ja=2&&A[1]!=null;if(!Aa)switch(I){case "rotate":I=f.getRotationAngle(R);a("#angle").val(Math.round(I));a("#tool_reorient").toggleClass("disabled",I==0)}f.runExtensions("elementTransition",{elems:A})}});f.bind("changed",function(q,A){var I=f.getMode();I==="select"&&oa();for(var R=0;R\n'+A;var I=navigator.userAgent;if(~I.indexOf("Chrome")&&a.browser.version>=533||~I.indexOf("MSIE"))D(0,true);else{var R=q.open("data:image/svg+xml;base64,"+ca.encode64(A)),X=a.pref("save_notice_done");if(X!=="all"){var ja=e.notification.saveFromBrowser.replace("%s","SVG");if(I.indexOf("Gecko/")!==-1)if(A.indexOf("",{id:"export_canvas"}).hide().appendTo("body");var R=a("#export_canvas")[0];R.width=f.contentW;R.height=f.contentH;canvg(R,A.svg,{renderCallback:function(){var X=R.toDataURL("image/png");ba.location.href=X;if(a.pref("export_notice_done")!=="all"){X=e.notification.saveFromBrowser.replace("%s", +"PNG");if(I.length)X+="\n\n"+e.notification.noteTheseIssues+"\n \u2022 "+I.join("\n \u2022 ");a.pref("export_notice_done","all");ba.alert(X)}}})});f.bind("zoomed",Oa);f.bind("contextset",function(q,A){var I="";if(A){var R="";I=''+f.getCurrentDrawing().getCurrentLayerName()+"";a(A).parentsUntil("#svgcontent > g").andSelf().each(function(){if(this.id){R+=" > "+this.id;I+=this!==A?' > '+this.id+"":" > "+this.id}});Sa=R}else Sa=null;a("#cur_context_panel").toggle(!!A).html(I); +W()});f.bind("extension_added",function(q,A){function I(){if(nb){clearTimeout(nb);nb=null}X||(nb=setTimeout(function(){X=true;za(b.iconsize)},50))}var R=false,X=false,ja=true,va=function(){if(A.callback&&!R&&ja){R=true;A.callback()}},ya=[];A.context_tools&&a.each(A.context_tools,function(Ta,ia){var wb=ia.container_id?' id="'+ia.container_id+'"':"",bb=a("#"+ia.panel);bb.length||(bb=a("
        ",{id:ia.panel}).appendTo("#tools_top").hide());switch(ia.type){case "tool_button":var Fa='
        '+ +ia.id+"
        ",Va=a(Fa).appendTo(bb);ia.events&&a.each(ia.events,function(eb,lb){a(Va).bind(eb,lb)});break;case "select":Fa="";var Ha=a(Fa).appendTo(bb).find("select");a.each(ia.events,function(eb,lb){a(Ha).bind(eb,lb)});break;case "button-select":Fa='';wb=a('
          ').appendTo("#option_lists");ia.colnum&&wb.addClass("optcols"+ia.colnum);a(Fa).appendTo(bb).children();ya.push({elem:"#"+ia.id,list:"#"+ia.id+"_opts",title:ia.title,callback:ia.events.change,cur:"#cur_"+ia.id});break;case "input":Fa="'+ia.label+':'; +var kb=a(Fa).appendTo(bb).find("input");ia.spindata&&kb.SpinButton(ia.spindata);ia.events&&a.each(ia.events,function(eb,lb){kb.bind(eb,lb)})}});if(A.buttons){var Da={},Ca={},Ba=A.svgicons,tb={};a.each(A.buttons,function(Ta,ia){for(var wb,bb=ia.id,Fa=Ta;a("#"+bb).length;)bb=ia.id+"_"+ ++Fa;if(Ba){Da[bb]=ia.icon;Fa=ia.svgicon?ia.svgicon:ia.id;if(ia.type=="app_menu")Ca["#"+bb+" > div"]=Fa;else Ca["#"+bb]=Fa}else wb=ia.type=="menu"?"":a('');var Va,Ha;switch(ia.type){case "mode_flyout":case "mode":Va= +"tool_button";if(ia.cls)Va+=" "+ia.cls;Ha="#tools_left";break;case "context":Va="tool_button";Ha="#"+ia.panel;a(Ha).length||a("
          ",{id:ia.panel}).appendTo("#tools_top");break;case "menu":Va="menu_item tool_button";Ha="#"+(ia.after||ia.panel);break;case "app_menu":Va="";Ha=ia.parent||"#main_menu ul";a(Ha).length||a("
          ",{id:ia.panel}).appendTo("#tools_top")}var kb=a(ia.list||ia.type=="app_menu"?"
        • ":"
          ").attr("id",bb).attr("title",ia.title).addClass(Va);if(!ia.includeWith&&!ia.list){if("position"in +ia)a(Ha).children().eq(ia.position).before(kb);else ia.type!="menu"||!ia.after?kb.appendTo(Ha):a(Ha).after(kb);if(ia.type=="mode_flyout"){Fa=a(kb);Va=Fa.parent();if(!Fa.parent().hasClass("tools_flyout")){var eb=Fa[0].id.replace("tool_","tools_"),lb=Fa.clone().attr("id",eb+"_show").append(a("
          ",{"class":"flyout_arrow_horiz"}));Fa.before(lb);Va=Ga(eb,Fa);Va.data("isLibrary",true);lb.data("isLibrary",true)}Ca["#"+eb+"_show"]=ia.id;bb=tb["#"+Va[0].id]=[{sel:"#"+bb,fn:ia.events.click,icon:ia.id,isDefault:true}, +Yb]}else if(ia.type=="app_menu"||ia.type=="menu")kb.append(ia.title)}else if(ia.list){kb.addClass("push_button");a("#"+ia.list+"_opts").append(kb);if(ia.isDefault){a("#cur_"+ia.list).append(kb.children().clone());Fa=ia.svgicon?ia.svgicon:ia.id;Ca["#cur_"+ia.list]=Fa}}else if(ia.includeWith){Ha=ia.includeWith;Fa=a(Ha.button);Va=Fa.parent();if(!Fa.parent().hasClass("tools_flyout")){eb=Fa[0].id.replace("tool_","tools_");lb=Fa.clone().attr("id",eb+"_show").append(a("
          ",{"class":"flyout_arrow_horiz"})); +Fa.before(lb);Va=Ga(eb,Fa)}var Yb=oc.getButtonData(Ha.button);if(Ha.isDefault)Ca["#"+eb+"_show"]=ia.id;bb=tb["#"+Va[0].id]=[{sel:"#"+bb,fn:ia.events.click,icon:ia.id,key:ia.key,isDefault:ia.includeWith?ia.includeWith.isDefault:0},Yb];eb="position"in Ha?Ha.position:"last";Yb=Va.children().length;if(!isNaN(eb)&&eb>=0&&eb
          '});a("#palette").append(Za); +Za="";a.each(["#FFF","#888","#000"],function(){Za+='
          '});a("#bg_blocks").append(Za);var Ma=a("#bg_blocks div");Ma.each(function(){a(this).click(function(){Ma.removeClass("cur_background");a(this).addClass("cur_background")})});if(a.pref("bkgd_color"))p(a.pref("bkgd_color"),a.pref("bkgd_url"));else a.pref("bkgd_url")&&p(o.bkgd_color,a.pref("bkgd_url"));if(a.pref("img_save")){b.img_save=a.pref("img_save");a("#image_save_opts input").val([b.img_save])}var ob= +function(q){var A=q.value/100;if(A<0.0010)q.value=0.1;else{q=f.getZoom();Oa(window,{width:0,height:0,x:(ra[0].scrollLeft+ra.width()/2)/q,y:(ra[0].scrollTop+ra.height()/2)/q,zoom:A},true)}},xb=function(q,A){if(A==null)A=q.value;a("#group_opacity").val(A);if(!q||!q.handle)a("#opac_slider").slider("option","value",A);f.setOpacity(A/100)},fb=function(q,A,I){if(A==null)A=q.value;a("#blur").val(A);var R=false;if(!q||!q.handle){a("#blur_slider").slider("option","value",A);R=true}I?f.setBlurNoUndo(A):f.setBlur(A, +R)},ib=function(){window.opera&&a("

          ").hide().appendTo("body").remove()};a("#stroke_style").change(function(){f.setStrokeAttr("stroke-dasharray",a(this).val());ib()});a("#stroke_linejoin").change(function(){f.setStrokeAttr("stroke-linejoin",a(this).val());ib()});a("select").change(function(){a(this).blur()});var Lb=false;a("#selLayerNames").change(function(){var q=this.options[this.selectedIndex].value,A=e.notification.QmoveElemsToLayer.replace("%s",q),I=function(R){if(R){Lb=true;f.moveSelectedToLayer(q); +f.clearSelection();Ab()}};if(q)Lb?I(true):a.confirm(A,I)});a("#font_family").change(function(){f.setFontFamily(this.value)});a("#seg_type").change(function(){f.setSegType(a(this).val())});a("#text").keyup(function(){f.setTextContent(this.value)});a("#image_url").change(function(){Ea(this.value)});a("#link_url").change(function(){this.value.length?f.setLinkURL(this.value):f.removeHyperlink()});a("#g_title").change(function(){f.setGroupTitle(this.value)});a(".attr_changer").change(function(){var q= +this.getAttribute("data-attr"),A=this.value;if(svgedit.units.isValidUnit(q,A,Z))this.blur();else{a.alert(e.notification.invalidAttrValGiven);this.value=Z.getAttribute(q);return false}if(q!=="id")if(isNaN(A))A=f.convertToNum(q,A);else if(d.baseUnit!=="px"){var I=svgedit.units.getTypeMap();if(Z[q]||f.getMode()==="pathedit"||q==="x"||q==="y")A*=I[d.baseUnit]}if(q==="id"){q=Z;f.clearSelection();q.id=A;f.addToSelection([q],true)}else f.changeSelectedAttribute(q,A);this.blur()});a("#palette").mouseover(function(){var q= +a('');a(this).append(q);q.focus().remove()});a(".palette_item").mousedown(function(){var q=a("#tool_stroke").hasClass("active"),A=q?"stroke":"fill",I=a(this).attr("data-rgb"),R=null;if(I==="transparent"||I==="initial"||I==="#none"){I="none";R=new a.jGraduate.Paint}else R=new a.jGraduate.Paint({alpha:100,solidColor:I.substr(1)});la[A].setPaint(R);if(q){f.setColor("stroke",I);I!="none"&&f.getStrokeOpacity()!=1&&f.setPaintOpacity("stroke",1)}else{f.setColor("fill",I);I!="none"&& +f.getFillOpacity()!=1&&f.setPaintOpacity("fill",1)}}).bind("contextmenu",function(q){q.preventDefault()});a("#toggle_stroke_tools").toggle(function(){a(".stroke_tool").css("display","table-cell");a(this).addClass("expanded");Ub()},function(){a(".stroke_tool").css("display","none");a(this).removeClass("expanded");Ub()});var xa=function(q,A){if(a(q).hasClass("disabled"))return false;if(a(q).parent().hasClass("tools_flyout"))return true;var I=I||"normal";A||a(".tools_flyout").fadeOut(I);a("#styleoverrides").text(""); +a(".tool_button_current").removeClass("tool_button_current").addClass("tool_button");a(q).addClass("tool_button_current").removeClass("tool_button");return true};(function(){var q=null,A=null,I=ra[0],R=false,X=false;a("#svgcanvas").bind("mousemove mouseup",function(ja){if(R!==false){I.scrollLeft-=ja.clientX-q;I.scrollTop-=ja.clientY-A;q=ja.clientX;A=ja.clientY;if(ja.type==="mouseup")R=false;return false}}).mousedown(function(ja){if(ja.button===1||X===true){R=true;q=ja.clientX;A=ja.clientY;return false}}); +a(window).mouseup(function(){R=false});a(document).bind("keydown","space",function(ja){f.spaceKey=X=true;ja.preventDefault()}).bind("keyup","space",function(ja){ja.preventDefault();f.spaceKey=X=false}).bind("keydown","alt",function(){f.getMode()==="zoom"&&ra.addClass("out")}).bind("keyup","alt",function(){f.getMode()==="zoom"&&ra.removeClass("out")})})();var ub=a(".menu"),rb=function(q){q.target.style.background="#fff";setTimeout(function(){q.target.style.background="#ddd"},50);setTimeout(function(){q.target.style.background= +"#fff"},150);setTimeout(function(){q.target.style.background="#ddd"},200);setTimeout(function(){q.target.style.background=""},200);setTimeout(function(){a("#menu_bar").removeClass("active")},220);return false};a(".menu_item").live("click",function(q){rb(q)});a("svg, body").on("mousedown",function(q){top!=self&&!q.isTrigger&&typeof top.exports.setEditorFocus=="function"&&top.exports.setEditorFocus();if(!a(q.target).hasClass("menu_title"))if(!a(q.target).hasClass("disabled")&&a(q.target).hasClass("menu_item"))rb(q); +else{a("#menu_bar").removeClass("active");a("#tools_shapelib").is(":visible")&&!a(q.target).parents("#tools_shapelib_show, #tools_shapelib").length&&a("#tools_shapelib").hide();q.target.nodeName.toLowerCase()!="input"&&a("input").blur()}});var yb=[6,12,16,33,50,66,100,150,200,300,400,600,800,1200];a("#workarea").on("mousewheel",function(q,A,I,R){if(q.altKey){q.preventDefault();q=f.getZoom()*100;A=yb.length;for(Bb=0;Bb0)zoom=yb[Bb]<=q?yb[I]:zoom;if(R<0)zoom=yb[Bb]< +q?yb[Bb]:zoom}zoom&&ob({value:zoom})}});a(".menu_title").on("click",function(){a("#menu_bar").toggleClass("active")});a(".menu_title").on("mouseover",function(){ub.removeClass("open");a(this).parent().addClass("open")});c.addDropDown=function(q,A,I){if(a(q).length!=0){var R=a(q).find("button"),X=a(q).find("ul").attr("id",a(q)[0].id+"-list");I||a("#option_lists").append(X);var ja=false;I&&a(q).addClass("dropup");X.find("li").bind("mouseup",A);a(window).mouseup(function(){if(!ja){R.removeClass("down"); +X.hide()}ja=false});R.bind("mousedown",function(){if(R.hasClass("down")){R.removeClass("down");X.hide()}else{R.addClass("down");if(!I){var va=a(q).offset();X.css({top:va.top,left:va.left-110})}X.show();ja=true}}).hover(function(){ja=true}).mouseout(function(){ja=false})}};var sb=function(q,A,I,R){var X=a(q);A=a(A);var ja=false,va=R.dropUp;va&&a(q).addClass("dropup");A.find("li").bind("mouseup",function(){if(R.seticon){fa("#cur_"+X[0].id,a(this).children());a(this).addClass("current").siblings().removeClass("current")}I.apply(this, +arguments)});a(window).mouseup(function(){if(!ja){X.removeClass("down");A.hide();A.css({top:0,left:0})}ja=false});A.height();a(q).bind("mousedown",function(){var ya=a(q).offset();if(va){ya.top-=A.height();ya.left+=8}else ya.top+=a(q).height();a(A).offset(ya);if(X.hasClass("down")){X.removeClass("down");A.hide();A.css({top:0,left:0})}else{X.addClass("down");A.show();ja=true;return false}}).hover(function(){ja=true}).mouseout(function(){ja=false});R.multiclick&&A.mousedown(function(){ja=true})};c.addDropDown("#font_family_dropdown", +function(){a(this).text();a("#font_family").val(a(this).text()).change()});c.addDropDown("#opacity_dropdown",function(){if(!a(this).find("div").length){var q=parseInt(a(this).text().split("%")[0]);xb(false,q)}},false);a("#opac_slider").slider({start:function(){a("#opacity_dropdown li:not(.special)").hide()},stop:function(){a("#opacity_dropdown li").show();a(window).mouseup()},slide:function(q,A){xb(A)}});c.addDropDown("#blur_dropdown",a.noop);var mb=false;a("#blur_slider").slider({max:10,step:0.1, +stop:function(q,A){mb=false;fb(A);a("#blur_dropdown li").show();a(window).mouseup()},start:function(){mb=true},slide:function(q,A){fb(A,null,mb)}});c.addDropDown("#zoom_dropdown",function(){var q=a(this),A=q.attr("data-val");A?Oa(window,A):ob({value:parseInt(q.text())})},true);sb("#stroke_linecap","#linecap_opts",function(){w(this,true)},{dropUp:true});sb("#stroke_linejoin","#linejoin_opts",function(){w(this,true)},{dropUp:true});a("div","#position_opts").each(function(){this.addEventListener("mouseup", +function(){var q=this.id.replace("tool_pos","").charAt(0);f.alignSelectedElements(q,"page")})});(function(){var q,A=function(){a(q).blur()};a("#svg_editor").find("button, select, input:not(#text)").focus(function(){q=this;U="toolbars";ra.mousedown(A)}).blur(function(){U="canvas";ra.unbind("mousedown",A);f.getMode()=="textedit"&&a("#text").focus()})})();var Gb=function(){if(xa("#tool_select")){f.setMode("select");a("#styleoverrides").text("#svgcanvas svg *{cursor:move;pointer-events:all}, #svgcanvas svg{cursor:default}")}}, +Hb=function(){xa("#tool_fhpath")&&f.setMode("fhpath")},Mb=function(){xa("#tool_line")&&f.setMode("line")},Nb=function(){xa("#tool_rect")&&f.setMode("rect")},ma=function(){xa("#tool_ellipse")&&f.setMode("ellipse")},Y=function(){xa("#tool_image")&&f.setMode("image")},na=function(){xa("#tool_zoom")&&f.setMode("zoom")},K=function(){if(xa("#tool_zoom")){E();oa()}},N=function(){xa("#tool_text")&&f.setMode("text")},aa=function(){xa("#tool_path")&&f.setMode("path")},Pa=function(){if(Z!=null||Aa)f.deleteSelectedElements()}, +Xa=function(){if(Z!=null||Aa){window.event.type==="keydown"&&db(a("#edit_menu"));f.cutSelectedElements()}},hb=function(){if(Z!=null||Aa){window.event.type==="keydown"&&db(a("#edit_menu"));f.copySelectedElements()}},pb=function(){window.event.type==="keydown"&&db(a("#edit_menu"));var q=f.getZoom(),A=(ra[0].scrollLeft+ra.width()/2)/q-f.contentW;q=(ra[0].scrollTop+ra.height()/2)/q-f.contentH;f.pasteElements("point",A,q)},Db=function(){if(Z!=null){window.event.type==="keydown"&&db(a("#object_menu")); +f.moveToTopSelectedElement()}},cb=function(){if(Z!=null){window.event.type==="keydown"&&db(a("#object_menu"));f.moveToBottomSelectedElement()}},Eb=function(){if(Z!=null){window.event.type==="keydown"&&db(a("#object_menu"));f.moveUpDownSelected("Up")}},$a=function(){if(Z!=null){window.event.type==="keydown"&&db(a("#object_menu"));f.moveUpDownSelected("Down")}},Fb=function(q){if(Z!=null){window.event.type==="keydown"&&db(a("#object_menu"));f.moveUpDownSelected(q)}},Pb=function(){if(Z!=null){f.convertToPath(); +elems=f.getSelectedElems();f.selectorManager.requestSelector(elems[0]).selectorRect.setAttribute("display","none");f.setMode("pathedit");ta.toEditMode(elems[0]);f.clearSelection()}},$b=function(){Z!=null&&ta.reorient()},Zb=function(){if(Z!=null||Aa)a.prompt(e.notification.enterNewLinkURL,"http://",function(q){q&&f.makeHyperlink(q)})},gb=function(q,A){if(Z!=null||Aa){if(d.gridSnapping){var I=f.getZoom()*d.snappingStep;q*=I;A*=I}a("input").blur();f.moveSelectedElements(q,A)}},Ua=function(){var q=!a("#tool_node_link").hasClass("push_button_pressed"); +q?a("#tool_node_link").addClass("push_button_pressed").removeClass("tool_button").find("input").attr("checked",true):a("#tool_node_link").removeClass("push_button_pressed").addClass("tool_button").find("input").attr("checked",false);ta.linkControlPoints(q)},ic=function(){ta.getNodePoint()&&ta.clonePathNode()},ec=function(){ta.getNodePoint()&&ta.deletePathNode()},cc=function(){var q=a("#tool_add_subpath"),A=!q.hasClass("push_button_pressed");A?q.addClass("push_button_pressed").removeClass("tool_button"): +q.removeClass("push_button_pressed").addClass("tool_button");ta.addSubPath(A)},fc=function(){ta.opencloseSubPath()},gc=function(){f.cycleElement(1)},Tb=function(){f.cycleElement(0)},Sb=function(q,A){if(!(Z==null||Aa)){q||(A*=-1);var I=a("#angle").val()*1+A;f.setRotationAngle(I);Ja()}},mc=function(){var q=d.dimensions;a.confirm(e.notification.QwantToClear,function(A){if(A){oa();f.clear();f.setResolution(q[0],q[1]);Rb(true);E();Ab();Ja();la.fill.prep();la.stroke.prep();f.runExtensions("onNewDocument")}})}, +Vb=function(){f.setBold(!f.getBold());Ja();return false},vb=function(){f.setItalic(!f.getItalic());Ja();return false},kc=function(){if(!l.pngsave){var q=e.notification.loadingImage;ba=window.open("data:text/html;charset=utf-8,"+q+"

          "+q+"

          ")}window.canvg?f.rasterExport():a.getScript("canvg/rgbcolor.js",function(){a.getScript("canvg/canvg.js",function(){f.rasterExport()})})},jc=function(){f.open()},Wb=function(){},db=function(q){var A=q.prev();A.css("background","#09f");setTimeout(function(){A.css("background", +"")},200)},dc=function(){if(ha.getUndoStackSize()>0){window.event.type==="keydown"&&db(a("#edit_menu"));ha.undo();Ab()}},g=function(){if(ha.getRedoStackSize()>0){window.event.type==="keydown"&&db(a("#edit_menu"));ha.redo();Ab()}},h=function(){if(Aa)f.groupSelectedElements();else Z&&f.ungroupSelectedElement()},k=function(){window.event.type==="keydown"&&db(a("#edit_menu"));f.cloneSelectedElements(20,20)},v=function(){var q=this.id.replace("tool_align","").charAt(0);f.alignSelectedElements(q,a("#align_relative_to").val())}, +s=function(){var q=document.querySelector("#tool_stroke rect"),A=document.querySelector("#tool_fill rect"),I=A.getAttribute("fill"),R=q.getAttribute("fill");q=parseFloat(q.getAttribute("stroke-opacity"));if(isNaN(q))q=100;A=parseFloat(A.getAttribute("fill-opacity"));if(isNaN(A))A=100;R=ab(R,q,"stroke");I=ab(I,A,"fill");la.fill.setPaint(R,true);la.stroke.setPaint(I,true)},E=function(q){var A=f.getResolution();q=q?A.zoom*q:1;a("#zoom").val(q*100);f.setZoom(q);B();Rb(true)},z=function(){!a("#tool_wireframe").hasClass("push_button_pressed")? +a("#tool_wireframe").addClass("push_button_pressed"):a("#tool_wireframe").removeClass("push_button_pressed");ra.toggleClass("wireframe");if(!tc){var q=a("#wireframe_rules");q.length?q.empty():a('').appendTo("head");B()}},t=function(){f.clearSelection();a("#tool_canvas").trigger("click")},C=function(){window.self!=window.top&&top.exports.setEditorFocus(false)},F=function(){if(a("#tool_rulers").hasClass("push_button_pressed")){a("#tool_rulers").removeClass("push_button_pressed"); +a("#show_rulers").attr("checked",false);d.showRulers=false}else{a("#tool_rulers").addClass("push_button_pressed");a("#show_rulers").attr("checked",true);d.showRulers=true}a("#rulers").toggle(!!d.showRulers)},B=function(){if(!tc){var q="#workarea.wireframe #svgcontent * { stroke-width: "+1/f.getZoom()+"px; }";a("#wireframe_rules").text(ra.hasClass("wireframe")?q:"")}},D=function(q,A){if(!Ka){Ka=true;a("#save_output_btns").toggle(!!A);a("#tool_source_back").toggle(!A);var I=sa=f.getSvgString();a("#svg_source_textarea").val(I); +a("#svg_source_editor").fadeIn();P();a("#svg_source_textarea").focus()}},H=function(){if(!Ra){Ra=true;a("#image_save_opts input").val([b.img_save]);var q=f.getResolution();if(d.baseUnit!=="px"){q.w=svgedit.units.convertUnit(q.w)+d.baseUnit;q.h=svgedit.units.convertUnit(q.h)+d.baseUnit}a(".canvas_width").val(q.w);a(".canvas_height").val(q.h);a("#canvas_title").val(f.getDocumentTitle());a("#svg_docprops").show()}},G=function(){if(!Na){Na=true;var q=a("#bg_blocks div"),A=a.pref("bkgd_color"),I=a.pref("bkgd_url"); +q.each(function(){var R=a(this),X=R.css("background-color")==A;R.toggleClass("cur_background",X);X&&a("#canvas_bg_url").removeClass("cur_background")});A||q.eq(0).addClass("cur_background");I&&a("#canvas_bg_url").val(I);a("grid_snapping_step").attr("value",d.snappingStep);d.gridSnapping==true?a("#grid_snapping_on").attr("checked","checked"):a("#grid_snapping_on").removeAttr("checked");a("#svg_prefs").show()}},P=function(){var q=a("#svg_source_container").height()-50;a("#svg_source_textarea").css("height", +q)},Q=function(){if(Ka){var q=function(){f.clearSelection();zb();E();Ab();W();la.fill.prep();la.stroke.prep()};f.setSvgString(a("#svg_source_textarea").val())?q():a.confirm(e.notification.QerrorsRevertToSource,function(A){if(!A)return false;q()});oa()}},W=function(q){q=q||f.getDocumentTitle();q=Wa+(q?": "+q:"");a("title:first").text(q)},ua=function(){var q=a("#canvas_width"),A=q.val(),I=a("#canvas_height"),R=I.val();if(A!="fit"&&!svgedit.units.isValidUnit("width",A)){a.alert(e.notification.invalidAttrValGiven); +q.parent().addClass("error");return false}q.parent().removeClass("error");if(R!="fit"&&!svgedit.units.isValidUnit("height",R)){a.alert(e.notification.invalidAttrValGiven);I.parent().addClass("error");return false}I.parent().removeClass("error");if(!f.setResolution(A,R)){a.alert(e.notification.noContentToFitTo);return false}b.img_save=a("#image_save_opts :checked").val();a.pref("img_save",b.img_save);Rb();Qb()},wa=function(){var q=a("#bg_blocks div.cur_background").css("background-color")||"#FFF"; +p(q,a("#canvas_bg_url").val());q=a("#lang_select").val();q!=b.lang&&c.putLocale(q);za(a("#iconsize").val());d.gridSnapping=a("#grid_snapping_on")[0].checked;d.snappingStep=a("#grid_snapping_step").val();d.showRulers=a("#show_rulers")[0].checked;a("#rulers").toggle(d.showRulers);d.showRulers&&da();d.baseUnit=a("#base_unit").val();f.setConfig(d);Rb();Ib()},fa=c.setIcon=function(q,A){var I=typeof A==="string"?a.getSvgIcon(A,true):A.clone();I?a(q).find("img").replaceWith(I):console.log("NOTE: Icon image missing: "+ +A)},ka;ka=function(){var q=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,A=document.getElementsByTagName("script")[0],I;for(I in A.style)if(q.test(I))return I.match(q)[0];if("WebkitOpacity"in A.style)return"Webkit";if("KhtmlOpacity"in A.style)return"Khtml";return""}();var qa=function(q,A){ka.toLowerCase();var I=["top","left","bottom","right"];q.each(function(){for(var R=a(this),X=R.outerWidth()*(A-1),ja=R.outerHeight()*(A-1),va=0;va<4;va++){var ya=I[va],Da=R.data("orig_margin-"+ya);if(Da==null){Da=parseInt(R.css("margin-"+ +ya));R.data("orig_margin-"+ya,Da)}Da=Da*A;if(ya==="right")Da+=X;else if(ya==="bottom")Da+=ja;R.css("margin-"+ya,Da)}})},za=c.setIconSize=function(q,A){if(!(q==b.size&&!A)){var I=a("#tools_top .toolset, #editor_panel > *, #history_panel > *,\t\t\t\t#main_button, #tools_left > *, #path_node_panel > *, #multiselected_panel > *,\t\t\t\t#g_panel > *, #tool_font_size > *, .tools_flyout"),R=1;R=typeof q=="number"?q:{s:0.75,m:1,l:1.25,xl:1.5}[q];c.tool_scale=S=R;Cb();var X=I.parents(":hidden");X.css("visibility", +"hidden").show();qa(I,R);X.css("visibility","visible").hide();a.pref("iconsize",q);a("#iconsize").val(q);X={"#tools_top":{left:50,height:72},"#tools_left":{width:31,top:74},"div#workarea":{left:38,top:74}};I=a("#tool_size_rules");if(I.length)I.empty();else I=a('').appendTo("head");if(q!="m"){var ja="";a.each(X,function(va,ya){va="#svg_editor "+va.replace(/,/g,", #svg_editor");ja+=va+"{";a.each(ya,function(Da,Ca){if(typeof Ca==="number")var Ba=Ca*R+"px";else if(Ca[q]|| +Ca.all)Ba=Ca[q]||Ca.all;ja+=Da+":"+Ba+";"});ja+="}"});X="-"+ka.toLowerCase()+"-";ja+="#tools_top .toolset, #editor_panel > *, #history_panel > *,\t\t\t\t#main_button, #tools_left > *, #path_node_panel > *, #multiselected_panel > *,\t\t\t\t#g_panel > *, #tool_font_size > *, .tools_flyout{"+X+"transform: scale("+R+");} #svg_editor div.toolset .toolset {"+X+"transform: scale(1); margin: 1px !important;} #svg_editor .ui-slider {"+X+"transform: scale("+1/R+");}";I.text(ja)}Cb()}},jb=function(){a("#dialog_box").hide(); +if(!Ka&&!Ra&&!Na)Sa&&f.leaveContext();else{if(Ka)sa!==a("#svg_source_textarea").val()?a.confirm(e.notification.QignoreSourceChanges,function(q){q&&zb()}):zb();else if(Ra)Qb();else Na&&Ib();Ub()}},zb=function(){a("#svg_source_editor").hide();Ka=false;a("#svg_source_textarea").blur()},Qb=function(){a("#svg_docprops").hide();a("#canvas_width,#canvas_height").removeAttr("disabled");a("#resolution")[0].selectedIndex=0;a("#image_save_opts input").val([b.img_save]);Ra=false},Ib=function(){a("#svg_prefs").hide(); +Na=false},Ob={width:a(window).width(),height:a(window).height()},Ub=a.noop,ac;svgedit.browser.isIE()&&function(){Ub=function(){if(ra[0].scrollLeft===0&&ra[0].scrollTop===0){ra[0].scrollLeft=ac.left;ra[0].scrollTop=ac.top}};ac={left:ra[0].scrollLeft,top:ra[0].scrollTop};a(window).resize(Ub);svgEditor.ready(function(){setTimeout(function(){Ub()},500)});ra.scroll(function(){ac={left:ra[0].scrollLeft,top:ra[0].scrollTop}})}();a(window).resize(function(){Ka&&P();a.each(Ob,function(q,A){var I=a(window)[q](); +ra[0]["scroll"+(q==="width"?"Left":"Top")]-=(I-A)/2;Ob[q]=I})});(function(){ra.scroll(function(){if(a("#ruler_x").length!=0)a("#ruler_x")[0].scrollLeft=ra[0].scrollLeft;if(a("#ruler_y").length!=0)a("#ruler_y")[0].scrollTop=ra[0].scrollTop})})();a("#url_notice").click(function(){a.alert(this.title)});a("#change_image_url").click(L);(function(){var q=["clear","open","save","source","delete","delete_multi","paste","clone","clone_multi","move_top","move_bottom"],A="";a.each(q,function(I,R){A+="#tool_"+ +R+(I==q.length-1?",":"")});a(A).mousedown(function(){a(this).addClass("tool_button_current")}).bind("mousedown mouseout",function(){a(this).removeClass("tool_button_current")});a("#tool_undo, #tool_redo").mousedown(function(){a(this).hasClass("disabled")||a(this).addClass("tool_button_current")}).bind("mousedown mouseout",function(){a(this).removeClass("tool_button_current")})})();if(V&&!window.opera){V=["tool_clear","tool_save","tool_source","tool_undo","tool_redo","tool_clone"];for(var Bb=V.length;Bb--;){var pc= +document.getElementById(V[Bb]);if(pc!=null){var qc=pc.title,uc=qc.indexOf("Ctrl+");pc.title=[qc.substr(0,uc),"Cmd+",qc.substr(uc+5)].join("")}}}var rc=function(q){var A=q[0].id=="stroke_color"?"stroke":"fill",I=q[0].id=="canvas_color";if(I)A="canvas";var R=la[A].paint;q=A=="stroke"?"Pick a Stroke Paint and Opacity":"Pick a Fill Paint and Opacity";I=I?{right:200,top:50}:{left:45,bottom:50};a("#color_picker").draggable({cancel:".jGraduate_tabs, .jGraduate_colPick, .jGraduate_gradPick, .jPicker",containment:"window"}).css(I).jGraduate({paint:R, +window:{pickerTitle:q},images:{clientPath:d.jGraduatePath},newstop:"inverse"},function(X){R=new a.jGraduate.Paint(X);la[A].setPaint(R);f.setPaint(A,R);a("#color_picker").hide()},function(){a("#color_picker").hide()})};V=function(q,A){var I=document.getElementById("canvas_background"),R={color:"fff",opacity:1};if(A=="stroke")R=d.initStroke;if(A=="fill")R=d.initFill;if(A=="canvas"&&I)if(I=I.getAttribute("fill").match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))R={color:("0"+parseInt(I[1],10).toString(16)).slice(-2)+ +("0"+parseInt(I[2],10).toString(16)).slice(-2)+("0"+parseInt(I[3],10).toString(16)).slice(-2),opacity:1};I=(new DOMParser).parseFromString('\t\t\t\t\t',"text/xml").documentElement;I=a(q)[0].appendChild(document.importNode(I,true));I.setAttribute("width",24.5);this.rect=I.firstChild;this.defs=I.getElementsByTagName("defs")[0]; +this.grad=this.defs.firstChild;this.paint=new a.jGraduate.Paint({solidColor:R.color});this.type=A;this.setPaint=function(X,ja){this.paint=X;var va="none",ya=X.type,Da=X.alpha/100;switch(ya){case "solidColor":va=X[ya]=="none"||X[ya]=="one"?"none":"#"+X[ya];break;case "linearGradient":case "radialGradient":this.defs.removeChild(this.grad);this.grad=this.defs.appendChild(X[ya]);va="url(#"+(this.grad.id="gradbox_"+this.type)+")"}this.rect.setAttribute("fill",va);this.rect.setAttribute("opacity",Da);if(ja){f.setColor(this.type, +va,true);f.setPaintOpacity(this.type,Da,true)}if(this.type=="canvas"){(ya=document.getElementById("canvas_background"))?ya.setAttribute("fill",va):La(va);console.log(ya.getAttribute("fill"))}};this.update=function(X){if(Z){var ja=this.type;switch(Z.tagName){case "use":case "image":case "foreignObject":return;case "g":case "a":for(var va=null,ya=Z.getElementsByTagName("*"),Da=0,Ca=ya.length;Da300)q=300-I;else if(I+q<2)q=2-I;if(q!=0){bc-=q;I=a("#layerpanel");ra.css("right",parseInt(ra.css("right"))+q);A.css("width",parseInt(A.css("width"))+q);I.css("width",parseInt(I.css("width"))+q);A=a("#ruler_x");A.css("right",parseInt(A.css("right"))+q)}}};a("#sidepanel_handle").mousedown(function(q){bc=q.pageX;a(window).mousemove(vc); +sc=false;setTimeout(function(){sc=true},20)}).mouseup(function(){lc||wc();bc=-1;lc=false});a(window).mouseup(function(){bc=-1;lc=false;a("#svg_editor").unbind("mousemove",vc)});var wc=function(q){var A=parseInt(a("#sidepanels").css("width"));q=(A>2||q?2:150)-A;A=a("#sidepanels");var I=a("#layerpanel"),R=a("#ruler_x");ra.css("right",parseInt(ra.css("right"))+q);A.css("width",parseInt(A.css("width"))+q);I.css("width",parseInt(I.css("width"))+q);R.css("right",parseInt(R.css("right"))+q)},xc=function(q){for(var A= +Array(f.getCurrentDrawing().getNumLayers()),I=0;I'+ja+"":''+ja+"";q.append(va);A.append('")}if(X!==undefined){X.clone();a("td.layervis",q).append(X.clone());a.resizeSvgIcons({"td.layervis .svg_icon":14})}a("#layerlist td.layername").mouseup(function(ya){a("#layerlist tr.layer").removeClass("layersel"); +a(this.parentNode).addClass("layersel");f.setCurrentLayer(this.textContent);ya.preventDefault()}).mouseover(function(){a(this).css({"font-style":"italic",color:"blue"});xc(this.textContent)}).mouseout(function(){a(this).css({"font-style":"normal",color:"black"});xc()});a("#layerlist td.layervis").click(function(){var ya=a(this.parentNode).prevAll().length;ya=a("#layerlist tr.layer:eq("+ya+") td.layername").text();var Da=a(this).hasClass("layerinvis");f.setLayerVisibility(ya,Da);Da?a(this).removeClass("layerinvis"): +a(this).addClass("layerinvis")});for(A=5-a("#layerlist tr.layer").size();A-- >0;)q.append('_')};Ab();a(window).bind("load resize",function(){ra.css("line-height",ra.height()+"px")});a("#resolution").change(function(){var q=a("#canvas_width,#canvas_height");if(this.selectedIndex)if(this.value=="content")q.val("fit").attr("disabled","disabled");else{var A=this.value.split("x");a("#canvas_width").val(A[0]);a("#canvas_height").val(A[1]);q.removeAttr("disabled")}else a("#canvas_width").val()== +"fit"&&q.removeAttr("disabled").val(100)});a("input,select").attr("autocomplete","off");var oc=function(){var q=[{sel:"#tool_select",fn:Gb,evt:"click",key:["V",true]},{sel:"#tool_fhpath",fn:Hb,evt:"click",key:["Q",true]},{sel:"#tool_line",fn:Mb,evt:"click",key:["L",true]},{sel:"#tool_rect",fn:Nb,evt:"click",key:["R",true],icon:"rect"},{sel:"#tool_ellipse",fn:ma,evt:"mouseup",key:["C",true],icon:"ellipse"},{sel:"#tool_path",fn:aa,evt:"click",key:["P",true]},{sel:"#tool_text",fn:N,evt:"click",key:["T", +true]},{sel:"#tool_image",fn:Y,evt:"mouseup"},{sel:"#tool_zoom",fn:na,evt:"mouseup",key:["Z",true]},{sel:"#tool_clear",fn:mc,evt:"mouseup",key:[ga+"N",true]},{sel:"#tool_save",fn:function(){Ka?Q():f.save({images:b.img_save,round_digits:6})},evt:"mouseup",key:[ga+"S",true]},{sel:"#tool_export",fn:kc,evt:"mouseup"},{sel:"#tool_open",fn:jc,evt:"mouseup"},{sel:"#tool_import",fn:Wb,evt:"mouseup"},{sel:"#tool_source",fn:D,evt:"click",key:[ga+"U",true]},{sel:"#tool_wireframe",fn:z,evt:"click"},{sel:"#tool_rulers", +fn:F,evt:"click"},{sel:"#tool_source_cancel,#svg_source_overlay,#tool_docprops_cancel,#tool_prefs_cancel",fn:jb,evt:"click",key:["esc",false,false],hidekey:true},{sel:"#tool_source_save",fn:Q,evt:"click"},{sel:"#tool_docprops_save",fn:ua,evt:"click"},{sel:"#tool_docprops",fn:H,evt:"mouseup"},{sel:"#tool_prefs_save",fn:wa,evt:"click"},{sel:"#tool_prefs_option",fn:function(){G();return false},evt:"mouseup"},{sel:"#tool_delete,#tool_delete_multi",fn:Pa,evt:"click",key:["del/backspace",true]},{sel:"#tool_reorient", +fn:$b,evt:"click"},{sel:"#tool_node_link",fn:Ua,evt:"click"},{sel:"#tool_node_clone",fn:ic,evt:"click"},{sel:"#tool_node_delete",fn:ec,evt:"click"},{sel:"#tool_openclose_path",fn:fc,evt:"click"},{sel:"#tool_add_subpath",fn:cc,evt:"click"},{sel:"#tool_move_top",fn:Db,evt:"click",key:ga+"shift+up"},{sel:"#tool_move_bottom",fn:cb,evt:"click",key:ga+"shift+down"},{sel:"#tool_move_up",fn:Eb,evt:"click",key:[ga+"up",true]},{sel:"#tool_move_down",fn:$a,evt:"click",key:[ga+"down",true]},{sel:"#tool_topath", +fn:Pb,evt:"click"},{sel:"#tool_make_link,#tool_make_link_multi",fn:Zb,evt:"click"},{sel:"#tool_clone,#tool_clone_multi",fn:k,evt:"click",key:[ga+"D",true]},{sel:"#tool_group",fn:h,evt:"click",key:[ga+"G",true]},{sel:"#tool_ungroup",fn:h,evt:"click",key:ga+"shift+G"},{sel:"#tool_unlink_use",fn:h,evt:"click"},{sel:"[id^=tool_align]",fn:v,evt:"click"},{sel:"#tool_switch",fn:s,evt:"click",key:["shift+x",true]},{sel:"#tool_undo",fn:dc,evt:"click",key:ga+"z"},{sel:"#tool_redo",fn:g,evt:"click",key:["y", +true]},{sel:"#tool_canvas_color_menu",fn:t,evt:"click"},{sel:"#tool_cut",fn:Xa,evt:"click",key:ga+"x"},{sel:"#tool_copy",fn:hb,evt:"click",key:ga+"c"},{sel:"#tool_paste",fn:pb,evt:"click",key:ga+"v"},{sel:"#tool_bold",fn:Vb,evt:"mousedown",key:[ga+"B",true]},{sel:"#tool_italic",fn:vb,evt:"mousedown",key:[ga+"I",true]},{sel:"#copy_save_done",fn:jb,evt:"click"},{key:"ctrl+left",fn:function(){Sb(0,1)}},{key:"ctrl+right",fn:function(){Sb(1,1)}},{key:"ctrl+shift+left",fn:function(){Sb(0,5)}},{key:"ctrl+shift+right", +fn:function(){Sb(1,5)}},{key:"shift+O",fn:Tb},{key:"shift+P",fn:gc},{key:[ga+"+",true],fn:function(){E(2)}},{key:[ga+"-",true],fn:function(){E(0.5)}},{key:["up",true],fn:function(){gb(0,-1)}},{key:["down",true],fn:function(){gb(0,1)}},{key:["left",true],fn:function(){gb(-1,0)}},{key:["right",true],fn:function(){gb(1,0)}},{key:"shift+up",fn:function(){gb(0,-10)}},{key:"shift+down",fn:function(){gb(0,10)}},{key:"shift+left",fn:function(){gb(-10,0)}},{key:"shift+right",fn:function(){gb(10,0)}},{key:["alt+up", +true],fn:function(){f.cloneSelectedElements(0,-1)}},{key:["alt+down",true],fn:function(){f.cloneSelectedElements(0,1)}},{key:["alt+left",true],fn:function(){f.cloneSelectedElements(-1,0)}},{key:["alt+right",true],fn:function(){f.cloneSelectedElements(1,0)}},{key:["alt+shift+up",true],fn:function(){f.cloneSelectedElements(0,-10)}},{key:["alt+shift+down",true],fn:function(){f.cloneSelectedElements(0,10)}},{key:["alt+shift+left",true],fn:function(){f.cloneSelectedElements(-10,0)}},{key:["alt+shift+right", +true],fn:function(){f.cloneSelectedElements(10,0)}},{key:ga+"A",fn:function(){f.selectAllInCurrentLayer()}},{key:ga+"shift+z",fn:g},{key:"esc",fn:C}],A={"4/Shift+4":"#tools_rect_show","5/Shift+5":"#tools_ellipse_show"};return{setAll:function(){var I={};a.each(q,function(R,X){if(X.sel){var ja=a(X.sel);if(ja.length==0)return true;if(X.evt){if(svgedit.browser.isTouch()&&X.evt==="click")X.evt="mousedown";ja[X.evt](X.fn)}if(X.parent&&a(X.parent+"_show").length!=0){var va=a(X.parent);va.length||(va=Ga(X.parent.substr(1))); +va.append(ja);a.isArray(I[X.parent])||(I[X.parent]=[]);I[X.parent].push(X)}}if(X.key){var ya=X.fn,Da=false;if(a.isArray(X.key)){va=X.key[0];if(X.key.length>1)Da=X.key[1]}else va=X.key;va+="";svgedit.browser.isMac&&va.indexOf("+")!=-1&&va.split("+")[0]=="ctrl"&&va.replace("ctrl","cmd");a.each(va.split("/"),function(Ba,tb){a(document).bind("keydown",tb,function(Ta){ya();Da&&Ta.preventDefault();return false})});if(X.sel&&!X.hidekey&&ja.attr("title")){var Ca=ja.attr("title").split("[")[0]+" ("+va+")"; +A[va]=X.sel;ja.parents("#main_menu").length||ja.attr("title",Ca)}}});Qa(I);a(".attr_changer, #image_url").bind("keydown","return",function(R){a(this).change();R.preventDefault()});a(window).bind("keydown","tab",function(R){if(U==="canvas"){R.preventDefault();gc()}}).bind("keydown","shift+tab",function(R){if(U==="canvas"){R.preventDefault();Tb()}});a("#tool_zoom").dblclick(K)},setTitles:function(){a.each(A,function(I,R){var X=a(R).parents("#main_menu").length;a(R).each(function(){var ja=X?a(this).text().split(" [")[0]: +this.title.split(" [")[0],va="";a.each(I.split("/"),function(ya,Da){var Ca=Da.split("+"),Ba="";if(Ca.length>1){Ba=Ca[0]+"+";Da=Ca[1]}va+=(ya?"/":"")+Ba+(e["key_"+Da]||Da)});if(X)this.lastChild.textContent=ja+" ["+va+"]";else this.title=ja+" ["+va+"]"})})},getButtonData:function(I){var R;a.each(q,function(X,ja){if(ja.sel===I)R=ja});return R}}}();oc.setAll();c.ready(function(){var q=d.initTool,A=a("#tools_left, #svg_editor .tools_flyout"),I=A.find("#tool_"+q);q=A.find("#"+q);(I.length?I:q.length?q: +a("#tool_select")).click().mouseup();d.wireframe&&a("#tool_wireframe").click();d.showlayers&&wc();a("#rulers").toggle(!!d.showRulers);if(d.showRulers)a("#show_rulers")[0].checked=true;if(d.gridSnapping)a("#grid_snapping_on")[0].checked=true;d.baseUnit&&a("#base_unit").val(d.baseUnit);d.snappingStep&&a("#grid_snapping_step").val(d.snappingStep)});a("#rect_rx").SpinButton({min:0,max:1E3,step:1,callback:function(q){f.setRectRadius(q.value)}});a("#stroke_width").SpinButton({min:0,max:99,step:1,smallStep:0.1, +callback:function(q){var A=q.value;if(A==0&&Z&&["line","polyline"].indexOf(Z.nodeName)>=0)A=q.value=1;f.setStrokeWidth(A)}});a("#angle").SpinButton({min:-180,max:180,step:5,callback:function(q){f.setRotationAngle(q.value);a("#tool_reorient").toggleClass("disabled",q.value==0)}});a("#font_size").SpinButton({step:1,min:0.0010,stepfunc:function(q,A){var I=q.value-0,R=I+A,X=R>=I;if(A===0)return I;return I>=24?X?Math.round(I*1.1):Math.round(I/1.1):I<=1?X?I*2:I/2:R},callback:function(q){f.setFontSize(q.value)}}); +a("#group_opacity").SpinButton({step:5,min:0,max:100,callback:xb});a("#blur").SpinButton({step:0.1,min:0,max:10,callback:fb});a("#zoom").SpinButton({min:0.0010,max:1E4,step:50,stepfunc:function(q,A){var I=q.value-0;if(I===0)return 100;var R=I+A;if(A===0)return I;return I>=100?R:R>=I?I*2:I/2},callback:ob}).val(f.getZoom()*100);a("#workarea").contextMenu({menu:"cmenu_canvas",inSpeed:0},function(q){switch(q){case "delete":Pa();break;case "cut":Xa();break;case "copy":hb();break;case "paste":f.pasteElements(); +break;case "paste_in_place":f.pasteElements("in_place");break;case "group":f.groupSelectedElements();break;case "ungroup":f.ungroupSelectedElement();break;case "move_front":Db();break;case "move_up":Fb("Up");break;case "move_down":Fb("Down");break;case "move_back":cb();break;default:svgedit.contextmenu&&svgedit.contextmenu.hasCustomHandler(q)&&svgedit.contextmenu.getCustomHandler(q).call()}f.clipBoard.length&&pa.enableContextMenuItems("#paste,#paste_in_place")});V=function(q){switch(q){case "dupe":M(); +break;case "delete":T();break;case "merge_down":if(a("#layerlist tr.layersel").index()!=f.getCurrentDrawing().getNumLayers()-1){f.mergeLayer();Ja();Ab()}break;case "merge_all":f.mergeAllLayers();Ja();Ab()}};a("#layerlist").contextMenu({menu:"cmenu_layers",inSpeed:0},V);a("#layer_moreopts").contextMenu({menu:"cmenu_layers",inSpeed:0,allowLeft:true},V);a(".contextMenu li").mousedown(function(q){q.preventDefault()});a("#cmenu_canvas li").disableContextMenu();pa.enableContextMenuItems("#delete,#cut,#copy"); +window.onbeforeunload=function(){if(ha.getUndoStackSize()===0)c.show_save_warning=false;if(!d.no_save_warning&&c.show_save_warning)return e.notification.unsavedChanges};c.openPrep=function(q){a("#main_menu").hide();ha.getUndoStackSize()===0?q(true):a.confirm(e.notification.QwantToOpen,q)};if(window.FileReader){V=a('').change(function(){var q=this;c.openPrep(function(A){if(A){f.clear();if(q.files.length==1){A=new FileReader;A.onloadend=function(I){n(I.target.result);Rb()};A.readAsText(q.files[0])}}})}); +a("#tool_open").show().prepend(V);V=a('').change(function(){a("#main_menu").hide();if(this.files.length==1){var q=new FileReader;q.onloadend=function(A){f.importSvgString(A.target.result,true);Rb()};q.readAsText(this.files[0])}});a("#tool_import").show().prepend(V)}var Rb=c.updateCanvas=function(q,A){var I=ra.width(),R=ra.height(),X=I,ja=R,va=f.getZoom(),ya=a("#svgcanvas"),Da={x:ra[0].scrollLeft+X/2,y:ra[0].scrollTop+ja/2},Ca=d.canvas_expansion;I=Math.max(X,f.contentW*va*Ca);R= +Math.max(ja,f.contentH*va*Ca);I==X&&R==ja?ra.css("overflow","hidden"):ra.css("overflow","scroll");Ca=ya.height()/2;var Ba=ya.width()/2;ya.width(I).height(R);var tb=R/2,Ta=I/2,ia=f.updateCanvas(I,R),wb=Ta/Ba;I=I/2-X/2;R=R/2-ja/2;if(A){A.x+=ia.x;A.y+=ia.y}else A={x:Ta+(Da.x-Ba)*wb,y:tb+(Da.y-Ca)*wb};if(q)if(f.contentW>ra.width()){ra[0].scrollLeft=ia.x-10;ra[0].scrollTop=ia.y-10}else{ra[0].scrollLeft=I;ra[0].scrollTop=R}else{ra[0].scrollLeft=A.x-X/2;ra[0].scrollTop=A.y-ja/2}if(d.showRulers){da(ya,va); +ra.scroll()}},hc=[];for(Bb=0.1;Bb<1E5;Bb*=10){hc.push(1*Bb);hc.push(2*Bb);hc.push(5*Bb)}Rb(true);try{var yc=function(q){if(window.JSON&&JSON.stringify)return JSON.stringify(q);var A=arguments.callee;if(typeof q=="boolean"||typeof q=="number")return q+"";else if(typeof q=="string")return'"'+q.replace(/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,function(X){return"\\u"+("0000"+X.charCodeAt(0).toString(16)).slice(-4)})+'"'; +else if(q.length){for(var I=0;I");var f=n.shortcut||"";$("#cmenu_canvas").append("
        • "+n.label+""+f+"
        • ")}});svgedit.contextmenu.resetCustomMenus=function(){a.contextMenuExtensions= {}};svgedit.contextmenu.add=function(n){if(n&&n.id&&n.label&&n.action&&typeof n.action=="function")if(n.id in a.contextMenuExtensions)console.error('Cannot add extension "'+n.id+'", an extension by that name already exists"');else{console.log("Registed contextmenu item: {id:"+n.id+", label:"+n.label+"}");a.contextMenuExtensions[n.id]=n}else console.error("Menu items must be defined and have at least properties: id, label, action, where action must be a function")};svgedit.contextmenu.hasCustomHandler= function(n){return a.contextMenuExtensions[n]&&true};svgedit.contextmenu.getCustomHandler=function(n){return a.contextMenuExtensions[n].action}})();var svgEditor=function(a,n){function f(m,o,b){var d=a("#svg_editor").parent(),e;for(e in o){var l=o[e];l||console.log(e);if(b)e="#"+e;if(d.find(e).length){var u=d.find(e)[0];switch(m){case "content":for(var w=0;wdiv{position:absolute;background:#2f2f2c;z-index:1;overflow:hidden;-webkit-font-smoothing:none;}#rulers #ruler_corner{top:30px;left:50px;width:15px;height:15px;border:solid #444 1px;z-index:2;}#ruler_x{height:15px;top:30px;left:66px;right:200px;border-top:solid #444 1px;border-right:solid #444 1px;}#ruler_x_cursor{height:15px;border-right:dotted #999 1px;position:absolute;background:#2f2f2c;}#ruler_y_cursor{width:15px;border-top:dotted #999 1px;position:absolute;background:#2f2f2c;}#rulers.moved #ruler_corner,#rulers.moved #ruler_x{top:101px;}#ruler_y{width:15px;top:46px;left:50px;bottom:40px;border-left:solid #444 1px;border-bottom:solid #444 1px;}#rulers.moved #ruler_y{top:116px;}#ruler_x canvas:first-child{margin-left:-16px;}#ruler_x canvas{float:left;}#ruler_y canvas{margin-top:-16px;}#ruler_x>div,#ruler_y>div{overflow:hidden;}#svg_editor div#palette_holder{display:block;overflow:hidden;height:31px;margin-top:10px;position:relative;z-index:2;float:left;}#svg_editor div#palette_holder #palette .palette_item:first-child{background:#fff;}#svg_editor div#palette_holder #palette .palette_item{cursor:pointer;}#tool_stroke select{margin-top:0;}#svg_editor #color_tools,#color_canvas_tools{position:relative;width:48px;height:48px;margin:6px 6px 0 6px;}#svg_editor #color_tools #tool_fill,#tool_canvas{position:absolute;top:0;left:0;z-index:1;}#tool_fill.active,#tool_stroke.active{z-index:2;}#tool_fill,#tool_stroke,#tool_canvas{box-shadow:0 0 0 1px #2f2f2c;}#color_canvas_tools{float:left;cursor:pointer;}#tool_fill .color_block,#tool_canvas .color_block{width:24px;height:24px;overflow:hidden;border:solid #ccc 1px;}#svg_editor #path_node_panel .tool_button{color:#999;border:solid #3F3F3C 1px;border-radius:3px;padding:3px 10px 3px 40px;background:transparent;position:relative;margin-top:10px;width:90px;height:23px;line-height:24px;}#svg_editor #path_node_panel .tool_button img{position:absolute;left:5px;top:3px;}#svg_editor #path_node_panel #tool_node_link{border:none;padding:3px 0;width:auto;margin:0 0 10px 0;background:transparent;color:#ccc;height:auto;line-height:130%;}#svg_editor #path_node_panel #segment_type{margin-top:10px;}#svg_editor #color_tools #tool_fill .color_block:hover,#svg_editor #color_tools #tool_stroke .color_block:hover{border-color:#fff;}#svg_editor #color_tools #tool_fill .color_block>div{position:absolute;top:0;left:0;}#svg_editor #color_tools #tool_fill .color_block #fill_bg,#svg_editor #color_tools #tool_stroke .color_block #stroke_bg{position:absolute;top:1px;left:1px;bottom:1px;right:1px;background:#fff;}#tool_stroke{position:absolute;top:12px;left:12px;z-index:0;}#stroke_color:after{content:'';position:absolute;display:block;width:8px;height:8px;left:8px;top:8px;background:#ccc;box-shadow:0 0 0 1px #000;}#svg_editor #color_tools #tool_switch{cursor:pointer;opacity:.7;width:11px;height:11px;background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABV0RVh0Q3JlYXRpb24gVGltZQA2LzE0LzEyP6j5+gAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNXG14zYAAAB4SURBVBiVjZHRCYUwDEVvxIF0kZKN7EjiIrrReR/PSNSKXiikcE5JUtMeADMzXQIcdRfgFWqlyyB7ap1wL+0HAnIv1DqRJUBxTkLUWXIvh9AHkIeb58UkIUnDMH4ZR0otCfhv4ynbtp7ut722ZniFG8L9xx4Ek6QfN9huARmYwR0AAAAASUVORK5CYII=) top left no-repeat;position:absolute;top:-2px;left:28px;}#svg_editor #color_tools #cross:hover{opacity:1;}#svg_editor #color_tools #tool_stroke:hover #stroke_color:after{background:#fff;}#svg_editor #color_tools #tool_stroke .color_block{width:24px;height:24px;overflow:hidden;border:solid #ccc 1px;}#svg_editor #color_tools #tool_stroke .color_block>div{position:absolute;bottom:0;right:0;}#svg_editor #color_tools .icon_label{padding:0;width:24px;height:100%;cursor:pointer;}#svg_editor #zoomLabel{cursor:pointer;margin-right:5px;}#svg_editor #linkLabel>svg{height:20px;padding-top:4px;}#svg_editor div#palette{float:left;width:672px;height:16px;}#svg_editor div#workarea{display:inline-table-cell;position:absolute;top:30px;left:50px;bottom:40px;right:200px;background-color:#444;overflow:auto;text-align:center;}#svg_editor #sidepanels{display:none;position:absolute;top:75px;bottom:60px;right:0;width:2px;padding:10px;border-left:none;z-index:10;}#svg_editor #layerpanel{display:inline-block;position:absolute;top:1px;bottom:0;right:0;width:0;overflow:auto;margin:0;-moz-user-select:none;-webkit-user-select:none;}#svg_editor #sidepanel_handle{display:inline-block;position:absolute;background-color:#D0D0D0;font-weight:bold;left:0;top:40%;width:1em;padding:5px 1px 5px 5px;margin-left:3px;cursor:pointer;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-moz-user-select:none;-webkit-user-select:none;}#svg_editor #sidepanel_handle:hover{font-weight:bold;}#svg_editor #sidepanel_handle *{cursor:pointer;-moz-user-select:none;-webkit-user-select:none;}#svg_editor #layerbuttons{margin:0;padding:0;padding-left:2px;padding-right:2px;width:125px;height:20px;border-right:1px solid #FFF;border-bottom:1px solid #FFF;border-left:1px solid #808080;border-top:1px solid #808080;overflow:hidden;}#svg_editor .layer_button{width:14px;height:14px;padding:1px;border-left:1px solid #FFF;border-top:1px solid #FFF;border-right:1px solid #808080;border-bottom:1px solid #808080;cursor:pointer;float:left;margin-right:3px;}#svg_editor .layer_button:last-child{margin-right:0;}#svg_editor .layer_buttonpressed{width:14px;height:14px;padding:1px;border-right:1px solid #FFF;border-bottom:1px solid #FFF;border-left:1px solid #808080;border-top:1px solid #808080;cursor:pointer;}#svg_editor #layerlist{margin:1px;padding:0;width:127px;border-collapse:collapse;border:1px solid #808080;background-color:#FFF;}#svg_editor #layerlist tr.layer{background-color:#FFF;margin:0;padding:0;}#svg_editor #layerlist tr.layersel{border:1px solid #808080;background-color:#CCC;}#svg_editor #layerlist td.layervis{width:22px;cursor:pointer;}#svg_editor #layerlist td.layerinvis{background-image:none;cursor:pointer;}#svg_editor #layerlist td.layervis *{display:block;}#svg_editor #layerlist td.layerinvis *{display:none;}#svg_editor #layerlist td.layername{cursor:pointer;}#svg_editor #layerlist tr.layersel td.layername{font-weight:bold;}#svg_editor #selLayerLabel{white-space:nowrap;}#svg_editor #selLayerNames{display:block;}#svg_editor div.palette_item{height:16px;width:16px;float:left;}#svg_editor .menu .menu_list{display:none;position:absolute;}#svg_editor .tool_button:hover,#svg_editor .push_button:hover,#svg_editor .buttonup:hover,#svg_editor .buttondown,#svg_editor .tool_button_current,#svg_editor .push_button_pressed{background-color:#fff;}#svg_editor .tool_button.disabled,#svg_editor .tool_button.disabled:hover{opacity:.3;background-color:#aaa;}#svg_editor #tools_left .tool_button{background:#2f2f2c;}#svg_editor #tools_left .tool_button.loaded{background:#ccc;}#svg_editor #tools_left .tool_button.loaded:hover{background:#fff;}#tools_top .padded{padding:10px 0;}#svg_editor #tools_left .tool_button_current{background-color:#0cf;}#svg_editor #main_icon span{position:absolute;width:100%;height:100%;display:block;z-index:2;}#svg_editor #tools_top{position:absolute;width:170px;right:2px;top:10px;border-bottom:none;overflow:visible;padding:0 10px;}#svg_editor label{display:block;color:#999;}div#font-selector{width:140px;height:300px;overflow:auto;margin:0 auto;position:absolute;top:27px;right:0;border:1px solid black;padding:10px;display:none;background-color:white;z-index:10;border-radius:3px;box-shadow:0 5px 10px rgba(0,0,0,0.7);}div#font-selector img{width:100%;}div#font-selector .font-item{border-bottom:solid #ddd 1px;padding:5px 10px;margin:0 -10px;}div#font-selector .font-item:hover{background-color:#eee;}#svg_editor #tools_top label:before,#svg_editor #tools_top label:after{content:"";display:table;}#svg_editor #tools_top label:after{clear:both;}#svg_editor #tools_top label span,#svg_editor #tools_top label select{display:block;width:80px;float:left;line-height:185%;}#svg_editor #tools_top label span.tuco{width:100%;float:none;}#svg_editor #tools_top #marker_panel *{float:left;}#svg_editor #tools_top #marker_panel h4{float:none;}#svg_editor #tools_top #marker_panel .dropdown .icon_label{width:36px;height:20px;margin-top:2px;border:solid #3f3f3c 1px;text-align:center;}#svg_editor #font_family_dropdown-list{border-radius:3px;box-shadow:0 5px 10px #000;}#svg_editor #font_family_dropdown-list li{cursor:pointer;}#svg_editor #tools_top #marker_panel .dropdown button{margin-top:2px;}#svg_editor #tools_top #marker_panel #marker_panel_title{float:none;color:#fff;margin-bottom:3px;}#svg_editor #tools_top #marker_panel .dropdown .icon_label img{float:none;}#svg_editor input[type=text],#svg_editor input[type=number]{border:solid #3f3f3c 1px;background-color:transparent;color:#09f;display:block;float:left;font-size:13px;padding:2px 5px;width:70px;-webkit-appearance:none;border-radius:2px;margin:0;-webkit-touch-callout:text;-webkit-user-select:text;-khtml-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;}#svg_editor #color_picker input[type=text],#color_picker #svg_editor input[type=number]{width:30px;background:#fff;}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0;}#svg_editor .dropdown_set input[type=text],#svg_editor .dropdown_set input[type=number]{width:50px;}#svg_editor input[type=text].wide,#svg_editor input[type=number].wide{width:110px;}#svg_editor input[type=text].tuco,#svg_editor input[type=number].tuco{width:150px;}#svg_editor input[type=submit],#svg_editor input[type=button],button{background:#2C7BB3;color:#fff;border-radius:2px;padding:5px 10px;border:none;line-height:140%;border-bottom:solid transparent 1px;}#svg_editor input[type=submit]:hover,#svg_editor button:hover{box-shadow:inset 0 3px 10px rgba(255,255,255,0.1),inset 0 -3px 10px rgba(0,0,0,0.2);}#svg_editor input[type=submit]:hover,#svg_editor button:hover{background:#2F84C1;}#svg_editor input[type=submit]:active,#svg_editor button:active{padding:6px 10px 4px 10px;box-shadow:inset 0 2px 2px rgba(0,0,0,0.2);border-bottom:solid rgba(255,255,255,0.1) 1px;}#svg_editor input[type=text]:focus,#svg_editor input[type=number]:focus{border:solid rgba(0,120,255,0.3) 1px;outline:none;}#svg_editor input[readonly=readonly],#svg_editor input[readonly=readonly]:focus{background:transparent;color:#fff;border:none;outline:none;}#svg_editor #tools_left{position:absolute;border-right:none;width:50px;top:30px;left:0;background:#2F2F2C;z-index:4;}#workarea.wireframe #svgcontent *{fill:none;stroke:#000;stroke-width:1px;stroke-opacity:1.0;stroke-dasharray:0;opacity:1;pointer-events:stroke;vector-effect:non-scaling-stroke;filter:none;}#workarea.wireframe #svgcontent text{fill:#000;stroke:none;}#workarea.wireframe #canvasBackground>rect{fill:#FFF!important;}#workarea #canvasBackground>rect{stroke:transparent!important;}#svg_editor #multiselected_panel .selected_tool{vertical-align:12px;}#cur_context_panel{position:absolute;top:47px;left:68px;line-height:22px;overflow:auto;border-bottom:none;border-right:none;padding-left:5px;font-size:12px;background:black;color:#999;opacity:.5;padding:0 10px;border-radius:0 10px 10px 0;}#svg_editor #cur_context_panel a{float:none;text-decoration:none;color:#fff;}#svg_editor #cur_context_panel a:hover{text-decoration:underline;}#svg_editor #tools_left .tool_button,#svg_editor #tools_left .tool_button_current{position:relative;z-index:11;}#svg_editor .flyout_arrow_horiz{position:absolute;bottom:-1px;right:0;z-index:10;}span.zoom_tool{line-height:16px;background:#ccc;display:block;width:18px;height:18px;margin-top:2px;float:left;}span.zoom_tool img{vertical-align:top;}#zoom_panel{margin-top:9px;right:200px;position:absolute;}.dropdown{position:relative;float:left;}#svg_editor .dropdown button{width:21px;height:22px;padding:0 3px 0 3px;border:none;background-color:#555;border-radius:0 2px 2px 0;margin-left:-1px;position:relative;}#svg_editor .dropdown button:hover{background-color:#666;}#svg_editor .dropdown button:after{content:'';position:absolute;border:solid transparent 4px;border-top-color:#999;top:9px;left:6px;}.dropdown button.down{border-left:1px solid #808080;border-top:1px solid #808080;border-right:1px solid #FFF;border-bottom:1px solid #FFF;background-color:#B0B0B0;}.dropdown ul{list-style:none;position:absolute;margin:0;padding:0;left:-80px;top:26px;z-index:4;display:none;}.dropup ul{top:auto;bottom:26px;border-radius:3px;box-shadow:0 5px 10px #000;}.dropup ul:after{content:'';display:block;position:absolute;bottom:-10px;right:50%;top:auto;width:0;height:0;border:solid transparent 5px;border-top-color:#fff;}.dropdown li{display:block;width:120px;padding:5px 10px;color:#333;background:#fff;margin:0;line-height:16px;}.dropdown li:first-child{border-radius:3px 3px 0 0;}.dropdown li:last-child{border-radius:0 0 3px 3px;}.dropdown li:hover{background-color:#ddd;color:#000;}.dropdown li.special{padding:10px;background:white;border:none;box-shadow:0 3px 10px black;border-radius:3px!important;}.dropdown li.special:after{content:'';display:block;position:absolute;top:-10px;right:50%;border:solid transparent 5px;border-bottom-color:#fff;}.dropdown li.special.down:after{bottom:-10px;right:50%;top:auto;border:solid transparent 5px;border-top-color:#fff;}#font_family_dropdown-list li{font-size:1.4em;}#font_family{margin-left:5px;margin-right:0;}#svg_editor .tool_button,#svg_editor .push_button,#svg_editor .tool_button_current,#svg_editor .push_button_pressed{height:27px;width:27px;border:solid #2f2f2c 8px;border-left-width:13px;margin:0;background-color:#ddd;cursor:pointer;}#svg_editor #main_menu li#tool_open,#svg_editor #main_menu li#tool_import{position:relative;overflow:hidden;}#tool_image{overflow:hidden;}#tool_open input,#tool_import input,#tool_image input{position:absolute;opacity:0;font-size:10em;top:-5px;right:-5px;margin:0;cursor:pointer;}#svg_editor .disabled{opacity:.5;cursor:default;}#svg_editor .width_label{padding-right:5px;}#svg_editor #tool_bold,#svg_editor #tool_italic{font:bold 2.1em/1.1em serif;text-align:center;padding:0 2px 5px 2px;position:relative;float:left;margin:5px 10px 0 0;color:#ccc;background:#2f2f2c;border:solid #3f3f3c 1px;}#svg_editor #tool_bold:hover,#svg_editor #tool_italic:hover{color:#fff;}#svg_editor #tool_font_size{clear:both;padding-top:8px;}#text{position:absolute;left:-9999px;}#svg_editor #tool_bold span,#svg_editor #tool_italic span{position:absolute;width:100%;height:100%;top:0;left:0;background:#ccc;opacity:0;}#svg_editor #tool_italic{font-weight:normal;font-style:italic;}#url_notice{padding-top:4px;display:none;}#svg_editor #color_picker{position:absolute;display:none;background:#fff;height:350px;border-radius:3px;z-index:5;box-shadow:0 5px 10px #000;width:530px;}#svg_editor .tools_flyout{position:absolute;display:none;cursor:pointer;width:385px;z-index:10;left:47px!important;height:324px;background:#fff;border-radius:5px;box-shadow:0 5px 10px rgba(0,0,0,0.5);}#svg_editor .tools_flyout_v{position:absolute;display:none;cursor:pointer;width:30px;}#svg_editor .tools_flyout .tool_button{float:left;background-color:#fff;height:24px;width:24px;}#svg_editor #tools_bottom{position:absolute;left:50px;right:0;bottom:0;height:40px;overflow:visible;}#svg_editor #tools_bottom_1{width:115px;float:left;}#svg_editor #tools_bottom_2{position:relative;float:left;margin-top:5px;}#tools_bottom input[type=text]{width:3.2em;}#svg_editor .stroke_tool .dropdown button{margin-top:0;}#svg_editor .stroke_tool div div{-moz-user-select:none;-webkit-user-select:none;width:20px;height:20px;margin:0;padding:1px;background:rgba(255,255,255,0.3);}#svg_editor #tools_bottom .stroke_tool .dropdown button{background-color:#555;margin-top:0;}#svg_editor #tools_top h4{color:#fff;font-weight:normal;margin:0;padding:20px 0 5px 0;}.stroke_tool>div{width:42px;}.stroke_tool>div>*{float:left;}#tools_top .dropdown .icon_label{border:1px solid transparent;height:auto;}.align_buttons .push_button,.align_buttons .push_button_pressed{display:block;float:left;}#option_lists ul{display:none;position:absolute;height:auto;z-index:3;margin:0;list-style:none;padding-left:0;}#option_lists .optcols2{width:70px;margin-left:-15px;}#option_lists .optcols3{width:192px;margin-left:-105px;margin-top:-25px;background:#fff;padding:5px;box-shadow:0 5px 10px #000;border-radius:3px;}#option_lists .optcols3:after{content:'';display:block;position:absolute;top:-10px;right:70px;border:solid transparent 5px;border-bottom-color:#fff;}#svg_editor #option_lists .tool_button,#svg_editor #option_lists .push_button,#svg_editor #option_lists .tool_button_current,#svg_editor #option_lists .push_button_pressed{border:none;background:transparent;}#svg_editor #option_lists .tool_button:hover{background:#ddd;}#svg_editor #option_lists ul li.current{background-color:#F4E284;}#option_lists .optcols4{width:130px;margin-left:-44px;}#option_lists ul[class^=optcols] li{float:left;}#svg_editor ul li.current{background-color:#F4E284;}#svg_editor #option_lists ul li{margin:0;border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;}#svg_editor #tool_stroke label input{margin-top:0;}#svg_editor #copyright{text-align:right;padding-right:.3em;}#svg_source_editor{display:none;}#svg_source_editor #svg_source_overlay{position:absolute;top:0;right:0;left:0;bottom:0;background-color:black;opacity:.6;z-index:5;}#svg_source_editor #svg_source_container{position:absolute;top:30px;left:30px;right:30px;bottom:30px;background-color:#fff;border-radius:3px;opacity:1.0;text-align:center;z-index:6;padding:20px 0;}#save_output_btns{display:none;text-align:left;}#save_output_btns p{margin:.5em 1.5em;display:inline-block;}#bg_blocks{overflow:auto;}#bg_blocks div{box-shadow:0 2px 3px rgba(0,0,0,0.3);margin-right:10px;}#svg_docprops #svg_docprops_container,#svg_prefs #svg_prefs_container{position:absolute;top:50%;width:300px;height:200px;margin-top:-140px;margin-left:-250px;border-radius:3px;padding:20px;left:50%;background-color:#fff;box-shadow:0 3px 10px rgba(0,0,0,0.3);opacity:1.0;z-index:20001;}#svg_docprops .error{border:1px solid red;padding:3px;}#svg_docprops #resolution{max-width:14em;}#tool_docprops_back,#tool_prefs_back{margin-left:1em;overflow:auto;}#svg_docprops_container #svg_docprops_docprops,#svg_prefs #svg_docprops_prefs{float:left;width:221px;margin:5px .7em;overflow:hidden;}#svg_prefs #svg_prefs_container{width:500px;height:320px;margin:-180px 0 0 -350px;}#svg_docprops legend,#svg_prefs legend{font-weight:bold;font-size:18px;padding:0 0 20px 0;display:block;font-family:sans-serif;}#svg_docprops_docprops>legend,#svg_prefs_container>fieldset>legend{font-weight:bold;font-size:1.1em;}#svg_docprops_container fieldset,#svg_prefs fieldset{margin:0;padding:0;border:none;}#svg_docprops_container label,#svg_prefs_container label{display:block;margin:.5em;}#svg_prefs_container label{margin:10px 0;}#svginfo_bg_note{font-size:.9em;font-style:italic;color:#444;}#canvas_title,#canvas_bg_url{display:block;width:96%;}#svg_source_editor #svg_source_textarea{position:relative;width:95%;top:5px;height:250px;padding:5px;font-size:12px;}#svg_source_editor #tool_source_back{text-align:left;padding:10px 0 0 20px;position:relative;}#svg_source_editor #tool_source_back #tool_source_save{position:absolute;right:20px;top:7px;}#svg_prefs_container div.color_block{float:left;margin:2px;padding:20px;}#svg_prefs_container div.cur_background{box-shadow:0 0 8px rgba(0,50,255,1);}#background_img{position:absolute;top:0;left:0;text-align:left;}#svg_docprops input,#svg_prefs input,#svg_docprops select,#svg_prefs select{font-size:15px;border-radius:3px;border:solid #aaa 1px;background-color:#eee;padding:5px 10px;}#svg_docprops select,#svg_prefs select{height:30px;width:210px;}#svg_docprops label,#svg_prefs label{display:inline-block;width:100px;vertical-align:top;}#svg_prefs .subtitle{margin-bottom:10px;}#svg_prefs label{width:200px;}#svg_docprops label span,#svg_prefs label span{display:inline-block;padding-bottom:5px;}#svg_docprops button,#svg_prefs button{position:absolute;font-size:15px;}#svg_editor button.cancel,#svg_editor input.Cancel,#svg_editor input.cancel,#svg_editor input.jGraduate_Cancel,button.cancel{background-color:#999;box-shadow:0 0 1px rgba(0,0,0,0.5);margin:0;}#svg_docprops button:first-child,#svg_prefs button:first-child{bottom:15px;left:15px;right:auto;}#svg_docprops button:last-child,#svg_prefs button:last-child{bottom:15px;right:15px;left:auto;}#svg_docprops button img,#svg_prefs button img{display:none;}#svg_editor button#docprops_button{background:#444;}#svg_editor button#docprops_button:hover{background:#555;}#svg_docprops,#svg_prefs{display:none;}#image_save_opts label{font-size:.9em;}#image_save_opts input{margin-left:0;}#svg_docprops #svg_docprops_overlay,#svg_prefs #svg_prefs_overlay{position:absolute;top:0;right:0;left:0;bottom:0;background-color:black;opacity:.6;z-index:20000;}#shape_buttons{overflow:auto;top:0;bottom:0;left:110px;right:0;position:absolute;vertical-align:top;}#shape_cats{min-width:110px;display:block;position:absolute;left:0;top:0;height:300px;background:#eee;border-radius:3px 0 0 3px;z-index:2;}#shape_cats>div{line-height:1em;padding:0 .5em;border-bottom:1px solid #ddd;background:#E8E8E8;color:#444;height:26px;line-height:26px;}#shape_cats>div:first-child{border-radius:3px 0 0 0;}#shape_cats>div:last-child{border-radius:0 0 0 3px;}#shape_cats div:hover{background:#efefef;color:#000;}#shape_cats div.current{font-weight:bold;background:#3f3f3c;color:#fff;position:relative;}#shape_cats div.current:after{content:'';position:absolute;right:-26px;top:0;border:solid transparent 13px;border-left-color:#3f3f3c;}.toolbar_button button .svg_icon{display:none;}#dialog_box{display:none;}#dialog_box_overlay{background:black;opacity:.5;height:100%;left:0;position:absolute;top:0;width:100%;z-index:6;}#dialog_content{height:95px;margin:10px 10px 5px 10px;background:#DDD;overflow:auto;text-align:left;border:1px solid #B0B0B0;}#dialog_content.prompt{height:75px;}#dialog_content p{margin:10px;line-height:1.3em;}#dialog_container{position:absolute;font-family:Verdana;text-align:center;left:50%;top:50%;width:300px;margin-left:-150px;height:150px;margin-top:-80px;position:fixed;z-index:50001;background:#CCC;border:1px outset #777;font-family:Verdana,Helvetica,sans-serif;font-size:.8em;}#dialog_container,#dialog_content{border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;}#dialog_buttons input[type=text]{width:90%;display:block;margin:0 0 5px 11px;}#dialog_buttons input[type=button]{margin:0 1em;}.invisible{visibility:none;}.ui-slider{position:relative;text-align:left;}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;}.ui-slider-horizontal{height:.8em;}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em;}.ui-slider-horizontal .ui-slider-range{top:0;height:100%;}.ui-slider-horizontal .ui-slider-range-min{left:0;}.ui-slider-horizontal .ui-slider-range-max{right:0;}.ui-slider-vertical{width:.8em;height:100px;}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em;}.ui-slider-vertical .ui-slider-range{left:0;width:100%;}.ui-slider-vertical .ui-slider-range-min{bottom:0;}.ui-slider-vertical .ui-slider-range-max{top:0;}.ui-slider{background:#3F3F3C;border-radius:10px;}.ui-slider-handle{box-shadow:0 3px 3px rgba(0,0,0,0.3);border-radius:30px;background:#fff;background-image:-ms-linear-gradient(top,#ccc 0,#fff 100%);background-image:-moz-linear-gradient(top,#ccc 0,#fff 100%);background-image:-o-linear-gradient(top,#ccc 0,#fff 100%);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#ccc),color-stop(1,#fff));background-image:-webkit-linear-gradient(top,#ccc 0,#fff 100%);background-image:linear-gradient(top,#ccc 0,#fff 100%);}.ui-slider-handle:focus{outline:none;}#shape_buttons{background:#fff;border-radius:0 3px 3px 0;padding:10px;}#svg_editor .tools_flyout .tool_button,#svg_editor .tools_flyout .tool_flyout{background:#fff;width:40px;height:40px;margin:5px;border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-width:0;}.contextMenu{position:absolute;z-index:99999;border:solid 1px rgba(0,0,0,.33);background:rgba(255,255,255,.95);padding:5px 0;margin:0;display:none;font:12px/15px Lucida Sans,Helvetica,Verdana,sans-serif;border-radius:5px;-moz-border-radius:5px;-moz-box-shadow:2px 5px 10px rgba(0,0,0,.3);-webkit-box-shadow:2px 5px 10px rgba(0,0,0,.3);box-shadow:2px 5px 10px rgba(0,0,0,.3);}.contextMenu LI{list-style:none;padding:0;margin:0;}.contextMenu .shortcut{width:115px;text-align:right;float:right;}.contextMenu A{-moz-user-select:none;-webkit-user-select:none;color:#222;text-decoration:none;display:block;line-height:20px;height:20px;background-position:6px center;background-repeat:no-repeat;outline:none;padding:0 15px 1px 20px;}.contextMenu LI.hover A{background-color:#2e5dea;color:white;cursor:default;}.contextMenu LI.disabled A{color:#999;}.contextMenu LI.hover.disabled A{background-color:transparent;}.contextMenu LI.separator{border-top:solid 1px #E3E3E3;padding-top:5px;margin-top:5px;}#menu{display:none;position:absolute;top:0;left:0;right:0;height:30px;background:#000;z-index:10;color:#fff;}#workarea.rect,#workarea.line,#workarea.ellipse,#workarea.path,#workarea.shapelib{cursor:crosshair;}#workarea.text{cursor:text;}#workarea.eyedropper{cursor:url(images/eyedropper.png),crosshair;}#workarea.fhpath{cursor:url(images/pencil_cursor.png) 0 20,crosshair;}#workarea.rotate *{cursor:url(images/rotate.png) 12 12,auto;}#workarea.n-resize *{cursor:n-resize!important;}#workarea.e-resize *{cursor:e-resize!important;}#workarea.w-resize *{cursor:w-resize!important;}#workarea.s-resize *{cursor:s-resize!important;}#workarea.ne-resize *{cursor:ne-resize!important;}#workarea.se-resize *{cursor:se-resize!important;}#workarea.nw-resize *{cursor:nw-resize!important;}#workarea.sw-resize *{cursor:sw-resize!important;}#workarea.zoom{cursor:crosshair;cursor:-moz-zoom-in;cursor:-webkit-zoom-in;}#workarea.zoom.out{cursor:crosshair;cursor:-moz-zoom-out;cursor:-webkit-zoom-out;}#selectorRubberBand{shape-rendering:crispEdges;}.clearfix:before,.clearfix:after{content:"";display:table;}.clearfix:after{clear:both;}.clearfix{*zoom:1;}#svg_editor #group_title{display:none;} \ No newline at end of file