From b81999924c4edb1de8a196cd771b974f1883070c Mon Sep 17 00:00:00 2001 From: Mark MacKay Date: Tue, 4 Aug 2020 19:52:08 -0500 Subject: [PATCH] updating readme and adding build --- dist/all.css | 1691 +++++++++---------- dist/all.js | 2783 ++++++++------------------------ dist/images/svg_edit_icons.svg | 77 +- dist/index.html | 131 +- readme.md | 1 + 5 files changed, 1493 insertions(+), 3190 deletions(-) diff --git a/dist/all.css b/dist/all.css index ed94fed..0fe9a8e 100644 --- a/dist/all.css +++ b/dist/all.css @@ -582,66 +582,430 @@ div.jGraduate_Slider img { left: 5px; } -/* Comment to prevent wrong concat */ +@font-face { + font-family: 'Arvo'; + src: url('font-files/arvo-bold-webfont.woff') format('woff'); + font-weight: bold; + font-style: normal; +} +@font-face { + font-family: 'Arvo'; + src: url('font-files/arvo-bolditalic-webfont.woff') format('woff'); + font-weight: bold; + font-style: italic; +} +@font-face { + font-family: 'Arvo'; + src: url('font-files/arvo-italic-webfont.woff') format('woff'); + font-weight: normal; + font-style: italic; +} +@font-face { + font-family: 'Arvo'; + src: url('font-files/arvo-regular-webfont.woff') format('woff'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'Euphoria'; + src: url('font-files/euphoriascript-regular-webfont.woff') format('woff'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'Shadows Into Light'; + src: url('font-files/shadowsintolight-webfont.woff') format('woff'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'Simonetta'; + src: url('font-files/simonetta-black-webfont.woff') format('woff'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'Simonetta'; + src: url('font-files/simonetta-blackitalic-webfont.woff') format('woff'); + font-weight: normal; + font-style: italic; +} +@font-face { + font-family: 'Simonetta'; + src: url('font-files/simonetta-italic-webfont.woff') format('woff'); + font-weight: normal; + font-style: italic; +} +@font-face { + font-family: 'Simonetta'; + src: url('font-files/simonetta-regular-webfont.woff') format('woff'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'Junction'; + src: url('font-files/Junction-webfont.woff') format('woff'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'League Gothic'; + src: url('font-files/League_Gothic-webfont.woff') format('woff'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'Fanwood'; + src: url('font-files/fanwood-webfont.woff') format('woff'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'Fanwood'; + src: url('font-files/fanwood_italic-webfont.woff') format('woff'); + font-weight: normal; + font-style: italic; +} -body { +.dropdown { + position: relative; + float: left; +} + + .dropdown button { + width: 21px; + height: 22px; + padding: 0 3px 0 3px; + border: none; + background-color: #555; + border-radius: 0 2px 2px 0; + margin-left: -1px; + position: relative; +} + + .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 #FFFFFF; + border-bottom: 1px solid #FFFFFF; + background-color: #B0B0B0; +} + +.dropdown ul { + list-style: none; + position: absolute; + margin: 0; + padding: 0; + left: -80px; + top: 26px; + z-index: 4; + display: none; +} + +.dropup ul { + top: auto; + bottom: 26px; + border-radius: 3px; + box-shadow: 0 5px 10px #000; +} + +.dropup ul:after { + content: ''; + display: block; + position: absolute; + bottom: -10px; + right: 50%; + top: auto; + width: 0; + height: 0; + border: solid transparent 5px; + border-top-color: #fff; +} + +.dropdown li { + display: block; + width: 120px; + padding: 5px 10px; + color: #333; + background: #fff; + margin: 0; + line-height: 16px; +} + +.dropdown li:first-child {border-radius: 3px 3px 0 0;} +.dropdown li:last-child {border-radius: 0 0 3px 3px;} + +.dropdown li:hover { + background-color: #ddd; + color: #000; +} + +.dropdown li.special { + padding: 10px; + background: white; + border: none; + box-shadow: 0 3px 10px black; + border-radius: 3px !important; +} + +.dropdown li.special:after { + content: ''; + display: block; + position: absolute; + top: -10px; + right: 50%; + border: solid transparent 5px; + border-bottom-color: #fff; + +} + +.dropdown li.special.down:after { + bottom: -10px; + right: 50%; + top: auto; + border: solid transparent 5px; + border-top-color: #fff; + +} + +.flyout_arrow_horiz { + position: absolute; + bottom: -1px; + right: 0; + z-index: 10; +} + + .draginput { background: #3f3f3c; - font: 13px/120% 'Lucida Sans', 'Lucida Grande', 'Lucida Sans Unicode', sans-serif; + 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: none; + 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; +} + +.draginput.twocol { + width: 145px; +} + + + +.draginput input, .draginput input:hover, .draginput input:active { + cursor: url(../images/drag.png), move; + cursor: -webkit-grab; + cursor: -moz-grab; +} + +.draginput input[type="checkbox"], .draginput input[type="checkbox"]:hover, .draginput input[type="checkbox"]:active { + cursor: pointer; +} + +.draginput.checkbox { + cursor: pointer; +} + +.draginput.active input, .draginput.active input:hover, .draginput.active input:active { + cursor: url(../images/dragging.png), move; + cursor: -webkit-grabbing; + cursor: -moz-grabbing; +} + + + + .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; + top: 0; + left: 0; +} + + +.draginput_cursor{ + position: absolute; + top: 50%; + width: 100%; + border-top: solid rgba(50,100,200,0.25) 3px; + margin-top: -2px; + z-index: 0; +} + + .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; - margin: 0; - padding: 0; } -::selection {background: #000; color: #fff; /* Safari */} -::-moz-selection {background: #000; color: #fff; /* Firefox */} -html, body { - overflow: hidden; - width: 100%; - height: 100%; + .draginput input:focus { + background: #50A0FF; + color: #fff; + outline: none; + box-shadow: 0 0 5px 2px #50A0FF; } -::-webkit-scrollbar { - width: 5px; - height: 5px; - background: #444; + .draginput input:focus+span { + z-index: 10; + color:#fff; } -::-webkit-scrollbar-track { - border-radius: 10px; - background: #444; +.draginput .push_bottom { + bottom: 0; + position: absolute; } -::-webkit-scrollbar-thumb { - border-radius: 10px; - background: #666; -} - -::-webkit-scrollbar-corner { - background: #444; -} - -#browser-not-supported { - font-size: 0.8em; - font-family: Verdana, Helvetica, Arial; - color: #000000; -} - - #svgroot { - -moz-user-select: none; - -webkit-user-select: none; +#menu { + display: none; position: absolute; top: 0; left: 0; -} - -#svg_editor { - background: #2f2f2c; + right: 0; + height: 30px; + background: #000; + z-index: 10; + color: #fff; } #menu_bar { @@ -709,6 +1073,11 @@ html, body { color: #333; } +.menu .menu_list { + display: none; + position: absolute; +} + .menu_list .menu_item { position: relative; overflow: hidden; @@ -718,7 +1087,7 @@ html, body { color: #333; } - .menu_list .menu_item.tool_button { +.menu_list .menu_item.tool_button { background: transparent; border: none; margin: 0; @@ -770,18 +1139,6 @@ html, body { 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; @@ -858,6 +1215,7 @@ html, body { overflow: hidden; } + #palette { display: block; position: absolute; @@ -899,11 +1257,12 @@ html, body { top: 20px; } - #color_tools { + +#color_tools { position: relative; width: 48px; height: 48px; - margin: 6px 6px 0 6px; + margin: 12px 6px 0 6px; } .touch #color_tools { @@ -980,18 +1339,315 @@ html, body { display: none; } -#use_panel .tool_button, #path_node_panel .tool_button { +/* Generic context menu styles */ +.contextMenu { + position: absolute; + z-index: 99999; + border: solid 1px rgba(0,0,0,.33); + background: rgba(255,255,255,.95); + padding: 5px 0; + margin: 0px; + display: none; + font: 12px/15px 'Lucida Sans', 'Lucida Grande', 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); +} + +.touch .contextMenu { + border: solid 5px rgba(0,0,0,.7); + padding: 0; + margin: 0 0 0 20px; + font: 18px/24px sans-serif; + border-radius: 5px; + -webkit-box-shadow: 2px 5px 20px 3px #000; + box-shadow: 2px 5px 20px rgba(0,0,0,0.5); +} + +.touch .contextMenu:after { + content: ''; + width: 0; + height: 0; + border: solid transparent 10px; + border-right-color: rgba(0,0,0,.7); + position: absolute; + top: 50%; + left: -25px; + margin-top: -10px; + z-index: 1000; +} + +.contextMenu LI { + list-style: none; + padding: 0px; + margin: 0px; +} + +.contextMenu .shortcut { + width: 115px; + text-align:right; + float:right; +} + +.touch .contextMenu .shortcut { + display: none; +} + + + +.contextMenu A { + -moz-user-select: none; + -webkit-user-select: none; + color: #222; + text-decoration: none; + display: block; + line-height: 20px; + height: 20px; + background-position: 6px center; + background-repeat: no-repeat; + outline: none; + padding: 0px 15px 1px 20px; +} + +.touch .contextMenu A { + padding: 0 15px; + border-bottom: #; + font-weight: bold; + border-top: solid 1px #E3E3E3; + height: 40px; + line-height: 40px; + min-width: 200px; +} + +.contextMenu LI.hover A { + background-color: #2e5dea; + color: white; + cursor: default; +} + +.contextMenu LI.disabled A { + color: #999; + +} + +.touch .contextMenu LI.disabled A { + display: none; +} + +.contextMenu LI.hover.disabled A { + background-color: transparent; +} + +.contextMenu LI.separator { + border-top: solid 1px #E3E3E3; + padding-top: 5px; + margin-top: 5px; +} + +.touch .contextMenu LI.separator { + border-top: none; + margin: 0; + padding: 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; +} + +#shape_cats > div:first-child { + border-radius: 3px 0 0 0; +} + +#shape_cats > div:last-child { + border-radius: 0 0 0 3px; +} + +#shape_cats div:hover { + background: #efefef; + color: #000; +} +#shape_cats div.current { + font-weight: bold; + background: #3f3f3c; + color: #fff; + position: relative; +} + +#shape_cats div.current:after { + content: ''; + position: absolute; + right: -26px; + top: 0; + border: solid transparent 13px; + border-left-color: #3f3f3c; +} + + + .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 .tool_button { + float: left; + background-color: #fff; + height: 24px; + width: 24px; +} + +/* Necessary to keep the flyouts sized properly */ +#shape_buttons {background: #fff; border-radius: 0 3px 3px 0; padding: 10px} + +.tools_flyout .tool_button, +.tools_flyout .tool_flyout { + background: #fff; + width: 40px; + height: 40px; + margin: 5px; + border-radius: 0px; + -moz-border-radius: 0px; + -webkit-border-radius: 0px; + border-width: 0; +} + +.tools_flyout .tool_button svg { + fill: #444; +} + +.tools_flyout .tool_button:hover svg { + fill: #111; +} + + +/* Comment to prevent wrong concat */ + +body { + background: #3f3f3c; + 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; /* Safari */} +::-moz-selection {background: #000; color: #fff; /* Firefox */} + +html, body { + overflow: hidden; + width: 100%; + height: 100%; +} + +::-webkit-scrollbar { + width: 5px; + height: 5px; + background: #444; +} + +::-webkit-scrollbar-track { + border-radius: 10px; + background: #444; +} + +::-webkit-scrollbar-thumb { + border-radius: 10px; + background: #666; +} + +::-webkit-scrollbar-corner { + background: #444; +} + +#browser-not-supported { + font-size: 0.8em; + font-family: Verdana, Helvetica, Arial; + color: #000000; +} + + #svgroot { + -moz-user-select: none; + -webkit-user-select: none; + position: absolute; + top: 0; + left: 0; +} + +#svg_editor { + background: #2f2f2c; +} + + +#svgcanvas { + line-height: normal; + display: inline-block; + background-color: #A0A0A0; + text-align: center; + vertical-align: middle; + width: 640px; + height: 480px; + position: relative; + background: #3F3F3C; +} + + +#use_panel .tool_button, +#path_node_panel .tool_button { color: #999; border: solid #3F3F3C 1px; border-radius: 3px; - padding: 3px 10px 3px 40px; - background: - transparent; - position: relative; + background: transparent; margin-top: 10px; - width: 90px; - height: 23px; - line-height: 24px; + width: 90%; + line-height: 40px; +} + +#use_panel .tool_button:hover, +#path_node_panel .tool_button:hover { + border-color: #666; + color: #aaa; } #use_panel .tool_button { @@ -1063,7 +1719,7 @@ html, body { } - #color_tools #tool_switch { +#tool_switch { cursor: pointer; opacity: 0.7; width: 11px; @@ -1072,6 +1728,7 @@ html, body { position: absolute; top: -2px; left: 28px; + cursor: nwse-resize } #color_tools #cross:hover { @@ -1140,51 +1797,6 @@ html, body { top: 40px; } - .menu .menu_list { - display: none; - position: absolute; -} - -.tool_button, -.tool_button_current, -.tool_button_pressed { - cursor: pointer; -} - - .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: 0.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 2px; - top: -1px; - left: -1px; - width: 26px; - height: 26px; - z-index: 0; -} - - #tools_left .tool_button_current { - background-color: #0cf; -} - #main_icon span { position: absolute; width: 100%; @@ -1387,151 +1999,35 @@ box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.1), } - #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; -} - - .dropdown button { - width: 21px; - height: 22px; - padding: 0 3px 0 3px; - border: none; - background-color: #555; - border-radius: 0 2px 2px 0; - margin-left: -1px; - position: relative; -} - - .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 #FFFFFF; - border-bottom: 1px solid #FFFFFF; - background-color: #B0B0B0; -} - -.dropdown ul { - list-style: none; - position: absolute; - margin: 0; - padding: 0; - left: -80px; - top: 26px; - z-index: 4; - display: none; -} - -.dropup ul { - top: auto; - bottom: 26px; - border-radius: 3px; - box-shadow: 0 5px 10px #000; -} - -.dropup ul:after { - content: ''; - display: block; - position: absolute; - bottom: -10px; - right: 50%; - top: auto; - width: 0; - height: 0; - border: solid transparent 5px; - border-top-color: #fff; -} - -.dropdown li { - display: block; - width: 120px; - padding: 5px 10px; - color: #333; - background: #fff; - margin: 0; - line-height: 16px; -} - -.dropdown li:first-child {border-radius: 3px 3px 0 0;} -.dropdown li:last-child {border-radius: 0 0 3px 3px;} - - -.dropdown li:hover { - background-color: #ddd; - color: #000; -} - -.dropdown li.special { - padding: 10px; - background: white; - border: none; - box-shadow: 0 3px 10px black; - border-radius: 3px !important; -} - -.dropdown li.special:after { - content: ''; - display: block; - position: absolute; - top: -10px; - right: 50%; - border: solid transparent 5px; - border-bottom-color: #fff; - -} - -.dropdown li.special.down:after { - bottom: -10px; - right: 50%; - top: auto; - border: solid transparent 5px; - border-top-color: #fff; - -} - - .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; +.tool_button { + height: 40px; + width: 50px; cursor: pointer; + line-height: 60px; + text-align: center; } - #main_menu li#tool_open, #main_menu li#tool_import { +.tool_button svg { + vertical-align: center; + fill: #999; +} + + +.tool_button:hover svg { + fill: #ddd; +} + +.tool_button.current svg { + fill: #0cf; +} + +.tool_button.disabled, +.tool_button.disabled:hover { + opacity: 0.3; + background-color: #aaa; +} + +#main_menu li#tool_open, #main_menu li#tool_import { position: relative; overflow: hidden; } @@ -1575,13 +2071,6 @@ box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.1), opacity: 0; } - - -#url_notice { - padding-top: 4px; - display: none; -} - #color_picker { position: absolute; display: none; @@ -1593,33 +2082,6 @@ box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.1), 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; @@ -1630,20 +2092,6 @@ box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.1), background: #2f2f2c; } - #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; -} #tools_top h4 { color: #fff; @@ -1654,7 +2102,6 @@ box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.1), #tools_top .dropdown .icon_label { border: 1px solid transparent; -/* margin-top: 3px;*/ height: auto; } @@ -1670,118 +2117,39 @@ box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.1), display: none; } - .draginput_cell { +.draginput_cell { float: left; height: 26px; height: 26px; border: solid #3f3f3c 10px; outline: solid #2f2f2c 1px; - background: #ddd; + background-color: #3f3f3c; cursor: pointer; position: relative; } - .draginput_cell:hover { - background: #fff; +.draginput_cell svg { + fill: #999; } - .draginput_cell:after { - content: ''; - position: absolute; - top: 0; - left: 0; - border: solid #3f3f3c 1px; - height: 26px; - width: 26px; - z-index: 0; +.draginput_cell:hover svg { + fill: #fff; } - .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; -} - - - #option_lists .tool_button, #option_lists .push_button, #option_lists .tool_button_current, #option_lists .push_button_pressed { - border: none; - 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; -} - 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; } @@ -1858,66 +2226,6 @@ box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.1), 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; -} - -#shape_cats > div:first-child { - border-radius: 3px 0 0 0; -} - -#shape_cats > div:last-child { - border-radius: 0 0 0 3px; -} - -#shape_cats div:hover { - background: #efefef; - color: #000; -} -#shape_cats div.current { - font-weight: bold; - background: #3f3f3c; - color: #fff; - position: relative; -} - -#shape_cats div.current:after { - content: ''; - position: absolute; - right: -26px; - top: 0; - border: solid transparent 13px; - border-left-color: #3f3f3c; -} - .toolbar_button button .svg_icon { display: none; } @@ -2000,189 +2308,10 @@ box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.1), } -/* Slider -----------------------------------*/ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; } - -.ui-slider { - background: #3F3F3C; - border-radius: 10px; -} - -.ui-slider-handle { - box-shadow: 0 3px 3px rgba(0,0,0,0.3); - border-radius: 30px; - background: #fff; - background-image: -ms-linear-gradient(top, #ccc 0%, #fff 100%); - background-image: -moz-linear-gradient(top, #ccc 0%, #fff 100%); - background-image: -o-linear-gradient(top, #ccc 0%, #fff 100%); - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ccc), color-stop(1, #fff)); - background-image: -webkit-linear-gradient(top, #ccc 0%, #fff 100%); - background-image: linear-gradient(top, #ccc 0%, #fff 100%); -} - -.ui-slider-handle:focus { - outline: none; -} - -/* Necessary to keep the flyouts sized properly */ -#shape_buttons {background: #fff; border-radius: 0 3px 3px 0; padding: 10px} - - .tools_flyout .tool_button, - .tools_flyout .tool_flyout { - background: #fff; - width: 40px; - height: 40px; - margin: 5px; - border-radius: 0px; - -moz-border-radius: 0px; - -webkit-border-radius: 0px; - border-width: 0; -} - -/* Generic context menu styles */ -.contextMenu { - position: absolute; - z-index: 99999; - border: solid 1px rgba(0,0,0,.33); - background: rgba(255,255,255,.95); - padding: 5px 0; - margin: 0px; - display: none; - font: 12px/15px 'Lucida Sans', 'Lucida Grande', 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); -} - -.touch .contextMenu { - border: solid 5px rgba(0,0,0,.7); - padding: 0; - margin: 0 0 0 20px; - font: 18px/24px sans-serif; - border-radius: 5px; - -webkit-box-shadow: 2px 5px 20px 3px #000; - box-shadow: 2px 5px 20px rgba(0,0,0,0.5); -} - -.touch .contextMenu:after { - content: ''; - width: 0; - height: 0; - border: solid transparent 10px; - border-right-color: rgba(0,0,0,.7); - position: absolute; - top: 50%; - left: -25px; - margin-top: -10px; - z-index: 1000; -} - -.contextMenu LI { - list-style: none; - padding: 0px; - margin: 0px; -} - -.contextMenu .shortcut { - width: 115px; - text-align:right; - float:right; -} - -.touch .contextMenu .shortcut { - display: none; -} - - .touch .shortcut { display: none; } - -.contextMenu A { - -moz-user-select: none; - -webkit-user-select: none; - color: #222; - text-decoration: none; - display: block; - line-height: 20px; - height: 20px; - background-position: 6px center; - background-repeat: no-repeat; - outline: none; - padding: 0px 15px 1px 20px; -} - -.touch .contextMenu A { - padding: 0 15px; - border-bottom: #; - font-weight: bold; - border-top: solid 1px #E3E3E3; - height: 40px; - line-height: 40px; - min-width: 200px; -} - -.contextMenu LI.hover A { - background-color: #2e5dea; - color: white; - cursor: default; -} - -.contextMenu LI.disabled A { - color: #999; - -} - -.touch .contextMenu LI.disabled A { - display: none; -} - -.contextMenu LI.hover.disabled A { - background-color: transparent; -} - -.contextMenu LI.separator { - border-top: solid 1px #E3E3E3; - padding-top: 5px; - margin-top: 5px; -} - -.touch .contextMenu LI.separator { - border-top: none; - margin: 0; - padding: 0; -} - -#menu { - display: none; - position: absolute; - top: 0; - left: 0; - right: 0; - height: 30px; - background: #000; - z-index: 10; - color: #fff; -} - #workarea.rect, #workarea.line, #workarea.ellipse, #workarea.path, #workarea.shapelib { cursor: crosshair; } @@ -2253,124 +2382,7 @@ box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.1), } - #group_title {display: none;} - -#base_unit_container { - display: none; - position: absolute; - z-index: 20; -} - - .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: none; - 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; -} - -.draginput.twocol { - width: 145px; -} +#group_title {display: none;} #tool_font_family .caret { right: 40px; @@ -2438,108 +2450,12 @@ box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.1), background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxsaW5lYXJHcmFkaWVudCBpZD0iZzU4MCIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIHgxPSIwJSIgeTE9IjAlIiB4Mj0iMTAwJSIgeTI9IjAlIj48c3RvcCBzdG9wLWNvbG9yPSIjM2YzZjNjIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiMzZjNmM2MiIG9mZnNldD0iMC43Ii8+PC9saW5lYXJHcmFkaWVudD48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2c1ODApIiAvPjwvc3ZnPg==); } - -.draginput input, .draginput input:hover, .draginput input:active { - cursor: url(../images/drag.png), move; - cursor: -webkit-grab; - cursor: -moz-grab; -} - -.draginput input[type="checkbox"], .draginput input[type="checkbox"]:hover, .draginput input[type="checkbox"]:active { - cursor: pointer; -} - -.draginput.checkbox { - cursor: pointer; -} - -.draginput.active input, .draginput.active input:hover, .draginput.active input:active { - cursor: url(../images/dragging.png), move; - cursor: -webkit-grabbing; - cursor: -moz-grabbing; -} - - - - .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; - top: 0; - left: 0; -} - - -.draginput_cursor{ - position: absolute; - top: 50%; - width: 100%; - border-top: solid rgba(50,100,200,0.25) 3px; - margin-top: -2px; - z-index: 0; -} - - .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: #50A0FF; - color: #fff; - outline: none; - box-shadow: 0 0 5px 2px #50A0FF; -} - - .draginput input:focus+span { - z-index: 10; - color:#fff; -} - -.draginput .push_bottom { - bottom: 0; - position: absolute; -} - #zoom_label { height: 20px; background: transparent; cursor: default !important; width: auto; - padding: 0 10px; + padding: 0 20px; margin: 0; } @@ -2549,6 +2465,10 @@ box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.1), position: absolute; } +#zoom_panel .caret { + margin-top: -5px; +} + #zoom_label img, #zoom_label svg { width: 16px; height: 16px; @@ -2562,15 +2482,10 @@ box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.1), width: 16px; height: 16px; cursor: pointer; - background: #ccc; } -#zoomLabel:after { - content: ''; - position: absolute; - border-left: solid #2f2f2c 1px; - left: 0; - height: 16px; +#zoomLabel svg { + fill: #999; } #zoom_label input { @@ -2665,88 +2580,4 @@ input[readonly=readonly]:focus { #tool_align_relative select { width: 100%; display: block; -} -@font-face { - font-family: 'Arvo'; - src: url('font-files/arvo-bold-webfont.woff') format('woff'); - font-weight: bold; - font-style: normal; -} -@font-face { - font-family: 'Arvo'; - src: url('font-files/arvo-bolditalic-webfont.woff') format('woff'); - font-weight: bold; - font-style: italic; -} -@font-face { - font-family: 'Arvo'; - src: url('font-files/arvo-italic-webfont.woff') format('woff'); - font-weight: normal; - font-style: italic; -} -@font-face { - font-family: 'Arvo'; - src: url('font-files/arvo-regular-webfont.woff') format('woff'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'Euphoria'; - src: url('font-files/euphoriascript-regular-webfont.woff') format('woff'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'Shadows Into Light'; - src: url('font-files/shadowsintolight-webfont.woff') format('woff'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'Simonetta'; - src: url('font-files/simonetta-black-webfont.woff') format('woff'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'Simonetta'; - src: url('font-files/simonetta-blackitalic-webfont.woff') format('woff'); - font-weight: normal; - font-style: italic; -} -@font-face { - font-family: 'Simonetta'; - src: url('font-files/simonetta-italic-webfont.woff') format('woff'); - font-weight: normal; - font-style: italic; -} -@font-face { - font-family: 'Simonetta'; - src: url('font-files/simonetta-regular-webfont.woff') format('woff'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'Junction'; - src: url('font-files/Junction-webfont.woff') format('woff'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'League Gothic'; - src: url('font-files/League_Gothic-webfont.woff') format('woff'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'Fanwood'; - src: url('font-files/fanwood-webfont.woff') format('woff'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'Fanwood'; - src: url('font-files/fanwood_italic-webfont.woff') format('woff'); - font-weight: normal; - font-style: italic; } \ No newline at end of file diff --git a/dist/all.js b/dist/all.js index 0f647ea..d1f1d4d 100644 --- a/dist/all.js +++ b/dist/all.js @@ -16,91 +16,93 @@ this._owningPathSegList = owningPathSegList; } - SVGPathSeg.PATHSEG_UNKNOWN = 0; - SVGPathSeg.PATHSEG_CLOSEPATH = 1; - SVGPathSeg.PATHSEG_MOVETO_ABS = 2; - SVGPathSeg.PATHSEG_MOVETO_REL = 3; - SVGPathSeg.PATHSEG_LINETO_ABS = 4; - SVGPathSeg.PATHSEG_LINETO_REL = 5; - SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS = 6; - SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL = 7; - SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS = 8; - SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL = 9; - SVGPathSeg.PATHSEG_ARC_ABS = 10; - SVGPathSeg.PATHSEG_ARC_REL = 11; - SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS = 12; - SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL = 13; - SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS = 14; - SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL = 15; - SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = 16; - SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL = 17; - SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18; - SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19; + window.SVGPathSeg.prototype.classname = "SVGPathSeg"; + + window.SVGPathSeg.PATHSEG_UNKNOWN = 0; + window.SVGPathSeg.PATHSEG_CLOSEPATH = 1; + window.SVGPathSeg.PATHSEG_MOVETO_ABS = 2; + window.SVGPathSeg.PATHSEG_MOVETO_REL = 3; + window.SVGPathSeg.PATHSEG_LINETO_ABS = 4; + window.SVGPathSeg.PATHSEG_LINETO_REL = 5; + window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS = 6; + window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL = 7; + window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS = 8; + window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL = 9; + window.SVGPathSeg.PATHSEG_ARC_ABS = 10; + window.SVGPathSeg.PATHSEG_ARC_REL = 11; + window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS = 12; + window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL = 13; + window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS = 14; + window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL = 15; + window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS = 16; + window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL = 17; + window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18; + window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19; // Notify owning PathSegList on any changes so they can be synchronized back to the path element. - SVGPathSeg.prototype._segmentChanged = function() { + window.SVGPathSeg.prototype._segmentChanged = function() { if (this._owningPathSegList) this._owningPathSegList.segmentChanged(this); } window.SVGPathSegClosePath = function(owningPathSegList) { - SVGPathSeg.call(this, SVGPathSeg.PATHSEG_CLOSEPATH, "z", owningPathSegList); + window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CLOSEPATH, "z", owningPathSegList); } - SVGPathSegClosePath.prototype = Object.create(SVGPathSeg.prototype); - SVGPathSegClosePath.prototype.toString = function() { return "[object SVGPathSegClosePath]"; } - SVGPathSegClosePath.prototype._asPathString = function() { return this.pathSegTypeAsLetter; } - SVGPathSegClosePath.prototype.clone = function() { return new SVGPathSegClosePath(undefined); } + window.SVGPathSegClosePath.prototype = Object.create(window.SVGPathSeg.prototype); + window.SVGPathSegClosePath.prototype.toString = function() { return "[object SVGPathSegClosePath]"; } + window.SVGPathSegClosePath.prototype._asPathString = function() { return this.pathSegTypeAsLetter; } + window.SVGPathSegClosePath.prototype.clone = function() { return new window.SVGPathSegClosePath(undefined); } window.SVGPathSegMovetoAbs = function(owningPathSegList, x, y) { - SVGPathSeg.call(this, SVGPathSeg.PATHSEG_MOVETO_ABS, "M", owningPathSegList); + window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_MOVETO_ABS, "M", owningPathSegList); this._x = x; this._y = y; } - SVGPathSegMovetoAbs.prototype = Object.create(SVGPathSeg.prototype); - SVGPathSegMovetoAbs.prototype.toString = function() { return "[object SVGPathSegMovetoAbs]"; } - SVGPathSegMovetoAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; } - SVGPathSegMovetoAbs.prototype.clone = function() { return new SVGPathSegMovetoAbs(undefined, this._x, this._y); } - Object.defineProperty(SVGPathSegMovetoAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegMovetoAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); + window.SVGPathSegMovetoAbs.prototype = Object.create(window.SVGPathSeg.prototype); + window.SVGPathSegMovetoAbs.prototype.toString = function() { return "[object SVGPathSegMovetoAbs]"; } + window.SVGPathSegMovetoAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; } + window.SVGPathSegMovetoAbs.prototype.clone = function() { return new window.SVGPathSegMovetoAbs(undefined, this._x, this._y); } + Object.defineProperty(window.SVGPathSegMovetoAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegMovetoAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegMovetoRel = function(owningPathSegList, x, y) { - SVGPathSeg.call(this, SVGPathSeg.PATHSEG_MOVETO_REL, "m", owningPathSegList); + window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_MOVETO_REL, "m", owningPathSegList); this._x = x; this._y = y; } - SVGPathSegMovetoRel.prototype = Object.create(SVGPathSeg.prototype); - SVGPathSegMovetoRel.prototype.toString = function() { return "[object SVGPathSegMovetoRel]"; } - SVGPathSegMovetoRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; } - SVGPathSegMovetoRel.prototype.clone = function() { return new SVGPathSegMovetoRel(undefined, this._x, this._y); } - Object.defineProperty(SVGPathSegMovetoRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegMovetoRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); + window.SVGPathSegMovetoRel.prototype = Object.create(window.SVGPathSeg.prototype); + window.SVGPathSegMovetoRel.prototype.toString = function() { return "[object SVGPathSegMovetoRel]"; } + window.SVGPathSegMovetoRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; } + window.SVGPathSegMovetoRel.prototype.clone = function() { return new window.SVGPathSegMovetoRel(undefined, this._x, this._y); } + Object.defineProperty(window.SVGPathSegMovetoRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegMovetoRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegLinetoAbs = function(owningPathSegList, x, y) { - SVGPathSeg.call(this, SVGPathSeg.PATHSEG_LINETO_ABS, "L", owningPathSegList); + window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_ABS, "L", owningPathSegList); this._x = x; this._y = y; } - SVGPathSegLinetoAbs.prototype = Object.create(SVGPathSeg.prototype); - SVGPathSegLinetoAbs.prototype.toString = function() { return "[object SVGPathSegLinetoAbs]"; } - SVGPathSegLinetoAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; } - SVGPathSegLinetoAbs.prototype.clone = function() { return new SVGPathSegLinetoAbs(undefined, this._x, this._y); } - Object.defineProperty(SVGPathSegLinetoAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegLinetoAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); + window.SVGPathSegLinetoAbs.prototype = Object.create(window.SVGPathSeg.prototype); + window.SVGPathSegLinetoAbs.prototype.toString = function() { return "[object SVGPathSegLinetoAbs]"; } + window.SVGPathSegLinetoAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; } + window.SVGPathSegLinetoAbs.prototype.clone = function() { return new window.SVGPathSegLinetoAbs(undefined, this._x, this._y); } + Object.defineProperty(window.SVGPathSegLinetoAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegLinetoAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegLinetoRel = function(owningPathSegList, x, y) { - SVGPathSeg.call(this, SVGPathSeg.PATHSEG_LINETO_REL, "l", owningPathSegList); + window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_REL, "l", owningPathSegList); this._x = x; this._y = y; } - SVGPathSegLinetoRel.prototype = Object.create(SVGPathSeg.prototype); - SVGPathSegLinetoRel.prototype.toString = function() { return "[object SVGPathSegLinetoRel]"; } - SVGPathSegLinetoRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; } - SVGPathSegLinetoRel.prototype.clone = function() { return new SVGPathSegLinetoRel(undefined, this._x, this._y); } - Object.defineProperty(SVGPathSegLinetoRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegLinetoRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); + window.SVGPathSegLinetoRel.prototype = Object.create(window.SVGPathSeg.prototype); + window.SVGPathSegLinetoRel.prototype.toString = function() { return "[object SVGPathSegLinetoRel]"; } + window.SVGPathSegLinetoRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; } + window.SVGPathSegLinetoRel.prototype.clone = function() { return new window.SVGPathSegLinetoRel(undefined, this._x, this._y); } + Object.defineProperty(window.SVGPathSegLinetoRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegLinetoRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegCurvetoCubicAbs = function(owningPathSegList, x, y, x1, y1, x2, y2) { - SVGPathSeg.call(this, SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS, "C", owningPathSegList); + window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS, "C", owningPathSegList); this._x = x; this._y = y; this._x1 = x1; @@ -108,19 +110,19 @@ this._x2 = x2; this._y2 = y2; } - SVGPathSegCurvetoCubicAbs.prototype = Object.create(SVGPathSeg.prototype); - SVGPathSegCurvetoCubicAbs.prototype.toString = function() { return "[object SVGPathSegCurvetoCubicAbs]"; } - SVGPathSegCurvetoCubicAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x1 + " " + this._y1 + " " + this._x2 + " " + this._y2 + " " + this._x + " " + this._y; } - SVGPathSegCurvetoCubicAbs.prototype.clone = function() { return new SVGPathSegCurvetoCubicAbs(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); } - Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype, "x1", { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype, "y1", { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype, "x2", { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype, "y2", { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true }); + window.SVGPathSegCurvetoCubicAbs.prototype = Object.create(window.SVGPathSeg.prototype); + window.SVGPathSegCurvetoCubicAbs.prototype.toString = function() { return "[object SVGPathSegCurvetoCubicAbs]"; } + window.SVGPathSegCurvetoCubicAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x1 + " " + this._y1 + " " + this._x2 + " " + this._y2 + " " + this._x + " " + this._y; } + window.SVGPathSegCurvetoCubicAbs.prototype.clone = function() { return new window.SVGPathSegCurvetoCubicAbs(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); } + Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "x1", { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "y1", { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "x2", { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype, "y2", { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegCurvetoCubicRel = function(owningPathSegList, x, y, x1, y1, x2, y2) { - SVGPathSeg.call(this, SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL, "c", owningPathSegList); + window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL, "c", owningPathSegList); this._x = x; this._y = y; this._x1 = x1; @@ -128,51 +130,51 @@ this._x2 = x2; this._y2 = y2; } - SVGPathSegCurvetoCubicRel.prototype = Object.create(SVGPathSeg.prototype); - SVGPathSegCurvetoCubicRel.prototype.toString = function() { return "[object SVGPathSegCurvetoCubicRel]"; } - SVGPathSegCurvetoCubicRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x1 + " " + this._y1 + " " + this._x2 + " " + this._y2 + " " + this._x + " " + this._y; } - SVGPathSegCurvetoCubicRel.prototype.clone = function() { return new SVGPathSegCurvetoCubicRel(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); } - Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype, "x1", { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype, "y1", { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype, "x2", { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype, "y2", { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true }); + window.SVGPathSegCurvetoCubicRel.prototype = Object.create(window.SVGPathSeg.prototype); + window.SVGPathSegCurvetoCubicRel.prototype.toString = function() { return "[object SVGPathSegCurvetoCubicRel]"; } + window.SVGPathSegCurvetoCubicRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x1 + " " + this._y1 + " " + this._x2 + " " + this._y2 + " " + this._x + " " + this._y; } + window.SVGPathSegCurvetoCubicRel.prototype.clone = function() { return new window.SVGPathSegCurvetoCubicRel(undefined, this._x, this._y, this._x1, this._y1, this._x2, this._y2); } + Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "x1", { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "y1", { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "x2", { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype, "y2", { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegCurvetoQuadraticAbs = function(owningPathSegList, x, y, x1, y1) { - SVGPathSeg.call(this, SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS, "Q", owningPathSegList); + window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS, "Q", owningPathSegList); this._x = x; this._y = y; this._x1 = x1; this._y1 = y1; } - SVGPathSegCurvetoQuadraticAbs.prototype = Object.create(SVGPathSeg.prototype); - SVGPathSegCurvetoQuadraticAbs.prototype.toString = function() { return "[object SVGPathSegCurvetoQuadraticAbs]"; } - SVGPathSegCurvetoQuadraticAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x1 + " " + this._y1 + " " + this._x + " " + this._y; } - SVGPathSegCurvetoQuadraticAbs.prototype.clone = function() { return new SVGPathSegCurvetoQuadraticAbs(undefined, this._x, this._y, this._x1, this._y1); } - Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype, "x1", { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype, "y1", { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true }); + window.SVGPathSegCurvetoQuadraticAbs.prototype = Object.create(window.SVGPathSeg.prototype); + window.SVGPathSegCurvetoQuadraticAbs.prototype.toString = function() { return "[object SVGPathSegCurvetoQuadraticAbs]"; } + window.SVGPathSegCurvetoQuadraticAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x1 + " " + this._y1 + " " + this._x + " " + this._y; } + window.SVGPathSegCurvetoQuadraticAbs.prototype.clone = function() { return new window.SVGPathSegCurvetoQuadraticAbs(undefined, this._x, this._y, this._x1, this._y1); } + Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "x1", { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype, "y1", { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegCurvetoQuadraticRel = function(owningPathSegList, x, y, x1, y1) { - SVGPathSeg.call(this, SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL, "q", owningPathSegList); + window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL, "q", owningPathSegList); this._x = x; this._y = y; this._x1 = x1; this._y1 = y1; } - SVGPathSegCurvetoQuadraticRel.prototype = Object.create(SVGPathSeg.prototype); - SVGPathSegCurvetoQuadraticRel.prototype.toString = function() { return "[object SVGPathSegCurvetoQuadraticRel]"; } - SVGPathSegCurvetoQuadraticRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x1 + " " + this._y1 + " " + this._x + " " + this._y; } - SVGPathSegCurvetoQuadraticRel.prototype.clone = function() { return new SVGPathSegCurvetoQuadraticRel(undefined, this._x, this._y, this._x1, this._y1); } - Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype, "x1", { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype, "y1", { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true }); + window.SVGPathSegCurvetoQuadraticRel.prototype = Object.create(window.SVGPathSeg.prototype); + window.SVGPathSegCurvetoQuadraticRel.prototype.toString = function() { return "[object SVGPathSegCurvetoQuadraticRel]"; } + window.SVGPathSegCurvetoQuadraticRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x1 + " " + this._y1 + " " + this._x + " " + this._y; } + window.SVGPathSegCurvetoQuadraticRel.prototype.clone = function() { return new window.SVGPathSegCurvetoQuadraticRel(undefined, this._x, this._y, this._x1, this._y1); } + Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "x1", { get: function() { return this._x1; }, set: function(x1) { this._x1 = x1; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype, "y1", { get: function() { return this._y1; }, set: function(y1) { this._y1 = y1; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegArcAbs = function(owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) { - SVGPathSeg.call(this, SVGPathSeg.PATHSEG_ARC_ABS, "A", owningPathSegList); + window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_ARC_ABS, "A", owningPathSegList); this._x = x; this._y = y; this._r1 = r1; @@ -181,20 +183,20 @@ this._largeArcFlag = largeArcFlag; this._sweepFlag = sweepFlag; } - SVGPathSegArcAbs.prototype = Object.create(SVGPathSeg.prototype); - SVGPathSegArcAbs.prototype.toString = function() { return "[object SVGPathSegArcAbs]"; } - SVGPathSegArcAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._r1 + " " + this._r2 + " " + this._angle + " " + (this._largeArcFlag ? "1" : "0") + " " + (this._sweepFlag ? "1" : "0") + " " + this._x + " " + this._y; } - SVGPathSegArcAbs.prototype.clone = function() { return new SVGPathSegArcAbs(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); } - Object.defineProperty(SVGPathSegArcAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegArcAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegArcAbs.prototype, "r1", { get: function() { return this._r1; }, set: function(r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegArcAbs.prototype, "r2", { get: function() { return this._r2; }, set: function(r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegArcAbs.prototype, "angle", { get: function() { return this._angle; }, set: function(angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegArcAbs.prototype, "largeArcFlag", { get: function() { return this._largeArcFlag; }, set: function(largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegArcAbs.prototype, "sweepFlag", { get: function() { return this._sweepFlag; }, set: function(sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true }); + window.SVGPathSegArcAbs.prototype = Object.create(window.SVGPathSeg.prototype); + window.SVGPathSegArcAbs.prototype.toString = function() { return "[object SVGPathSegArcAbs]"; } + window.SVGPathSegArcAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._r1 + " " + this._r2 + " " + this._angle + " " + (this._largeArcFlag ? "1" : "0") + " " + (this._sweepFlag ? "1" : "0") + " " + this._x + " " + this._y; } + window.SVGPathSegArcAbs.prototype.clone = function() { return new window.SVGPathSegArcAbs(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); } + Object.defineProperty(window.SVGPathSegArcAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegArcAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegArcAbs.prototype, "r1", { get: function() { return this._r1; }, set: function(r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegArcAbs.prototype, "r2", { get: function() { return this._r2; }, set: function(r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegArcAbs.prototype, "angle", { get: function() { return this._angle; }, set: function(angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegArcAbs.prototype, "largeArcFlag", { get: function() { return this._largeArcFlag; }, set: function(largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegArcAbs.prototype, "sweepFlag", { get: function() { return this._sweepFlag; }, set: function(sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegArcRel = function(owningPathSegList, x, y, r1, r2, angle, largeArcFlag, sweepFlag) { - SVGPathSeg.call(this, SVGPathSeg.PATHSEG_ARC_REL, "a", owningPathSegList); + window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_ARC_REL, "a", owningPathSegList); this._x = x; this._y = y; this._r1 = r1; @@ -203,138 +205,169 @@ this._largeArcFlag = largeArcFlag; this._sweepFlag = sweepFlag; } - SVGPathSegArcRel.prototype = Object.create(SVGPathSeg.prototype); - SVGPathSegArcRel.prototype.toString = function() { return "[object SVGPathSegArcRel]"; } - SVGPathSegArcRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._r1 + " " + this._r2 + " " + this._angle + " " + (this._largeArcFlag ? "1" : "0") + " " + (this._sweepFlag ? "1" : "0") + " " + this._x + " " + this._y; } - SVGPathSegArcRel.prototype.clone = function() { return new SVGPathSegArcRel(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); } - Object.defineProperty(SVGPathSegArcRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegArcRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegArcRel.prototype, "r1", { get: function() { return this._r1; }, set: function(r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegArcRel.prototype, "r2", { get: function() { return this._r2; }, set: function(r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegArcRel.prototype, "angle", { get: function() { return this._angle; }, set: function(angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegArcRel.prototype, "largeArcFlag", { get: function() { return this._largeArcFlag; }, set: function(largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegArcRel.prototype, "sweepFlag", { get: function() { return this._sweepFlag; }, set: function(sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true }); + window.SVGPathSegArcRel.prototype = Object.create(window.SVGPathSeg.prototype); + window.SVGPathSegArcRel.prototype.toString = function() { return "[object SVGPathSegArcRel]"; } + window.SVGPathSegArcRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._r1 + " " + this._r2 + " " + this._angle + " " + (this._largeArcFlag ? "1" : "0") + " " + (this._sweepFlag ? "1" : "0") + " " + this._x + " " + this._y; } + window.SVGPathSegArcRel.prototype.clone = function() { return new window.SVGPathSegArcRel(undefined, this._x, this._y, this._r1, this._r2, this._angle, this._largeArcFlag, this._sweepFlag); } + Object.defineProperty(window.SVGPathSegArcRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegArcRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegArcRel.prototype, "r1", { get: function() { return this._r1; }, set: function(r1) { this._r1 = r1; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegArcRel.prototype, "r2", { get: function() { return this._r2; }, set: function(r2) { this._r2 = r2; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegArcRel.prototype, "angle", { get: function() { return this._angle; }, set: function(angle) { this._angle = angle; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegArcRel.prototype, "largeArcFlag", { get: function() { return this._largeArcFlag; }, set: function(largeArcFlag) { this._largeArcFlag = largeArcFlag; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegArcRel.prototype, "sweepFlag", { get: function() { return this._sweepFlag; }, set: function(sweepFlag) { this._sweepFlag = sweepFlag; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegLinetoHorizontalAbs = function(owningPathSegList, x) { - SVGPathSeg.call(this, SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS, "H", owningPathSegList); + window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS, "H", owningPathSegList); this._x = x; } - SVGPathSegLinetoHorizontalAbs.prototype = Object.create(SVGPathSeg.prototype); - SVGPathSegLinetoHorizontalAbs.prototype.toString = function() { return "[object SVGPathSegLinetoHorizontalAbs]"; } - SVGPathSegLinetoHorizontalAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x; } - SVGPathSegLinetoHorizontalAbs.prototype.clone = function() { return new SVGPathSegLinetoHorizontalAbs(undefined, this._x); } - Object.defineProperty(SVGPathSegLinetoHorizontalAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); + window.SVGPathSegLinetoHorizontalAbs.prototype = Object.create(window.SVGPathSeg.prototype); + window.SVGPathSegLinetoHorizontalAbs.prototype.toString = function() { return "[object SVGPathSegLinetoHorizontalAbs]"; } + window.SVGPathSegLinetoHorizontalAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x; } + window.SVGPathSegLinetoHorizontalAbs.prototype.clone = function() { return new window.SVGPathSegLinetoHorizontalAbs(undefined, this._x); } + Object.defineProperty(window.SVGPathSegLinetoHorizontalAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegLinetoHorizontalRel = function(owningPathSegList, x) { - SVGPathSeg.call(this, SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL, "h", owningPathSegList); + window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL, "h", owningPathSegList); this._x = x; } - SVGPathSegLinetoHorizontalRel.prototype = Object.create(SVGPathSeg.prototype); - SVGPathSegLinetoHorizontalRel.prototype.toString = function() { return "[object SVGPathSegLinetoHorizontalRel]"; } - SVGPathSegLinetoHorizontalRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x; } - SVGPathSegLinetoHorizontalRel.prototype.clone = function() { return new SVGPathSegLinetoHorizontalRel(undefined, this._x); } - Object.defineProperty(SVGPathSegLinetoHorizontalRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); + window.SVGPathSegLinetoHorizontalRel.prototype = Object.create(window.SVGPathSeg.prototype); + window.SVGPathSegLinetoHorizontalRel.prototype.toString = function() { return "[object SVGPathSegLinetoHorizontalRel]"; } + window.SVGPathSegLinetoHorizontalRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x; } + window.SVGPathSegLinetoHorizontalRel.prototype.clone = function() { return new window.SVGPathSegLinetoHorizontalRel(undefined, this._x); } + Object.defineProperty(window.SVGPathSegLinetoHorizontalRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegLinetoVerticalAbs = function(owningPathSegList, y) { - SVGPathSeg.call(this, SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS, "V", owningPathSegList); + window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS, "V", owningPathSegList); this._y = y; } - SVGPathSegLinetoVerticalAbs.prototype = Object.create(SVGPathSeg.prototype); - SVGPathSegLinetoVerticalAbs.prototype.toString = function() { return "[object SVGPathSegLinetoVerticalAbs]"; } - SVGPathSegLinetoVerticalAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._y; } - SVGPathSegLinetoVerticalAbs.prototype.clone = function() { return new SVGPathSegLinetoVerticalAbs(undefined, this._y); } - Object.defineProperty(SVGPathSegLinetoVerticalAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); + window.SVGPathSegLinetoVerticalAbs.prototype = Object.create(window.SVGPathSeg.prototype); + window.SVGPathSegLinetoVerticalAbs.prototype.toString = function() { return "[object SVGPathSegLinetoVerticalAbs]"; } + window.SVGPathSegLinetoVerticalAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._y; } + window.SVGPathSegLinetoVerticalAbs.prototype.clone = function() { return new window.SVGPathSegLinetoVerticalAbs(undefined, this._y); } + Object.defineProperty(window.SVGPathSegLinetoVerticalAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegLinetoVerticalRel = function(owningPathSegList, y) { - SVGPathSeg.call(this, SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL, "v", owningPathSegList); + window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL, "v", owningPathSegList); this._y = y; } - SVGPathSegLinetoVerticalRel.prototype = Object.create(SVGPathSeg.prototype); - SVGPathSegLinetoVerticalRel.prototype.toString = function() { return "[object SVGPathSegLinetoVerticalRel]"; } - SVGPathSegLinetoVerticalRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._y; } - SVGPathSegLinetoVerticalRel.prototype.clone = function() { return new SVGPathSegLinetoVerticalRel(undefined, this._y); } - Object.defineProperty(SVGPathSegLinetoVerticalRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); + window.SVGPathSegLinetoVerticalRel.prototype = Object.create(window.SVGPathSeg.prototype); + window.SVGPathSegLinetoVerticalRel.prototype.toString = function() { return "[object SVGPathSegLinetoVerticalRel]"; } + window.SVGPathSegLinetoVerticalRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._y; } + window.SVGPathSegLinetoVerticalRel.prototype.clone = function() { return new window.SVGPathSegLinetoVerticalRel(undefined, this._y); } + Object.defineProperty(window.SVGPathSegLinetoVerticalRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegCurvetoCubicSmoothAbs = function(owningPathSegList, x, y, x2, y2) { - SVGPathSeg.call(this, SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, "S", owningPathSegList); + window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, "S", owningPathSegList); this._x = x; this._y = y; this._x2 = x2; this._y2 = y2; } - SVGPathSegCurvetoCubicSmoothAbs.prototype = Object.create(SVGPathSeg.prototype); - SVGPathSegCurvetoCubicSmoothAbs.prototype.toString = function() { return "[object SVGPathSegCurvetoCubicSmoothAbs]"; } - SVGPathSegCurvetoCubicSmoothAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x2 + " " + this._y2 + " " + this._x + " " + this._y; } - SVGPathSegCurvetoCubicSmoothAbs.prototype.clone = function() { return new SVGPathSegCurvetoCubicSmoothAbs(undefined, this._x, this._y, this._x2, this._y2); } - Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype, "x2", { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype, "y2", { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true }); + window.SVGPathSegCurvetoCubicSmoothAbs.prototype = Object.create(window.SVGPathSeg.prototype); + window.SVGPathSegCurvetoCubicSmoothAbs.prototype.toString = function() { return "[object SVGPathSegCurvetoCubicSmoothAbs]"; } + window.SVGPathSegCurvetoCubicSmoothAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x2 + " " + this._y2 + " " + this._x + " " + this._y; } + window.SVGPathSegCurvetoCubicSmoothAbs.prototype.clone = function() { return new window.SVGPathSegCurvetoCubicSmoothAbs(undefined, this._x, this._y, this._x2, this._y2); } + Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "x2", { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype, "y2", { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegCurvetoCubicSmoothRel = function(owningPathSegList, x, y, x2, y2) { - SVGPathSeg.call(this, SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL, "s", owningPathSegList); + window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL, "s", owningPathSegList); this._x = x; this._y = y; this._x2 = x2; this._y2 = y2; } - SVGPathSegCurvetoCubicSmoothRel.prototype = Object.create(SVGPathSeg.prototype); - SVGPathSegCurvetoCubicSmoothRel.prototype.toString = function() { return "[object SVGPathSegCurvetoCubicSmoothRel]"; } - SVGPathSegCurvetoCubicSmoothRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x2 + " " + this._y2 + " " + this._x + " " + this._y; } - SVGPathSegCurvetoCubicSmoothRel.prototype.clone = function() { return new SVGPathSegCurvetoCubicSmoothRel(undefined, this._x, this._y, this._x2, this._y2); } - Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype, "x2", { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype, "y2", { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true }); + window.SVGPathSegCurvetoCubicSmoothRel.prototype = Object.create(window.SVGPathSeg.prototype); + window.SVGPathSegCurvetoCubicSmoothRel.prototype.toString = function() { return "[object SVGPathSegCurvetoCubicSmoothRel]"; } + window.SVGPathSegCurvetoCubicSmoothRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x2 + " " + this._y2 + " " + this._x + " " + this._y; } + window.SVGPathSegCurvetoCubicSmoothRel.prototype.clone = function() { return new window.SVGPathSegCurvetoCubicSmoothRel(undefined, this._x, this._y, this._x2, this._y2); } + Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "x2", { get: function() { return this._x2; }, set: function(x2) { this._x2 = x2; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype, "y2", { get: function() { return this._y2; }, set: function(y2) { this._y2 = y2; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegCurvetoQuadraticSmoothAbs = function(owningPathSegList, x, y) { - SVGPathSeg.call(this, SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, "T", owningPathSegList); + window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, "T", owningPathSegList); this._x = x; this._y = y; } - SVGPathSegCurvetoQuadraticSmoothAbs.prototype = Object.create(SVGPathSeg.prototype); - SVGPathSegCurvetoQuadraticSmoothAbs.prototype.toString = function() { return "[object SVGPathSegCurvetoQuadraticSmoothAbs]"; } - SVGPathSegCurvetoQuadraticSmoothAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; } - SVGPathSegCurvetoQuadraticSmoothAbs.prototype.clone = function() { return new SVGPathSegCurvetoQuadraticSmoothAbs(undefined, this._x, this._y); } - Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); + window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype = Object.create(window.SVGPathSeg.prototype); + window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.toString = function() { return "[object SVGPathSegCurvetoQuadraticSmoothAbs]"; } + window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; } + window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.clone = function() { return new window.SVGPathSegCurvetoQuadraticSmoothAbs(undefined, this._x, this._y); } + Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); window.SVGPathSegCurvetoQuadraticSmoothRel = function(owningPathSegList, x, y) { - SVGPathSeg.call(this, SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, "t", owningPathSegList); + window.SVGPathSeg.call(this, window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, "t", owningPathSegList); this._x = x; this._y = y; } - SVGPathSegCurvetoQuadraticSmoothRel.prototype = Object.create(SVGPathSeg.prototype); - SVGPathSegCurvetoQuadraticSmoothRel.prototype.toString = function() { return "[object SVGPathSegCurvetoQuadraticSmoothRel]"; } - SVGPathSegCurvetoQuadraticSmoothRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; } - SVGPathSegCurvetoQuadraticSmoothRel.prototype.clone = function() { return new SVGPathSegCurvetoQuadraticSmoothRel(undefined, this._x, this._y); } - Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); - Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); + window.SVGPathSegCurvetoQuadraticSmoothRel.prototype = Object.create(window.SVGPathSeg.prototype); + window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.toString = function() { return "[object SVGPathSegCurvetoQuadraticSmoothRel]"; } + window.SVGPathSegCurvetoQuadraticSmoothRel.prototype._asPathString = function() { return this.pathSegTypeAsLetter + " " + this._x + " " + this._y; } + window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.clone = function() { return new window.SVGPathSegCurvetoQuadraticSmoothRel(undefined, this._x, this._y); } + Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype, "x", { get: function() { return this._x; }, set: function(x) { this._x = x; this._segmentChanged(); }, enumerable: true }); + Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype, "y", { get: function() { return this._y; }, set: function(y) { this._y = y; this._segmentChanged(); }, enumerable: true }); - // Add createSVGPathSeg* functions to SVGPathElement. - // Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathElement. - SVGPathElement.prototype.createSVGPathSegClosePath = function() { return new SVGPathSegClosePath(undefined); } - SVGPathElement.prototype.createSVGPathSegMovetoAbs = function(x, y) { return new SVGPathSegMovetoAbs(undefined, x, y); } - SVGPathElement.prototype.createSVGPathSegMovetoRel = function(x, y) { return new SVGPathSegMovetoRel(undefined, x, y); } - SVGPathElement.prototype.createSVGPathSegLinetoAbs = function(x, y) { return new SVGPathSegLinetoAbs(undefined, x, y); } - SVGPathElement.prototype.createSVGPathSegLinetoRel = function(x, y) { return new SVGPathSegLinetoRel(undefined, x, y); } - SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs = function(x, y, x1, y1, x2, y2) { return new SVGPathSegCurvetoCubicAbs(undefined, x, y, x1, y1, x2, y2); } - SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel = function(x, y, x1, y1, x2, y2) { return new SVGPathSegCurvetoCubicRel(undefined, x, y, x1, y1, x2, y2); } - SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs = function(x, y, x1, y1) { return new SVGPathSegCurvetoQuadraticAbs(undefined, x, y, x1, y1); } - SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel = function(x, y, x1, y1) { return new SVGPathSegCurvetoQuadraticRel(undefined, x, y, x1, y1); } - SVGPathElement.prototype.createSVGPathSegArcAbs = function(x, y, r1, r2, angle, largeArcFlag, sweepFlag) { return new SVGPathSegArcAbs(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag); } - SVGPathElement.prototype.createSVGPathSegArcRel = function(x, y, r1, r2, angle, largeArcFlag, sweepFlag) { return new SVGPathSegArcRel(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag); } - SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs = function(x) { return new SVGPathSegLinetoHorizontalAbs(undefined, x); } - SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel = function(x) { return new SVGPathSegLinetoHorizontalRel(undefined, x); } - SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs = function(y) { return new SVGPathSegLinetoVerticalAbs(undefined, y); } - SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel = function(y) { return new SVGPathSegLinetoVerticalRel(undefined, y); } - SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs = function(x, y, x2, y2) { return new SVGPathSegCurvetoCubicSmoothAbs(undefined, x, y, x2, y2); } - SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel = function(x, y, x2, y2) { return new SVGPathSegCurvetoCubicSmoothRel(undefined, x, y, x2, y2); } - SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs = function(x, y) { return new SVGPathSegCurvetoQuadraticSmoothAbs(undefined, x, y); } - SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel = function(x, y) { return new SVGPathSegCurvetoQuadraticSmoothRel(undefined, x, y); } + // Add createSVGPathSeg* functions to window.SVGPathElement. + // Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-Interfacewindow.SVGPathElement. + window.SVGPathElement.prototype.createSVGPathSegClosePath = function() { return new window.SVGPathSegClosePath(undefined); } + window.SVGPathElement.prototype.createSVGPathSegMovetoAbs = function(x, y) { return new window.SVGPathSegMovetoAbs(undefined, x, y); } + window.SVGPathElement.prototype.createSVGPathSegMovetoRel = function(x, y) { return new window.SVGPathSegMovetoRel(undefined, x, y); } + window.SVGPathElement.prototype.createSVGPathSegLinetoAbs = function(x, y) { return new window.SVGPathSegLinetoAbs(undefined, x, y); } + window.SVGPathElement.prototype.createSVGPathSegLinetoRel = function(x, y) { return new window.SVGPathSegLinetoRel(undefined, x, y); } + window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs = function(x, y, x1, y1, x2, y2) { return new window.SVGPathSegCurvetoCubicAbs(undefined, x, y, x1, y1, x2, y2); } + window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel = function(x, y, x1, y1, x2, y2) { return new window.SVGPathSegCurvetoCubicRel(undefined, x, y, x1, y1, x2, y2); } + window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs = function(x, y, x1, y1) { return new window.SVGPathSegCurvetoQuadraticAbs(undefined, x, y, x1, y1); } + window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel = function(x, y, x1, y1) { return new window.SVGPathSegCurvetoQuadraticRel(undefined, x, y, x1, y1); } + window.SVGPathElement.prototype.createSVGPathSegArcAbs = function(x, y, r1, r2, angle, largeArcFlag, sweepFlag) { return new window.SVGPathSegArcAbs(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag); } + window.SVGPathElement.prototype.createSVGPathSegArcRel = function(x, y, r1, r2, angle, largeArcFlag, sweepFlag) { return new window.SVGPathSegArcRel(undefined, x, y, r1, r2, angle, largeArcFlag, sweepFlag); } + window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs = function(x) { return new window.SVGPathSegLinetoHorizontalAbs(undefined, x); } + window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel = function(x) { return new window.SVGPathSegLinetoHorizontalRel(undefined, x); } + window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs = function(y) { return new window.SVGPathSegLinetoVerticalAbs(undefined, y); } + window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel = function(y) { return new window.SVGPathSegLinetoVerticalRel(undefined, y); } + window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs = function(x, y, x2, y2) { return new window.SVGPathSegCurvetoCubicSmoothAbs(undefined, x, y, x2, y2); } + window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel = function(x, y, x2, y2) { return new window.SVGPathSegCurvetoCubicSmoothRel(undefined, x, y, x2, y2); } + window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs = function(x, y) { return new window.SVGPathSegCurvetoQuadraticSmoothAbs(undefined, x, y); } + window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel = function(x, y) { return new window.SVGPathSegCurvetoQuadraticSmoothRel(undefined, x, y); } + + if (!("getPathSegAtLength" in window.SVGPathElement.prototype)) { + // Add getPathSegAtLength to SVGPathElement. + // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-__svg__SVGPathElement__getPathSegAtLength + // This polyfill requires SVGPathElement.getTotalLength to implement the distance-along-a-path algorithm. + window.SVGPathElement.prototype.getPathSegAtLength = function(distance) { + if (distance === undefined || !isFinite(distance)) + throw "Invalid arguments."; + + var measurementElement = document.createElementNS("http://www.w3.org/2000/svg", "path"); + measurementElement.setAttribute("d", this.getAttribute("d")); + var lastPathSegment = measurementElement.pathSegList.numberOfItems - 1; + + // If the path is empty, return 0. + if (lastPathSegment <= 0) + return 0; + + do { + measurementElement.pathSegList.removeItem(lastPathSegment); + if (distance > measurementElement.getTotalLength()) + break; + lastPathSegment--; + } while (lastPathSegment > 0); + return lastPathSegment; + } + } } - if (!("SVGPathSegList" in window)) { + // Checking for SVGPathSegList in window checks for the case of an implementation without the + // SVGPathSegList API. + // The second check for appendItem is specific to Firefox 59+ which removed only parts of the + // SVGPathSegList API (e.g., appendItem). In this case we need to re-implement the entire API + // so the polyfill data (i.e., _list) is used throughout. + if (!("SVGPathSegList" in window) || !("appendItem" in window.SVGPathSegList.prototype)) { // Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSegList window.SVGPathSegList = function(pathElement) { this._pathElement = pathElement; @@ -346,7 +379,9 @@ this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig); } - Object.defineProperty(SVGPathSegList.prototype, "numberOfItems", { + window.SVGPathSegList.prototype.classname = "SVGPathSegList"; + + Object.defineProperty(window.SVGPathSegList.prototype, "numberOfItems", { get: function() { this._checkPathSynchronizedToList(); return this._list.length; @@ -354,29 +389,38 @@ enumerable: true }); - // Add the pathSegList accessors to SVGPathElement. + // The length property was not specified but was in Firefox 58. + Object.defineProperty(window.SVGPathSegList.prototype, "length", { + get: function() { + this._checkPathSynchronizedToList(); + return this._list.length; + }, + enumerable: true + }); + + // Add the pathSegList accessors to window.SVGPathElement. // Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGAnimatedPathData - Object.defineProperty(SVGPathElement.prototype, "pathSegList", { + Object.defineProperty(window.SVGPathElement.prototype, "pathSegList", { get: function() { if (!this._pathSegList) - this._pathSegList = new SVGPathSegList(this); + this._pathSegList = new window.SVGPathSegList(this); return this._pathSegList; }, enumerable: true }); - // FIXME: The following are not implemented and simply return SVGPathElement.pathSegList. - Object.defineProperty(SVGPathElement.prototype, "normalizedPathSegList", { get: function() { return this.pathSegList; }, enumerable: true }); - Object.defineProperty(SVGPathElement.prototype, "animatedPathSegList", { get: function() { return this.pathSegList; }, enumerable: true }); - Object.defineProperty(SVGPathElement.prototype, "animatedNormalizedPathSegList", { get: function() { return this.pathSegList; }, enumerable: true }); + // FIXME: The following are not implemented and simply return window.SVGPathElement.pathSegList. + Object.defineProperty(window.SVGPathElement.prototype, "normalizedPathSegList", { get: function() { return this.pathSegList; }, enumerable: true }); + Object.defineProperty(window.SVGPathElement.prototype, "animatedPathSegList", { get: function() { return this.pathSegList; }, enumerable: true }); + Object.defineProperty(window.SVGPathElement.prototype, "animatedNormalizedPathSegList", { get: function() { return this.pathSegList; }, enumerable: true }); // Process any pending mutations to the path element and update the list as needed. // This should be the first call of all public functions and is needed because // MutationObservers are not synchronous so we can have pending asynchronous mutations. - SVGPathSegList.prototype._checkPathSynchronizedToList = function() { + window.SVGPathSegList.prototype._checkPathSynchronizedToList = function() { this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords()); } - SVGPathSegList.prototype._updateListFromPathMutations = function(mutationRecords) { + window.SVGPathSegList.prototype._updateListFromPathMutations = function(mutationRecords) { if (!this._pathElement) return; var hasPathMutations = false; @@ -389,18 +433,18 @@ } // Serialize the list and update the path's 'd' attribute. - SVGPathSegList.prototype._writeListToPath = function() { + window.SVGPathSegList.prototype._writeListToPath = function() { this._pathElementMutationObserver.disconnect(); - this._pathElement.setAttribute("d", SVGPathSegList._pathSegArrayAsString(this._list)); + this._pathElement.setAttribute("d", window.SVGPathSegList._pathSegArrayAsString(this._list)); this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig); } // When a path segment changes the list needs to be synchronized back to the path element. - SVGPathSegList.prototype.segmentChanged = function(pathSeg) { + window.SVGPathSegList.prototype.segmentChanged = function(pathSeg) { this._writeListToPath(); } - SVGPathSegList.prototype.clear = function() { + window.SVGPathSegList.prototype.clear = function() { this._checkPathSynchronizedToList(); this._list.forEach(function(pathSeg) { @@ -410,7 +454,7 @@ this._writeListToPath(); } - SVGPathSegList.prototype.initialize = function(newItem) { + window.SVGPathSegList.prototype.initialize = function(newItem) { this._checkPathSynchronizedToList(); this._list = [newItem]; @@ -419,19 +463,19 @@ return newItem; } - SVGPathSegList.prototype._checkValidIndex = function(index) { + window.SVGPathSegList.prototype._checkValidIndex = function(index) { if (isNaN(index) || index < 0 || index >= this.numberOfItems) throw "INDEX_SIZE_ERR"; } - SVGPathSegList.prototype.getItem = function(index) { + window.SVGPathSegList.prototype.getItem = function(index) { this._checkPathSynchronizedToList(); this._checkValidIndex(index); return this._list[index]; } - SVGPathSegList.prototype.insertItemBefore = function(newItem, index) { + window.SVGPathSegList.prototype.insertItemBefore = function(newItem, index) { this._checkPathSynchronizedToList(); // Spec: If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list. @@ -447,7 +491,7 @@ return newItem; } - SVGPathSegList.prototype.replaceItem = function(newItem, index) { + window.SVGPathSegList.prototype.replaceItem = function(newItem, index) { this._checkPathSynchronizedToList(); if (newItem._owningPathSegList) { @@ -461,7 +505,7 @@ return newItem; } - SVGPathSegList.prototype.removeItem = function(index) { + window.SVGPathSegList.prototype.removeItem = function(index) { this._checkPathSynchronizedToList(); this._checkValidIndex(index); @@ -471,7 +515,7 @@ return item; } - SVGPathSegList.prototype.appendItem = function(newItem) { + window.SVGPathSegList.prototype.appendItem = function(newItem) { this._checkPathSynchronizedToList(); if (newItem._owningPathSegList) { @@ -485,7 +529,7 @@ return newItem; } - SVGPathSegList._pathSegArrayAsString = function(pathSegArray) { + window.SVGPathSegList._pathSegArrayAsString = function(pathSegArray) { var string = ""; var first = true; pathSegArray.forEach(function(pathSeg) { @@ -500,7 +544,7 @@ } // This closely follows SVGPathParser::parsePath from Source/core/svg/SVGPathParser.cpp. - SVGPathSegList.prototype._parsePath = function(string) { + window.SVGPathSegList.prototype._parsePath = function(string) { if (!string || string.length == 0) return []; @@ -518,7 +562,7 @@ this._string = string; this._currentIndex = 0; this._endIndex = this._string.length; - this._previousCommand = SVGPathSeg.PATHSEG_UNKNOWN; + this._previousCommand = window.SVGPathSeg.PATHSEG_UNKNOWN; this._skipOptionalSpaces(); } @@ -559,58 +603,58 @@ switch (lookahead) { case "Z": case "z": - return SVGPathSeg.PATHSEG_CLOSEPATH; + return window.SVGPathSeg.PATHSEG_CLOSEPATH; case "M": - return SVGPathSeg.PATHSEG_MOVETO_ABS; + return window.SVGPathSeg.PATHSEG_MOVETO_ABS; case "m": - return SVGPathSeg.PATHSEG_MOVETO_REL; + return window.SVGPathSeg.PATHSEG_MOVETO_REL; case "L": - return SVGPathSeg.PATHSEG_LINETO_ABS; + return window.SVGPathSeg.PATHSEG_LINETO_ABS; case "l": - return SVGPathSeg.PATHSEG_LINETO_REL; + return window.SVGPathSeg.PATHSEG_LINETO_REL; case "C": - return SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS; + return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS; case "c": - return SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL; + return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL; case "Q": - return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS; + return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS; case "q": - return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL; + return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL; case "A": - return SVGPathSeg.PATHSEG_ARC_ABS; + return window.SVGPathSeg.PATHSEG_ARC_ABS; case "a": - return SVGPathSeg.PATHSEG_ARC_REL; + return window.SVGPathSeg.PATHSEG_ARC_REL; case "H": - return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS; + return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS; case "h": - return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL; + return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL; case "V": - return SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS; + return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS; case "v": - return SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL; + return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL; case "S": - return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS; + return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS; case "s": - return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL; + return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL; case "T": - return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS; + return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS; case "t": - return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL; + return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL; default: - return SVGPathSeg.PATHSEG_UNKNOWN; + return window.SVGPathSeg.PATHSEG_UNKNOWN; } } Source.prototype._nextCommandHelper = function(lookahead, previousCommand) { // Check for remaining coordinates in the current command. - if ((lookahead == "+" || lookahead == "-" || lookahead == "." || (lookahead >= "0" && lookahead <= "9")) && previousCommand != SVGPathSeg.PATHSEG_CLOSEPATH) { - if (previousCommand == SVGPathSeg.PATHSEG_MOVETO_ABS) - return SVGPathSeg.PATHSEG_LINETO_ABS; - if (previousCommand == SVGPathSeg.PATHSEG_MOVETO_REL) - return SVGPathSeg.PATHSEG_LINETO_REL; + if ((lookahead == "+" || lookahead == "-" || lookahead == "." || (lookahead >= "0" && lookahead <= "9")) && previousCommand != window.SVGPathSeg.PATHSEG_CLOSEPATH) { + if (previousCommand == window.SVGPathSeg.PATHSEG_MOVETO_ABS) + return window.SVGPathSeg.PATHSEG_LINETO_ABS; + if (previousCommand == window.SVGPathSeg.PATHSEG_MOVETO_REL) + return window.SVGPathSeg.PATHSEG_LINETO_REL; return previousCommand; } - return SVGPathSeg.PATHSEG_UNKNOWN; + return window.SVGPathSeg.PATHSEG_UNKNOWN; } Source.prototype.initialCommandIsMoveTo = function() { @@ -619,7 +663,7 @@ return true; var command = this.peekSegmentType(); // Path must start with moveTo. - return command == SVGPathSeg.PATHSEG_MOVETO_ABS || command == SVGPathSeg.PATHSEG_MOVETO_REL; + return command == window.SVGPathSeg.PATHSEG_MOVETO_ABS || command == window.SVGPathSeg.PATHSEG_MOVETO_REL; } // Parse a number from an SVG path. This very closely follows genericParseNumber(...) from Source/core/svg/SVGParserUtilities.cpp. @@ -669,8 +713,11 @@ // There must be a least one digit following the . if (this._currentIndex >= this._endIndex || this._string.charAt(this._currentIndex) < "0" || this._string.charAt(this._currentIndex) > "9") return undefined; - while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= "0" && this._string.charAt(this._currentIndex) <= "9") - decimal += (this._string.charAt(this._currentIndex++) - "0") * (frac *= 0.1); + while (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) >= "0" && this._string.charAt(this._currentIndex) <= "9") { + frac *= 10; + decimal += (this._string.charAt(this._currentIndex) - "0") / frac; + this._currentIndex += 1; + } } // Read the exponent part. @@ -729,12 +776,12 @@ Source.prototype.parseSegment = function() { var lookahead = this._string[this._currentIndex]; var command = this._pathSegTypeFromChar(lookahead); - if (command == SVGPathSeg.PATHSEG_UNKNOWN) { + if (command == window.SVGPathSeg.PATHSEG_UNKNOWN) { // Possibly an implicit command. Not allowed if this is the first command. - if (this._previousCommand == SVGPathSeg.PATHSEG_UNKNOWN) + if (this._previousCommand == window.SVGPathSeg.PATHSEG_UNKNOWN) return null; command = this._nextCommandHelper(lookahead, this._previousCommand); - if (command == SVGPathSeg.PATHSEG_UNKNOWN) + if (command == window.SVGPathSeg.PATHSEG_UNKNOWN) return null; } else { this._currentIndex++; @@ -743,53 +790,53 @@ this._previousCommand = command; switch (command) { - case SVGPathSeg.PATHSEG_MOVETO_REL: - return new SVGPathSegMovetoRel(owningPathSegList, this._parseNumber(), this._parseNumber()); - case SVGPathSeg.PATHSEG_MOVETO_ABS: - return new SVGPathSegMovetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber()); - case SVGPathSeg.PATHSEG_LINETO_REL: - return new SVGPathSegLinetoRel(owningPathSegList, this._parseNumber(), this._parseNumber()); - case SVGPathSeg.PATHSEG_LINETO_ABS: - return new SVGPathSegLinetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber()); - case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL: - return new SVGPathSegLinetoHorizontalRel(owningPathSegList, this._parseNumber()); - case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS: - return new SVGPathSegLinetoHorizontalAbs(owningPathSegList, this._parseNumber()); - case SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL: - return new SVGPathSegLinetoVerticalRel(owningPathSegList, this._parseNumber()); - case SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS: - return new SVGPathSegLinetoVerticalAbs(owningPathSegList, this._parseNumber()); - case SVGPathSeg.PATHSEG_CLOSEPATH: + case window.SVGPathSeg.PATHSEG_MOVETO_REL: + return new window.SVGPathSegMovetoRel(owningPathSegList, this._parseNumber(), this._parseNumber()); + case window.SVGPathSeg.PATHSEG_MOVETO_ABS: + return new window.SVGPathSegMovetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber()); + case window.SVGPathSeg.PATHSEG_LINETO_REL: + return new window.SVGPathSegLinetoRel(owningPathSegList, this._parseNumber(), this._parseNumber()); + case window.SVGPathSeg.PATHSEG_LINETO_ABS: + return new window.SVGPathSegLinetoAbs(owningPathSegList, this._parseNumber(), this._parseNumber()); + case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL: + return new window.SVGPathSegLinetoHorizontalRel(owningPathSegList, this._parseNumber()); + case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS: + return new window.SVGPathSegLinetoHorizontalAbs(owningPathSegList, this._parseNumber()); + case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL: + return new window.SVGPathSegLinetoVerticalRel(owningPathSegList, this._parseNumber()); + case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS: + return new window.SVGPathSegLinetoVerticalAbs(owningPathSegList, this._parseNumber()); + case window.SVGPathSeg.PATHSEG_CLOSEPATH: this._skipOptionalSpaces(); - return new SVGPathSegClosePath(owningPathSegList); - case SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL: + return new window.SVGPathSegClosePath(owningPathSegList); + case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL: var points = {x1: this._parseNumber(), y1: this._parseNumber(), x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()}; - return new SVGPathSegCurvetoCubicRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2); - case SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS: + return new window.SVGPathSegCurvetoCubicRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2); + case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS: var points = {x1: this._parseNumber(), y1: this._parseNumber(), x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()}; - return new SVGPathSegCurvetoCubicAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2); - case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL: + return new window.SVGPathSegCurvetoCubicAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.x2, points.y2); + case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL: var points = {x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()}; - return new SVGPathSegCurvetoCubicSmoothRel(owningPathSegList, points.x, points.y, points.x2, points.y2); - case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: + return new window.SVGPathSegCurvetoCubicSmoothRel(owningPathSegList, points.x, points.y, points.x2, points.y2); + case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: var points = {x2: this._parseNumber(), y2: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()}; - return new SVGPathSegCurvetoCubicSmoothAbs(owningPathSegList, points.x, points.y, points.x2, points.y2); - case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL: + return new window.SVGPathSegCurvetoCubicSmoothAbs(owningPathSegList, points.x, points.y, points.x2, points.y2); + case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL: var points = {x1: this._parseNumber(), y1: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()}; - return new SVGPathSegCurvetoQuadraticRel(owningPathSegList, points.x, points.y, points.x1, points.y1); - case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS: + return new window.SVGPathSegCurvetoQuadraticRel(owningPathSegList, points.x, points.y, points.x1, points.y1); + case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS: var points = {x1: this._parseNumber(), y1: this._parseNumber(), x: this._parseNumber(), y: this._parseNumber()}; - return new SVGPathSegCurvetoQuadraticAbs(owningPathSegList, points.x, points.y, points.x1, points.y1); - case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: - return new SVGPathSegCurvetoQuadraticSmoothRel(owningPathSegList, this._parseNumber(), this._parseNumber()); - case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: - return new SVGPathSegCurvetoQuadraticSmoothAbs(owningPathSegList, this._parseNumber(), this._parseNumber()); - case SVGPathSeg.PATHSEG_ARC_REL: + return new window.SVGPathSegCurvetoQuadraticAbs(owningPathSegList, points.x, points.y, points.x1, points.y1); + case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: + return new window.SVGPathSegCurvetoQuadraticSmoothRel(owningPathSegList, this._parseNumber(), this._parseNumber()); + case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: + return new window.SVGPathSegCurvetoQuadraticSmoothAbs(owningPathSegList, this._parseNumber(), this._parseNumber()); + case window.SVGPathSeg.PATHSEG_ARC_REL: var points = {x1: this._parseNumber(), y1: this._parseNumber(), arcAngle: this._parseNumber(), arcLarge: this._parseArcFlag(), arcSweep: this._parseArcFlag(), x: this._parseNumber(), y: this._parseNumber()}; - return new SVGPathSegArcRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep); - case SVGPathSeg.PATHSEG_ARC_ABS: + return new window.SVGPathSegArcRel(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep); + case window.SVGPathSeg.PATHSEG_ARC_ABS: var points = {x1: this._parseNumber(), y1: this._parseNumber(), arcAngle: this._parseNumber(), arcLarge: this._parseArcFlag(), arcSweep: this._parseArcFlag(), x: this._parseNumber(), y: this._parseNumber()}; - return new SVGPathSegArcAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep); + return new window.SVGPathSegArcAbs(owningPathSegList, points.x, points.y, points.x1, points.y1, points.arcAngle, points.arcLarge, points.arcSweep); default: throw "Unknown path seg type." } @@ -859,475 +906,6 @@ function touchHandler(event) { */ (function(b){b.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta",219:"[",221:"]"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}};function a(d){if(typeof d.data!=="string"){return}var c=d.handler,e=d.data.toLowerCase().split(" ");d.handler=function(n){if(this!==n.target&&(/textarea|select/i.test(n.target.nodeName)||n.target.type==="text")){return}var h=n.type!=="keypress"&&b.hotkeys.specialKeys[n.which],o=String.fromCharCode(n.which).toLowerCase(),k,m="",g={};if(n.altKey&&h!=="alt"){m+="alt+"}if(n.ctrlKey&&h!=="ctrl"){m+="ctrl+"}if(n.metaKey&&!n.ctrlKey&&h!=="meta"){m+="meta+"}if(n.shiftKey&&h!=="shift"){m+="shift+"}if(h){g[m+h]=true}else{g[m+o]=true;g[m+b.hotkeys.shiftNums[o]]=true;if(m==="shift+"){g[b.hotkeys.shiftNums[o]]=true}}for(var j=0,f=e.length;j elements. Each element should contain the markup of an SVG -icon. The element has an ID that should -correspond with the ID of the HTML element used on the page that should contain -or optionally be replaced by the icon. Additionally, one empty element should be -added at the end with id "svg_eof". - -2. Optionally create fallback raster images for each SVG icon. - -3. Include the jQuery and the SVG Icon Loader scripts on your page. - -4. Run $.svgIcons() when the document is ready: - -$.svgIcons( file [string], options [object literal]); - -File is the location of a local SVG or SVGz file. - -All options are optional and can include: - -- 'w (number)': The icon widths - -- 'h (number)': The icon heights - -- 'fallback (object literal)': List of raster images with each - key being the SVG icon ID to replace, and the value the image file name. - -- 'fallback_path (string)': The path to use for all images - listed under "fallback" - -- 'replace (boolean)': If set to true, HTML elements will be replaced by, - rather than include the SVG icon. - -- 'placement (object literal)': List with selectors for keys and SVG icon ids - as values. This provides a custom method of adding icons. - -- 'resize (object literal)': List with selectors for keys and numbers - as values. This allows an easy way to resize specific icons. - -- 'callback (function)': A function to call when all icons have been loaded. - Includes an object literal as its argument with as keys all icon IDs and the - icon as a jQuery object as its value. - -- 'id_match (boolean)': Automatically attempt to match SVG icon ids with - corresponding HTML id (default: true) - -- 'no_img (boolean)': Prevent attempting to convert the icon into an - element (may be faster, help for browser consistency) - -- 'svgz (boolean)': Indicate that the file is an SVGZ file, and thus not to - parse as XML. SVGZ files add compression benefits, but getting data from - them fails in Firefox 2 and older. - -5. To access an icon at a later point without using the callback, use this: - $.getSvgIcon(id (string)); - -This will return the icon (as jQuery object) with a given ID. - -6. To resize icons at a later point without using the callback, use this: - $.resizeSvgIcons(resizeOptions) (use the same way as the "resize" parameter) - - -Example usage #1: - -$(function() { - $.svgIcons('my_icon_set.svg'); // The SVG file that contains all icons - // No options have been set, so all icons will automatically be inserted - // into HTML elements that match the same IDs. -}); - -Example usage #2: - -$(function() { - $.svgIcons('my_icon_set.svg', { // The SVG file that contains all icons - callback: function(icons) { // Custom callback function that sets click - // events for each icon - $.each(icons, function(id, icon) { - icon.click(function() { - alert('You clicked on the icon with id ' + id); - }); - }); - } - }); //The SVG file that contains all icons -}); - -Example usage #3: - -$(function() { - $.svgIcons('my_icon_set.svgz', { // The SVGZ file that contains all icons - w: 32, // All icons will be 32px wide - h: 32, // All icons will be 32px high - fallback_path: 'icons/', // All fallback files can be found here - fallback: { - '#open_icon': 'open.png', // The "open.png" will be appended to the - // HTML element with ID "open_icon" - '#close_icon': 'close.png', - '#save_icon': 'save.png' - }, - placement: {'.open_icon','open'}, // The "open" icon will be added - // to all elements with class "open_icon" - resize: function() { - '#save_icon .svg_icon': 64 // The "save" icon will be resized to 64 x 64px - }, - - callback: function(icons) { // Sets background color for "close" icon - icons['close'].css('background','red'); - }, - - svgz: true // Indicates that an SVGZ file is being used - - }) -}); - -*/ - - -(function($) { - var svg_icons = {}, fixIDs; - - $.svgIcons = function(file, opts) { - var svgns = "http://www.w3.org/2000/svg", - xlinkns = "http://www.w3.org/1999/xlink", - icon_w = opts.w?opts.w : 24, - icon_h = opts.h?opts.h : 24, - elems, svgdoc, testImg, - icons_made = false, data_loaded = false, load_attempts = 0, - ua = navigator.userAgent, isOpera = !!window.opera, isSafari = (ua.indexOf('Safari/') > -1 && ua.indexOf('Chrome/')==-1), - data_pre = 'data:image/svg+xml;charset=utf-8;base64,'; - - if(opts.svgz) { - var data_el = $('').appendTo('body').hide(); - try { - svgdoc = data_el[0].contentDocument; - data_el.load(getIcons); - getIcons(0, true); // Opera will not run "load" event if file is already cached - } catch(err1) { - useFallback(); - } - } else { - var parser = new DOMParser(); - $.ajax({ - url: file, - dataType: 'string', - success: function(data) { - if(!data) { - $(useFallback); - return; - } - svgdoc = parser.parseFromString(data, "text/xml"); - $(function() { - getIcons('ajax'); - }); - }, - error: function(err) { - // TODO: Fix Opera widget icon bug - if(window.opera) { - $(function() { - useFallback(); - }); - } else { - if(err.responseText) { - svgdoc = parser.parseFromString(err.responseText, "text/xml"); - if(!svgdoc.childNodes.length) { - $(useFallback); - } - $(function() { - getIcons('ajax'); - }); - } else { - $(useFallback); - } - } - } - }); - } - - function getIcons(evt, no_wait) { - if(evt !== 'ajax') { - if(data_loaded) return; - // Webkit sometimes says svgdoc is undefined, other times - // it fails to load all nodes. Thus we must make sure the "eof" - // element is loaded. - svgdoc = data_el[0].contentDocument; // Needed again for Webkit - var isReady = (svgdoc && svgdoc.getElementById('svg_eof')); - if(!isReady && !(no_wait && isReady)) { - load_attempts++; - if(load_attempts < 50) { - setTimeout(getIcons, 20); - } else { - useFallback(); - data_loaded = true; - } - return; - } - data_loaded = true; - } - - elems = $(svgdoc.firstChild).children(); //.getElementsByTagName('foreignContent'); - - if(!opts.no_img) { - var testSrc = data_pre + 'PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNzUiIGhlaWdodD0iMjc1Ij48L3N2Zz4%3D'; - - testImg = $(new Image()).attr({ - src: testSrc, - width: 0, - height: 0 - }).appendTo('body') - .on("load", function () { - // Safari 4 crashes, Opera and Chrome don't - makeIcons(true); - }); - } else { - setTimeout(function() { - if(!icons_made) makeIcons(); - },500); - } - } - - var setIcon = function(target, icon, id, setID) { - if(isOpera) icon.css('visibility','hidden'); - if(opts.replace) { - if(setID) icon.attr('id',id); - var cl = target.attr('class'); - if(cl) icon.attr('class','svg_icon '+cl); - target.replaceWith(icon); - } else { - - target.append(icon); - } - if(isOpera) { - setTimeout(function() { - icon.removeAttr('style'); - },1); - } - } - - var addIcon = function(icon, id) { - if(opts.id_match === undefined || opts.id_match !== false) { - setIcon(holder, icon, id, true); - } - svg_icons[id] = icon; - } - - function makeIcons(toImage, fallback) { - if(icons_made) return; - if(opts.no_img) toImage = false; - var holder; - - if(toImage) { - var temp_holder = $(document.createElement('div')); - temp_holder.hide().appendTo('body'); - } - if(fallback) { - var path = opts.fallback_path?opts.fallback_path:''; - $.each(fallback, function(id, imgsrc) { - holder = $('#' + id); - var icon = $(new Image()) - .attr({ - 'class':'svg_icon', - src: path + imgsrc, - 'width': icon_w, - 'height': icon_h, - 'alt': 'icon' - }); - - addIcon(icon, id); - }); - } else { - var len = elems.length; - for(var i = 0; i < len; i++) { - var elem = elems[i]; - var id = elem.id; - if(id === 'svg_eof') break; - holder = $('#' + id); - var svg = elem.getElementsByTagNameNS(svgns, 'svg')[0]; - var svgroot = document.createElementNS(svgns, "svg"); - svgroot.setAttributeNS(svgns, 'viewBox', [0,0,icon_w,icon_h].join(' ')); - // Make flexible by converting width/height to viewBox - var w = svg.getAttribute('width'); - var h = svg.getAttribute('height'); - svg.removeAttribute('width'); - svg.removeAttribute('height'); - - var vb = svg.getAttribute('viewBox'); - if(!vb) { - svg.setAttribute('viewBox', [0,0,w,h].join(' ')); - } - - // Not using jQuery to be a bit faster - svgroot.setAttribute('xmlns', svgns); - svgroot.setAttribute('width', icon_w); - svgroot.setAttribute('height', icon_h); - svgroot.setAttribute("xmlns:xlink", xlinkns); - svgroot.setAttribute("class", 'svg_icon'); - - // Without cloning, Firefox will make another GET request. - // With cloning, causes issue in Opera/Win/Non-EN - if(!isOpera) svg = svg.cloneNode(true); - - svgroot.appendChild(svg); - - if(toImage) { - // Without cloning, Safari will crash - // With cloning, causes issue in Opera/Win/Non-EN - var svgcontent = isOpera?svgroot:svgroot.cloneNode(true); - temp_holder.empty().append(svgroot); - var str = data_pre + encode64(temp_holder.html()); - var icon = $(new Image()) - .attr({'class':'svg_icon', src:str}); - } else { - var icon = fixIDs($(svgroot), i); - } - addIcon(icon, id); - } - - } - - if(opts.placement) { - $.each(opts.placement, function(sel, id) { - if(!svg_icons[id]) return; - $(sel).each(function(i) { - var copy = svg_icons[id].clone(); - if(i > 0 && !toImage) copy = fixIDs(copy, i, true); - setIcon($(this), copy, id); - }) - }); - } - if(!fallback) { - if(toImage) temp_holder.remove(); - if(data_el) data_el.remove(); - if(testImg) testImg.remove(); - } - if(opts.resize) $.resizeSvgIcons(opts.resize); - icons_made = true; - - if(opts.callback) opts.callback(svg_icons); - } - - fixIDs = function(svg_el, svg_num, force) { - var defs = svg_el.find('defs'); - if(!defs.length) return svg_el; - - if(isOpera) { - var id_elems = defs.find('*').filter(function() { - return !!this.id; - }); - } else { - var id_elems = defs.find('[id]'); - } - - var all_elems = svg_el[0].getElementsByTagName('*'), len = all_elems.length; - - id_elems.each(function(i) { - var id = this.id; - var no_dupes = ($(svgdoc).find('#' + id).length <= 1); - if(isOpera) no_dupes = false; // Opera didn't clone svg_el, so not reliable - // if(!force && no_dupes) return; - var new_id = 'x' + id + svg_num + i; - this.id = new_id; - - var old_val = 'url(#' + id + ')'; - var new_val = 'url(#' + new_id + ')'; - - for(var i = 0; i < len; i++) { - var elem = all_elems[i]; - if(elem.getAttribute('fill') === old_val) { - elem.setAttribute('fill', new_val); - } - if(elem.getAttribute('stroke') === old_val) { - elem.setAttribute('stroke', new_val); - } - if(elem.getAttribute('filter') === old_val) { - elem.setAttribute('filter', new_val); - } - } - }); - return svg_el; - } - - function useFallback() { - if(file.indexOf('.svgz') != -1) { - var reg_file = file.replace('.svgz','.svg'); - if(window.console) { - console.log('.svgz failed, trying with .svg'); - } - $.svgIcons(reg_file, opts); - } else if(opts.fallback) { - makeIcons(false, opts.fallback); - } - } - - function encode64(input) { - // base64 strings are 4/3 larger than the original string - if(window.btoa) return window.btoa(input); - var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; - var output = new Array( Math.floor( (input.length + 2) / 3 ) * 4 ); - var chr1, chr2, chr3; - var enc1, enc2, enc3, enc4; - var i = 0, p = 0; - - do { - chr1 = input.charCodeAt(i++); - chr2 = input.charCodeAt(i++); - chr3 = input.charCodeAt(i++); - - enc1 = chr1 >> 2; - enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); - enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); - enc4 = chr3 & 63; - - if (isNaN(chr2)) { - enc3 = enc4 = 64; - } else if (isNaN(chr3)) { - enc4 = 64; - } - - output[p++] = _keyStr.charAt(enc1); - output[p++] = _keyStr.charAt(enc2); - output[p++] = _keyStr.charAt(enc3); - output[p++] = _keyStr.charAt(enc4); - } while (i < input.length); - - return output.join(''); - } - } - - $.getSvgIcon = function(id, uniqueClone) { - var icon = svg_icons[id]; - if(uniqueClone && icon) { - icon = fixIDs(icon, 0, true).clone(true); - } - return icon; - } - - $.resizeSvgIcons = function(obj) { - // FF2 and older don't detect .svg_icon, so we change it detect svg elems instead - var change_sel = !$('.svg_icon:first').length; - $.each(obj, function(sel, size) { - var arr = $.isArray(size); - var w = arr?size[0]:size, - h = arr?size[1]:size; - if(change_sel) { - sel = sel.replace(/\.svg_icon/g,'svg'); - } - $(sel).each(function() { - this.setAttribute('width', w); - this.setAttribute('height', h); - if(window.opera && window.widget) { - this.parentNode.style.width = w + 'px'; - this.parentNode.style.height = h + 'px'; - } - }); - }); - } - -})(jQuery); /* * jGraduate 0.4 * @@ -2751,20 +2329,9 @@ if(jQuery)( function() { * jquery.ui.core.js * jquery.ui.mouse.js * jquery.ui.widget.js - */(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!!this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy();return this}},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return!1;this.handle=this._getHandle(b);if(!this.handle)return!1;c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")});return!0},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment();if(this._trigger("start",b)===!1){this._clear();return!1}this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1){this._mouseUp({});return!1}this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){d._trigger("stop",b)!==!1&&d._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;a(this.options.handle,this.element).find("*").addBack().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute");return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.lefth[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.toph[3]?j-this.offset.click.toph[2]?k-this.offset.click.left=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;ic&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i);if(j===!1)return!1;this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0;return!0},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);this._slide(a,this._handleIndex,c);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1;return!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e;return this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());return this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c1)this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);else{if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;Math.abs(c)*2>=b&&(d+=c>0?b:-b);return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.17"})})(jQuery); + */ + (function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!!this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy();return this}},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return!1;this.handle=this._getHandle(b);if(!this.handle)return!1;c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")});return!0},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment();if(this._trigger("start",b)===!1){this._clear();return!1}this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1){this._mouseUp({});return!1}this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){d._trigger("stop",b)!==!1&&d._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;a(this.options.handle,this.element).find("*").addBack().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute");return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.lefth[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.toph[3]?j-this.offset.click.toph[2]?k-this.offset.click.left=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f= limit) { + var num = parseInt(ruler_len / limit) + 1; + ctx_arr = Array(num); + ctx_arr[0] = ctx; + for(var i = 1; i < num; i++) { + hcanv[lentype] = limit; + var copy = hcanv.cloneNode(true); + hcanv.parentNode.appendChild(copy); + ctx_arr[i] = copy.getContext('2d'); + } + + copy[lentype] = ruler_len % limit; + + // set copy width to last + ruler_len = limit; + } + + hcanv[lentype] = ruler_len * scale; + + var u_multi = unit * zoom; + + // Calculate the main number interval + var raw_m = 50 / u_multi; + var multi = 1; + for(var i = 0; i < r_intervals.length; i++) { + var num = r_intervals[i]; + multi = num; + if(raw_m <= num) { + break; + } + } + + var big_int = multi * u_multi; + ctx.font = "normal 9px 'Verdana', sans-serif"; + ctx.fillStyle = "#777"; + ctx.scale(scale,scale); + + var ruler_d = ((content_d / u_multi) % multi) * u_multi; + var label_pos = ruler_d - big_int; + for (; ruler_d < total_len; ruler_d += big_int) { + label_pos += big_int; + var real_d = ruler_d - content_d; + + var cur_d = Math.round(ruler_d) + .5; + if(is_x) { + ctx.moveTo(cur_d, 15); + ctx.lineTo(cur_d, 0); + } else { + ctx.moveTo(15, cur_d); + ctx.lineTo(0, cur_d); + } + + var num = (label_pos - content_d) / u_multi; + var label; + if(multi >= 1) { + label = Math.round(num); + } else { + var decs = (multi+'').split('.')[1].length; + label = num.toFixed(decs)-0; + } + + // Change 1000s to Ks + if(label !== 0 && label !== 1000 && label % 1000 === 0) { + label = (label / 1000) + 'K'; + } + + if(is_x) { + ctx.fillText(label, ruler_d+2, 8); + ctx.fillStyle = "#777"; + } else { + var str = (label+'').split(''); + for(var i = 0; i < str.length; i++) { + ctx.fillText(str[i], 1, (ruler_d+9) + i*9); + ctx.fillStyle = "#777"; + } + } + + var part = big_int / 10; + for(var i = 1; i < 10; i++) { + var sub_d = Math.round(ruler_d + part * i) + .5; + if(ctx_arr && sub_d > ruler_len) { + ctx_num++; + ctx.stroke(); + if(ctx_num >= ctx_arr.length) { + i = 10; + ruler_d = total_len; + continue; + } + ctx = ctx_arr[ctx_num]; + ruler_d -= limit; + sub_d = Math.round(ruler_d + part * i) + .5; + } + + var line_num = (i % 2)?12:10; + if(is_x) { + ctx.moveTo(sub_d, 15); + ctx.lineTo(sub_d, line_num); + } else { + ctx.moveTo(15, sub_d); + ctx.lineTo(line_num ,sub_d); + } + } + } + ctx.strokeStyle = "#666"; + ctx.stroke(); + } +} +window.methodDraw = function() { var svgCanvas; var Editor = {}; var is_ready = false; @@ -16472,7 +16187,6 @@ if(!window.methodDraw) window.methodDraw = function($) { no_save_warning: true, initFont: 'Helvetica, Arial, sans-serif' }; - var curPrefs = {}; //$.extend({}, defaultPrefs); var customHandlers = {}; Editor.curConfig = curConfig; Editor.tool_scale = 1; @@ -16484,217 +16198,16 @@ if(!window.methodDraw) window.methodDraw = function($) { } } - // Extension mechanisms must call setCustomHandlers with two functions: opts.open and opts.save - // opts.open's responsibilities are: - // - invoke a file chooser dialog in 'open' mode - // - let user pick a SVG file - // - calls setCanvas.setSvgString() with the string contents of that file - // opts.save's responsibilities are: - // - accept the string contents of the current document - // - invoke a file chooser dialog in 'save' mode - // - save the file to location chosen by the user - Editor.setCustomHandlers = function(opts) { - Editor.ready(function() { - if(opts.open) { - $('#tool_open > input[type="file"]').remove(); - $('#tool_open').show(); - svgCanvas.open = opts.open; - } - if(opts.save) { - Editor.show_save_warning = false; - svgCanvas.bind("saved", opts.save); - } - if(opts.pngsave) { - svgCanvas.bind("exported", opts.pngsave); - } - customHandlers = opts; - }); - } - - Editor.randomizeIds = function() { - svgCanvas.randomizeIds(arguments) - } - Editor.init = function() { - // For external openers - (function() { - // let the opener know SVG Edit is ready - var w = window.opener; - if (w) { - try { - var methodDrawReadyEvent = w.document.createEvent("Event"); - methodDrawReadyEvent.initEvent("methodDrawReady", true, true); - w.document.documentElement.dispatchEvent(methodDrawReadyEvent); - } - catch(e) {} - } - })(); - $("body").toggleClass("touch", svgedit.browser.isTouch()); $("#canvas_width").val(curConfig.dimensions[0]); $("#canvas_height").val(curConfig.dimensions[1]); - - var extFunc = function() { - $.each(curConfig.extensions, function() { - var extname = this; - $.getScript(curConfig.extPath + extname, function(d) { - // Fails locally in Chrome 5 - if(!d) { - var s = document.createElement('script'); - s.src = curConfig.extPath + extname; - document.querySelector('head').appendChild(s); - } - }); - }); - } - - // Load extensions - // Bit of a hack to run extensions in local Opera/IE9 - if(document.location.protocol === 'file:') { - setTimeout(extFunc, 100); - } else { - extFunc(); - } - $.svgIcons(curConfig.imgPath + 'svg_edit_icons.svg', { - w:27, h:27, - id_match: false, - no_img: true, // Opera & Firefox 4 gives odd behavior w/images - fallback_path: curConfig.imgPath, - fallback:{ - 'logo':'logo.png', - 'select':'select.png', - 'select_node':'select_node.png', - 'pencil':'pencil.png', - 'pen':'line.png', - 'rect':'square.png', - 'ellipse':'ellipse.png', - 'path':'path.png', - 'text':'text.png', - 'image':'image.png', - 'zoom':'zoom.png', - 'delete':'delete.png', - 'spapelib':'shapelib.png', - 'node_delete':'node_delete.png', - 'align_left':'align-left.png', - 'align_center':'align-center.png', - 'align_right':'align-right.png', - 'align_top':'align-top.png', - 'align_middle':'align-middle.png', - 'align_bottom':'align-bottom.png', - 'arrow_right':'flyouth.png', - 'arrow_down':'dropdown.gif' - }, - placement: { - '#logo':'logo', - '#tool_select':'select', - '#tool_fhpath':'pencil', - '#tool_line':'pen', - '#tool_rect,#tools_rect_show':'rect', - '#tool_ellipse,#tools_ellipse_show':'ellipse', - '#tool_path':'path', - '#tool_text,#layer_rename':'text', - '#tool_image':'image', - '#tool_zoom':'zoom', - '#tool_node_clone':'node_clone', - '#tool_node_delete':'node_delete', - '#tool_add_subpath':'add_subpath', - '#tool_openclose_path':'open_path', - '#tool_alignleft, #tool_posleft':'align_left', - '#tool_aligncenter, #tool_poscenter':'align_center', - '#tool_alignright, #tool_posright':'align_right', - '#tool_aligntop, #tool_postop':'align_top', - '#tool_alignmiddle, #tool_posmiddle':'align_middle', - '#tool_alignbottom, #tool_posbottom':'align_bottom', - '#cur_position':'align', - '#zoomLabel':'zoom' - }, - resize: { - '#logo .svg_icon': 15, - '.flyout_arrow_horiz .svg_icon': 5, - '#fill_bg .svg_icon, #stroke_bg .svg_icon': svgedit.browser.isTouch() ? 24 : 24, - '.palette_item:first .svg_icon': svgedit.browser.isTouch() ? 30 : 16, - '#zoomLabel .svg_icon': 16, - '#zoom_dropdown .svg_icon': 7 - }, - callback: function(icons) { - $('.toolbar_button button > svg, .toolbar_button button > img').each(function() { - $(this).parent().prepend(this); - }); - $('.tool_button, .tool_button_current').addClass("loaded") - var tleft = $('#tools_left'); - if (tleft.length != 0) { - var min_height = tleft.offset().top + tleft.outerHeight(); - } - - // Look for any missing flyout icons from plugins - $('.tools_flyout').each(function() { - var shower = $('#' + this.id + '_show'); - var sel = shower.attr('data-curopt'); - // Check if there's an icon here - if(!shower.children('svg, img').length) { - var clone = $(sel).children().clone(); - if(clone.length) { - clone[0].removeAttribute('style'); //Needed for Opera - shower.append(clone); - } - } - }); - methodDraw.runCallbacks(); - - setTimeout(function() { - $('.flyout_arrow_horiz:empty').each(function() { - $(this).append($.getSvgIcon('arrow_right').width(5).height(5)); - }); - }, 1); - } - }); - - $('#rulers').on("dblclick", function(e){ - $("#base_unit_container").css({ - top: e.pageY-10, - left: e.pageX-50, - display: 'block' - }) - }) - $("#base_unit_container") - .on("mouseleave mouseenter", function(e){ - t = setTimeout(function(){$("#base_unit_container").fadeOut(500)}, 200) - if(event.type == "mouseover") clearTimeout(t) - }) - $("#base_unit") - .on("change", function(e) { - savePreferences(); - }); + Editor.canvas = svgCanvas = new $.SvgCanvas(document.getElementById("svgcanvas"), curConfig); - Editor.show_save_warning = false; Editor.paintBox = {fill: null, stroke:null, canvas:null}; - var palette = ["#444444", "#482816", "#422C10", "#3B2F0E", "#32320F", - "#293414", "#1F361B", "#153723", "#0C372C", - "#083734", "#0E353B", "#1A333F", "#273141", - "#332D40", "#3E2A3C", "#462735", "#4B252D", - "#4D2425", "#4C261D", "#666666", "#845335", "#7B572D", - "#6F5C2A", "#62612C", "#546433", "#46673D", - "#396849", "#306856", "#2D6862", "#33666C", - "#426373", "#535F75", "#645A73", "#74556D", - "#805064", "#884D58", "#8B4D4B", "#894F3F", - "#999999", "#C48157", "#B8874D", "#A98E49", "#97944B", - "#849854", "#729C62", "#619E73", "#559E84", - "#529D94", "#5B9BA2", "#6D97AB", "#8391AE", - "#9A8AAB", "#AF84A3", "#BF7E96", "#C97A86", - "#CE7975", "#CC7C65", "#BBBBBB", "#FFB27C", "#FABA6F", - "#E6C36A", "#CFCA6D", "#B8D078", "#A0D58A", - "#8CD79F", "#7DD8B5", "#7AD6CA", "#84D3DB", - "#9ACEE6", "#B6C7EA", "#D3BEE7", "#EDB6DC", - "#FFAFCC", "#FFAAB8", "#FFA9A2", "#FFAC8D", - "#DDDDDD", "#FFE7A2", "#FFF093", "#FFFA8D", "#FFFF91", - "#EEFF9F", "#D1FFB4", "#B9FFCE", "#A8FFE9", - "#A4FFFF", "#B1FFFF", "#CBFFFF", "#EDFFFF", - "#FFF5FF", "#FFEBFF", "#FFE2FF", "#FFDCEC", - "#FFDBD2", "#FFDFB8" - ], - isMac = (navigator.platform.indexOf("Mac") >= 0), + var isMac = (navigator.platform.indexOf("Mac") >= 0), isWebkit = (navigator.userAgent.indexOf("AppleWebKit") >= 0), modKey = (isMac ? "meta+" : "ctrl+"), // โŒ˜ path = svgCanvas.pathActions, @@ -16708,7 +16221,6 @@ if(!window.methodDraw) window.methodDraw = function($) { ui_context = 'toolbars', orig_source = ''; - // This puts the correct shortcuts in the menus if (!isMac) { $('.shortcut').each(function(){ @@ -16716,83 +16228,23 @@ if(!window.methodDraw) window.methodDraw = function($) { $(this).text(text.split("โŒ˜").join("Ctrl+")) }); } - - // This sets up alternative dialog boxes. They mostly work the same way as - // their UI counterparts, expect instead of returning the result, a callback - // needs to be included that returns the result as its first parameter. - // In the future we may want to add additional types of dialog boxes, since - // they should be easy to handle this way. - (function() { - $('#dialog_container').draggable({cancel:'#dialog_content, #dialog_buttons *', containment: 'window'}); - var box = $('#dialog_box'), btn_holder = $('#dialog_buttons'); - - var dbox = function(type, msg, callback, defText) { - $('#dialog_content').html('

'+msg.replace(/\n/g,'

')+'

') - .toggleClass('prompt',(type=='prompt')); - btn_holder.empty(); - - var ok = $('').appendTo(btn_holder); - - if(type != 'alert') { - $('') - .appendTo(btn_holder) - .on("click touchstart", function() { box.hide();callback(false)}); - } - - if(type == 'prompt') { - var input = $('').prependTo(btn_holder); - input.val(defText || ''); - input.bind('keydown', 'return', function() {ok.trigger("click touchstart");}); - } - - if(type == 'process') { - ok.hide(); - } - - box.show(); - - ok.on("click touchstart", function() { - box.hide(); - var resp = (type == 'prompt')?input.val():true; - if(callback) callback(resp); - }).focus(); - - if(type == 'prompt') input.focus(); - } - - $.alert = function(msg, cb) { dbox('alert', msg, cb);}; - $.confirm = function(msg, cb) { dbox('confirm', msg, cb);}; - $.process_cancel = function(msg, cb) { dbox('process', msg, cb);}; - $.prompt = function(msg, txt, cb) { dbox('prompt', msg, cb, txt);}; - }()); var setSelectMode = function() { - var curr = $('.tool_button_current'); + var curr = $('.tool_button.current'); if(curr.length && curr[0].id !== 'tool_select') { - curr.removeClass('tool_button_current').addClass('tool_button'); - $('#tool_select').addClass('tool_button_current').removeClass('tool_button'); + curr.removeClass('current').addClass('tool_button'); + $('#tool_select').addClass('current'); } svgCanvas.setMode('select'); }; - var setEyedropperMode = function() { - var curr = $('.tool_button_current'); - if(curr.length && curr[0].id !== 'tool_eyedropper') { - curr.removeClass('tool_button_current').addClass('tool_button'); - $('#tool_eyedropper').addClass('tool_button_current').removeClass('tool_button'); - } - svgCanvas.setMode('eyedropper'); - } - var togglePathEditMode = function(editmode, elems) { - $('#tools_bottom_2,#tools_bottom_3').toggle(!editmode); if(editmode) { // Change select icon $('.context_panel').hide(); $('#path_node_panel').show(); - $('.tool_button_current').removeClass('tool_button_current').addClass('tool_button'); - $('#tool_select').addClass('tool_button_current').removeClass('tool_button'); - setIcon('#tool_select', 'select_node'); + $('.tool_button.current').removeClass('.current'); + $('#tool_select').addClass('.current'); multiselected = false; } else { if (elems[0]) { @@ -16800,8 +16252,7 @@ if(!window.methodDraw) window.methodDraw = function($) { selector.reset(elems[0]); selector.selectorRect.setAttribute('display', 'inline'); } - - setIcon('#tool_select', 'select'); + } } @@ -16904,11 +16355,6 @@ if(!window.methodDraw) window.methodDraw = function($) { rotateCursor(ang); $('#tool_reorient').toggleClass('disabled', ang == 0); break; - - // TODO: Update values that change on move/resize, etc -// case "select": -// case "resize": -// break; } } svgCanvas.runExtensions("elementTransition", { @@ -16938,9 +16384,7 @@ if(!window.methodDraw) window.methodDraw = function($) { selectedElement = elem; } } - - Editor.show_save_warning = true; - + // we update the contextual panel with potentially new // positional/sizing information (we DON'T want to update the // toolbar here as that creates an infinite loop) @@ -17044,512 +16488,17 @@ if(!window.methodDraw) window.methodDraw = function($) { $('#cur_context_panel').toggle(!!context).html(link_str); } + + var extAdded = function(window, ext) { + if(ext.callback) ext.callback(); + } // Makes sure the current selected paint is available to work with var prepPaints = function() { Editor.paintBox.fill.prep(); Editor.paintBox.stroke.prep(); } - - var flyout_funcs = {}; - - var setupFlyouts = function(holders) { - $.each(holders, function(hold_sel, btn_opts) { - var buttons = $(hold_sel).children(); - var show_sel = hold_sel + '_show'; - var shower = $(show_sel); - var def = false; - buttons.addClass('tool_button') - .unbind('click mousedown mouseup') // may not be necessary - .each(function(i) { - // Get this buttons options - var opts = btn_opts[i]; - - // Remember the function that goes with this ID - flyout_funcs[opts.sel] = opts.fn; - if(opts.isDefault) def = i; - - // Clicking the icon in flyout should set this set's icon - var func = function(event) { - var options = opts; - //find the currently selected tool if comes from keystroke - if (event.type === "keydown") { - var flyoutIsSelected = $(options.parent + "_show").hasClass('tool_button_current'); - var currentOperation = $(options.parent + "_show").attr("data-curopt"); - $.each(holders[opts.parent], function(i, tool){ - if (tool.sel == currentOperation) { - if(!event.shiftKey || !flyoutIsSelected) { - options = tool; - } - else { - options = holders[opts.parent][i+1] || holders[opts.parent][0]; - } - } - }); - } - if($(this).hasClass('disabled')) return false; - if (toolButtonClick(show_sel)) { - options.fn(); - } - if(options.icon) { - var icon = $.getSvgIcon(options.icon, true); - } else { - var icon = $(options.sel).children().eq(0).clone(); - } - - icon[0].setAttribute('width',shower.width()); - icon[0].setAttribute('height',shower.height()); - shower.children(':not(.flyout_arrow_horiz)').remove(); - shower.append(icon).attr('data-curopt', options.sel); // This sets the current mode - } - - $(this).mouseup(func); - - if(opts.key) { - $(document).bind('keydown', opts.key[0] + " shift+" + opts.key[0], func); - } - }); - - if(def) { - shower.attr('data-curopt', btn_opts[def].sel); - } else if(!shower.attr('data-curopt')) { - // Set first as default - shower.attr('data-curopt', btn_opts[0].sel); - } - - var timer; - - var pos = $(show_sel).position(); - $(hold_sel).css({'left': pos.left+34, 'top': pos.top+77}); - - // Clicking the "show" icon should set the current mode - shower.mousedown(function(evt) { - $('#workarea').one("mousedown", function(){$('#tools_shapelib').hide()}) - if ($('#tools_shapelib').is(":visible")) toolButtonClick(show_sel, false); - if(shower.hasClass('disabled')) return false; - var holder = $(hold_sel); - var l = pos.left+34; - var w = holder.width()*-1; - var time = holder.data('shown_popop')?200:0; - timer = setTimeout(function() { - // Show corresponding menu - if(!shower.data('isLibrary')) { - holder.css('left', w).show().animate({ - left: l - },50); - } else { - holder.css('left', l).show(); - } - holder.data('shown_popop',true); - },time); - evt.preventDefault(); - }).mouseup(function(evt) { - clearTimeout(timer); - var opt = $(this).attr('data-curopt'); - // Is library and popped up, so do nothing - if(shower.data('isLibrary') && $(show_sel.replace('_show','')).is(':visible')) { - toolButtonClick(show_sel, true); - return; - } - if (toolButtonClick(show_sel) && (opt in flyout_funcs)) { - flyout_funcs[opt](); - } - }); - - // $('#tools_rect').mouseleave(function(){$('#tools_rect').fadeOut();}); - }); - - setFlyoutTitles(); - } - - var makeFlyoutHolder = function(id, child) { - var div = $('
',{ - 'class': 'tools_flyout', - id: id - }).appendTo('#svg_editor').append(child); - - return div; - } - - var setFlyoutPositions = function() { - $('.tools_flyout').each(function() { - var shower = $('#' + this.id + '_show'); - var pos = shower.offset(); - var w = shower.outerWidth(); - $(this).css({left: (pos.left + w)*tool_scale, top: pos.top}); - }); - } - - var setFlyoutTitles = function() { - $('.tools_flyout').each(function() { - var shower = $('#' + this.id + '_show'); - if(shower.data('isLibrary')) return; - - var tooltips = []; - $(this).children().each(function() { - tooltips.push(this.title); - }); - shower[0].title = tooltips.join(' / '); - }); - } - - var resize_timer; - - var extAdded = function(window, ext) { - - var cb_called = false; - var resize_done = false; - var cb_ready = true; // Set to false to delay callback (e.g. wait for $.svgIcons) - - function prepResize() { - if(resize_timer) { - clearTimeout(resize_timer); - resize_timer = null; - } - if(!resize_done) { - resize_timer = setTimeout(function() { - resize_done = true; - setIconSize(curPrefs.iconsize); - }, 50); - } - } - - - var runCallback = function() { - if(ext.callback && !cb_called && cb_ready) { - cb_called = true; - ext.callback(); - } - } - - var btn_selects = []; - - if(ext.context_tools) { - $.each(ext.context_tools, function(i, tool) { - // Add select tool - var cont_id = tool.container_id?(' id="' + tool.container_id + '"'):""; - - var panel = $('#' + tool.panel); - - // create the panel if it doesn't exist - if(!panel.length) - panel = $('
', {id: tool.panel}).appendTo("#tools_top").hide(); - - // TODO: Allow support for other types, or adding to existing tool - switch (tool.type) { - case 'tool_button': - var html = '
' + tool.id + '
'; - var div = $(html).appendTo(panel); - if (tool.events) { - $.each(tool.events, function(evt, func) { - $(div).bind(evt, func); - }); - } - break; - case 'select': - var html = '' - + '"; - // Creates the tool, hides & adds it, returns the select element - var sel = $(html).appendTo(panel).find('select'); - - $.each(tool.events, function(evt, func) { - $(sel).bind(evt, func); - }); - break; - case 'button-select': - var html = ''; - - var list = $('
    ').appendTo('#option_lists'); - if(tool.colnum) { - list.addClass('optcols' + tool.colnum); - } - - // Creates the tool, hides & adds it, returns the select element - var dropdown = $(html).appendTo(panel).children(); - - btn_selects.push({ - elem: ('#' + tool.id), - list: ('#' + tool.id + '_opts'), - title: tool.title, - callback: tool.events.change, - cur: ('#cur_' + tool.id) - }); - - break; - case 'input': - var html = '' - + '' - + tool.label + ':' - + '' - - // Creates the tool, hides & adds it, returns the select element - - // Add to given tool.panel - var inp = $(html).appendTo(panel).find('input'); - - if(tool.spindata) { - inp.SpinButton(tool.spindata); - } - - if(tool.events) { - $.each(tool.events, function(evt, func) { - inp.bind(evt, func); - }); - } - break; - - default: - break; - } - }); - } - - if(ext.buttons) { - var fallback_obj = {}, - placement_obj = {}, - svgicons = ext.svgicons; - var holders = {}; - - - // Add buttons given by extension - $.each(ext.buttons, function(i, btn) { - var icon; - var id = btn.id; - var num = i; - // Give button a unique ID - while($('#'+id).length) { - id = btn.id + '_' + (++num); - } - if(!svgicons) { - icon = (btn.type == "menu") ? "" : $(''); - } else { - fallback_obj[id] = btn.icon; - var svgicon = btn.svgicon ? btn.svgicon : btn.id; - if(btn.type == 'app_menu') { - placement_obj['#' + id + ' > div'] = svgicon; - } else { - placement_obj['#' + id] = svgicon; - } - } - - var cls, parent; - - - - // Set button up according to its type - switch ( btn.type ) { - case 'mode_flyout': - case 'mode': - cls = 'tool_button'; - if(btn.cls) { - cls += " " + btn.cls; - } - parent = "#tools_left"; - break; - case 'context': - cls = 'tool_button'; - parent = "#" + btn.panel; - // create the panel if it doesn't exist - if(!$(parent).length) - $('
    ', {id: btn.panel}).appendTo("#tools_top"); - break; - case 'menu': - cls = 'menu_item tool_button'; - parent = "#" + (btn.after || btn.panel); - break; - case 'app_menu': - cls = ''; - parent = btn.parent || '#main_menu ul'; - // create the panel if it doesn't exist - if(!$(parent).length) - $('
    ', {id: btn.panel}).appendTo("#tools_top"); - break; - } - - var button = $((btn.list || btn.type == 'app_menu')?'
  • ':'
    ') - .attr("id", id) - .attr("title", btn.title) - .addClass(cls); - if(!btn.includeWith && !btn.list) { - if("position" in btn) { - $(parent).children().eq(btn.position).before(button); - } else { - if (btn.type != "menu" || !btn.after) button.appendTo(parent); - else $(parent).after(button); - } - - if(btn.type =='mode_flyout') { - // Add to flyout menu / make flyout menu -// var opts = btn.includeWith; -// // opts.button, default, position - var ref_btn = $(button); - - var flyout_holder = ref_btn.parent(); - // Create a flyout menu if there isn't one already - if(!ref_btn.parent().hasClass('tools_flyout')) { - // Create flyout placeholder - var tls_id = ref_btn[0].id.replace('tool_','tools_') - var show_btn = ref_btn.clone() - .attr('id',tls_id + '_show') - .append($('
    ',{'class':'flyout_arrow_horiz'})); - - ref_btn.before(show_btn); - - // Create a flyout div - flyout_holder = makeFlyoutHolder(tls_id, ref_btn); - flyout_holder.data('isLibrary', true); - show_btn.data('isLibrary', true); - } - - - -// var ref_data = Actions.getButtonData(opts.button); - - placement_obj['#' + tls_id + '_show'] = btn.id; - // TODO: Find way to set the current icon using the iconloader if this is not default - - // Include data for extension button as well as ref button - var cur_h = holders['#'+flyout_holder[0].id] = [{ - sel: '#'+id, - fn: btn.events.click, - icon: btn.id, - //key: btn.key, - isDefault: true - }, ref_data]; - - } else if(btn.type == 'app_menu' || btn.type == 'menu') { - button.append(btn.title); - } - - } else if(btn.list) { - // Add button to list - button.addClass('push_button'); - $('#' + btn.list + '_opts').append(button); - if(btn.isDefault) { - $('#cur_' + btn.list).append(button.children().clone()); - var svgicon = btn.svgicon?btn.svgicon:btn.id; - placement_obj['#cur_' + btn.list] = svgicon; - } - } else if(btn.includeWith) { - // Add to flyout menu / make flyout menu - var opts = btn.includeWith; - // opts.button, default, position - var ref_btn = $(opts.button); - - var flyout_holder = ref_btn.parent(); - // Create a flyout menu if there isn't one already - if(!ref_btn.parent().hasClass('tools_flyout')) { - // Create flyout placeholder - var tls_id = ref_btn[0].id.replace('tool_','tools_') - var show_btn = ref_btn.clone() - .attr('id',tls_id + '_show') - .append($('
    ',{'class':'flyout_arrow_horiz'})); - - ref_btn.before(show_btn); - - // Create a flyout div - flyout_holder = makeFlyoutHolder(tls_id, ref_btn); - } - - var ref_data = Actions.getButtonData(opts.button); - - if(opts.isDefault) { - placement_obj['#' + tls_id + '_show'] = btn.id; - } - // TODO: Find way to set the current icon using the iconloader if this is not default - - // Include data for extension button as well as ref button - var cur_h = holders['#'+flyout_holder[0].id] = [{ - sel: '#'+id, - fn: btn.events.click, - icon: btn.id, - key: btn.key, - isDefault: btn.includeWith?btn.includeWith.isDefault:0 - }, ref_data]; - - // {sel:'#tool_rect', fn: clickRect, evt: 'mouseup', key: 4, parent: '#tools_rect', icon: 'rect'} - - var pos = ("position" in opts)?opts.position:'last'; - var len = flyout_holder.children().length; - - // Add at given position or end - if(!isNaN(pos) && pos >= 0 && pos < len) { - flyout_holder.children().eq(pos).before(button); - } else { - flyout_holder.append(button); - cur_h.reverse(); - } - } - - if(!svgicons) { - button.append(icon); - } - - if(!btn.list) { - // Add given events to button - $.each(btn.events, function(name, func) { - if(name == "click") { - if(btn.type == 'mode') { - if(btn.includeWith) { - button.bind(name, func); - } else { - button.bind(name, function() { - if(toolButtonClick(button)) { - func(); - } - }); - } - if(btn.key) { - $(document).bind('keydown', btn.key, func); - if(btn.title) button.attr("title", btn.title + ' ['+btn.key+']'); - } - } else { - button.bind(name, func); - } - } else { - button.bind(name, func); - } - }); - } - setupFlyouts(holders); - }); - - $.each(btn_selects, function() { - addAltDropDown(this.elem, this.list, this.callback, {seticon: true}); - }); - - if (svgicons) - cb_ready = false; // Delay callback - - $.svgIcons(svgicons, { - w:27, h:27, - id_match: false, - no_img: (!isWebkit), - fallback: fallback_obj, - placement: placement_obj, - callback: function(icons) { - // Non-ideal hack to make the icon match the current size - if(curPrefs.iconsize && curPrefs.iconsize != 'm') { - prepResize(); - } - cb_ready = true; // Ready for callback - runCallback(); - } - - }); - } - - runCallback(); - }; - var getPaint = function(color, opac, type) { // update the editor's fill paint var opts = null; @@ -17700,10 +16649,7 @@ if(!window.methodDraw) window.methodDraw = function($) { var point = path.getNodePoint(); $('#tool_add_subpath').removeClass('push_button_pressed').addClass('tool_button'); $('#tool_node_delete').toggleClass('disabled', !path.canDeleteNodes); - - // Show open/close button based on selected point - setIcon('#tool_openclose_path', path.closed_subpath ? 'open_path' : 'close_path'); - + if(point) { var seg_type = $('#seg_type'); if(unit) { @@ -17925,7 +16871,7 @@ if(!window.methodDraw) window.methodDraw = function($) { $('#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); svgCanvas.bind("transition", elementTransition); @@ -17935,14 +16881,6 @@ if(!window.methodDraw) window.methodDraw = function($) { svgCanvas.bind("contextset", contextChanged); svgCanvas.bind("extension_added", extAdded); svgCanvas.textActions.setInputElem($("#text")[0]); - - var str = '
    \ -
    \ -
    ' - palette.forEach(function(item, i){ - str += '
    '; - }); - $('#palette').append(str); var changeFontSize = function(ctl) { svgCanvas.setFontSize(ctl.value); @@ -18049,46 +16987,7 @@ if(!window.methodDraw) window.methodDraw = function($) { //if (!noUndo) svgCanvas.changeSelectedAttribute(attr, val); svgCanvas.changeSelectedAttributeNoUndo(attr, val); }; - - picking = false; - $(document).on("mouseup", function(){picking = false;}) - $('#palette').on("mousemove mousedown touchstart touchmove", ".palette_item", function(evt){ - evt.preventDefault(); - - if (evt.type == "mousedown") picking = true; - if (picking) { - var isStroke = $('#tool_stroke').hasClass('active'); - var picker = isStroke ? "stroke" : "fill"; - var color = $(this).attr('data-rgb'); - var paint = null; - var noUndo = true; - if (evt.type == "mousedown") noUndo = false - // Webkit-based browsers returned 'initial' here for no stroke - if (color === 'transparent' || color === 'initial' || color === '#none') { - color = 'none'; - paint = new $.jGraduate.Paint(); - } - else { - paint = new $.jGraduate.Paint({alpha: 100, solidColor: color.substr(1)}); - } - - Editor.paintBox[picker].setPaint(paint); - - if (isStroke) { - svgCanvas.setColor('stroke', color, noUndo); - if (color != 'none' && svgCanvas.getStrokeOpacity() != 1) { - svgCanvas.setPaintOpacity('stroke', 1.0); - } - } else { - svgCanvas.setColor('fill', color, noUndo); - if (color != 'none' && svgCanvas.getFillOpacity() != 1) { - svgCanvas.setPaintOpacity('fill', 1.0); - } - } - } - }).bind('contextmenu', function(e) {e.preventDefault()}); - $("#toggle_stroke_tools").toggle(function() { $(".stroke_tool").css('display','table-cell'); $(this).addClass('expanded'); @@ -18099,11 +16998,6 @@ if(!window.methodDraw) window.methodDraw = function($) { resetScrollPos(); }); - // This is a common function used when a tool has been clicked (chosen) - // It does several common things: - // - removes the tool_button_current class from whatever tool currently has it - // - hides any flyouts - // - adds the tool_button_current class to the button passed in var toolButtonClick = function(button, noHiding) { if ($(button).hasClass('disabled')) return false; if($(button).parent().hasClass('tools_flyout')) return true; @@ -18112,8 +17006,8 @@ if(!window.methodDraw) window.methodDraw = function($) { $('.tools_flyout').fadeOut(fadeFlyouts); } $('#styleoverrides').text(''); - $('.tool_button_current').removeClass('tool_button_current').addClass('tool_button'); - $(button).addClass('tool_button_current').removeClass('tool_button'); + $('.tool_button.current').removeClass('current'); + $(button).addClass('current'); return true; }; @@ -18178,7 +17072,6 @@ if(!window.methodDraw) window.methodDraw = function($) { svgCanvas.setStrokeAttr('stroke-' + pre, val); } operaRepaint(); - setIcon('#cur_' + pre , id, 20); $(opt).addClass('current').siblings().removeClass('current'); } @@ -18198,8 +17091,8 @@ if(!window.methodDraw) window.methodDraw = function($) { if (!$(e.target).hasClass("menu_title") && !$(e.target).parent().hasClass("menu_title")) { if(!$(e.target).hasClass("disabled") && $(e.target).hasClass("menu_item")) blinker(e) else $('#menu_bar').removeClass('active') - } + } $('.menu_item').on('mousedown touchstart', function(e){blinker(e)}); @@ -18226,123 +17119,6 @@ if(!window.methodDraw) window.methodDraw = function($) { $(this).parent().addClass('open'); }); - - // Made public for UI customization. - // TODO: Group UI functions into a public methodDraw.ui interface. - Editor.addDropDown = function(elem, callback, dropUp) { - if ($(elem).length == 0) return; // Quit if called on non-existant element - var button = $(elem).find('button'); - - var list = $(elem).find('ul').attr('id', $(elem)[0].id + '-list'); - - if(!dropUp) { - // Move list to place where it can overflow container - $('#option_lists').append(list); - } - - var on_button = false; - if(dropUp) { - $(elem).addClass('dropup'); - } - - list.find('li').bind('mouseup', callback); - - $(window).mouseup(function(evt) { - if(!on_button) { - button.removeClass('down'); - list.hide(); - } - on_button = false; - }); - - button.bind('mousedown',function() { - if (!button.hasClass('down')) { - button.addClass('down'); - - if(!dropUp) { - var pos = $(elem).offset(); - // position slider - list.css({ - top: pos.top, - left: pos.left - 110 - }); - } - list.show(); - - on_button = true; - } else { - button.removeClass('down'); - list.hide(); - } - }).hover(function() { - on_button = true; - }).mouseout(function() { - on_button = false; - }); - } - - // TODO: Combine this with addDropDown or find other way to optimize - var addAltDropDown = function(elem, list, callback, opts) { - var button = $(elem); - var list = $(list); - var on_button = false; - var dropUp = opts.dropUp; - if(dropUp) { - $(elem).addClass('dropup'); - } - list.find('li').bind('mouseup', function() { - if(opts.seticon) { - setIcon('#cur_' + button[0].id , $(this).children()); - $(this).addClass('current').siblings().removeClass('current'); - } - callback.apply(this, arguments); - - }); - - $(window).mouseup(function(evt) { - if(!on_button) { - button.removeClass('down'); - list.hide(); - list.css({top:0, left:0}); - } - on_button = false; - }); - - var height = list.height(); - $(elem).bind('mousedown',function() { - var off = $(elem).offset(); - if(dropUp) { - off.top -= list.height(); - off.left += 8; - } else { - off.top += $(elem).height(); - } - $(list).offset(off); - - if (!button.hasClass('down')) { - button.addClass('down'); - list.show(); - on_button = true; - return false; - } else { - button.removeClass('down'); - // CSS position must be reset for Webkit - list.hide(); - list.css({top:0, left:0}); - } - }).hover(function() { - on_button = true; - }).mouseout(function() { - on_button = false; - }); - - if(opts.multiclick) { - list.mousedown(function() { - on_button = true; - }); - } - } - $('#font_family_dropdown').change(function() { var fam = this.options[this.selectedIndex].value var fam_display = this.options[this.selectedIndex].text @@ -18356,22 +17132,7 @@ if(!window.methodDraw) window.methodDraw = function($) { svgCanvas.alignSelectedElements(letter, 'page'); }) }); - - /* - - When a flyout icon is selected - (if flyout) { - - Change the icon - - Make pressing the button run its stuff - } - - Run its stuff - - When its shortcut key is pressed - - If not current in list, do as above - , else: - - Just run its stuff - - */ + // Unfocus text input when workarea is mousedowned. (function() { @@ -18413,11 +17174,7 @@ if(!window.methodDraw) window.methodDraw = function($) { } }; - var clickSquare = function(){ - if (toolButtonClick('#tool_square')) { - svgCanvas.setMode('square'); - } - }; + var clickRect = function(){ if (toolButtonClick('#tool_rect')) { @@ -18425,17 +17182,7 @@ if(!window.methodDraw) window.methodDraw = function($) { } }; - var clickFHRect = function(){ - if (toolButtonClick('#tool_fhrect')) { - svgCanvas.setMode('fhrect'); - } - }; - - var clickCircle = function(){ - if (toolButtonClick('#tool_circle')) { - svgCanvas.setMode('circle'); - } - }; + var clickEllipse = function(){ if (toolButtonClick('#tool_ellipse')) { @@ -18443,30 +17190,12 @@ if(!window.methodDraw) window.methodDraw = function($) { } }; - var clickFHEllipse = function(){ - if (toolButtonClick('#tool_fhellipse')) { - svgCanvas.setMode('fhellipse'); - } - }; - - var clickImage = function(){ - if (toolButtonClick('#tool_image')) { - svgCanvas.setMode('image'); - } - }; - var clickZoom = function(){ if (toolButtonClick('#tool_zoom')) { svgCanvas.setMode('zoom'); } }; - var dblclickZoom = function(){ - if (toolButtonClick('#tool_zoom')) { - zoomImage(); - setSelectMode(); - } - }; var clickText = function(){ if (toolButtonClick('#tool_text')) { @@ -18480,6 +17209,24 @@ if(!window.methodDraw) window.methodDraw = function($) { } }; + + var clickEyedropper = function() { + if (toolButtonClick('#tool_eyedropper')) { + svgCanvas.setMode('eyedropper'); + } + } + + var clickShapelib = function() { + if (toolButtonClick('#tool_shapelib')) { + $('#workarea').one("mousedown", function(){$('#tools_shapelib').hide()}) + $("#tools_shapelib").css({ + "top": $('#tool_shapelib').offset().top, + "margin-left": 3, + }) + $("#tools_shapelib").show(); + } + } + // Delete is a contextual tool that only appears in the ribbon if // an element has been selected var deleteSelected = function() { @@ -18802,7 +17549,7 @@ if(!window.methodDraw) window.methodDraw = function($) { top.exit_fullscreen(); } } - + var clickRulers = function() { flash($('#view_menu')); var rulers = !$('#tool_rulers').hasClass('push_button_pressed'); @@ -18843,12 +17590,7 @@ if(!window.methodDraw) window.methodDraw = function($) { var clickSave = function(){ flash($('#file_menu')); - // In the future, more options can be provided here - var saveOpts = { - 'images': curPrefs.img_save, - 'round_digits': 6 - } - svgCanvas.save(saveOpts); + svgCanvas.save(); }; var saveSourceEditor = function(){ @@ -18873,23 +17615,11 @@ if(!window.methodDraw) window.methodDraw = function($) { }; function setBackground(color, url) { -// if(color == curPrefs.bkgd_color && url == curPrefs.bkgd_url) return; $.pref('bkgd_color', color); $.pref('bkgd_url', url); - // This should be done in svgcanvas.js for the borderRect fill svgCanvas.setBackground(color, url); } - - var setIcon = Editor.setIcon = function(elem, icon_id, forcedSize) { - var icon = (typeof icon_id === 'string') ? $.getSvgIcon(icon_id, true) : icon_id.clone(); - if(!icon) { - console.log('NOTE: Icon image missing: ' + icon_id); - return; - } - - $(elem).find("img").replaceWith(icon); - } var ua_prefix; (ua_prefix = function() { @@ -18948,68 +17678,6 @@ if(!window.methodDraw) window.methodDraw = function($) { } }); } - - var setIconSize = Editor.setIconSize = function(size, force) { - if(size == curPrefs.size && !force) return; -// return; -// var elems = $('.tool_button, .push_button, .tool_button_current, .disabled, .icon_label, #url_notice, #tool_open'); - - var sel_toscale = '#tools_top .toolset, #editor_panel > *, #history_panel > *,\ - #main_button, #tools_left > *, #path_node_panel > *, #multiselected_panel > *,\ - #g_panel > *, #tool_font_size > *, .tools_flyout'; - - var elems = $(sel_toscale); - - var scale = 1; - - if(typeof size == 'number') { - scale = size; - } else { - var icon_sizes = { s:.75, m:1, l:1.25, xl:1.5 }; - scale = icon_sizes[size]; - } - - Editor.tool_scale = tool_scale = scale; - - setFlyoutPositions(); - var hidden_ps = elems.parents(':hidden'); - hidden_ps.css('visibility', 'hidden').show(); - scaleElements(elems, scale); - hidden_ps.css('visibility', 'visible').hide(); - - var rule_elem = $('#tool_size_rules'); - if(!rule_elem.length) { - rule_elem = $('