diff --git a/Makefile b/Makefile index d7968c4..0296cbf 100644 --- a/Makefile +++ b/Makefile @@ -8,11 +8,11 @@ YUICOMPRESSOR=build/tools/yuicompressor-2.4.7.jar # All files that will be compiled by the Closure compiler. JS_FILES=\ + touch.js \ js-hotkeys/jquery.hotkeys.min.js \ jquerybbq/jquery.bbq.min.js \ svgicons/jquery.svgicons.js \ jgraduate/jquery.jgraduate.js \ - touch.js \ contextmenu/jquery.contextmenu.js \ browser.js \ svgtransformlist.js \ @@ -32,10 +32,10 @@ JS_FILES=\ jgraduate/jpicker.min.js \ mousewheel.js \ extensions/ext-eyedropper.js \ - extensions/ext-markers.js \ extensions/ext-grid.js \ extensions/ext-shapes.js \ - requestanimationframe.js + requestanimationframe.js \ + taphold.js CSS_FILES=\ fonts.css \ diff --git a/editor/jgraduate/css/jPicker.css b/editor/jgraduate/css/jPicker.css index b51fb72..5bb30fd 100644 --- a/editor/jgraduate/css/jPicker.css +++ b/editor/jgraduate/css/jPicker.css @@ -153,9 +153,7 @@ table#svg_editor .jPicker { #svg_editor .jPicker .Button input { width: 100px; } -#svg_editor .jPicker .Button .Ok { - margin: 0 0 5px 0; -} + #svg_editor .jPicker td.Radio { margin: 0; padding: 0; diff --git a/editor/jgraduate/css/jgraduate.css b/editor/jgraduate/css/jgraduate.css index ccc875f..2283c00 100644 --- a/editor/jgraduate/css/jgraduate.css +++ b/editor/jgraduate/css/jgraduate.css @@ -10,38 +10,38 @@ * Licensed under the Apache License Version 2 */ -#svg_editor h2.jGraduate_Title { +h2.jGraduate_Title { display: none; } -#svg_editor .jGraduate_Picker { +.jGraduate_Picker { position: absolute; padding: 20px; } -#svg_editor .jGraduate_tabs li { +.jGraduate_tabs li { display: inline-block; padding: 5px 10px; margin-right: 5px; cursor: pointer; } -#svg_editor li.jGraduate_tab_current { +li.jGraduate_tab_current { background: #fff; border-radius: 3px 3px 0 0; } -#svg_editor .jGraduate_colPick { +.jGraduate_colPick { display: none; } -#svg_editor .jGraduate_gradPick { +.jGraduate_gradPick { display: none; overflow: visible; /* position: relative;*/ } -#svg_editor .jGraduate_tabs { +.jGraduate_tabs { position: relative; background-color: #ddd; padding: 10px 10px 0 10px; @@ -49,11 +49,11 @@ border-radius: 3px 3px 0 0; } -#svg_editor div.jGraduate_Swatch { +div.jGraduate_Swatch { float: left; margin: 0 15px 0 0; } -#svg_editor div.jGraduate_GradContainer { +div.jGraduate_GradContainer { border: solid #000 1px; background-image: url(../images/map-opacity.png); background-position: 0px 0px; @@ -62,7 +62,7 @@ position: relative; } -#svg_editor div.jGraduate_GradContainer div.grad_coord { +div.jGraduate_GradContainer div.grad_coord { background: rgba(0,0,0,0.8); border: 2px solid white; border-radius: 15px; @@ -83,13 +83,13 @@ -webkit-user-select: none; } -#svg_editor .jGraduate_AlphaArrows { +.jGraduate_AlphaArrows { position: absolute; margin-top: -10px; margin-left: 250.5px; } -#svg_editor div.jGraduate_Opacity { +div.jGraduate_Opacity { border: 2px inset #eee; margin-top: 14px; background-color: black; @@ -99,7 +99,7 @@ cursor: ew-resize; } -#svg_editor div.jGraduate_StopSlider { +div.jGraduate_StopSlider { margin: -10px 0 0 -10px; width: 276px; overflow: visible; @@ -108,24 +108,24 @@ cursor: pointer; } -#svg_editor div.jGraduate_StopSection { +div.jGraduate_StopSection { width: 120px; float: left; } -#svg_editor div.jGraduate_StopSection.jGraduate_SpreadMethod { +div.jGraduate_StopSection.jGraduate_SpreadMethod { display: none; } -#svg_editor input.jGraduate_Ok, input.jGraduate_Cancel { +input.jGraduate_Ok, input.jGraduate_Cancel { display: block; width: 100px; } -#svg_editor input.jGraduate_Ok { +input.jGraduate_Ok { margin: 0 0 5px 0; } -#svg_editor .colorBox { +.colorBox { float: left; height: 16px; width: 16px; @@ -134,12 +134,12 @@ margin: 4px 4px 4px 30px; } -#svg_editor .colorBox + label { +.colorBox + label { float: left; margin-top: 7px; } -#svg_editor label.jGraduate_Form_Heading { +label.jGraduate_Form_Heading { color: #333; padding: 2px; @@ -147,7 +147,7 @@ font-size: 13px; } -#svg_editor div.jGraduate_Form_Section { +div.jGraduate_Form_Section { -moz-border-radius: 5px; -webkit-border-radius: 5px; padding: 15px 5px 5px 5px; @@ -158,18 +158,18 @@ background: #eee; } -#svg_editor div.jGraduate_Form label { +div.jGraduate_Form label { padding: 0 2px; color: #333; } -#svg_editor div.jGraduate_StopSection input[type=text], -#svg_editor div.jGraduate_Slider input[type=text] { +div.jGraduate_StopSection input[type=text], +div.jGraduate_Slider input[type=text] { width: 33px; color: #333; } -#svg_editor div.jGraduate_LightBox { +div.jGraduate_LightBox { position: fixed; top: 0px; left: 0px; @@ -180,7 +180,7 @@ display: none; } -#svg_editor div.jGraduate_stopPicker { +div.jGraduate_stopPicker { position: absolute; display: none; background: @@ -194,15 +194,15 @@ } -#svg_editor .jGraduate_gradPick { +.jGraduate_gradPick { width: 526px; } -#svg_editor .jGraduate_gradPick div.jGraduate_Slider { +.jGraduate_gradPick div.jGraduate_Slider { line-height: 160% } -#svg_editor .jGraduate_gradPick div.jGraduate_Slider label:last-child { +.jGraduate_gradPick div.jGraduate_Slider label:last-child { position: absolute; right: 10px; top: 0; @@ -210,12 +210,12 @@ font-weight: bold; } -#svg_editor .jGraduate_gradPick div.jGraduate_Slider label:last-child input { +.jGraduate_gradPick div.jGraduate_Slider label:last-child input { margin: 0 3px 0 0; color: #333; } -#svg_editor .jGraduate_gradPick .jGraduate_Form { +.jGraduate_gradPick .jGraduate_Form { float: left; width: 270px; position: absolute; @@ -227,55 +227,55 @@ line-height: 200%; } -#svg_editor .jGraduate_gradPick .jGraduate_Form label, -#svg_editor .jGraduate_gradPick .jGraduate_Form input { +.jGraduate_gradPick .jGraduate_Form label, +.jGraduate_gradPick .jGraduate_Form input { width: auto; float: left; } -#svg_editor .jGraduate_gradPick .jGraduate_Form.jGraduate_rg_field label, #svg_editor .jGraduate_gradPick .jGraduate_Form.jGraduate_rg_field input { +.jGraduate_gradPick .jGraduate_Form.jGraduate_rg_field label, .jGraduate_gradPick .jGraduate_Form.jGraduate_rg_field input { width: auto; float: left; font-size: 11px; } -#svg_editor .jGraduate_gradPick .jGraduate_Form.jGraduate_rg_field #color_picker_jGraduate_match_ctr { +.jGraduate_gradPick .jGraduate_Form.jGraduate_rg_field #color_picker_jGraduate_match_ctr { float: none; } -#svg_editor .jGraduate_gradPick .jGraduate_Form label { +.jGraduate_gradPick .jGraduate_Form label { clear: left; } -#svg_editor .jGraduate_gradPick .jGraduate_Points { +.jGraduate_gradPick .jGraduate_Points { position: static; float: left; margin: 0; width: auto; } -#svg_editor .jGraduate_Colorblocks { +.jGraduate_Colorblocks { display: table; border-spacing: 0 5px; } -#svg_editor .jGraduate_colorblock { +.jGraduate_colorblock { display: table-row; } -#svg_editor .jGraduate_Colorblocks .jGraduate_colorblock > * { +.jGraduate_Colorblocks .jGraduate_colorblock > * { display: table-cell; vertical-align: middle; margin: 0; float: none; } -#svg_editor .jGraduate_gradPick .jGraduate_Form_Section { +.jGraduate_gradPick .jGraduate_Form_Section { padding-top: 9px; } -#svg_editor .jGraduate_Slider { +.jGraduate_Slider { text-align: center; float: left; width: 100%; @@ -283,7 +283,7 @@ font-size: 11px; margin: 5px 0; } -#svg_editor .jGraduate_Slider .jGraduate_Form_Section { +.jGraduate_Slider .jGraduate_Form_Section { border: none; width: 250px; padding: 0 2px; @@ -291,12 +291,12 @@ font-size: 11px; } -#svg_editor .jGraduate_Slider label.prelabel { +.jGraduate_Slider label.prelabel { width: 40px; text-align: left; } -#svg_editor .jGraduate_SliderBar { +.jGraduate_SliderBar { width: 140px; float: left; margin: 0 5px; @@ -305,27 +305,28 @@ font-size: 11px; position: relative; } -#svg_editor div.jGraduate_Slider input { +div.jGraduate_Slider input { margin-top: 5px; } -#svg_editor div.jGraduate_Slider img { +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; +.jPicker .Button .Ok, .jGraduate_Picker .jGraduate_OkCancel .jGraduate_Ok { + -webkit-appearance: none; + margin: 0; position: absolute; - bottom: 15px; - right: 15px; + bottom: 5px; + right: 5px; } -#svg_editor .jPicker .Button .Cancel, #svg_editor .jGraduate_Picker .jGraduate_OkCancel .jGraduate_Cancel { +.jPicker .Button .Cancel, .jGraduate_Picker .jGraduate_OkCancel .jGraduate_Cancel { margin: 0; position: absolute; - bottom: 15px; - left: 15px; + bottom: 5px; + left: 5px; } diff --git a/editor/jgraduate/jpicker.min.js b/editor/jgraduate/jpicker.min.js index 4a6161b..147b197 100644 --- a/editor/jgraduate/jpicker.min.js +++ b/editor/jgraduate/jpicker.min.js @@ -1751,8 +1751,8 @@ activePreview = preview.find('.Active:first').css({ backgroundColor: hex && '#' + hex || 'transparent' }); currentPreview = preview.find('.Current:first').css({ backgroundColor: hex && '#' + hex || 'transparent' }).bind('click', currentClicked); setAlpha.call($this, currentPreview, Math.precision(color.current.val('a') * 100) / 255, 4); - okButton = button.find('.Ok:first').bind('click', okClicked); - cancelButton = button.find('.Cancel:first').bind('click', cancelClicked); + okButton = button.find('.Ok:first').bind('click touchstart', okClicked); + cancelButton = button.find('.Cancel:first').bind('click touchstart', cancelClicked); grid = button.find('.Grid:first'); setTimeout( function() @@ -1768,7 +1768,7 @@ setImg.call($this, colorBarL6, images.clientPath + 'AlphaBar.png'); setImg.call($this, preview.find('div:last'), images.clientPath + 'preview-opacity.png'); }, 0); - tbody.find('td.Radio input').bind('click', radioClicked); + tbody.find('td.Radio input').bind('click touchstart', radioClicked); // initialize quick list if (color.quickList && color.quickList.length > 0) { @@ -1817,10 +1817,10 @@ destroy = function() { - container.find('td.Radio input').unbind('click', radioClicked); - currentPreview.unbind('click', currentClicked); - cancelButton.unbind('click', cancelClicked); - okButton.unbind('click', okClicked); + container.find('td.Radio input touchstart').unbind('click', radioClicked); + currentPreview.unbind('click touchstart', currentClicked); + cancelButton.unbind('click touchstart', cancelClicked); + okButton.unbind('click touchstart', okClicked); if (settings.window.expandable) { iconImage.unbind('click', iconImageClicked); diff --git a/editor/jquery-draginput.js b/editor/jquery-draginput.js index 94ec610..33139b6 100644 --- a/editor/jquery-draginput.js +++ b/editor/jquery-draginput.js @@ -44,7 +44,9 @@ $.fn.dragInput = function(cfg){ var $cursor = (area && this.dragCfg.cursor) ? $("
").appendTo($label) : false + $input.attr("readonly", "readonly") if ($cursor && !isNaN(this.dragCfg.start)) $cursor.css("top", (this.dragCfg.start*-1)/scale+cursorHeight) + //this is where all the magic happens this.adjustValue = function(i, noUndo){ var v; @@ -98,7 +100,7 @@ $.fn.dragInput = function(cfg){ this.updateCursor = function(){ var value = parseFloat(this.value) var pos = (value*-1)/scale+cursorHeight - $(this).next(".draginput_cursor").css("top", pos) + $cursor.css("top", pos) } this.start = function(e) { @@ -119,7 +121,10 @@ $.fn.dragInput = function(cfg){ .attr("data-domain", cursorHeight) .attr("data-cursor", ($cursor != false)) - .bind("mousedown touchstart", function(e){this.start(e);}) + .bind("mousedown touchstart", function(e){ + this.blur(); + this.start(e); + }) .bind("dblclick taphold", function(e) { this.removeAttribute("readonly", "readonly"); @@ -127,54 +132,19 @@ $.fn.dragInput = function(cfg){ this.select(); }) - .blur(function(e){ - this.setAttribute("readonly", "readonly"); - this.adjustValue(0) - }) - .keydown(function(e){ - // Respond to up/down arrow keys. - switch(e.keyCode){ - case 13: this.blur(); break; // Enter - case 38: this.adjustValue(this.dragCfg.step); break; // Up - case 40: this.adjustValue(-this.dragCfg.step); break; // Down - case 33: this.adjustValue(this.dragCfg.page); break; // PageUp - case 34: this.adjustValue(-this.dragCfg.page); break; // PageDown - } + // Respond to up/down arrow keys. + switch(e.keyCode){ + case 13: this.adjustValue(0); this.blur(); break; // Enter + } }) - /* - http://unixpapa.com/js/key.html describes the current state-of-affairs for - key repeat events: - - Safari 3.1 changed their model so that keydown is reliably repeated going forward - - Firefox and Opera still only repeat the keypress event, not the keydown - */ - .keypress(function(e){ - if (this.repeating) { - // Respond to up/down arrow keys. - switch(e.keyCode){ - case 38: this.adjustValue(this.dragCfg.step); break; // Up - case 40: this.adjustValue(-this.dragCfg.step); break; // Down - case 33: this.adjustValue(this.dragCfg.page); break; // PageUp - case 34: this.adjustValue(-this.dragCfg.page); break; // PageDown - } - } - // we always ignore the first keypress event (use the keydown instead) - else { - this.repeating = true; - } + .focus(function(e){ + if (this.getAttribute("readonly") === "readonly") this.blur() }) - // clear the 'repeating' flag - .keyup(function(e) { - this.repeating = false; - switch(e.keyCode){ - case 38: // Up - case 40: // Down - case 33: // PageUp - case 34: // PageDown - case 13: this.adjustValue(0); break; // Enter/Return - } + .blur(function(e){ + this.setAttribute("readonly", "readonly") }) .bind("mousewheel", function(e, delta, deltaX, deltaY){ @@ -196,7 +166,7 @@ $.fn.dragInput.updateCursor = function(el){ var scale = parseFloat(el.getAttribute("data-scale")); var domain = parseFloat(el.getAttribute("data-domain")); var pos = ((value*-1)/scale+domain) + "px"; - var cursor = el.nextElementSibling - if (cursor) cursor.style.top = pos; + var cursor = el.parentNode.lastChild + if (cursor.className == "draginput_cursor") cursor.style.top = pos; } diff --git a/editor/select.js b/editor/select.js index 4332285..d957596 100644 --- a/editor/select.js +++ b/editor/select.js @@ -63,7 +63,7 @@ svgedit.select.Selector = function(id, elem) { ); if (svgedit.browser.isTouch()) { - this.selectorRect.setAttribute("stroke-opacity", 0); + this.selectorRect.setAttribute("stroke-opacity", 0.3); } // this holds a reference to the grip coordinates for this selector @@ -399,6 +399,59 @@ svgedit.select.SelectorManager.prototype.initGroup = function() { } }); + var defs = svgFactory_.createSVGElement({ + 'element': 'defs', + 'attr': { + 'id': 'placeholder_defs' + } + }) + + var pattern = svgFactory_.createSVGElement({ + 'element': 'pattern', + 'attr': { + 'id': 'checkerPattern', + 'patternUnits': 'userSpaceOnUse', + 'x': 0, + 'y': 0, + 'width': 20, + 'height': 20, + 'viewBox': '0 0 10 10' + } + }) + + var pattern_bg = svgFactory_.createSVGElement({ + 'element': 'rect', + 'attr': { + 'x': 0, + 'y': 0, + 'width': 10, + 'height': 10, + 'fill': "#fff" + } + }) + + var pattern_square1 = svgFactory_.createSVGElement({ + 'element': 'rect', + 'attr': { + 'x': 0, + 'y': 0, + 'width': 5, + 'height': 5, + 'fill': "#eee" + } + }) + + var pattern_square2 = svgFactory_.createSVGElement({ + 'element': 'rect', + 'attr': { + 'x': 5, + 'y': 5, + 'width': 5, + 'height': 5, + 'fill': "#eee" + } + }) + var rect = svgFactory_.createSVGElement({ 'element': 'rect', 'attr': { @@ -408,7 +461,7 @@ svgedit.select.SelectorManager.prototype.initGroup = function() { 'y': 0, 'stroke-width': 1, 'stroke': '#000', - 'fill': '#FFF', + 'fill': 'url(#checkerPattern)', 'style': 'pointer-events:none' } }); @@ -416,7 +469,13 @@ svgedit.select.SelectorManager.prototype.initGroup = function() { // Both Firefox and WebKit are too slow with this filter region (especially at higher // zoom levels) and Opera has at least one bug // if (!svgedit.browser.isOpera()) rect.setAttribute('filter', 'url(#canvashadow)'); + canvasbg.appendChild(defs); + defs.appendChild(pattern); + pattern.appendChild(pattern_bg); + pattern.appendChild(pattern_square1); + pattern.appendChild(pattern_square2); canvasbg.appendChild(rect); + svgFactory_.svgRoot().insertBefore(canvasbg, svgFactory_.svgContent()); }; @@ -527,6 +586,13 @@ svgedit.select.init = function(config, svgFactory) { config_ = config; svgFactory_ = svgFactory; selectorManager_ = new svgedit.select.SelectorManager(); + //for hovering elements + svgFactory_.createSVGElement({ + 'element': 'g', + 'attr': { + 'id': 'hover_group' + } + }) }; /** diff --git a/editor/svg-editor.css b/editor/svg-editor.css index 9c71f9e..e863e34 100644 --- a/editor/svg-editor.css +++ b/editor/svg-editor.css @@ -49,12 +49,7 @@ html, body { color: #000000; } -#svg_editor hr { - border: none; - border-bottom: 1px solid #808080; -} - -#svg_editor #svgroot { + #svgroot { -moz-user-select: none; -webkit-user-select: none; position: absolute; @@ -62,22 +57,22 @@ html, body { left: 0; } -#svg_editor #menu_bar { + #menu_bar { margin: 0 0 0 50px } -#svg_editor #menu_bar.active .menu.open .menu_list { + #menu_bar.active .menu.open .menu_list { display: block; } -#svg_editor .menu { + .menu { position: relative; z-index: 5; color: #333; display: inline-block; } -#svg_editor .menu_title { + .menu_title { cursor: pointer; display: inline-block; padding: 7px 10px; @@ -88,22 +83,22 @@ html, body { vertical-align: top; } -.touch #svg_editor .menu_title { +.touch .menu_title { padding: 7px 17px; height: 26px; line-height: 26px; } -#svg_editor .menu .menu_title:hover { + .menu .menu_title:hover { background: rgba(255,255,255,0.1); } -#svg_editor .menu_list .separator { + .menu_list .separator { margin: 5px 0; border-top: solid #ddd 1px; } -#svg_editor .menu_list { + .menu_list { display: none; position: absolute; top: 28px; @@ -115,16 +110,16 @@ html, body { box-shadow: 0 0 20px rgba(0,0,0,0.8); } -.touch #svg_editor .menu_list { +.touch .menu_list { top: 38px; } -#svg_editor #menu_bar.active .menu.open .menu_title { + #menu_bar.active .menu.open .menu_title { background: white; color: #333; } -#svg_editor .menu_list .menu_item { + .menu_list .menu_item { position: relative; overflow: hidden; line-height: 22px; @@ -133,7 +128,7 @@ html, body { color: #333; } -#svg_editor .menu_list .menu_item.tool_button { + .menu_list .menu_item.tool_button { background: transparent; border: none; margin: 0; @@ -142,7 +137,7 @@ html, body { width: auto; } -#svg_editor .menu_list .menu_item.push_button_pressed:before { + .menu_list .menu_item.push_button_pressed:before { content: '✔'; position: absolute; display: block; @@ -152,19 +147,19 @@ html, body { height: 20px; } -#svg_editor .menu_list .menu_item:hover, -#svg_editor .menu_list .menu_item.push_button_pressed:hover { + .menu_list .menu_item:hover, + .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 { + .menu_list .menu_item.disabled:hover, + .menu_list .menu_item.push_button_pressed.disabled:hover { background: transparent; color: #333; } -#svg_editor .menu_list .menu_item.push_button_pressed { + .menu_list .menu_item.push_button_pressed { background: transparent; border: none; width: auto; @@ -172,7 +167,7 @@ html, body { margin: 0; } -#svg_editor .menu_list .menu_item span { + .menu_list .menu_item span { display: block; position: absolute; right: 10px; @@ -185,7 +180,7 @@ html, body { line-height: 120%; } -#svg_editor #svgcanvas { + #svgcanvas { line-height: normal; display: inline-block; background-color: #A0A0A0; @@ -273,7 +268,7 @@ html, body { overflow: hidden; } -#svg_editor div#palette_holder { + div#palette_holder { display: block; overflow: hidden; height: 31px; @@ -283,28 +278,28 @@ html, body { float: left; } -.touch #svg_editor div#palette_holder { +.touch div#palette_holder { height: 40px; margin-top: 0; } -#svg_editor div#palette_holder #palette .palette_item:first-child { + div#palette_holder #palette .palette_item:first-child { background: #fff; } -#svg_editor div#palette_holder #palette .palette_item { + div#palette_holder #palette .palette_item { cursor: pointer; } -#svg_editor #color_tools { + #color_tools { position: relative; width: 48px; height: 48px; margin: 6px 6px 0 6px; } -.touch #svg_editor #color_tools { +.touch #color_tools { width: auto; height: auto; } @@ -360,7 +355,7 @@ html, body { border: solid #ccc 1px; } -.touch #svg_editor #tool_eyedropper { +.touch #tool_eyedropper { margin-top: 6px; } @@ -374,11 +369,11 @@ html, body { height: 36px !important; } -.touch #svg_editor #tool_switch { +.touch #tool_switch { display: none; } -#svg_editor #path_node_panel .tool_button { + #path_node_panel .tool_button { color: #999; border: solid #3F3F3C 1px; border-radius: 3px; @@ -392,27 +387,27 @@ html, body { line-height: 24px; } -#svg_editor #path_node_panel .tool_button img { + #path_node_panel .tool_button img { position: absolute; left: 5px; top: 3px; } -#svg_editor #color_tools #tool_fill .color_block:hover, #svg_editor #color_tools #tool_stroke .color_block:hover { + #color_tools #tool_fill .color_block:hover, #color_tools #tool_stroke .color_block:hover { border-color: #fff; } -#svg_editor #color_tools #tool_fill .color_block > div { + #color_tools #tool_fill .color_block > div { position: absolute; top: 0; left: 0; } -.touch #svg_editor #color_tools #tool_fill .color_block > div { +.touch #color_tools #tool_fill .color_block > div { position: relative; } -#svg_editor #color_tools #tool_fill .color_block #fill_bg, #svg_editor #color_tools #tool_stroke .color_block #stroke_bg { + #color_tools #tool_fill .color_block #fill_bg, #color_tools #tool_stroke .color_block #stroke_bg { position: absolute; top: 1px; left: 1px; @@ -421,7 +416,7 @@ html, body { background: #fff; } -.touch #svg_editor #color_tools #tool_fill .color_block #fill_bg, .touch #svg_editor #color_tools #tool_stroke .color_block #stroke_bg { +.touch #color_tools #tool_fill .color_block #fill_bg, .touch #color_tools #tool_stroke .color_block #stroke_bg { width: 36px; height: 36px; right: auto; @@ -456,7 +451,7 @@ html, body { } -#svg_editor #color_tools #tool_switch { + #color_tools #tool_switch { cursor: pointer; opacity: 0.7; width: 11px; @@ -467,39 +462,39 @@ html, body { left: 28px; } -#svg_editor #color_tools #cross:hover { + #color_tools #cross:hover { opacity: 1; } -#svg_editor #color_tools #tool_stroke:hover #stroke_color:after { + #color_tools #tool_stroke:hover #stroke_color:after { background: #fff; } -#svg_editor #color_tools #tool_stroke .color_block { + #color_tools #tool_stroke .color_block { width: 24px; height: 24px; overflow: hidden; border: solid #ccc 1px; } -.touch #svg_editor #color_tools #tool_stroke .color_block { +.touch #color_tools #tool_stroke .color_block { width: 36px; height: 36px; } -#svg_editor #color_tools #tool_stroke .color_block > div { + #color_tools #tool_stroke .color_block > div { position: absolute; bottom: 0; right: 0; } -.touch #svg_editor #color_tools #tool_stroke .color_block > div { +.touch #color_tools #tool_stroke .color_block > div { position: relative; } -#svg_editor #color_tools .icon_label { + #color_tools .icon_label { padding: 0; width: 24px; height: 100%; @@ -507,23 +502,18 @@ html, body { position: absolute; } -#svg_editor #zoomLabel { - cursor: pointer; - margin-right: 5px; -} - -#svg_editor #linkLabel > svg { + #linkLabel > svg { height: 20px; padding-top: 4px; } -#svg_editor div#palette { + div#palette { float: left; width: 810px; height: 16px; } -#svg_editor div#workarea { + div#workarea { display: inline-table-cell; position:absolute; top: 30px; @@ -535,58 +525,69 @@ html, body { text-align: center; } -.touch #svg_editor div#workarea { +.touch div#workarea { top: 40px; } -#svg_editor div.palette_item { + div.palette_item { height: 16px; width: 16px; float: left; } -.touch #svg_editor div.palette_item { +.touch div.palette_item { height: 30px; border-top: solid #2f2f2c 5px; border-bottom: solid #2f2f2c 5px; - width: 30px; + width: 19px; float: left; } -#svg_editor .menu .menu_list { + .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 + .tool_button:hover, + .push_button:hover, + .buttonup:hover, + .buttondown, + .tool_button_current, + .push_button_pressed { background-color: #fff; } -#svg_editor .tool_button.disabled, -#svg_editor .tool_button.disabled:hover { + .tool_button.disabled, + .tool_button.disabled:hover { opacity: 0.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_left .tool_button { background: #2f2f2c; position: relative;} + #tools_left .tool_button.loaded { background: #ccc;} + #tools_left .tool_button.loaded:hover { background: #fff;} + #tools_left .tool_button:after, #tools_left .tool_button_current:after { + position: absolute; + content: ''; + border: solid #2f2f2c 1px; + top: 0; + left: 0; + width: 27px; + height: 27px; + z-index: 0; +} + #tools_top .padded { padding: 10px 0; } -#svg_editor #tools_left .tool_button_current { + #tools_left .tool_button_current { background-color: #0cf; } -#svg_editor #main_icon span { + #main_icon span { position: absolute; width: 100%; height: 100%; @@ -594,7 +595,7 @@ html, body { z-index: 2; } -#svg_editor #tools_top { + #tools_top { position: absolute; width: 160px; right: 0; @@ -604,11 +605,11 @@ html, body { padding: 0 0 0 10px; } -.touch #svg_editor #tools_top { - top: 40px; +.touch #tools_top { + top: 30px; } -#svg_editor label { + label { display: block; color: #999; } @@ -644,15 +645,15 @@ div#font-selector .font-item:hover { background-color: #eee; } -#svg_editor #tools_top #marker_panel * { + #tools_top #marker_panel * { float: left; } -#svg_editor #tools_top #marker_panel h4 { + #tools_top #marker_panel h4 { float: none; } -#svg_editor #tools_top #marker_panel .dropdown .icon_label { + #tools_top #marker_panel .dropdown .icon_label { width: 36px; height: 20px; margin-top: 2px; @@ -660,63 +661,65 @@ div#font-selector .font-item:hover { text-align: center; } -#svg_editor #font_family_dropdown-list { + #font_family_dropdown-list { border-radius: 3px; box-shadow: 0 5px 10px #000; } -#svg_editor #font_family_dropdown-list li { + #font_family_dropdown-list li { cursor: pointer; } -#svg_editor #tools_top #marker_panel .dropdown button { + #tools_top #marker_panel .dropdown button { margin-top: 2px; } -#svg_editor #tools_top #marker_panel #marker_panel_title { + #tools_top #marker_panel #marker_panel_title { float: none; color: #fff; margin-bottom: 3px; } -#svg_editor #tools_top #marker_panel .dropdown .icon_label img { + #tools_top #marker_panel .dropdown .icon_label img { float: none; } -#svg_editor #color_picker input[type=text], #color_picker #svg_editor input[type=number] { + #color_picker input[type=text], #color_picker input[type=number] { width: 30px; background: #fff; } -#svg_editor .dropdown_set input[type=text], #svg_editor .dropdown_set input[type=number] { + .dropdown_set input[type=text], .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;} + input[type=text].wide, input[type=number].wide {width: 110px;} + input[type=text].tuco, input[type=number].tuco {width: 150px;} -#svg_editor input[type=submit], #svg_editor input[type=button], button { - background: #2C7BB3; + input[type=submit], input[type=button], button { + background: #4F80FF; color: #fff; - border-radius: 2px; - padding: 5px 10px; + border-radius: 3px; + padding: 7px 17px; border: none; line-height: 140%; - border-bottom: solid transparent 1px; + font-size: 14px; + font-weight: bold; + font-family: sans-serif; } -#svg_editor input[type=submit]:hover, #svg_editor button:hover { + input[type=submit]:hover, 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;} + input[type=submit]:hover, button:hover {background: #2F84C1;} + input[type=submit]:active, 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 #tools_left { + #tools_left { position: absolute; border-right: none; width: 50px; @@ -759,7 +762,7 @@ box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.1), display: block; } -#svg_editor #multiselected_panel .selected_tool { + #multiselected_panel .selected_tool { vertical-align: 12px; } @@ -780,57 +783,36 @@ box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.1), border-radius: 0 10px 10px 0; } -#svg_editor #cur_context_panel a { + #cur_context_panel a { float: none; text-decoration: none; color: #fff; } -#svg_editor #cur_context_panel a:hover { + #cur_context_panel a:hover { text-decoration: underline; } -#svg_editor #tools_left .tool_button, -#svg_editor #tools_left .tool_button_current { + #tools_left .tool_button, + #tools_left .tool_button_current { position: relative; z-index: 11; } -#svg_editor .flyout_arrow_horiz { + .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 { + .dropdown button { width: 21px; height: 22px; padding: 0 3px 0 3px; @@ -841,11 +823,11 @@ span.zoom_tool img { position: relative; } -#svg_editor .dropdown button:hover { + .dropdown button:hover { background-color: #666; } -#svg_editor .dropdown button:after { + .dropdown button:after { content: ''; position: absolute; border: solid transparent 4px; @@ -952,10 +934,10 @@ span.zoom_tool img { } -#svg_editor .tool_button, -#svg_editor .push_button, -#svg_editor .tool_button_current, -#svg_editor .push_button_pressed + .tool_button, + .push_button, + .tool_button_current, + .push_button_pressed { height: 27px; width: 27px; @@ -966,7 +948,7 @@ span.zoom_tool img { cursor: pointer; } -#svg_editor #main_menu li#tool_open, #svg_editor #main_menu li#tool_import { + #main_menu li#tool_open, #main_menu li#tool_import { position: relative; overflow: hidden; } @@ -987,16 +969,16 @@ span.zoom_tool img { cursor: pointer; /* Sadly doesn't appear to have an effect */ } -#svg_editor .disabled { + .disabled { opacity: 0.5; cursor: default; } -#svg_editor .width_label { + .width_label { padding-right: 5px; } -#svg_editor #tool_bold, #svg_editor #tool_italic { + #tool_bold, #tool_italic { font: bold 2.1em/1.1em serif; text-align: center; padding: 0 2px 5px 2px; @@ -1008,7 +990,7 @@ span.zoom_tool img { border: solid #3f3f3c 1px; } -#svg_editor #tool_bold:hover, #svg_editor #tool_italic:hover { + #tool_bold:hover, #tool_italic:hover { color: #fff; } @@ -1017,7 +999,7 @@ span.zoom_tool img { left: -9999px; } -#svg_editor #tool_bold span, #svg_editor #tool_italic span { + #tool_bold span, #tool_italic span { position: absolute; width: 100%; height: 100%; @@ -1026,7 +1008,7 @@ span.zoom_tool img { opacity: 0; } -#svg_editor #tool_italic { + #tool_italic { font-weight: normal; font-style: italic; } @@ -1036,7 +1018,7 @@ span.zoom_tool img { display: none; } -#svg_editor #color_picker { + #color_picker { position: absolute; display: none; background: #fff; @@ -1047,7 +1029,7 @@ span.zoom_tool img { width: 530px; } -#svg_editor .tools_flyout { + .tools_flyout { position: absolute; display: none; cursor: pointer; @@ -1060,21 +1042,21 @@ span.zoom_tool img { box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5); } -#svg_editor .tools_flyout_v { + .tools_flyout_v { position: absolute; display: none; cursor: pointer; width: 30px; } -#svg_editor .tools_flyout .tool_button { + .tools_flyout .tool_button { float: left; background-color: #fff; height: 24px; width: 24px; } -#svg_editor #tools_bottom { + #tools_bottom { position: absolute; left: 50px; right: 0; @@ -1083,12 +1065,12 @@ span.zoom_tool img { overflow: visible; } -#svg_editor #tools_bottom_1 { + #tools_bottom_1 { width: 115px; float: left; } -#svg_editor #tools_bottom_2 { + #tools_bottom_2 { position: relative; float: left; margin-top: 5px; @@ -1098,7 +1080,7 @@ span.zoom_tool img { width: 3.2em; } -#svg_editor #tools_top h4 { + #tools_top h4 { color: #fff; font-weight: normal; margin: 0; @@ -1111,21 +1093,49 @@ span.zoom_tool img { height: auto; } +#tools_top.multiselected #align_tools { + display: none; +} -#svg_editor .draginput_cell { +#tools_top.multiselected #multiselected_panel { + display: block !important; +} + +#tools_top.multiselected #multiselected_panel .hidable { + display: none; +} + + .draginput_cell { float: left; height: 26px; + height: 26px; border: solid #3f3f3c 10px; outline: solid #2f2f2c 1px; - background-color: #ddd; + background: #ddd; cursor: pointer; + position: relative; +} + + .draginput_cell:hover { + background: #fff; +} + + .draginput_cell:after { + content: ''; + position: absolute; + top: 0; + left: 0; + border: solid #3f3f3c 1px; + height: 26px; + width: 26px; + z-index: 0; } -#svg_editor .align_buttons .draginput_cell:nth-child(1) {border-radius: 3px 0 0 0;} -#svg_editor .align_buttons .draginput_cell:nth-child(3) {border-radius: 0 3px 0 0;} -#svg_editor .align_buttons .draginput_cell:nth-child(4) {border-radius: 0 0 0 3px;} -#svg_editor .align_buttons .draginput_cell:nth-child(6) {border-radius: 0 0 3px 0;} + .align_buttons .draginput_cell:nth-child(1) {border-radius: 3px 0 0 0;} + .align_buttons .draginput_cell:nth-child(3) {border-radius: 0 3px 0 0;} + .align_buttons .draginput_cell:nth-child(4) {border-radius: 0 0 0 3px;} + .align_buttons .draginput_cell:nth-child(6) {border-radius: 0 0 3px 0;} .align_buttons .push_button { @@ -1169,16 +1179,16 @@ span.zoom_tool img { } -#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 { + #option_lists .tool_button, #option_lists .push_button, #option_lists .tool_button_current, #option_lists .push_button_pressed { border: none; background: transparent; } -#svg_editor #option_lists .tool_button:hover { + #option_lists .tool_button:hover { background: #ddd; } -#svg_editor #option_lists ul li.current { + #option_lists ul li.current { background-color: #F4E284; } @@ -1191,18 +1201,18 @@ span.zoom_tool img { float: left; } -#svg_editor ul li.current { + ul li.current { background-color: #F4E284; } -#svg_editor #option_lists ul li { + #option_lists ul li { margin: 0; border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; } -#svg_editor #copyright { + #copyright { text-align: right; padding-right: .3em; } @@ -1276,7 +1286,7 @@ span.zoom_tool img { -#svg_editor button.cancel, #svg_editor input.Cancel, #svg_editor input.cancel, #svg_editor input.jGraduate_Cancel, button.cancel { + button.cancel, input.Cancel, input.cancel, input.jGraduate_Cancel, button.cancel { -webkit-appearance: none; background-color: #999; box-shadow: 0 0 1px rgba(0,0,0,0.5); @@ -1461,8 +1471,8 @@ span.zoom_tool img { /* Necessary to keep the flyouts sized properly */ #shape_buttons {background: #fff; border-radius: 0 3px 3px 0; padding: 10px} -#svg_editor .tools_flyout .tool_button, -#svg_editor .tools_flyout .tool_flyout { + .tools_flyout .tool_button, + .tools_flyout .tool_flyout { background: #fff; width: 40px; height: 40px; @@ -1636,7 +1646,7 @@ span.zoom_tool img { } -#svg_editor #group_title {display: none;} + #group_title {display: none;} #base_unit_container { display: none; @@ -1644,7 +1654,7 @@ span.zoom_tool img { z-index: 20; } -#svg_editor .draginput { + .draginput { background: #3f3f3c; border-radius: 3px; -webkit-font-smoothing: antialiased; @@ -1656,7 +1666,7 @@ span.zoom_tool img { margin: 0 5px 5px 0; } -#svg_editor .draginput .caret { + .draginput .caret { border: solid transparent 5px; border-top-color: #999; position: absolute; @@ -1667,7 +1677,7 @@ span.zoom_tool img { top: 50%; } -#svg_editor .draginput label { + .draginput label { margin: 28px 10px 0 5px; font-size: 14px; color: white; @@ -1675,7 +1685,7 @@ span.zoom_tool img { font-family: sans-serif; } -#svg_editor .draginput label#resolution_label, #svg_editor .draginput label#seg_type_label { + .draginput label#resolution_label, .draginput label#seg_type_label { font: bold 12px/110% sans-serif; position: absolute; left: auto; @@ -1684,20 +1694,20 @@ span.zoom_tool img { text-align: right; } - #svg_editor .draginput label#seg_type_label { + .draginput label#seg_type_label { margin-top: 40px; } - #svg_editor .draginput label#seg_type_label .caret { + .draginput label#seg_type_label .caret { top: 66%; } -#svg_editor .draginput label#resolution_label .pull { + .draginput label#resolution_label .pull { position: relative; left: -15px; } -#svg_editor .draginput label#resolution_label span { + .draginput label#resolution_label span { right: -13px; left: auto; font-size: 16px; @@ -1706,7 +1716,7 @@ span.zoom_tool img { color: white; } -.touch #svg_editor .draginput.active:after { +.touch .draginput.active:after { content: attr(data-value); display: block; position: absolute; @@ -1727,7 +1737,7 @@ span.zoom_tool img { letter-spacing: -1px; } -.touch #svg_editor .draginput.active:before { +.touch .draginput.active:before { content: ''; height: 0; width: 0; @@ -1738,7 +1748,7 @@ span.zoom_tool img { border-left-color: #fff; } -#svg_editor .draginput input { + .draginput input { border: none; background: transparent; font: 24px/normal sans-serif; @@ -1754,13 +1764,13 @@ span.zoom_tool img { cursor: -moz-drag; } -#svg_editor .draginput input:active { + .draginput input:active { cursor: url(images/dragging.png), move; cursor: -webkit-dragging; cursor: -moz-dragging; } -#svg_editor .draginput span { + .draginput span { font: 11px/130% sans-serif; color: #ccc; display: block; @@ -1770,19 +1780,19 @@ span.zoom_tool img { text-align: left; } -#svg_editor .draginput.error { + .draginput.error { background: #900; } -#svg_editor .draginput.error input { + .draginput.error input { color: #fff; } -#svg_editor .draginput.stroke_tool { + .draginput.stroke_tool { text-align: center; } -#svg_editor .draginput select { + .draginput select { -webkit-appearance: none; opacity: 0; display: block; @@ -1803,7 +1813,7 @@ span.zoom_tool img { z-index: 0; } -#svg_editor .draginput input[readonly=readonly] { + .draginput input[readonly=readonly] { -webkit-appearance: none; -webkit-touch-callout: none; -webkit-user-select: none; @@ -1814,6 +1824,68 @@ span.zoom_tool img { } + .draginput input:focus { + background: #4F80FF; + color: #fff; + outline: none; + box-shadow: 0 0 5px 2px #4F80FF; +} + + .draginput input:focus+span { + z-index: 10; + color:#fff; +} + +#zoom_label { + height: 20px; + background: transparent; + cursor: default !important; + width: auto; + padding: 0 10px; + margin: 0; +} + +#zoom_panel { + padding: 9px 0; + right: 175px; + position: absolute; +} + +#zoom_label img { + width: 16px; + height: 16px; +} + +#zoomLabel { + width: 16px; + height: 16px; + cursor: pointer; + background: #ccc; +} + +#zoomLabel:after { + content: ''; + position: absolute; + border-left: solid #2f2f2c 1px; + left: 0; + height: 16px; +} + +#zoom_label input { + color: #ccc; + font-size: 13px; + height: auto; + width: auto; + padding: 0; + cursor: default; + position: static; +} + +#zoom_label span { + top: 0; + left: 0; +} + body.dragging * { cursor: url(images/dragging.png), move; cursor: -webkit-drag; @@ -1826,7 +1898,7 @@ body.drag * { cursor: -moz-dragging; } -#svg_editor input[readonly=readonly]:focus { +input[readonly=readonly]:focus { box-shadow: none; } @@ -1836,20 +1908,22 @@ body.drag * { height: 40px; margin: 23px 5px 5px 5px; position: relative; + overflow: hidden; } -#color_canvas_tools svg { +#color_canvas_tools { display: block; } + #tool_angle_indicator { width: 50px; height: 50px; border-radius: 50px; - border: solid rgba(50,100,200,0.25) 3px; + background: rgba(255,255,255,0.05); position: absolute; bottom: 2px; - left: 7px; + left: 10px; } #tool_angle_indicator_cursor { @@ -1857,7 +1931,7 @@ body.drag * { height: 25px; border-top: solid #4F80FF 3px; position: absolute; - margin: -3px 0 0 25px; + margin: 0 0 0 23px; -webkit-transform-origin: 50% 0; -moz-transform-origin: 50% 0; -o-transform-origin: 50% 0; diff --git a/editor/svg-editor.html b/editor/svg-editor.html index 6d891d8..fbdbe1c 100644 --- a/editor/svg-editor.html +++ b/editor/svg-editor.html @@ -24,11 +24,11 @@ + - @@ -51,6 +51,7 @@ + @@ -166,12 +167,12 @@ $(function(){

Canvas

@@ -207,91 +208,104 @@ $(function(){

Rectangle

Path

-

Image

- +

Ellipse

-

Line

-

Text

-
@@ -511,7 +519,7 @@ $(function(){
-
+
@@ -537,9 +545,26 @@ $(function(){
-
diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 9e6b31b..7fc7a4a 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -22,6 +22,7 @@ document.addEventListener("touchmove", touchHandler, true); document.addEventListener("touchend", touchHandler, true); document.addEventListener("touchcancel", touchHandler, true); + if(!window.svgEditor) window.svgEditor = function($) { var svgCanvas; var Editor = {}; @@ -284,13 +285,9 @@ resize: { '#logo .svg_icon': 15, '.flyout_arrow_horiz .svg_icon': 5, - '.layer_button .svg_icon, #layerlist td.layervis .svg_icon': 14, - '#main_button .dropdown .svg_icon': 9, - '#fill_bg .svg_icon, #stroke_bg .svg_icon': svgedit.browser.isTouch() ? 36 : 24, + '#fill_bg .svg_icon, #stroke_bg .svg_icon': svgedit.browser.isTouch() ? 24 : 24, '.palette_item:first .svg_icon': svgedit.browser.isTouch() ? 30 : 16, - '.toolbar_button button .svg_icon':16, - '.stroke_tool div div .svg_icon': 20, - '#tools_bottom label .svg_icon': 18, + '#zoomLabel .svg_icon': 16, '#zoom_dropdown .svg_icon': 7 }, callback: function(icons) { @@ -468,7 +465,6 @@ var docprops = false; var preferences = false; var cur_context = ''; - var orig_title = $('title:first').text(); var saveHandler = function(window,svg) { Editor.show_save_warning = false; @@ -552,7 +548,7 @@ var is_node = (mode == "pathedit"); // if elems[1] is present, then we have more than one element selectedElement = (elems.length == 1 || elems[1] == null ? elems[0] : null); - multiselected = (elems.length >= 2 && elems[1] != null); + multiselected = (elems.length >= 2 && elems[1] != null) ? elems : false; if (selectedElement != null) { // unless we're already in always set the mode of the editor to select because // upon creation of a text element the editor is switched into @@ -580,7 +576,7 @@ if(!elem) return; - multiselected = (elems.length >= 2 && elems[1] != null); + multiselected = (elems.length >= 2 && elems[1] != null) ? elems : null; // Only updating fields for single elements for now if(!multiselected) { switch ( mode ) { @@ -668,7 +664,6 @@ var diff = (zoomlevel) - (res.zoom) var zoom = $('#zoom')[0] var current_zoom = res.zoom - console.log(diff); var animateZoom = function(timestamp) { var progress = timestamp - start var tick = progress / duration @@ -1387,18 +1382,34 @@ var elem = selectedElement; // If element has just been deleted, consider it null if(elem != null && !elem.parentNode) elem = null; + if (multiselected && multiselected[0] != null && !multiselected[0].parentNode) multiselected = false; + var currentLayerName = svgCanvas.getCurrentDrawing().getCurrentLayerName(); var currentMode = svgCanvas.getMode(); var unit = curConfig.baseUnit !== 'px' ? curConfig.baseUnit : null; var is_node = currentMode == 'pathedit'; //elem ? (elem.id && elem.id.indexOf('pathpointgrip') == 0) : false; var menu_items = $('#cmenu_canvas li'); - $('#selected_panel, #multiselected_panel, #g_panel, #path_panel, #rect_panel, #canvas_panel, #circle_panel,\ - #ellipse_panel, #line_panel, #text_panel, #image_panel, #container_panel, #use_panel, #a_panel').hide(); + $('.context_panel').hide(); $('.menu_item', '#edit_menu').addClass('disabled'); $('.menu_item', '#object_menu').addClass('disabled'); - if (!elem && !multiselected) $("#canvas_panel").show(); + + + //hack to show the proper multialign box + if (multiselected) { + elem = (svgCanvas.elementsAreSame(multiselected)) ? multiselected[0] : null + if (elem) $("#tools_top").addClass("multiselected") + } + + if (!elem && !multiselected) { + $("#tools_top").removeClass("multiselected") + $("#stroke_panel").hide(); + $("#canvas_panel").show(); + } + + if (elem != null) { + $("#stroke_panel").show(); var elname = elem.nodeName; var angle = svgCanvas.getRotationAngle(elem); $('#angle').val(Math.round(angle)); @@ -1423,7 +1434,7 @@ x = svgedit.units.convertUnit(x); y = svgedit.units.convertUnit(y); } - + $("#" + elname +"_x").val(Math.round(x)) $("#" + elname +"_y").val(Math.round(y)) @@ -1556,15 +1567,6 @@ $('#container_panel').show(); $('.action_group_selected').removeClass('disabled'); var title = svgCanvas.getTitle(); - var label = $('#g_title')[0]; - label.value = title; - setInputWidth(label); - var d = 'disabled'; - if(el_name == 'use') { - label.setAttribute(d, d); - } else { - label.removeAttribute(d); - } } } menu_items[(el_name === 'g' ? 'en':'dis') + 'ableContextMenuItems']('#ungroup'); @@ -1597,8 +1599,8 @@ svgCanvas.addedNew = false; }; - $('#text').focus( function(){ textBeingEntered = true; } ); - $('#text').blur( function(){ textBeingEntered = false; } ); + $('#text').on("focus", function(e){ textBeingEntered = true; } ); + $('#text').on("blur", function(){ textBeingEntered = false; } ); // bind the selected event to our function that handles updates to the UI svgCanvas.bind("selected", selectedChanged); @@ -1654,8 +1656,6 @@ $('#tool_reorient').toggleClass('disabled', ctl.value == 0); } - - var changeZoom = function(ctl) { var zoomlevel = ctl.value / 100; if(zoomlevel < .001) { @@ -1719,29 +1719,11 @@ $('#font_family').change(function() { svgCanvas.setFontFamily(this.value); }); - - - + $('#text').keyup(function(){ svgCanvas.setTextContent(this.value); }); - $('#image_url').change(function(){ - setImageURL(this.value); - }); - - $('#link_url').change(function() { - if(this.value.length) { - svgCanvas.setLinkURL(this.value); - } else { - svgCanvas.removeHyperlink(); - } - }); - - $('#g_title').change(function() { - svgCanvas.setGroupTitle(this.value); - }); - changeAttribute = function(el, noUndo) { var attr = el.getAttribute("data-attr"); var val = el.value; @@ -1751,23 +1733,6 @@ el.value = selectedElement.getAttribute(attr); return false; } - else{ - el.blur() - } - - if (attr !== "id") { - if (isNaN(val)) { - val = svgCanvas.convertToNum(attr, val); - } else if(curConfig.baseUnit !== 'px') { - // Convert unitless value to one with given unit - - var unitData = svgedit.units.getTypeMap(); - - if(selectedElement[attr] || svgCanvas.getMode() === "pathedit" || attr === "x" || attr === "y") { - val *= unitData[curConfig.baseUnit]; - } - } - } if (!noUndo) svgCanvas.changeSelectedAttribute(attr, val); else svgCanvas.changeSelectedAttributeNoUndo(attr, val); }; @@ -1779,7 +1744,7 @@ inp.focus().remove(); }); - $('.palette_item').mousedown(function(evt){ + $('.palette_item').on("mousedown touchstart touchmove", function(evt){ var isStroke = $('#tool_stroke').hasClass('active'); var picker = isStroke ? "stroke" : "fill"; var color = $(this).attr('data-rgb'); @@ -1842,7 +1807,7 @@ var last_x = null, last_y = null, w_area = workarea[0], panning = false, keypan = false; - $('#svgcanvas').bind('mousemove mouseup', function(evt) { + $('#svgcanvas').bind('mousemove mouseup touchend', function(evt) { if(panning === false) return; w_area.scrollLeft -= (evt.clientX - last_x); w_area.scrollTop -= (evt.clientY - last_y); @@ -1850,10 +1815,11 @@ last_x = evt.clientX; last_y = evt.clientY; - if(evt.type === 'mouseup') panning = false; + if(evt.type === 'mouseup' || evt.type === 'touchend') panning = false; return false; - }).mousedown(function(evt) { - if(evt.button === 1 || keypan === true) { + }) + .on("mousedown touchmove", function(evt) { + if(evt.button === 1 || keypan === true || (evt.originalEvent.touches && evt.originalEvent.touches.length >= 2)) { panning = true; last_x = evt.clientX; last_y = evt.clientY; @@ -2526,11 +2492,6 @@ curConfig.gridSnapping = sg; } - var clickCanvasColor = function(){ - svgCanvas.clearSelection(); - $('#tool_canvas').trigger("click") - }; - var minimizeModal = function() { if (window.self != window.top) { //we're in an iframe @@ -3129,13 +3090,7 @@ } }); - $('#tool_canvas').on("click touchstart", function(){ - colorPicker($('#canvas_color')); - updateToolButtonState(); - }); - - $('#tool_stroke').on("click touchstart", function(){ - + $('#tool_stroke').on("click", function(){ if ($('#tool_stroke').hasClass('active')) { colorPicker($('#stroke_color')); updateToolButtonState(); @@ -3146,9 +3101,29 @@ } }); - $('#zoomLabel').click(function() { - $('#zoom_dropdown button').mousedown(); - $(window).mouseup(); + $('#tool_canvas').on("click touchstart", function(){ + colorPicker($('#canvas_color')); + updateToolButtonState(); + }); + + $('#tool_stroke').on("touchstart", function(){ + $('#tool_stroke').addClass('active'); + $("#tool_fill").removeClass('active'); + colorPicker($('#stroke_color')); + updateToolButtonState(); + }); + + $('#tool_fill').on("touchstart", function(){ + $('#tool_fill').addClass('active'); + $("#tool_stroke").removeClass('active'); + colorPicker($('#fill_color')); + updateToolButtonState(); + }); + + $('#zoom_select').on("change", function() { + var val = this.options[this.selectedIndex].text + val = val.split("%")[0] + $("#zoom").val(val).trigger("change") }); $('.push_button').mousedown(function() { @@ -3349,7 +3324,6 @@ {sel:'[id^=tool_align]', fn: clickAlign, evt: 'click'}, {sel:'#tool_undo', fn: clickUndo, evt: 'click', key: modKey + 'z'}, {sel:'#tool_redo', fn: clickRedo, evt: 'click', key: ['y', true]}, - {sel:'#tool_canvas_color_menu', fn: clickCanvasColor, evt: 'click'}, {sel:'#tool_cut', fn: cutSelected, evt: 'click', key: [modKey+'x', true]}, {sel:'#tool_copy', fn: copySelected, evt: 'click', key: modKey+'c'}, {sel:'#tool_paste', fn: pasteSelected, evt: 'click', key: modKey+'v'}, @@ -3472,14 +3446,6 @@ // Setup flyouts setupFlyouts(flyouts); - - // Misc additional actions - - // Make "return" keypress trigger the change event - $('.attr_changer, #image_url').bind('keydown', 'return', - function(evt) {$(this).change();evt.preventDefault();} - ); - $(window).bind('keydown', 'tab', function(e) { if(ui_context === 'canvas') { e.preventDefault(); @@ -3584,8 +3550,8 @@ $('#path_y') .dragInput({ min: null, max: null, step: 1, callback: changeAttribute, cursor: false }); $('#rect_x') .dragInput({ min: null, max: null, step: 1, callback: changeAttribute, cursor: false }); $('#rect_y') .dragInput({ min: null, max: null, step: 1, callback: changeAttribute, cursor: false }); - $('#group_x') .dragInput({ min: null, max: null, step: 1, callback: changeAttribute, cursor: false }); - $('#group_y') .dragInput({ min: null, max: null, step: 1, callback: changeAttribute, cursor: false }); + $('#g_x') .dragInput({ min: null, max: null, step: 1, callback: changeAttribute, cursor: false }); + $('#g_y') .dragInput({ min: null, max: null, step: 1, callback: changeAttribute, cursor: false }); $('#image_x') .dragInput({ min: null, max: null, step: 1, callback: changeAttribute, cursor: false }); $('#text_y') .dragInput({ min: null, max: null, step: 1, callback: changeAttribute, cursor: false }); $('#text_x') .dragInput({ min: null, max: null, step: 1, callback: changeAttribute, cursor: false }); diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 5ba8b0d..bf69a2c 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -409,7 +409,6 @@ svgedit.select.init(curConfig, { // this object manages selectors for us var selectorManager = this.selectorManager = svgedit.select.getSelectorManager(); // this object manages selectors for us -var hoverManager = this.hoverManager = svgedit.select.getSelectorManager(); // Import from path.js svgedit.path.init({ @@ -560,6 +559,7 @@ var runExtensions = this.runExtensions = function(action, vars, returnArray) { return result; } + // Function: addExtension // Add an extension to the editor // @@ -575,8 +575,7 @@ this.addExtension = function(name, ext_func) { svgroot: svgroot, svgcontent: svgcontent, nonce: getCurrentDrawing().getNonce(), - selectorManager: selectorManager, - hoverManager: hoverManager + selectorManager: selectorManager })); } else { var ext = ext_func; @@ -2374,10 +2373,9 @@ var getMouseTarget = this.getMouseTarget = function(evt) { // but the action is not recorded until mousing up // - when we are in select mode, select the element, remember the position // and do nothing else - var mouseDown = mouseOver = function(evt) + var mouseDown = function(evt) { - if(canvas.spaceKey || evt.button === 1) return; - + if (evt.originalEvent.touches && evt.originalEvent.touches > 1) return; var right_click = evt.button === 2; root_sctm = svgcontent.getScreenCTM().inverse(); @@ -2734,8 +2732,8 @@ var getMouseTarget = this.getMouseTarget = function(evt) { // in this function we do not record any state changes yet (but we do update // any elements that are still being created, moved or resized on the canvas) - var mouseMove = function(evt) - { + var mouseMove = function(evt) { + if (evt.originalEvent.touches && evt.originalEvent.touches.length > 1) return; if (!started) return; if(evt.button === 1 || canvas.spaceKey) return; @@ -2769,9 +2767,9 @@ var getMouseTarget = this.getMouseTarget = function(evt) { dx = snapToGrid(dx); dy = snapToGrid(dy); } - - if(evt.shiftKey) { var xya = snapToAngle(start_x,start_y,x,y); x=xya.x; y=xya.y; } - //duplicate only once + + if(evt.shiftKey) { var xya = snapToAngle(start_x,start_y,x,y); x=xya.x; y=xya.y; } + if (dx != 0 || dy != 0) { var len = selectedElements.length; for (var i = 0; i < len; ++i) { @@ -2790,7 +2788,6 @@ var getMouseTarget = this.getMouseTarget = function(evt) { // Note that if Webkit and there's no ID for this // element, the dummy transform may have gotten lost. // This results in unexpected behaviour - xform.setTranslate(dx,dy); if(tlist.numberOfItems) { tlist.replaceItem(xform, 0); @@ -2798,27 +2795,34 @@ var getMouseTarget = this.getMouseTarget = function(evt) { tlist.appendItem(xform); } - // alt drag = create a clone and save the reference - if(evt.altKey) { - //clone doesn't exist yet - if (!canvas.addClone) { - canvas.addClone = canvas.cloneSelectedElements(0,0, true); - canvas.removeClone = function(){ - parent = canvas.addClone.parentNode - if (parent) { - parent.removeChild(canvas.addClone) - canvas.addClone = false; - } - } - window.addEventListener("keyup", canvas.removeClone) - } - } // update our internal bbox that we're tracking while dragging selectorManager.requestSelector(selected).resize(); } - + + //duplicate only once + // alt drag = create a clone and save the reference + if(evt.altKey) { + //clone doesn't exist yet + if (!canvas.addClone) { + canvas.addClone = canvas.cloneSelectedElements(0,0, xform); + canvas.removeClone = function(){ + parent = canvas.addClone.parentNode + if (parent) { + parent.removeChild(canvas.addClone) + canvas.addClone = false; + } + } + window.addEventListener("keyup", canvas.removeClone) + } + } + call("transition", selectedElements); } + + + + + } break; case "multiselect": @@ -3170,16 +3174,35 @@ var getMouseTarget = this.getMouseTarget = function(evt) { }; // mouseMove() - // mouseover mode + /* mouseover mode var mouseOver = function(evt) { - if (evt.button) return; - elem = evt.target; - var clone = elem.cloneNode(true); - clone.setAttribute("fill", "none"); - clone.setAttribute("stroke", "#09f") - clone.setAttribute("stroke-width", "1") - elem.selectorParentGroup.appendChild(clone) + + if(canvas.spaceKey || evt.button === 1 || current_mode != "select") return; + evt.stopPropagation(); + mouse_target = getMouseTarget(evt); + if (svghover.lastChild) svghover.removeChild(svghover.lastChild); + + if (mouse_target.id == "svgroot") return + switch (mouse_target.nodeName) { + case "polyline": + case "line": + case "path": + case "ellipse": + case "rect": + var clone = mouse_target.cloneNode(true); + clone.setAttribute("stroke", "#c00") + clone.setAttribute("stroke-width", "1") + clone.setAttribute("stroke-opacity", "1") + clone.setAttribute("shape-rendering", "crispEdges") + clone.setAttribute("fill", "none") + hover_group.appendChild(clone); + break; + + default: + break; + } } + */ // - in create mode, the element's opacity is set properly, we create an InsertElementCommand // and store it on the Undo stack @@ -3839,6 +3862,7 @@ var textActions = canvas.textActions = function() { // TODO: Find way to block native selection }, mouseMove: function(mouse_x, mouse_y) { + if (evt.originalEvent.touches && evt.originalEvent.touches.length > 1) return; var pt = screenToPt(mouse_x, mouse_y); setEndSelectionFromPoint(pt.x, pt.y); }, @@ -4348,6 +4372,7 @@ var pathActions = canvas.pathActions = function() { } }, mouseMove: function(evt, mouse_x, mouse_y) { + if (evt.originalEvent.touches && evt.originalEvent.touches.length > 1) return; hasMoved = true; if(current_mode === "path") { if(!drawn_path) return; @@ -7604,21 +7629,42 @@ this.setLinkURL = function(val) { }; +// Function selectedAreSame +// Checks if all the selected Elements are the same type +// +// Parameters: +// None + +this.elementsAreSame = function(elements) { + if (!elements.length || elements[0] == null) return null + else { + var isSameElement = function(el) { + if (el && selectedElements[0]) + return (el.nodeName == selectedElements[0].nodeName); + else return null; + } + return selectedElements.every(isSameElement); + } +} + + // Function: setRectRadius // Sets the rx & ry values to the selected rect element to change its corner radius // // Parameters: // val - The new radius this.setRectRadius = function(val) { - var selected = selectedElements[0]; - if (selected != null && selected.tagName == "rect") { + if (canvas.elementsAreSame(selectedElements) && selectedElements[0].tagName == "rect") { + var assign_rr = function(selected){ var r = selected.getAttribute("rx"); - if (r != val) { - selected.setAttribute("rx", val); - selected.setAttribute("ry", val); - addCommandToHistory(new ChangeElementCommand(selected, {"rx":r, "ry":r}, "Radius")); - call("changed", [selected]); - } + if (r != val) { + selected.setAttribute("rx", val); + selected.setAttribute("ry", val); + addCommandToHistory(new ChangeElementCommand(selected, {"rx":r, "ry":r}, "Radius")); + call("changed", [selected]); + } + } + selectedElements.forEach(assign_rr) } }; @@ -8423,7 +8469,6 @@ this.moveToBottomSelectedElement = function() { this.moveUpDownSelected = function(dir) { var selected = selectedElements[0]; if (!selected) return; - curBBoxes = []; var closest, found_cur; // jQuery sorts this list @@ -8545,7 +8590,7 @@ this.cloneSelectedElements = function(x,y, drag) { // clone each element and replace it within copiedElements var elem = copiedElements[i] var clone = copyElem(copiedElements[i]); - if (drag) clone.removeAttribute("transform"); + if (drag) clone.setAttribute("transform", ""); (current_group || getCurrentDrawing().getCurrentLayer()).appendChild(clone); batchCmd.addSubCommand(new InsertElementCommand(clone)); } diff --git a/editor/svgedit.compiled.css b/editor/svgedit.compiled.css index 33d6fb0..1d1cb4f 100644 --- a/editor/svgedit.compiled.css +++ b/editor/svgedit.compiled.css @@ -33,7 +33,6 @@ table#svg_editor .jPicker{width:545px;z-index:20} #svg_editor .jPicker .Preview .Current{border-top-width:0;cursor:pointer} #svg_editor .jPicker .Button{text-align:center;width:115px} #svg_editor .jPicker .Button input{width:100px} -#svg_editor .jPicker .Button .Ok{margin:0 0 5px 0} #svg_editor .jPicker td.Radio{margin:0;padding:0;width:31px} #svg_editor .jPicker td.Radio input{margin:0 5px 0 0;padding:0} #svg_editor .jPicker td.Text{font-size:12px!important;height:22px;margin:0;padding:0;text-align:left;width:70px} @@ -51,53 +50,53 @@ table#svg_editor .jPicker{width:545px;z-index:20} #svg_editor .jPicker .actions .Ok{position:absolute;top:0;right:0} #svg_editor .jPicker .actions .Cancel{position:absolute;top:0;left:0} #svg_editor .jPicker .color_preview{width:62px;margin:0 auto} -#svg_editor h2.jGraduate_Title{display:none} -#svg_editor .jGraduate_Picker{position:absolute;padding:20px} -#svg_editor .jGraduate_tabs li{display:inline-block;padding:5px 10px;margin-right:5px;cursor:pointer} -#svg_editor li.jGraduate_tab_current{background:#fff;border-radius:3px 3px 0 0} -#svg_editor .jGraduate_colPick{display:none} -#svg_editor .jGraduate_gradPick{display:none;overflow:visible} -#svg_editor .jGraduate_tabs{position:relative;background-color:#ddd;padding:10px 10px 0 10px;margin:-20px -20px 20px -20px;border-radius:3px 3px 0 0} -#svg_editor div.jGraduate_Swatch{float:left;margin:0 15px 0 0} -#svg_editor div.jGraduate_GradContainer{border:solid #000 1px;background-image:url(../images/map-opacity.png);background-position:0 0;height:256px;width:256px;position:relative} -#svg_editor div.jGraduate_GradContainer div.grad_coord{background:rgba(0,0,0,0.8);border:2px solid white;border-radius:15px;-moz-border-radius:5px;width:14px;height:14px;position:absolute;margin:-7px -7px;top:0;left:0;text-align:center;font-size:8px;line-height:14px;color:white;text-decoration:none;cursor:pointer;-moz-user-select:none;-webkit-user-select:none} -#svg_editor .jGraduate_AlphaArrows{position:absolute;margin-top:-10px;margin-left:250.5px} -#svg_editor div.jGraduate_Opacity{border:2px inset #eee;margin-top:14px;background-color:black;background-image:url(../images/Maps.png);background-position:0 -2816px;height:20px;cursor:ew-resize} -#svg_editor div.jGraduate_StopSlider{margin:-10px 0 0 -10px;width:276px;overflow:visible;background:white;height:45px;cursor:pointer} -#svg_editor div.jGraduate_StopSection{width:120px;float:left} -#svg_editor div.jGraduate_StopSection.jGraduate_SpreadMethod{display:none} -#svg_editor input.jGraduate_Ok,input.jGraduate_Cancel{display:block;width:100px} -#svg_editor input.jGraduate_Ok{margin:0 0 5px 0} -#svg_editor .colorBox{float:left;height:16px;width:16px;border:1px solid #808080;cursor:pointer;margin:4px 4px 4px 30px} -#svg_editor .colorBox+label{float:left;margin-top:7px} -#svg_editor label.jGraduate_Form_Heading{color:#333;padding:2px;font-weight:bold;font-size:13px} -#svg_editor div.jGraduate_Form_Section{-moz-border-radius:5px;-webkit-border-radius:5px;padding:15px 5px 5px 5px;margin:5px 2px;width:100px;text-align:center;overflow:auto;background:#eee} -#svg_editor div.jGraduate_Form label{padding:0 2px;color:#333} -#svg_editor div.jGraduate_StopSection input[type=text],#svg_editor div.jGraduate_Slider input[type=text]{width:33px;color:#333} -#svg_editor div.jGraduate_LightBox{position:fixed;top:0;left:0;right:0;bottom:0;background-color:#000;opacity:.5;display:none} -#svg_editor div.jGraduate_stopPicker{position:absolute;display:none;background:white;padding:20px;border-radius:3px;width:530px;height:300px;box-shadow:0 5px 25px black} -#svg_editor .jGraduate_gradPick{width:526px} -#svg_editor .jGraduate_gradPick div.jGraduate_Slider{line-height:160%} -#svg_editor .jGraduate_gradPick div.jGraduate_Slider label:last-child{position:absolute;right:10px;top:0;color:#999;font-weight:bold} -#svg_editor .jGraduate_gradPick div.jGraduate_Slider label:last-child input{margin:0 3px 0 0;color:#333} -#svg_editor .jGraduate_gradPick .jGraduate_Form{float:left;width:270px;position:absolute;left:284px;width:266px;height:200px;top:195px;margin:-3px 3px 0 10px;line-height:200%} -#svg_editor .jGraduate_gradPick .jGraduate_Form label,#svg_editor .jGraduate_gradPick .jGraduate_Form input{width:auto;float:left} -#svg_editor .jGraduate_gradPick .jGraduate_Form.jGraduate_rg_field label,#svg_editor .jGraduate_gradPick .jGraduate_Form.jGraduate_rg_field input{width:auto;float:left;font-size:11px} -#svg_editor .jGraduate_gradPick .jGraduate_Form.jGraduate_rg_field #color_picker_jGraduate_match_ctr{float:none} -#svg_editor .jGraduate_gradPick .jGraduate_Form label{clear:left} -#svg_editor .jGraduate_gradPick .jGraduate_Points{position:static;float:left;margin:0;width:auto} -#svg_editor .jGraduate_Colorblocks{display:table;border-spacing:0 5px} -#svg_editor .jGraduate_colorblock{display:table-row} -#svg_editor .jGraduate_Colorblocks .jGraduate_colorblock>*{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:0;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} +h2.jGraduate_Title{display:none} +.jGraduate_Picker{position:absolute;padding:20px} +.jGraduate_tabs li{display:inline-block;padding:5px 10px;margin-right:5px;cursor:pointer} +li.jGraduate_tab_current{background:#fff;border-radius:3px 3px 0 0} +.jGraduate_colPick{display:none} +.jGraduate_gradPick{display:none;overflow:visible} +.jGraduate_tabs{position:relative;background-color:#ddd;padding:10px 10px 0 10px;margin:-20px -20px 20px -20px;border-radius:3px 3px 0 0} +div.jGraduate_Swatch{float:left;margin:0 15px 0 0} +div.jGraduate_GradContainer{border:solid #000 1px;background-image:url(../images/map-opacity.png);background-position:0 0;height:256px;width:256px;position:relative} +div.jGraduate_GradContainer div.grad_coord{background:rgba(0,0,0,0.8);border:2px solid white;border-radius:15px;-moz-border-radius:5px;width:14px;height:14px;position:absolute;margin:-7px -7px;top:0;left:0;text-align:center;font-size:8px;line-height:14px;color:white;text-decoration:none;cursor:pointer;-moz-user-select:none;-webkit-user-select:none} +.jGraduate_AlphaArrows{position:absolute;margin-top:-10px;margin-left:250.5px} +div.jGraduate_Opacity{border:2px inset #eee;margin-top:14px;background-color:black;background-image:url(../images/Maps.png);background-position:0 -2816px;height:20px;cursor:ew-resize} +div.jGraduate_StopSlider{margin:-10px 0 0 -10px;width:276px;overflow:visible;background:white;height:45px;cursor:pointer} +div.jGraduate_StopSection{width:120px;float:left} +div.jGraduate_StopSection.jGraduate_SpreadMethod{display:none} +input.jGraduate_Ok,input.jGraduate_Cancel{display:block;width:100px} +input.jGraduate_Ok{margin:0 0 5px 0} +.colorBox{float:left;height:16px;width:16px;border:1px solid #808080;cursor:pointer;margin:4px 4px 4px 30px} +.colorBox+label{float:left;margin-top:7px} +label.jGraduate_Form_Heading{color:#333;padding:2px;font-weight:bold;font-size:13px} +div.jGraduate_Form_Section{-moz-border-radius:5px;-webkit-border-radius:5px;padding:15px 5px 5px 5px;margin:5px 2px;width:100px;text-align:center;overflow:auto;background:#eee} +div.jGraduate_Form label{padding:0 2px;color:#333} +div.jGraduate_StopSection input[type=text],div.jGraduate_Slider input[type=text]{width:33px;color:#333} +div.jGraduate_LightBox{position:fixed;top:0;left:0;right:0;bottom:0;background-color:#000;opacity:.5;display:none} +div.jGraduate_stopPicker{position:absolute;display:none;background:white;padding:20px;border-radius:3px;width:530px;height:300px;box-shadow:0 5px 25px black} +.jGraduate_gradPick{width:526px} +.jGraduate_gradPick div.jGraduate_Slider{line-height:160%} +.jGraduate_gradPick div.jGraduate_Slider label:last-child{position:absolute;right:10px;top:0;color:#999;font-weight:bold} +.jGraduate_gradPick div.jGraduate_Slider label:last-child input{margin:0 3px 0 0;color:#333} +.jGraduate_gradPick .jGraduate_Form{float:left;width:270px;position:absolute;left:284px;width:266px;height:200px;top:195px;margin:-3px 3px 0 10px;line-height:200%} +.jGraduate_gradPick .jGraduate_Form label,.jGraduate_gradPick .jGraduate_Form input{width:auto;float:left} +.jGraduate_gradPick .jGraduate_Form.jGraduate_rg_field label,.jGraduate_gradPick .jGraduate_Form.jGraduate_rg_field input{width:auto;float:left;font-size:11px} +.jGraduate_gradPick .jGraduate_Form.jGraduate_rg_field #color_picker_jGraduate_match_ctr{float:none} +.jGraduate_gradPick .jGraduate_Form label{clear:left} +.jGraduate_gradPick .jGraduate_Points{position:static;float:left;margin:0;width:auto} +.jGraduate_Colorblocks{display:table;border-spacing:0 5px} +.jGraduate_colorblock{display:table-row} +.jGraduate_Colorblocks .jGraduate_colorblock>*{display:table-cell;vertical-align:middle;margin:0;float:none} +.jGraduate_gradPick .jGraduate_Form_Section{padding-top:9px} +.jGraduate_Slider{text-align:center;float:left;width:100%;position:relative;margin:5px 0} +.jGraduate_Slider .jGraduate_Form_Section{border:0;width:250px;padding:0 2px;overflow:visible} +.jGraduate_Slider label.prelabel{width:40px;text-align:left} +.jGraduate_SliderBar{width:140px;float:left;margin:0 5px;border:1px solid #BBB;height:20px;position:relative} +div.jGraduate_Slider input{margin-top:5px} +div.jGraduate_Slider img{top:0;left:0;position:absolute;cursor:ew-resize} +.jPicker .Button .Ok,.jGraduate_Picker .jGraduate_OkCancel .jGraduate_Ok{-webkit-appearance:none;margin:0;position:absolute;bottom:5px;right:5px} +.jPicker .Button .Cancel,.jGraduate_Picker .jGraduate_OkCancel .jGraduate_Cancel{margin:0;position:absolute;bottom:5px;left:5px} 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} @@ -107,26 +106,25 @@ html,body{overflow:hidden;width:100%;height:100%} ::-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:0;border-bottom:1px solid #808080} -#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} -.touch #svg_editor .menu_title{padding:7px 17px;height:26px;line-height:26px} -#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)} -.touch #svg_editor .menu_list{top:38px} -#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:0;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:0;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} +#svgroot{-moz-user-select:none;-webkit-user-select:none;position:absolute;top:0;left:0} +#menu_bar{margin:0 0 0 50px} +#menu_bar.active .menu.open .menu_list{display:block} +.menu{position:relative;z-index:5;color:#333;display:inline-block} +.menu_title{cursor:pointer;display:inline-block;padding:7px 10px;z-index:10;color:#fff;position:relative;height:16px;vertical-align:top} +.touch .menu_title{padding:7px 17px;height:26px;line-height:26px} +.menu .menu_title:hover{background:rgba(255,255,255,0.1)} +.menu_list .separator{margin:5px 0;border-top:solid #ddd 1px} +.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)} +.touch .menu_list{top:38px} +#menu_bar.active .menu.open .menu_title{background:white;color:#333} +.menu_list .menu_item{position:relative;overflow:hidden;line-height:22px;padding:5px 69px 5px 25px;cursor:default;color:#333} +.menu_list .menu_item.tool_button{background:transparent;border:0;margin:0;padding:5px 55px 5px 25px;height:auto;width:auto} +.menu_list .menu_item.push_button_pressed:before{content:'✔';position:absolute;display:block;left:7px;top:3px;width:20px;height:20px} +.menu_list .menu_item:hover,.menu_list .menu_item.push_button_pressed:hover{background:rgba(0,0,0,0.1);color:#000} +.menu_list .menu_item.disabled:hover,.menu_list .menu_item.push_button_pressed.disabled:hover{background:transparent;color:#333} +.menu_list .menu_item.push_button_pressed{background:transparent;border:0;width:auto;height:auto;margin:0} +.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%} +#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:175px;border-top:solid #444 1px;border-right:solid #444 1px} @@ -139,12 +137,12 @@ html,body{overflow:hidden;width:100%;height:100%} #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} -.touch #svg_editor div#palette_holder{height:40px;margin-top:0} -#svg_editor div#palette_holder #palette .palette_item:first-child{background:#fff} -#svg_editor div#palette_holder #palette .palette_item{cursor:pointer} -#svg_editor #color_tools{position:relative;width:48px;height:48px;margin:6px 6px 0 6px} -.touch #svg_editor #color_tools{width:auto;height:auto} +div#palette_holder{display:block;overflow:hidden;height:31px;margin-top:10px;position:relative;z-index:2;float:left} +.touch div#palette_holder{height:40px;margin-top:0} +div#palette_holder #palette .palette_item:first-child{background:#fff} +div#palette_holder #palette .palette_item{cursor:pointer} +#color_tools{position:relative;width:48px;height:48px;margin:6px 6px 0 6px} +.touch #color_tools{width:auto;height:auto} #tool_fill{position:absolute;top:0;left:0;z-index:1} .touch #tool_fill{position:static;width:36px;height:36px;margin-bottom:10px} #tool_fill.active,#tool_stroke.active{z-index:2} @@ -154,87 +152,84 @@ html,body{overflow:hidden;width:100%;height:100%} .touch #tool_fill,.touch #tool_stroke,.touch #tool_canvas{position:relative;top:0;left:0} #color_canvas_tools{float:left;cursor:pointer} #tool_fill .color_block{width:24px;height:24px;overflow:hidden;border:solid #ccc 1px} -.touch #svg_editor #tool_eyedropper{margin-top:6px} +.touch #tool_eyedropper{margin-top:6px} .touch #tool_fill .color_block{width:36px;height:36px} .touch #tool_fill .color_block svg{width:36px!important;height:36px!important} -.touch #svg_editor #tool_switch{display:none} -#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 #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} -.touch #svg_editor #color_tools #tool_fill .color_block>div{position:relative} -#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} -.touch #svg_editor #color_tools #tool_fill .color_block #fill_bg,.touch #svg_editor #color_tools #tool_stroke .color_block #stroke_bg{width:36px;height:36px;right:auto;bottom:auto} +.touch #tool_switch{display:none} +#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} +#path_node_panel .tool_button img{position:absolute;left:5px;top:3px} +#color_tools #tool_fill .color_block:hover,#color_tools #tool_stroke .color_block:hover{border-color:#fff} +#color_tools #tool_fill .color_block>div{position:absolute;top:0;left:0} +.touch #color_tools #tool_fill .color_block>div{position:relative} +#color_tools #tool_fill .color_block #fill_bg,#color_tools #tool_stroke .color_block #stroke_bg{position:absolute;top:1px;left:1px;bottom:1px;right:1px;background:#fff} +.touch #color_tools #tool_fill .color_block #fill_bg,.touch #color_tools #tool_stroke .color_block #stroke_bg{width:36px;height:36px;right:auto;bottom:auto} .touch #tool_stroke{position:relative;top:0;left:0;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} .touch #stroke_color:after{height:14px;left:10px;position:absolute;top:10px;width:14px} -#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} -.touch #svg_editor #color_tools #tool_stroke .color_block{width:36px;height:36px} -#svg_editor #color_tools #tool_stroke .color_block>div{position:absolute;bottom:0;right:0} -.touch #svg_editor #color_tools #tool_stroke .color_block>div{position:relative} -#svg_editor #color_tools .icon_label{padding:0;width:24px;height:100%;cursor:pointer;position:absolute} -#svg_editor #zoomLabel{cursor:pointer;margin-right:5px} -#svg_editor #linkLabel>svg{height:20px;padding-top:4px} -#svg_editor div#palette{float:left;width:810px;height:16px} -#svg_editor div#workarea{display:inline-table-cell;position:absolute;top:30px;left:50px;bottom:40px;right:175px;background-color:#444;overflow:auto;text-align:center} -.touch #svg_editor div#workarea{top:40px} -#svg_editor div.palette_item{height:16px;width:16px;float:left} -.touch #svg_editor div.palette_item{height:30px;border-top:solid #2f2f2c 5px;border-bottom:solid #2f2f2c 5px;width:30px;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} +#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} +#color_tools #cross:hover{opacity:1} +#color_tools #tool_stroke:hover #stroke_color:after{background:#fff} +#color_tools #tool_stroke .color_block{width:24px;height:24px;overflow:hidden;border:solid #ccc 1px} +.touch #color_tools #tool_stroke .color_block{width:36px;height:36px} +#color_tools #tool_stroke .color_block>div{position:absolute;bottom:0;right:0} +.touch #color_tools #tool_stroke .color_block>div{position:relative} +#color_tools .icon_label{padding:0;width:24px;height:100%;cursor:pointer;position:absolute} +#linkLabel>svg{height:20px;padding-top:4px} +div#palette{float:left;width:810px;height:16px} +div#workarea{display:inline-table-cell;position:absolute;top:30px;left:50px;bottom:40px;right:175px;background-color:#444;overflow:auto;text-align:center} +.touch div#workarea{top:40px} +div.palette_item{height:16px;width:16px;float:left} +.touch div.palette_item{height:30px;border-top:solid #2f2f2c 5px;border-bottom:solid #2f2f2c 5px;width:19px;float:left} +.menu .menu_list{display:none;position:absolute} +.tool_button:hover,.push_button:hover,.buttonup:hover,.buttondown,.tool_button_current,.push_button_pressed{background-color:#fff} +.tool_button.disabled,.tool_button.disabled:hover{opacity:.3;background-color:#aaa} +#tools_left .tool_button{background:#2f2f2c;position:relative} +#tools_left .tool_button.loaded{background:#ccc} +#tools_left .tool_button.loaded:hover{background:#fff} +#tools_left .tool_button:after,#tools_left .tool_button_current:after{position:absolute;content:'';border:solid #2f2f2c 1px;top:0;left:0;width:27px;height:27px;z-index:0} #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:160px;right:0;top:20px;border-bottom:0;overflow:visible;padding:0 0 0 10px} -.touch #svg_editor #tools_top{top:40px} -#svg_editor label{display:block;color:#999} +#tools_left .tool_button_current{background-color:#0cf} +#main_icon span{position:absolute;width:100%;height:100%;display:block;z-index:2} +#tools_top{position:absolute;width:160px;right:0;top:20px;border-bottom:0;overflow:visible;padding:0 0 0 10px} +.touch #tools_top{top:30px} +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 #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 #color_picker input[type=text],#color_picker #svg_editor input[type=number]{width:30px;background:#fff} -#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:0;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 #tools_left{position:absolute;border-right:0;width:50px;top:30px;left:0;background:#2f2f2c;z-index:4} +#tools_top #marker_panel *{float:left} +#tools_top #marker_panel h4{float:none} +#tools_top #marker_panel .dropdown .icon_label{width:36px;height:20px;margin-top:2px;border:solid #3f3f3c 1px;text-align:center} +#font_family_dropdown-list{border-radius:3px;box-shadow:0 5px 10px #000} +#font_family_dropdown-list li{cursor:pointer} +#tools_top #marker_panel .dropdown button{margin-top:2px} +#tools_top #marker_panel #marker_panel_title{float:none;color:#fff;margin-bottom:3px} +#tools_top #marker_panel .dropdown .icon_label img{float:none} +#color_picker input[type=text],#color_picker input[type=number]{width:30px;background:#fff} +.dropdown_set input[type=text],.dropdown_set input[type=number]{width:50px} +input[type=text].wide,input[type=number].wide{width:110px} +input[type=text].tuco,input[type=number].tuco{width:150px} +input[type=submit],input[type=button],button{background:#4f80ff;color:#fff;border-radius:3px;padding:7px 17px;border:0;line-height:140%;font-size:14px;font-weight:bold;font-family:sans-serif} +input[type=submit]:hover,button:hover{box-shadow:inset 0 3px 10px rgba(255,255,255,0.1),inset 0 -3px 10px rgba(0,0,0,0.2)} +input[type=submit]:hover,button:hover{background:#2f84c1} +input[type=submit]:active,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} +#tools_left{position:absolute;border-right:0;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} +#multiselected_panel .selected_tool{vertical-align:12px} #cur_context_panel{position:absolute;top:47px;left:68px;line-height:22px;overflow:auto;border-bottom:0;border-right:0;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} +#cur_context_panel a{float:none;text-decoration:none;color:#fff} +#cur_context_panel a:hover{text-decoration:underline} +#tools_left .tool_button,#tools_left .tool_button_current{position:relative;z-index:11} +.flyout_arrow_horiz{position:absolute;bottom:-1px;right:0;z-index:10} .dropdown{position:relative;float:left} -#svg_editor .dropdown button{width:21px;height:22px;padding:0 3px 0 3px;border:0;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{width:21px;height:22px;padding:0 3px 0 3px;border:0;background-color:#555;border-radius:0 2px 2px 0;margin-left:-1px;position:relative} +.dropdown button:hover{background-color:#666} +.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} @@ -248,46 +243,51 @@ span.zoom_tool img{vertical-align:top} .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_button,.push_button,.tool_button_current,.push_button_pressed{height:27px;width:27px;border:solid #2f2f2c 8px;border-left-width:13px;margin:0;background-color:#ddd;cursor:pointer} +#main_menu li#tool_open,#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} +.disabled{opacity:.5;cursor:default} +.width_label{padding-right:5px} +#tool_bold,#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} +#tool_bold:hover,#tool_italic:hover{color:#fff} #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} +#tool_bold span,#tool_italic span{position:absolute;width:100%;height:100%;top:0;left:0;background:#ccc;opacity:0} +#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} +#color_picker{position:absolute;display:none;background:#fff;height:350px;border-radius:3px;z-index:5;box-shadow:0 5px 10px #000;width:530px} +.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)} +.tools_flyout_v{position:absolute;display:none;cursor:pointer;width:30px} +.tools_flyout .tool_button{float:left;background-color:#fff;height:24px;width:24px} +#tools_bottom{position:absolute;left:50px;right:0;bottom:0;height:40px;overflow:visible} +#tools_bottom_1{width:115px;float:left} +#tools_bottom_2{position:relative;float:left;margin-top:5px} #tools_bottom input[type=text]{width:3.2em} -#svg_editor #tools_top h4{color:#fff;font-weight:normal;margin:0;padding:10px 0 5px 0} +#tools_top h4{color:#fff;font-weight:normal;margin:0;padding:10px 0 5px 0} #tools_top .dropdown .icon_label{border:1px solid transparent;height:auto} -#svg_editor .draginput_cell{float:left;height:26px;border:solid #3f3f3c 10px;outline:solid #2f2f2c 1px;background-color:#ddd;cursor:pointer} -#svg_editor .align_buttons .draginput_cell:nth-child(1){border-radius:3px 0 0 0} -#svg_editor .align_buttons .draginput_cell:nth-child(3){border-radius:0 3px 0 0} -#svg_editor .align_buttons .draginput_cell:nth-child(4){border-radius:0 0 0 3px} -#svg_editor .align_buttons .draginput_cell:nth-child(6){border-radius:0 0 3px 0} +#tools_top.multiselected #align_tools{display:none} +#tools_top.multiselected #multiselected_panel{display:block!important} +#tools_top.multiselected #multiselected_panel .hidable{display:none} +.draginput_cell{float:left;height:26px;height:26px;border:solid #3f3f3c 10px;outline:solid #2f2f2c 1px;background:#ddd;cursor:pointer;position:relative} +.draginput_cell:hover{background:#fff} +.draginput_cell:after{content:'';position:absolute;top:0;left:0;border:solid #3f3f3c 1px;height:26px;width:26px;z-index:0} +.align_buttons .draginput_cell:nth-child(1){border-radius:3px 0 0 0} +.align_buttons .draginput_cell:nth-child(3){border-radius:0 3px 0 0} +.align_buttons .draginput_cell:nth-child(4){border-radius:0 0 0 3px} +.align_buttons .draginput_cell:nth-child(6){border-radius:0 0 3px 0} .align_buttons .push_button{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:0;background:transparent} -#svg_editor #option_lists .tool_button:hover{background:#ddd} -#svg_editor #option_lists ul li.current{background-color:#f4e284} +#option_lists .tool_button,#option_lists .push_button,#option_lists .tool_button_current,#option_lists .push_button_pressed{border:0;background:transparent} +#option_lists .tool_button:hover{background:#ddd} +#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 #copyright{text-align:right;padding-right:.3em} +ul li.current{background-color:#f4e284} +#option_lists ul li{margin:0;border-radius:0;-moz-border-radius:0;-webkit-border-radius:0} +#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} @@ -297,7 +297,7 @@ span.zoom_tool img{vertical-align:top} #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_editor button.cancel,#svg_editor input.Cancel,#svg_editor input.cancel,#svg_editor input.jGraduate_Cancel,button.cancel{-webkit-appearance:none;background-color:#999;box-shadow:0 0 1px rgba(0,0,0,0.5);margin:0} +button.cancel,input.Cancel,input.cancel,input.jGraduate_Cancel,button.cancel{-webkit-appearance:none;background-color:#999;box-shadow:0 0 1px rgba(0,0,0,0.5);margin:0} #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} @@ -334,7 +334,7 @@ span.zoom_tool img{vertical-align:top} .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:0} #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} +.tools_flyout .tool_button,.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} @@ -365,34 +365,43 @@ span.zoom_tool img{vertical-align:top} .clearfix:before,.clearfix:after{content:"";display:table} .clearfix:after{clear:both} .clearfix{*zoom:1} -#svg_editor #group_title{display:none} +#group_title{display:none} #base_unit_container{display:none;position:absolute;z-index:20} -#svg_editor .draginput{background:#3f3f3c;border-radius:3px;-webkit-font-smoothing:antialiased;width:70px;height:70px;display:block;position:relative;float:left;margin:0 5px 5px 0} -#svg_editor .draginput .caret{border:solid transparent 5px;border-top-color:#999;position:absolute;width:0;height:0;right:5px;margin-top:-2px;top:50%} -#svg_editor .draginput label{margin:28px 10px 0 5px;font-size:14px;color:white;font-weight:bold;font-family:sans-serif} -#svg_editor .draginput label#resolution_label,#svg_editor .draginput label#seg_type_label{font:bold 12px/110% sans-serif;position:absolute;left:auto;right:10px;z-index:0;text-align:right} -#svg_editor .draginput label#seg_type_label{margin-top:40px} -#svg_editor .draginput label#seg_type_label .caret{top:66%} -#svg_editor .draginput label#resolution_label .pull{position:relative;left:-15px} -#svg_editor .draginput label#resolution_label span{right:-13px;left:auto;font-size:16px;top:2px;font-weight:bold;color:white} -.touch #svg_editor .draginput.active:after{content:attr(data-value);display:block;position:absolute;background:#fff;font-size:16px;top:0;width:30px;left:-50px;padding:0 5px;color:#333;z-index:10;font-family:sans-serif;font-weight:bold;text-align:right;padding-right:10px;height:20px;line-height:20px;letter-spacing:-1px} -.touch #svg_editor .draginput.active:before{content:'';height:0;width:0;position:absolute;top:5px;left:-5px;border:solid transparent 5px;border-left-color:#fff} -#svg_editor .draginput input{border:0;background:transparent;font:24px/normal sans-serif;text-align:center;color:#4f80ff;padding:30px 0 16px;width:100%;height:24px;position:relative;z-index:2;cursor:url(images/drag.png),move;cursor:-webkit-drag;cursor:-moz-drag} -#svg_editor .draginput input:active{cursor:url(images/dragging.png),move;cursor:-webkit-dragging;cursor:-moz-dragging} -#svg_editor .draginput span{font:11px/130% sans-serif;color:#ccc;display:block;position:absolute;top:5px;left:5px;text-align:left} -#svg_editor .draginput.error{background:#900} -#svg_editor .draginput.error input{color:#fff} -#svg_editor .draginput.stroke_tool{text-align:center} -#svg_editor .draginput select{-webkit-appearance:none;opacity:0;display:block;position:absolute;height:100%;width:100%;margin:0;z-index:1} +.draginput{background:#3f3f3c;border-radius:3px;-webkit-font-smoothing:antialiased;width:70px;height:70px;display:block;position:relative;float:left;margin:0 5px 5px 0} +.draginput .caret{border:solid transparent 5px;border-top-color:#999;position:absolute;width:0;height:0;right:5px;margin-top:-2px;top:50%} +.draginput label{margin:28px 10px 0 5px;font-size:14px;color:white;font-weight:bold;font-family:sans-serif} +.draginput label#resolution_label,.draginput label#seg_type_label{font:bold 12px/110% sans-serif;position:absolute;left:auto;right:10px;z-index:0;text-align:right} +.draginput label#seg_type_label{margin-top:40px} +.draginput label#seg_type_label .caret{top:66%} +.draginput label#resolution_label .pull{position:relative;left:-15px} +.draginput label#resolution_label span{right:-13px;left:auto;font-size:16px;top:2px;font-weight:bold;color:white} +.touch .draginput.active:after{content:attr(data-value);display:block;position:absolute;background:#fff;font-size:16px;top:0;width:30px;left:-50px;padding:0 5px;color:#333;z-index:10;font-family:sans-serif;font-weight:bold;text-align:right;padding-right:10px;height:20px;line-height:20px;letter-spacing:-1px} +.touch .draginput.active:before{content:'';height:0;width:0;position:absolute;top:5px;left:-5px;border:solid transparent 5px;border-left-color:#fff} +.draginput input{border:0;background:transparent;font:24px/normal sans-serif;text-align:center;color:#4f80ff;padding:30px 0 16px;width:100%;height:24px;position:relative;z-index:2;cursor:url(images/drag.png),move;cursor:-webkit-drag;cursor:-moz-drag} +.draginput input:active{cursor:url(images/dragging.png),move;cursor:-webkit-dragging;cursor:-moz-dragging} +.draginput span{font:11px/130% sans-serif;color:#ccc;display:block;position:absolute;top:5px;left:5px;text-align:left} +.draginput.error{background:#900} +.draginput.error input{color:#fff} +.draginput.stroke_tool{text-align:center} +.draginput select{-webkit-appearance:none;opacity:0;display:block;position:absolute;height:100%;width:100%;margin:0;z-index:1} .draginput_cursor{position:absolute;top:50%;width:100%;border-top:solid rgba(50,100,200,0.25) 3px;margin-top:-2px;z-index:0} -#svg_editor .draginput input[readonly=readonly]{-webkit-appearance:none;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} +.draginput input[readonly=readonly]{-webkit-appearance:none;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} +.draginput input:focus{background:#4f80ff;color:#fff;outline:0;box-shadow:0 0 5px 2px #4f80ff} +.draginput input:focus+span{z-index:10;color:#fff} +#zoom_label{height:20px;background:transparent;cursor:default!important;width:auto;padding:0 10px;margin:0} +#zoom_panel{padding:9px 0;right:175px;position:absolute} +#zoom_label img{width:16px;height:16px} +#zoomLabel{width:16px;height:16px;cursor:pointer;background:#ccc} +#zoomLabel:after{content:'';position:absolute;border-left:solid #2f2f2c 1px;left:0;height:16px} +#zoom_label input{color:#ccc;font-size:13px;height:auto;width:auto;padding:0;cursor:default;position:static} +#zoom_label span{top:0;left:0} body.dragging *{cursor:url(images/dragging.png),move;cursor:-webkit-drag;cursor:-moz-drag} body.drag *{cursor:url(images/dragging.png),move;cursor:-webkit-dragging;cursor:-moz-dragging} -#svg_editor input[readonly=readonly]:focus{box-shadow:none} -#color_canvas_tools{background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAAA3NCSVQICAjb4U/gAAAABlBMVEXu7u7///8o06qaAAAACXBIWXMAAAsSAAALEgHS3X78AAAAFXRFWHRDcmVhdGlvbiBUaW1lADcvMjIvMTL7FNdCAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M1cbXjNgAAABFJREFUCJljYP7AgIb+MKAhAM8/C5vWL6zSAAAAAElFTkSuQmCC) top left repeat;width:60px;height:40px;margin:23px 5px 5px 5px;position:relative} -#color_canvas_tools svg{display:block} -#tool_angle_indicator{width:50px;height:50px;border-radius:50px;border:solid rgba(50,100,200,0.25) 3px;position:absolute;bottom:2px;left:7px} -#tool_angle_indicator_cursor{width:4px;height:25px;border-top:solid #4f80ff 3px;position:absolute;margin:-3px 0 0 25px;-webkit-transform-origin:50% 0;-moz-transform-origin:50% 0;-o-transform-origin:50% 0;-ms-transform-origin:50% 0;transform-origin:50% 0} +input[readonly=readonly]:focus{box-shadow:none} +#color_canvas_tools{background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAAA3NCSVQICAjb4U/gAAAABlBMVEXu7u7///8o06qaAAAACXBIWXMAAAsSAAALEgHS3X78AAAAFXRFWHRDcmVhdGlvbiBUaW1lADcvMjIvMTL7FNdCAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M1cbXjNgAAABFJREFUCJljYP7AgIb+MKAhAM8/C5vWL6zSAAAAAElFTkSuQmCC) top left repeat;width:60px;height:40px;margin:23px 5px 5px 5px;position:relative;overflow:hidden} +#color_canvas_tools{display:block} +#tool_angle_indicator{width:50px;height:50px;border-radius:50px;background:rgba(255,255,255,0.05);position:absolute;bottom:2px;left:10px} +#tool_angle_indicator_cursor{width:4px;height:25px;border-top:solid #4f80ff 3px;position:absolute;margin:0 0 0 23px;-webkit-transform-origin:50% 0;-moz-transform-origin:50% 0;-o-transform-origin:50% 0;-ms-transform-origin:50% 0;transform-origin:50% 0} INPUT.spin-button{background:transparent url('spinner.svg') right top no-repeat;background-size:17px 54px} INPUT.spin-button.up{cursor:pointer;background-position:100% -20px} INPUT.spin-button.down{cursor:pointer;background-position:100% -40px} \ No newline at end of file diff --git a/editor/svgedit.compiled.js b/editor/svgedit.compiled.js index 2f94a5e..74023bc 100644 --- a/editor/svgedit.compiled.js +++ b/editor/svgedit.compiled.js @@ -1,104 +1,104 @@ -(function(a){function o(g){if(typeof g.data==="string"){var c=g.handler,m=g.data.toLowerCase().split(" ");g.handler=function(s){if(!(this!==s.target&&(/textarea|select/i.test(s.target.nodeName)||s.target.type==="text"))){var b=s.type!=="keypress"&&a.hotkeys.specialKeys[s.which],f=String.fromCharCode(s.which).toLowerCase(),d="",l={};if(s.altKey&&b!=="alt")d+="alt+";if(s.ctrlKey&&b!=="ctrl")d+="ctrl+";if(s.metaKey&&!s.ctrlKey&&b!=="meta")d+="meta+";if(s.shiftKey&&b!=="shift")d+="shift+";if(b)l[d+b]= -true;else{l[d+f]=true;l[d+a.hotkeys.shiftNums[f]]=true;if(d==="shift+")l[a.hotkeys.shiftNums[f]]=true}b=0;for(f=m.length;b","/":"?","\\":"|"}};a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:o}})})(jQuery);(function(a,o){function g(ea){return typeof ea==="string"}function c(ea){var aa=d.call(arguments,1);return function(){return ea.apply(this,aa.concat(d.call(arguments)))}}function m(ea,aa,Z,la,sa){var na;if(la!==f){aa=Z.match(ea?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);Z=aa[3]||"";if(sa===2&&g(la))la=la.replace(ea?ba:R,"");else{na=q(aa[2]);la=g(la)?q[ea?W:Q](la):la;la=sa===2?la:sa===1?a.extend({},la,na):a.extend({},na,la);la=p(la);if(ea)la=la.replace(ta,l)}ea=aa[1]+(ea?"#":la||!aa[1]?"?":"")+ -la+Z}else ea=aa(Z!==f?Z:o[ha][X]);return ea}function s(ea,aa,Z){if(aa===f||typeof aa==="boolean"){Z=aa;aa=p[ea?W:Q]()}else aa=g(aa)?aa.replace(ea?ba:R,""):aa;return q(aa,Z)}function b(ea,aa,Z,la){if(!g(Z)&&typeof Z!=="object"){la=Z;Z=aa;aa=f}return this.each(function(){var sa=a(this),na=aa||V()[(this.nodeName||"").toLowerCase()]||"",oa=na&&sa.attr(na)||"";sa.attr(na,p[ea](oa,Z,la))})}var f,d=Array.prototype.slice,l=decodeURIComponent,p=a.param,B,q,M,U=a.bbq=a.bbq||{},P,I,V,ca=a.event.special,Q="querystring", -W="fragment",ha="location",X="href",R=/^.*\?|#.*$/g,ba=/^.*\#/,ta,ja={};p[Q]=c(m,0,function(ea){return ea.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")});p[W]=B=c(m,1,function(ea){return ea.replace(/^[^#]*#?(.*)$/,"$1")});B.noEscape=function(ea){ea=ea||"";ea=a.map(ea.split(""),encodeURIComponent);ta=RegExp(ea.join("|"),"g")};B.noEscape(",/");a.deparam=q=function(ea,aa){var Z={},la={"true":true,"false":false,"null":null};a.each(ea.replace(/\+/g," ").split("&"),function(sa,na){var oa=na.split("="),Ba= -l(oa[0]),Ga=Z,Ja=0,Ca=Ba.split("]["),La=Ca.length-1;if(/\[/.test(Ca[0])&&/\]$/.test(Ca[La])){Ca[La]=Ca[La].replace(/\]$/,"");Ca=Ca.shift().split("[").concat(Ca);La=Ca.length-1}else La=0;if(oa.length===2){oa=l(oa[1]);if(aa)oa=oa&&!isNaN(oa)?+oa:oa==="undefined"?f:la[oa]!==f?la[oa]:oa;if(La)for(;Ja<=La;Ja++){Ba=Ca[Ja]===""?Ga.length:Ca[Ja];Ga=Ga[Ba]=Ja').hide().insertAfter("body")[0].contentWindow; -I=function(){return c(U.document[b][f])};P=function(V,ca){if(V!==ca){var Q=U.document;Q.open().close();Q[b].hash="#"+V}};P(c())}}var q={},M,U,P,I;q.start=function(){if(!M){var V=c();P||B();(function ca(){var Q=c(),W=I(V);if(Q!==V){P(V=Q,W);a(o).trigger("hashchange")}else if(W!==V)o[b][f]=o[b][f].replace(/#.*/,"")+"#"+W;M=setTimeout(ca,a.hashchangeDelay)})()}};q.stop=function(){if(!U){M&&clearTimeout(M);M=0}};return q}()})(jQuery,this);(function(a){var o={},g;a.svgIcons=function(c,m){function s(ea,aa){if(ea!=="ajax"){if(V)return;var Z=(U=X[0].contentDocument)&&U.getElementById("svg_eof");if(!Z&&!(aa&&Z)){ca++;if(ca<50)setTimeout(s,20);else{f();V=true}return}V=true}M=a(U.firstChild).children();if(m.no_img)setTimeout(function(){I||b()},500);else{Z=ha+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNzUiIGhlaWdodD0iMjc1Ij48L3N2Zz4%3D";P=a(new Image).attr({src:Z,width:0,height:0}).appendTo("body").load(function(){b(true)}).error(function(){b()})}} -function b(ea,aa){if(!I){if(m.no_img)ea=false;if(ea){var Z=a(document.createElement("div"));Z.hide().appendTo("body")}if(aa){var la=m.fallback_path?m.fallback_path:"";a.each(aa,function(La,Na){a("#"+La);var Ha=a(new Image).attr({"class":"svg_icon",src:la+Na,width:B,height:q,alt:"icon"});ja(Ha,La)})}else for(var sa=M.length,na=0;na0&&!ea)va=g(va,Ha,true);ta(a(this),va,Na)})});if(!aa){ea&&Z.remove();X&&X.remove();P&&P.remove()}m.resize&&a.resizeSvgIcons(m.resize);I=true;m.callback&&m.callback(o)}}function f(){if(c.indexOf(".svgz")!=-1){var ea=c.replace(".svgz",".svg");window.console&&console.log(".svgz failed, trying with .svg");a.svgIcons(ea,m)}else m.fallback&&b(false,m.fallback)} -function d(ea){if(window.btoa)return window.btoa(ea);var aa=Array(Math.floor((ea.length+2)/3)*4),Z,la,sa,na,oa,Ba,Ga=0,Ja=0;do{Z=ea.charCodeAt(Ga++);la=ea.charCodeAt(Ga++);sa=ea.charCodeAt(Ga++);na=Z>>2;Z=(Z&3)<<4|la>>4;oa=(la&15)<<2|sa>>6;Ba=sa&63;if(isNaN(la))oa=Ba=64;else if(isNaN(sa))Ba=64;aa[Ja++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(na);aa[Ja++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Z);aa[Ja++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(oa); -aa[Ja++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Ba)}while(Ga-1&&Q.indexOf("Chrome/");var ha="data:image/svg+xml;charset=utf-8;base64,";if(m.svgz){var X=a('').appendTo("body").hide();try{U=X[0].contentDocument;X.load(s); -s(0,true)}catch(R){f()}}else{var ba=new DOMParser;a.ajax({url:c,dataType:"string",success:function(ea){if(ea){U=ba.parseFromString(ea,"text/xml");a(function(){s("ajax")})}else a(f)},error:function(ea){if(window.opera)a(function(){f()});else if(ea.responseText){U=ba.parseFromString(ea.responseText,"text/xml");U.childNodes.length||a(f);a(function(){s("ajax")})}else a(f)}})}var ta=function(ea,aa,Z,la){W&&aa.css("visibility","hidden");if(m.replace){la&&aa.attr("id",Z);(Z=ea.attr("class"))&&aa.attr("class", -"svg_icon "+Z);ea.replaceWith(aa)}else ea.append(aa);W&&setTimeout(function(){aa.removeAttr("style")},1)},ja=function(ea,aa){if(m.id_match===undefined||m.id_match!==false)ta(holder,ea,aa,true);o[aa]=ea};g=function(ea,aa){var Z=ea.find("defs");if(!Z.length)return ea;Z=W?Z.find("*").filter(function(){return!!this.id}):Z.find("[id]");var la=ea[0].getElementsByTagName("*"),sa=la.length;Z.each(function(na){var oa=this.id;a(U).find("#"+oa);this.id=na="x"+oa+aa+na;oa="url(#"+oa+")";var Ba="url(#"+na+")"; -for(na=0;na","/":"?","\\":"|"}};a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:p}})})(jQuery);(function(a,p){function g(da){return typeof da==="string"}function c(da){var W=d.call(arguments,1);return function(){return da.apply(this,W.concat(d.call(arguments)))}}function n(da,W,Z,oa,pa){var na;if(oa!==f){W=Z.match(da?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);Z=W[3]||"";if(pa===2&&g(oa))oa=oa.replace(da?ba:U,"");else{na=o(W[2]);oa=g(oa)?o[da?ia:P](oa):oa;oa=pa===2?oa:pa===1?a.extend({},oa,na):a.extend({},na,oa);oa=q(oa);if(da)oa=oa.replace(xa,m)}da=W[1]+(da?"#":oa||!W[1]?"?":"")+oa+Z}else da= +W(Z!==f?Z:p[qa][ga]);return da}function s(da,W,Z){if(W===f||typeof W==="boolean"){Z=W;W=q[da?ia:P]()}else W=g(W)?W.replace(da?ba:U,""):W;return o(W,Z)}function b(da,W,Z,oa){if(!g(Z)&&typeof Z!=="object"){oa=Z;Z=W;W=f}return this.each(function(){var pa=a(this),na=W||Q()[(this.nodeName||"").toLowerCase()]||"",ma=na&&pa.attr(na)||"";pa.attr(na,q[da](ma,Z,oa))})}var f,d=Array.prototype.slice,m=decodeURIComponent,q=a.param,B,o,K,S=a.bbq=a.bbq||{},M,J,Q,Y=a.event.special,P="querystring",ia="fragment",qa= +"location",ga="href",U=/^.*\?|#.*$/g,ba=/^.*\#/,xa,ka={};q[P]=c(n,0,function(da){return da.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")});q[ia]=B=c(n,1,function(da){return da.replace(/^[^#]*#?(.*)$/,"$1")});B.noEscape=function(da){da=da||"";da=a.map(da.split(""),encodeURIComponent);xa=RegExp(da.join("|"),"g")};B.noEscape(",/");a.deparam=o=function(da,W){var Z={},oa={"true":true,"false":false,"null":null};a.each(da.replace(/\+/g," ").split("&"),function(pa,na){var ma=na.split("="),za=m(ma[0]),Ha=Z,Fa= +0,Ia=za.split("]["),La=Ia.length-1;if(/\[/.test(Ia[0])&&/\]$/.test(Ia[La])){Ia[La]=Ia[La].replace(/\]$/,"");Ia=Ia.shift().split("[").concat(Ia);La=Ia.length-1}else La=0;if(ma.length===2){ma=m(ma[1]);if(W)ma=ma&&!isNaN(ma)?+ma:ma==="undefined"?f:oa[ma]!==f?oa[ma]:ma;if(La)for(;Fa<=La;Fa++){za=Ia[Fa]===""?Ha.length:Ia[Fa];Ha=Ha[za]=Fa').hide().insertAfter("body")[0].contentWindow; +J=function(){return c(S.document[b][f])};M=function(Q,Y){if(Q!==Y){var P=S.document;P.open().close();P[b].hash="#"+Q}};M(c())}}var o={},K,S,M,J;o.start=function(){if(!K){var Q=c();M||B();(function Y(){var P=c(),ia=J(Q);if(P!==Q){M(Q=P,ia);a(p).trigger("hashchange")}else if(ia!==Q)p[b][f]=p[b][f].replace(/#.*/,"")+"#"+ia;K=setTimeout(Y,a.hashchangeDelay)})()}};o.stop=function(){if(!S){K&&clearTimeout(K);K=0}};return o}()})(jQuery,this);(function(a){var p={},g;a.svgIcons=function(c,n){function s(da,W){if(da!=="ajax"){if(Q)return;var Z=(S=ga[0].contentDocument)&&S.getElementById("svg_eof");if(!Z&&!(W&&Z)){Y++;if(Y<50)setTimeout(s,20);else{f();Q=true}return}Q=true}K=a(S.firstChild).children();if(n.no_img)setTimeout(function(){J||b()},500);else{Z=qa+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNzUiIGhlaWdodD0iMjc1Ij48L3N2Zz4%3D";M=a(new Image).attr({src:Z,width:0,height:0}).appendTo("body").load(function(){b(true)}).error(function(){b()})}} +function b(da,W){if(!J){if(n.no_img)da=false;if(da){var Z=a(document.createElement("div"));Z.hide().appendTo("body")}if(W){var oa=n.fallback_path?n.fallback_path:"";a.each(W,function(La,Ka){a("#"+La);var Ea=a(new Image).attr({"class":"svg_icon",src:oa+Ka,width:B,height:o,alt:"icon"});ka(Ea,La)})}else for(var pa=K.length,na=0;na0&&!da)ya=g(ya,Ea,true);xa(a(this),ya,Ka)})});if(!W){da&&Z.remove();ga&&ga.remove();M&&M.remove()}n.resize&&a.resizeSvgIcons(n.resize);J=true;n.callback&&n.callback(p)}}function f(){if(c.indexOf(".svgz")!=-1){var da=c.replace(".svgz",".svg");window.console&&console.log(".svgz failed, trying with .svg");a.svgIcons(da,n)}else n.fallback&&b(false,n.fallback)} +function d(da){if(window.btoa)return window.btoa(da);var W=Array(Math.floor((da.length+2)/3)*4),Z,oa,pa,na,ma,za,Ha=0,Fa=0;do{Z=da.charCodeAt(Ha++);oa=da.charCodeAt(Ha++);pa=da.charCodeAt(Ha++);na=Z>>2;Z=(Z&3)<<4|oa>>4;ma=(oa&15)<<2|pa>>6;za=pa&63;if(isNaN(oa))ma=za=64;else if(isNaN(pa))za=64;W[Fa++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(na);W[Fa++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(Z);W[Fa++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(ma); +W[Fa++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(za)}while(Ha-1&&P.indexOf("Chrome/");var qa="data:image/svg+xml;charset=utf-8;base64,";if(n.svgz){var ga=a('').appendTo("body").hide();try{S=ga[0].contentDocument;ga.load(s); +s(0,true)}catch(U){f()}}else{var ba=new DOMParser;a.ajax({url:c,dataType:"string",success:function(da){if(da){S=ba.parseFromString(da,"text/xml");a(function(){s("ajax")})}else a(f)},error:function(da){if(window.opera)a(function(){f()});else if(da.responseText){S=ba.parseFromString(da.responseText,"text/xml");S.childNodes.length||a(f);a(function(){s("ajax")})}else a(f)}})}var xa=function(da,W,Z,oa){ia&&W.css("visibility","hidden");if(n.replace){oa&&W.attr("id",Z);(Z=da.attr("class"))&&W.attr("class", +"svg_icon "+Z);da.replaceWith(W)}else da.append(W);ia&&setTimeout(function(){W.removeAttr("style")},1)},ka=function(da,W){if(n.id_match===undefined||n.id_match!==false)xa(holder,da,W,true);p[W]=da};g=function(da,W){var Z=da.find("defs");if(!Z.length)return da;Z=ia?Z.find("*").filter(function(){return!!this.id}):Z.find("[id]");var oa=da[0].getElementsByTagName("*"),pa=oa.length;Z.each(function(na){var ma=this.id;a(S).find("#"+ma);this.id=na="x"+ma+W+na;ma="url(#"+ma+")";var za="url(#"+na+")";for(na= +0;na=0;jQuery.fn.jGraduate=function(c){var m= -arguments;return this.each(function(){function s(ma,ga,qa,S,O){var fa=O||a("stop",{"stop-color":ga,"stop-opacity":qa,offset:ma},ba);if(O){ga=O.getAttribute("stop-color");qa=O.getAttribute("stop-opacity");ma=O.getAttribute("offset")}else ba.appendChild(fa);if(qa===null)qa=1;O=a("path",{d:"M-6.2,0.9c3.6-4,6.7-4.3,6.7-12.4c-0.2,7.9,3.1,8.8,6.5,12.4c3.5,3.8,2.9,9.6,0,12.3c-3.1,2.8-10.4,2.7-13.2,0C-9.6,9.9-9.4,4.4-6.2,0.9z",fill:"url(#jGraduate_trans)",transform:"translate("+(10+ma*W)+", 26)"},Aa);var Ia= -a("path",{d:"M-6.2,0.9c3.6-4,6.7-4.3,6.7-12.4c-0.2,7.9,3.1,8.8,6.5,12.4c3.5,3.8,2.9,9.6,0,12.3c-3.1,2.8-10.4,2.7-13.2,0C-9.6,9.9-9.4,4.4-6.2,0.9z",fill:ga,"fill-opacity":qa,transform:"translate("+(10+ma*W)+", 26)",stroke:"#000","stroke-width":1.5},Aa);$(Ia).mousedown(function(Qa){b(this);$a=Ua;V.mousemove(l).mouseup(f);ya=vb.offset();Qa.preventDefault();return false}).data("stop",fa).data("bg",O).dblclick(function(){$("div.jGraduate_LightBox").show();for(var Qa=this,Ya=+fa.getAttribute("stop-opacity")|| -1,kb=fa.getAttribute("stop-color")||1,mb=(parseFloat(Ya)*255).toString(16);mb.length<2;)mb="0"+mb;ga=kb.substr(1)+mb;$("#"+q+"_jGraduate_stopPicker").css({left:100,bottom:15}).jPicker({window:{title:"Pick the start color and opacity for the gradient"},images:{clientPath:B.images.clientPath},color:{active:ga,alphaSupport:true}},function(nb){kb=nb.val("hex")?"#"+nb.val("hex"):"none";Ya=nb.val("a")!==null?nb.val("a")/256:1;Qa.setAttribute("fill",kb);Qa.setAttribute("fill-opacity",Ya);fa.setAttribute("stop-color", -kb);fa.setAttribute("stop-opacity",Ya);$("div.jGraduate_LightBox").hide();$("#"+q+"_jGraduate_stopPicker").hide()},null,function(){$("div.jGraduate_LightBox").hide();$("#"+q+"_jGraduate_stopPicker").hide()})});$(ba).find("stop").each(function(){var Qa=$(this);if(+this.getAttribute("offset")>ma){if(!ga){var Ya=this.getAttribute("stop-color"),kb=this.getAttribute("stop-opacity");fa.setAttribute("stop-color",Ya);Ia.setAttribute("fill",Ya);fa.setAttribute("stop-opacity",kb===null?1:kb);Ia.setAttribute("fill-opacity", -kb===null?1:kb)}Qa.before(fa);return false}});S&&b(Ia);return fa}function b(ma){Ua&&Ua.setAttribute("stroke","#000");ma.setAttribute("stroke","blue");Ua=ma;Ua.parentNode.appendChild(Ua)}function f(){V.unbind("mousemove",l);if(za.getAttribute("display")!=="none"){za.setAttribute("display","none");var ma=$(Ua),ga=ma.data("stop");ma=ma.data("bg");$([Ua,ga,ma]).remove()}$a=null}function d(){var ma=Oa?"rotate("+Oa+","+Za+","+Ea+") ":"";ob===1&&fb===1?ba.removeAttribute("gradientTransform"):ba.setAttribute("gradientTransform", -ma+"translate("+-Za*(ob-1)+","+-Ea*(fb-1)+") scale("+ob+","+fb+")")}function l(ma){var ga=ma.pageX-ya.left;ma=ma.pageY-ya.top;ga=ga<10?10:ga>W+10?W+10:ga;var qa="translate("+ga+", 26)";if(ma<-60||ma>130){za.setAttribute("display","block");za.setAttribute("transform",qa)}else za.setAttribute("display","none");$a.setAttribute("transform",qa);$.data($a,"bg").setAttribute("transform",qa);$.data($a,"stop").setAttribute("offset",(ga-10)/W);var S=0;$(ba).find("stop").each(function(){var O=this.getAttribute("offset"), -fa=$(this);if(O
  • Solid Color
  • Linear Gradient
  • Radial Gradient
  • ');var ca=$(M+"> .jGraduate_colPick"),Q=$(M+"> .jGraduate_gradPick");Q.html('

    '+B.window.pickerTitle+'


    ');var W=256,ha=W-0,X=W-0,R,ba,ta,ja={};$(".jGraduate_SliderBar").width(145);var ea=$("#"+q+"_jGraduate_GradContainer")[0],aa=a("svg",{id:q+"_jgraduate_svg",width:W,height:W,xmlns:o.svg},ea);R=R||p.paint.type;var Z=ba=p.paint[R],la=p.paint.alpha,sa=R==="solidColor";switch(R){case "solidColor":case "linearGradient":if(!sa){ba.id=q+"_lg_jgraduate_grad";Z= -ba=aa.appendChild(ba)}a("radialGradient",{id:q+"_rg_jgraduate_grad"},aa);if(R==="linearGradient")break;case "radialGradient":if(!sa){ba.id=q+"_rg_jgraduate_grad";Z=ba=aa.appendChild(ba)}a("linearGradient",{id:q+"_lg_jgraduate_grad"},aa)}if(sa){Z=ba=$("#"+q+"_lg_jgraduate_grad")[0];I=p.paint[R];s(0,"#"+I,1);var na=typeof B.newstop;if(na==="string")switch(B.newstop){case "same":s(1,"#"+I,1);break;case "inverse":na="";for(var oa=0;oa<6;oa+=2){I.substr(oa,2);var Ba=(255-parseInt(I.substr(oa,2),16)).toString(16); -if(Ba.length<2)Ba=0+Ba;na+=Ba}s(1,"#"+na,1);break;case "white":s(1,"#ffffff",1);break;case "black":s(1,"#000000",1)}else if(na==="object")s(1,B.newstop.color||"#"+I,"opac"in B.newstop?B.newstop.opac:1)}I=parseFloat(Z.getAttribute("x1")||0);na=parseFloat(Z.getAttribute("y1")||0);oa=parseFloat(Z.getAttribute("x2")||1);Ba=parseFloat(Z.getAttribute("y2")||0);var Ga=parseFloat(Z.getAttribute("cx")||0.5),Ja=parseFloat(Z.getAttribute("cy")||0.5),Ca=parseFloat(Z.getAttribute("fx")||Ga),La=parseFloat(Z.getAttribute("fy")|| -Ja);ta=a("rect",{id:q+"_jgraduate_rect",x:0,y:0,width:ha,height:X,fill:"url(#"+q+"_jgraduate_grad)","fill-opacity":la/100},aa);var Na=$("
    ").attr({"class":"grad_coord jGraduate_lg_field",title:"Begin Stop"}).text(1).css({top:na*W,left:I*W}).data("coord","start").appendTo(ea),Ha=Na.clone().text(2).css({top:Ba*W,left:oa*W}).attr("title","End stop").data("coord","end").appendTo(ea),va=$("
    ").attr({"class":"grad_coord jGraduate_rg_field",title:"Center stop"}).text("C").css({top:Ja*W,left:Ga* -W}).data("coord","center").appendTo(ea),Fa=va.clone().text("F").css({top:La*W,left:Ca*W,display:"none"}).attr("title","Focus point").data("coord","focus").appendTo(ea);Fa[0].id=q+"_jGraduate_focusCoord";$(M+" .grad_coord");$.each(["x1","y1","x2","y2","cx","cy","fx","fy"],function(ma,ga){var qa=ba.getAttribute(ga),S=isNaN(ga[1]);qa||(qa=S?"0.5":ga==="x2"?"1.0":"0.0");ja[ga]=$("#"+q+"_jGraduate_"+ga).val(qa).change(function(){if(isNaN(parseFloat(this.value))||this.value<0)this.value=0;else if(this.value> -1)this.value=1;if(!(ga[0]==="f"&&!bb))if(S&&R==="radialGradient"||!S&&R==="linearGradient")ba.setAttribute(ga,this.value);var O=S?ga[0]==="c"?va:Fa:ga[1]==="1"?Na:Ha,fa=ga.indexOf("x")>=0?"left":"top";O.css(fa,this.value*W)}).change()});var ub,Aa,vb=$("#"+q+"_jGraduate_StopSlider"),Ua,Ta,$a,za=a("path",{d:"m9.75,-6l-19.5,19.5m0,-19.5l19.5,19.5",fill:"none",stroke:"#D00","stroke-width":5,display:"none"},Ta),ya,ob=1,fb=1,Oa=0,Za=Ga,Ea=Ja;Ta=a("svg",{width:"100%",height:45},vb[0]);ea=a("pattern",{width:16, -height:16,patternUnits:"userSpaceOnUse",id:"jGraduate_trans"},Ta);a("image",{width:16,height:16},ea).setAttributeNS(o.xlink,"xlink:href",B.images.clientPath+"map-opacity.png");$(Ta).on("click touchstart",function(ma){ya=vb.offset();if(ma.target.tagName!=="path"){var ga=ma.pageX-ya.left-8;ga=ga<10?10:ga>W+10?W+10:ga;s(ga/W,0,0,true);ma.stopPropagation()}});$(Ta).mouseover(function(){Ta.appendChild(za)});Aa=a("g",{},Ta);a("line",{x1:10,y1:15,x2:W+10,y2:15,"stroke-width":2,stroke:"#000"},Ta);var pb= -Q.find(".jGraduate_spreadMethod").change(function(){ba.setAttribute("spreadMethod",$(this).val())}),qb=null,gb=function(ma){var ga=ma.pageX-Ma.left,qa=ma.pageY-Ma.top;ga=ga<0?0:ga>W?W:ga;qa=qa<0?0:qa>W?W:qa;qb.css("left",ga).css("top",qa);ga=ga/ha;qa=qa/X;var S=qb.data("coord"),O=ba;switch(S){case "start":ja.x1.val(ga);ja.y1.val(qa);O.setAttribute("x1",ga);O.setAttribute("y1",qa);break;case "end":ja.x2.val(ga);ja.y2.val(qa);O.setAttribute("x2",ga);O.setAttribute("y2",qa);break;case "center":ja.cx.val(ga); -ja.cy.val(qa);O.setAttribute("cx",ga);O.setAttribute("cy",qa);Za=ga;Ea=qa;d();break;case "focus":ja.fx.val(ga);ja.fy.val(qa);O.setAttribute("fx",ga);O.setAttribute("fy",qa);d()}ma.preventDefault()},cb=function(){qb=null;V.unbind("mousemove",gb).unbind("mouseup",cb)};ub=ba.getElementsByTagNameNS(o.svg,"stop");if(Sa<2){for(;Sa<2;){ba.appendChild(document.createElementNS(o.svg,"stop"));++Sa}ub=ba.getElementsByTagNameNS(o.svg,"stop")}var Sa=ub.length;for(oa=0;oa99.5)S=99.5;if(S>0)fb=1-S/100;else ob= --(S/100)-1;O=145*((S+100)/2)/100;fa&&d();break;case "angle":Oa=S;O=Oa/180;O+=0.5;O*=145;fa&&d()}if(O>145)O=145;else if(O<0)O=0;qa.css({"margin-left":O-5})}).change()});var rb=function(ma){var ga=ma.pageX-eb.offset.left-parseInt(eb.parent.css("border-left-width"));if(ga>145)ga=145;if(ga<=0)ga=0;var qa=ga-5;ga/=145;switch(eb.type){case "radius":ga=Math.pow(ga*2,2.5);if(ga>0.98&&ga<1.02)ga=1;if(ga<=0.01)ga=0.01;ba.setAttribute("r",ga);break;case "opacity":p.paint.alpha=parseInt(ga*100);ta.setAttribute("fill-opacity", -ga);break;case "ellip":fb=ob=1;if(ga<0.5){ga/=0.5;ob=ga<=0?0.01:ga}else if(ga>0.5){ga/=0.5;ga=2-ga;fb=ga<=0?0.01:ga}d();ga-=1;if(fb===ga+1)ga=Math.abs(ga);break;case "angle":ga-=0.5;Oa=ga*=180;d();ga/=100}eb.elem.css({"margin-left":qa});ga=Math.round(ga*100);eb.input.val(ga);ma.preventDefault()},Ab=function(){V.unbind("mousemove",rb).unbind("mouseup",Ab);eb=null};for(Q=(p.paint.alpha*255/100).toString(16);Q.length<2;)Q="0"+Q;Q=Q.split(".")[0];I=p.paint.solidColor=="none"?"":p.paint.solidColor+Q;sa|| -(I=ub[0].getAttribute("stop-color"));$.extend($.fn.jPicker.defaults.window,{alphaSupport:true,effects:{type:"show",speed:0}});ca.jPicker({window:{title:B.window.pickerTitle},images:{clientPath:B.images.clientPath},color:{active:I,alphaSupport:true}},function(ma){p.paint.type="solidColor";p.paint.alpha=ma.val("ahex")?Math.round(ma.val("a")/255*100):100;p.paint.solidColor=ma.val("hex")?ma.val("hex"):"none";p.paint.radialGradient=null;U()},null,function(){P()});var wb=$(M+" .jGraduate_tabs li");wb.on("click touchstart", -function(){wb.removeClass("jGraduate_tab_current");$(this).addClass("jGraduate_tab_current");$(M+" > div").hide();var ma=$(this).attr("data-type");$(M+" .jGraduate_gradPick").show();if(ma==="rg"||ma==="lg"){$(".jGraduate_"+ma+"_field").show();$(".jGraduate_"+(ma==="lg"?"rg":"lg")+"_field").hide();$("#"+q+"_jgraduate_rect")[0].setAttribute("fill","url(#"+q+"_"+ma+"_jgraduate_grad)");R=ma==="lg"?"linearGradient":"radialGradient";$("#"+q+"_jGraduate_OpacInput").val(p.paint.alpha).change();var ga=$("#"+ -q+"_"+ma+"_jgraduate_grad")[0];if(ba!==ga){var qa=$(ba).find("stop");$(ga).empty().append(qa);ba=ga;ga=pb.val();ba.setAttribute("spreadMethod",ga)}bb=ma==="rg"&&ba.getAttribute("fx")!=null&&!(Ga==Ca&&Ja==La);$("#"+q+"_jGraduate_focusCoord").toggle(bb);if(bb)$("#"+q+"_jGraduate_match_ctr")[0].checked=false}else{$(M+" .jGraduate_gradPick").hide();$(M+" .jGraduate_colPick").show()}});$(M+" > div").hide();wb.removeClass("jGraduate_tab_current");var Db;switch(p.paint.type){case "linearGradient":Db=$(M+ -" .jGraduate_tab_lingrad");break;case "radialGradient":Db=$(M+" .jGraduate_tab_radgrad");break;default:Db=$(M+" .jGraduate_tab_color")}p.show();setTimeout(function(){Db.addClass("jGraduate_tab_current").click()},10)}else alert("Container element must have an id attribute to maintain unique id strings for sub-elements.")})}})();function touchHandler(a){var o=a.changedTouches,g=o[0],c="";switch(a.type){case "touchstart":c="mousedown";break;case "touchmove":c="mousemove";break;case "touchend":c="mouseup";break;default:return}var m=document.createEvent("MouseEvent");m.initMouseEvent(c,true,true,window,1,g.screenX,g.screenY,g.clientX,g.clientY,false,false,false,false,0,null);if(o.length<2){g.target.dispatchEvent(m);a.preventDefault()}};jQuery&&function(){var a=$(window),o=$(document);$.extend($.fn,{contextMenu:function(g,c){if(g.menu==undefined)return false;if(g.inSpeed==undefined)g.inSpeed=150;if(g.outSpeed==undefined)g.outSpeed=75;if(g.inSpeed==0)g.inSpeed=-1;if(g.outSpeed==0)g.outSpeed=-1;$(this).each(function(){var m=$(this),s=$(m).offset(),b=$("#"+g.menu);b.addClass("contextMenu");$(this).bind("mousedown",function(f){$(this).mouseup(function(d){var l=$(this);l.unbind("mouseup");$(".contextMenu").hide();if(f.button===2||g.allowLeft|| -f.ctrlKey&&svgedit.browser.isMac()){d.stopPropagation();if(m.hasClass("disabled")||f.altKey)return false;var p=d.pageX,B=d.pageY;d=a.width()-b.width();var q=a.height()-b.height();if(p>d-15)p=d-15;if(B>q-30)B=q-30;o.unbind("click");b.css({top:B,left:p}).fadeIn(g.inSpeed);b.find("A").mouseover(function(){b.find("LI.hover").removeClass("hover");$(this).parent().addClass("hover")}).mouseout(function(){b.find("LI.hover").removeClass("hover")});o.keypress(function(M){switch(M.keyCode){case 38:if(b.find("LI.hover").length){b.find("LI.hover").removeClass("hover").prevAll("LI:not(.disabled)").eq(0).addClass("hover"); -b.find("LI.hover").length||b.find("LI:last").addClass("hover")}else b.find("LI:last").addClass("hover");break;case 40:if(b.find("LI.hover").length==0)b.find("LI:first").addClass("hover");else{b.find("LI.hover").removeClass("hover").nextAll("LI:not(.disabled)").eq(0).addClass("hover");b.find("LI.hover").length||b.find("LI:first").addClass("hover")}break;case 13:b.find("LI.hover A").trigger("click");break;case 27:o.trigger("click")}});b.find("A").unbind("mouseup");b.find("LI:not(.disabled) A").mouseup(function(){o.unbind("click").unbind("keypress"); -$(".contextMenu").hide();c&&c($(this).attr("href").substr(1),$(l),{x:p-s.left,y:B-s.top,docX:p,docY:B});return false});setTimeout(function(){o.click(function(){o.unbind("click").unbind("keypress");b.fadeOut(g.outSpeed);return false})},0)}})});if($.browser.mozilla)$("#"+g.menu).each(function(){$(this).css({MozUserSelect:"none"})});else $.browser.msie?$("#"+g.menu).each(function(){$(this).bind("selectstart.disableTextSelect",function(){return false})}):$("#"+g.menu).each(function(){$(this).bind("mousedown.disableTextSelect", -function(){return false})});$(m).add($("UL.contextMenu")).bind("contextmenu",function(){return false})});return $(this)},disableContextMenuItems:function(g){if(g==undefined){$(this).find("LI").addClass("disabled");return $(this)}$(this).each(function(){if(g!=undefined)for(var c=g.split(","),m=0;m=0,s=o.indexOf("Gecko/")>=0,b=o.indexOf("MSIE")>=0,f=o.indexOf("Chrome/")>=0,d=o.indexOf("Windows")>=0,l=o.indexOf("Macintosh")>= -0,p="ontouchstart"in window,B=!!g.querySelector,q=!!document.evaluate,M=function(){var ha=document.createElementNS("http://www.w3.org/2000/svg","path");ha.setAttribute("d","M0,0 10,10");var X=ha.pathSegList;ha=ha.createSVGPathSegLinetoAbs(5,5);try{X.replaceItem(ha,0);return true}catch(R){}return false}(),U=function(){var ha=document.createElementNS("http://www.w3.org/2000/svg","path");ha.setAttribute("d","M0,0 10,10");var X=ha.pathSegList;ha=ha.createSVGPathSegLinetoAbs(5,5);try{X.insertItemBefore(ha, -0);return true}catch(R){}return false}(),P=function(){var ha=document.createElementNS("http://www.w3.org/2000/svg","svg"),X=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(ha);X.setAttribute("x",5);ha.appendChild(X);var R=document.createElementNS("http://www.w3.org/2000/svg","text");R.textContent="a";X.appendChild(R);X=R.getStartPositionOfChar(0).x;document.documentElement.removeChild(ha);return X===0}(),I=function(){var ha=document.createElementNS("http://www.w3.org/2000/svg", -"svg");document.documentElement.appendChild(ha);var X=document.createElementNS("http://www.w3.org/2000/svg","path");X.setAttribute("d","M0,0 C0,0 10,10 10,0");ha.appendChild(X);X=X.getBBox();document.documentElement.removeChild(ha);return X.height>4&&X.height<5}(),V=function(){var ha=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(ha);var X=document.createElementNS("http://www.w3.org/2000/svg","path");X.setAttribute("d","M0,0 10,0");var R=document.createElementNS("http://www.w3.org/2000/svg", -"path");R.setAttribute("d","M5,0 15,0");var ba=document.createElementNS("http://www.w3.org/2000/svg","g");ba.appendChild(X);ba.appendChild(R);ha.appendChild(ba);X=ba.getBBox();document.documentElement.removeChild(ha);return X.width==15}(),ca=function(){var ha=document.createElementNS("http://www.w3.org/2000/svg","rect");ha.setAttribute("x",0.1);(ha=ha.cloneNode(false).getAttribute("x").indexOf(",")==-1)||$.alert("NOTE: This version of Opera is known to contain bugs in SVG-edit.\n\t\tPlease upgrade to the latest version in which the problems have been fixed."); -return ha}(),Q=function(){var ha=document.createElementNS("http://www.w3.org/2000/svg","rect");ha.setAttribute("style","vector-effect:non-scaling-stroke");return ha.style.vectorEffect==="non-scaling-stroke"}(),W=function(){var ha=document.createElementNS("http://www.w3.org/2000/svg","rect").transform.baseVal,X=g.createSVGTransform();ha.appendItem(X);return ha.getItem(0)==X}();svgedit.browser.isOpera=function(){return c};svgedit.browser.isWebkit=function(){return m};svgedit.browser.isGecko=function(){return s}; -svgedit.browser.isIE=function(){return b};svgedit.browser.isChrome=function(){return f};svgedit.browser.isWindows=function(){return d};svgedit.browser.isMac=function(){return l};svgedit.browser.isTouch=function(){return p};svgedit.browser.supportsSelectors=function(){return B};svgedit.browser.supportsXpath=function(){return q};svgedit.browser.supportsPathReplaceItem=function(){return M};svgedit.browser.supportsPathInsertItemBefore=function(){return U};svgedit.browser.supportsPathBBox=function(){return I}; -svgedit.browser.supportsHVLineContainerBBox=function(){return V};svgedit.browser.supportsGoodTextCharPos=function(){return P};svgedit.browser.supportsEditableText=function(){return c};svgedit.browser.supportsGoodDecimals=function(){return ca};svgedit.browser.supportsNonScalingStroke=function(){return Q};svgedit.browser.supportsNativeTransformLists=function(){return W}}else window.location="browser-not-supported.html"})();svgedit=svgedit||{}; -(function(){if(!svgedit.transformlist)svgedit.transformlist={};var a=document.createElementNS("http://www.w3.org/2000/svg","svg"),o={};svgedit.transformlist.SVGTransformList=function(g){this._elem=g||null;this._xforms=[];this._update=function(){var c="";a.createSVGMatrix();for(var m=0;m=0)return this._xforms[c];throw{code:1};};this.insertItemBefore=function(c,m){var s=null;if(m>=0)if(m=0){this._removeFromOtherLists(c);s=this._xforms[m]=c;this._list._update()}return s};this.removeItem=function(c){if(c=0){for(var m=this._xforms[c],s=Array(this.numberOfItems- -1),b=0;b1;)c=o[g-1].multiply(c);if(Math.abs(c.a)<1.0E-14)c.a=0;if(Math.abs(c.b)<1.0E-14)c.b=0;if(Math.abs(c.c)<1.0E-14)c.c=0;if(Math.abs(c.d)< -1.0E-14)c.d=0;if(Math.abs(c.e)<1.0E-14)c.e=0;if(Math.abs(c.f)<1.0E-14)c.f=0;return c};svgedit.math.hasMatrixTransform=function(o){if(!o)return false;for(var g=o.numberOfItems;g--;){var c=o.getItem(g);if(c.type==1&&!svgedit.math.isIdentity(c.matrix))return true}return false};svgedit.math.transformBox=function(o,g,c,m,s){var b={x:o,y:g},f={x:o+c,y:g};c={x:o+c,y:g+m};o={x:o,y:g+m};g=svgedit.math.transformPoint;b=g(b.x,b.y,s);var d=m=b.x,l=b.y,p=b.y;f=g(f.x,f.y,s);m=Math.min(m,f.x);d=Math.max(d,f.x); -l=Math.min(l,f.y);p=Math.max(p,f.y);o=g(o.x,o.y,s);m=Math.min(m,o.x);d=Math.max(d,o.x);l=Math.min(l,o.y);p=Math.max(p,o.y);c=g(c.x,c.y,s);m=Math.min(m,c.x);d=Math.max(d,c.x);l=Math.min(l,c.y);p=Math.max(p,c.y);return{tl:b,tr:f,bl:o,br:c,aabox:{x:m,y:l,width:d-m,height:p-l}}};svgedit.math.transformListToTransform=function(o,g,c){if(o==null)return a.createSVGTransformFromMatrix(a.createSVGMatrix());g=g==undefined?0:g;c=c==undefined?o.numberOfItems-1:c;g=parseInt(g);c=parseInt(c);if(g>c){var m=c;c=g; -g=m}m=a.createSVGMatrix();for(g=g;g<=c;++g){var s=g>=0&&go.x&&g.yo.y}})();svgedit=svgedit||{}; -(function(){if(!svgedit.units)svgedit.units={};var a=["x","x1","cx","rx","width"],o=["y","y1","cy","ry","height"],g=$.merge(["r","radius"],a);$.merge(g,o);var c,m={px:1};svgedit.units.init=function(b){c=b;b=document.createElementNS("http://www.w3.org/2000/svg","svg");document.body.appendChild(b);var f=document.createElementNS("http://www.w3.org/2000/svg","rect");f.setAttribute("width","1em");f.setAttribute("height","1ex");f.setAttribute("x","1in");b.appendChild(f);f=f.getBBox();document.body.removeChild(b); -b=f.x;m.em=f.width;m.ex=f.height;m["in"]=b;m.cm=b/2.54;m.mm=b/25.4;m.pt=b/72;m.pc=b/6;m["%"]=0};svgedit.units.getTypeMap=function(){return m};svgedit.units.shortFloat=function(b){var f=c.getRoundDigits();if(isNaN(b)){if($.isArray(b))return svgedit.units.shortFloat(b[0])+","+svgedit.units.shortFloat(b[1])}else return+(+b).toFixed(f);return parseFloat(b).toFixed(f)-0};svgedit.units.convertUnit=function(b,f){f=f||c.getBaseUnit();return svgedit.unit.shortFloat(b/m[f])};svgedit.units.setUnitAttr=function(b, -f,d){isNaN(d)||b.getAttribute(f);b.setAttribute(f,d)};var s={line:["x1","x2","y1","y2"],circle:["cx","cy","r"],ellipse:["cx","cy","rx","ry"],foreignObject:["x","y","width","height"],rect:["x","y","width","height"],image:["x","y","width","height"],use:["x","y","width","height"],text:["x","y"]};svgedit.units.convertAttrs=function(b){var f=b.tagName,d=c.getBaseUnit();if(f=s[f])for(var l=f.length,p=0;p=0?d*l:o.indexOf(b)>=0?d*p:d*Math.sqrt(l*l+p*p)/Math.sqrt(2)}else{l=f.substr(-2);d=f.substr(0,f.length-2);return d*m[l]}};svgedit.units.isValidUnit=function(b,f,d){var l=false;if(g.indexOf(b)>=0)if(isNaN(f)){f=f.toLowerCase();$.each(m,function(q){if(!l)if(RegExp("^-?[\\d\\.]+"+q+"$").test(f))l=true})}else l=true;else if(b=="id"){b=false;try{var p=c.getElement(f); -b=p==null||p===d}catch(B){}return b}else l=true;return l}})();svgedit=svgedit||{}; -(function(){function a(b){if(svgedit.browser.supportsHVLineContainerBBox())try{return b.getBBox()}catch(f){}var d=$.data(b,"ref"),l=null;if(d){var p=$(d).children().clone().attr("visibility","hidden");$(s).append(p);l=p.filter("line, path")}else l=$(b).find("line, path");var B=false;if(l.length){l.each(function(){var q=this.getBBox();if(!q.width||!q.height)B=true});if(B){b=d?p:$(b).children();ret=getStrokedBBox(b)}else ret=b.getBBox()}else ret=b.getBBox();d&&p.remove();return ret}if(!svgedit.utilities)svgedit.utilities= -{};var o="a,circle,ellipse,foreignObject,g,image,line,path,polygon,polyline,rect,svg,text,tspan,use".split(","),g=null,c=null,m=null,s=null;svgedit.utilities.init=function(b){g=b;c=b.getDOMDocument();m=b.getDOMContainer();s=b.getSVGRoot()};svgedit.utilities.toXml=function(b){return $("

    ").text(b).html()};svgedit.utilities.fromXml=function(b){return $("

    ").html(b).text()};svgedit.utilities.encode64=function(b){b=svgedit.utilities.convertToXMLReferences(b);if(window.btoa)return window.btoa(b); -var f=Array(Math.floor((b.length+2)/3)*4),d,l,p,B,q,M,U=0,P=0;do{d=b.charCodeAt(U++);l=b.charCodeAt(U++);p=b.charCodeAt(U++);B=d>>2;d=(d&3)<<4|l>>4;q=(l&15)<<2|p>>6;M=p&63;if(isNaN(l))q=M=64;else if(isNaN(p))M=64;f[P++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(B);f[P++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d);f[P++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(q);f[P++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(M)}while(U< -b.length);return f.join("")};svgedit.utilities.decode64=function(b){if(window.atob)return window.atob(b);var f="",d,l,p="",B,q="",M=0;b=b.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(M++));l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(M++));B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(M++));q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(M++)); -d=d<<2|l>>4;l=(l&15)<<4|B>>2;p=(B&3)<<6|q;f+=String.fromCharCode(d);if(B!=64)f+=String.fromCharCode(l);if(q!=64)f+=String.fromCharCode(p)}while(M127)f+="&#"+l+";"}return f};svgedit.utilities.text2xml=function(b){if(b.indexOf("=0)b=b.replace(/<(\/?)svg:/g,"<$1").replace("xmlns:svg","xmlns");var f;try{var d=window.DOMParser? -new DOMParser:new ActiveXObject("Microsoft.XMLDOM");d.async=false}catch(l){throw Error("XML Parser could not be instantiated");}try{f=d.loadXML?d.loadXML(b)?d:false:d.parseFromString(b,"text/xml")}catch(p){throw Error("Error parsing XML string");}return f};svgedit.utilities.bboxToObj=function(b){return{x:b.x,y:b.y,width:b.width,height:b.height}};svgedit.utilities.walkTree=function(b,f){if(b&&b.nodeType==1){f(b);for(var d=b.childNodes.length;d--;)svgedit.utilities.walkTree(b.childNodes.item(d),f)}}; +"radialGradient";this.linearGradient=this.solidColor=null;this.radialGradient=c.radialGradient.cloneNode(true)}else if(c.solidColor){this.type="solidColor";this.solidColor=c.solidColor}else{this.type="none";this.radialGradient=this.linearGradient=this.solidColor=null}}};jQuery.fn.jGraduateDefaults={paint:new $.jGraduate.Paint,window:{pickerTitle:"Drag markers to pick a paint"},images:{clientPath:"images/"},newstop:"inverse"};var g=navigator.userAgent.indexOf("Gecko/")>=0;jQuery.fn.jGraduate=function(c){var n= +arguments;return this.each(function(){function s(ja,ca,la,N,R){var ea=R||a("stop",{"stop-color":ca,"stop-opacity":la,offset:ja},ba);if(R){ca=R.getAttribute("stop-color");la=R.getAttribute("stop-opacity");ja=R.getAttribute("offset")}else ba.appendChild(ea);if(la===null)la=1;R=a("path",{d:"M-6.2,0.9c3.6-4,6.7-4.3,6.7-12.4c-0.2,7.9,3.1,8.8,6.5,12.4c3.5,3.8,2.9,9.6,0,12.3c-3.1,2.8-10.4,2.7-13.2,0C-9.6,9.9-9.4,4.4-6.2,0.9z",fill:"url(#jGraduate_trans)",transform:"translate("+(10+ja*ia)+", 26)"},Va);var Ga= +a("path",{d:"M-6.2,0.9c3.6-4,6.7-4.3,6.7-12.4c-0.2,7.9,3.1,8.8,6.5,12.4c3.5,3.8,2.9,9.6,0,12.3c-3.1,2.8-10.4,2.7-13.2,0C-9.6,9.9-9.4,4.4-6.2,0.9z",fill:ca,"fill-opacity":la,transform:"translate("+(10+ja*ia)+", 26)",stroke:"#000","stroke-width":1.5},Va);$(Ga).mousedown(function(Oa){b(this);Ya=ib;Q.mousemove(m).mouseup(f);ua=yb.offset();Oa.preventDefault();return false}).data("stop",ea).data("bg",R).dblclick(function(){$("div.jGraduate_LightBox").show();for(var Oa=this,Xa=+ea.getAttribute("stop-opacity")|| +1,bb=ea.getAttribute("stop-color")||1,rb=(parseFloat(Xa)*255).toString(16);rb.length<2;)rb="0"+rb;ca=bb.substr(1)+rb;$("#"+o+"_jGraduate_stopPicker").css({left:100,bottom:15}).jPicker({window:{title:"Pick the start color and opacity for the gradient"},images:{clientPath:B.images.clientPath},color:{active:ca,alphaSupport:true}},function(Wa){bb=Wa.val("hex")?"#"+Wa.val("hex"):"none";Xa=Wa.val("a")!==null?Wa.val("a")/256:1;Oa.setAttribute("fill",bb);Oa.setAttribute("fill-opacity",Xa);ea.setAttribute("stop-color", +bb);ea.setAttribute("stop-opacity",Xa);$("div.jGraduate_LightBox").hide();$("#"+o+"_jGraduate_stopPicker").hide()},null,function(){$("div.jGraduate_LightBox").hide();$("#"+o+"_jGraduate_stopPicker").hide()})});$(ba).find("stop").each(function(){var Oa=$(this);if(+this.getAttribute("offset")>ja){if(!ca){var Xa=this.getAttribute("stop-color"),bb=this.getAttribute("stop-opacity");ea.setAttribute("stop-color",Xa);Ga.setAttribute("fill",Xa);ea.setAttribute("stop-opacity",bb===null?1:bb);Ga.setAttribute("fill-opacity", +bb===null?1:bb)}Oa.before(ea);return false}});N&&b(Ga);return ea}function b(ja){ib&&ib.setAttribute("stroke","#000");ja.setAttribute("stroke","blue");ib=ja;ib.parentNode.appendChild(ib)}function f(){Q.unbind("mousemove",m);if(Aa.getAttribute("display")!=="none"){Aa.setAttribute("display","none");var ja=$(ib),ca=ja.data("stop");ja=ja.data("bg");$([ib,ca,ja]).remove()}Ya=null}function d(){var ja=Ta?"rotate("+Ta+","+Ba+","+jb+") ":"";fb===1&&Ma===1?ba.removeAttribute("gradientTransform"):ba.setAttribute("gradientTransform", +ja+"translate("+-Ba*(fb-1)+","+-jb*(Ma-1)+") scale("+fb+","+Ma+")")}function m(ja){var ca=ja.pageX-ua.left;ja=ja.pageY-ua.top;ca=ca<10?10:ca>ia+10?ia+10:ca;var la="translate("+ca+", 26)";if(ja<-60||ja>130){Aa.setAttribute("display","block");Aa.setAttribute("transform",la)}else Aa.setAttribute("display","none");Ya.setAttribute("transform",la);$.data(Ya,"bg").setAttribute("transform",la);$.data(Ya,"stop").setAttribute("offset",(ca-10)/ia);var N=0;$(ba).find("stop").each(function(){var R=this.getAttribute("offset"), +ea=$(this);if(R

  • Solid Color
  • Linear Gradient
  • Radial Gradient
  • ');var Y=$(K+"> .jGraduate_colPick"),P=$(K+"> .jGraduate_gradPick");P.html('

    '+B.window.pickerTitle+'


    ');var ia=256,qa=ia-0,ga=ia-0,U,ba,xa,ka={};$(".jGraduate_SliderBar").width(145);var da=$("#"+o+"_jGraduate_GradContainer")[0],W=a("svg",{id:o+"_jgraduate_svg",width:ia,height:ia,xmlns:p.svg},da);U=U||q.paint.type;var Z=ba=q.paint[U],oa=q.paint.alpha,pa=U==="solidColor";switch(U){case "solidColor":case "linearGradient":if(!pa){ba.id=o+"_lg_jgraduate_grad"; +Z=ba=W.appendChild(ba)}a("radialGradient",{id:o+"_rg_jgraduate_grad"},W);if(U==="linearGradient")break;case "radialGradient":if(!pa){ba.id=o+"_rg_jgraduate_grad";Z=ba=W.appendChild(ba)}a("linearGradient",{id:o+"_lg_jgraduate_grad"},W)}if(pa){Z=ba=$("#"+o+"_lg_jgraduate_grad")[0];J=q.paint[U];s(0,"#"+J,1);var na=typeof B.newstop;if(na==="string")switch(B.newstop){case "same":s(1,"#"+J,1);break;case "inverse":na="";for(var ma=0;ma<6;ma+=2){J.substr(ma,2);var za=(255-parseInt(J.substr(ma,2),16)).toString(16); +if(za.length<2)za=0+za;na+=za}s(1,"#"+na,1);break;case "white":s(1,"#ffffff",1);break;case "black":s(1,"#000000",1)}else if(na==="object")s(1,B.newstop.color||"#"+J,"opac"in B.newstop?B.newstop.opac:1)}J=parseFloat(Z.getAttribute("x1")||0);na=parseFloat(Z.getAttribute("y1")||0);ma=parseFloat(Z.getAttribute("x2")||1);za=parseFloat(Z.getAttribute("y2")||0);var Ha=parseFloat(Z.getAttribute("cx")||0.5),Fa=parseFloat(Z.getAttribute("cy")||0.5),Ia=parseFloat(Z.getAttribute("fx")||Ha),La=parseFloat(Z.getAttribute("fy")|| +Fa);xa=a("rect",{id:o+"_jgraduate_rect",x:0,y:0,width:qa,height:ga,fill:"url(#"+o+"_jgraduate_grad)","fill-opacity":oa/100},W);var Ka=$("
    ").attr({"class":"grad_coord jGraduate_lg_field",title:"Begin Stop"}).text(1).css({top:na*ia,left:J*ia}).data("coord","start").appendTo(da),Ea=Ka.clone().text(2).css({top:za*ia,left:ma*ia}).attr("title","End stop").data("coord","end").appendTo(da),ya=$("
    ").attr({"class":"grad_coord jGraduate_rg_field",title:"Center stop"}).text("C").css({top:Fa*ia,left:Ha* +ia}).data("coord","center").appendTo(da),Ca=ya.clone().text("F").css({top:La*ia,left:Ia*ia,display:"none"}).attr("title","Focus point").data("coord","focus").appendTo(da);Ca[0].id=o+"_jGraduate_focusCoord";$(K+" .grad_coord");$.each(["x1","y1","x2","y2","cx","cy","fx","fy"],function(ja,ca){var la=ba.getAttribute(ca),N=isNaN(ca[1]);la||(la=N?"0.5":ca==="x2"?"1.0":"0.0");ka[ca]=$("#"+o+"_jGraduate_"+ca).val(la).change(function(){if(isNaN(parseFloat(this.value))||this.value<0)this.value=0;else if(this.value> +1)this.value=1;if(!(ca[0]==="f"&&!kb))if(N&&U==="radialGradient"||!N&&U==="linearGradient")ba.setAttribute(ca,this.value);var R=N?ca[0]==="c"?ya:Ca:ca[1]==="1"?Ka:Ea,ea=ca.indexOf("x")>=0?"left":"top";R.css(ea,this.value*ia)}).change()});var wa,Va,yb=$("#"+o+"_jGraduate_StopSlider"),ib,Qa,Ya,Aa=a("path",{d:"m9.75,-6l-19.5,19.5m0,-19.5l19.5,19.5",fill:"none",stroke:"#D00","stroke-width":5,display:"none"},Qa),ua,fb=1,Ma=1,Ta=0,Ba=Ha,jb=Fa;Qa=a("svg",{width:"100%",height:45},yb[0]);da=a("pattern",{width:16, +height:16,patternUnits:"userSpaceOnUse",id:"jGraduate_trans"},Qa);a("image",{width:16,height:16},da).setAttributeNS(p.xlink,"xlink:href",B.images.clientPath+"map-opacity.png");$(Qa).on("click touchstart",function(ja){ua=yb.offset();if(ja.target.tagName!=="path"){var ca=ja.pageX-ua.left-8;ca=ca<10?10:ca>ia+10?ia+10:ca;s(ca/ia,0,0,true);ja.stopPropagation()}});$(Qa).mouseover(function(){Qa.appendChild(Aa)});Va=a("g",{},Qa);a("line",{x1:10,y1:15,x2:ia+10,y2:15,"stroke-width":2,stroke:"#000"},Qa);var sb= +P.find(".jGraduate_spreadMethod").change(function(){ba.setAttribute("spreadMethod",$(this).val())}),Za=null,cb=function(ja){var ca=ja.pageX-lb.left,la=ja.pageY-lb.top;ca=ca<0?0:ca>ia?ia:ca;la=la<0?0:la>ia?ia:la;Za.css("left",ca).css("top",la);ca=ca/qa;la=la/ga;var N=Za.data("coord"),R=ba;switch(N){case "start":ka.x1.val(ca);ka.y1.val(la);R.setAttribute("x1",ca);R.setAttribute("y1",la);break;case "end":ka.x2.val(ca);ka.y2.val(la);R.setAttribute("x2",ca);R.setAttribute("y2",la);break;case "center":ka.cx.val(ca); +ka.cy.val(la);R.setAttribute("cx",ca);R.setAttribute("cy",la);Ba=ca;jb=la;d();break;case "focus":ka.fx.val(ca);ka.fy.val(la);R.setAttribute("fx",ca);R.setAttribute("fy",la);d()}ja.preventDefault()},zb=function(){Za=null;Q.unbind("mousemove",cb).unbind("mouseup",zb)};wa=ba.getElementsByTagNameNS(p.svg,"stop");if(sa<2){for(;sa<2;){ba.appendChild(document.createElementNS(p.svg,"stop"));++sa}wa=ba.getElementsByTagNameNS(p.svg,"stop")}var sa=wa.length;for(ma=0;ma99.5)N=99.5;if(N>0)Ma=1-N/100;else fb=-(N/100)-1;R=145*((N+100)/ +2)/100;ea&&d();break;case "angle":Ta=N;R=Ta/180;R+=0.5;R*=145;ea&&d()}if(R>145)R=145;else if(R<0)R=0;la.css({"margin-left":R-5})}).change()});var tb=function(ja){var ca=ja.pageX-gb.offset.left-parseInt(gb.parent.css("border-left-width"));if(ca>145)ca=145;if(ca<=0)ca=0;var la=ca-5;ca/=145;switch(gb.type){case "radius":ca=Math.pow(ca*2,2.5);if(ca>0.98&&ca<1.02)ca=1;if(ca<=0.01)ca=0.01;ba.setAttribute("r",ca);break;case "opacity":q.paint.alpha=parseInt(ca*100);xa.setAttribute("fill-opacity",ca);break; +case "ellip":Ma=fb=1;if(ca<0.5){ca/=0.5;fb=ca<=0?0.01:ca}else if(ca>0.5){ca/=0.5;ca=2-ca;Ma=ca<=0?0.01:ca}d();ca-=1;if(Ma===ca+1)ca=Math.abs(ca);break;case "angle":ca-=0.5;Ta=ca*=180;d();ca/=100}gb.elem.css({"margin-left":la});ca=Math.round(ca*100);gb.input.val(ca);ja.preventDefault()},pb=function(){Q.unbind("mousemove",tb).unbind("mouseup",pb);gb=null};for(P=(q.paint.alpha*255/100).toString(16);P.length<2;)P="0"+P;P=P.split(".")[0];J=q.paint.solidColor=="none"?"":q.paint.solidColor+P;pa||(J=wa[0].getAttribute("stop-color")); +$.extend($.fn.jPicker.defaults.window,{alphaSupport:true,effects:{type:"show",speed:0}});Y.jPicker({window:{title:B.window.pickerTitle},images:{clientPath:B.images.clientPath},color:{active:J,alphaSupport:true}},function(ja){q.paint.type="solidColor";q.paint.alpha=ja.val("ahex")?Math.round(ja.val("a")/255*100):100;q.paint.solidColor=ja.val("hex")?ja.val("hex"):"none";q.paint.radialGradient=null;S()},null,function(){M()});var Ab=$(K+" .jGraduate_tabs li");Ab.on("click touchstart",function(){Ab.removeClass("jGraduate_tab_current"); +$(this).addClass("jGraduate_tab_current");$(K+" > div").hide();var ja=$(this).attr("data-type");$(K+" .jGraduate_gradPick").show();if(ja==="rg"||ja==="lg"){$(".jGraduate_"+ja+"_field").show();$(".jGraduate_"+(ja==="lg"?"rg":"lg")+"_field").hide();$("#"+o+"_jgraduate_rect")[0].setAttribute("fill","url(#"+o+"_"+ja+"_jgraduate_grad)");U=ja==="lg"?"linearGradient":"radialGradient";$("#"+o+"_jGraduate_OpacInput").val(q.paint.alpha).change();var ca=$("#"+o+"_"+ja+"_jgraduate_grad")[0];if(ba!==ca){var la= +$(ba).find("stop");$(ca).empty().append(la);ba=ca;ca=sb.val();ba.setAttribute("spreadMethod",ca)}kb=ja==="rg"&&ba.getAttribute("fx")!=null&&!(Ha==Ia&&Fa==La);$("#"+o+"_jGraduate_focusCoord").toggle(kb);if(kb)$("#"+o+"_jGraduate_match_ctr")[0].checked=false}else{$(K+" .jGraduate_gradPick").hide();$(K+" .jGraduate_colPick").show()}});$(K+" > div").hide();Ab.removeClass("jGraduate_tab_current");var Bb;switch(q.paint.type){case "linearGradient":Bb=$(K+" .jGraduate_tab_lingrad");break;case "radialGradient":Bb= +$(K+" .jGraduate_tab_radgrad");break;default:Bb=$(K+" .jGraduate_tab_color")}q.show();setTimeout(function(){Bb.addClass("jGraduate_tab_current").click()},10)}else alert("Container element must have an id attribute to maintain unique id strings for sub-elements.")})}})();jQuery&&function(){var a=$(window),p=$(document);$.extend($.fn,{contextMenu:function(g,c){if(g.menu==undefined)return false;if(g.inSpeed==undefined)g.inSpeed=150;if(g.outSpeed==undefined)g.outSpeed=75;if(g.inSpeed==0)g.inSpeed=-1;if(g.outSpeed==0)g.outSpeed=-1;$(this).each(function(){var n=$(this),s=$(n).offset(),b=$("#"+g.menu);b.addClass("contextMenu");$(this).bind("mousedown",function(f){$(this).mouseup(function(d){var m=$(this);m.unbind("mouseup");$(".contextMenu").hide();if(f.button===2||g.allowLeft|| +f.ctrlKey&&svgedit.browser.isMac()){d.stopPropagation();if(n.hasClass("disabled")||f.altKey)return false;var q=d.pageX,B=d.pageY;d=a.width()-b.width();var o=a.height()-b.height();if(q>d-15)q=d-15;if(B>o-30)B=o-30;p.unbind("click");b.css({top:B,left:q}).fadeIn(g.inSpeed);b.find("A").mouseover(function(){b.find("LI.hover").removeClass("hover");$(this).parent().addClass("hover")}).mouseout(function(){b.find("LI.hover").removeClass("hover")});p.keypress(function(K){switch(K.keyCode){case 38:if(b.find("LI.hover").length){b.find("LI.hover").removeClass("hover").prevAll("LI:not(.disabled)").eq(0).addClass("hover"); +b.find("LI.hover").length||b.find("LI:last").addClass("hover")}else b.find("LI:last").addClass("hover");break;case 40:if(b.find("LI.hover").length==0)b.find("LI:first").addClass("hover");else{b.find("LI.hover").removeClass("hover").nextAll("LI:not(.disabled)").eq(0).addClass("hover");b.find("LI.hover").length||b.find("LI:first").addClass("hover")}break;case 13:b.find("LI.hover A").trigger("click");break;case 27:p.trigger("click")}});b.find("A").unbind("mouseup");b.find("LI:not(.disabled) A").mouseup(function(){p.unbind("click").unbind("keypress"); +$(".contextMenu").hide();c&&c($(this).attr("href").substr(1),$(m),{x:q-s.left,y:B-s.top,docX:q,docY:B});return false});setTimeout(function(){p.click(function(){p.unbind("click").unbind("keypress");b.fadeOut(g.outSpeed);return false})},0)}})});if($.browser.mozilla)$("#"+g.menu).each(function(){$(this).css({MozUserSelect:"none"})});else $.browser.msie?$("#"+g.menu).each(function(){$(this).bind("selectstart.disableTextSelect",function(){return false})}):$("#"+g.menu).each(function(){$(this).bind("mousedown.disableTextSelect", +function(){return false})});$(n).add($("UL.contextMenu")).bind("contextmenu",function(){return false})});return $(this)},disableContextMenuItems:function(g){if(g==undefined){$(this).find("LI").addClass("disabled");return $(this)}$(this).each(function(){if(g!=undefined)for(var c=g.split(","),n=0;n=0,s=p.indexOf("Gecko/")>=0,b=p.indexOf("MSIE")>=0,f=p.indexOf("Chrome/")>=0,d=p.indexOf("Windows")>=0,m=p.indexOf("Macintosh")>= +0,q="ontouchstart"in window,B=!!g.querySelector,o=!!document.evaluate,K=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","path");qa.setAttribute("d","M0,0 10,10");var ga=qa.pathSegList;qa=qa.createSVGPathSegLinetoAbs(5,5);try{ga.replaceItem(qa,0);return true}catch(U){}return false}(),S=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","path");qa.setAttribute("d","M0,0 10,10");var ga=qa.pathSegList;qa=qa.createSVGPathSegLinetoAbs(5,5);try{ga.insertItemBefore(qa, +0);return true}catch(U){}return false}(),M=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","svg"),ga=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(qa);ga.setAttribute("x",5);qa.appendChild(ga);var U=document.createElementNS("http://www.w3.org/2000/svg","text");U.textContent="a";ga.appendChild(U);ga=U.getStartPositionOfChar(0).x;document.documentElement.removeChild(qa);return ga===0}(),J=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg", +"svg");document.documentElement.appendChild(qa);var ga=document.createElementNS("http://www.w3.org/2000/svg","path");ga.setAttribute("d","M0,0 C0,0 10,10 10,0");qa.appendChild(ga);ga=ga.getBBox();document.documentElement.removeChild(qa);return ga.height>4&&ga.height<5}(),Q=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","svg");document.documentElement.appendChild(qa);var ga=document.createElementNS("http://www.w3.org/2000/svg","path");ga.setAttribute("d","M0,0 10,0");var U= +document.createElementNS("http://www.w3.org/2000/svg","path");U.setAttribute("d","M5,0 15,0");var ba=document.createElementNS("http://www.w3.org/2000/svg","g");ba.appendChild(ga);ba.appendChild(U);qa.appendChild(ba);ga=ba.getBBox();document.documentElement.removeChild(qa);return ga.width==15}(),Y=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","rect");qa.setAttribute("x",0.1);(qa=qa.cloneNode(false).getAttribute("x").indexOf(",")==-1)||$.alert("NOTE: This version of Opera is known to contain bugs in SVG-edit.\n\t\tPlease upgrade to the latest version in which the problems have been fixed."); +return qa}(),P=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","rect");qa.setAttribute("style","vector-effect:non-scaling-stroke");return qa.style.vectorEffect==="non-scaling-stroke"}(),ia=function(){var qa=document.createElementNS("http://www.w3.org/2000/svg","rect").transform.baseVal,ga=g.createSVGTransform();qa.appendItem(ga);return qa.getItem(0)==ga}();svgedit.browser.isOpera=function(){return c};svgedit.browser.isWebkit=function(){return n};svgedit.browser.isGecko=function(){return s}; +svgedit.browser.isIE=function(){return b};svgedit.browser.isChrome=function(){return f};svgedit.browser.isWindows=function(){return d};svgedit.browser.isMac=function(){return m};svgedit.browser.isTouch=function(){return q};svgedit.browser.supportsSelectors=function(){return B};svgedit.browser.supportsXpath=function(){return o};svgedit.browser.supportsPathReplaceItem=function(){return K};svgedit.browser.supportsPathInsertItemBefore=function(){return S};svgedit.browser.supportsPathBBox=function(){return J}; +svgedit.browser.supportsHVLineContainerBBox=function(){return Q};svgedit.browser.supportsGoodTextCharPos=function(){return M};svgedit.browser.supportsEditableText=function(){return c};svgedit.browser.supportsGoodDecimals=function(){return Y};svgedit.browser.supportsNonScalingStroke=function(){return P};svgedit.browser.supportsNativeTransformLists=function(){return ia}}else window.location="browser-not-supported.html"})();svgedit=svgedit||{}; +(function(){if(!svgedit.transformlist)svgedit.transformlist={};var a=document.createElementNS("http://www.w3.org/2000/svg","svg"),p={};svgedit.transformlist.SVGTransformList=function(g){this._elem=g||null;this._xforms=[];this._update=function(){var c="";a.createSVGMatrix();for(var n=0;n=0)return this._xforms[c];throw{code:1};};this.insertItemBefore=function(c,n){var s=null;if(n>=0)if(n=0){this._removeFromOtherLists(c);s=this._xforms[n]=c;this._list._update()}return s};this.removeItem=function(c){if(c=0){for(var n=this._xforms[c],s=Array(this.numberOfItems- +1),b=0;b1;)c=p[g-1].multiply(c);if(Math.abs(c.a)<1.0E-14)c.a=0;if(Math.abs(c.b)<1.0E-14)c.b=0;if(Math.abs(c.c)<1.0E-14)c.c=0;if(Math.abs(c.d)< +1.0E-14)c.d=0;if(Math.abs(c.e)<1.0E-14)c.e=0;if(Math.abs(c.f)<1.0E-14)c.f=0;return c};svgedit.math.hasMatrixTransform=function(p){if(!p)return false;for(var g=p.numberOfItems;g--;){var c=p.getItem(g);if(c.type==1&&!svgedit.math.isIdentity(c.matrix))return true}return false};svgedit.math.transformBox=function(p,g,c,n,s){var b={x:p,y:g},f={x:p+c,y:g};c={x:p+c,y:g+n};p={x:p,y:g+n};g=svgedit.math.transformPoint;b=g(b.x,b.y,s);var d=n=b.x,m=b.y,q=b.y;f=g(f.x,f.y,s);n=Math.min(n,f.x);d=Math.max(d,f.x); +m=Math.min(m,f.y);q=Math.max(q,f.y);p=g(p.x,p.y,s);n=Math.min(n,p.x);d=Math.max(d,p.x);m=Math.min(m,p.y);q=Math.max(q,p.y);c=g(c.x,c.y,s);n=Math.min(n,c.x);d=Math.max(d,c.x);m=Math.min(m,c.y);q=Math.max(q,c.y);return{tl:b,tr:f,bl:p,br:c,aabox:{x:n,y:m,width:d-n,height:q-m}}};svgedit.math.transformListToTransform=function(p,g,c){if(p==null)return a.createSVGTransformFromMatrix(a.createSVGMatrix());g=g==undefined?0:g;c=c==undefined?p.numberOfItems-1:c;g=parseInt(g);c=parseInt(c);if(g>c){var n=c;c=g; +g=n}n=a.createSVGMatrix();for(g=g;g<=c;++g){var s=g>=0&&gp.x&&g.yp.y}})();svgedit=svgedit||{}; +(function(){if(!svgedit.units)svgedit.units={};var a=["x","x1","cx","rx","width"],p=["y","y1","cy","ry","height"],g=$.merge(["r","radius"],a);$.merge(g,p);var c,n={px:1};svgedit.units.init=function(b){c=b;b=document.createElementNS("http://www.w3.org/2000/svg","svg");document.body.appendChild(b);var f=document.createElementNS("http://www.w3.org/2000/svg","rect");f.setAttribute("width","1em");f.setAttribute("height","1ex");f.setAttribute("x","1in");b.appendChild(f);f=f.getBBox();document.body.removeChild(b); +b=f.x;n.em=f.width;n.ex=f.height;n["in"]=b;n.cm=b/2.54;n.mm=b/25.4;n.pt=b/72;n.pc=b/6;n["%"]=0};svgedit.units.getTypeMap=function(){return n};svgedit.units.shortFloat=function(b){var f=c.getRoundDigits();if(isNaN(b)){if($.isArray(b))return svgedit.units.shortFloat(b[0])+","+svgedit.units.shortFloat(b[1])}else return+(+b).toFixed(f);return parseFloat(b).toFixed(f)-0};svgedit.units.convertUnit=function(b,f){f=f||c.getBaseUnit();return svgedit.unit.shortFloat(b/n[f])};svgedit.units.setUnitAttr=function(b, +f,d){isNaN(d)||b.getAttribute(f);b.setAttribute(f,d)};var s={line:["x1","x2","y1","y2"],circle:["cx","cy","r"],ellipse:["cx","cy","rx","ry"],foreignObject:["x","y","width","height"],rect:["x","y","width","height"],image:["x","y","width","height"],use:["x","y","width","height"],text:["x","y"]};svgedit.units.convertAttrs=function(b){var f=b.tagName,d=c.getBaseUnit();if(f=s[f])for(var m=f.length,q=0;q=0?d*m:p.indexOf(b)>=0?d*q:d*Math.sqrt(m*m+q*q)/Math.sqrt(2)}else{m=f.substr(-2);d=f.substr(0,f.length-2);return d*n[m]}};svgedit.units.isValidUnit=function(b,f,d){var m=false;if(g.indexOf(b)>=0)if(isNaN(f)){f=f.toLowerCase();$.each(n,function(o){if(!m)if(RegExp("^-?[\\d\\.]+"+o+"$").test(f))m=true})}else m=true;else if(b=="id"){b=false;try{var q=c.getElement(f); +b=q==null||q===d}catch(B){}return b}else m=true;return m}})();svgedit=svgedit||{}; +(function(){function a(b){if(svgedit.browser.supportsHVLineContainerBBox())try{return b.getBBox()}catch(f){}var d=$.data(b,"ref"),m=null;if(d){var q=$(d).children().clone().attr("visibility","hidden");$(s).append(q);m=q.filter("line, path")}else m=$(b).find("line, path");var B=false;if(m.length){m.each(function(){var o=this.getBBox();if(!o.width||!o.height)B=true});if(B){b=d?q:$(b).children();ret=getStrokedBBox(b)}else ret=b.getBBox()}else ret=b.getBBox();d&&q.remove();return ret}if(!svgedit.utilities)svgedit.utilities= +{};var p="a,circle,ellipse,foreignObject,g,image,line,path,polygon,polyline,rect,svg,text,tspan,use".split(","),g=null,c=null,n=null,s=null;svgedit.utilities.init=function(b){g=b;c=b.getDOMDocument();n=b.getDOMContainer();s=b.getSVGRoot()};svgedit.utilities.toXml=function(b){return $("

    ").text(b).html()};svgedit.utilities.fromXml=function(b){return $("

    ").html(b).text()};svgedit.utilities.encode64=function(b){b=svgedit.utilities.convertToXMLReferences(b);if(window.btoa)return window.btoa(b); +var f=Array(Math.floor((b.length+2)/3)*4),d,m,q,B,o,K,S=0,M=0;do{d=b.charCodeAt(S++);m=b.charCodeAt(S++);q=b.charCodeAt(S++);B=d>>2;d=(d&3)<<4|m>>4;o=(m&15)<<2|q>>6;K=q&63;if(isNaN(m))o=K=64;else if(isNaN(q))K=64;f[M++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(B);f[M++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d);f[M++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(o);f[M++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(K)}while(S< +b.length);return f.join("")};svgedit.utilities.decode64=function(b){if(window.atob)return window.atob(b);var f="",d,m,q="",B,o="",K=0;b=b.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(K++));m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(K++));B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(K++));o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(K++)); +d=d<<2|m>>4;m=(m&15)<<4|B>>2;q=(B&3)<<6|o;f+=String.fromCharCode(d);if(B!=64)f+=String.fromCharCode(m);if(o!=64)f+=String.fromCharCode(q)}while(K127)f+="&#"+m+";"}return f};svgedit.utilities.text2xml=function(b){if(b.indexOf("=0)b=b.replace(/<(\/?)svg:/g,"<$1").replace("xmlns:svg","xmlns");var f;try{var d=window.DOMParser? +new DOMParser:new ActiveXObject("Microsoft.XMLDOM");d.async=false}catch(m){throw Error("XML Parser could not be instantiated");}try{f=d.loadXML?d.loadXML(b)?d:false:d.parseFromString(b,"text/xml")}catch(q){throw Error("Error parsing XML string");}return f};svgedit.utilities.bboxToObj=function(b){return{x:b.x,y:b.y,width:b.width,height:b.height}};svgedit.utilities.walkTree=function(b,f){if(b&&b.nodeType==1){f(b);for(var d=b.childNodes.length;d--;)svgedit.utilities.walkTree(b.childNodes.item(d),f)}}; svgedit.utilities.walkTreePost=function(b,f){if(b&&b.nodeType==1){for(var d=b.childNodes.length;d--;)svgedit.utilities.walkTree(b.childNodes.item(d),f);f(b)}};svgedit.utilities.getUrlFromAttr=function(b){if(b)if(b.indexOf('url("')===0)return b.substring(5,b.indexOf('"',6));else if(b.indexOf("url('")===0)return b.substring(5,b.indexOf("'",6));else if(b.indexOf("url(")===0)return b.substring(4,b.indexOf(")"));return null};svgedit.utilities.getHref=function(b){return b.getAttributeNS("http://www.w3.org/1999/xlink", -"href")};svgedit.utilities.setHref=function(b,f){b.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f)};svgedit.utilities.findDefs=function(b){b=g.getSVGContent().documentElement;var f=b.getElementsByTagNameNS("http://www.w3.org/2000/svg","defs");return f=f.length>0?f[0]:b.insertBefore(b.ownerDocument.createElementNS("http://www.w3.org/2000/svg","defs"),b.firstChild.nextSibling)};svgedit.utilities.getPathBBox=function(b){var f=b.pathSegList,d=f.numberOfItems;b=[[],[]];var l=f.getItem(0), -p=[l.x,l.y];for(l=0;l0?f[0]:b.insertBefore(b.ownerDocument.createElementNS("http://www.w3.org/2000/svg","defs"),b.firstChild.nextSibling)};svgedit.utilities.getPathBBox=function(b){var f=b.pathSegList,d=f.numberOfItems;b=[[],[]];var m=f.getItem(0), +q=[m.x,m.y];for(m=0;m= -0){var l=d.split(":");b[l[1]]=o[l[0]]}else b[d]=d=="xmlns"?"http://www.w3.org/2000/xmlns/":null});c[m]=b});svgedit.sanitize.getNSMap=function(){return a};svgedit.sanitize.sanitizeSvg=function(m){if(m.nodeType==3){m.nodeValue=m.nodeValue.replace(/^\s+|\s+$/g,"");m.nodeValue.length||m.parentNode.removeChild(m)}if(m.nodeType==1){var s=m.parentNode;if(m.ownerDocument&&s){var b=g[m.nodeName],f=c[m.nodeName];if(b!=undefined){for(var d=[],l=m.attributes.length;l--;){var p=m.attributes.item(l),B=p.nodeName, -q=p.localName,M=p.namespaceURI;if(!(f.hasOwnProperty(q)&&M==f[q]&&M!="http://www.w3.org/2000/xmlns/")&&!(M=="http://www.w3.org/2000/xmlns/"&&a[p.nodeValue])){B.indexOf("se:")==0&&d.push([B,p.nodeValue]);m.removeAttributeNS(M,q)}if(svgedit.browser.isGecko())switch(B){case "transform":case "gradientTransform":case "patternTransform":q=p.nodeValue.replace(/(\d)-/g,"$1 -");m.setAttribute(B,q)}if(B=="style"){p=p.nodeValue.split(";");for(B=p.length;B--;){q=p[B].split(":");b.indexOf(q[0])>=0&&m.setAttribute(q[0], -q[1])}m.removeAttribute("style")}}$.each(d,function(U,P){m.setAttributeNS("http://svg-edit.googlecode.com",P[0],P[1])});if((l=svgedit.utilities.getHref(m))&&["filter","linearGradient","pattern","radialGradient","textPath","use"].indexOf(m.nodeName)>=0)if(l[0]!="#"){svgedit.utilities.setHref(m,"");m.removeAttributeNS("http://www.w3.org/1999/xlink","href")}if(m.nodeName=="use"&&!svgedit.utilities.getHref(m))s.removeChild(m);else{$.each(["clip-path","fill","filter","marker-end","marker-mid","marker-start", -"mask","stroke"],function(U,P){var I=m.getAttribute(P);if(I)if((I=svgedit.utilities.getUrlFromAttr(I))&&I[0]!=="#"){m.setAttribute(P,"");m.removeAttribute(P)}});for(l=m.childNodes.length;l--;)svgedit.sanitize.sanitizeSvg(m.childNodes.item(l))}}else{for(b=[];m.hasChildNodes();)b.push(s.insertBefore(m.firstChild,m));s.removeChild(m);for(l=b.length;l--;)svgedit.sanitize.sanitizeSvg(b[l])}}}}})();svgedit=svgedit||{}; -(function(){if(!svgedit.history)svgedit.history={};svgedit.history.HistoryEventTypes={BEFORE_APPLY:"before_apply",AFTER_APPLY:"after_apply",BEFORE_UNAPPLY:"before_unapply",AFTER_UNAPPLY:"after_unapply"};svgedit.history.MoveElementCommand=function(a,o,g,c){this.elem=a;this.text=c?"Move "+a.tagName+" to "+c:"Move "+a.tagName;this.oldNextSibling=o;this.oldParent=g;this.newNextSibling=a.nextSibling;this.newParent=a.parentNode};svgedit.history.MoveElementCommand.type=function(){return"svgedit.history.MoveElementCommand"};svgedit.history.MoveElementCommand.prototype.type= +"height","width"],msqrt:[],mstyle:["displaystyle","mathbackground","mathcolor","mathvariant","scriptlevel"],msub:[],msubsup:[],msup:[],mtable:["align","columnalign","columnlines","columnspacing","displaystyle","equalcolumns","equalrows","frame","rowalign","rowlines","rowspacing","width"],mtd:["columnalign","columnspan","rowalign","rowspan"],mtext:[],mtr:["columnalign","rowalign"],munder:[],munderover:[],none:[],semantics:[]},c={};$.each(g,function(n,s){var b={};$.each(s,function(f,d){if(d.indexOf(":")>= +0){var m=d.split(":");b[m[1]]=p[m[0]]}else b[d]=d=="xmlns"?"http://www.w3.org/2000/xmlns/":null});c[n]=b});svgedit.sanitize.getNSMap=function(){return a};svgedit.sanitize.sanitizeSvg=function(n){if(n.nodeType==3){n.nodeValue=n.nodeValue.replace(/^\s+|\s+$/g,"");n.nodeValue.length||n.parentNode.removeChild(n)}if(n.nodeType==1){var s=n.parentNode;if(n.ownerDocument&&s){var b=g[n.nodeName],f=c[n.nodeName];if(b!=undefined){for(var d=[],m=n.attributes.length;m--;){var q=n.attributes.item(m),B=q.nodeName, +o=q.localName,K=q.namespaceURI;if(!(f.hasOwnProperty(o)&&K==f[o]&&K!="http://www.w3.org/2000/xmlns/")&&!(K=="http://www.w3.org/2000/xmlns/"&&a[q.nodeValue])){B.indexOf("se:")==0&&d.push([B,q.nodeValue]);n.removeAttributeNS(K,o)}if(svgedit.browser.isGecko())switch(B){case "transform":case "gradientTransform":case "patternTransform":o=q.nodeValue.replace(/(\d)-/g,"$1 -");n.setAttribute(B,o)}if(B=="style"){q=q.nodeValue.split(";");for(B=q.length;B--;){o=q[B].split(":");b.indexOf(o[0])>=0&&n.setAttribute(o[0], +o[1])}n.removeAttribute("style")}}$.each(d,function(S,M){n.setAttributeNS("http://svg-edit.googlecode.com",M[0],M[1])});if((m=svgedit.utilities.getHref(n))&&["filter","linearGradient","pattern","radialGradient","textPath","use"].indexOf(n.nodeName)>=0)if(m[0]!="#"){svgedit.utilities.setHref(n,"");n.removeAttributeNS("http://www.w3.org/1999/xlink","href")}if(n.nodeName=="use"&&!svgedit.utilities.getHref(n))s.removeChild(n);else{$.each(["clip-path","fill","filter","marker-end","marker-mid","marker-start", +"mask","stroke"],function(S,M){var J=n.getAttribute(M);if(J)if((J=svgedit.utilities.getUrlFromAttr(J))&&J[0]!=="#"){n.setAttribute(M,"");n.removeAttribute(M)}});for(m=n.childNodes.length;m--;)svgedit.sanitize.sanitizeSvg(n.childNodes.item(m))}}else{for(b=[];n.hasChildNodes();)b.push(s.insertBefore(n.firstChild,n));s.removeChild(n);for(m=b.length;m--;)svgedit.sanitize.sanitizeSvg(b[m])}}}}})();svgedit=svgedit||{}; +(function(){if(!svgedit.history)svgedit.history={};svgedit.history.HistoryEventTypes={BEFORE_APPLY:"before_apply",AFTER_APPLY:"after_apply",BEFORE_UNAPPLY:"before_unapply",AFTER_UNAPPLY:"after_unapply"};svgedit.history.MoveElementCommand=function(a,p,g,c){this.elem=a;this.text=c?"Move "+a.tagName+" to "+c:"Move "+a.tagName;this.oldNextSibling=p;this.oldParent=g;this.newNextSibling=a.nextSibling;this.newParent=a.parentNode};svgedit.history.MoveElementCommand.type=function(){return"svgedit.history.MoveElementCommand"};svgedit.history.MoveElementCommand.prototype.type= svgedit.history.MoveElementCommand.type;svgedit.history.MoveElementCommand.prototype.getText=function(){return this.text};svgedit.history.MoveElementCommand.prototype.apply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_APPLY,this);this.elem=this.newParent.insertBefore(this.elem,this.newNextSibling);a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_APPLY,this)};svgedit.history.MoveElementCommand.prototype.unapply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_UNAPPLY, -this);this.elem=this.oldParent.insertBefore(this.elem,this.oldNextSibling);a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_UNAPPLY,this)};svgedit.history.MoveElementCommand.prototype.elements=function(){return[this.elem]};svgedit.history.InsertElementCommand=function(a,o){this.elem=a;this.text=o||"Create "+a.tagName;this.parent=a.parentNode;this.nextSibling=this.elem.nextSibling};svgedit.history.InsertElementCommand.type=function(){return"svgedit.history.InsertElementCommand"};svgedit.history.InsertElementCommand.prototype.type= +this);this.elem=this.oldParent.insertBefore(this.elem,this.oldNextSibling);a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_UNAPPLY,this)};svgedit.history.MoveElementCommand.prototype.elements=function(){return[this.elem]};svgedit.history.InsertElementCommand=function(a,p){this.elem=a;this.text=p||"Create "+a.tagName;this.parent=a.parentNode;this.nextSibling=this.elem.nextSibling};svgedit.history.InsertElementCommand.type=function(){return"svgedit.history.InsertElementCommand"};svgedit.history.InsertElementCommand.prototype.type= svgedit.history.InsertElementCommand.type;svgedit.history.InsertElementCommand.prototype.getText=function(){return this.text};svgedit.history.InsertElementCommand.prototype.apply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_APPLY,this);this.elem=this.parent.insertBefore(this.elem,this.nextSibling);a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_APPLY,this)};svgedit.history.InsertElementCommand.prototype.unapply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_UNAPPLY, -this);this.parent=this.elem.parentNode;this.elem=this.elem.parentNode.removeChild(this.elem);a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_UNAPPLY,this)};svgedit.history.InsertElementCommand.prototype.elements=function(){return[this.elem]};svgedit.history.RemoveElementCommand=function(a,o,g,c){this.elem=a;this.text=c||"Delete "+a.tagName;this.nextSibling=o;this.parent=g;svgedit.transformlist.removeElementFromListMap(a)};svgedit.history.RemoveElementCommand.type=function(){return"svgedit.history.RemoveElementCommand"}; +this);this.parent=this.elem.parentNode;this.elem=this.elem.parentNode.removeChild(this.elem);a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_UNAPPLY,this)};svgedit.history.InsertElementCommand.prototype.elements=function(){return[this.elem]};svgedit.history.RemoveElementCommand=function(a,p,g,c){this.elem=a;this.text=c||"Delete "+a.tagName;this.nextSibling=p;this.parent=g;svgedit.transformlist.removeElementFromListMap(a)};svgedit.history.RemoveElementCommand.type=function(){return"svgedit.history.RemoveElementCommand"}; svgedit.history.RemoveElementCommand.prototype.type=svgedit.history.RemoveElementCommand.type;svgedit.history.RemoveElementCommand.prototype.getText=function(){return this.text};svgedit.history.RemoveElementCommand.prototype.apply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_APPLY,this);svgedit.transformlist.removeElementFromListMap(this.elem);this.parent=this.elem.parentNode;this.elem=this.parent.removeChild(this.elem);a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_APPLY, this)};svgedit.history.RemoveElementCommand.prototype.unapply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_UNAPPLY,this);svgedit.transformlist.removeElementFromListMap(this.elem);this.nextSibling==null&&window.console&&console.log("Error: reference element was lost");this.parent.insertBefore(this.elem,this.nextSibling);a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_UNAPPLY,this)};svgedit.history.RemoveElementCommand.prototype.elements=function(){return[this.elem]}; -svgedit.history.ChangeElementCommand=function(a,o,g){this.elem=a;this.text=g?"Change "+a.tagName+" "+g:"Change "+a.tagName;this.newValues={};this.oldValues=o;for(var c in o)this.newValues[c]=c=="#text"?a.textContent:c=="#href"?svgedit.utilities.getHref(a):a.getAttribute(c)};svgedit.history.ChangeElementCommand.type=function(){return"svgedit.history.ChangeElementCommand"};svgedit.history.ChangeElementCommand.prototype.type=svgedit.history.ChangeElementCommand.type;svgedit.history.ChangeElementCommand.prototype.getText= -function(){return this.text};svgedit.history.ChangeElementCommand.prototype.apply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_APPLY,this);var o=false,g;for(g in this.newValues){if(this.newValues[g])if(g=="#text")this.elem.textContent=this.newValues[g];else g=="#href"?svgedit.utilities.setHref(this.elem,this.newValues[g]):this.elem.setAttribute(g,this.newValues[g]);else if(g=="#text")this.elem.textContent="";else{this.elem.setAttribute(g,"");this.elem.removeAttribute(g)}if(g== -"transform")o=true}if(!o)if(o=svgedit.utilities.getRotationAngle(this.elem)){g=elem.getBBox();o=["rotate(",o," ",g.x+g.width/2,",",g.y+g.height/2,")"].join("");o!=elem.getAttribute("transform")&&elem.setAttribute("transform",o)}a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_APPLY,this);return true};svgedit.history.ChangeElementCommand.prototype.unapply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_UNAPPLY,this);var o=false,g;for(g in this.oldValues){if(this.oldValues[g])if(g== -"#text")this.elem.textContent=this.oldValues[g];else g=="#href"?svgedit.utilities.setHref(this.elem,this.oldValues[g]):this.elem.setAttribute(g,this.oldValues[g]);else if(g=="#text")this.elem.textContent="";else this.elem.removeAttribute(g);if(g=="transform")o=true}if(!o)if(o=svgedit.utilities.getRotationAngle(this.elem)){g=this.elem.getBBox();o=["rotate(",o," ",g.x+g.width/2,",",g.y+g.height/2,")"].join("");o!=this.elem.getAttribute("transform")&&this.elem.setAttribute("transform",o)}svgedit.transformlist.removeElementFromListMap(this.elem); +svgedit.history.ChangeElementCommand=function(a,p,g){this.elem=a;this.text=g?"Change "+a.tagName+" "+g:"Change "+a.tagName;this.newValues={};this.oldValues=p;for(var c in p)this.newValues[c]=c=="#text"?a.textContent:c=="#href"?svgedit.utilities.getHref(a):a.getAttribute(c)};svgedit.history.ChangeElementCommand.type=function(){return"svgedit.history.ChangeElementCommand"};svgedit.history.ChangeElementCommand.prototype.type=svgedit.history.ChangeElementCommand.type;svgedit.history.ChangeElementCommand.prototype.getText= +function(){return this.text};svgedit.history.ChangeElementCommand.prototype.apply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_APPLY,this);var p=false,g;for(g in this.newValues){if(this.newValues[g])if(g=="#text")this.elem.textContent=this.newValues[g];else g=="#href"?svgedit.utilities.setHref(this.elem,this.newValues[g]):this.elem.setAttribute(g,this.newValues[g]);else if(g=="#text")this.elem.textContent="";else{this.elem.setAttribute(g,"");this.elem.removeAttribute(g)}if(g== +"transform")p=true}if(!p)if(p=svgedit.utilities.getRotationAngle(this.elem)){g=elem.getBBox();p=["rotate(",p," ",g.x+g.width/2,",",g.y+g.height/2,")"].join("");p!=elem.getAttribute("transform")&&elem.setAttribute("transform",p)}a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_APPLY,this);return true};svgedit.history.ChangeElementCommand.prototype.unapply=function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_UNAPPLY,this);var p=false,g;for(g in this.oldValues){if(this.oldValues[g])if(g== +"#text")this.elem.textContent=this.oldValues[g];else g=="#href"?svgedit.utilities.setHref(this.elem,this.oldValues[g]):this.elem.setAttribute(g,this.oldValues[g]);else if(g=="#text")this.elem.textContent="";else this.elem.removeAttribute(g);if(g=="transform")p=true}if(!p)if(p=svgedit.utilities.getRotationAngle(this.elem)){g=this.elem.getBBox();p=["rotate(",p," ",g.x+g.width/2,",",g.y+g.height/2,")"].join("");p!=this.elem.getAttribute("transform")&&this.elem.setAttribute("transform",p)}svgedit.transformlist.removeElementFromListMap(this.elem); a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_UNAPPLY,this);return true};svgedit.history.ChangeElementCommand.prototype.elements=function(){return[this.elem]};svgedit.history.BatchCommand=function(a){this.text=a||"Batch Command";this.stack=[]};svgedit.history.BatchCommand.type=function(){return"svgedit.history.BatchCommand"};svgedit.history.BatchCommand.prototype.type=svgedit.history.BatchCommand.type;svgedit.history.BatchCommand.prototype.getText=function(){return this.text};svgedit.history.BatchCommand.prototype.apply= -function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_APPLY,this);for(var o=this.stack.length,g=0;g=0;o--)this.stack[o].unapply(a);a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_UNAPPLY, -this)};svgedit.history.BatchCommand.prototype.elements=function(){for(var a=[],o=this.stack.length;o--;)for(var g=this.stack[o].elements(),c=g.length;c--;)a.indexOf(g[c])==-1&&a.push(g[c]);return a};svgedit.history.BatchCommand.prototype.addSubCommand=function(a){this.stack.push(a)};svgedit.history.BatchCommand.prototype.isEmpty=function(){return this.stack.length==0};svgedit.history.UndoManager=function(a){this.handler_=a||null;this.undoStackPointer=0;this.undoStack=[];this.undoChangeStackPointer= +function(a){a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_APPLY,this);for(var p=this.stack.length,g=0;g=0;p--)this.stack[p].unapply(a);a&&a.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_UNAPPLY, +this)};svgedit.history.BatchCommand.prototype.elements=function(){for(var a=[],p=this.stack.length;p--;)for(var g=this.stack[p].elements(),c=g.length;c--;)a.indexOf(g[c])==-1&&a.push(g[c]);return a};svgedit.history.BatchCommand.prototype.addSubCommand=function(a){this.stack.push(a)};svgedit.history.BatchCommand.prototype.isEmpty=function(){return this.stack.length==0};svgedit.history.UndoManager=function(a){this.handler_=a||null;this.undoStackPointer=0;this.undoStack=[];this.undoChangeStackPointer= -1;this.undoableChangeStack=[]};svgedit.history.UndoManager.prototype.resetUndoStack=function(){this.undoStack=[];this.undoStackPointer=0};svgedit.history.UndoManager.prototype.getUndoStackSize=function(){return this.undoStackPointer};svgedit.history.UndoManager.prototype.getRedoStackSize=function(){return this.undoStack.length-this.undoStackPointer};svgedit.history.UndoManager.prototype.getNextUndoCommandText=function(){return this.undoStackPointer>0?this.undoStack[this.undoStackPointer-1].getText(): ""};svgedit.history.UndoManager.prototype.getNextRedoCommandText=function(){return this.undoStackPointer0&&this.undoStack[--this.undoStackPointer].unapply(this.handler_)};svgedit.history.UndoManager.prototype.redo=function(){this.undoStackPointer0&&this.undoStack[this.undoStackPointer++].apply(this.handler_)}; -svgedit.history.UndoManager.prototype.addCommandToHistory=function(a){if(this.undoStackPointer0)this.undoStack=this.undoStack.splice(0,this.undoStackPointer);this.undoStack.push(a);this.undoStackPointer=this.undoStack.length};svgedit.history.UndoManager.prototype.beginUndoableChange=function(a,o){for(var g=++this.undoChangeStackPointer,c=o.length,m=Array(c),s=Array(c);c--;){var b=o[c];if(b!=null){s[c]=b;m[c]=b.getAttribute(a)}}this.undoableChangeStack[g]= -{attrName:a,oldValues:m,elements:s}};svgedit.history.UndoManager.prototype.finishUndoableChange=function(){for(var a=this.undoChangeStackPointer--,o=this.undoableChangeStack[a],g=o.elements.length,c=o.attrName,m=new svgedit.history.BatchCommand("Change "+c);g--;){var s=o.elements[g];if(s!=null){var b={};b[c]=o.oldValues[g];b[c]!=s.getAttribute(c)&&m.addSubCommand(new svgedit.history.ChangeElementCommand(s,b,c))}}this.undoableChangeStack[a]=null;return m}})();svgedit=svgedit||{}; -(function(){if(!svgedit.select)svgedit.select={};var a,o,g;svgedit.select.Selector=function(c,m){this.id=c;this.selectedElement=m;this.locked=true;this.selectorGroup=a.createSVGElement({element:"g",attr:{id:"selectorGroup"+this.id}});this.selectorRect=this.selectorGroup.appendChild(a.createSVGElement({element:"path",attr:{id:"selectedBox"+this.id,fill:"none",stroke:"#4F80FF","stroke-width":"1","shape-rendering":"crispEdges",style:"pointer-events:none"}}));svgedit.browser.isTouch()&&this.selectorRect.setAttribute("stroke-opacity", -0);this.gripCoords={nw:null,n:null,ne:null,e:null,se:null,s:null,sw:null,w:null};this.reset(this.selectedElement)};svgedit.select.Selector.prototype.reset=function(c){this.locked=true;this.selectedElement=c;this.resize();this.selectorGroup.setAttribute("display","inline")};svgedit.select.Selector.prototype.updateGripCursors=function(c){var m=[];c=Math.round(c/45);if(c<0)c+=8;for(var s in g.selectorGrips)m.push(s);for(;c>0;){m.push(m.shift());c--}c=0;for(s in g.selectorGrips){g.selectorGrips[s].setAttribute("style", -"cursor:"+m[c]+"-resize");c++}};svgedit.select.Selector.prototype.showGrips=function(c){g.selectorGripsGroup.setAttribute("display",c?"inline":"none");var m=this.selectedElement;this.hasGrips=c;if(m&&c){this.selectorGroup.appendChild(g.selectorGripsGroup);this.updateGripCursors(svgedit.utilities.getRotationAngle(m))}};svgedit.select.Selector.prototype.resize=function(){var c=this.selectorRect,m=g,s=m.selectorGrips,b=this.selectedElement,f=b.getAttribute("stroke-width"),d=a.currentZoom(),l=1/d;if(b.getAttribute("stroke")!== -"none"&&!isNaN(f))l+=f/2;var p=b.tagName;if(p==="text")l+=2/d;f=svgedit.transformlist.getTransformList(b);f=svgedit.math.transformListToTransform(f).matrix;f.e*=d;f.f*=d;var B=svgedit.utilities.getBBox(b);if(p==="g"&&!$.data(b,"gsvg"))if(p=a.getStrokedBBox(b.childNodes))B=p;p=B.x;var q=B.y,M=B.width;B=B.height;l*=d;d=svgedit.math.transformBox(p*d,q*d,M*d,B*d,f);f=d.aabox;p=f.x-l;q=f.y-l;M=f.width+l*2;var U=f.height+l*2;f=p+M/2;B=q+U/2;if(b=svgedit.utilities.getRotationAngle(b)){p=a.svgRoot().createSVGTransform(); -p.setRotate(-b,f,B);p=p.matrix;d.tl=svgedit.math.transformPoint(d.tl.x,d.tl.y,p);d.tr=svgedit.math.transformPoint(d.tr.x,d.tr.y,p);d.bl=svgedit.math.transformPoint(d.bl.x,d.bl.y,p);d.br=svgedit.math.transformPoint(d.br.x,d.br.y,p);p=d.tl;M=p.x;U=p.y;var P=p.x,I=p.y;p=Math.min;q=Math.max;M=p(M,p(d.tr.x,p(d.bl.x,d.br.x)))-l;U=p(U,p(d.tr.y,p(d.bl.y,d.br.y)))-l;P=q(P,q(d.tr.x,q(d.bl.x,d.br.x)))+l;I=q(I,q(d.tr.y,q(d.bl.y,d.br.y)))+l;p=M;q=U;M=P-M;U=I-U}l=a.svgRoot().suspendRedraw(100);c.setAttribute("d", -"M"+p+","+q+" L"+(p+M)+","+q+" "+(p+M)+","+(q+U)+" "+p+","+(q+U)+"z");this.selectorGroup.setAttribute("transform",b?"rotate("+[b,f,B].join(",")+")":"");if(svgedit.browser.isTouch()){p-=15.75;q-=15.75}else{p-=4;q-=4}this.gripCoords={nw:[p,q].map(Math.round),ne:[p+M,q].map(Math.round),sw:[p,q+U].map(Math.round),se:[p+M,q+U].map(Math.round),n:[p+M/2,q].map(Math.round),w:[p,q+U/2].map(Math.round),e:[p+M,q+U/2].map(Math.round),s:[p+M/2,q+U].map(Math.round)};for(var V in this.gripCoords){c=this.gripCoords[V]; -s[V].setAttribute("x",c[0]);s[V].setAttribute("y",c[1])}this.rotateCoords={nw:[p,q],ne:[p+M+8,q],sw:[p,q+U+8],se:[p+M+8,q+U+8]};for(V in this.rotateCoords){c=this.rotateCoords[V];m.rotateGrips[V].setAttribute("cx",c[0]);m.rotateGrips[V].setAttribute("cy",c[1])}a.svgRoot().unsuspendRedraw(l)};svgedit.select.SelectorManager=function(){this.rubberBandBox=this.selectorParentGroup=null;this.selectors=[];this.selectorMap={};this.selectorGrips={nw:null,n:null,ne:null,e:null,se:null,s:null,sw:null,w:null}; +svgedit.history.UndoManager.prototype.addCommandToHistory=function(a){if(this.undoStackPointer0)this.undoStack=this.undoStack.splice(0,this.undoStackPointer);this.undoStack.push(a);this.undoStackPointer=this.undoStack.length};svgedit.history.UndoManager.prototype.beginUndoableChange=function(a,p){for(var g=++this.undoChangeStackPointer,c=p.length,n=Array(c),s=Array(c);c--;){var b=p[c];if(b!=null){s[c]=b;n[c]=b.getAttribute(a)}}this.undoableChangeStack[g]= +{attrName:a,oldValues:n,elements:s}};svgedit.history.UndoManager.prototype.finishUndoableChange=function(){for(var a=this.undoChangeStackPointer--,p=this.undoableChangeStack[a],g=p.elements.length,c=p.attrName,n=new svgedit.history.BatchCommand("Change "+c);g--;){var s=p.elements[g];if(s!=null){var b={};b[c]=p.oldValues[g];b[c]!=s.getAttribute(c)&&n.addSubCommand(new svgedit.history.ChangeElementCommand(s,b,c))}}this.undoableChangeStack[a]=null;return n}})();svgedit=svgedit||{}; +(function(){if(!svgedit.select)svgedit.select={};var a,p,g;svgedit.select.Selector=function(c,n){this.id=c;this.selectedElement=n;this.locked=true;this.selectorGroup=a.createSVGElement({element:"g",attr:{id:"selectorGroup"+this.id}});this.selectorRect=this.selectorGroup.appendChild(a.createSVGElement({element:"path",attr:{id:"selectedBox"+this.id,fill:"none",stroke:"#4F80FF","stroke-width":"1","shape-rendering":"crispEdges",style:"pointer-events:none"}}));svgedit.browser.isTouch()&&this.selectorRect.setAttribute("stroke-opacity", +0.3);this.gripCoords={nw:null,n:null,ne:null,e:null,se:null,s:null,sw:null,w:null};this.reset(this.selectedElement)};svgedit.select.Selector.prototype.reset=function(c){this.locked=true;this.selectedElement=c;this.resize();this.selectorGroup.setAttribute("display","inline")};svgedit.select.Selector.prototype.updateGripCursors=function(c){var n=[];c=Math.round(c/45);if(c<0)c+=8;for(var s in g.selectorGrips)n.push(s);for(;c>0;){n.push(n.shift());c--}c=0;for(s in g.selectorGrips){g.selectorGrips[s].setAttribute("style", +"cursor:"+n[c]+"-resize");c++}};svgedit.select.Selector.prototype.showGrips=function(c){g.selectorGripsGroup.setAttribute("display",c?"inline":"none");var n=this.selectedElement;this.hasGrips=c;if(n&&c){this.selectorGroup.appendChild(g.selectorGripsGroup);this.updateGripCursors(svgedit.utilities.getRotationAngle(n))}};svgedit.select.Selector.prototype.resize=function(){var c=this.selectorRect,n=g,s=n.selectorGrips,b=this.selectedElement,f=b.getAttribute("stroke-width"),d=a.currentZoom(),m=1/d;if(b.getAttribute("stroke")!== +"none"&&!isNaN(f))m+=f/2;var q=b.tagName;if(q==="text")m+=2/d;f=svgedit.transformlist.getTransformList(b);f=svgedit.math.transformListToTransform(f).matrix;f.e*=d;f.f*=d;var B=svgedit.utilities.getBBox(b);if(q==="g"&&!$.data(b,"gsvg"))if(q=a.getStrokedBBox(b.childNodes))B=q;q=B.x;var o=B.y,K=B.width;B=B.height;m*=d;d=svgedit.math.transformBox(q*d,o*d,K*d,B*d,f);f=d.aabox;q=f.x-m;o=f.y-m;K=f.width+m*2;var S=f.height+m*2;f=q+K/2;B=o+S/2;if(b=svgedit.utilities.getRotationAngle(b)){q=a.svgRoot().createSVGTransform(); +q.setRotate(-b,f,B);q=q.matrix;d.tl=svgedit.math.transformPoint(d.tl.x,d.tl.y,q);d.tr=svgedit.math.transformPoint(d.tr.x,d.tr.y,q);d.bl=svgedit.math.transformPoint(d.bl.x,d.bl.y,q);d.br=svgedit.math.transformPoint(d.br.x,d.br.y,q);q=d.tl;K=q.x;S=q.y;var M=q.x,J=q.y;q=Math.min;o=Math.max;K=q(K,q(d.tr.x,q(d.bl.x,d.br.x)))-m;S=q(S,q(d.tr.y,q(d.bl.y,d.br.y)))-m;M=o(M,o(d.tr.x,o(d.bl.x,d.br.x)))+m;J=o(J,o(d.tr.y,o(d.bl.y,d.br.y)))+m;q=K;o=S;K=M-K;S=J-S}m=a.svgRoot().suspendRedraw(100);c.setAttribute("d", +"M"+q+","+o+" L"+(q+K)+","+o+" "+(q+K)+","+(o+S)+" "+q+","+(o+S)+"z");this.selectorGroup.setAttribute("transform",b?"rotate("+[b,f,B].join(",")+")":"");if(svgedit.browser.isTouch()){q-=15.75;o-=15.75}else{q-=4;o-=4}this.gripCoords={nw:[q,o].map(Math.round),ne:[q+K,o].map(Math.round),sw:[q,o+S].map(Math.round),se:[q+K,o+S].map(Math.round),n:[q+K/2,o].map(Math.round),w:[q,o+S/2].map(Math.round),e:[q+K,o+S/2].map(Math.round),s:[q+K/2,o+S].map(Math.round)};for(var Q in this.gripCoords){c=this.gripCoords[Q]; +s[Q].setAttribute("x",c[0]);s[Q].setAttribute("y",c[1])}this.rotateCoords={nw:[q,o],ne:[q+K+8,o],sw:[q,o+S+8],se:[q+K+8,o+S+8]};for(Q in this.rotateCoords){c=this.rotateCoords[Q];n.rotateGrips[Q].setAttribute("cx",c[0]);n.rotateGrips[Q].setAttribute("cy",c[1])}a.svgRoot().unsuspendRedraw(m)};svgedit.select.SelectorManager=function(){this.rubberBandBox=this.selectorParentGroup=null;this.selectors=[];this.selectorMap={};this.selectorGrips={nw:null,n:null,ne:null,e:null,se:null,s:null,sw:null,w:null}; this.selectorGripsGroup=null;this.rotateGrips={nw:null,ne:null,se:null,sw:null};this.initGroup()};svgedit.select.SelectorManager.prototype.initGroup=function(){this.selectorParentGroup&&this.selectorParentGroup.parentNode&&this.selectorParentGroup.parentNode.removeChild(this.selectorParentGroup);this.selectorParentGroup=a.createSVGElement({element:"g",attr:{id:"selectorParentGroup"}});this.selectorGripsGroup=a.createSVGElement({element:"g",attr:{display:"none"}});this.selectorParentGroup.appendChild(this.selectorGripsGroup); -a.svgRoot().appendChild(this.selectorParentGroup);this.selectorMap={};this.selectors=[];this.rubberBandBox=null;for(var c in this.rotateGrips){var m=a.createSVGElement({element:"circle",attr:{id:"selectorGrip_rotate_"+c,fill:"#000",r:8,stroke:"#000","fill-opacity":0,"stroke-opacity":0,"stroke-width":0,style:"cursor:url("+o.imgPath+"rotate.png) 12 12, auto;"}});$.data(m,"dir",c);$.data(m,"type","rotate");this.rotateGrips[c]=this.selectorGripsGroup.appendChild(m)}for(c in this.selectorGrips){m=a.createSVGElement({element:"rect", -attr:{id:"selectorGrip_resize_"+c,width:8,height:8,fill:"#4F80FF",stroke:"rgba(0,0,0,0)","stroke-width":1,style:"cursor:"+c+"-resize","pointer-events":"all"}});if(svgedit.browser.isTouch()){m.setAttribute("width",30.5);m.setAttribute("height",30.5);m.setAttribute("fill-opacity",0.3)}$.data(m,"dir",c);$.data(m,"type","resize");this.selectorGrips[c]=this.selectorGripsGroup.appendChild(m)}if(!$("#canvasBackground").length){c=o.dimensions;c=a.createSVGElement({element:"svg",attr:{id:"canvasBackground", -width:c[0],height:c[1],x:0,y:0,overflow:svgedit.browser.isWebkit()?"none":"visible",style:"pointer-events:none"}});m=a.createSVGElement({element:"rect",attr:{width:"100%",height:"100%",x:0,y:0,"stroke-width":1,stroke:"#000",fill:"#FFF",style:"pointer-events:none"}});c.appendChild(m);a.svgRoot().insertBefore(c,a.svgContent())}};svgedit.select.SelectorManager.prototype.requestSelector=function(c){if(c==null)return null;var m=this.selectors.length;if(typeof this.selectorMap[c.id]=="object"){this.selectorMap[c.id].locked= -true;return this.selectorMap[c.id]}for(var s=0;s element";this.svgElem_=c;this.obj_num=0;this.idPrefix=m||"svg_";this.releasedNums=[];this.all_layers=[];this.current_layer=null;this.nonce_= -"";var s=this.svgElem_.getAttributeNS("http://svg-edit.googlecode.com","nonce");if(s&&g!=o.NEVER_RANDOMIZE)this.nonce_=s;else g==o.ALWAYS_RANDOMIZE&&this.setNonce(Math.floor(Math.random()*100001))};svgedit.draw.Drawing.prototype.getElem_=function(c){return this.svgElem_.querySelector?this.svgElem_.querySelector("#"+c):$(this.svgElem_).find("[id="+c+"]")[0]};svgedit.draw.Drawing.prototype.getSvgElem=function(){return this.svgElem_};svgedit.draw.Drawing.prototype.getNonce=function(){return this.nonce_}; +a.svgRoot().appendChild(this.selectorParentGroup);this.selectorMap={};this.selectors=[];this.rubberBandBox=null;for(var c in this.rotateGrips){var n=a.createSVGElement({element:"circle",attr:{id:"selectorGrip_rotate_"+c,fill:"#000",r:8,stroke:"#000","fill-opacity":0,"stroke-opacity":0,"stroke-width":0,style:"cursor:url("+p.imgPath+"rotate.png) 12 12, auto;"}});$.data(n,"dir",c);$.data(n,"type","rotate");this.rotateGrips[c]=this.selectorGripsGroup.appendChild(n)}for(c in this.selectorGrips){n=a.createSVGElement({element:"rect", +attr:{id:"selectorGrip_resize_"+c,width:8,height:8,fill:"#4F80FF",stroke:"rgba(0,0,0,0)","stroke-width":1,style:"cursor:"+c+"-resize","pointer-events":"all"}});if(svgedit.browser.isTouch()){n.setAttribute("width",30.5);n.setAttribute("height",30.5);n.setAttribute("fill-opacity",0.3)}$.data(n,"dir",c);$.data(n,"type","resize");this.selectorGrips[c]=this.selectorGripsGroup.appendChild(n)}if(!$("#canvasBackground").length){c=p.dimensions;c=a.createSVGElement({element:"svg",attr:{id:"canvasBackground", +width:c[0],height:c[1],x:0,y:0,overflow:svgedit.browser.isWebkit()?"none":"visible",style:"pointer-events:none"}});n=a.createSVGElement({element:"defs",attr:{id:"placeholder_defs"}});var s=a.createSVGElement({element:"pattern",attr:{id:"checkerPattern",patternUnits:"userSpaceOnUse",x:0,y:0,width:20,height:20,viewBox:"0 0 10 10"}}),b=a.createSVGElement({element:"rect",attr:{x:0,y:0,width:10,height:10,fill:"#fff"}}),f=a.createSVGElement({element:"rect",attr:{x:0,y:0,width:5,height:5,fill:"#eee"}}), +d=a.createSVGElement({element:"rect",attr:{x:5,y:5,width:5,height:5,fill:"#eee"}}),m=a.createSVGElement({element:"rect",attr:{width:"100%",height:"100%",x:0,y:0,"stroke-width":1,stroke:"#000",fill:"url(#checkerPattern)",style:"pointer-events:none"}});c.appendChild(n);n.appendChild(s);s.appendChild(b);s.appendChild(f);s.appendChild(d);c.appendChild(m);a.svgRoot().insertBefore(c,a.svgContent())}};svgedit.select.SelectorManager.prototype.requestSelector=function(c){if(c==null)return null;var n=this.selectors.length; +if(typeof this.selectorMap[c.id]=="object"){this.selectorMap[c.id].locked=true;return this.selectorMap[c.id]}for(var s=0;s element";this.svgElem_=c;this.obj_num=0;this.idPrefix=n||"svg_";this.releasedNums=[];this.all_layers=[];this.current_layer=null;this.nonce_= +"";var s=this.svgElem_.getAttributeNS("http://svg-edit.googlecode.com","nonce");if(s&&g!=p.NEVER_RANDOMIZE)this.nonce_=s;else g==p.ALWAYS_RANDOMIZE&&this.setNonce(Math.floor(Math.random()*100001))};svgedit.draw.Drawing.prototype.getElem_=function(c){return this.svgElem_.querySelector?this.svgElem_.querySelector("#"+c):$(this.svgElem_).find("[id="+c+"]")[0]};svgedit.draw.Drawing.prototype.getSvgElem=function(){return this.svgElem_};svgedit.draw.Drawing.prototype.getNonce=function(){return this.nonce_}; svgedit.draw.Drawing.prototype.setNonce=function(c){this.svgElem_.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:se","http://svg-edit.googlecode.com");this.svgElem_.setAttributeNS("http://svg-edit.googlecode.com","se:nonce",c);this.nonce_=c};svgedit.draw.Drawing.prototype.clearNonce=function(){this.nonce_=""};svgedit.draw.Drawing.prototype.getId=function(){return this.nonce_?this.idPrefix+this.nonce_+"_"+this.obj_num:this.idPrefix+this.obj_num};svgedit.draw.Drawing.prototype.getNextId=function(){var c= -this.obj_num,m=false;if(this.releasedNums.length>0){this.obj_num=this.releasedNums.pop();m=true}else this.obj_num++;for(var s=this.getId();this.getElem_(s);){if(m){this.obj_num=c;m=false}this.obj_num++;s=this.getId()}if(m)this.obj_num=c;return s};svgedit.draw.Drawing.prototype.releaseId=function(c){var m=this.idPrefix+(this.nonce_?this.nonce_+"_":"");if(typeof c!="string"||c.indexOf(m)!=0)return false;c=parseInt(c.substr(m.length));if(typeof c!="number"||c<=0||this.releasedNums.indexOf(c)!=-1)return false; -this.releasedNums.push(c);return true};svgedit.draw.Drawing.prototype.getNumLayers=function(){return this.all_layers.length};svgedit.draw.Drawing.prototype.hasLayer=function(c){for(var m=0;m=0&&c1){var c=this.current_layer.parentNode.removeChild(this.current_layer);this.identifyLayers();return c}return null};svgedit.draw.Drawing.prototype.identifyLayers=function(){this.all_layers=[];for(var c=this.svgElem_.childNodes.length,m=[],s=[],b=null,f=false,d=0;d0||!f){for(d=1;s.indexOf("Layer "+d)>=0;)d++;s="Layer "+d;b=c.createElementNS("http://www.w3.org/2000/svg","g");f=c.createElementNS("http://www.w3.org/2000/svg","title");f.textContent=s; -b.appendChild(f);for(f=0;f1))for(var s=0;s0){this.obj_num=this.releasedNums.pop();n=true}else this.obj_num++;for(var s=this.getId();this.getElem_(s);){if(n){this.obj_num=c;n=false}this.obj_num++;s=this.getId()}if(n)this.obj_num=c;return s};svgedit.draw.Drawing.prototype.releaseId=function(c){var n=this.idPrefix+(this.nonce_?this.nonce_+"_":"");if(typeof c!="string"||c.indexOf(n)!=0)return false;c=parseInt(c.substr(n.length));if(typeof c!="number"||c<=0||this.releasedNums.indexOf(c)!=-1)return false; +this.releasedNums.push(c);return true};svgedit.draw.Drawing.prototype.getNumLayers=function(){return this.all_layers.length};svgedit.draw.Drawing.prototype.hasLayer=function(c){for(var n=0;n=0&&c1){var c=this.current_layer.parentNode.removeChild(this.current_layer);this.identifyLayers();return c}return null};svgedit.draw.Drawing.prototype.identifyLayers=function(){this.all_layers=[];for(var c=this.svgElem_.childNodes.length,n=[],s=[],b=null,f=false,d=0;d0||!f){for(d=1;s.indexOf("Layer "+d)>=0;)d++;s="Layer "+d;b=c.createElementNS("http://www.w3.org/2000/svg","g");f=c.createElementNS("http://www.w3.org/2000/svg","title");f.textContent=s; +b.appendChild(f);for(f=0;f1))for(var s=0;s0){f=U0){f=S element";this.elem=f;this.segs=[];this.selected_pts=[];svgedit.path.path=this;this.init()};svgedit.path.Path.prototype.init=function(){$(svgedit.path.getGripContainer()).find("*").attr("display","none");var f= -this.elem.pathSegList,d=f.numberOfItems;this.segs=[];this.selected_pts=[];this.first_seg=null;for(var l=0;l=d?null:f[l+1],M=l-1<0?null:f[l-1];if(B.type===2){if(M&&M.type!==1){q=f[p];q.next=f[p+1];q.next.prev=q;q.addGrip()}p=l}else if(q&&q.type===1){B.next=f[p+1];B.next.prev=B;B.mate=f[p];B.addGrip();if(this.first_seg==null)this.first_seg=B}else if(q){if(B.type!== -1){B.addGrip();if(q&&q.type!==2){B.next=q;B.next.prev=B}}}else if(B.type!==1){q=f[p];q.next=f[p+1];q.next.prev=q;q.addGrip();B.addGrip();if(!this.first_seg)this.first_seg=f[p]}}return this};svgedit.path.Path.prototype.eachSeg=function(f){for(var d=this.segs.length,l=0;l=d?null:f[m+1],K=m-1<0?null:f[m-1];if(B.type===2){if(K&&K.type!==1){o=f[q];o.next=f[q+1];o.next.prev=o;o.addGrip()}q=m}else if(o&&o.type===1){B.next=f[q+1];B.next.prev=B;B.mate=f[q];B.addGrip();if(this.first_seg==null)this.first_seg=B}else if(o){if(B.type!== +1){B.addGrip();if(o&&o.type!==2){B.next=o;B.next.prev=B}}}else if(B.type!==1){o=f[q];o.next=f[q+1];o.next.prev=o;o.addGrip();B.addGrip();if(!this.first_seg)this.first_seg=f[q]}}return this};svgedit.path.Path.prototype.eachSeg=function(f){for(var d=this.segs.length,m=0;m').documentElement, -true);a.appendChild(d);var l=f.createElementNS(c,"svg");(b.clearSvgContentElement=function(){for(;l.firstChild;)l.removeChild(l.firstChild);$(l).attr({id:"svgcontent",width:s[0],height:s[1],x:s[0],y:s[1],overflow:m.show_outside_canvas?"visible":"hidden",xmlns:c,"xmlns:se":"http://svg-edit.googlecode.com","xmlns:xlink":"http://www.w3.org/1999/xlink"}).appendTo(d);var e=f.createComment(" Created with Method Draw - http://github.com/duopixel/Method-Draw/ ");l.appendChild(e)})();var p="svg_";b.setIdPrefix= -function(e){p=e};b.current_drawing_=new svgedit.draw.Drawing(l,p);var B=b.getCurrentDrawing=function(){return b.current_drawing_},q=1,M=null,U={shape:{fill:(m.initFill.color=="none"?"":"#")+m.initFill.color,fill_paint:null,fill_opacity:m.initFill.opacity,stroke:"#"+m.initStroke.color,stroke_paint:null,stroke_opacity:m.initStroke.opacity,stroke_width:m.initStroke.width,stroke_dasharray:"none",stroke_linejoin:"miter",stroke_linecap:"butt",opacity:m.initOpacity}};U.text=$.extend(true,{},U.shape);$.extend(U.text, -{fill:"#000000",stroke_width:0,font_size:24,font_family:"Junction"});var P=U.shape,I=Array(1),V=this.addSvgElementFromJson=function(e){var h=svgedit.utilities.getElem(e.attr.id),k=B().getCurrentLayer();if(h&&e.element!=h.tagName){k.removeChild(h);h=null}if(!h){h=f.createElementNS(c,e.element);if(k)(M||k).appendChild(h)}e.curStyles&&svgedit.utilities.assignAttributes(h,{fill:P.fill,stroke:P.stroke,"stroke-width":P.stroke_width,"stroke-dasharray":P.stroke_dasharray,"stroke-linejoin":P.stroke_linejoin, -"stroke-linecap":P.stroke_linecap,"stroke-opacity":P.stroke_opacity,"fill-opacity":P.fill_opacity,opacity:P.opacity/2,style:"pointer-events:inherit"},100);svgedit.utilities.assignAttributes(h,e.attr,100);svgedit.utilities.cleanupElement(h);return h},ca=b.getTransformList=svgedit.transformlist.getTransformList,Q=svgedit.math.transformPoint,W=b.matrixMultiply=svgedit.math.matrixMultiply,ha=b.hasMatrixTransform=svgedit.math.hasMatrixTransform,X=b.transformListToTransform=svgedit.math.transformListToTransform, -R=svgedit.math.snapToAngle,ba=svgedit.math.getMatrix;svgedit.units.init({getBaseUnit:function(){return m.baseUnit},getElement:svgedit.utilities.getElem,getHeight:function(){return l.getAttribute("height")/q},getWidth:function(){return l.getAttribute("width")/q},getRoundDigits:function(){return fb.round_digits}});var ta=b.convertToNum=svgedit.units.convertToNum;svgedit.utilities.init({getDOMDocument:function(){return f},getDOMContainer:function(){return a},getSVGRoot:function(){return d},getSelectedElements:function(){return I}, -getSVGContent:function(){return l}});var ja=b.getUrlFromAttr=svgedit.utilities.getUrlFromAttr,ea=b.getHref=svgedit.utilities.getHref,aa=b.setHref=svgedit.utilities.setHref,Z=svgedit.utilities.getPathBBox;b.getBBox=svgedit.utilities.getBBox;var la=b.getRotationAngle=svgedit.utilities.getRotationAngle,sa=b.getElem=svgedit.utilities.getElem,na=b.assignAttributes=svgedit.utilities.assignAttributes,oa=this.cleanupElement=svgedit.utilities.cleanupElement,Ba=svgedit.sanitize.getNSMap(),Ga=b.sanitizeSvg= -svgedit.sanitize.sanitizeSvg,Ja=svgedit.history.MoveElementCommand,Ca=svgedit.history.InsertElementCommand,La=svgedit.history.RemoveElementCommand,Na=svgedit.history.ChangeElementCommand,Ha=svgedit.history.BatchCommand;b.undoMgr=new svgedit.history.UndoManager({handleHistoryEvent:function(e,h){var k=svgedit.history.HistoryEventTypes;if(e==k.BEFORE_UNAPPLY||e==k.BEFORE_APPLY)b.clearSelection();else if(e==k.AFTER_APPLY||e==k.AFTER_UNAPPLY){var w=h.elements();b.pathActions.clear();O("changed",w);w=h.type(); -k=e==k.AFTER_APPLY;if(w==Ja.type()){k=k?h.newParent:h.oldParent;k==l&&b.identifyLayers()}else if(w==Ca.type()||w==La.type()){h.parent==l&&b.identifyLayers();if(w==Ca.type())k&&$a(h.elem);else k||$a(h.elem);h.elem.tagName==="use"&&Qb(h.elem)}else if(w==Na.type()){h.elem.tagName=="title"&&h.elem.parentNode.parentNode==l&&b.identifyLayers();k=k?h.newValues:h.oldValues;k.stdDeviation&&b.setBlurOffsets(h.elem.parentNode,k.stdDeviation);if(h.elem.tagName==="use"&&svgedit.browser.isWebkit()){w=h.elem;if(!w.getAttribute("x")&& -!w.getAttribute("y")){k=w.parentNode;var v=w.nextSibling;k.removeChild(w);k.insertBefore(w,v)}}}}}});var va=function(e){b.undoMgr.addCommandToHistory(e)};svgedit.select.init(m,{createSVGElement:function(e){return b.addSvgElementFromJson(e)},svgRoot:function(){return d},svgContent:function(){return l},currentZoom:function(){return q},getStrokedBBox:function(e){return b.getStrokedBBox([e])}});var Fa=this.selectorManager=svgedit.select.getSelectorManager(),ub=this.hoverManager=svgedit.select.getSelectorManager(); -svgedit.path.init({getCurrentZoom:function(){return q},getSVGRoot:function(){return d}});svgedit.utilities.snapToGrid=function(e){var h=m.snappingStep,k=m.baseUnit;if(k!=="px")h*=svgedit.units.getTypeMap()[k];return e=Math.round(e/h)*h};var Aa=svgedit.utilities.snapToGrid,vb={exportNoBlur:"Blurred elements will appear as un-blurred",exportNoforeignObject:"foreignObject elements will not appear",exportNoDashArray:"Strokes will appear filled",exportNoText:"Text may not appear as expected"},Ua=["clip-path", -"fill","filter","marker-end","marker-mid","marker-start","mask","stroke"],Ta=$.data,$a=function(e){var h=$(e).attr(Ua),k;for(k in h){var w=h[k];if(w&&w.indexOf("url(")===0){w=ja(w).substr(1);if(!sa(w)){sb().appendChild(xb[w]);delete xb[w]}}}e=e.getElementsByTagName("*");if(e.length){h=0;for(k=e.length;h=0)C=E=b.convertToPath(H,true);else if(H.tagName=="rect"){var K=H.getAttribute("rx"),L=H.getAttribute("ry");if(K||L)C=E=b.convertToPath(H,true)}if(!E){var Y=H.cloneNode(true),n=document.createElementNS(c,"g"),A=H.parentNode;A.appendChild(n);n.appendChild(Y);C=svgedit.utilities.bboxToObj(n.getBBox()); -A.removeChild(n)}}return C}catch(G){console.log(H,G);return null}},k;$.each(e,function(){if(!k)if(this.parentNode)k=h(this)});if(k==null)return null;var w=k.x+k.width,v=k.y+k.height,F=k.x,z=k.y,u=function(H){var C=H.getAttribute("stroke-width"),E=0;if(H.getAttribute("stroke")!="none"&&!isNaN(C))E+=C/2;return E},D=[];$.each(e,function(H,C){var E=h(C);if(E){var K=u(C);F=Math.min(F,E.x-K);z=Math.min(z,E.y-K);D.push(E)}});k.x=F;k.y=z;$.each(e,function(H,C){var E=D[H];if(E&&C.nodeType==1){var K=u(C);w= -Math.max(w,E.x+E.width+K);v=Math.max(v,E.y+E.height+K)}});k.width=w-F;k.height=v-z;return k};var wb=this.getVisibleElements=function(e){e||(e=$(l).children());e.find("#canvas_background").length&&e.splice(0,1);var h=[];$(e).children().each(function(k,w){try{w.getBBox()&&h.push(w)}catch(v){}});return h.reverse()},Db=this.getVisibleElementsAndBBoxes=function(e){e||(e=$(l).children());var h=[];$(e).children().each(function(k,w){try{w.getBBox()&&h.push({elem:w,bbox:getStrokedBBox([w])})}catch(v){}}); -return h.reverse()},ma=this.groupSvgElem=function(e){var h=document.createElementNS(c,"g");e.parentNode.replaceChild(h,e);$(h).append(e).data("gsvg",e)[0].id=S()},ga=function(e){var h=document.createElementNS(e.namespaceURI,e.nodeName);h.removeAttribute("id");$.each(e.attributes,function(w,v){v.localName!="-moz-math-font-style"&&h.setAttributeNS(v.namespaceURI,v.nodeName,v.nodeValue)});if(svgedit.browser.isWebkit()&&e.nodeName=="path"){var k=Ka.convertPath(e);h.setAttribute("d",k)}$.each(e.childNodes, -function(w,v){switch(v.nodeType){case 1:h.appendChild(ga(v));break;case 3:h.textContent=v.nodeValue}});if($(e).data("gsvg"))$(h).data("gsvg",h.firstChild);else if($(e).data("symbol")){e=$(e).data("symbol");$(h).data("ref",e).data("symbol",e)}else h.tagName=="image"&&tb(h);h.id=S();return h},qa,S,O;(function(e){var h={};qa=e.getId=function(){return B().getId()};S=e.getNextId=function(){return B().getNextId()};O=e.call=function(k,w){if(h[k])return h[k](this,w)};e.bind=function(k,w){var v=h[k];h[k]= -w;return v}})(b);this.prepareSvg=function(e){this.sanitizeSvg(e.documentElement);e=e.getElementsByTagNameNS(c,"path");for(var h=0,k=e.length;h0&&v.getItem(0).type==4&&v.removeItem(0);if(e!=0){F=Q(F,z,X(v).matrix);z=d.createSVGTransform();z.setRotate(e,F.x,F.y);v.numberOfItems?v.insertItemBefore(z,0):v.appendItem(z)}else v.numberOfItems==0&&k.removeAttribute("transform");if(!h){v=k.getAttribute("transform");k.setAttribute("transform",w);jb("transform",v,I);O("changed",I)}sa("pathpointgrip_container"); -k=Fa.requestSelector(I[0]);k.resize();k.updateGripCursors(e)};var Qa=this.recalculateAllSelectedDimensions=function(){for(var e=new Ha(pb=="none"?"position":"size"),h=I.length;h--;){var k=hb(I[h]);k&&e.addSubCommand(k)}if(!e.isEmpty()){va(e);O("changed",I)}},Ya=[0,"z","M","m","L","l","C","c","Q","q","A","a","H","h","V","v","S","s","T","t"],kb=function(e){console.log([e.a,e.b,e.c,e.d,e.e,e.f])},mb=this.remapElement=function(e,h,k){var w=m.gridSnapping&&e.parentNode.parentNode.localName==="svg",v=function(){if(w)for(var E in h)h[E]= -Aa(h[E]);na(e,h,1E3,true)};box=svgedit.utilities.getBBox(e);for(var F=0;F<2;F++){var z=F===0?"fill":"stroke",u=e.getAttribute(z);if(u&&u.indexOf("url(")===0)if(k.a<0||k.d<0){u=fa(u).cloneNode(true);if(k.a<0){var D=u.getAttribute("x1"),H=u.getAttribute("x2");u.setAttribute("x1",-(D-1));u.setAttribute("x2",-(H-1))}if(k.d<0){D=u.getAttribute("y1");H=u.getAttribute("y2");u.setAttribute("y1",-(D-1));u.setAttribute("y2",-(H-1))}u.id=S();sb().appendChild(u);e.setAttribute(z,"url(#"+u.id+")")}}F=e.tagName; -if(F==="g"||F==="text"||F==="use")if(k.a==1&&k.b==0&&k.c==0&&k.d==1&&(k.e!=0||k.f!=0)){z=X(e).matrix;z=W(z.inverse(),k,z);h.x=parseFloat(h.x)+z.e;h.y=parseFloat(h.y)+z.f}else{z=ca(e);u=d.createSVGTransform();u.setMatrix(W(X(z).matrix,k));z.clear();z.appendItem(u)}switch(F){case "foreignObject":case "rect":case "image":if(F==="image"&&(k.a<0||k.d<0)){z=ca(e);u=d.createSVGTransform();u.setMatrix(W(X(z).matrix,k));z.clear();z.appendItem(u)}else{z=Q(h.x,h.y,k);h.width=k.a*h.width;h.height=k.d*h.height; -h.x=z.x+Math.min(0,h.width);h.y=z.y+Math.min(0,h.height);h.width=Math.abs(h.width);h.height=Math.abs(h.height)}v();break;case "ellipse":F=Q(h.cx,h.cy,k);h.cx=F.x;h.cy=F.y;h.rx=k.a*h.rx;h.ry=k.d*h.ry;h.rx=Math.abs(h.rx);h.ry=Math.abs(h.ry);v();break;case "circle":F=Q(h.cx,h.cy,k);h.cx=F.x;h.cy=F.y;F=svgedit.math.transformBox(box.x,box.y,box.width,box.height,k);h.r=Math.min((F.tr.x-F.tl.x)/2,(F.bl.y-F.tl.y)/2);if(h.r)h.r=Math.abs(h.r);v();break;case "line":z=Q(h.x1,h.y1,k);D=Q(h.x2,h.y2,k);h.x1=z.x; -h.y1=z.y;h.x2=D.x;h.y2=D.y;case "text":k=e.querySelectorAll("tspan");for(F=k.length;F--;){z=ta("x",e.getAttribute("x"));u=ta("x",k[F].getAttribute("x"));D=ta("y",e.getAttribute("y"));H=ta("y",k[F].getAttribute("y"));var C={};if(!isNaN(z)&&!isNaN(u)&&z!=0&&u!=0&&h.x)C.x=h.x-(z-u);if(!isNaN(D)&&!isNaN(H)&&D!=0&&H!=0&&h.y)C.y=h.y-(D-H);if(C.x||C.y)na(k[F],C,1E3,true)}v();break;case "use":v();break;case "g":(v=$(e).data("gsvg"))&&na(v,h,1E3,true);break;case "polyline":case "polygon":v=h.points.length; -for(F=0;F0){for(var k=h.numberOfItems;k--;){var w=h.getItem(k);if(w.type===0)h.removeItem(k);else if(w.type===1)svgedit.math.isIdentity(w.matrix)&&h.removeItem(k);else w.type===4&&w.angle===0&&h.removeItem(k)}if(h.numberOfItems===1&&la(e))return null}if(!h||h.numberOfItems==0){e.removeAttribute("transform");return null}if(h){k=h.numberOfItems;for(var v=[];k--;){w=h.getItem(k);if(w.type===1)v.push([w.matrix,k]);else if(v.length)v=[]}if(v.length===2){k=d.createSVGTransformFromMatrix(W(v[1][0], -v[0][0]));h.removeItem(v[0][1]);h.removeItem(v[1][1]);h.insertItemBefore(k,v[1][1])}k=h.numberOfItems;if(k>=2&&h.getItem(k-2).type===1&&h.getItem(k-1).type===2){v=d.createSVGTransform();w=W(h.getItem(k-2).matrix,h.getItem(k-1).matrix);v.setMatrix(w);h.removeItem(k-2);h.removeItem(k-2);h.appendItem(v)}}switch(e.tagName){case "line":case "polyline":case "polygon":case "path":break;default:if(h.numberOfItems===1&&h.getItem(0).type===1||h.numberOfItems===2&&h.getItem(0).type===1&&h.getItem(0).type=== -4)return null}var F=$(e).data("gsvg");k=new Ha("Transform");var z={},u=null;w=[];switch(e.tagName){case "line":w=["x1","y1","x2","y2"];break;case "circle":w=["cx","cy","r"];break;case "ellipse":w=["cx","cy","rx","ry"];break;case "foreignObject":case "rect":case "image":w=["width","height","x","y"];break;case "use":case "text":case "tspan":w=["x","y"];break;case "polygon":case "polyline":u={};u.points=e.getAttribute("points");v=e.points;var D=v.numberOfItems;z.points=Array(D);for(var H=0;H1.0E-10?Math.sin(H)/(1-Math.cos(H)):2/H;for(H=0;H=3&&h.getItem(L-2).type==3&&h.getItem(L-3).type==2&&h.getItem(L-1).type==2){H=3;var n=h.getItem(L-3).matrix,A=h.getItem(L-2).matrix,G=h.getItem(L-1).matrix;D=e.childNodes;for(C=D.length;C--;){var N=D.item(C);w=F=0;if(N.nodeType== -1){var J=ca(N);if(J){w=X(J).matrix;F=la(N);var T=Za,da=[];Za=N.getAttribute("transform");if(F||ha(J)){var ia=d.createSVGTransform();ia.setMatrix(W(n,A,G,w));J.clear();J.appendItem(ia);da.push(ia)}else{F=W(w.inverse(),G,w);ia=d.createSVGMatrix();ia.e=-F.e;ia.f=-F.f;w=W(ia.inverse(),w.inverse(),n,A,G,w,F.inverse());var pa=d.createSVGTransform(),ra=d.createSVGTransform(),ua=d.createSVGTransform();pa.setTranslate(F.e,F.f);ra.setScale(w.a,w.d);ua.setTranslate(ia.e,ia.f);J.appendItem(ua);J.appendItem(ra); -J.appendItem(pa);da.push(ua);da.push(ra);da.push(pa)}k.addSubCommand(hb(N));Za=T}}}h.removeItem(L-1);h.removeItem(L-2);h.removeItem(L-3)}else if(L>=3&&h.getItem(L-1).type==1){H=3;w=X(h).matrix;ia=d.createSVGTransform();ia.setMatrix(w);h.clear();h.appendItem(ia)}else if((L==1||L>1&&h.getItem(1).type!=3)&&h.getItem(0).type==2){H=2;F=X(h).matrix;h.removeItem(0);w=X(h).matrix.inverse();w=W(w,F);F=w.e;w=w.f;if(F!=0||w!=0){D=e.childNodes;C=D.length;for(L=[];C--;){N=D.item(C);if(N.nodeType==1){if(N.getAttribute("clip-path")){T= -N.getAttribute("clip-path");if(L.indexOf(T)===-1){nb(T,F,w);L.push(T)}}T=Za;Za=N.getAttribute("transform");if(J=ca(N)){n=d.createSVGTransform();n.setTranslate(F,w);J.numberOfItems?J.insertItemBefore(n,0):J.appendItem(n);k.addSubCommand(hb(N));J=e.getElementsByTagNameNS(c,"use");N="#"+N.id;for(n=J.length;n--;){A=J.item(n);if(N==ea(A)){G=d.createSVGTransform();G.setTranslate(-F,-w);ca(A).insertItemBefore(G,0);k.addSubCommand(hb(A))}}Za=T}}}L=[];Za=T}}else if(L==1&&h.getItem(0).type==1&&!v){H=1;w=h.getItem(0).matrix; -D=e.childNodes;for(C=D.length;C--;){N=D.item(C);if(N.nodeType==1){T=Za;Za=N.getAttribute("transform");if(J=ca(N)){F=W(w,X(J).matrix);L=d.createSVGTransform();L.setMatrix(F);J.clear();J.appendItem(L,0);k.addSubCommand(hb(N));Za=T;T=N.getAttribute("stroke-width");N.getAttribute("stroke")!=="none"&&!isNaN(T)&&N.setAttribute("stroke-width",T*((Math.abs(F.a)+Math.abs(F.d))/2))}}}h.clear()}else{if(v){E=d.createSVGTransform();E.setRotate(v,K.x,K.y);h.numberOfItems?h.insertItemBefore(E,0):h.appendItem(E)}h.numberOfItems== -0&&e.removeAttribute("transform");return null}if(H==2){if(v){K={x:E.x+Y.e,y:E.y+Y.f};E=d.createSVGTransform();E.setRotate(v,K.x,K.y);h.numberOfItems?h.insertItemBefore(E,0):h.appendItem(E)}}else if(H==3){w=X(h).matrix;Y=d.createSVGTransform();Y.setRotate(v,E.x,E.y);Y=Y.matrix;E=d.createSVGTransform();E.setRotate(v,K.x,K.y);K=E.matrix.inverse();T=w.inverse();K=W(T,K,Y,w);F=K.e;w=K.f;if(F!=0||w!=0){D=e.childNodes;for(C=D.length;C--;){N=D.item(C);if(N.nodeType==1){T=Za;Za=N.getAttribute("transform"); -J=ca(N);n=d.createSVGTransform();n.setTranslate(F,w);J.numberOfItems?J.insertItemBefore(n,0):J.appendItem(n);k.addSubCommand(hb(N));Za=T}}}if(v)h.numberOfItems?h.insertItemBefore(E,0):h.appendItem(E)}}else{v=svgedit.utilities.getBBox(e);if(!v&&e.tagName!="path")return null;w=d.createSVGMatrix();if(F=la(e)){E={x:v.x+v.width/2,y:v.y+v.height/2};K=Q(v.x+v.width/2,v.y+v.height/2,X(h).matrix);H=F*Math.PI/180;D=Math.abs(H)>1.0E-10?Math.sin(H)/(1-Math.cos(H)):2/H;for(H=0;H=3&&h.getItem(L-2).type==3&&h.getItem(L-3).type==2&&h.getItem(L-1).type==2){H= -3;w=X(h,L-3,L-1).matrix;h.removeItem(L-1);h.removeItem(L-2);h.removeItem(L-3)}else if(L==4&&h.getItem(L-1).type==1){H=3;w=X(h).matrix;ia=d.createSVGTransform();ia.setMatrix(w);h.clear();h.appendItem(ia);w=d.createSVGMatrix()}else if((L==1||L>1&&h.getItem(1).type!=3)&&h.getItem(0).type==2){H=2;Y=h.getItem(0).matrix;T=X(h,1).matrix;v=T.inverse();w=W(v,Y,T);h.removeItem(0)}else if(L==1&&h.getItem(0).type==1&&!F){w=X(h).matrix;switch(e.tagName){case "line":z=$(e).attr(["x1","y1","x2","y2"]);case "polyline":case "polygon":z.points= -e.getAttribute("points");if(z.points){v=e.points;D=v.numberOfItems;z.points=Array(D);for(H=0;H1&&v.showGrips(false)}}}O("selected",I);h||I.length==1?Fa.requestSelector(I[0]).showGrips(true):Fa.requestSelector(I[0]).showGrips(false); -for(I.sort(function(F,z){if(F&&z&&F.compareDocumentPosition)return 3-(z.compareDocumentPosition(F)&6);else if(F==null)return 1});I[0]==null;)I.shift(0)}},Eb=this.selectOnly=function(e,h){Va(true);yb(e,h)};this.removeFromSelection=function(e){if(I[0]!=null)if(e.length!=0){var h=Array(I.length);j=0;len=I.length;for(var k=0;k=0&&e.id!="svgcanvas")for(;e.nodeName!="foreignObject";){e=e.parentNode;if(!e)return d}var h=B().getCurrentLayer();if([d,a,l,h].indexOf(e)>=0)return d;if($(e).closest("#selectorParentGroup").length)return Fa.selectorParentGroup;for(;e.parentNode!==(M|| -h);)e=e.parentNode;return e};(function(){var e=null,h=null,k=null,w=null,v=null,F={},z={minx:null,miny:null,maxx:null,maxy:null};$(a).mousedown(function(u){if(!(b.spaceKey||u.button===1)){var D=u.button===2;Bb=l.getScreenCTM().inverse();var H=Q(u.pageX,u.pageY,Bb),C=H.x*q;H=H.y*q;u.preventDefault();if(D)Ea="select";C=C/q;H=H/q;var E=Mb(u);if(E.tagName==="a"&&E.childNodes.length===1)E=E.firstChild;var K=w=h=C,L=v=k=H;if(m.gridSnapping){C=Aa(C);H=Aa(H);h=Aa(h);k=Aa(k)}if(E==Fa.selectorParentGroup&& -I[0]!=null){E=u.target;var Y=Ta(E,"type");if(Y=="rotate"){Ea="rotate";current_rotate_mode=Ta(E,"dir")}else if(Y=="resize"){Ea="resize";pb=Ta(E,"dir")}E=I[0]}Za=E.getAttribute("transform");Y=ca(E);switch(Ea){case "select":Oa=true;pb="none";if(D)Oa=false;if(E!=d){if(I.indexOf(E)==-1){u.shiftKey||Va(true);yb([E]);Sa=E;Ka.clear()}if(!D)for(D=0;D0&&b.removeFromSelection(E);K.length>0&&yb(K);break;case "resize":E= -ca(D);K=(n=ha(E))?F:svgedit.utilities.getBBox(D);L=K.x;A=K.y;var G=K.width,N=K.height;K=x-h;Y=y-k;if(m.gridSnapping){K=Aa(K);Y=Aa(Y);N=Aa(N);G=Aa(G)}var J=la(D);if(J){var T=Math.sqrt(K*K+Y*Y);Y=Math.atan2(Y,K)-J*Math.PI/180;K=T*Math.cos(Y);Y=T*Math.sin(Y)}if(pb.indexOf("n")==-1&&pb.indexOf("s")==-1)Y=0;if(pb.indexOf("e")==-1&&pb.indexOf("w")==-1)K=0;var da=T=0,ia=N?(N+Y)/N:1,pa=G?(G+K)/G:1;if(pb.indexOf("n")>=0){ia=N?(N-Y)/N:1;da=N}if(pb.indexOf("w")>=0){pa=G?(G-K)/G:1;T=G}K=d.createSVGTransform(); -Y=d.createSVGTransform();G=d.createSVGTransform();if(m.gridSnapping){L=Aa(L);T=Aa(T);A=Aa(A);da=Aa(da)}K.setTranslate(-(L+T),-(A+da));if(u.shiftKey)if(pa==1)pa=ia;else ia=pa;Y.setScale(pa,ia);G.setTranslate(L+T,A+da);if(n){n=J?1:0;E.replaceItem(K,2+n);E.replaceItem(Y,1+n);E.replaceItem(G,0+n)}else{n=E.numberOfItems;E.replaceItem(G,n-3);E.replaceItem(Y,n-2);E.replaceItem(K,n-1)}Fa.requestSelector(D).resize();O("transition",I);break;case "zoom":K*=q;L*=q;na(Ma,{x:Math.min(w*q,K),y:Math.min(v*q,L),width:Math.abs(K- -w*q),height:Math.abs(L-v*q)},100);break;case "text":na(E,{x:x,y:y},1E3);break;case "line":K=null;window.opera||d.suspendRedraw(1E3);if(m.gridSnapping){x=Aa(x);y=Aa(y)}L=x;n=y;if(u.shiftKey){n=R(h,k,L,n);L=n.x;n=n.y}E.setAttributeNS(null,"x2",L);E.setAttributeNS(null,"y2",n);window.opera||d.unsuspendRedraw(K);break;case "foreignObject":case "square":case "rect":case "image":K=Math.abs(x-h);n=Math.abs(y-k);if(Ea=="square"||u.shiftKey){K=n=Math.max(K,n);L=hk?k+A:k-A}if(u.altKey){n=h;L=k;A=Math.abs(x-n);Y=u.shiftKey?A:Math.abs(y-L)}E.setAttributeNS(null,"rx",A);E.setAttributeNS(null,"ry",Y);E.setAttributeNS(null,"cx",n);E.setAttributeNS(null,"cy",L);window.opera||d.unsuspendRedraw(K);break;case "fhellipse":case "fhrect":z.minx=Math.min(K,z.minx);z.maxx=Math.max(K,z.maxx);z.miny=Math.min(L,z.miny);z.maxy=Math.max(L,z.maxy);case "fhpath":e+=+K+","+L+" ";E.setAttributeNS(null,"points",e);break;case "path":case "pathedit":x*=q; -y*=q;if(m.gridSnapping){x=Aa(x);y=Aa(y);h=Aa(h);k=Aa(k)}if(u.shiftKey){if(n=svgedit.path.path){E=n.dragging?n.dragging[0]:h;n=n.dragging?n.dragging[1]:k}else{E=h;n=k}n=R(E,n,x,y);x=n.x;y=n.y}if(Ma&&Ma.getAttribute("display")!=="none"){K*=q;L*=q;na(Ma,{x:Math.min(w*q,K),y:Math.min(v*q,L),width:Math.abs(K-w*q),height:Math.abs(L-v*q)},100)}Ka.mouseMove(u,x,y);break;case "textedit":x*=q;y*=q;ib.mouseMove(C,H);break;case "rotate":K=svgedit.utilities.getBBox(D);n=K.x+K.width/2;L=K.y+K.height/2;E=ba(D); -E=Q(n,L,E);n=E.x;L=E.y;E=K.x;A=K.y;if(current_rotate_mode=="nw")E=K.x+K.width;if(current_rotate_mode=="se")A=K.y+K.height;if(current_rotate_mode=="sw"){E=K.x+K.width;A=K.y+K.height}compensation_angle=(Math.atan2(L-A,n-E)*(180/Math.PI)-90)%360;J=(Math.atan2(L-y,n-x)*(180/Math.PI)-90)%360;J+=compensation_angle;if(m.gridSnapping)J=Aa(J);if(u.shiftKey)J=Math.round(J/45)*45;b.setRotationAngle(J<-180?360+J:J,true);O("transition",I)}eb("mouseMove",{event:u,mouse_x:C,mouse_y:H,selected:D})}}).click(function(u){u.preventDefault(); -return false}).dblclick(function(u){var D=u.target.parentNode;if(D!==M){var H=Mb(u),C=H.tagName;if(C==="text"&&Ea!=="textedit"){u=Q(u.pageX,u.pageY,Bb);ib.select(H,u.x,u.y)}if((C==="g"||C==="a")&&la(H)){Fb(H);H=I[0];Va(true)}M&&Nb();D.tagName!=="g"&&D.tagName!=="a"||D===B().getCurrentLayer()||H===Fa.selectorParentGroup||Ub(H)}}).mouseup(function(u){b.addClone=false;window.removeEventListener("keyup",b.removeClone);if(u.button!==2){var D=Sa;Sa=null;if(Oa){var H=Q(u.pageX,u.pageY,Bb),C=H.x*q;H=H.y* -q;var E=C/q,K=H/q,L=sa(qa()),Y=false;Oa=false;switch(Ea){case "resize":case "multiselect":if(Ma!=null){Ma.setAttribute("display","none");bb=[]}Ea="select";case "select":if(I[0]!=null){if(I[1]==null){C=I[0];switch(C.tagName){case "g":case "use":case "image":case "foreignObject":break;default:cb.fill=C.getAttribute("fill");cb.fill_opacity=C.getAttribute("fill-opacity");cb.stroke=C.getAttribute("stroke");cb.stroke_opacity=C.getAttribute("stroke-opacity");cb.stroke_width=C.getAttribute("stroke-width"); -cb.stroke_dasharray=C.getAttribute("stroke-dasharray");cb.stroke_linejoin=C.getAttribute("stroke-linejoin");cb.stroke_linecap=C.getAttribute("stroke-linecap")}if(C.tagName=="text"){gb.font_size=C.getAttribute("font-size");gb.font_family=C.getAttribute("font-family")}Fa.requestSelector(C).showGrips(true)}Qa();if(E!=w||K!=v){u=I.length;for(C=0;C=0?D.indexOf(",",E+1)>=0:D.indexOf(" ",D.indexOf(" ")+1)>=0)L=Ka.smoothPolylineIntoPath(L); -break;case "line":D=$(L).attr(["x1","x2","y1","y2"]);Y=D.x1!=D.x2||D.y1!=D.y2;break;case "foreignObject":case "square":case "rect":case "image":D=$(L).attr(["width","height"]);Y=D.width!=0||D.height!=0||Ea==="image";break;case "circle":Y=L.getAttribute("r")!=0;break;case "ellipse":D=$(L).attr(["rx","ry"]);Y=D.rx!=null||D.ry!=null;break;case "fhellipse":if(z.maxx-z.minx>0&&z.maxy-z.miny>0){L=V({element:"ellipse",curStyles:true,attr:{cx:(z.minx+z.maxx)/2,cy:(z.miny+z.maxy)/2,rx:(z.maxx-z.minx)/2,ry:(z.maxy- -z.miny)/2,id:qa()}});O("changed",[L]);Y=true}break;case "fhrect":if(z.maxx-z.minx>0&&z.maxy-z.miny>0){L=V({element:"rect",curStyles:true,attr:{x:z.minx,y:z.miny,width:z.maxx-z.minx,height:z.maxy-z.miny,id:qa()}});O("changed",[L]);Y=true}break;case "text":Y=true;Eb([L]);ib.start(L);break;case "path":L=null;Oa=true;D=Ka.mouseUp(u,L,C,H);L=D.element;Y=D.keep;break;case "pathedit":Y=true;L=null;Ka.mouseUp(u);break;case "textedit":Y=false;L=null;ib.mouseUp(u,C,H);break;case "rotate":Y=true;L=null;Ea="select"; -D=b.undoMgr.finishUndoableChange();D.isEmpty()||va(D);Qa();O("changed",I)}C=eb("mouseUp",{event:u,mouse_x:C,mouse_y:H},true);$.each(C,function(G,N){if(N){Y=N.keep||Y;L=N.element;Oa=N.started||Oa}});if(!Y&&L!=null){B().releaseId(qa());L.parentNode.removeChild(L);L=null;for(C=u.target;C.parentNode.parentNode.tagName=="g";)C=C.parentNode;if((Ea!="path"||!drawn_path)&&C.parentNode.id!="selectorParentGroup"&&C.id!="svgcanvas"&&C.id!="svgroot"){b.setMode("select");Eb([C],true)}}else if(L!=null){b.addedNew= -true;u=0.2;var n;if(false.beginElement&&L.getAttribute("opacity")!=P.opacity){n=$(false).clone().attr({to:P.opacity,dur:u}).appendTo(L);try{n[0].beginElement()}catch(A){}}else u=0;setTimeout(function(){n&&n.remove();L.setAttribute("opacity",P.opacity);L.setAttribute("style","pointer-events:inherit");oa(L);if(Ea==="path")Ka.toEditMode(L);else m.selectNew&&Eb([L],true);va(new Ca(L));O("changed",[L])},u*1E3)}Za=null}}});$(a).bind("mousewheel DOMMouseScroll",function(u){if(u.shiftKey){u.preventDefault(); -Bb=l.getScreenCTM().inverse();var D=Q(u.pageX,u.pageY,Bb);D={x:D.x,y:D.y,width:0,height:0};if(u.wheelDelta)if(u.wheelDelta>=120)D.factor=2;else{if(u.wheelDelta<=-120)D.factor=0.5}else if(u.detail)if(u.detail>0)D.factor=0.5;else if(u.detail<0)D.factor=2;D.factor&&O("zoomed",D)}})})();var tb=function(e){$(e).click(function(h){h.preventDefault()})},ib=b.textActions=function(){function e(J){var T=H.value==="";$(H).focus();if(!arguments.length)if(T)J=0;else{if(H.selectionEnd!==H.selectionStart)return; -J=H.selectionEnd}var da;da=L[J];T||H.setSelectionRange(J,J);C=sa("text_cursor");if(!C){C=document.createElementNS(c,"line");na(C,{id:"text_cursor",stroke:"#333","stroke-width":1});C=sa("selectorParentGroup").appendChild(C)}K||(K=setInterval(function(){var ia=C.getAttribute("display")==="none";C.setAttribute("display",ia?"inline":"none")},600));T=F(da.x,Y.y);da=F(da.x,Y.y+Y.height);na(C,{x1:T.x,y1:T.y,x2:da.x,y2:da.y,visibility:"visible",display:"inline"});E&&E.setAttribute("d","")}function h(J,T, -da){if(J===T)e(T);else{da||H.setSelectionRange(J,T);E=sa("text_selectblock");if(!E){E=document.createElementNS(c,"path");na(E,{id:"text_selectblock",fill:"green",opacity:0.5,style:"pointer-events:none"});sa("selectorParentGroup").appendChild(E)}J=L[J];var ia=L[T];C.setAttribute("visibility","hidden");T=F(J.x,Y.y);da=F(J.x+(ia.x-J.x),Y.y);var pa=F(J.x,Y.y+Y.height);J=F(J.x+(ia.x-J.x),Y.y+Y.height);na(E,{d:"M"+T.x+","+T.y+" L"+da.x+","+da.y+" "+J.x+","+J.y+" "+pa.x+","+pa.y+"z",display:"inline"})}} -function k(J,T){var da=d.createSVGPoint();da.x=J;da.y=T;if(L.length==1)return 0;da=D.getCharNumAtPosition(da);if(da<0){da=L.length-2;if(J<=L[0].x)da=0}else if(da>=L.length-2)da=L.length-2;var ia=L[da];J>ia.x+ia.width/2&&da++;return da}function w(J,T,da){var ia=H.selectionStart;J=k(J,T);h(Math.min(ia,J),Math.max(ia,J),!da)}function v(J,T){var da={x:J,y:T};da.x/=q;da.y/=q;if(n){var ia=Q(da.x,da.y,n.inverse());da.x=ia.x;da.y=ia.y}return da}function F(J,T){var da={x:J,y:T};if(n){var ia=Q(da.x,da.y,n); -da.x=ia.x;da.y=ia.y}da.x*=q;da.y*=q;return da}function z(J){h(0,D.textContent.length);$(this).unbind(J)}function u(J){if(N&&D){var T=Q(J.pageX,J.pageY,Bb);T=v(T.x*q,T.y*q);T=k(T.x,T.y);var da=D.textContent,ia=da.substr(0,T).replace(/[a-z0-9]+$/i,"").length;da=da.substr(T).match(/^[a-z0-9]+/i);h(ia,(da?da[0].length:0)+T);$(J.target).click(z);setTimeout(function(){$(J.target).unbind("click",z)},300)}}var D,H,C,E,K,L=[],Y,n,A,G,N;return{select:function(J,T,da){D=J;ib.toEditMode(T,da)},start:function(J){D= -J;ib.toEditMode()},mouseDown:function(J,T,da,ia){J=v(da,ia);H.focus();e(k(J.x,J.y));A=da;G=ia},mouseMove:function(J,T){var da=v(J,T);w(da.x,da.y)},mouseUp:function(J,T,da){var ia=v(T,da);w(ia.x,ia.y,true);J.target!==D&&TA-2&&daG-2&&ib.toSelectMode(true)},setCursor:e,toEditMode:function(J,T){N=false;Ea="textedit";Fa.requestSelector(D).showGrips(false);Fa.requestSelector(D);ib.init();$(D).css("cursor","text");if(arguments.length){var da=v(J,T);e(k(da.x,da.y))}else e();setTimeout(function(){N= -true},300)},toSelectMode:function(J){Ea="select";clearInterval(K);K=null;E&&$(E).attr("display","none");C&&$(C).attr("visibility","hidden");$(D).css("cursor","move");if(J){Va();$(D).css("cursor","move");O("selected",[D]);yb([D],true)}D&&!D.textContent.length&&b.deleteSelectedElements();$(H).blur();D=false},setInputElem:function(J){H=J},clear:function(){Ea=="textedit"&&ib.toSelectMode()},init:function(){if(D){if(!D.parentNode){D=I[0];Fa.requestSelector(D).showGrips(false)}var J=D.textContent.length, -T=D.getAttribute("transform");Y=svgedit.utilities.getBBox(D);n=T?ba(D):null;L=Array(J);H.focus();$(D).unbind("dblclick",u).dblclick(u);if(!J)var da={x:Y.x+Y.width/2,width:0};for(T=0;T=0&&this.selected_pts.push(D)}this.selected_pts.sort();u=this.selected_pts.length;for(z=Array(u);u--;){H= -this.segs[this.selected_pts[u]];H.select(true);z[u]=H.ptgrip}Ka.canDeleteNodes=true;Ka.closed_subpath=this.subpathIsClosed(this.selected_pts[0]);O("selected",z)};var v=h=null,F=false;return{mouseDown:function(z,u,D,H){if(Ea==="path"){mouse_x=D;mouse_y=H;H=mouse_x/q;u=mouse_y/q;D=sa("path_stretch_line");k=[H,u];if(m.gridSnapping){H=Aa(H);u=Aa(u);mouse_x=Aa(mouse_x);mouse_y=Aa(mouse_y)}if(!D){D=document.createElementNS(c,"path");na(D,{id:"path_stretch_line",stroke:"#22C","stroke-width":"0.5",fill:"none"}); -D=sa("selectorParentGroup").appendChild(D)}D.setAttribute("display","inline");var C=null;if(v){C=v.pathSegList;for(var E=C.numberOfItems,K=6/q,L=false;E;){E--;var Y=C.getItem(E),n=Y.x;Y=Y.y;if(H>=n-K&&H<=n+K&&u>=Y-K&&u<=Y+K){L=true;break}}K=qa();svgedit.path.removePath_(K);K=sa(K);n=C.numberOfItems;if(L){if(E<=1&&n>=2){H=C.getItem(0).x;u=C.getItem(0).y;z=D.pathSegList.getItem(1);z=z.pathSegType===4?v.createSVGPathSegLinetoAbs(H,u):v.createSVGPathSegCurvetoCubicAbs(H,u,z.x1/q,z.y1/q,H,u);H=v.createSVGPathSegClosePath(); -C.appendItem(z);C.appendItem(H)}else if(n<3)return C=false;$(D).remove();element=K;v=null;Oa=false;if(e){svgedit.path.path.matrix&&mb(K,{},svgedit.path.path.matrix.inverse());D=K.getAttribute("d");z=$(svgedit.path.path.elem).attr("d");$(svgedit.path.path.elem).attr("d",z+D);$(K).remove();svgedit.path.path.matrix&&svgedit.path.recalcRotatedPath();svgedit.path.path.init();Ka.toEditMode(svgedit.path.path.elem);svgedit.path.path.selectPt();return false}}else{if(!$.contains(a,Mb(z))){console.log("Clicked outside canvas"); -return false}C=v.pathSegList.numberOfItems;E=v.pathSegList.getItem(C-1);K=E.x;E=E.y;if(z.shiftKey){z=R(K,E,H,u);H=z.x;u=z.y}z=D.pathSegList.getItem(1);z=z.pathSegType===4?v.createSVGPathSegLinetoAbs(rb(H),rb(u)):v.createSVGPathSegCurvetoCubicAbs(rb(H),rb(u),z.x1/q,z.y1/q,z.x2/q,z.y2/q);v.pathSegList.appendItem(z);H*=q;u*=q;D.setAttribute("d",["M",H,u,H,u].join(" "));D=C;if(e)D+=svgedit.path.path.segs.length;svgedit.path.addPointGrip(D,H,u)}}else{d_attr="M"+H+","+u+" ";v=V({element:"path",curStyles:true, -attr:{d:d_attr,id:S(),opacity:P.opacity/2}});D.setAttribute("d",["M",mouse_x,mouse_y,mouse_x,mouse_y].join(" "));D=e?svgedit.path.path.segs.length:0;svgedit.path.addPointGrip(D,mouse_x,mouse_y)}}else if(svgedit.path.path){svgedit.path.path.storeD();K=z.target.id;if(K.substr(0,14)=="pathpointgrip_"){u=svgedit.path.path.cur_pt=parseInt(K.substr(14));svgedit.path.path.dragging=[D,H];C=svgedit.path.path.segs[u];if(z.shiftKey)C.selected?svgedit.path.path.removePtFromSelection(u):svgedit.path.path.addPtsToSelection(u); -else{if(svgedit.path.path.selected_pts.length<=1||!C.selected)svgedit.path.path.clearSelection();svgedit.path.path.addPtsToSelection(u)}}else if(K.indexOf("ctrlpointgrip_")==0){svgedit.path.path.dragging=[D,H];z=K.split("_")[1].split("c");u=z[0]-0;svgedit.path.path.selectPt(u,z[1]-0)}if(!svgedit.path.path.dragging){if(Ma==null)Ma=Fa.getRubberBandBox();na(Ma,{x:D*q,y:H*q,width:0,height:0,display:"inline"},100)}}},mouseMove:function(z,u,D){F=true;if(Ea==="path"){if(v){var H=v.pathSegList;z=H.numberOfItems- -1;if(k){var C=svgedit.path.addCtrlGrip("1c1"),E=svgedit.path.addCtrlGrip("0c2");E.getAttribute("cx");E.getAttribute("cy");C.setAttribute("cx",u);C.setAttribute("cy",D);C.setAttribute("display","inline");C=k[0];var K=k[1];H.getItem(z);var L=C+(C-u/q),Y=K+(K-D/q);E.setAttribute("cx",L*q);E.setAttribute("cy",Y*q);E.setAttribute("display","inline");E=svgedit.path.getCtrlLine(1);var n=svgedit.path.getCtrlLine(2);na(E,{x1:u,y1:D,x2:C*q,y2:K*q,display:"inline"});na(n,{x1:L*q,y1:Y*q,x2:C*q,y2:K*q,display:"inline"}); -if(z===0)w=[u,D];else{H=H.getItem(z-1);u=H.x;D=H.y;if(H.pathSegType===6){u+=u-H.x2;D+=D-H.y2}else if(w){u=w[0]/q;D=w[1]/q}svgedit.path.replacePathSeg(6,z,[C,K,u,D,L,Y],v)}}else if(C=sa("path_stretch_line")){z=H.getItem(z);if(z.pathSegType===6)svgedit.path.replacePathSeg(6,1,[u,D,(z.x+(z.x-z.x2))*q,(z.y+(z.y-z.y2))*q,u,D],C);else w?svgedit.path.replacePathSeg(6,1,[u,D,w[0],w[1],u,D],C):svgedit.path.replacePathSeg(4,1,[u,D],C)}}}else if(svgedit.path.path.dragging){C=svgedit.path.getPointFromGrip({x:svgedit.path.path.dragging[0], -y:svgedit.path.path.dragging[1]},svgedit.path.path);K=svgedit.path.getPointFromGrip({x:u,y:D},svgedit.path.path);z=K.x-C.x;C=K.y-C.y;svgedit.path.path.dragging=[u,D];svgedit.path.path.dragctrl?svgedit.path.path.moveCtrl(z,C):svgedit.path.path.movePts(z,C)}else{svgedit.path.path.selected_pts=[];svgedit.path.path.eachSeg(function(){if(this.next||this.prev){var A=Ma.getBBox(),G=svgedit.path.getGripPt(this);A=svgedit.math.rectsIntersect(A,{x:G.x,y:G.y,width:0,height:0});this.select(A);A&&svgedit.path.path.selected_pts.push(this.index)}})}}, -mouseUp:function(z,u){if(Ea==="path"){k=null;if(!v){u=sa(qa());Oa=false;w=null}return{keep:true,element:u}}if(svgedit.path.path.dragging){var D=svgedit.path.path.cur_pt;svgedit.path.path.dragging=false;svgedit.path.path.dragctrl=false;svgedit.path.path.update();F&&svgedit.path.path.endChanges("Move path point(s)");!z.shiftKey&&!F&&svgedit.path.path.selectPt(D)}else if(Ma&&Ma.getAttribute("display")!="none"){Ma.setAttribute("display","none");Ma.getAttribute("width")<=2&&Ma.getAttribute("height")<= -2&&Ka.toSelectMode(z.target)}else Ka.toSelectMode(z.target);F=false},toEditMode:function(z){svgedit.path.path=svgedit.path.getPath_(z);Ea="pathedit";Va();svgedit.path.path.show(true).update();svgedit.path.path.oldbbox=svgedit.utilities.getBBox(svgedit.path.path.elem);e=false},toSelectMode:function(z){var u=z==svgedit.path.path.elem;Ea="select";svgedit.path.path.show(false);h=false;Va();svgedit.path.path.matrix&&svgedit.path.recalcRotatedPath();if(u){O("selected",[z]);yb([z],true)}},addSubPath:function(z){if(z){Ea= -"path";e=true}else{Ka.clear(true);Ka.toEditMode(svgedit.path.path.elem)}},select:function(z){if(h===z){Ka.toEditMode(z);Ea="pathedit"}else h=z},reorient:function(){var z=I[0];if(z)if(la(z)!=0){var u=new Ha("Reorient path"),D={d:z.getAttribute("d"),transform:z.getAttribute("transform")};u.addSubCommand(new Na(z,D));Va();this.resetOrientation(z);va(u);svgedit.path.getPath_(z).show(false).matrix=null;this.clear();yb([z],true);O("changed",I)}},clear:function(){h=null;if(v){var z=sa(qa());$(sa("path_stretch_line")).remove(); -$(z).remove();$(sa("pathpointgrip_container")).find("*").attr("display","none");v=w=null;Oa=false}else Ea=="pathedit"&&this.toSelectMode();svgedit.path.path&&svgedit.path.path.init().show(false)},resetOrientation:function(z){if(z==null||z.nodeName!="path")return false;var u=ca(z),D=X(u).matrix;u.clear();z.removeAttribute("transform");u=z.pathSegList;for(var H=u.numberOfItems,C=0;C0){K=H.getItem(C-1).pathSegType;if(K===2){E(C-1,1);D();break}else if(K===1&&H.numberOfItems-1===C){E(C,1);D();break}}}return false};D();if(svgedit.path.path.elem.pathSegList.numberOfItems<=1){Ka.toSelectMode(svgedit.path.path.elem); -b.deleteSelectedElements()}else{svgedit.path.path.init();svgedit.path.path.clearSelection();if(window.opera){z=$(svgedit.path.path.elem);z.attr("d",z.attr("d"))}svgedit.path.path.endChanges("Delete path node(s)")}}},smoothPolylineIntoPath:function(z){var u=z.points,D=u.numberOfItems;if(D>=4){var H=u.getItem(0),C=null;z=[];z.push(["M",H.x,",",H.y," C"].join(""));for(var E=1;E<=D-4;E+=3){var K=u.getItem(E),L=u.getItem(E+1),Y=u.getItem(E+2);if(C)if((H=svgedit.path.smoothControlPoints(C,K,H))&&H.length== -2){K=z[z.length-1].split(",");K[2]=H[0].x;K[3]=H[0].y;z[z.length-1]=K.join(",");K=H[1]}z.push([K.x,K.y,L.x,L.y,Y.x,Y.y].join(","));H=Y;C=L}for(z.push("L");E0;);Ka.clear(true);$.each(l.childNodes,function(k,w){k&&w.nodeType===8&&w.data.indexOf("Created with")>=0&&l.insertBefore(w,l.firstChild)});if(M){Nb();Eb([M])}var e= -[];$(l).find("g:data(gsvg)").each(function(){for(var k=this.attributes,w=k.length,v=0;v=0;D--){u=z.item(D);E=w(u.nodeValue);if(!(K.indexOf(u.localName)>=0))if(E!="")if(E.indexOf("pointer-events")!==0)if(!(u.localName==="class"&&E.indexOf("se_")===0)){k.push(" ");if(u.localName==="d")E=Ka.convertPath(e,true);if(isNaN(E)){if(F.test(E))E= -svgedit.units.shortFloat(E)+v}else E=svgedit.units.shortFloat(E);if(fb.apply&&e.nodeName==="image"&&u.localName==="href"&&fb.images&&fb.images==="embed"){var L=za[E];if(L)E=L}if(!u.namespaceURI||u.namespaceURI==c||Ba[u.namespaceURI]){k.push(u.nodeName);k.push('="');k.push(E);k.push('"')}}}}if(e.hasChildNodes()){k.push(">");h++;z=false;for(D=0;D");break;case 8:k.push("\n");k.push(Array(h+1).join(" "));k.push(" @@ -223,10 +222,6 @@ $(function(){ Height -

    @@ -367,8 +362,6 @@ $(function(){

    Edit Path

    -
    -