| | |
| | | case "不限定生产方风险查询": |
| | | result = this.getCondition2(dto); |
| | | break; |
| | | case "不限定规定值查询": |
| | | case "不限定检验上限查询": |
| | | result = this.getCondition3(dto); |
| | | break; |
| | | } |
| | |
| | | public Result delete(@RequestBody Long[] ids) { |
| | | //效验数据 |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | xhProductModelService.delete(ids); |
| | | for(Long id : ids){ |
| | | XhProductModel data = xhProductModelService.get(id); |
| | | if (data.getProductType().equals("1")||data.getProductType().equals("3")||data.getProductType().equals("4")){ |
| | | |
| | | }else if(data.getProductType().equals("2")){ |
| | | |
| | | }else if(data.getProductType().equals("5")){ |
| | | xhProductModelService.delete(ids); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | return Result.ok(); |
| | | } |
| | |
| | | @ApiModelProperty(value = "运行图片") |
| | | private Long operatImg; |
| | | |
| | | @ApiModelProperty(value = "同类设备名") |
| | | private String sameSbName; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "图片名称") |
| | | private String operatImgName; |
| | |
| | | String xt = com.zt.core.shiro.ImportUtil.getCellValue(row, 1, pattern); //系统 |
| | | String fxt = com.zt.core.shiro.ImportUtil.getCellValue(row, 2, pattern); |
| | | String sb = com.zt.core.shiro.ImportUtil.getCellValue(row, 3, pattern); //设备 |
| | | String equipType = com.zt.core.shiro.ImportUtil.getCellValue(row, 4, pattern); //设备类型 |
| | | String reliabDistribType = com.zt.core.shiro.ImportUtil.getCellValue(row, 5, pattern); //可靠性分布类型 |
| | | String basicJoinCompute = com.zt.core.shiro.ImportUtil.getCellValue(row, 6, pattern); //参加计算 |
| | | String basicMtbfRegulate = com.zt.core.shiro.ImportUtil.getCellValue(row, 7, pattern); //mtbf |
| | | String basicMtbfRegulSuccRate = com.zt.core.shiro.ImportUtil.getCellValue(row, 8, pattern); //成功率 |
| | | String basicMtbfOperatingRatio = com.zt.core.shiro.ImportUtil.getCellValue(row, 9, pattern); //运行比 |
| | | String taskMtbcfRegulate = com.zt.core.shiro.ImportUtil.getCellValue(row, 10, pattern); //mtbcf |
| | | String taskMtbcfOtherParams2 = com.zt.core.shiro.ImportUtil.getCellValue(row, 11, pattern); //mtbcf其他参数2 |
| | | String taskMtbcfOtherParams3 = com.zt.core.shiro.ImportUtil.getCellValue(row, 12, pattern); //mtbcf其他参数3 |
| | | String taskMtbcfRegulSuccRate = com.zt.core.shiro.ImportUtil.getCellValue(row, 13, pattern); //mtbcf成功率 |
| | | String taskMtbcfOperatingRatio = com.zt.core.shiro.ImportUtil.getCellValue(row, 14, pattern); //mtbcf运行比 |
| | | String repairable = com.zt.core.shiro.ImportUtil.getCellValue(row, 15, pattern); //是否可维修 |
| | | String repairDistribType = com.zt.core.shiro.ImportUtil.getCellValue(row, 16, pattern); //维修发布类型 |
| | | String repairMttcr = com.zt.core.shiro.ImportUtil.getCellValue(row, 17, pattern); //mttcr |
| | | String repairMttcrOtherParams2 = com.zt.core.shiro.ImportUtil.getCellValue(row, 18, pattern); //mttcr其他参数2 |
| | | String repairMttcrOtherParams3 = com.zt.core.shiro.ImportUtil.getCellValue(row, 19, pattern); //mttcr其他参数3 |
| | | String sameSbName = com.zt.core.shiro.ImportUtil.getCellValue(row, 4, pattern); //同类设备名称 |
| | | String equipType = com.zt.core.shiro.ImportUtil.getCellValue(row, 5, pattern); //设备类型 |
| | | String reliabDistribType = com.zt.core.shiro.ImportUtil.getCellValue(row, 6, pattern); //可靠性分布类型 |
| | | String basicJoinCompute = com.zt.core.shiro.ImportUtil.getCellValue(row, 7, pattern); //参加计算 |
| | | String basicMtbfRegulate = com.zt.core.shiro.ImportUtil.getCellValue(row, 8, pattern); //mtbf |
| | | String basicMtbfRegulSuccRate = com.zt.core.shiro.ImportUtil.getCellValue(row, 9, pattern); //成功率 |
| | | String basicMtbfOperatingRatio = com.zt.core.shiro.ImportUtil.getCellValue(row, 10, pattern); //运行比 |
| | | String taskMtbcfRegulate = com.zt.core.shiro.ImportUtil.getCellValue(row, 11, pattern); //mtbcf |
| | | String taskMtbcfOtherParams2 = com.zt.core.shiro.ImportUtil.getCellValue(row, 12, pattern); //mtbcf其他参数2 |
| | | String taskMtbcfOtherParams3 = com.zt.core.shiro.ImportUtil.getCellValue(row, 13, pattern); //mtbcf其他参数3 |
| | | String taskMtbcfRegulSuccRate = com.zt.core.shiro.ImportUtil.getCellValue(row, 14, pattern); //mtbcf成功率 |
| | | String taskMtbcfOperatingRatio = com.zt.core.shiro.ImportUtil.getCellValue(row, 15, pattern); //mtbcf运行比 |
| | | String repairable = com.zt.core.shiro.ImportUtil.getCellValue(row, 16, pattern); //是否可维修 |
| | | String repairDistribType = com.zt.core.shiro.ImportUtil.getCellValue(row, 17, pattern); //维修发布类型 |
| | | String repairMttcr = com.zt.core.shiro.ImportUtil.getCellValue(row, 18, pattern); //mttcr |
| | | String repairMttcrOtherParams2 = com.zt.core.shiro.ImportUtil.getCellValue(row, 19, pattern); //mttcr其他参数2 |
| | | String repairMttcrOtherParams3 = com.zt.core.shiro.ImportUtil.getCellValue(row, 20, pattern); //mttcr其他参数3 |
| | | |
| | | if (StringUtils.isBlank(sb)) |
| | | continue; |
| | |
| | | } else { |
| | | curSbId = modelMap.get(sbPath).getId(); |
| | | paramId = modelMap.get(sbPath).getParamId(); |
| | | } |
| | | |
| | | if(StringUtils.isBlank(sameSbName)){ |
| | | sameSbName = sb; |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(sb)) { |
| | |
| | | paramDataService.insert(itemEntity); |
| | | } |
| | | |
| | | xhProductModel.setPid(curFxtId == null ? curXtId : curFxtId); |
| | | xhProductModel.setId(curSbId); |
| | | xhProductModel.setName(sb); |
| | | xhProductModel.setSameSbName(sameSbName); |
| | | xhProductModel.setEquipType(equipType); |
| | | xhProductModel.setProductType("5"); |
| | | xhProductModel.setSort(Integer.valueOf(sort)); |
| | | defultImg = sysPictureBaseService.getDefaultImg(5).getId(); |
| | | xhProductModel.setOperatImg(defultImg); |
| | | xhProductModel.setNamePath(sbPath); |
| | | if (insertSb) { |
| | | xhProductModel.setPid(curFxtId == null ? curXtId : curFxtId); |
| | | xhProductModel.setId(curSbId); |
| | | xhProductModel.setName(sb); |
| | | xhProductModel.setEquipType(equipType); |
| | | xhProductModel.setProductType("5"); |
| | | xhProductModel.setSort(Integer.valueOf(sort)); |
| | | defultImg = sysPictureBaseService.getDefaultImg(5).getId(); |
| | | xhProductModel.setOperatImg(defultImg); |
| | | xhProductModel.setNamePath(sbPath); |
| | | this.insert(xhProductModel); |
| | | }else{ |
| | | this.update(xhProductModel); |
| | | } |
| | | |
| | | //导入预计参数 |
| | |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("time_diagram") |
| | | @TableName("time_diagram_temp") |
| | | public class TimeDiagram extends CompanyEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | @ApiModelProperty(value = "PROJECT_ID") |
| | |
| | | } |
| | | JSONObject xmlJSONObj = XML.toJSONObject(xml); |
| | | JSONObject jsonObject = xmlJSONObj.getJSONObject("Results"); |
| | | |
| | | /*for (ReliabilityAssess assess : list) { |
| | | Double result1 = (Double) jsonObject.get(assess.getName()); |
| | | if (result1 != null) { |
| | |
| | | </select> |
| | | <select id="getTimeDiagram" resultType="com.zt.life.modules.mainPart.taskReliability.model.TimeDiagram"> |
| | | select * |
| | | from time_diagram |
| | | from time_diagram_temp |
| | | where is_delete = 0 |
| | | <if test="projectId!=null and projectId!=''"> |
| | | and PROJECT_ID = #{projectId} |
| | |
| | | if (res.success) { |
| | | await this.$tip.success() |
| | | this._query() |
| | | this.$emit('refreshMethod') |
| | | } |
| | | } |
| | | }, |
| | |
| | | build/svg-edit-2.6.wgt |
| | | build/svg-edit-2.6.xpi |
| | | build/svg-edit-2.6.zip |
| | | .DS_Store |
| | | .DS_Store |
| | |
| | | Copyright (c) by Mark MacKay |
| | | |
| | | Permission is hereby granted, free of charge, to any person obtaining a copy |
| | | of this software and associated documentation files (the "Software"), to deal |
| | | in the Software without restriction, including without limitation the rights |
| | | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| | | copies of the Software, and to permit persons to whom the Software is |
| | | furnished to do so, subject to the following conditions: |
| | | |
| | | The above copyright notice and this permission notice shall be included in |
| | | all copies or substantial portions of the Software. |
| | | |
| | | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| | | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| | | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| | | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| | | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| | | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| | | THE SOFTWARE. |
| | |
| | | else: # else append line to the output list |
| | | out_lines.append(line) |
| | | i += 1 |
| | | |
| | | |
| | | return ''.join(out_lines) |
| | | |
| | | if __name__ == '__main__': |
| | |
| | | |
| | | |
| | | <script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | <html><head><meta http-equiv="Refresh" CONTENT="0; URL=files/svgcanvas-js.html"></head></html> |
| | | <html><head><meta http-equiv="Refresh" CONTENT="0; URL=files/svgcanvas-js.html"></head></html> |
| | |
| | | |
| | | |
| | | <script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | |
| | | |
| | | <script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | |
| | | |
| | | <script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | "Y": false, |
| | | "Z": false |
| | | } |
| | | } |
| | | } |
| | |
| | | var searchResults = new SearchResults("searchResults", "HTML"); |
| | | searchResults.Search(); |
| | | --></script></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | var searchResults = new SearchResults("searchResults", "HTML"); |
| | | searchResults.Search(); |
| | | --></script></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | var searchResults = new SearchResults("searchResults", "HTML"); |
| | | searchResults.Search(); |
| | | --></script></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | var searchResults = new SearchResults("searchResults", "HTML"); |
| | | searchResults.Search(); |
| | | --></script></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | var searchResults = new SearchResults("searchResults", "HTML"); |
| | | searchResults.Search(); |
| | | --></script></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | var searchResults = new SearchResults("searchResults", "HTML"); |
| | | searchResults.Search(); |
| | | --></script></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | var searchResults = new SearchResults("searchResults", "HTML"); |
| | | searchResults.Search(); |
| | | --></script></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | var searchResults = new SearchResults("searchResults", "HTML"); |
| | | searchResults.Search(); |
| | | --></script></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | var searchResults = new SearchResults("searchResults", "HTML"); |
| | | searchResults.Search(); |
| | | --></script></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | var searchResults = new SearchResults("searchResults", "HTML"); |
| | | searchResults.Search(); |
| | | --></script></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | var searchResults = new SearchResults("searchResults", "HTML"); |
| | | searchResults.Search(); |
| | | --></script></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | var searchResults = new SearchResults("searchResults", "HTML"); |
| | | searchResults.Search(); |
| | | --></script></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | var searchResults = new SearchResults("searchResults", "HTML"); |
| | | searchResults.Search(); |
| | | --></script></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | var searchResults = new SearchResults("searchResults", "HTML"); |
| | | searchResults.Search(); |
| | | --></script></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | var searchResults = new SearchResults("searchResults", "HTML"); |
| | | searchResults.Search(); |
| | | --></script></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | var searchResults = new SearchResults("searchResults", "HTML"); |
| | | searchResults.Search(); |
| | | --></script></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | var searchResults = new SearchResults("searchResults", "HTML"); |
| | | searchResults.Search(); |
| | | --></script></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | var searchResults = new SearchResults("searchResults", "HTML"); |
| | | searchResults.Search(); |
| | | --></script></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | var searchResults = new SearchResults("searchResults", "HTML"); |
| | | searchResults.Search(); |
| | | --></script></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | |
| | | |
| | | <div id=Index><div class=SRStatus id=NoMatches>No Matches</div></div><script language=JavaScript><!-- |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | | if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |
| | |
| | | <glyph unicode="™" horiz-adv-x="3623" d="M1577 0v172h144v1153h-144v191h480l481 -1309l487 1309h455v-191h-143v-1153h143v-172h-492v172h162v1164l-530 -1336h-170l-537 1339v-1167h156v-172h-492zM41 1116v400h1352v-400h-205v236h-400v-1180h156v-172h-491v172h139v1180h-346v-236h-205z" /> |
| | | <glyph unicode="" horiz-adv-x="1035" d="M0 1035h1035v-1035h-1035v1035z" /> |
| | | </font> |
| | | </defs></svg> |
| | | </defs></svg> |
| | |
| | | <glyph unicode="−" horiz-adv-x="1331" d="M102 496v137h1127v-137h-1127z" /> |
| | | <glyph unicode="" horiz-adv-x="1125" d="M0 1125h1125v-1125h-1125v1125z" /> |
| | | </font> |
| | | </defs></svg> |
| | | </defs></svg> |
| | |
| | | <glyph unicode="fi" horiz-adv-x="772" d="M20 934v186h105v31q0 45 1 69.5t7 77t22.5 84t43 67.5t72.5 53.5t108 17.5q33 0 69.5 -4.5t57.5 -8.5l20 -2v-184q-41 12 -110 12q-31 0 -50.5 -18.5t-25.5 -58t-7 -54t-1 -53.5v-29h358v-1120h-207v934h-151v-934h-207v934h-105z" /> |
| | | <glyph unicode="fl" horiz-adv-x="772" d="M20 934v186h105v31q0 45 1 69.5t7 77t22.5 84t43 67.5t72.5 53.5t108 17.5q33 0 69.5 -4.5t57.5 -8.5l20 -2h164v-1505h-207v1329q-37 4 -67.5 4t-50 -18.5t-25.5 -58t-7 -54t-1 -53.5v-29h104v-186h-104v-934h-207v934h-105z" /> |
| | | </font> |
| | | </defs></svg> |
| | | </defs></svg> |
| | |
| | | <glyph d="M71 154q0 37 11.5 66.5t32.5 49t35 28.5t34 19q5 3 9.5 4.5t6.5 2.5h2l-2 2q-3 1 -8 4t-11 7q-101 69 -101 158q0 68 49.5 115.5t120.5 47.5q67 0 112.5 -42t45.5 -108q0 -16 -2 -30t-7 -26.5t-9.5 -22.5t-13.5 -20t-14 -16.5t-15.5 -15t-14.5 -12t-15 -11t-12 -8.5 q-9 -7 -9 -8t9 -6q1 -1 17 -9.5t23 -14l22.5 -17t24 -24t19 -29.5t15 -38.5t4.5 -45.5q0 -72 -50 -116t-132 -44q-73 0 -125 45t-52 115zM124 164q0 -63 35 -102.5t93 -39.5q50 0 81.5 39t31.5 92q0 40 -19.5 70.5t-40 45t-59.5 35.5q-22 12 -27 12q-3 0 -33 -21 q-62 -46 -62 -131zM138 507q0 -64 69 -118q34 -26 54 -35l16 -7q3 0 14 10q26 23 49 65t23 78q0 64 -32 100t-83 36q-50 0 -80 -37.5t-30 -91.5z" /> |
| | | <glyph d="M60 204q0 89 55 141.5t138 52.5q87 0 143.5 -62t56.5 -174q0 -70 -26.5 -130t-68 -99.5t-88.5 -70.5t-91 -47.5t-71.5 -24.5t-34.5 -8q-4 0 -7 9t-3 16q0 2 24 9.5t62 24t79 42t80 71t59 102.5l3 7l3 10.5t0 3.5q-2 0 -20 -12q-54 -33 -125 -33q-77 0 -122.5 47.5 t-45.5 124.5zM125 214q0 -60 35 -105.5t95 -45.5q96 0 126 52q6 11 6 57q0 50 -13 92.5t-43.5 73t-74.5 30.5q-64 0 -97.5 -43.5t-33.5 -110.5z" /> |
| | | </font> |
| | | </defs></svg> |
| | | </defs></svg> |
| | |
| | | <glyph horiz-adv-x="415" d="M45 130q0 34 14.5 66t35 54.5t41.5 39.5t35.5 27t14.5 12q0 1 -10.5 10.5t-25 25t-29 35.5t-25 47t-10.5 53q0 71 48 116t124 45q62 0 99.5 -35.5t37.5 -98.5q0 -29 -13.5 -58t-32.5 -49.5t-38.5 -37t-33 -26.5t-13.5 -12q0 -1 11.5 -11.5t28 -28.5t32.5 -40t27.5 -53 t11.5 -61q0 -67 -52.5 -110t-129.5 -43q-68 0 -108 33.5t-40 99.5zM99 145q0 -55 30.5 -89t72.5 -34q48 0 81 35.5t33 82.5q0 22 -11.5 48.5t-27.5 48t-33.5 39.5t-29.5 28.5t-14 10.5q-7 0 -30 -20.5t-47 -62.5t-24 -87zM139 534q0 -36 25.5 -79.5t51 -69.5t30.5 -26 q7 0 30.5 21.5t46.5 62.5t23 82q0 48 -28 80.5t-74 32.5q-48 0 -76.5 -32t-28.5 -72z" /> |
| | | <glyph horiz-adv-x="437" d="M-6 -185q0 2 32 13q114 40 235 186q20 23 20 32q-2 1 -5 0.5t-12 -4t-12 -4.5q-41 -13 -74 -13q-62 0 -100 45.5t-38 121.5q0 89 62 145.5t146 56.5q70 0 109.5 -52.5t39.5 -138.5q0 -77 -39 -150.5t-101 -125.5q-49 -41 -111.5 -74t-99 -45.5t-43.5 -12.5q-9 0 -9 20z M99 173q0 -55 26.5 -88t79.5 -33q44 0 74 13q25 11 42.5 64t17.5 111q0 61 -25.5 94.5t-66.5 33.5q-66 0 -107 -60.5t-41 -134.5z" /> |
| | | </font> |
| | | </defs></svg> |
| | | </defs></svg> |
| | |
| | | src: url('font-files/fanwood_italic-webfont.woff') format('woff'); |
| | | font-weight: normal; |
| | | font-style: italic; |
| | | } |
| | | } |
| | |
| | | #stroke_style_label{font-size:30px;margin-top:33px;letter-spacing:-1px} |
| | | .stroke_tool .caret{top:60%} |
| | | #tool_align_relative{position:absolute;top:-5px;left:0;right:20px;display:block} |
| | | #tool_align_relative select{width:100%;display:block} |
| | | #tool_align_relative select{width:100%;display:block} |
| | |
| | | vertical-align: top; |
| | | } |
| | | |
| | | .touch .menu_title { |
| | | .touch .menu_title { |
| | | padding: 7px 17px; |
| | | height: 26px; |
| | | line-height: 26px; |
| | |
| | | |
| | | .menu_list .menu_item.push_button_pressed { |
| | | background: transparent; |
| | | border: none; |
| | | border: none; |
| | | width: auto; |
| | | height: auto; |
| | | margin: 0; |
| | |
| | | margin-top: -16px; |
| | | } |
| | | |
| | | #ruler_x > div, |
| | | #ruler_x > div, |
| | | #ruler_y > div { |
| | | overflow: hidden; |
| | | } |
| | |
| | | .palette_item.transparent, .palette_item.white, .palette_item.black { |
| | | background: #fff; |
| | | position: absolute; |
| | | width: 10px; |
| | | height: 10px; |
| | | left: -10px; |
| | | width: 30px; |
| | | height: 30px; |
| | | top: 0; |
| | | /*background-size:cover;*/ |
| | | } |
| | | |
| | | .palette_item.transparent { |
| | | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNXG14zYAAAAVdEVYdENyZWF0aW9uIFRpbWUAOC8yMi8xMg1cp6sAAABESURBVBiVjdBBCgAgCETRr/e/87SJKFPLnfIcQRMIwMBIShIAvgZzoSrfkzrs8WyF1+kX9r3p8AE7nL7kSpSshN+JEQ8GixkF0mSevgAAAABJRU5ErkJggg==); |
| | | left: -10px; |
| | | } |
| | | |
| | | .palette_item.black { |
| | | background: #000; |
| | | top: 10px; |
| | | left: 20px; |
| | | } |
| | | |
| | | .palette_item.white { |
| | | background: #fff; |
| | | top: 20px; |
| | | left:50px; |
| | | } |
| | | |
| | | #color_tools { |
| | |
| | | |
| | | .touch #tool_switch { |
| | | display: none; |
| | | } |
| | | } |
| | | |
| | | #use_panel .tool_button, #path_node_panel .tool_button { |
| | | color: #999; |
| | | border: solid #3F3F3C 1px; |
| | | border-radius: 3px; |
| | | padding: 3px 10px 3px 40px; |
| | | background: |
| | | background: |
| | | transparent; |
| | | position: relative; |
| | | margin-top: 10px; |
| | |
| | | position: absolute; |
| | | top: 10px; |
| | | width: 14px; |
| | | |
| | | |
| | | } |
| | | |
| | | #color_tools #tool_switch { |
| | |
| | | position: absolute; |
| | | } |
| | | |
| | | .tool_button, |
| | | .tool_button, |
| | | .tool_button_current, |
| | | .tool_button_pressed { |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .tool_button:hover, |
| | | .tool_button:hover, |
| | | .push_button:hover, |
| | | .buttonup:hover, |
| | | .buttondown, |
| | |
| | | color: #999; |
| | | } |
| | | |
| | | div#font-selector { |
| | | width:140px; |
| | | height:300px; |
| | | overflow:auto; |
| | | margin:0 auto; |
| | | position:absolute; |
| | | div#font-selector { |
| | | width:140px; |
| | | height:300px; |
| | | overflow:auto; |
| | | margin:0 auto; |
| | | position:absolute; |
| | | top:27px; |
| | | right:0; |
| | | border:1px solid black; |
| | | padding:10px; |
| | | display:none; |
| | | border:1px solid black; |
| | | padding:10px; |
| | | display:none; |
| | | background-color:white; |
| | | z-index: 10; |
| | | border-radius: 3px; |
| | |
| | | right: 50%; |
| | | border: solid transparent 5px; |
| | | border-bottom-color: #fff; |
| | | |
| | | |
| | | } |
| | | |
| | | .dropdown li.special.down:after { |
| | |
| | | top: auto; |
| | | border: solid transparent 5px; |
| | | border-top-color: #fff; |
| | | |
| | | |
| | | } |
| | | |
| | | .tool_button, |
| | | .tool_button, |
| | | .push_button, |
| | | .tool_button_current, |
| | | .push_button_pressed |
| | | .push_button_pressed |
| | | { |
| | | height: 27px; |
| | | width: 27px; |
| | |
| | | overflow: hidden; |
| | | } |
| | | |
| | | #tool_open input, |
| | | #tool_open input, |
| | | #tool_import input, |
| | | #tool_import_bitmap input { |
| | | position: absolute; |
| | |
| | | left: -9999px; |
| | | } |
| | | |
| | | #tool_bold span, #tool_italic span { |
| | | #tool_bold span, #tool_italic span { |
| | | position: absolute; |
| | | width: 100%; |
| | | height: 100%; |
| | |
| | | |
| | | .draginput_cell { |
| | | float: left; |
| | | height: 26px; |
| | | height: 26px; |
| | | border: solid #3f3f3c 10px; |
| | | outline: solid #2f2f2c 1px; |
| | |
| | | overflow: auto; |
| | | top: 0; |
| | | bottom: 0; |
| | | left: 110px; |
| | | left: 0; |
| | | /*left: 110px;*/ |
| | | right: 0; |
| | | position: absolute; |
| | | vertical-align: top; |
| | | } |
| | | |
| | | #shape_cats { |
| | | display: none; |
| | | min-width: 110px; |
| | | display: block; |
| | | /*display: block;*/ |
| | | position: absolute; |
| | | left: 0; |
| | | top: 0; |
| | |
| | | margin: 5px; |
| | | border-radius: 0px; |
| | | -moz-border-radius: 0px; |
| | | -webkit-border-radius: 0px; |
| | | -webkit-border-radius: 0px; |
| | | border-width: 0; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | .contextMenu .shortcut { |
| | | width: 115px; |
| | | width: 115px; |
| | | text-align:right; |
| | | float:right; |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | #tool_bold, #tool_italic { |
| | | #tool_bold, #tool_italic { |
| | | font: bold 20px/35px serif; |
| | | text-align: center; |
| | | position: absolute; |
| | |
| | | } |
| | | |
| | | |
| | | .draginput input, .draginput input:hover, .draginput input:active { |
| | | .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 { |
| | | .draginput input[type="checkbox"], .draginput input[type="checkbox"]:hover, .draginput input[type="checkbox"]:active { |
| | | cursor: pointer; |
| | | } |
| | | |
| | |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .draginput.active input, .draginput.active input:hover, .draginput.active input:active { |
| | | .draginput.active input, .draginput.active input:hover, .draginput.active input:active { |
| | | cursor: url(../images/dragging.png), move; |
| | | cursor: -webkit-grabbing; |
| | | cursor: -moz-grabbing; |
| | |
| | | margin: 0; |
| | | z-index: 1; |
| | | top: 0; |
| | | left: 0; |
| | | left: 0; |
| | | } |
| | | |
| | | |
| | |
| | | #tool_align_relative select { |
| | | width: 100%; |
| | | display: block; |
| | | } |
| | | } |
| | |
| | | function init_embed() { |
| | | var frame = document.getElementById('svgedit'); |
| | | svgCanvas = new embedded_svg_edit(frame); |
| | | |
| | | |
| | | // Hide main button, as we will be controlling new/load/save etc from the host document |
| | | var doc; |
| | | doc = frame.contentDocument; |
| | |
| | | { |
| | | doc = frame.contentWindow.document; |
| | | } |
| | | |
| | | |
| | | var mainButton = doc.getElementById('main_button'); |
| | | mainButton.style.display = 'none'; |
| | | mainButton.style.display = 'none'; |
| | | } |
| | | |
| | | |
| | | function handleSvgData(data, error) { |
| | | if (error) |
| | | { |
| | |
| | | else |
| | | { |
| | | alert('Congratulations. Your SVG string is back in the host page, do with it what you will\n\n' + data); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | function loadSvg() { |
| | | var svgexample = '<svg width="640" height="480" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"><g><title>Layer 1</title><rect stroke-width="5" stroke="#000000" fill="#FF0000" id="svg_1" height="35" width="51" y="35" x="32"/><ellipse ry="15" rx="24" stroke-width="5" stroke="#000000" fill="#0000ff" id="svg_2" cy="60" cx="66"/></g></svg>'; |
| | | svgCanvas.setSvgString(svgexample); |
| | | } |
| | | |
| | | function saveSvg() { |
| | | |
| | | function saveSvg() { |
| | | svgCanvas.getSvgString()(handleSvgData); |
| | | } |
| | | </script> |
| | |
| | | <button onclick="saveSvg();">Save data</button> |
| | | <br/> |
| | | |
| | | <iframe src="index.html" width="900px" height="600px" id="svgedit" onload="init_embed()"></iframe> |
| | | <iframe src="index.html" width="900px" height="600px" id="svgedit" onload="init_embed()"></iframe> |
| | | </body> |
| | | </html> |
| | |
| | | </g> |
| | | |
| | | <g id="svg_eof"/> |
| | | </svg> |
| | | </svg> |
| | |
| | | * |
| | | */ |
| | | |
| | | |
| | | |
| | | methodDraw.addExtension("Arrows", function(S) { |
| | | var svgcontent = S.svgcontent, |
| | | addElem = S.addSvgElementFromJson, |
| | |
| | | |
| | | svgCanvas.bind('setnonce', setArrowNonce); |
| | | svgCanvas.bind('unsetnonce', unsetArrowNonce); |
| | | |
| | | |
| | | var lang_list = { |
| | | "en":[ |
| | | {"id": "arrow_none", "textContent": "No arrow" } |
| | |
| | | {"id": "arrow_none", "textContent": "Sans flèche" } |
| | | ] |
| | | }; |
| | | |
| | | |
| | | var prefix = 'se_arrow_'; |
| | | if (randomize_ids) { |
| | | var arrowprefix = prefix + nonce + '_'; |
| | |
| | | fw: {d:"m0,0l10,5l-10,5l5,-5l-5,-5z", refx:8, id: arrowprefix + 'fw'}, |
| | | bk: {d:"m10,0l-10,5l10,5l-5,-5l5,-5z", refx:2, id: arrowprefix + 'bk'} |
| | | } |
| | | |
| | | |
| | | function setArrowNonce(window, n) { |
| | | randomize_ids = true; |
| | | arrowprefix = prefix + n + '_'; |
| | |
| | | } |
| | | return S.getElem(m[1]); |
| | | } |
| | | |
| | | |
| | | function showPanel(on) { |
| | | $('#arrow_panel').toggle(on); |
| | | |
| | | |
| | | if(on) { |
| | | var el = selElems[0]; |
| | | var end = el.getAttribute("marker-end"); |
| | | var start = el.getAttribute("marker-start"); |
| | | var mid = el.getAttribute("marker-mid"); |
| | | var val; |
| | | |
| | | |
| | | if(end && start) { |
| | | val = "both"; |
| | | } else if(end) { |
| | |
| | | val = "mid_bk"; |
| | | } |
| | | } |
| | | |
| | | |
| | | if(!start && !mid && !end) { |
| | | val = "none"; |
| | | } |
| | | |
| | | |
| | | $("#arrow_list").val(val); |
| | | } |
| | | } |
| | | |
| | | |
| | | function resetMarker() { |
| | | var el = selElems[0]; |
| | | el.removeAttribute("marker-start"); |
| | | el.removeAttribute("marker-mid"); |
| | | el.removeAttribute("marker-end"); |
| | | } |
| | | |
| | | |
| | | function addMarker(dir, type, id) { |
| | | // TODO: Make marker (or use?) per arrow type, since refX can be different |
| | | id = id || arrowprefix + dir; |
| | | |
| | | |
| | | var marker = S.getElem(id); |
| | | |
| | | var data = pathdata[dir]; |
| | | |
| | | |
| | | if(type == "mid") { |
| | | data.refx = 5; |
| | | } |
| | |
| | | }); |
| | | marker.appendChild(arrow); |
| | | S.findDefs().appendChild(marker); |
| | | } |
| | | |
| | | } |
| | | |
| | | marker.setAttribute('refX', data.refx); |
| | | |
| | | |
| | | return marker; |
| | | } |
| | | |
| | | |
| | | function setArrow() { |
| | | var type = this.value; |
| | | resetMarker(); |
| | | |
| | | |
| | | if(type == "none") { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // Set marker on element |
| | | var dir = "fw"; |
| | | if(type == "mid_bk") { |
| | |
| | | } else if (type == "start") { |
| | | dir = "bk"; |
| | | } |
| | | |
| | | |
| | | addMarker(dir, type); |
| | | svgCanvas.changeSelectedAttribute("marker-"+type, "url(#" + pathdata[dir].id + ")"); |
| | | S.call("changed", selElems); |
| | | } |
| | | |
| | | |
| | | function colorChanged(elem) { |
| | | var color = elem.getAttribute('stroke'); |
| | | |
| | | |
| | | var mtypes = ['start','mid','end']; |
| | | var defs = S.findDefs(); |
| | | |
| | | |
| | | $.each(mtypes, function(i, type) { |
| | | var marker = getLinked(elem, 'marker-'+type); |
| | | if(!marker) return; |
| | | |
| | | |
| | | var cur_color = $(marker).children().attr('fill'); |
| | | var cur_d = $(marker).children().attr('d'); |
| | | var new_marker = null; |
| | | if(cur_color === color) return; |
| | | |
| | | |
| | | var all_markers = $(defs).find('marker'); |
| | | // Different color, check if already made |
| | | all_markers.each(function() { |
| | |
| | | new_marker = this; |
| | | } |
| | | }); |
| | | |
| | | |
| | | if(!new_marker) { |
| | | // Create a new marker with this color |
| | | var last_id = marker.id; |
| | | var dir = last_id.indexOf('_fw') !== -1?'fw':'bk'; |
| | | |
| | | |
| | | new_marker = addMarker(dir, type, arrowprefix + dir + all_markers.length); |
| | | |
| | | $(new_marker).children().attr('fill', color); |
| | | } |
| | | |
| | | |
| | | $(elem).attr('marker-'+type, "url(#" + new_marker.id + ")"); |
| | | |
| | | |
| | | // Check if last marker can be removed |
| | | var remove = true; |
| | | $(S.svgcontent).find('line, polyline, path, polygon').each(function() { |
| | |
| | | }); |
| | | if(!remove) return false; |
| | | }); |
| | | |
| | | |
| | | // Not found, so can safely remove |
| | | if(remove) { |
| | | $(marker).remove(); |
| | | } |
| | | |
| | | }); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | return { |
| | | name: "Arrows", |
| | | context_tools: [{ |
| | |
| | | }; |
| | | }, |
| | | selectedChanged: function(opts) { |
| | | |
| | | |
| | | // Use this to update the current selected elements |
| | | selElems = opts.elems; |
| | | |
| | | |
| | | var i = selElems.length; |
| | | var marker_elems = ['line','path','polyline','polygon']; |
| | | |
| | | |
| | | while(i--) { |
| | | var elem = selElems[i]; |
| | | if(elem && $.inArray(elem.tagName, marker_elems) != -1) { |
| | |
| | | // Has marker, so see if it should match color |
| | | colorChanged(elem); |
| | | } |
| | | |
| | | |
| | | } |
| | | }; |
| | | }); |
| | |
| | | if (path) updateButton(path); |
| | | } |
| | | }, |
| | | |
| | | |
| | | toggleClosed = function() { |
| | | var path = selElems[0]; |
| | | if (path) { |
| | | var seglist = path.pathSegList, |
| | | last = seglist.numberOfItems - 1; |
| | | last = seglist.numberOfItems - 1; |
| | | // is closed |
| | | if(seglist.getItem(last).pathSegType == 1) { |
| | | seglist.removeItem(last); |
| | |
| | | updateButton(path); |
| | | } |
| | | }; |
| | | |
| | | |
| | | return { |
| | | name: "ClosePath", |
| | | svgicons: "extensions/closepath_icons.svg", |
| | |
| | | selectedChanged: function(opts) { |
| | | selElems = opts.elems; |
| | | var i = selElems.length; |
| | | |
| | | |
| | | while(i--) { |
| | | var elem = selElems[i]; |
| | | if(elem && elem.tagName == 'path') { |
| | |
| | | * Copyright(c) 2010 Alexis Deveria |
| | | * |
| | | */ |
| | | |
| | | |
| | | methodDraw.addExtension("Connector", function(S) { |
| | | var svgcontent = S.svgcontent, |
| | | svgroot = S.svgroot, |
| | |
| | | se_ns, |
| | | // connect_str = "-SE_CONNECT-", |
| | | selElems = []; |
| | | |
| | | |
| | | elData = $.data; |
| | | |
| | | |
| | | var lang_list = { |
| | | "en":[ |
| | | {"id": "mode_connect", "title": "Connect two objects" } |
| | |
| | | {"id": "mode_connect", "title": "Connecter deux objets"} |
| | | ] |
| | | }; |
| | | |
| | | |
| | | function getOffset(side, line) { |
| | | var give_offset = !!line.getAttribute('marker-' + side); |
| | | // var give_offset = $(line).data(side+'_off'); |
| | |
| | | var size = line.getAttribute('stroke-width') * 5; |
| | | return give_offset ? size : 0; |
| | | } |
| | | |
| | | |
| | | function showPanel(on) { |
| | | var conn_rules = $('#connector_rules'); |
| | | if(!conn_rules.length) { |
| | | conn_rules = $('<style id="connector_rules"><\/style>').appendTo('head'); |
| | | } |
| | | } |
| | | conn_rules.text(!on?"":"#tool_clone, #tool_topath, #tool_angle, #xy_panel { display: none !important; }"); |
| | | $('#connector_panel').toggle(on); |
| | | } |
| | | |
| | | |
| | | function setPoint(elem, pos, x, y, setMid) { |
| | | var pts = elem.points; |
| | | var pt = svgroot.createSVGPoint(); |
| | |
| | | pt_arr[i] = x + ',' + y; |
| | | } |
| | | } |
| | | elem.setAttribute("points",pt_arr.join(" ")); |
| | | elem.setAttribute("points",pt_arr.join(" ")); |
| | | } |
| | | |
| | | |
| | | if(setMid) { |
| | | // Add center point |
| | | var pt_start = pts.getItem(0); |
| | |
| | | setPoint(elem, 1, (pt_end.x + pt_start.x)/2, (pt_end.y + pt_start.y)/2); |
| | | } |
| | | } |
| | | |
| | | |
| | | function updateLine(diff_x, diff_y) { |
| | | // Update line with element |
| | | var i = connections.length; |
| | |
| | | var conn = connections[i]; |
| | | var line = conn.connector; |
| | | var elem = conn.elem; |
| | | |
| | | |
| | | var pre = conn.is_start?'start':'end'; |
| | | // var sw = line.getAttribute('stroke-width') * 5; |
| | | |
| | | |
| | | // Update bbox for this element |
| | | var bb = elData(line, pre+'_bb'); |
| | | bb.x = conn.start_x + diff_x; |
| | | bb.y = conn.start_y + diff_y; |
| | | elData(line, pre+'_bb', bb); |
| | | |
| | | |
| | | var alt_pre = conn.is_start?'end':'start'; |
| | | |
| | | |
| | | // Get center pt of connected element |
| | | var bb2 = elData(line, alt_pre+'_bb'); |
| | | var src_x = bb2.x + bb2.width/2; |
| | | var src_y = bb2.y + bb2.height/2; |
| | | |
| | | |
| | | // Set point of element being moved |
| | | var pt = getBBintersect(src_x, src_y, bb, getOffset(pre, line)); // $(line).data(pre+'_off')?sw:0 |
| | | setPoint(line, conn.is_start?0:'end', pt.x, pt.y, true); |
| | | |
| | | |
| | | // Set point of connected element |
| | | var pt2 = getBBintersect(pt.x, pt.y, elData(line, alt_pre + '_bb'), getOffset(alt_pre, line)); |
| | | setPoint(line, conn.is_start?'end':0, pt2.x, pt2.y, true); |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | function findConnectors(elems) { |
| | | if(!elems) elems = selElems; |
| | | var connectors = $(svgcontent).find(conn_sel); |
| | |
| | | connectors.each(function() { |
| | | var start = elData(this, "c_start"); |
| | | var end = elData(this, "c_end"); |
| | | |
| | | |
| | | var parts = [getElem(start), getElem(end)]; |
| | | for(var i=0; i<2; i++) { |
| | | var c_elem = parts[i]; |
| | |
| | | add_this = true; |
| | | } |
| | | }); |
| | | |
| | | |
| | | if(!c_elem || !c_elem.parentNode) { |
| | | $(this).remove(); |
| | | continue; |
| | |
| | | is_start: (i === 0), |
| | | start_x: bb.x, |
| | | start_y: bb.y |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | function updateConnectors(elems) { |
| | | // Updates connector lines based on selected elements |
| | | // Is not used on mousemove, as it runs getStrokedBBox every time, |
| | |
| | | |
| | | var sw = line.getAttribute('stroke-width') * 5; |
| | | var pre = conn.is_start?'start':'end'; |
| | | |
| | | |
| | | // Update bbox for this element |
| | | var bb = svgCanvas.getStrokedBBox([elem]); |
| | | bb.x = conn.start_x; |
| | | bb.y = conn.start_y; |
| | | elData(line, pre+'_bb', bb); |
| | | var add_offset = elData(line, pre+'_off'); |
| | | |
| | | |
| | | var alt_pre = conn.is_start?'end':'start'; |
| | | |
| | | |
| | | // Get center pt of connected element |
| | | var bb2 = elData(line, alt_pre+'_bb'); |
| | | var src_x = bb2.x + bb2.width/2; |
| | | var src_y = bb2.y + bb2.height/2; |
| | | |
| | | |
| | | // Set point of element being moved |
| | | var pt = getBBintersect(src_x, src_y, bb, getOffset(pre, line)); |
| | | setPoint(line, conn.is_start?0:'end', pt.x, pt.y, true); |
| | | |
| | | |
| | | // Set point of connected element |
| | | var pt2 = getBBintersect(pt.x, pt.y, elData(line, alt_pre + '_bb'), getOffset(alt_pre, line)); |
| | | setPoint(line, conn.is_start?'end':0, pt2.x, pt2.y, true); |
| | | |
| | | |
| | | // Update points attribute manually for webkit |
| | | if(navigator.userAgent.indexOf('AppleWebKit') != -1) { |
| | | var pts = line.points; |
| | |
| | | for(var j=0; j< len; j++) { |
| | | var pt = pts.getItem(j); |
| | | pt_arr[j] = pt.x + ',' + pt.y; |
| | | } |
| | | line.setAttribute("points",pt_arr.join(" ")); |
| | | } |
| | | line.setAttribute("points",pt_arr.join(" ")); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | function getBBintersect(x, y, bb, offset) { |
| | | if(offset) { |
| | | offset -= 0; |
| | |
| | | bb.x -= offset/2; |
| | | bb.y -= offset/2; |
| | | } |
| | | |
| | | |
| | | var mid_x = bb.x + bb.width/2; |
| | | var mid_y = bb.y + bb.height/2; |
| | | var len_x = x - mid_x; |
| | | var len_y = y - mid_y; |
| | | |
| | | |
| | | var slope = Math.abs(len_y/len_x); |
| | | |
| | | |
| | | var ratio; |
| | | |
| | | |
| | | if(slope < bb.height/bb.width) { |
| | | ratio = (bb.width/2) / Math.abs(len_x); |
| | | } else { |
| | | ratio = (bb.height/2) / Math.abs(len_y); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | return { |
| | | x: mid_x + len_x * ratio, |
| | | y: mid_y + len_y * ratio |
| | | } |
| | | } |
| | | |
| | | |
| | | // Do once |
| | | (function() { |
| | | var gse = svgCanvas.groupSelectedElements; |
| | | |
| | | |
| | | svgCanvas.groupSelectedElements = function() { |
| | | svgCanvas.removeFromSelection($(conn_sel).toArray()); |
| | | return gse.apply(this, arguments); |
| | | } |
| | | |
| | | |
| | | var mse = svgCanvas.moveSelectedElements; |
| | | |
| | | |
| | | svgCanvas.moveSelectedElements = function() { |
| | | svgCanvas.removeFromSelection($(conn_sel).toArray()); |
| | | var cmd = mse.apply(this, arguments); |
| | | updateConnectors(); |
| | | return cmd; |
| | | } |
| | | |
| | | |
| | | se_ns = svgCanvas.getEditorNS(); |
| | | }()); |
| | | |
| | | |
| | | // Do on reset |
| | | function init() { |
| | | // Make sure all connectors have data set |
| | | $(svgcontent).find('*').each(function() { |
| | | $(svgcontent).find('*').each(function() { |
| | | var conn = this.getAttributeNS(se_ns, "connector"); |
| | | if(conn) { |
| | | this.setAttribute('class', conn_sel.substr(1)); |
| | |
| | | }); |
| | | // updateConnectors(); |
| | | } |
| | | |
| | | |
| | | // $(svgroot).parent().mousemove(function(e) { |
| | | // // if(started |
| | | // // if(started |
| | | // // || svgCanvas.getMode() != "connector" |
| | | // // || e.target.parentNode.parentNode != svgcontent) return; |
| | | // |
| | | // |
| | | // console.log('y') |
| | | // // if(e.target.parentNode.parentNode === svgcontent) { |
| | | // // |
| | | // // |
| | | // // } |
| | | // }); |
| | | |
| | | |
| | | return { |
| | | name: "Connector", |
| | | svgicons: "images/conn.svg", |
| | |
| | | start_x = opts.start_x, |
| | | start_y = opts.start_y; |
| | | var mode = svgCanvas.getMode(); |
| | | |
| | | |
| | | if(mode == "connector") { |
| | | |
| | | |
| | | if(started) return; |
| | | |
| | | |
| | | var mouse_target = e.target; |
| | | |
| | | |
| | | var parents = $(mouse_target).parents(); |
| | | |
| | | |
| | | if($.inArray(svgcontent, parents) != -1) { |
| | | // Connectable element |
| | | |
| | | |
| | | // If child of foreignObject, use parent |
| | | var fo = $(mouse_target).closest("foreignObject"); |
| | | start_elem = fo.length ? fo[0] : mouse_target; |
| | | |
| | | |
| | | // Get center of source element |
| | | var bb = svgCanvas.getStrokedBBox([start_elem]); |
| | | var x = bb.x + bb.width/2; |
| | | var y = bb.y + bb.height/2; |
| | | |
| | | |
| | | started = true; |
| | | cur_line = addElem({ |
| | | "element": "polyline", |
| | |
| | | var e = opts.event; |
| | | var x = opts.mouse_x/zoom; |
| | | var y = opts.mouse_y/zoom; |
| | | |
| | | |
| | | var diff_x = x - start_x, |
| | | diff_y = y - start_y; |
| | | |
| | | |
| | | var mode = svgCanvas.getMode(); |
| | | |
| | | |
| | | if(mode == "connector" && started) { |
| | | |
| | | |
| | | var sw = cur_line.getAttribute('stroke-width') * 3; |
| | | // Set start point (adjusts based on bb) |
| | | var pt = getBBintersect(x, y, elData(cur_line, 'start_bb'), getOffset('start', cur_line)); |
| | | start_x = pt.x; |
| | | start_y = pt.y; |
| | | |
| | | |
| | | setPoint(cur_line, 0, pt.x, pt.y, true); |
| | | |
| | | |
| | | // Set end point |
| | | setPoint(cur_line, 'end', x, y, true); |
| | | } else if(mode == "select") { |
| | | var slen = selElems.length; |
| | | |
| | | |
| | | while(slen--) { |
| | | var elem = selElems[slen]; |
| | | // Look for selected connector elements |
| | |
| | | if(connections.length) { |
| | | updateLine(diff_x, diff_y); |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | mouseUp: function(opts) { |
| | | var zoom = svgCanvas.getZoom(); |
| | |
| | | x = opts.mouse_x/zoom, |
| | | y = opts.mouse_y/zoom, |
| | | mouse_target = e.target; |
| | | |
| | | |
| | | if(svgCanvas.getMode() == "connector") { |
| | | var fo = $(mouse_target).closest("foreignObject"); |
| | | if(fo.length) mouse_target = fo[0]; |
| | | |
| | | |
| | | var parents = $(mouse_target).parents(); |
| | | |
| | | if(mouse_target == start_elem) { |
| | |
| | | keep: true, |
| | | element: null, |
| | | started: started |
| | | } |
| | | } |
| | | } else if($.inArray(svgcontent, parents) === -1) { |
| | | // Not a valid target element, so remove line |
| | | $(cur_line).remove(); |
| | |
| | | } else { |
| | | // Valid end element |
| | | end_elem = mouse_target; |
| | | |
| | | |
| | | var start_id = start_elem.id, end_id = end_elem.id; |
| | | var conn_str = start_id + " " + end_id; |
| | | var alt_str = end_id + " " + start_id; |
| | |
| | | started: false |
| | | } |
| | | } |
| | | |
| | | |
| | | var bb = svgCanvas.getStrokedBBox([end_elem]); |
| | | |
| | | |
| | | var pt = getBBintersect(start_x, start_y, bb, getOffset('start', cur_line)); |
| | | setPoint(cur_line, 'end', pt.x, pt.y, true); |
| | | $(cur_line) |
| | |
| | | selectedChanged: function(opts) { |
| | | // TODO: Find better way to skip operations if no connectors are in use |
| | | if(!$(svgcontent).find(conn_sel).length) return; |
| | | |
| | | |
| | | if(svgCanvas.getMode() == 'connector') { |
| | | svgCanvas.setMode('select'); |
| | | } |
| | | |
| | | |
| | | // Use this to update the current selected elements |
| | | selElems = opts.elems; |
| | | |
| | | |
| | | var i = selElems.length; |
| | | |
| | | |
| | | while(i--) { |
| | | var elem = selElems[i]; |
| | | if(elem && elData(elem, 'c_start')) { |
| | |
| | | svgcontent = elem; |
| | | init(); |
| | | } |
| | | |
| | | |
| | | // Has marker, so change offset |
| | | if(elem && ( |
| | | elem.getAttribute("marker-start") || |
| | |
| | | $(elem) |
| | | .data("start_off", !!start) |
| | | .data("end_off", !!end); |
| | | |
| | | |
| | | if(elem.tagName == "line" && mid) { |
| | | // Convert to polyline to accept mid-arrow |
| | | |
| | | |
| | | var x1 = elem.getAttribute('x1')-0; |
| | | var x2 = elem.getAttribute('x2')-0; |
| | | var y1 = elem.getAttribute('y1')-0; |
| | | var y2 = elem.getAttribute('y2')-0; |
| | | var id = elem.id; |
| | | |
| | | |
| | | var mid_pt = (' '+((x1+x2)/2)+','+((y1+y2)/2) + ' '); |
| | | var pline = addElem({ |
| | | "element": "polyline", |
| | |
| | | buttons: [{ |
| | | id: "tool_eyedropper", |
| | | type: "mode", |
| | | title: "吸管工具", |
| | | title: "Eye Dropper Tool", |
| | | position: 8, |
| | | key: "I", |
| | | icon: "extensions/eyedropper.png", |
| | |
| | | * |
| | | * Licensed under the Apache License, Version 2 |
| | | * |
| | | * Copyright(c) 2010 Jacques Distler |
| | | * Copyright(c) 2010 Alexis Deveria |
| | | * Copyright(c) 2010 Jacques Distler |
| | | * Copyright(c) 2010 Alexis Deveria |
| | | * |
| | | */ |
| | | |
| | |
| | | svgdoc = S.svgroot.parentNode.ownerDocument, |
| | | started, |
| | | newFO; |
| | | |
| | | |
| | | |
| | | |
| | | var properlySourceSizeTextArea = function(){ |
| | | // TODO: remove magic numbers here and get values from CSS |
| | | var height = $('#svg_source_container').height() - 80; |
| | |
| | | var fc_rules = $('#fc_rules'); |
| | | if(!fc_rules.length) { |
| | | fc_rules = $('<style id="fc_rules"><\/style>').appendTo('head'); |
| | | } |
| | | } |
| | | fc_rules.text(!on?"":" #tool_topath { display: none !important; }"); |
| | | $('#foreignObject_panel').toggle(on); |
| | | } |
| | |
| | | $('#tool_source_save, #tool_source_cancel').toggle(!on); |
| | | $('#foreign_save, #foreign_cancel').toggle(on); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // Function: setForeignString(xmlString, elt) |
| | | // This function sets the content of element elt to the input XML. |
| | | // |
| | |
| | | console.log(e); |
| | | return false; |
| | | } |
| | | |
| | | |
| | | return true; |
| | | }; |
| | | |
| | |
| | | properlySourceSizeTextArea(); |
| | | $('#svg_source_textarea').focus(); |
| | | } |
| | | |
| | | |
| | | function setAttr(attr, val) { |
| | | svgCanvas.changeSelectedAttribute(attr, val); |
| | | S.call("changed", selElems); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | return { |
| | | name: "foreignObject", |
| | | svgicons: "extensions/foreignobject-icons.xml", |
| | |
| | | } |
| | | } |
| | | }], |
| | | |
| | | |
| | | context_tools: [{ |
| | | type: "input", |
| | | panel: "foreignObject_panel", |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | ], |
| | | callback: function() { |
| | | $('#foreignObject_panel').hide(); |
| | |
| | | } |
| | | |
| | | // TODO: Needs to be done after orig icon loads |
| | | setTimeout(function() { |
| | | setTimeout(function() { |
| | | // Create source save/cancel buttons |
| | | var save = $('#tool_source_save').clone() |
| | | .hide().attr('id', 'foreign_save').unbind() |
| | | .appendTo("#tool_source_back").click(function() { |
| | | |
| | | |
| | | if (!editingforeign) return; |
| | | |
| | | if (!setForeignString($('#svg_source_textarea').val())) { |
| | |
| | | } else { |
| | | endChanges(); |
| | | } |
| | | // setSelectMode(); |
| | | // setSelectMode(); |
| | | }); |
| | | |
| | | |
| | | var cancel = $('#tool_source_cancel').clone() |
| | | .hide().attr('id', 'foreign_cancel').unbind() |
| | | .appendTo("#tool_source_back").click(function() { |
| | | endChanges(); |
| | | }); |
| | | |
| | | |
| | | }, 3000); |
| | | }, |
| | | mouseDown: function(opts) { |
| | | var e = opts.event; |
| | | |
| | | |
| | | if(svgCanvas.getMode() == "foreign") { |
| | | |
| | | started = true; |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | }, |
| | | selectedChanged: function(opts) { |
| | | // Use this to update the current selected elements |
| | | selElems = opts.elems; |
| | | |
| | | |
| | | var i = selElems.length; |
| | | |
| | | |
| | | while(i--) { |
| | | var elem = selElems[i]; |
| | | if(elem && elem.tagName == "foreignObject") { |
| | |
| | | $('#foreign_font_size').val(elem.getAttribute("font-size")); |
| | | $('#foreign_width').val(elem.getAttribute("width")); |
| | | $('#foreign_height').val(elem.getAttribute("height")); |
| | | |
| | | |
| | | showPanel(true); |
| | | } else { |
| | | showPanel(false); |
| | |
| | | var svgCanvas = methodDraw.canvas; |
| | | var showGrid = false; |
| | | var assignAttributes = s.assignAttributes; |
| | | |
| | | |
| | | var hcanvas = document.createElement('canvas'); |
| | | $(hcanvas).hide().appendTo('body'); |
| | | |
| | |
| | | 'overflow': 'visible', |
| | | 'display': 'none' |
| | | }); |
| | | |
| | | |
| | | var canvBG = $('#canvas_background'); |
| | | canvBG.after(canvasgrid); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // grid-pattern |
| | | var gridPattern = svgdoc.createElementNS(svgns, "pattern"); |
| | |
| | | 'width': 100, |
| | | 'height': 100 |
| | | }); |
| | | |
| | | |
| | | var gridimg = svgdoc.createElementNS(svgns, "image"); |
| | | assignAttributes(gridimg, { |
| | | 'x': 0, |
| | |
| | | 'width': 100, |
| | | 'height': 100 |
| | | }); |
| | | |
| | | |
| | | gridPattern.appendChild(gridimg); |
| | | $('#svgroot defs').append(gridPattern); |
| | | |
| | |
| | | |
| | | function updateGrid(zoom) { |
| | | // TODO: Try this with <line> elements, then compare performance difference |
| | | |
| | | |
| | | var bgwidth = +canvBG.attr('width'); |
| | | var bgheight = +canvBG.attr('height'); |
| | | |
| | | |
| | | var units = svgedit.units.getTypeMap(); |
| | | var unit = units[methodDraw.curConfig.baseUnit]; // 1 = 1px |
| | | var r_intervals = [.01, .1, 1, 10, 100, 1000]; |
| | | |
| | | |
| | | var d = 0; |
| | | var is_x = (d === 0); |
| | | var dim = is_x ? 'x' : 'y'; |
| | | var lentype = is_x?'width':'height'; |
| | | var c_elem = svgCanvas.getContentElem(); |
| | | var content_d = c_elem.getAttribute(dim)-0; |
| | | |
| | | |
| | | var hcanv = hcanvas; |
| | | |
| | | |
| | | var u_multi = unit * zoom; |
| | | |
| | | |
| | | // Calculate the main number interval |
| | | var raw_m = 100 / u_multi; |
| | | var multi = 1; |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | var big_int = multi * u_multi; |
| | | |
| | | // Set the canvas size to the width of the container |
| | |
| | | hcanv.height = big_int; |
| | | var ctx = hcanv.getContext("2d"); |
| | | |
| | | var ruler_d = 0; |
| | | var ruler_d = 0; |
| | | var cur_d = .5; |
| | | |
| | | |
| | | var part = big_int / 10; |
| | | |
| | | ctx.globalAlpha = 0.2; |
| | |
| | | ctx.lineTo(line_num ,sub_d); |
| | | } |
| | | ctx.stroke(); |
| | | ctx.beginPath(); |
| | | ctx.beginPath(); |
| | | ctx.globalAlpha = 0.5; |
| | | ctx.moveTo(cur_d, big_int); |
| | | ctx.lineTo(cur_d, 0); |
| | |
| | | * Copyright(c) 2010 Alexis Deveria |
| | | * |
| | | */ |
| | | |
| | | /* |
| | | |
| | | /* |
| | | This is a very basic SVG-Edit extension. It adds a "Hello World" button in |
| | | the left panel. Clicking on the button, and then the canvas will show the |
| | | user the point on the canvas that was clicked on. |
| | | */ |
| | | |
| | | |
| | | methodDraw.addExtension("Hello World", function() { |
| | | |
| | | return { |
| | |
| | | // For more notes on how to make an icon file, see the source of |
| | | // the hellorworld-icon.xml |
| | | svgicons: "extensions/helloworld-icon.xml", |
| | | |
| | | |
| | | // Multiple buttons can be added in this array |
| | | buttons: [{ |
| | | // Must match the icon ID in helloworld-icon.xml |
| | | id: "hello_world", |
| | | |
| | | id: "hello_world", |
| | | |
| | | // This indicates that the button will be added to the "mode" |
| | | // button panel on the left side |
| | | type: "mode", |
| | | |
| | | type: "mode", |
| | | |
| | | // Tooltip text |
| | | title: "Say 'Hello World'", |
| | | |
| | | title: "Say 'Hello World'", |
| | | |
| | | // Events |
| | | events: { |
| | | 'click': function() { |
| | | // The action taken when the button is clicked on. |
| | | // For "mode" buttons, any other button will |
| | | // For "mode" buttons, any other button will |
| | | // automatically be de-pressed. |
| | | svgCanvas.setMode("hello_world"); |
| | | } |
| | | } |
| | | }], |
| | | // This is triggered when the main mouse button is pressed down |
| | | // This is triggered when the main mouse button is pressed down |
| | | // on the editor canvas (not the tool panels) |
| | | mouseDown: function() { |
| | | // Check the mode on mousedown |
| | | if(svgCanvas.getMode() == "hello_world") { |
| | | |
| | | // The returned object must include "started" with |
| | | |
| | | // The returned object must include "started" with |
| | | // a value of true in order for mouseUp to be triggered |
| | | return {started: true}; |
| | | } |
| | | }, |
| | | |
| | | |
| | | // This is triggered from anywhere, but "started" must have been set |
| | | // to true (see above). Note that "opts" is an object with event info |
| | | mouseUp: function(opts) { |
| | | // Check the mode on mouseup |
| | | if(svgCanvas.getMode() == "hello_world") { |
| | | var zoom = svgCanvas.getZoom(); |
| | | |
| | | |
| | | // Get the actual coordinate by dividing by the zoom value |
| | | var x = opts.mouse_x / zoom; |
| | | var y = opts.mouse_y / zoom; |
| | | |
| | | var text = "Hello World!\n\nYou clicked here: " |
| | | |
| | | var text = "Hello World!\n\nYou clicked here: " |
| | | + x + ", " + y; |
| | | |
| | | |
| | | // Show the text using the custom alert function |
| | | $.alert(text); |
| | | } |
| | |
| | | methodDraw.addExtension("imagelib", function() { |
| | | |
| | | var uiStrings = methodDraw.uiStrings; |
| | | |
| | | |
| | | $.extend(uiStrings, { |
| | | imagelib: { |
| | | select_lib: 'Select an image library', |
| | |
| | | name: 'Demo library (local)', |
| | | url: 'extensions/imagelib/index.html', |
| | | description: 'Demonstration library for SVG-edit on this server' |
| | | }, |
| | | }, |
| | | { |
| | | name: 'IAN Symbol Libraries', |
| | | url: 'http://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php', |
| | | description: 'Free library of illustrations' |
| | | } |
| | | ]; |
| | | |
| | | |
| | | var xlinkns = "http://www.w3.org/1999/xlink"; |
| | | |
| | | function closeBrowser() { |
| | | $('#imgbrowse_holder').hide(); |
| | | } |
| | | |
| | | |
| | | function importImage(url) { |
| | | var newImage = svgCanvas.addSvgElementFromJson({ |
| | | "element": "image", |
| | |
| | | var cur_meta; |
| | | var tranfer_stopped = false; |
| | | var pending = {}; |
| | | |
| | | |
| | | window.addEventListener("message", function(evt) { |
| | | // Receive postMessage data |
| | | var response = evt.data; |
| | | |
| | | |
| | | if(!response) { |
| | | // Do nothing |
| | | return; |
| | | } |
| | | |
| | | |
| | | var char1 = response.charAt(0); |
| | | |
| | | |
| | | var svg_str; |
| | | var img_str; |
| | | |
| | | |
| | | if(char1 != "{" && tranfer_stopped) { |
| | | tranfer_stopped = false; |
| | | return; |
| | | } |
| | | |
| | | |
| | | if(char1 == '|') { |
| | | var secondpos = response.indexOf('|', 1); |
| | | var id = response.substr(1, secondpos-1); |
| | |
| | | char1 = response.charAt(0); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // Hide possible transfer dialog box |
| | | $('#dialog_box').hide(); |
| | | |
| | | |
| | | switch (char1) { |
| | | case '{': |
| | | // Metadata |
| | | tranfer_stopped = false; |
| | | var cur_meta = JSON.parse(response); |
| | | |
| | | |
| | | pending[cur_meta.id] = cur_meta; |
| | | |
| | | |
| | | var name = (cur_meta.name || 'file'); |
| | | |
| | | |
| | | var message = uiStrings.notification.retrieving.replace('%s', name); |
| | | |
| | | |
| | | if(mode != 'm') { |
| | | $.process_cancel(message, function() { |
| | | tranfer_stopped = true; |
| | | // Should a message be sent back to the frame? |
| | | |
| | | |
| | | $('#dialog_box').hide(); |
| | | }); |
| | | } else { |
| | |
| | | preview.append(entry); |
| | | cur_meta.entry = entry; |
| | | } |
| | | |
| | | |
| | | return; |
| | | case '<': |
| | | svg_str = true; |
| | |
| | | default: |
| | | // TODO: See if there's a way to base64 encode the binary data stream |
| | | // var str = 'data:;base64,' + svgCanvas.Utils.encode64(response, true); |
| | | |
| | | |
| | | // Assume it's raw image data |
| | | // importImage(str); |
| | | |
| | | |
| | | // Don't give warning as postMessage may have been used by something else |
| | | if(mode !== 'm') { |
| | | closeBrowser(); |
| | |
| | | // }); |
| | | return; |
| | | } |
| | | |
| | | |
| | | switch (mode) { |
| | | case 's': |
| | | // Import one |
| | |
| | | } else { |
| | | var entry = '<img src="' + response + '">'; |
| | | } |
| | | |
| | | |
| | | if(cur_meta) { |
| | | preview.children().each(function() { |
| | | if($(this).data('id') == id) { |
| | |
| | | break; |
| | | } |
| | | }, true); |
| | | |
| | | |
| | | var preview, submit; |
| | | |
| | | function toggleMulti(show) { |
| | | |
| | | |
| | | $('#lib_framewrap, #imglib_opts').css({right: (show ? 200 : 10)}); |
| | | if(!preview) { |
| | | preview = $('<div id=imglib_preview>').css({ |
| | |
| | | background: '#fff', |
| | | overflow: 'auto' |
| | | }).insertAfter('#lib_framewrap'); |
| | | |
| | | |
| | | submit = $('<button disabled>Import selected</button>').appendTo('#imgbrowse').click(function() { |
| | | $.each(multi_arr, function(i) { |
| | | var type = this[0]; |
| | |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | preview.toggle(show); |
| | | submit.toggle(show); |
| | | } |
| | |
| | | |
| | | var lib_opts = $('<ul id=imglib_opts>').appendTo(browser); |
| | | var frame = $('<iframe/>').prependTo(browser).hide().wrap('<div id=lib_framewrap>'); |
| | | |
| | | |
| | | var header = $('<h1>').prependTo(browser).text(all_libs).css({ |
| | | position: 'absolute', |
| | | top: 0, |
| | | left: 0, |
| | | width: '100%' |
| | | }); |
| | | |
| | | |
| | | var cancel = $('<button>' + uiStrings.common.cancel + '</button>').appendTo(browser).click(function() { |
| | | $('#imgbrowse_holder').hide(); |
| | | }).css({ |
| | |
| | | top: 5, |
| | | right: -10 |
| | | }); |
| | | |
| | | |
| | | var leftBlock = $('<span>').css({position:'absolute',top:5,left:10}).appendTo(browser); |
| | | |
| | | |
| | | var back = $('<button hidden>' + uiStrings.imagelib.show_list + '</button>').appendTo(leftBlock).click(function() { |
| | | frame.attr('src', 'about:blank').hide(); |
| | | lib_opts.show(); |
| | |
| | | }).css({ |
| | | 'margin-right': 5 |
| | | }).hide(); |
| | | |
| | | var type = $('<select><option value=s>' + |
| | | |
| | | var type = $('<select><option value=s>' + |
| | | uiStrings.imagelib.import_single + '</option><option value=m>' + |
| | | uiStrings.imagelib.import_multi + '</option><option value=o>' + |
| | | uiStrings.imagelib.open + '</option></select>').appendTo(leftBlock).change(function() { |
| | |
| | | case 'o': |
| | | toggleMulti(false); |
| | | break; |
| | | |
| | | |
| | | case 'm': |
| | | // Import multiple |
| | | toggleMulti(true); |
| | |
| | | }).css({ |
| | | 'margin-top': 10 |
| | | }); |
| | | |
| | | |
| | | cancel.prepend($.getSvgIcon('cancel', true)); |
| | | back.prepend($.getSvgIcon('tool_imagelib', true)); |
| | | |
| | | |
| | | $.each(img_libs, function(i, opts) { |
| | | $('<li>').appendTo(lib_opts).text(opts.name).click(function() { |
| | | frame.attr('src', opts.url).show(); |
| | |
| | | back.show(); |
| | | }).append('<span>' + opts.description + '</span>'); |
| | | }); |
| | | |
| | | |
| | | } else { |
| | | $('#imgbrowse_holder').show(); |
| | | } |
| | | } |
| | | |
| | | |
| | | return { |
| | | buttons: [{ |
| | | id: "tool_imagelib", |
| | |
| | | } |
| | | }], |
| | | callback: function() { |
| | | |
| | | |
| | | $('<style>').text('\ |
| | | #imgbrowse_holder {\ |
| | | position: absolute;\ |
| | |
| | | </g> |
| | | </svg> |
| | | </g> |
| | | </svg> |
| | | </svg> |
| | |
| | | * |
| | | * Licensed under the Apache License, Version 2 |
| | | * |
| | | * Copyright(c) 2010 Will Schleter |
| | | * Copyright(c) 2010 Will Schleter |
| | | * based on ext-arrows.js by Copyright(c) 2010 Alexis Deveria |
| | | * |
| | | * This extension provides for the addition of markers to the either end |
| | | * or the middle of a line, polyline, path, polygon. |
| | | * |
| | | * or the middle of a line, polyline, path, polygon. |
| | | * |
| | | * Markers may be either a graphic or arbitary text |
| | | * |
| | | * |
| | | * to simplify the coding and make the implementation as robust as possible, |
| | | * markers are not shared - every object has its own set of markers. |
| | | * this relationship is maintained by a naming convention between the |
| | | * ids of the markers and the ids of the object |
| | | * |
| | | * |
| | | * The following restrictions exist for simplicty of use and programming |
| | | * objects and their markers to have the same color |
| | | * marker size is fixed |
| | | * text marker font, size, and attributes are fixed |
| | | * an application specific attribute - se_type - is added to each marker element |
| | | * to store the type of marker |
| | | * |
| | | * |
| | | * TODO: |
| | | * remove some of the restrictions above |
| | | * add option for keeping text aligned to horizontal |
| | |
| | | |
| | | var marker_prefix = 'se_marker_'; |
| | | var id_prefix = 'mkr_'; |
| | | |
| | | |
| | | // note - to add additional marker types add them below with a unique id |
| | | // and add the associated icon(s) to marker-icons.svg |
| | | // the geometry is normallized to a 100x100 box with the origin at lower left |
| | | // Safari did not like negative values for low left of viewBox |
| | | // remember that the coordinate system has +y downward |
| | | var marker_types = { |
| | | nomarker: {}, |
| | | leftarrow: |
| | | nomarker: {}, |
| | | leftarrow: |
| | | {element:'path', attr:{d:'M0,50 L100,90 L70,50 L100,10 Z'}}, |
| | | rightarrow: |
| | | {element:'path', attr:{d:'M100,50 L0,90 L30,50 L0,10 Z'}}, |
| | |
| | | mcircle: |
| | | {element:'circle', attr:{r:30, cx:50, cy:50}} |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | var lang_list = { |
| | | "en":[ |
| | | {id: "start_marker_list", title: "Select start marker type" }, |
| | |
| | | $.each(['leftarrow','rightarrow','box','star','mcircle','triangle'],function(i,v) { |
| | | marker_types[v+'_o'] = marker_types[v]; |
| | | }); |
| | | |
| | | |
| | | // elem = a graphic element will have an attribute like marker-start |
| | | // attr - marker-start, marker-mid, or marker-end |
| | | // returns the marker element that is linked to the graphic element |
| | |
| | | txtbox.hide() // hide text box |
| | | } |
| | | } |
| | | txtbox.val(val); |
| | | txtbox.val(val); |
| | | setIcon(pos,ci); |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | | function addMarker(id, val) { |
| | | var txt_box_bg = '#ffffff'; |
| | | var txt_box_border = 'none'; |
| | | var txt_box_stroke_width = 0; |
| | | |
| | | |
| | | var marker = S.getElem(id); |
| | | |
| | | if (marker) return; |
| | | |
| | | if (val=='' || val=='\\nomarker') return; |
| | | |
| | | var el = selElems[0]; |
| | | var el = selElems[0]; |
| | | var color = el.getAttribute('stroke'); |
| | | //NOTE: Safari didn't like a negative value in viewBox |
| | | //so we use a standardized 0 0 100 100 |
| | |
| | | else se_type='textmarker'; |
| | | |
| | | if (!marker_types[se_type]) return; // an unknown type! |
| | | |
| | | |
| | | // create a generic marker |
| | | marker = addElem({ |
| | | "element": "marker", |
| | |
| | | marker.setAttribute("orient",0); |
| | | marker.appendChild(box); |
| | | marker.appendChild(text); |
| | | } |
| | | } |
| | | |
| | | marker.setAttribute("viewBox",viewBox); |
| | | marker.setAttribute("markerWidth", markerWidth); |
| | |
| | | var m = elem.getAttribute(nam); |
| | | if (m) pline.setAttribute(nam,elem.getAttribute(nam)); |
| | | }); |
| | | |
| | | |
| | | var batchCmd = new S.BatchCommand(); |
| | | batchCmd.addSubCommand(new S.RemoveElementCommand(elem, elem.parentNode)); |
| | | batchCmd.addSubCommand(new S.InsertElementCommand(pline)); |
| | | |
| | | |
| | | $(elem).after(pline).remove(); |
| | | svgCanvas.clearSelection(); |
| | | pline.id = id; |
| | |
| | | //if (val.substr(0,1)=='\\') txtbox.hide(); |
| | | //else txtbox.show(); |
| | | } |
| | | |
| | | |
| | | function setIcon(pos,id) { |
| | | if (id.substr(0,1)!='\\') id='\\textmarker' |
| | | var ci = '#'+id_prefix+pos+'_'+id.substr(1); |
| | | methodDraw.setIcon('#cur_' + pos +'_marker_list', $(ci).children()); |
| | | $(ci).addClass('current').siblings().removeClass('current'); |
| | | } |
| | | |
| | | |
| | | function setMarkerSet(obj) { |
| | | var parts = this.id.split('_'); |
| | | var set = parts[2]; |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | function showTextPrompt(pos) { |
| | | var def = $('#'+pos+'_marker').val(); |
| | | if (def.substr(0,1)=='\\') def=''; |
| | | $.prompt('Enter text for ' + pos + ' marker', def , function(txt) { if (txt) triggerTextEntry(pos,txt); }); |
| | | } |
| | | |
| | | |
| | | // callback function for a toolbar button click |
| | | function setArrowFromButton(obj) { |
| | | |
| | | |
| | | var parts = this.id.split('_'); |
| | | var pos = parts[1]; |
| | | var val = parts[2]; |
| | | if (parts[3]) val+='_'+parts[3]; |
| | | |
| | | |
| | | if (val!='textmarker') { |
| | | triggerTextEntry(pos,'\\'+val); |
| | | } else { |
| | | showTextPrompt(pos); |
| | | } |
| | | } |
| | | |
| | | |
| | | function getTitle(lang,id) { |
| | | var list = lang_list[lang]; |
| | | for (var i in list) { |
| | |
| | | } |
| | | return id; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // build the toolbar button array from the marker definitions |
| | | // TODO: need to incorporate language specific titles |
| | | function buildButtonList() { |
| | |
| | | } ], |
| | | callback: function() { |
| | | $('#marker_panel').addClass('toolset').hide(); |
| | | |
| | | |
| | | }, |
| | | addLangData: function(lang) { |
| | | return { data: lang_list[lang] }; |
| | |
| | | } |
| | | }, |
| | | |
| | | elementChanged: function(opts) { |
| | | elementChanged: function(opts) { |
| | | //console.log('elementChanged',opts); |
| | | var elem = opts.elems[0]; |
| | | if(elem && ( |
| | |
| | | callback: function() { |
| | | |
| | | var save_svg_action = '/+modify'; |
| | | |
| | | |
| | | // Create upload target (hidden iframe) |
| | | var target = $('<iframe name="output_frame" src="#"/>').hide().appendTo('body'); |
| | | |
| | | |
| | | methodDraw.setCustomHandlers({ |
| | | save: function(win, data) { |
| | | var svg = "<?xml version=\"1.0\"?>\n" + data; |
| | |
| | | top.window.location = '/'+name; |
| | | }, |
| | | }); |
| | | |
| | | |
| | | } |
| | | }); |
| | | |
| | |
| | | |
| | | //var save_svg_action = 'extensions/filesave.php'; |
| | | //var save_png_action = 'extensions/filesave.php'; |
| | | |
| | | |
| | | // Create upload target (hidden iframe) |
| | | var target = $('<iframe name="output_frame" />').hide().appendTo('body'); |
| | | |
| | | |
| | | //methodDraw.setCustomHandlers({ |
| | | // save: function(win, data) { |
| | | // var svg = "<?xml version=\"1.0\"?>\n" + data; |
| | | // |
| | | // |
| | | // var title = svgCanvas.getDocumentTitle(); |
| | | // var filename = title.replace(/[^a-z0-9\.\_\-]+/gi, '_'); |
| | | // |
| | | // |
| | | // var form = $('<form>').attr({ |
| | | // method: 'post', |
| | | // action: save_svg_action, |
| | |
| | | // }, |
| | | // pngsave: function(win, data) { |
| | | // var issues = data.issues; |
| | | // |
| | | // |
| | | // if(!$('#export_canvas').length) { |
| | | // $('<canvas>', {id: 'export_canvas'}).hide().appendTo('body'); |
| | | // } |
| | | // var c = $('#export_canvas')[0]; |
| | | // |
| | | // |
| | | // c.width = svgCanvas.contentW; |
| | | // c.height = svgCanvas.contentH; |
| | | // canvg(c, data.svg, {renderCallback: function() { |
| | | // var datauri = c.toDataURL('image/png'); |
| | | // |
| | | // |
| | | // var uiStrings = methodDraw.uiStrings; |
| | | // var note = ''; |
| | | // |
| | | // |
| | | // // Check if there's issues |
| | | // if(issues.length) { |
| | | // var pre = "\n \u2022 "; |
| | | // note += ("\n\n" + pre + issues.join(pre)); |
| | | // } |
| | | // |
| | | // } |
| | | // |
| | | // if(note.length) { |
| | | // alert(note); |
| | | // } |
| | | // |
| | | // |
| | | // var title = svgCanvas.getDocumentTitle(); |
| | | // var filename = title.replace(/[^a-z0-9\.\_\-]+/gi, '_'); |
| | | // |
| | | // |
| | | // var form = $('<form>').attr({ |
| | | // method: 'post', |
| | | // action: save_png_action, |
| | |
| | | // .submit().remove(); |
| | | // }}); |
| | | // |
| | | // |
| | | // |
| | | // } |
| | | //}); |
| | | |
| | | |
| | | // Do nothing if client support is found |
| | | if(window.FileReader) return; |
| | | |
| | | |
| | | var cancelled = false; |
| | | |
| | | |
| | | // Change these to appropriate script file |
| | | var open_svg_action = 'extensions/fileopen.php?type=load_svg'; |
| | | var import_svg_action = 'extensions/fileopen.php?type=import_svg'; |
| | | var import_img_action = 'extensions/fileopen.php?type=import_img'; |
| | | |
| | | |
| | | // Set up function for PHP uploader to use |
| | | methodDraw.processFile = function(str64, type) { |
| | | if(cancelled) { |
| | | cancelled = false; |
| | | return; |
| | | } |
| | | |
| | | |
| | | $('#dialog_box').hide(); |
| | | |
| | | |
| | | if(type != 'import_img') { |
| | | var xmlstr = svgCanvas.Utils.decode64(str64); |
| | | } |
| | | |
| | | |
| | | switch ( type ) { |
| | | case 'load_svg': |
| | | svgCanvas.clear(); |
| | |
| | | break; |
| | | case 'import_svg': |
| | | svgCanvas.importSvgString(xmlstr); |
| | | methodDraw.updateCanvas(); |
| | | methodDraw.updateCanvas(); |
| | | break; |
| | | case 'import_img': |
| | | svgCanvas.setGoodImage(str64); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | // Create upload form |
| | | var open_svg_form = $('<form>'); |
| | | open_svg_form.attr({ |
| | |
| | | action: open_svg_action, |
| | | target: 'output_frame' |
| | | }); |
| | | |
| | | |
| | | // Create import form |
| | | var import_svg_form = open_svg_form.clone().attr('action', import_svg_action); |
| | | |
| | | |
| | | // Create image form |
| | | var import_img_form = open_svg_form.clone().attr('action', import_img_action); |
| | | |
| | | // It appears necessory to rebuild this input every time a file is |
| | | |
| | | // It appears necessory to rebuild this input every time a file is |
| | | // selected so the same file can be picked and the change event can fire. |
| | | function rebuildInput(form) { |
| | | form.empty(); |
| | | var inp = $('<input type="file" name="svg_file">').appendTo(form); |
| | | |
| | | |
| | | |
| | | |
| | | function submit() { |
| | | // This submits the form, which returns the file data using methodDraw.uploadSVG |
| | | form.submit(); |
| | | |
| | | |
| | | rebuildInput(form); |
| | | $.process_cancel("Uploading...", function() { |
| | | cancelled = true; |
| | | $('#dialog_box').hide(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | if(form[0] == open_svg_form[0]) { |
| | | inp.change(function() { |
| | | // This takes care of the "are you sure" dialog box |
| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | // Create the input elements |
| | | rebuildInput(open_svg_form); |
| | | rebuildInput(import_svg_form); |
| | |
| | | |
| | | // This populates the category list |
| | | var categories = { |
| | | basic: '基本', |
| | | object: '物体', |
| | | symbol: '符号', |
| | | arrow: '箭头', |
| | | flowchart: '流程图', |
| | | nature: '自然', |
| | | game: '纸牌与象棋', |
| | | dialog_balloon: '对话框', |
| | | music: '音乐', |
| | | weather: '天气与时间', |
| | | ui: '用户接口', |
| | | social: '社交网络' |
| | | basic: 'Basic', |
| | | object: 'Objects', |
| | | symbol: 'Symbols', |
| | | arrow: 'Arrows', |
| | | flowchart: 'Flowchart', |
| | | nature: 'Nature', |
| | | game: 'Cards & Chess', |
| | | dialog_balloon: 'Dialog balloons', |
| | | music: 'Music', |
| | | weather: 'Weather & Time', |
| | | ui: 'User Interface', |
| | | social: 'Social Web' |
| | | }; |
| | | |
| | | var library = { |
| | |
| | | 'heart': 'm150,73c61,-175 300,0 0,225c-300,-225 -61,-400 0,-225z', |
| | | "cylinder": "m299.0007,83.77844c0,18.28676 -66.70958,33.11111 -149.00002,33.11111m149.00002,-33.11111l0,0c0,18.28676 -66.70958,33.11111 -149.00002,33.11111c-82.29041,0 -148.99997,-14.82432 -148.99997,-33.11111m0,0l0,0c0,-18.28674 66.70956,-33.1111 148.99997,-33.1111c82.29044,0 149.00002,14.82436 149.00002,33.1111l0,132.44449c0,18.28674 -66.70958,33.11105 -149.00002,33.11105c-82.29041,0 -148.99997,-14.82431 -148.99997,-33.11105z", |
| | | "arrow_up": "m1.49805,149.64304l148.50121,-148.00241l148.50121,148.00241l-74.25061,0l0,148.71457l-148.5012,0l0,-148.71457z", |
| | | "arrow_u_turn": "m1.00059,299.00055l0,-167.62497l0,0c0,-72.00411 58.37087,-130.37499 130.375,-130.37499l0,0l0,0c34.57759,0 67.73898,13.7359 92.18906,38.18595c24.45006,24.45005 38.18593,57.61144 38.18593,92.18904l0,18.625l37.24997,0l-74.49995,74.50002l-74.50002,-74.50002l37.25,0l0,-18.625c0,-30.8589 -25.0161,-55.87498 -55.87498,-55.87498l0,0l0,0c-30.85892,0 -55.875,25.01608 -55.875,55.87498l0,167.62497z", |
| | | "arrow_left_up": "m0.99865,224.5l74.50004,-74.5l0,37.25l111.74991,0l0,-111.75l-37.25,0l74.5,-74.5l74.5,74.5l-37.25,0l0,186.25l-186.24989,0l0,37.25l-74.50005,-74.5z", |
| | | "piping_left": "m61.06297,135.21906c1.26516,30.57214 1.45736,47.83058 49.70693,48.17825c48.24958,0.34766 84.79024,-0.96742 117.29734,-2.05798c32.5071,-1.09057 42.57196,-6.82504 39.75187,-89.83523l29.71009,-0.09174c4.15832,110.21703 -16.27162,115.96341 -62.08326,119.84398c-45.81163,3.88059 -122.9577,2.75494 -155.18351,0.85096c-32.2258,-1.90396 -49.88012,-29.62204 -49.71715,-67.06613c0.16297,-37.4441 -12.64439,-27.42789 -29.18351,-30.51291l-0.30561,-24.87842c49.64155,-5.12952 58.74164,14.99708 60.0068,45.56922l0,-0.00002l0.00001,0.00001l0,0.00001z", |
| | | "piping_right": "m34.77162,144.78038c1.93502,23.59007 0.90063,36.98668 51.7728,39.12084c50.87217,2.13416 49.3661,0.20868 95.80745,0.31737c46.44135,0.10868 46.80596,-16.26537 50.39204,-41.13127c3.58607,-24.8659 9.89537,-41.12805 16.9583,-45.07714c7.06293,-3.94908 26.20271,-3.41801 47.83801,-1.96183l-0.56549,21.42594c-1.95665,3.6252 -32.45161,-7.98981 -32.68677,30.50966c-0.23516,38.49947 -15.74948,61.56741 -84.43714,63.72421c-68.68766,2.15681 -34.0838,1.55507 -97.51854,-0.36787c-63.43474,-1.92294 -79.51644,-17.24319 -79.3467,-58.58433c0.16974,-41.34115 0.12119,-45.63576 -0.32767,-49.13504l30.73149,0.18025c0.17338,20.1933 -0.5528,17.38914 1.38222,40.97921z", |
| | | "curve_1": "m12.99218,75.18742c-21.79909,161.7324 270.03537,128.87978 281.3936,129.5404", |
| | | "curve_2": "m9.70598,97.53259c60.4983,112.24893 204.38633,128.61647 275.93837,-0.52493", |
| | | "S-shaped_arc": "m177.40301,7.84547c-107.70811,-0.87963 -95.07584,134.96412 -25.7545,143.11086c69.32135,8.14675 89.64716,119.18795 -27.73838,144.46005", |
| | | "anti_S-shaped_arc": "m133.54237,3.90583c113.54352,-2.11252 100.59557,128.86359 8.96395,144.70747c-91.63162,15.84388 -77.68768,149.98876 37.54903,146.81995", |
| | | "plaque": "m-0.00197,49.94376l0,0c27.5829,0 49.94327,-22.36036 49.94327,-49.94327l199.76709,0l0,0c0,27.5829 22.36037,49.94327 49.94325,49.94327l0,199.7671l0,0c-27.58289,0 -49.94325,22.36034 -49.94325,49.94325l-199.76709,0c0,-27.58292 -22.36037,-49.94325 -49.94327,-49.94325z", |
| | | "page": "m249.3298,298.99744l9.9335,-39.73413l39.73413,-9.93355l-49.66763,49.66768l-248.33237,0l0,-298.00001l298.00001,0l0,248.33234", |
| | | "cross": "m0.99844,99.71339l98.71494,0l0,-98.71495l101.26279,0l0,98.71495l98.71495,0l0,101.2628l-98.71495,0l0,98.71494l-101.26279,0l0,-98.71494l-98.71494,0z", |
| | |
| | | var shape_cats = $('<div id="shape_cats">'); |
| | | var cat_str = ''; |
| | | |
| | | $.each(categories, function(id, label) { |
| | | cat_str += '<div data-cat=' + id + '>' + label + '</div>'; |
| | | }); |
| | | // $.each(categories, function(id, label) { |
| | | // cat_str += '<div data-cat=' + id + '>' + label + '</div>'; |
| | | // }); |
| | | |
| | | shape_cats.html(cat_str).children().bind('mouseup', function() { |
| | | var catlink = $(this); |
| | |
| | | l3.445-6.979l3.447,6.98l7.702,1.121l-5.573,5.434L20.328,24.166z"/> |
| | | </svg> |
| | | </g> |
| | | </svg> |
| | | </svg> |
| | |
| | | l-2.5,2.482l0.167,0.166c0.46,0.457,0.46,1.197,0,1.655l-1.5,1.489c-0.46,0.456-1.207,0.456-1.667,0l-0.333-0.332L7.708,22.809l-0.223,0.037c-1.787,0.296-3.805,1.978-3.826,1.995l-0.496,0.417L2.702,24.801z"/> |
| | | </svg> |
| | | </g> |
| | | |
| | | |
| | | <g id="svg_eof"/> |
| | | </svg> |
| | | </svg> |
| | |
| | | */ |
| | | // Very minimal PHP file, all we do is Base64 encode the uploaded file and |
| | | // return it to the editor |
| | | |
| | | |
| | | $file = $_FILES['svg_file']['tmp_name']; |
| | | |
| | | |
| | | $output = file_get_contents($file); |
| | | |
| | | |
| | | $type = $_REQUEST['type']; |
| | | |
| | | |
| | | $prefix = ''; |
| | | |
| | | |
| | | // Make Data URL prefix for import image |
| | | if($type == 'import_img') { |
| | | $info = getimagesize($file); |
| | |
| | | * Copyright(c) 2010 Alexis Deveria |
| | | * |
| | | */ |
| | | |
| | | |
| | | if(!isset($_POST['output_svg']) && !isset($_POST['output_png'])) { |
| | | die('post fail'); |
| | | } |
| | |
| | | header("Content-Disposition: attachment; filename=" . $file); |
| | | header("Content-Type: " . $mime); |
| | | header("Content-Transfer-Encoding: binary"); |
| | | |
| | | |
| | | echo $contents; |
| | | |
| | | ?> |
| | | |
| | | ?> |
| | |
| | | </g> |
| | | </svg> |
| | | </g> |
| | | |
| | | |
| | | <g id="edit_foreign"> |
| | | <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="34 38 170 170" overflow="hidden"> |
| | | <g fill="#000088"> |
| | |
| | | </g> |
| | | </svg> |
| | | </g> |
| | | |
| | | |
| | | <g id="svg_eof"/> |
| | | </svg> |
| | | </svg> |
| | |
| | | <svg xmlns="http://www.w3.org/2000/svg"> |
| | | <!-- |
| | | <!-- |
| | | Sample icons file. This file looks like an SVG file with groups as its |
| | | children. Each group element has an ID that must match the ID of the button given |
| | | in the extension. The SVG inside the group makes up the actual icon, and |
| | | needs use a viewBox instead of width/height for it to scale properly. |
| | | |
| | | |
| | | Multiple icons can be included, each within their own group. |
| | | --> |
| | | <g id="view_grid"> |
| | |
| | | <svg xmlns="http://www.w3.org/2000/svg"> |
| | | <!-- |
| | | <!-- |
| | | Sample icons file. This file looks like an SVG file with groups as its |
| | | children. Each group element has an ID that must match the ID of the button given |
| | | in the extension. The SVG inside the group makes up the actual icon, and |
| | | needs use a viewBox instead of width/height for it to scale properly. |
| | | |
| | | |
| | | Multiple icons can be included, each within their own group. |
| | | --> |
| | | <g id="hello_world"> |
| | |
| | | </g> |
| | | </svg> |
| | | </g> |
| | | </svg> |
| | | </svg> |
| | |
| | | $('a').click(function() { |
| | | var href = this.href; |
| | | var target = window.parent; |
| | | // Convert Non-SVG images to data URL first |
| | | // Convert Non-SVG images to data URL first |
| | | // (this could also have been done server-side by the library) |
| | | if(this.href.indexOf('.svg') === -1) { |
| | | |
| | |
| | | id: href |
| | | }); |
| | | target.postMessage(meta_str, "*"); |
| | | |
| | | |
| | | var img = new Image(); |
| | | img.onload = function() { |
| | | var canvas = document.createElement("canvas"); |
| | |
| | | data = '|' + href + '|' + data; |
| | | // This is where the magic happens! |
| | | target.postMessage(data, "*"); |
| | | |
| | | |
| | | }, 'html'); // 'html' is necessary to keep returned data as a string |
| | | } |
| | | return false; |
| | |
| | | <stop stop-color="#ffff00" offset="1"/> |
| | | </linearGradient> |
| | | </defs> |
| | | </svg> |
| | | </svg> |
| | |
| | | </g> |
| | | <g id="textmarker"> |
| | | <svg viewBox="-60 -60 120 120" xmlns="http://www.w3.org/2000/svg"> |
| | | <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="120" y="40" x="0" stroke-width="0" stroke="#ff7f00" fill="#ff7f00">T</text> |
| | | <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="120" y="40" x="0" stroke-width="0" stroke="#ff7f00" fill="#ff7f00">T</text> |
| | | </svg> |
| | | </g> |
| | | <g id="mkr_markers_off"> |
| | |
| | | "u_turn": "m1.00059,299.00055l0,-167.62497l0,0c0,-72.00411 58.37087,-130.37499 130.375,-130.37499l0,0l0,0c34.57759,0 67.73898,13.7359 92.18906,38.18595c24.45006,24.45005 38.18593,57.61144 38.18593,92.18904l0,18.625l37.24997,0l-74.49995,74.50002l-74.50002,-74.50002l37.25,0l0,-18.625c0,-30.8589 -25.0161,-55.87498 -55.87498,-55.87498l0,0l0,0c-30.85892,0 -55.875,25.01608 -55.875,55.87498l0,167.62497z", |
| | | "up": "m1.49805,149.64304l148.50121,-148.00241l148.50121,148.00241l-74.25061,0l0,148.71457l-148.5012,0l0,-148.71457z", |
| | | "3_ways": "m1,159.61292l52.87097,-52.87097l0,26.43549l69.69355,0l0,-79.30646l-26.43549,0l52.87096,-52.87097l52.87097,52.87097l-26.43549,0l0,79.30646l69.69356,0l0,-26.43549l52.87096,52.87097l-52.87096,52.87097l0,-26.43549l-192.25807,0l0,26.43549l-52.87097,-52.87097z", |
| | | |
| | | |
| | | "maximize_2": "m1,149.99998l67.05,-67.05l0,33.52501l48.425,0l0,-48.425l-33.52501,0l67.05,-67.05l67.04999,67.05l-33.52499,0l0,48.425l48.42502,0l0,-33.52501l67.04997,67.05l-67.04997,67.04999l0,-33.52499l-48.42502,0l0,48.42502l33.52499,0l-67.04999,67.04997l-67.05,-67.04997l33.52501,0l0,-48.42502l-48.425,0l0,33.52499l-67.05,-67.04999z", |
| | | "raph_download": "m149.92238,36.82233c-65.72484,0 -119.00005,53.27818 -119.00005,119c0,65.72183 53.27521,119 119.00005,119c65.7218,0 118.99995,-53.27817 118.99995,-119c0,-65.72182 -53.27815,-119 -118.99995,-119zm0,223.73889c-12.68407,0 -22.97548,-10.28841 -22.97548,-22.97537s10.28215,-22.97583 22.97548,-22.97583c12.69009,0 22.97223,10.28247 22.97223,22.97583s-10.28214,22.97537 -22.97223,22.97537zm0,-63.08578l-64.34113,-53.72815l28.40379,0l0,-71.87465l71.88103,0l0,71.87465l28.39413,0l-64.33783,53.72815z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "raph_talkq": "m151.95413,37.83469c-77.87229,0 -140.99913,47.34782 -140.99913,105.75328c0,19.94707 7.46298,38.60376 20.30468,54.52449l-20.30468,44.51276l56.5302,-14.49918c23.55888,13.25453 52.74399,21.2072 84.46893,21.2072c77.87204,0 141.00085,-47.3481 141.00085,-105.74527s-63.12881,-105.75328 -141.00085,-105.75328zm8.74214,165.54159l-19.83006,0l0,-19.02583l19.83006,0l0,19.02583zm-0.96628,-33.04105l-17.89746,0l-1.77126,-81.41087l21.28053,0l-1.61182,81.41087z", |
| | | "raph_talke": "m151.46997,37.82469c-78.14881,0 -141.49997,47.50852 -141.49997,106.12126c0,20.02579 7.4895,38.74088 20.37584,54.71835l-20.37584,44.67868l56.73113,-14.55873c23.6405,13.30168 52.9314,21.29042 84.76884,21.29042c78.149,0 141.50003,-47.51628 141.50003,-106.12872s-63.35103,-106.12126 -141.50003,-106.12126zm9.92621,166.12944l-19.90253,0l0,-19.09268l19.90253,0l0,19.09268zm0,-39.48112l0,6.31543l-19.90253,0l0,-7.77286c0,-23.45735 26.69424,-27.17406 26.69424,-43.83023c0,-7.60336 -6.79172,-13.43297 -15.69612,-13.43297c-9.21872,0 -17.31352,6.79367 -17.31352,6.79367l-11.32195,-14.0807c0,0 11.15999,-11.65153 30.41292,-11.65153c18.29469,0 35.27467,11.32766 35.27467,30.41285c0.0097,26.71156 -28.14772,29.78053 -28.14772,47.24634z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "punched_tape": "m1.00047,30.80047l0,0c0,16.45808 33.35479,29.8 74.50001,29.8c41.1452,0 74.49998,-13.34192 74.49998,-29.8l0,0c0,-16.45809 33.3548,-29.8 74.50002,-29.8c41.14522,0 74.49998,13.34192 74.49998,29.8l0,238.4c0,-16.45808 -33.35477,-29.80002 -74.49998,-29.80002c-41.14522,0 -74.50002,13.34193 -74.50002,29.80002c0,16.45807 -33.35478,29.79999 -74.49998,29.79999c-41.14522,0 -74.50001,-13.34192 -74.50001,-29.79999z", |
| | | "wave": "m1,37.20809c99.33355,-125.42461 198.66708,125.4246 298.00061,0l0,225.76426c-99.33353,125.42462 -198.66706,-125.42459 -298.00061,0z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "chess_queen": "m59.54884,298.46313c-11.18457,2.51251 -19.80814,-14.30008 -5.94004,-16.129c12.20336,0.23074 -3.0349,-11.94995 7.98012,-16.05304c12.67021,-12.36537 25.23749,-25.26018 33.3575,-41.17609c-4.09126,-5.42482 -10.84344,-10.60782 -9.96117,-18.03085c7.964,-2.71161 19.82806,-0.87375 20.29981,-13.44502c7.24239,-22.68985 9.1741,-46.67986 10.76167,-70.3136c-7.99255,-6.33596 -24.45116,-0.33371 -35.62089,-3.56097c-16.94488,-4.5746 6.31873,-13.33291 13.78075,-12.6113c6.70493,0.01006 16.63324,-4.12222 5.41084,-7.2804c9.46686,-0.43687 23.08297,-12.44518 7.51486,-16.77373c11.54188,-8.28655 2.64816,-26.31929 -2.17102,-36.68976c-7.265,-12.52285 -19.21146,-21.59242 -32.71435,-26.42871c-2.18616,-12.77 18.63421,-8.99565 27.07909,-9.65835c12.78728,0.48775 25.82639,-0.15282 36.96732,-7.11507c15.05278,-6.96464 27.8495,4.65901 41.61934,7.11611c13.92807,0.89699 28.41634,-2.50577 41.97807,1.44028c4.20209,2.98911 11.18788,7.71034 2.77457,9.97613c-16.06789,8.94404 -31.07338,22.15693 -35.10127,40.92605c-6.0766,10.44077 4.6955,19.50048 -5.15381,26.98807c-0.10249,8.80961 22.85634,10.04067 10.00395,14.37878c8.80815,4.77542 27.69864,1.76332 29.62625,12.3696c-7.99612,6.2903 -19.2092,3.80788 -28.79007,4.39512c-3.2489,1.10706 -11.41316,-2.70125 -10.17032,2.89742c-0.6366,25.08775 5.87923,49.75521 12.1806,73.83221c0.00804,11.79608 29.09497,5.10777 12.92737,18.49597c-11.94247,10.28146 5.56685,24.68452 11.63272,33.82986c8.25099,10.03221 22.89711,15.11021 21.67468,29.8362c8.40468,0.60507 18.40166,13.69095 6.78131,16.95151c-62.8902,1.31946 -125.82766,2.22778 -188.72791,1.83258z", |
| | | "chess_rock": "m70.40736,299.11804c-15.60727,2.87628 -15.90823,-19.81082 -1.8931,-20.53482c-4.2011,-9.73361 -0.98556,-21.67557 5.22356,-30.68398c8.90442,-15.05035 22.29623,-30.00999 19.52936,-48.8515c-0.95786,-9.8022 -13.10349,-27.37677 5.72565,-24.85997c5.09087,-9.77498 2.13017,-24.16621 5.9483,-35.39389c3.33424,-21.28385 10.75552,-43.9948 2.86147,-65.09612c-4.97705,-11.23243 -17.62387,-18.62589 -16.26645,-32.35733c-1.42947,-13.39034 -0.95647,-26.88279 0.60455,-40.23392c6.07738,0.50975 12.84039,-1.27954 18.38155,1.475c-0.04153,12.96106 12.26991,10.08973 10.7935,-0.92486c3.23881,-1.28251 8.60017,-0.18413 12.6562,-0.55014c18.03256,0 36.06522,0 54.09778,0c-2.06311,7.51434 3.5195,17.19948 10.5887,8.35272c-1.93379,-11.75267 14.25911,-7.86334 10.37854,2.24694c0.22855,13.39515 1.87041,27.25403 -1.89201,40.29753c-6.12787,5.2086 -6.22449,15.45995 -13.90137,21.60233c-6.16908,11.51656 -3.45045,25.43306 -2.7644,37.9428c2.61279,18.51363 6.92676,36.79671 8.00221,55.52328c-0.76923,10.18126 20.18948,7.18474 11.15244,19.71645c-9.87662,8.41151 -4.0954,22.61668 -0.18413,32.66171c7.71916,17.36203 23.99019,32.95758 21.5343,53.32025c-1.94743,8.89606 14.16618,5.88821 9.97758,17.34372c-0.12151,14.11871 -21.10172,5.04239 -30.39526,8.00793c-46.7146,0.56656 -93.44374,1.44144 -140.159,0.99585z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "times": "m1.00089,73.36786l72.36697,-72.36697l76.87431,76.87368l76.87431,-76.87368l72.36765,72.36697l-76.87433,76.87431l76.87433,76.87431l-72.36765,72.36765l-76.87431,-76.87433l-76.87431,76.87433l-72.36697,-72.36765l76.87368,-76.87431l-76.87368,-76.87431z", |
| | | "plus": "m1.00211,102.40185l101.39974,0l0,-101.39975l95.45412,0l0,101.39975l101.3997,0l0,95.45412l-101.3997,0l0,101.3997l-95.45412,0l0,-101.3997l-101.39974,0z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "note_half": "m126.15042,298.46863c-16.82465,-2.00256 -23.94094,-21.72537 -20.50175,-36.48892c5.91676,-23.32147 29.06407,-39.43811 52.28738,-42.05833c8.81128,-0.72736 18.52644,-0.60411 25.78337,4.94891c5.95566,-2.36537 1.76544,-11.69408 2.85246,-17.2854c0,-68.81003 0,-137.6201 0,-206.43012c14.97716,-2.18183 5.30603,19.02521 7.94768,27.71113c-0.09924,75.95386 0.62134,151.91534 -0.76007,227.86198c-7.30341,28.38443 -39.39244,46.36703 -67.60907,41.74075zm2.8452,-12.40747c22.98492,-7.3089 44.37535,-22.56259 55.31068,-44.49013c0.95541,-13.55527 -16.00528,-10.73553 -23.6718,-6.15868c-13.5024,6.76553 -26.21068,15.65268 -36.74068,26.51123c-6.99238,6.4256 -15.89267,26.17618 0.78696,25.05563l2.30408,-0.3252l2.01074,-0.59286l0,0z", |
| | | "note_whole": "m130.51953,195.65829c-18.47874,-2.9818 -38.13104,-9.41365 -49.81914,-24.96915c-4.87284,-6.5025 -6.85786,-14.78229 -6.23731,-22.81049c-0.81288,-10.41815 5.23877,-19.78279 13.11027,-26.04227c15.71593,-12.69998 36.4436,-17.12403 56.18739,-18.21444c21.01479,-0.84168 42.85126,2.6237 61.20964,13.32044c11.19275,6.86285 21.10484,18.66567 20.54733,32.45548c0.612,8.09668 -0.91914,16.68852 -6.59294,22.84065c-11.24144,13.63681 -28.92738,19.59387 -45.72455,22.87505c-14.06622,2.54445 -28.55254,2.69426 -42.68069,0.54472zm34.33258,-7.95905c9.06644,-1.9348 15.01314,-11.03741 14.88672,-20.03276c1.54852,-18.89767 -4.73529,-39.56404 -20.09192,-51.52234c-8.61502,-6.06224 -20.8895,-6.65757 -30.00668,-1.42353c-6.79661,4.10276 -9.33514,12.23845 -9.31819,19.7824c-0.73656,16.04378 3.97748,32.8201 14.66045,45.0217c7.49542,7.87076 19.3475,12.08484 29.86963,8.17453z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "shark": "M 0.0576 184.3533 C -1 180.6667 16.109 171.9119 28.5757 164.4365 C 38.4736 158.5251 49.2812 151.3596 59.5749 145.0374 C 68.1791 139.7532 87.1667 130.8333 89.3069 125.0559 C 91.8073 118.3062 96.2785 105.8677 101.081 96.5857 C 104.7343 89.4927 111.6667 80.1667 115.4351 80.0032 C 116.8965 79.9398 118.1484 83.3223 118.1484 83.3223 C 118.1484 83.3223 122.1099 105.8601 130.8815 116.7246 C 134.3825 121.0713 144.5294 120.8968 148.261 120.6279 C 173.1667 118.8333 205.8755 122.4387 205.8755 122.4387 C 205.8755 122.4387 216.5042 115.1404 218.2813 114.3643 C 222.787 112.4434 218.2767 117.0532 229.4009 125.4153 C 235.5 130 238.8499 128.6677 243.6637 127.1807 C 245.6044 126.5642 246.7613 124.552 248.3672 123.3879 C 250.4222 121.9041 291.7726 94.0098 295.9696 92.7549 C 300.1667 91.5 299.9836 99.5272 299.2917 101.4797 C 291.6667 123 270.9678 137.8057 270.9678 137.8057 C 270.9678 137.8057 269.3696 140.9553 270.0887 144.2822 C 270.7395 147.3027 281.8333 169.5 276.0176 168.1533 C 273.6004 168.4127 267.6419 165.6692 267.6419 165.6692 C 267.6419 165.6692 261.6635 162.3462 257.3862 157.6331 C 254.3608 154.2813 252.5989 149.0752 252.5989 149.0752 C 252.5989 149.0752 251.2239 144.8431 247.1571 143.6204 C 237.3333 140.6667 229.9983 144.0425 227.4753 146.9565 C 225.3138 149.4482 226.6418 153.6443 226.6418 153.6443 C 226.6418 153.6443 229.6977 156.9539 227.8292 157.125 C 219.7236 157.823 215.9372 151.9265 210.3013 148.6626 C 208.3377 147.5349 205.3333 145.6667 200.2473 149.5073 C 197.6903 151.4382 195.8333 161.3333 191.8562 164.625 C 189.1771 166.8424 184.8923 164.2864 184.8923 164.2864 C 184.8923 164.2864 178.3735 162.0303 173.7651 161.9048 C 152.75 172.25 114.5828 181.7512 114.5828 181.7512 C 114.5828 181.7512 119.6706 187.7639 122.3383 191.9104 C 123.6625 193.978 123.6093 195.7603 123.6093 195.7603 C 123.6093 195.7603 124.9374 198.5923 122.1708 198.9861 C 120.5306 199.2144 104.5744 196.5801 96.0502 193.2532 C 88.873 190.4495 83.203 186.3447 83.203 186.3447 C 83.203 186.3447 57.0849 188.4819 40.3333 189.1667 C 30.5761 189.551 1.5102 189.4165 0.0576 184.3533 Z", |
| | | "dolphin": "M151.054, 51.526c-5.487, 2.029-10.494, 4.734-15.541, 7.145c-1.72, 0.821-3.674, 2.126-5.268, 2.525c-4.062, 1.013-10.418-0.759-15.596-0.944c-12.942-0.459-21.321, 0.493-31.96, 2.097c-4.979, 0.749-10.134, 1.451-14.504, 2.732c-3.733, 1.095-8.013, 3.542-12.19, 5.6c-6.601, 3.253-11.097, 6.316-16.244, 10.238 c-8.603, 6.551-14.019, 14.798-20.314, 23.859c-2.749, 3.955-6.708, 9.848-6.905, 14.528c-3.639, 5.515-9.168, 8.882-10.555, 16.955c1.939, 4.721, 6.964, 0.523, 9.992-1.049c2.504-1.304, 5.198-2.862, 7.417-3.487c11.533-3.251, 27.605, 1.396, 38.834-1.583c3.98-1.055, 7.428-3.185, 11.382-4.087c3.755-0.859, 6.627, 0.662, 9.304, 1.818c1.422, 0.616, 2.92, 1.45, 4.212, 2.113 c8.366, 4.323, 16.728, 8.906, 27.96, 10.632c9.015, 1.383, 16.847-1.256, 24.175-2.682c1.86-0.363, 4.263-0.231, 5.674-1.819 c-5.849-1.321-10.703-3.574-16.811-5.979c-8.023-3.156-14.255-5.291-17.287-11.627c3.591-0.94, 7.75-0.243, 11.488, 0.412 c4.082, 0.712, 8.133, 1.381, 12.05, 2.025c16.539, 2.723, 28.995, 7.294, 41.585, 13.224c6.116, 2.877, 11.752, 6.886, 16.936, 10.251 c10.617, 6.9, 19.68, 15.468, 28.228, 24.802c3.869, 4.226, 7.325, 9.518, 11.521, 14.562c1.834, 2.205, 3.678, 4.665, 5.638, 7.388 c1.873, 2.587, 4.731, 5.758, 5.127, 8.021c0.446, 2.499-0.881, 5.239-1.549, 7.97c-1.155, 4.744-2.007, 9.833-1.62, 14.704 c0.506, 6.3, 1.914, 12.436, 4.866, 17.209c1.281-1.139, 1.804-3.144, 2.464-4.98c3.236-4.136, 7.541-8.267, 7.648-15.15 c8.839, 4.568, 26.008, 4.185, 36.316, 4.066c3.099-0.036, 6.256, 0.292, 8.823-0.913c-5.414-3.138-9.388-7.109-14.094-11.163c-7.12-6.125-13.009-11.285-23.505-14.562c-3.402-1.062-7.297-1.637-9.161-3.605c-1.433-1.506-1.869-4.842-2.596-8.055 c-1.955-8.687-4.497-17.904-6.765-25.215c-6.806-21.976-17.194-41.507-31.015-56.675c-7.004-7.692-15.368-13.956-24.386-20.921 c-1.541-2.416-4.428-5.675-5.024-9.359c-0.61-3.793, 0.49-7.122, 2.834-9.67c5.128-3.742, 13.185-4.156, 16.669-9.757 c-4.555-3.279-10.207-4.24-15.753-4.776C171.573, 47.185, 160.348, 48.085, 151.054, 51.526z", |
| | | "he_hen": "m176.04681,296.29803c-8.82596,-3.77927 -18.43298,1.74493 -27.86224,-3.75964c7.62581,-0.4744 19.08463,-0.03574 17.06104,-11.34488c3.33665,-13.20654 -3.43475,-27.06163 2.20258,-38.55534c-8.82878,-8.42361 -18.09561,-18.39673 -22.80272,-30.16238c-0.9447,4.74663 -1.81537,8.52257 -3.158,0.33916c-0.76965,-4.00471 -0.30261,9.89931 -3.24527,0.14346c-3.10373,-8.67493 -11.4597,-31.29446 -14.05236,-10.31462c-1.0768,10.8262 -4.45592,3.14465 -6.0004,-3.72562c-1.56924,-13.22943 -7.23737,-25.48523 -8.72193,-38.68883c5.80227,-8.36407 -0.82715,-9.5029 -3.91098,-1.15848c-3.39584,13.23767 -6.30494,26.33923 -2.7624,39.9769c-4.70789,3.85124 -13.79493,-17.92216 -9.61541,-26.27414c3.62592,-9.45018 2.81974,-19.09607 3.42313,-25.48878c3.31529,-7.21146 -3.22571,-15.04807 0.25123,-22.73853c-8.88477,9.68631 -16.83011,16.38615 -14.33428,31.58234c-1.10283,3.79079 3.703,25.58844 0.64231,17.56184c-5.77861,-15.66916 -5.78305,-33.02271 -1.43442,-49.01125c0.00535,-12.20366 -9.89253,21.0744 -9.16187,4.76299c-0.93676,-12.30159 4.13303,-25.82869 8.93452,-35.55499c-5.46675,-6.50523 -23.17289,-1.89566 -14.79648,-15.70558c8.24343,-7.01884 7.35999,-16.67057 -3.85936,-8.18394c-17.3246,12.72424 -31.69814,29.07174 -47.58007,43.52234c15.25898,-19.61487 32.46107,-38.59572 53.7519,-51.75492c20.64337,-12.99951 50.5769,-14.34346 68.38963,4.28573c4.53072,7.97979 15.06177,13.26968 17.57275,20.45337c-1.84586,10.76744 5.10652,16.10654 5.85289,25.57021c4.38731,7.30244 -3.95828,20.43125 8.52597,16.64671c14.20137,-0.01996 33.63664,-3.16645 34.74754,-20.87874c5.66772,-25.50935 8.27689,-54.0092 26.4256,-74.31131c10.08655,-5.89642 3.82147,-4.32716 -3.54926,-5.29837c-6.51613,-7.58361 6.57724,-19.75743 13.02319,-21.14511c-1.112,-17.9227 10.53479,10.74471 13.86426,-2.41437c4.99586,0.09501 7.43144,12.08141 10.46855,2.29789c9.05719,7.66376 18.6297,19.25661 6.66562,29.92943c13.61102,6.52517 -13.86911,2.29947 -2.14532,12.29652c9.6759,9.35194 2.83621,26.62759 -5.10654,34.15639c-0.3085,5.66077 9.31277,13.88494 11.24728,20.75249c9.99454,19.34809 11.9986,42.36646 8.16797,63.56847c-5.39346,19.98318 -25.46588,28.67906 -39.65833,41.37386c-12.12337,9.93893 -7.85776,27.37115 -13.59781,40.42342c0.57072,7.5369 4.77751,16.1196 10.7547,20.66925c8.66214,4.84064 18.81006,7.96561 25.81393,15.05286c-6.39667,3.34055 -19.43893,-10.21753 -19.56508,0.39017c-9.50252,-12.34393 -23.7677,-4.06104 -34.21234,-13.55405c8.69193,1.65643 19.99033,0.8027 10.47188,-9.61145c-3.75841,-8.80696 -15.07852,-11.84618 -15.37883,-22.49022c-10.66643,6.69647 -17.92447,15.81358 -25.66988,24.90395c-12.85808,-0.80322 -13.41248,25.11618 0.47165,24.73163c5.7019,1.45825 27.10161,9.40335 10.25006,7.35107c-5.02289,-0.89746 -10.47203,-4.04099 -10.31842,1.85727c-2.30338,-0.41431 -4.35982,-1.56003 -6.48019,-2.47418z", |
| | | "hen": "m131.70792,299.20142c-2.65045,-8.04401 -50.59061,2.01245 -25.50379,-8.40613c9.71836,-2.24731 29.67359,0.57056 9.8335,-5.50568c22.5928,7.62228 32.60569,-19.08859 34.06422,-37.09636c-21.02885,-6.55212 -24.67069,-31.02429 -46.83106,-37.61485c-16.88445,-13.23645 -41.63732,-12.83168 -52.35418,-33.24014c-10.17476,-18.17259 -4.4284,-40.29292 -2.74405,-59.92338c4.00956,-20.72375 12.14967,-41.69897 10.53991,-62.75727c-16.41068,9.44812 -22.4106,-11.67328 -22.78485,-18.27062c-12.07958,3.08904 -19.7317,3.22594 -6.59584,-7.5194c5.87008,-8.14037 8.78346,-25.92081 18.16113,-23.25189c2.47408,-10.763 9.04029,4.89351 16.30021,-4.61621c4.44867,3.35889 13.85731,7.10325 3.42817,13.02555c18.83147,9.50194 34.07959,23.95835 41.92437,42.43233c7.86127,18.77559 23.52317,39.06593 48.8149,33.98585c22.90038,3.93186 49.73083,-9.80992 48.68822,-32.86776c0.44391,-16.33654 16.52325,-54.48924 38.19395,-35.09801c16.24046,6.22802 34.92778,21.65468 31.09642,39.16159c-2.21887,18.0508 -0.50452,36.25767 1.60162,54.45551c-13.60181,10.0825 -11.15982,27.59631 -20.65894,40.7838c7.8804,18.56862 0.29095,38.62871 -12.60841,53.70848c-12.90314,13.89935 -31.76248,26.24356 -52.66508,24.4381c-7.98578,13.29396 9.42929,24.99069 15.57339,25.73553c-16.01053,-5.1321 -13.75549,4.70874 -8.47672,15.2244c4.94576,19.6875 -10.58037,-17.53909 -20.60904,0.27255c-7.77597,7.68976 -38.86531,10.29276 -13.69539,1.07587c21.48048,-7.96875 -24.12099,-12.95142 -13.99879,5.00586c3.34996,7.49203 22.77361,10.79092 2.32814,7.93628c-9.02753,-4.74515 -13.85625,12.10397 -21.02202,8.92599zm43.09088,-34.62769c7.8596,-9.56569 10.12141,-37.24054 -6.87671,-17.06372c-13.43553,10.88889 -18.29311,29.6301 6.87671,17.06372z", |
| | | "hen": "m131.70792,299.20142c-2.65045,-8.04401 -50.59061,2.01245 -25.50379,-8.40613c9.71836,-2.24731 29.67359,0.57056 9.8335,-5.50568c22.5928,7.62228 32.60569,-19.08859 34.06422,-37.09636c-21.02885,-6.55212 -24.67069,-31.02429 -46.83106,-37.61485c-16.88445,-13.23645 -41.63732,-12.83168 -52.35418,-33.24014c-10.17476,-18.17259 -4.4284,-40.29292 -2.74405,-59.92338c4.00956,-20.72375 12.14967,-41.69897 10.53991,-62.75727c-16.41068,9.44812 -22.4106,-11.67328 -22.78485,-18.27062c-12.07958,3.08904 -19.7317,3.22594 -6.59584,-7.5194c5.87008,-8.14037 8.78346,-25.92081 18.16113,-23.25189c2.47408,-10.763 9.04029,4.89351 16.30021,-4.61621c4.44867,3.35889 13.85731,7.10325 3.42817,13.02555c18.83147,9.50194 34.07959,23.95835 41.92437,42.43233c7.86127,18.77559 23.52317,39.06593 48.8149,33.98585c22.90038,3.93186 49.73083,-9.80992 48.68822,-32.86776c0.44391,-16.33654 16.52325,-54.48924 38.19395,-35.09801c16.24046,6.22802 34.92778,21.65468 31.09642,39.16159c-2.21887,18.0508 -0.50452,36.25767 1.60162,54.45551c-13.60181,10.0825 -11.15982,27.59631 -20.65894,40.7838c7.8804,18.56862 0.29095,38.62871 -12.60841,53.70848c-12.90314,13.89935 -31.76248,26.24356 -52.66508,24.4381c-7.98578,13.29396 9.42929,24.99069 15.57339,25.73553c-16.01053,-5.1321 -13.75549,4.70874 -8.47672,15.2244c4.94576,19.6875 -10.58037,-17.53909 -20.60904,0.27255c-7.77597,7.68976 -38.86531,10.29276 -13.69539,1.07587c21.48048,-7.96875 -24.12099,-12.95142 -13.99879,5.00586c3.34996,7.49203 22.77361,10.79092 2.32814,7.93628c-9.02753,-4.74515 -13.85625,12.10397 -21.02202,8.92599zm43.09088,-34.62769c7.8596,-9.56569 10.12141,-37.24054 -6.87671,-17.06372c-13.43553,10.88889 -18.29311,29.6301 6.87671,17.06372z", |
| | | "mythic_unicorn_2": "m182.0204,297.85391c-5.77818,-7.90314 -14.7635,-8.80438 -16.9241,-20.05347c-1.69348,-6.11859 -17.65829,-14.32483 -8.20955,-3.3428c7.2961,6.61768 15.96432,31.02682 -1.98563,23.31473c-13.65228,-5.01041 -14.2377,-20.48209 -17.89716,-32.06519c-11.90031,-8.25644 3.07674,-25.71408 -9.73651,-36.29276c-10.87482,-11.04288 -3.30119,-31.72456 -18.8404,-39.55457c-7.79965,-3.16566 -11.1757,18.69177 -12.48895,2.70163c-4.27309,-16.17242 -19.36451,7.86156 -29.42789,5.31358c-8.12057,-0.70595 13.58361,-6.35143 3.22626,-7.87068c-6.08933,3.33348 -11.72343,9.09727 -12.68681,-0.44351c-7.3251,-4.35046 -22.68599,-11.29797 -22.28696,-18.20909c6.3611,-1.99829 27.83545,3.78387 24.11403,-4.25029c-6.38573,-2.42343 -7.54573,-9.04803 0.27553,-4.60205c15.41352,0.48352 33.48255,-5.66917 46.30758,6.09853c6.68958,4.11612 13.26701,18.87857 16.84827,4.53223c11.5443,-13.92389 34.83883,-15.10329 41.95536,-33.13124c1.72211,-8.72215 -5.28903,-13.69839 -11.24521,-15.46512c-1.15878,-2.86641 -3.13139,-15.03612 -8.05675,-8.8949c0.22449,-5.37502 4.84473,-18.22859 -5.38927,-12.53831c-1.03801,-11.44846 8.74879,-22.87025 -4.19783,-31.20716c12.13029,2.25027 9.73825,-11.57887 7.09616,-13.77212c7.19073,-1.02106 15.62939,-7.49186 11.66467,-15.50808c7.80894,14.17675 8.07971,-17.19902 14.50877,-3.67512c11.83272,1.93988 -3.67599,-10.57163 7.20721,-7.77902c6.21443,0.21264 4.83423,-6.80917 10.41692,-1.50957c7.3886,-4.03149 -5.66409,-16.21531 6.26559,-7.74985c4.01033,3.484 16.77809,12.60911 14.48726,0.56772c11.33586,12.0923 20.25659,-11.23169 29.67625,-16.06186c3.73633,-4.47003 11.8613,-9.20071 4.36795,-0.66791c-4.97461,10.87669 -21.85179,22.64296 -17.31131,33.45053c-4.10985,3.74163 8.29224,8.44421 -1.58034,7.02768c-5.8488,6.31351 7.84134,18.1257 8.93388,28.06219c-3.13588,6.80826 -15.07657,14.53744 -19.90688,14.29315c1.76543,-8.76564 -2.06178,-20.19066 -13.24036,-15.23595c6.26202,11.45789 14.72818,22.40379 20.03253,34.86404c5.18462,12.24902 13.59059,26.39416 24.64981,10.62966c7.04883,-10.04763 27.18559,-9.90218 21.65419,6.41521c-2.82767,16.0232 4.74286,37.1706 -9.80374,48.20794c-8.77531,16.90973 -18.50392,-6.2874 -11.60965,-15.06308c-1.75673,-2.50781 -3.11575,-4.27809 2.02489,-7.7061c-1.06146,-2.57137 14.7939,-12.24554 6.80286,-18.18176c-9.0885,10.30594 -22.38708,22.23511 -18.69125,37.55475c2.99957,10.26601 -21.73944,27.86615 -19.76117,10.82875c0.44312,-6.62131 9.89648,-19.45415 7.72044,-21.10741c-6.90181,12.95006 -16.71997,25.39136 -31.55621,29.23625c-12.34084,0.73132 -18.80547,10.66779 -12.94504,21.69241c1.11998,15.62238 -7.12646,29.76141 -9.02499,44.972c3.52914,16.13283 25.01552,19.39287 27.93198,35.84959c5.01138,11.05234 -7.52405,9.41898 -13.36446,6.32639zm-30.55545,-48.12944c-1.80891,-7.29253 -5.53151,18.95699 -0.94273,5.02481l0.68695,-2.46143l0.25578,-2.56339z", |
| | | |
| | | |
| | | "rhino":"M 31.2973 189.1916 C 30.374 186.1509 30.2876 182.8892 30.2876 182.8892 C 30.2876 182.8892 18.6488 172.7592 12.9338 167.0182 C 8.1162 162.1747 0.1206 148.2926 0.1206 148.2926 C 0.1206 148.2926 -0.3045 144.7842 0.4415 144.6859 C 1.6515 144.5302 7.9245 150.0048 14.0462 153.201 C 20.3518 156.4936 27.5875 158.6592 27.5875 158.6592 L 35.5018 158.6592 C 35.5018 158.6592 29.0012 141.5758 37.34 143.8147 C 40.3528 144.0688 42.0178 150.5315 46.6067 151.2422 C 51.9836 149.9209 54.6313 134.4272 54.6313 134.4272 C 54.6313 134.4272 52.9961 131.5424 53.0697 128.803 C 53.129 126.9918 54.9114 124.9244 54.9114 124.9244 C 54.9114 124.9244 51.1096 125.5576 48.5035 124.7196 C 46.155 123.9635 42.5672 121.0233 41.6173 118.8496 C 40.4416 116.1589 40.7466 113.1821 39.4977 111.4715 C 39.3738 110.1291 41.1021 109.6715 42.02 110.3015 C 45.4753 112.6733 50.0547 112.9256 51.043 113.4111 C 55.1783 115.443 62.1528 115.7264 63.1698 115.3193 C 54.0175 103.9211 65.6289 101.5547 67.2467 101.3131 C 69.2713 103.514 72.3221 106.16 73.1967 108.5642 C 74.3559 110.0273 74.2616 107.9475 74.2616 107.9475 C 74.2616 107.9475 74.3209 101.8131 76.9637 97.2195 C 77.5729 96.1479 80.9405 92.7265 83.1856 92.4271 C 83.9995 92.3186 85.7254 92.0741 87.5618 90.4255 C 92.2537 86.2132 105.0561 86.9177 105.0561 86.9177 C 105.0561 86.9177 106.0924 87.3971 108.0301 87.3889 C 109.7409 87.3788 139.8456 85.6026 152.1574 90.03 C 160.433 93.0059 175.2345 92.1159 193.0635 87.0243 C 198.6909 85.4173 214.9442 85 214.9442 85 C 214.9442 85 221.0913 85.3409 226.0806 87.0274 C 233.8591 89.6567 248.6718 88.6388 257.7491 89.6018 C 261.2524 89.9747 267.9599 93.2576 273.5101 96.3221 C 290.9601 105.9565 301.1294 127.5316 299.8999 134.8799 C 297.5037 149.2014 283.2316 173.735 276.9266 184.5226 C 274.3758 188.8869 273.0623 195.5137 273.6205 200.5527 C 273.7831 202.0202 271.6895 205.6906 267.7195 208.1928 C 262.1246 211.7193 266.3419 216.8904 266.8591 219.2671 C 267.3741 221.6376 267.2024 224.6782 265.6837 225.3544 C 264.1713 226.0263 242.5547 229.81 241.9206 224.7663 C 238.7548 219.072 254.3001 210.4229 252.5226 200.3702 C 247.4359 193.6818 246.2545 178.7816 245.4402 176.4947 C 244.5885 166.2041 227.9237 182.3253 219.5206 185.6245 C 195.3696 195.1066 168.116 190.8322 165.9726 190.0358 C 163.0314 198.9738 166.1362 203.3924 166.3365 204.4804 C 165.6754 210.5755 172.1837 220.3454 173.6375 226.3336 C 174.8277 231.1329 154.4893 231.1329 148.9116 230.9416 C 144.3201 229.7082 151.2226 220.7226 152.3475 219.7199 C 153.8791 212.0003 145.337 205.08 145.337 205.08 C 145.337 205.08 144.7269 212.0003 143.029 217.8104 C 143.0998 220.549 145.8231 222.5392 146.2197 224.9814 C 146.6408 227.5896 144.6581 227.9297 144.6581 227.9297 C 144.6581 227.9297 129.0663 230.7259 125.1382 227.4769 C 123.1681 226.8586 121.4508 227.8662 120.0711 226.7946 C 119.1125 226.0447 120.6945 221.7545 121.8821 220.5681 C 122.8979 219.5479 129.6764 219.3277 129.7289 211.1167 C 128.0493 196.5313 114.2192 190.4252 113.1891 184.7516 C 106.4906 187.3721 99.4475 182.4468 99.4475 182.4468 C 99.4475 182.4468 97.6059 184.5796 95.5782 184.9831 C 93.9512 185.3028 87.9826 181.4695 85.9838 179.2361 C 85.3387 187.9827 78.1289 185.6491 78.1289 185.6491 C 78.1289 185.6491 75.58 189.9465 71.5288 192.0231 C 61.5427 197.142 59.7122 196.7349 55.59 200.6408 C 53.2684 202.8405 49.1881 199.5904 46.4922 200.6021 C 36.7298 204.2658 30.8317 199.5844 31.2973 189.1916 Z", |
| | | |
| | | |
| | | "tree": "M 27.2254 74.2515 C 25.9396 74.2515 25.2787 72.9597 25.2787 71.4106 C 25.2787 70.1191 25.6091 68.8652 26.5645 68.8652 C 27.2254 68.8652 28.2203 70.1191 28.5507 71.4106 C 29.2116 73.291 28.5507 74.2515 27.2254 74.2515 ZM 247.0194 147.96 C 249.9611 147.96 250.6219 148.2913 248.9661 150.5051 C 248.0107 152.0542 246.0245 153.3457 245.0691 153.3457 C 244.0743 153.3457 243.0829 152.0542 243.0829 150.5051 C 243.0829 148.918 244.4083 147.96 247.0194 147.96 ZM 41.6425 57.7979 C 38.7009 57.1711 38.3704 53.9971 41.6425 53.0388 C 43.2982 52.7437 44.2537 53.6655 44.2537 55.5842 C 44.2537 57.1711 43.2982 58.0933 41.6425 57.7979 ZM 4.9748 158.0671 C 8.9113 157.1448 8.9113 156.4819 7.586 154.3042 C 6.5946 152.719 6.2642 150.8005 6.9251 150.1736 C 7.2555 149.2136 8.9113 150.1736 9.8667 152.0542 C 11.192 154.5996 12.1833 154.9329 14.7945 153.3457 C 16.4144 152.3875 17.7361 151.759 17.7361 152.719 C 17.7361 153.3457 18.731 152.719 20.0168 151.4275 C 22.0031 149.5469 22.3335 145.4146 20.3473 143.2007 C 18.731 141.3201 10.5276 141.947 8.2469 144.1589 C 6.9251 145.7461 5.9302 145.4146 4.6444 142.574 C 2.6582 137.8508 2.6582 137.1877 7.2555 136.8926 C 11.192 136.8926 11.192 136.8926 7.9164 134.9741 C 6.2642 134.0518 4.6444 132.1335 4.6444 130.8796 C 4.6444 127.7058 9.2058 125.8252 11.192 128.0391 C 11.8529 128.9612 13.1388 129.9197 14.4641 129.9197 C 17.0753 129.9197 29.542 119.1853 29.542 116.9714 C 29.542 116.0115 30.8314 115.3848 32.1532 116.0115 C 33.773 116.3447 36.7147 115.3848 39.6958 113.7976 C 43.9232 111.2524 43.9232 110.957 41.6425 106.8264 C 40.0262 103.9858 38.04 103.0256 33.4426 103.0256 C 28.2203 103.0256 26.895 103.6526 25.2787 107.4534 C 24.6142 109.9985 22.6281 111.8792 21.3422 111.8792 C 19.0615 111.8792 18.4006 109.0403 20.6813 107.4534 C 21.6726 106.8264 22.3335 104.6128 22.3335 102.3989 C 22.3335 98.9312 21.6726 98.3044 17.4057 99.2268 C 13.1388 99.8535 13.1388 99.5581 14.1336 94.7988 C 14.7945 91.9583 15.7499 89.4131 16.4144 89.1177 C 17.0753 88.7864 17.7361 85.9456 17.7361 83.105 C 17.7361 77.4233 19.6864 76.4651 23.2925 80.5596 C 24.9446 82.7734 25.9396 83.105 26.5645 81.1863 C 27.2254 79.9326 29.542 79.6372 33.1481 80.2639 C 38.04 81.5178 38.3704 81.1863 37.7095 77.4233 C 37.3791 75.2097 37.0451 72.6643 36.7147 72.0376 C 36.7147 71.0791 35.0984 69.8237 33.1481 68.8652 C 29.2116 67.2786 28.2203 63.4795 31.8228 63.4795 C 32.8177 63.4795 33.773 62.8525 33.773 61.5969 C 33.773 60.6384 35.7593 60.0117 38.3704 60.3052 C 41.9765 60.6384 43.9232 59.3833 48.851 52.7437 C 52.4571 47.9844 55.0682 45.4392 55.3987 46.7307 C 55.7291 48.3159 57.3849 49.238 59.0047 49.238 C 61.6159 49.238 61.9464 48.3159 60.991 44.1853 C 60.657 41.3445 59.0047 37.8772 58.0099 36.29 C 55.0682 32.7849 55.0682 28.6904 58.0099 29.9438 C 60.3265 31.1995 67.535 27.7319 67.535 25.5181 C 67.535 24.5581 68.494 23.9312 69.8157 23.9312 C 71.1411 23.9312 71.766 25.8496 71.766 28.3589 C 71.766 31.531 72.4269 32.7849 74.0827 31.8625 C 75.3685 31.1995 76.3635 29.3171 76.3635 28.0635 C 76.3635 24.2625 86.844 17.6228 89.4551 19.5051 C 90.4501 20.1323 91.4413 19.5051 91.7755 17.2915 C 92.7308 12.8638 98.6499 9.3962 101.261 11.6101 C 102.5864 12.5322 103.8723 12.2371 104.2063 11.2788 C 104.8671 10.0232 107.4783 9.0649 110.4199 8.7693 C 113.3615 8.438 117.298 7.1824 118.9538 5.8909 C 125.1674 1.7964 131.3847 2.0918 133.9958 6.5198 C 135.6516 9.6917 136.3124 9.6917 136.3124 7.4778 C 136.3124 4.637 137.6019 4.3057 145.4713 5.2642 C 157.9381 6.5198 159.8884 6.5198 164.4858 4.9326 C 167.4274 4.0103 168.4222 4.3057 168.4222 6.8508 C 168.4222 8.438 169.3777 9.6917 170.703 9.6917 C 171.6943 9.6917 172.6497 8.7693 172.6497 7.8093 C 172.6497 5.2642 177.9116 4.0103 182.5089 5.2642 C 186.0755 6.5198 186.4059 6.8508 185.4505 15.373 C 185.1201 20.4636 185.4505 23.9312 186.0755 23.9312 C 186.7363 23.9312 187.4008 21.7173 187.4008 18.5452 C 187.4008 13.1953 191.0033 10.9832 192.3286 15.373 C 192.6591 16.9583 193.6144 16.3313 194.2753 13.824 C 195.9312 7.1824 199.5372 10.6499 198.5422 17.9185 C 197.551 23.9312 197.551 23.9312 200.4926 21.7173 C 202.1483 20.759 203.4341 18.25 203.4341 16.6646 C 203.4341 15.0776 204.4291 13.1953 205.7509 12.5322 C 208.3619 11.2788 211.3072 16.0361 210.3482 19.5051 C 210.0178 21.0906 210.0178 22.3459 210.9731 22.3459 C 211.6376 22.3459 212.2985 21.4238 212.2985 20.759 C 212.2985 19.8367 213.9183 19.5051 215.9045 20.1323 C 220.1679 21.0906 220.7928 23.6357 217.1904 25.1848 C 216.235 25.8496 215.2401 27.3987 215.2401 28.6904 C 215.2401 30.9043 215.9045 30.9043 219.507 28.6904 C 225.3902 24.8914 228.0013 25.1848 228.9963 29.3171 C 229.6571 31.531 230.9465 32.491 232.2683 31.531 C 233.5936 31.1995 236.5352 32.491 238.816 34.7031 C 240.8022 36.5854 243.7438 38.1707 245.0691 38.1707 C 247.0194 38.1707 247.0194 39.7578 246.3549 44.1853 C 245.6941 48.9446 245.6941 49.5713 247.6803 47.6531 C 250.2914 44.5168 251.2828 44.812 252.2418 49.238 C 252.5722 51.4519 254.8888 53.0388 257.5 53.9971 C 260.4416 54.626 262.0615 56.2109 262.0615 58.0933 C 262.0615 60.0117 263.0527 62.2239 264.0477 63.4795 C 266.6589 65.6931 265.9944 72.3328 263.0527 74.5466 C 262.0615 75.2097 260.7721 74.8782 260.4416 73.9199 C 259.7808 72.9597 257.5 72.9597 253.233 73.9199 C 246.3549 76.1318 245.0691 76.7605 246.6854 79.6372 C 247.6803 81.5178 259.1198 80.8911 265.3694 78.6772 C 267.3197 77.7188 267.9806 78.6772 267.9806 83.105 C 267.9806 86.2769 267.3197 88.7864 266.3284 88.7864 C 265.6639 88.7864 265.039 89.7446 265.039 91.3315 C 265.039 95.1321 266.6589 94.7988 270.9258 90.373 C 273.2029 87.8279 274.5282 87.1992 276.1481 88.7864 C 277.8003 90.373 278.1343 90.373 278.1343 87.8279 C 278.1343 86.2769 277.4698 84.9873 276.4786 84.9873 C 275.8536 84.9873 275.1891 83.7317 275.1891 82.4778 C 275.1891 80.8911 276.1481 79.6372 277.4698 79.6372 C 278.4647 79.6372 279.7865 80.2639 279.7865 81.1863 C 279.7865 82.1467 281.0759 83.4001 282.7317 83.7317 C 285.0089 84.6919 285.6733 85.9456 285.3428 89.7446 C 284.6784 97.0127 286.0038 99.2268 290.8956 97.9731 C 293.2123 97.3442 294.498 97.9731 293.5068 99.2268 C 293.2123 99.8535 293.5068 101.4407 294.1677 102.1033 C 296.8183 103.9858 295.8234 108.4119 292.8818 108.4119 C 289.2758 108.4119 288.2844 109.9985 290.2348 112.8394 C 291.5565 114.4263 292.5514 114.72 293.8372 113.4663 C 296.8183 110.2942 297.4433 112.8394 297.7737 125.4939 C 297.7737 131.8379 298.4346 136.8926 299.0955 136.8926 C 300.7153 136.8926 300.0904 143.8655 297.7737 146.7061 C 296.4843 148.2913 296.4843 149.8403 297.4433 151.1318 C 299.7599 153.9727 297.4433 162.1995 294.498 162.1995 C 291.887 162.1995 286.9591 168.2122 286.9591 171.053 C 286.9591 174.5225 282.7317 171.053 281.7368 167.2539 C 280.7455 163.7864 280.7455 163.7864 280.081 166.2939 C 279.4561 169.1724 283.0262 178.0259 286.0038 180.5349 C 287.954 182.4536 284.348 185.6255 281.7368 184.334 C 280.4114 183.7073 279.7865 181.8267 279.7865 179.9082 C 279.7865 174.5225 271.5866 160.9456 265.3694 155.8552 C 262.0615 153.3457 259.1198 150.5051 259.1198 149.5469 C 259.1198 147.6284 248.6357 141.6516 242.7525 139.7332 C 239.4768 138.7732 238.4855 139.1064 238.4855 141.6516 C 238.4855 143.5322 237.8606 144.1589 236.5352 143.5322 C 233.5936 142.2783 232.2683 145.1194 234.8795 147.96 C 238.4855 151.4275 237.8606 155.5596 233.9241 153.9727 C 231.277 153.0144 230.9465 153.3457 231.9379 158.7319 C 232.2683 161.8679 232.9328 166 232.9328 167.8806 C 232.9328 169.7991 233.5936 171.053 234.2545 171.053 C 235.2136 171.053 235.5439 170.426 234.8795 169.4678 C 234.5491 168.5076 235.2136 167.5854 236.5352 167.5854 C 237.5302 167.5854 238.4855 168.8408 238.4855 170.0945 C 238.4855 171.3862 237.1962 172.6396 234.8795 172.3086 C 232.9328 172.3086 231.277 171.3862 231.277 170.7593 C 231.277 167.8806 222.4486 148.2913 219.8375 145.4146 C 216.8958 142.2783 218.8461 141.3201 195.6006 156.1865 C 191.9982 158.4004 188.0617 163.1594 186.0755 166.6272 C 184.4556 170.0945 181.8445 173.6001 180.5227 174.2268 C 179.1974 174.8538 174.3055 179.9082 170.0385 185.2942 C 151.6849 209.0139 154.666 211.8547 155.9519 260.2944 C 161.5082 297 161.5082 297 161.5082 297 C 148.4129 297 148.4129 297 148.4129 297 C 137.6019 297 137.6019 297 137.6019 297 C 138.5932 263.1331 138.5932 263.1331 138.5932 263.1331 C 139.254 260.2944 139.5881 254.5752 139.9186 251.4028 C 140.249 249.5205 130.7238 241.2937 131.0543 239.4133 C 131.0543 237.8264 140.9099 242.2542 140.9099 240.667 C 142.5297 217.574 140.9099 199.2021 136.6429 189.4246 C 135.6516 183.4116 127.4482 164.0818 126.1624 164.0818 C 125.8319 164.0818 123.5153 162.1995 121.2346 159.9856 C 117.298 155.8552 115.6818 155.5596 93.7221 154.3042 C 70.1462 153.0144 70.1462 153.0144 70.1462 153.0144 C 64.5575 157.4404 64.5575 157.4404 64.5575 157.4404 C 61.2855 160.3188 58.0099 162.1995 57.0544 162.1995 C 55.0682 162.1995 46.8648 168.8408 43.2982 172.6396 C 42.9678 172.6396 42.6374 172.3086 42.6374 172.0129 C 42.3069 172.0129 42.3069 172.0129 42.3069 171.6814 C 41.9765 170.7593 41.6425 169.7991 40.9816 168.8408 C 42.9678 167.2539 44.5876 166.2939 45.2485 166.6272 C 46.2398 167.2539 47.1988 166.6272 47.1988 165.04 C 47.1988 163.4548 45.2485 162.8262 40.0262 163.4548 C 33.773 164.4133 32.1532 164.7446 31.1619 168.5076 C 29.542 170.426 29.2116 173.2668 30.1706 175.4807 C 29.8365 178.3213 29.8365 180.2397 30.1706 180.2397 C 30.501 180.2397 30.8314 179.613 31.8228 178.9482 C 31.8228 179.2798 32.1532 179.613 32.4872 179.9082 C 29.2116 180.8665 27.5558 183.7073 27.8898 186.5479 C 26.2341 187.8394 24.6142 188.4663 22.6281 189.4246 C 22.6281 189.4246 22.6281 189.0933 22.3335 189.0933 C 23.6229 186.2527 24.2838 183.0803 24.6142 178.3213 C 25.2787 172.9712 24.9446 169.4678 23.9534 169.4678 C 23.2925 169.4678 22.6281 170.7593 22.6281 172.6396 C 22.9584 174.2268 22.3335 175.812 21.0117 176.1074 C 20.0168 176.4387 19.356 175.812 19.356 174.2268 C 19.356 170.426 18.0701 170.426 15.1249 173.8936 C 13.8032 175.1851 11.192 176.7344 8.9113 177.3992 C 5.9302 178.3213 4.9748 177.6943 3.6495 174.2268 C 2.6582 171.3862 1.9973 168.2122 2.6582 166.9585 C 2.9886 165.3716 2.9886 164.0818 1.7028 164.0818 C -1.9033 164.0818 0.7079 159.0271 4.9748 158.0671 ZM 33.1481 85.3186 C 31.1619 84.9873 29.542 84.0649 28.8812 82.7734 C 28.5507 80.8911 28.2203 80.8911 28.2203 82.7734 C 28.2203 84.0649 26.895 84.9873 25.6091 85.3186 C 23.2925 85.3186 23.2925 85.6501 25.9396 86.9058 C 27.5558 87.5325 29.2116 88.4907 29.542 88.4907 C 29.8365 88.4907 31.4923 87.5325 33.1481 86.9058 C 36.0897 85.3186 36.0897 85.3186 33.1481 85.3186 ZM 292.8818 136.2656 C 293.5068 136.8926 294.1677 135.9324 294.1677 134.3472 C 294.1677 133.0918 293.5068 131.8379 292.8818 131.8379 C 291.887 131.8379 291.2261 132.4648 291.2261 133.387 C 291.2261 134.3472 291.887 135.6387 292.8818 136.2656 ZM 290.5652 139.1064 C 290.2348 138.1462 288.6149 136.8926 287.2896 136.8926 C 286.3342 136.8926 285.6733 138.1462 286.3342 139.1064 C 286.6287 140.0647 287.954 140.6917 289.2758 140.6917 C 290.5652 140.6917 290.8956 140.0647 290.5652 139.1064 ZM 287.6236 153.3457 C 288.6149 153.3457 289.9402 153.0144 289.9402 152.719 C 289.9402 152.0542 288.6149 151.4275 287.6236 150.8005 C 286.3342 150.1736 285.3428 150.5051 285.3428 151.4275 C 285.3428 152.3875 286.3342 153.3457 287.6236 153.3457 ZM 290.2348 123.28 C 291.5565 122.6528 292.2209 121.6929 291.887 120.7705 C 290.8956 118.5208 285.3428 118.5208 285.3428 120.7705 C 285.3428 123.28 287.2896 124.2383 290.2348 123.28 ZM 272.2476 99.5581 C 270.5918 100.5183 269.6005 102.3989 269.9308 103.3589 C 271.5866 105.8665 273.537 105.2395 275.1891 101.145 C 276.809 97.3442 276.1481 96.7175 272.2476 99.5581 ZM 265.9944 148.2913 C 274.5282 156.8132 274.8587 157.1448 274.8587 154.3042 C 274.8587 152.719 274.1978 151.4275 273.2029 151.4275 C 272.2476 151.4275 270.5918 149.8403 269.6005 147.96 C 268.645 146.0774 266.6589 144.1589 265.039 144.1589 C 262.0615 144.1589 262.0615 144.4922 265.9944 148.2913 ZM 259.1198 133.387 C 261.1025 133.387 262.0615 132.7603 260.7721 132.4648 C 259.7808 131.8379 258.1609 131.8379 257.1696 132.4648 C 256.1746 132.7603 257.1696 133.387 259.1198 133.387 ZM 249.6306 90.373 C 250.6219 91.3315 253.5635 92.5852 256.1746 93.2139 C 260.7721 94.1721 261.1025 94.1721 258.4913 91.627 C 255.5138 88.4907 247.3499 87.5325 249.6306 90.373 ZM 229.6571 37.8772 C 228.6658 38.7993 228.3354 40.7178 228.6658 41.9714 C 229.3267 44.5168 231.277 42.303 231.277 38.5039 C 231.277 36.5854 230.9465 36.29 229.6571 37.8772 ZM 239.4768 106.1997 C 242.088 107.7847 243.0829 107.7847 244.4083 105.571 C 247.0194 102.1033 245.3636 100.5183 240.4717 102.7305 C 236.5352 104.2813 236.5352 104.2813 239.4768 106.1997 ZM 232.9328 90.373 C 237.8606 86.9058 237.8606 86.9058 233.9241 86.9058 C 231.277 86.9058 229.3267 88.1592 228.3354 90.373 C 227.7104 92.5852 227.046 93.8408 227.3764 93.8408 C 227.3764 93.8408 229.9876 91.9583 232.9328 90.373 ZM 225.7242 141.6516 C 228.0013 145.1194 231.9379 145.1194 230.652 141.3201 C 230.3216 140.0647 229.9876 138.4795 229.9876 138.1462 C 229.9876 137.8508 228.6658 137.8508 227.046 138.4795 C 224.3989 139.1064 224.3989 140.0647 225.7242 141.6516 ZM 215.5705 128.6658 C 218.1816 132.1335 219.507 132.4648 222.4486 129.9197 C 224.3989 128.3345 224.3989 128.3345 222.4486 128.0391 C 221.4573 128.0391 218.8461 127.7058 216.5654 127.0789 C 213.2898 125.8252 213.2898 125.8252 215.5705 128.6658 ZM 215.2401 94.1721 C 216.8958 94.1721 218.8461 89.1177 217.8513 87.5325 C 216.5654 85.9456 213.9183 88.4907 213.9183 91.3315 C 213.9183 92.9185 214.5792 94.1721 215.2401 94.1721 ZM 199.2067 115.6799 C 197.2205 116.9714 197.551 117.2671 200.1622 117.2671 C 201.8179 117.2671 203.7646 116.6382 204.4291 115.6799 C 205.4203 113.1709 202.1483 113.1709 199.2067 115.6799 ZM 199.5372 143.5322 C 199.8317 143.8655 200.823 143.2007 201.8179 141.6516 C 202.8091 140.3601 205.7509 138.7732 208.0315 138.1462 C 210.9731 137.1877 212.2985 135.6387 212.2985 133.387 C 212.2985 128.0391 207.7011 129.624 202.8091 136.561 C 200.823 140.0647 199.2067 142.9055 199.5372 143.5322 ZM 195.9312 128.9612 C 198.8727 125.4939 198.8727 124.865 196.556 123.9067 C 193.9449 122.6528 191.9982 125.4939 191.9982 130.5464 C 191.6642 134.3472 191.6642 134.3472 195.9312 128.9612 ZM 190.6729 91.627 C 191.0033 94.1721 191.6642 93.8408 193.6144 89.1177 C 195.9312 84.0649 195.9312 83.4001 193.9449 83.4001 C 192.6591 83.4001 191.3337 84.3586 191.0033 85.9456 C 190.3424 87.1992 190.3424 90.0779 190.6729 91.627 ZM 189.053 65.6931 C 189.053 66.9829 189.6779 70.1191 190.3424 72.3328 C 191.3337 76.7605 191.3337 76.7605 192.3286 72.9597 C 193.6144 69.1609 192.3286 63.4795 190.3424 63.4795 C 189.3834 63.4795 189.053 64.4375 189.053 65.6931 ZM 166.1056 76.1318 C 164.4858 78.3457 164.4858 80.5596 165.7716 87.1992 C 166.4361 91.9583 168.0919 96.7175 169.0472 97.6399 C 170.703 99.2268 171.0334 97.6399 171.3638 87.8279 C 171.3638 75.8381 169.7081 72.0376 166.1056 76.1318 ZM 169.0472 109.6672 C 169.3777 110.2942 170.0385 109.0403 169.7081 107.158 C 169.7081 105.2395 169.3777 104.9441 168.7168 106.1997 C 168.4222 107.4534 168.4222 109.0403 169.0472 109.6672 ZM 180.8531 79.9326 C 180.5227 80.5596 180.5227 84.9873 181.514 89.7446 C 182.5089 97.9731 182.8034 98.3044 183.1339 92.2915 C 183.4643 82.4778 182.8034 77.7188 180.8531 79.9326 ZM 169.7081 169.1724 C 171.6943 165.3716 174.9664 159.0271 177.2471 155.2266 C 179.8582 151.1318 181.514 145.7461 182.1749 140.3601 C 183.1339 131.8379 183.1339 131.8379 183.1339 131.8379 C 179.1974 136.561 179.1974 136.561 179.1974 136.561 C 177.2471 139.1064 175.9253 141.947 175.9253 142.9055 C 175.9253 145.4146 169.7081 161.241 167.7578 164.0818 C 166.7665 165.6667 165.1107 169.1724 164.8162 171.6814 C 163.1604 178.9482 166.1056 177.6943 169.7081 169.1724 ZM 146.4626 201.7476 C 147.4575 208.0557 147.4575 208.0557 150.7296 194.4792 C 152.6799 187.1746 155.6215 175.4807 157.6077 168.2122 C 160.2188 159.0271 161.2137 151.4275 161.2137 140.6917 C 161.2137 126.7473 160.8797 126.4519 158.2686 128.0391 C 152.3494 132.1335 149.0738 143.5322 147.752 165.6667 C 147.1271 177.0676 146.4626 188.4663 145.8018 190.9756 C 145.4713 193.5208 145.8018 198.28 146.4626 201.7476 ZM 147.1271 120.7705 C 148.4129 123.9067 149.7383 126.4519 149.7383 126.4519 C 150.0687 126.4519 151.6849 124.5334 153.0103 122.0244 C 154.666 119.8123 157.2772 117.2671 158.2686 116.3447 C 162.1691 113.4663 163.1604 104.6128 159.8884 98.5999 C 157.2772 93.2139 150.0687 87.1992 148.7433 89.1177 C 148.0825 89.7446 147.1271 95.7593 146.4626 102.7305 C 145.1409 113.1709 145.1409 116.3447 147.1271 120.7705 ZM 145.1409 48.3159 C 145.8018 48.9446 146.4626 48.6113 146.4626 47.6531 C 146.4626 46.3975 145.8018 45.1436 145.1409 44.5168 C 144.146 43.8521 143.521 44.1853 143.521 45.4392 C 143.521 46.3975 144.146 47.6531 145.1409 48.3159 ZM 39.0313 133.387 C 43.5927 133.7202 43.5927 133.7202 43.5927 133.7202 C 48.1901 133.7202 52.7875 129.624 52.7875 126.1206 C 52.7875 123.9067 52.4571 123.9067 39.0313 133.387 ZM 40.9816 124.5334 C 40.9816 125.4939 41.6425 126.4519 42.6374 126.4519 C 44.2537 126.4519 48.851 120.7705 47.8597 119.8123 C 46.8648 118.5208 40.9816 122.6528 40.9816 124.5334 ZM 44.5876 102.7305 C 49.5155 109.0403 51.7962 109.6672 54.4073 105.571 C 57.0544 101.7722 54.7378 99.2268 46.8648 98.3044 C 40.3207 97.3442 40.3207 97.3442 44.5876 102.7305 ZM 40.9816 84.9873 C 40.9816 85.6501 43.2982 87.1992 45.9094 88.4907 C 58.0099 94.5037 60.3265 94.5037 59.996 88.7864 C 59.996 85.3186 55.0682 77.7188 53.1179 77.7188 C 50.8013 77.7188 40.9816 83.7317 40.9816 84.9873 ZM 58.6743 129.9197 C 62.2768 129.9197 62.6072 128.9612 59.6656 127.4121 C 58.3403 127.0789 57.0544 127.4121 56.724 128.3345 C 56.0595 129.2925 57.0544 129.9197 58.6743 129.9197 ZM 61.2855 55.5842 C 59.0047 53.9971 56.0595 53.3704 54.7378 53.9971 C 52.4571 55.2527 52.7875 55.5842 56.0595 56.5422 C 57.6794 57.1711 60.991 57.7979 62.6072 58.0933 C 64.5575 58.0933 64.5575 57.4646 61.2855 55.5842 ZM 60.991 66.9829 C 62.9376 66.9829 63.2717 66.6514 61.9464 65.6931 C 60.991 65.3979 59.6656 65.3979 59.0047 66.0247 C 58.6743 66.6514 59.6656 67.2786 60.991 66.9829 ZM 62.9376 74.2515 C 58.3403 74.2515 58.3403 74.5466 60.991 77.092 C 64.263 79.9326 65.2184 80.2639 66.5438 78.3457 C 68.8244 75.8381 67.2046 74.2515 62.9376 74.2515 ZM 69.4854 38.5039 C 68.16 36.917 67.8296 39.7578 68.494 43.2253 C 68.8244 45.4392 70.1462 47.3574 70.8107 47.3574 C 72.0965 47.3574 71.1411 40.3845 69.4854 38.5039 ZM 79.9659 80.2639 C 79.3051 80.5596 80.9608 82.4778 82.9111 84.0649 C 84.8973 85.6501 86.5135 86.2769 86.5135 85.3186 C 86.5135 83.105 80.9608 78.9727 79.9659 80.2639 ZM 71.766 82.4778 C 68.8244 84.6919 70.4802 90.373 74.7436 91.3315 C 77.0243 91.9583 80.6304 94.5037 82.9111 97.0127 C 84.8973 99.5581 86.5135 100.5183 86.5135 99.5581 C 86.5135 96.386 73.4218 81.1863 71.766 82.4778 ZM 85.1918 108.7451 C 83.2416 103.6526 80.9608 101.145 76.6938 99.5581 C 73.4218 98.3044 70.1462 97.6399 69.1549 97.9731 C 68.16 98.3044 72.0965 102.3989 77.6888 107.158 C 88.1693 115.3848 88.1693 115.3848 85.1918 108.7451 ZM 102.5864 60.0117 C 101.9255 60.0117 101.261 61.2656 101.261 62.5193 C 101.261 64.1062 101.9255 65.0647 102.5864 65.0647 C 103.5418 65.0647 104.2063 64.1062 104.2063 62.5193 C 104.2063 61.2656 103.5418 60.0117 102.5864 60.0117 ZM 99.6089 85.9456 C 99.6089 88.1592 105.1976 86.5725 107.4783 83.7317 C 110.7504 78.9727 110.4199 77.7188 106.153 77.7188 C 103.2114 77.7188 99.6089 82.1467 99.6089 85.9456 ZM 109.1341 17.6228 C 108.1392 21.7173 107.4783 25.1848 107.8088 25.5181 C 108.8036 26.772 111.4149 17.2915 111.4149 13.4907 C 111.4149 11.9055 110.4199 13.824 109.1341 17.6228 ZM 126.1624 81.5178 C 124.5066 81.5178 123.2207 82.1467 123.2207 83.4001 C 123.2207 84.3586 124.1761 84.9873 125.1674 84.9873 C 126.4927 84.9873 127.7786 84.3586 128.1126 83.4001 C 128.7735 82.1467 127.7786 81.5178 126.1624 81.5178 ZM 122.2258 140.9868 C 124.1761 146.7061 127.1177 152.0542 128.7735 153.3457 C 130.4293 154.3042 133.7013 158.7319 135.6516 163.1594 C 137.6019 167.5854 139.5881 171.053 139.9186 171.053 C 141.5348 171.053 138.2628 141.947 135.9821 133.0918 C 133.9958 125.4939 133.3708 118.5208 133.7013 107.4534 C 133.9958 99.2268 133.7013 91.9583 133.0405 91.3315 C 132.71 90.7046 130.4293 90.7046 128.4431 91.3315 C 124.837 92.5852 124.5066 93.5454 124.5066 100.5183 C 124.5066 105.8665 123.8456 108.7451 122.2258 109.9985 C 117.6285 112.8394 117.9589 128.9612 122.2258 140.9868 ZM 112.7366 98.5999 C 112.0757 93.8408 111.4149 93.2139 107.8088 93.2139 C 103.5418 93.2139 103.5418 93.5454 103.8723 100.1851 C 103.8723 104.2813 104.5367 109.0403 104.8671 111.2524 C 105.1976 113.4663 106.487 115.6799 107.8088 116.0115 C 110.4199 117.5986 113.3615 106.5313 112.7366 98.5999 ZM 107.8088 130.5464 C 104.8671 126.7473 102.881 122.6528 102.5864 121.6929 C 102.5864 120.4392 100.9307 117.2671 98.9839 114.4263 C 96.9977 111.5857 94.717 108.0803 93.7221 106.8264 C 90.4501 102.3989 91.1109 106.1997 94.717 116.0115 C 96.9977 122.6528 100.9307 128.6658 105.528 133.7202 C 114.0259 142.2783 115.0173 140.6917 107.8088 130.5464 ZM 102.5864 146.0774 C 106.153 146.0774 105.8585 145.7461 100.9307 140.6917 C 97.6586 137.5193 95.3779 134.0518 95.3779 132.4648 C 95.3779 131.2112 91.1109 126.7473 86.1832 122.6528 C 81.2912 118.5208 76.6938 114.4263 76.033 113.1709 C 75.3685 111.5857 75.0381 111.5857 75.0381 113.4663 C 75.0381 115.3848 73.4218 115.6799 68.16 114.72 C 64.5575 114.093 61.6159 114.093 61.6159 114.4263 C 61.6159 115.0532 62.9376 118.8523 64.263 122.6528 C 66.5438 128.9612 67.535 130.2529 74.7436 132.7603 C 79.3051 134.3472 86.5135 138.1462 91.1109 140.9868 C 95.3779 143.8655 100.6002 146.0774 102.5864 146.0774 ZM 51.4622 156.8132 C 52.7875 156.8132 54.7378 156.1865 56.0595 155.2266 C 58.3403 153.0144 56.3936 153.0144 52.1266 155.2266 C 50.1763 156.1865 49.8459 156.4819 51.4622 156.8132 ZM 47.8597 148.918 C 51.1318 147.6284 61.6159 146.3728 71.1411 146.3728 C 89.1248 146.0774 92.7308 145.1194 85.5222 143.2007 C 83.2416 142.574 78.0192 140.9868 73.7523 139.4016 C 66.2133 136.561 50.8013 137.5193 49.185 140.6917 C 48.851 141.3201 47.1988 141.6516 45.579 141.3201 C 42.3069 140.3601 39.0313 142.9055 38.04 147.96 C 36.7147 152.0542 39.0313 152.3875 47.8597 148.918 ZM 21.6726 156.1865 C 22.3335 158.7319 25.6091 159.0271 28.2203 156.8132 C 29.8365 155.5596 29.8365 154.9329 28.2203 153.0144 C 26.895 151.1318 25.9396 151.1318 23.9534 152.719 C 22.6281 153.6414 21.6726 155.2266 21.6726 156.1865 ZM 11.192 178.3213 C 12.4779 178.3213 13.1388 179.2798 12.4779 181.1621 C 12.1833 182.4536 11.192 183.7073 10.5276 183.7073 C 9.5363 183.7073 8.9113 182.4536 8.9113 181.1621 C 8.9113 179.613 9.8667 178.3213 11.192 178.3213 Z", |
| | | |
| | | "maple-leaf": "M 82.7949 242.2583 C 77.6862 252.9512 74.1093 258.564 56.7309 264.1697 C 53.66 265.6975 57.7499 269.2642 59.8018 268.7527 C 75.1283 262.6421 78.7051 257.541 85.8658 246.3296 C 89.4427 260.6033 97.6154 269.7756 111.4169 275.3813 L 112.4428 272.3191 C 131.3531 282.5146 145.6606 284.554 157.9232 282.0032 C 169.6797 279.4526 183.4743 277.4204 194.7248 278.9482 C 187.571 273.342 183.4743 266.7134 181.9492 258.564 C 193.6989 246.3296 216.699 250.9192 227.9426 243.7856 L 225.3847 238.1729 C 249.9168 230.0234 270.872 216.7727 300 220.8511 L 251.9617 186.1934 L 252.9807 181.6035 C 238.6732 170.9036 222.3208 168.3528 203.9166 175.4932 C 210.0513 157.6528 203.9166 138.2915 220.7888 124.5298 C 216.699 116.8848 220.7888 106.1848 227.9426 96.5007 C 228.9686 78.1558 234.0704 61.8464 243.2691 47.0679 C 228.4487 56.752 213.6351 65.4128 198.3017 73.0613 L 195.7438 67.4521 C 189.616 77.1394 180.9233 84.2729 169.1668 88.3442 L 167.1219 82.7385 C 151.2755 98.5398 132.3721 106.6892 120.6155 129.6306 C 124.1924 107.2007 117.5447 85.2891 108.3461 67.4521 L 104.7692 71.0222 C 98.1284 49.1072 74.6222 34.8369 59.8018 17 C 65.9296 65.9243 48.0383 72.0383 48.5581 99.0513 L 42.4165 99.5557 C 51.1091 127.0801 39.3525 139.8193 44.9744 158.6758 C 30.6669 151.5422 12.2626 156.6365 0 145.425 C 14.8204 168.8713 19.9362 197.4048 44.9744 216.7727 L 41.3975 218.3005 C 50.5961 228.489 62.3527 237.157 82.7949 242.2583 Z", |
| | | |
| | | |
| | | "butterfly": "M 132.1899 141.4731 C 133.2701 142.188 135.5561 140.834 136.6667 140.6667 C 135.4167 139.0417 140.125 131.125 138.5 128.25 C 138 121.75 125.3439 107.0776 123.75 105.375 C 124.358 104.2332 131.1718 105.2957 130.9684 105.4595 C 128.125 107.75 140.5635 120.8953 142 128.5 C 144.6469 128.3535 148.1237 127.3618 149.6667 129 C 151.1076 127.4255 162.2255 115.3953 162.8333 105 C 162.9204 103.5103 168.9546 104.4531 167.8195 105.3611 C 166 111.8333 153.1691 130.0051 152.1667 130.6667 C 153.3333 136.3333 152.861 136.7217 160.3125 141.1279 C 163.666 133.2534 170.8113 126.5691 177.3557 119.9163 C 184.7454 112.4465 189.7048 105.2905 197.845 97.5144 C 208.5609 87.6365 222.2463 78.6233 234.7805 73.2429 C 243.5 69.5 258.1094 66.2913 260.349 66.0813 C 264.498 65.6785 268.25 65.75 273.1679 66.4807 C 280.4244 67.5588 287.5098 68.1609 295.1284 71.7371 C 302.2921 76.3269 299.8157 82.0793 298.48 87.4675 C 287.4467 99.6348 276.1462 114.2068 272.5872 129.1147 C 271.3906 134.6348 269.2391 144.147 264.1613 150.1221 C 255.9979 159.313 246.0071 158.9731 236.6201 160.219 C 242.3398 161.8567 248.5434 167.2041 254.1089 172.5776 C 262.7908 181.0295 267.0212 189.697 264.7792 199.1331 C 264.3019 201.1123 256.0239 216.1243 251.975 220.8347 C 236.6072 238.771 215.6852 250.9351 198.8225 248.9609 C 192.75 248.25 176 235.5 172.9885 231.7378 C 165.5126 222.3984 159.372 211.1333 159.1196 201.2981 C 158.1903 200.3696 157.0538 200.301 157.5549 199.0588 C 156.6237 201.9033 153.6667 211.1667 149.289 217.0229 C 142.9601 225.4893 137.1667 212.8333 134.8217 202.5698 C 134.0178 199.0515 134.6078 198.4424 133.6702 196.3386 C 129.2367 198.0208 131.5711 202.8984 129.8312 206.8386 C 128.3561 210.2698 121.75 220.75 119.9257 223.1392 C 114.0942 230.7764 101 242.3333 91.5037 245.1064 C 82.69 247.6802 75.22 247.3191 68.1365 243.686 C 59 239 46.124 228.1169 38.2026 219.2678 C 28.1746 208.3184 19.4099 191.8674 27.7518 180.2795 C 33.0762 173.0493 43.0985 162.2744 52.8922 159.6267 C 45.9788 158.78 30.683 154.2236 24.9946 141.5679 C 23.1688 137.5554 22.4915 131.3167 22.0271 126.853 C 21.2715 119.4836 17.9091 111.0168 15.1179 103.7605 C 12.8741 97.1265 8.9083 88.6335 4.7579 81.3755 C 0.4083 73.759 -3.1577 61.1648 4.4119 54.9631 C 7.0561 52.7964 15.2436 50.2693 16.9547 50.0891 C 22.936 49.4504 31.085 52.3877 37.1343 54.1499 C 41.0975 55.314 58.487 61.5269 63.2961 64.9478 C 95 87.5 117.5438 115.5918 132.1899 141.4731 Z", |
| | | "leaf_1": "m35.63904,285.5213c9.77121,-31.99348 23.14531,-59.08864 35.83149,-72.59245c13.5912,-14.46718 7.56125,-20.74258 -6.45918,-6.72212c-5.89857,5.89853 -7.58387,1.61555 -7.58387,-19.2735c0,-49.83961 25.83589,-80.67891 87.99842,-105.04016c52.59872,-20.61333 91.37741,-43.79435 107.45589,-64.23479l13.10197,-16.65652l0,28.9807c0,35.83507 -11.11781,89.97318 -23.42422,114.0641c-13.0549,25.55626 -57.80217,72.72934 -79.76038,84.08435c-19.67261,10.17316 -61.687,13.16808 -84.14172,5.99792c-11.19011,-3.57314 -14.7415,-0.84308 -20.53963,15.78944c-3.8556,11.06018 -7.0102,26.79501 -7.0102,34.96616c0,9.27652 -3.72057,14.8566 -9.90572,14.8566c-7.3461,0 -8.78352,-3.67429 -5.56284,-14.21973z", |
| | | "drop": "m115.15536,295.759c-42.01334,-15.78687 -72.12711,-65.94934 -65.28346,-108.74701c4.3154,-26.98718 95.35947,-190.81818 103.3105,-185.90417c2.59511,1.60386 25.68835,39.79974 51.31831,84.87975c41.0565,72.21342 46.5999,85.67899 46.5999,113.19665c0,55.77716 -44.6394,101.46498 -98.23825,100.54555c-15.6409,-0.26834 -32.60906,-2.05518 -37.707,-3.97076zm42.09262,-28.05386c1.39066,-7.22116 -1.85785,-10.74289 -9.90955,-10.74289c-18.35065,0 -43.80598,-23.24161 -49.49309,-45.18889c-6.0666,-23.41179 -22.15186,-26.19615 -24.52774,-4.24574c-4.57746,42.29059 76.21872,100.22086 83.93037,60.17752z", |
| | | "feather":"M 188.7044 276.8495 C 188.7044 276.8495 159.7298 274.7077 144.3849 266.5197 C 129.04 258.3316 121.8791 247.8918 121.8791 247.8918 C 121.8791 247.8918 129.932 256.8966 141.2327 263.7194 C 148.1224 267.879 156.2198 271.2277 164.4356 271.2277 C 164.4356 271.2277 151.7511 264.0633 142.2365 269.1805 C 142.2365 269.1805 149.0907 264.4724 160.9574 268.0547 C 172.8248 271.6369 178.7574 269.5897 178.7574 269.5897 C 178.7574 269.5897 158.7075 269.4874 150.0116 263.7557 C 141.3156 258.024 139.1672 254.7494 139.1672 254.7494 C 139.1672 254.7494 148.1699 264.0633 155.1263 265.1892 C 162.0827 266.3151 174.0517 264.9839 174.0517 264.9839 C 174.0517 264.9839 161.6738 265.2915 157.7859 263.5511 C 153.8987 261.8116 138.5538 258.3316 135.792 265.5983 C 135.792 265.5983 138.8605 257.9217 152.8756 260.1735 C 166.8907 262.4253 168.2213 261.7093 168.2213 261.7093 C 168.2213 261.7093 143.3618 252.0877 129.449 257.5126 C 115.5361 262.9374 116.4569 267.5432 116.4569 267.5432 C 116.4569 267.5432 117.3778 251.5763 151.3414 254.4418 C 151.3414 254.4418 135.4853 252.0877 129.6534 247.3797 C 123.8231 242.6716 123.4134 239.6015 123.4134 239.6015 C 123.4134 239.6015 130.0624 249.7337 138.2471 249.836 C 146.4311 249.939 148.784 249.2223 148.784 249.2223 C 148.784 249.2223 132.825 245.5378 125.2544 246.356 C 117.6845 247.1751 105.4089 249.836 98.9636 238.168 C 98.9636 238.168 104.9992 249.3246 121.4702 245.4355 C 137.9404 241.5457 148.2721 245.8446 148.2721 245.8446 C 148.2721 245.8446 123.3111 241.0342 118.1957 236.2239 C 113.081 231.4135 112.4676 223.1224 112.4676 223.1224 C 112.4676 223.1224 114.616 237.0421 125.1521 238.3734 C 135.6898 239.7038 151.6481 239.3962 155.8427 244.2073 C 155.8427 244.2073 145.3058 236.4284 134.3592 237.452 C 123.4134 238.4756 106.5335 252.5999 97.9405 248.9154 C 89.3476 245.2309 85.4597 248.301 85.4597 248.301 C 85.4597 248.301 89.0409 244.7188 95.1779 246.356 C 101.3165 247.9941 102.6463 250.4504 113.1832 243.1837 C 123.7201 235.917 141.6224 226.91 152.9779 234.6881 C 152.9779 234.6881 99.9193 219.9849 94.1912 190.099 C 94.1912 190.099 99.2355 210.0254 125.1521 218.8946 C 151.0695 227.7638 152.5689 227.0827 152.5689 227.0827 C 152.5689 227.0827 112.6046 222.8512 93.9171 186.8237 C 93.9171 186.8237 110.148 214.8002 135.3831 218.4847 C 135.3831 218.4847 114.1041 211.1158 97.599 188.5989 C 81.0962 166.0812 80.4116 158.5744 80.4116 158.5744 C 80.4116 158.5744 100.4645 194.6018 138.3849 201.0169 C 138.3849 201.0169 108.6819 192.5198 87.4036 165.3971 C 66.1254 138.2744 72.7751 132.9519 72.7751 132.9519 C 72.7751 132.9519 68.1716 123.2288 71.649 121.0793 C 71.649 121.0793 64.7948 113.3004 66.7388 106.955 C 66.7388 106.955 71.649 131.0069 96.713 146.7693 C 121.7769 162.5309 123.9253 164.4758 123.9253 164.4758 C 123.9253 164.4758 97.9405 146.667 89.7565 138.0691 C 81.5725 129.4719 72.3654 122.8189 67.0455 104.3964 C 67.0455 104.3964 72.161 122.6143 88.3245 135.1013 C 104.4873 147.5883 107.6595 147.383 107.6595 147.383 C 107.6595 147.383 74.5138 130.3932 66.6366 102.2469 C 66.6366 102.2469 71.2401 123.0242 107.7618 142.8802 C 107.7618 142.8802 71.1379 121.2839 66.6366 98.2548 C 66.6366 98.2548 65.8187 94.8772 67.3529 93.2399 C 67.3529 93.2399 65.5112 88.8386 66.1254 83.3115 C 66.7388 77.7851 67.4552 71.8489 67.4552 71.8489 C 67.4552 71.8489 65.8187 95.1848 88.529 113.1982 C 88.529 113.1982 61.7263 81.0583 71.2757 54.5849 C 71.2757 54.5849 69.228 69.1872 75.6392 75.8736 C 75.6392 75.8736 70.1822 64.1389 72.7751 50.3548 C 72.7751 50.3548 72.0921 64.9572 78.9129 78.1943 C 85.7338 91.4314 107.5573 117.0872 107.5573 117.0872 C 107.5573 117.0872 81.9148 87.0635 77.8224 70.1419 C 73.7308 53.2203 76.0481 42.1668 76.0481 42.1668 C 76.0481 42.1668 73.7308 57.9959 83.6876 73.8271 C 93.6444 89.6577 97.0552 91.4314 97.0552 91.4314 C 97.0552 91.4314 69.6369 62.9085 80.0027 31.249 C 80.0027 31.249 79.3219 63.3184 90.6426 77.1018 C 101.9655 90.8858 105.3733 91.295 105.3733 91.295 C 105.3733 91.295 82.0489 72.8717 82.8668 47.0795 C 83.6861 21.2872 88.0526 19.9227 88.0526 19.9227 C 88.0526 19.9227 78.3662 41.7555 93.9156 62.7729 C 109.4657 83.7903 106.329 79.8316 106.329 79.8316 C 106.329 79.8316 84.2329 51.1739 88.5979 28.7926 C 92.9629 6.4114 101.2824 6.6849 101.2824 6.6849 C 101.2824 6.6849 92.145 12.6886 92.5539 26.4719 C 92.9629 40.2553 106.0578 67.0029 106.0578 67.0029 C 106.0578 67.0029 91.4619 30.2943 95.418 18.9665 C 99.3726 7.6395 107.6944 4.2285 107.6944 4.2285 C 107.6944 4.2285 91.4604 13.5084 100.872 38.3459 C 100.872 38.3459 95.0076 14.7387 110.6925 3.6845 C 110.6925 3.6845 99.5089 14.3296 104.1458 34.1167 C 104.1458 34.1167 102.7819 9.8239 117.6489 1.5002 C 117.6489 1.5002 108.1033 9.0071 107.9662 24.1549 C 107.9662 24.1549 110.0124 8.8692 121.3324 0.272 C 121.3324 0.272 112.7387 13.3727 113.2854 32.2051 C 113.2854 32.2051 119.6966 13.6477 122.8348 0 C 122.8348 0 123.3786 7.3697 121.0605 16.5117 C 118.7424 25.6551 117.6512 26.4734 117.6512 26.4734 C 117.6512 26.4734 125.9707 14.1917 126.3804 2.1828 C 126.3804 2.1828 126.7894 13.9197 123.2437 23.7458 C 123.2437 23.7458 129.9972 18.3128 130.8477 6.2743 C 130.861 6.0949 130.8714 5.914 130.8817 5.7317 C 130.8817 5.7317 132.7901 23.3344 125.8337 38.2103 C 118.8773 53.0869 115.6035 54.4507 115.6035 54.4507 C 115.6035 54.4507 131.0188 39.8476 133.3369 19.6514 C 133.3369 19.6514 133.6095 30.9769 129.5179 40.8023 C 125.4262 50.6283 121.0605 58.1352 121.0605 58.1352 C 121.0605 58.1352 141.6564 39.437 138.2471 5.8681 C 138.2471 5.8681 142.2017 24.5626 138.6561 38.7558 C 135.1104 52.949 117.6489 74.7833 117.6489 74.7833 C 117.6489 74.7833 144.7946 50.764 146.0214 12.6901 C 146.0214 12.6901 149.2952 35.207 136.8143 55.6767 C 136.8143 55.6767 155.2285 34.7978 154.8196 14.9418 C 154.8196 14.9418 158.912 24.9717 155.433 38.6869 C 151.9555 52.402 135.3831 84.5397 118.1957 92.3186 C 118.1957 92.3186 164.8446 67.14 161.776 23.9489 C 161.776 23.9489 166.8907 43.5996 160.5485 62.6373 C 154.2062 81.6742 130.0624 110.7418 130.0624 110.7418 C 130.0624 110.7418 164.6401 78.8087 169.7556 44.0087 C 169.7556 44.0087 171.3921 33.3651 169.3459 27.0189 C 169.3459 27.0189 177.7351 30.7034 178.3485 46.4658 C 178.9619 62.2274 170.7787 83.5168 165.0498 98.4594 C 159.3209 113.4027 147.0453 133.2587 147.0453 133.2587 C 147.0453 133.2587 186.9422 72.258 181.2126 42.3714 C 181.2126 42.3714 191.4435 55.2675 190.2152 72.0535 C 188.9884 88.8386 180.3947 135.5105 156.4568 156.5946 C 156.4568 156.5946 182.2364 136.1249 189.3973 98.8693 C 189.3973 98.8693 193.08 79.0133 192.4659 68.1636 C 192.4659 68.1636 197.5806 91.0904 195.7396 108.2855 C 193.8986 125.4806 174.6658 163.9644 174.6658 163.9644 C 174.6658 163.9644 195.7396 131.826 197.1716 111.7654 C 197.1716 111.7654 199.4223 123.8425 197.7858 134.8968 C 196.1493 145.9503 186.7377 166.6253 178.7574 178.7024 C 178.7574 178.7024 195.5351 154.5482 199.0133 143.9031 C 202.4916 133.2587 201.8774 127.1179 201.8774 127.1179 C 201.8774 127.1179 205.9698 160.2799 199.4223 175.8369 C 192.8748 191.3939 172.2107 214.5253 170.7787 225.3742 C 170.7787 225.3742 180.3947 200.1964 201.264 196.3066 C 222.1333 192.4175 234 198.3538 234 198.3538 C 234 198.3538 202.2871 188.1186 185.3049 207.3608 C 185.3049 207.3608 176.712 217.8006 176.5068 227.2168 C 176.5068 227.2168 198.6044 211.6598 202.0819 190.3703 C 205.5608 169.0816 221.7244 165.8062 221.7244 165.8062 C 221.7244 165.8062 203.7191 172.5615 203.9236 190.9848 C 204.1281 209.408 183.4632 231.1059 178.553 230.4922 C 178.553 230.4922 195.3307 225.7841 201.264 211.6598 C 201.264 211.6598 197.3761 225.9886 188.9884 234.279 C 180.5992 242.5693 183.361 246.1515 183.361 246.1515 C 183.361 246.1515 186.2258 237.2475 194.6143 229.7754 C 203.0035 222.3041 214.0515 209.408 214.1538 200.7078 C 214.256 192.0084 223.3609 183.3082 223.3609 183.3082 C 223.3609 183.3082 216.2 192.4175 215.8925 198.9682 C 215.5858 205.5182 216.6089 215.7534 204.64 224.3513 C 192.6703 232.9485 187.6578 248.4033 187.8623 255.1585 C 187.8623 255.1585 196.2174 231.0377 220.7702 226.2621 C 220.7702 226.2621 197.3079 230.9013 188.9884 257.377 C 188.9884 257.377 204.537 230.9028 225.2707 223.9429 C 225.2707 223.9429 203.1739 233.3591 192.5347 256.4223 C 192.5347 256.4223 198.8089 240.044 218.4499 239.3629 C 218.4499 239.3629 202.0819 241.5457 195.3996 256.9671 C 195.3996 256.9671 198.3999 250.4186 209.5851 248.0979 C 220.7702 245.7772 230.1803 237.7255 227.8622 230.0823 C 227.8622 230.0823 230.7263 240.7252 216.1326 247.8229 C 201.5374 254.9206 195.4055 271.9161 195.4055 271.9161 C 195.4055 271.9161 207.2904 283.1744 216.8995 292.6617 C 216.1409 297.9746 213.5212 299.4365 211.0835 299.9987 C 210.2119 300.1997 189.8638 277.3056 188.7044 276.8495 Z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "raph_boy": "m210.33144,143.89894c-6.95941,-12.57172 -15.47375,-22.74984 -24.01424,-29.86983c-9.96541,7.29803 -22.10274,11.74199 -35.33479,11.74199c-13.25803,0 -25.41282,-4.45262 -35.36066,-11.74199c-8.54047,7.11999 -17.06351,17.29811 -24.04,29.86983c-16.19487,29.18793 -17.97591,59.1273 -3.98808,66.89018c6.26434,3.49693 12.83241,0.89052 19.61797,-5.6474c-1.19028,6.62904 -1.88538,13.81406 -1.88538,21.32939c0,33.38869 12.97153,60.43492 28.95753,60.43492c9.6353,0 14.40506,-9.84814 16.69862,-24.92639c2.2851,15.07825 7.05482,24.92639 16.6552,24.92639c16.01227,0 28.98392,-27.04623 28.98392,-60.43492c0,-7.51534 -0.69533,-14.70035 -1.91148,-21.32939c6.80278,6.53792 13.36221,9.14433 19.64394,5.6474c13.97922,-7.76288 12.17188,-37.70226 -4.02254,-66.89018zm-59.36613,-29.51799c26.89833,0 48.71428,-21.8159 48.71428,-48.72745s-21.81595,-48.72751 -48.71428,-48.72751c-26.90748,0 -48.74066,21.82024 -48.74066,48.72751s21.83318,48.72745 48.74066,48.72745z", |
| | | "raph_girl": "m210.47775,159.31802c-6.5556,-11.85419 -14.5853,-21.4483 -22.63556,-28.15549c-9.39328,6.87933 -20.83389,11.06407 -33.31883,11.06407c-12.49292,0 -23.95,-4.19719 -33.33109,-11.06407c-8.05025,6.70718 -16.07988,16.3013 -22.66017,28.15549c-15.26108,27.50842 -16.94806,55.72913 -3.76718,63.05058c5.9046,3.29617 12.09998,0.83537 18.49591,-5.32317c-1.12607,6.24446 -1.79353,13.01715 -1.79353,20.10512c0,31.47218 12.22685,56.96574 27.29962,56.96574c9.078,0 13.57817,-9.28665 15.73595,-23.49945c2.15787,14.2128 6.65384,23.49945 15.71159,23.49945c15.09309,0 27.3199,-25.49356 27.3199,-56.96574c0,-7.08797 -0.65509,-13.86066 -1.80157,-20.10512c6.41638,6.15854 12.59937,8.61934 18.5162,5.32317c13.20151,-7.32146 11.4939,-35.54216 -3.77124,-63.05058zm-55.96663,-27.82361c25.36684,0 45.93047,-20.56793 45.93047,-45.93063s-20.56363,-45.93048 -45.93047,-45.93048c-25.36276,0 -45.94283,20.56364 -45.94283,45.93048s20.58006,45.93063 45.94283,45.93063zm31.37788,-94.27703c13.25461,4.88095 5.27805,-7.78414 5.27805,-16.43626s8.1813,-19.23294 -5.27805,-14.92929c-14.12682,4.52865 -25.57977,7.01829 -25.57977,15.68267s11.45296,10.47439 25.57977,15.68288zm-31.29187,-6.16252c8.39418,0 3.70572,-4.25034 3.70572,-9.48752c0,-5.24121 4.70074,-9.47933 -3.70572,-9.47933s-4.01289,4.25037 -4.01289,9.47933c0,5.24941 -4.38142,9.48752 4.01289,9.48752zm-31.47208,6.16252c14.12683,-5.1963 25.57968,-7.02252 25.57968,-15.68288s-11.45285,-11.15402 -25.57968,-15.68267c-13.45937,-4.31592 -5.28221,6.26888 -5.28221,14.92929s-7.98471,21.30898 5.28221,16.43626z", |
| | | "raph_pen": "m146.83684,115.71881c-0.45042,-0.67755 -1.00925,-1.34163 -1.72177,-1.85109c-3.04871,-2.2215 -7.351,-1.54391 -9.58611,1.52216c-2.23131,3.07336 -1.52603,7.36902 1.52969,9.59677c2.77647,2.01186 6.48155,1.52948 8.8457,-0.83739l-64.87093,89.42747l-20.16745,73.20351l63.32053,-41.89926l144.20293,-198.7902l-43.17049,-31.31054l-13.91629,19.18622c-0.79611,-3.19165 -2.57372,-6.18823 -5.45471,-8.29767c-6.68427,-4.84662 -16.02917,-3.38049 -20.87282,3.3172c-27.75597,38.28942 -12.36926,48.48591 -38.13829,86.73282zm-31.75805,119.69107l-32.57163,21.55399l10.37183,-37.68758l22.19981,16.13359zm38.36887,-121.63963c19.98219,-29.52283 18.07886,-37.52791 35.18015,-63.73244c2.82889,1.94135 6.07655,2.62617 9.2648,2.45808l-44.44495,61.27437z", |
| | | "raph_clip": "m254.98035,21.30912c-21.11665,-15.11687 -50.51465,-10.26612 -65.65204,10.86102l-118.72278,165.76295c-10.80711,15.07626 -7.34069,36.07983 7.75584,46.88922c15.09648,10.78922 36.07957,7.32249 46.88668,-7.77365l83.82764,-117.02809l-10.92749,-7.83544l-83.81487,117.03815l0,0c-6.49191,9.03548 -19.08845,11.1275 -28.12135,4.6667c-9.04539,-6.47157 -11.11713,-19.07556 -4.63807,-28.13162l0,0l118.70741,-165.75288l0.01529,-0.01052l-0.02554,-0.01006c10.79433,-15.04511 31.84402,-18.52175 46.89943,-7.74307c15.05548,10.78889 18.53748,31.84415 7.75841,46.89928l0,-0.01001l-130.12462,181.67987l0.01277,0.02063c-15.10905,21.08588 -44.57393,25.95731 -65.66481,10.86099c-21.09067,-15.12738 -25.94428,-44.56136 -10.84798,-65.66789l94.56806,-132.03191l-10.93002,-7.82487l-94.56529,132.03193c-19.45266,27.15742 -13.20177,64.92889 13.96575,84.37384c27.16738,19.46548 64.93915,13.20953 84.39181,-13.93738l130.12166,-181.69052c15.09668,-21.11655 10.25589,-50.49928 -10.87589,-65.63668z", |
| | | "raph_tshirt": "m191.01682,41.7402c-6.65135,16.37186 -22.65103,27.93963 -41.39505,27.93963c-18.75568,0 -34.7588,-11.56777 -41.3954,-27.93963l-101.36017,42.98543l28.51685,67.20866l31.32125,-13.28813l0,137.02332l166.93693,0l0,-136.53912l30.19667,12.81158l28.52783,-67.2086l-101.34891,-42.99313z", |
| | | "raph_clip": "m254.98035,21.30912c-21.11665,-15.11687 -50.51465,-10.26612 -65.65204,10.86102l-118.72278,165.76295c-10.80711,15.07626 -7.34069,36.07983 7.75584,46.88922c15.09648,10.78922 36.07957,7.32249 46.88668,-7.77365l83.82764,-117.02809l-10.92749,-7.83544l-83.81487,117.03815l0,0c-6.49191,9.03548 -19.08845,11.1275 -28.12135,4.6667c-9.04539,-6.47157 -11.11713,-19.07556 -4.63807,-28.13162l0,0l118.70741,-165.75288l0.01529,-0.01052l-0.02554,-0.01006c10.79433,-15.04511 31.84402,-18.52175 46.89943,-7.74307c15.05548,10.78889 18.53748,31.84415 7.75841,46.89928l0,-0.01001l-130.12462,181.67987l0.01277,0.02063c-15.10905,21.08588 -44.57393,25.95731 -65.66481,10.86099c-21.09067,-15.12738 -25.94428,-44.56136 -10.84798,-65.66789l94.56806,-132.03191l-10.93002,-7.82487l-94.56529,132.03193c-19.45266,27.15742 -13.20177,64.92889 13.96575,84.37384c27.16738,19.46548 64.93915,13.20953 84.39181,-13.93738l130.12166,-181.69052c15.09668,-21.11655 10.25589,-50.49928 -10.87589,-65.63668z", |
| | | "raph_tshirt": "m191.01682,41.7402c-6.65135,16.37186 -22.65103,27.93963 -41.39505,27.93963c-18.75568,0 -34.7588,-11.56777 -41.3954,-27.93963l-101.36017,42.98543l28.51685,67.20866l31.32125,-13.28813l0,137.02332l166.93693,0l0,-136.53912l30.19667,12.81158l28.52783,-67.2086l-101.34891,-42.99313z", |
| | | "ball": "m1.36762,144.54343c-0.61252,-24.33647 11.43968,-48.24649 31.71385,-61.85355c33.0555,-25.12355 76.68359,-36.57172 117.69406,-29.65477c20.30775,-3.13354 29.29549,17.94864 22.15137,34.18353c-11.04268,10.79923 -30.25032,0.52836 -44.5518,6.11385c-46.3661,5.97041 -92.1348,26.12911 -123.47163,61.54787c-0.19116,-3.78908 -5.04203,-6.31387 -3.53584,-10.33693zm0.56006,21.59657c2.46893,-17.16783 19.59014,-26.10648 31.49495,-36.53964c40.07716,-28.36518 90.31613,-39.61352 138.89854,-37.70576c1.20387,19.56051 -8.00084,38.23036 -19.07559,53.7263c-15.20721,8.47826 -34.11861,-1.17561 -50.23914,6.54221c-28.27367,6.8441 -59.74523,15.46761 -77.84163,40.11734c-6.57559,19.79451 -20.47401,-0.35286 -21.54921,-12.00313c-1.52846,-4.62877 -1.3158,-9.384 -1.6879,-14.13731zm7.76269,-58.70418c2.42006,-21.53997 16.61662,-39.35048 29.64042,-55.76294c14.68114,-17.49181 34.66698,-30.31521 57.12629,-35.01287c17.80165,-4.64955 36.14864,-6.58389 54.39959,-8.53692c13.84103,10.63111 22.64574,29.11792 20.32661,46.60463c-10.75017,2.72292 -29.7578,-6.48294 -44.25362,-4.23798c-41.11142,0.38721 -83.13954,16.86419 -110.9226,47.60359c-2.31326,2.96635 -4.3931,6.11006 -6.31669,9.34248zm-2.20363,84.97105c15.37329,12.3277 15.8773,33.69405 25.32488,49.77684c-11.32475,-14.57886 -21.29314,-31.61081 -25.32488,-49.77684zm12.17333,11.7446c4.82258,-13.28815 19.94093,-31.96367 32.55468,-30.57486c5.04242,12.98813 7.22698,27.06129 15.42273,38.77007c22.00548,40.39473 62.27551,75.33984 110.15025,76.43997c7.82913,1.58691 28.58411,-3.6853 27.74063,-1.50394c-20.00963,9.82742 -43.17618,11.98239 -65.22374,11.19174c-40.94611,-2.71915 -81.7309,-22.38535 -106.34646,-55.65858c-6.96676,-11.95032 -10.92698,-25.33659 -14.29809,-38.66251zm33.70255,-33.88084c11.04849,-5.13829 31.74819,-20.7682 40.05036,-8.17067c20.26116,39.90601 54.51507,73.83781 96.68548,89.7942c21.8947,7.30453 46.52556,7.18939 67.87685,-1.92662c-8.90472,13.82597 -23.64018,22.69292 -37.52655,30.83714c-35.49046,15.14874 -78.39111,6.93469 -108.29421,-16.68286c-28.94243,-22.9118 -51.66176,-55.70389 -58.71476,-92.285l-0.04169,-0.84726l-0.03548,-0.71893l0,0l0,0zm14.80587,-143.69432c26.85995,-18.47492 60.14433,-27.13922 92.60995,-24.83766c-16.61871,10.60714 -37.47179,6.57748 -55.695,12.32051c-12.71339,2.76803 -25.33243,6.4903 -36.91495,12.51714zm23.19239,130.17215c17.68391,-8.37067 37.80864,-8.2348 56.92004,-7.08942c11.52194,17.94525 19.73788,38.80402 37.6284,51.74121c20.84937,18.617 51.18832,23.87227 77.45898,15.12419c9.02167,-6.09496 19.03778,-2.20023 14.1109,9.88971c-5.93085,20.07378 -26.98962,28.88977 -46.28781,29.86346c-39.48146,3.94382 -75.60028,-18.48682 -102.27098,-45.57831c-15.55914,-15.57706 -28.70033,-33.74123 -37.55954,-53.95085zm59.9713,-149.25921c14.39017,-11.41684 33.98842,-1.08634 48.71259,4.37706c14.6449,12.52997 16.60739,33.37817 20.47758,51.17717c6.47049,41.78263 3.85324,86.6684 -15.69031,124.8082c-4.67027,13.36929 -18.09242,20.61154 -26.69522,6.15724c-9.99724,-11.02568 -17.64142,-23.85532 -24.85538,-36.77173c-4.26648,-12.35977 9.69913,-21.07201 12.62395,-32.37317c5.6987,-11.2672 7.1479,-23.94022 7.7876,-36.27168c2.68518,-18.44756 0.04341,-37.58501 -4.80806,-55.44724c-3.40224,-9.88385 -8.92734,-19.45691 -17.55275,-25.65586zm41.36089,197.33399c28.32747,-32.0033 32.81847,-77.44762 30.6862,-118.36129c-1.29825,-24.12249 -4.96657,-49.05092 -17.68674,-70.0582c13.14473,0.40704 27.28206,12.75397 37.58124,21.8466c29.18982,37.11403 37.77368,91.40852 15.58273,134.05255c-8.72922,17.24329 -20.55305,32.80717 -34.43375,46.22929c-11.62009,-0.9548 -23.39864,-5.3515 -31.72969,-13.70895zm32.30334,13.89389c30.50691,-29.40305 52.59978,-71.66214 46.00664,-114.99303c-2.62479,-20.29454 -10.03497,-39.89902 -21.13239,-57.06778c20.32477,12.66527 31.62595,35.09759 41.79111,55.93748c14.61285,36.42265 6.66864,80.8159 -19.44537,109.92648c-13.41086,7.60643 -32.33356,8.77071 -47.21999,6.19685zm50.22404,-6.80072c10.46527,-18.28113 22.34006,-36.81323 23.43076,-58.50224c1.62656,-7.25171 -0.89633,14.22787 -1.77191,18.74721c-2.78329,15.96013 -6.41766,32.99399 -16.3092,46.01608c-2.27573,-1.26239 -1.2605,-7.4102 -5.34964,-6.26105z", |
| | | "bolt": "m178.14388,74.00616l-108.49727,68.79685l107.15599,23.63498l-99.04335,73.85934l-39.98779,-12.47227l28.36194,71.19228l112.7131,-31.06076l-47.58928,-12.98325l129.22581,-106.08589l-118.12698,-19.22734l114.07071,-71.6874l-65.0681,-10.76349l70.86891,-45.56109l-26.03423,-0.65478l-109.97452,62.50492l51.92505,10.50792z", |
| | | "car_smart": "m28.92024,238.37814c-20.54175,-8.15092 -27.36674,-32.3504 -27.6178,-52.52942c-2.7836,-14.94118 14.71887,-25.93048 8.95686,-41.2937c-2.18657,-22.71175 4.68564,-45.20703 14.9548,-65.22043c0.32475,-12.85873 10.87969,-17.84956 22.37955,-17.11762c37.15603,-4.71741 74.98359,-4.84966 112.15372,-0.39277c22.18198,4.11681 39.85953,19.32546 58.61859,30.81274c11.63586,8.63808 25.21985,14.32888 36.92355,22.63131c12.64026,10.62529 24.51556,22.47708 33.27448,36.57193c3.15143,14.09033 7.38165,28.09947 9.54742,42.2829c4.39661,13.27223 -4.6037,21.62047 -11.41214,30.84103c-10.34,12.57306 -29.90723,17.53416 -44.71561,10.78313c-10.28528,-3.75465 -14.07077,-19.70746 -25.7968,-18.60466c-44.20906,-0.65964 -88.41812,-1.31926 -132.62719,-1.97884c-10.24168,13.44736 -24.40165,28.14365 -42.91705,26.05086c-4.02312,-0.33679 -7.97831,-1.33774 -11.7224,-2.83646z", |
| | |
| | | "dagger": "m1.57422,47.21264c-2.775,14.24454 5.08469,27.79975 11.2199,40.10517c13.07098,21.70464 28.2358,42.59465 47.26681,59.46329c12.98537,10.6889 24.68548,22.99878 39.38902,31.4678c19.22253,12.95224 39.86254,23.55869 61.26455,32.3793c15.9138,6.93546 32.60274,11.85577 49.65401,15.08282c4.95967,1.28564 18.82625,4.91663 10.19991,-3.60251c-7.15544,-3.02133 -14.76756,-5.22583 -21.96236,-8.37695c-34.92769,-14.34082 -72.04247,-26.94104 -100.21951,-53.10463c-4.66899,-6.20064 8.95855,3.3492 11.3067,5.96803c23.50703,16.73581 50.36192,27.95749 76.84653,39.04178c13.47301,4.46384 28.20039,13.97903 42.51408,7.22675c12.36502,-4.72467 -2.95702,-5.44891 -8.42033,-7.24844c-24.28337,-6.90491 -48.85286,-13.54227 -71.13893,-25.76019c-12.72568,-4.65573 -23.42126,-13.22678 -34.85331,-20.29132c-12.35065,-8.53128 -23.65424,-18.49934 -35.67798,-27.49634c-7.86864,-5.96642 -15.68669,-11.98865 -22.20108,-19.46664c-11.01625,-11.02383 -21.70009,-22.36108 -31.68482,-34.33246c-6.52307,-7.36439 -13.86146,-14.10685 -18.44664,-22.93894l-5.05655,-8.11652zm256.45175,139.13108c-1.50562,-0.04745 -3.06,0.28214 -4.36211,1.15021c-9.72246,4.86124 -7.63908,13.88922 -13.19478,20.83386c-4.16678,5.55569 -9.028,8.33356 -15.97261,10.41693c1.38892,2.77783 4.16675,6.94461 4.16675,10.41693c0,7.63907 -9.02798,14.58368 -15.97261,13.88922c-2.77786,-0.69446 -9.028,-4.16678 -11.11139,0c-0.69446,1.38895 -0.69446,2.77786 0,3.47232c0,2.77786 3.47231,4.16678 6.25015,5.55569c7.63908,2.08337 15.97263,-0.69446 22.22279,-4.86124c4.86122,-2.77783 8.33353,-7.63907 9.72246,-13.19479l1.38892,-9.02798c0.69446,-2.77783 3.47232,-3.47232 6.94463,-8.33353c4.16676,-5.55569 8.33354,-15.2782 13.88924,-19.44495c2.08337,-1.38892 4.16675,-2.0834 6.94461,-2.77786c-1.38892,-2.08337 -2.77786,-3.47229 -4.16678,-5.55566c-1.38892,-0.69449 -2.77783,-2.0834 -4.16675,-2.0834c-0.78128,-0.26041 -1.6792,-0.42728 -2.58252,-0.45575zm29.4061,26.21594c-2.61084,-0.02899 -5.33868,0.54254 -8.07312,1.32382l5.55569,3.47232c-1.38895,2.77783 -4.86121,8.33353 -4.16678,11.80585c0.69449,6.94461 10.41693,6.94461 14.58371,2.77783c4.86124,-5.55569 4.86124,-13.88922 -2.08337,-18.056c-1.82297,-0.91147 -3.78549,-1.30127 -5.81613,-1.32382zm-13.39011,3.40723c-0.54364,0.00192 -1.07498,0.00705 -1.60593,0.0217c-3.8486,0.21091 -7.69568,0.50116 -11.54541,0.67276c-2.41867,0.03116 -4.88754,-0.00473 -7.22676,0.69446c-3.17285,2.02515 -5.29396,5.38272 -6.53229,8.87607c-0.16666,0.50345 -0.30807,1.02072 -0.41234,1.54083c3.86218,1.74924 8.17189,1.5618 12.30499,1.41064c2.50439,-0.06696 5.00949,0.24561 7.50888,0.36893c1.7876,0.07916 3.57104,0.32327 5.36038,0.26044c2.19412,-0.07278 4.22598,-1.3168 5.38205,-3.16849c0.99927,-1.58255 1.9447,-3.21933 2.56085,-4.99146c0.49768,-1.59048 0.5896,-3.80087 -1.06339,-4.75272c-1.43857,-0.79446 -3.10013,-0.93906 -4.73105,-0.93317zm2.53915,15.9726c-0.69449,0.69446 -1.38892,0.69446 -2.0834,1.38892c-0.69446,3.47232 8.33356,11.80588 9.72247,4.16678c-3.47232,-1.38892 -5.55573,-2.77786 -7.63907,-5.55569z", |
| | | "menorah": "m86.17095,270.72717c9.02267,-23.09398 33.59461,-36.70894 57.45916,-38.45409c0,-4.91623 0,-9.83244 0,-14.74866c-38.305,-2.75075 -76.20534,-18.86525 -101.66333,-48.29793c-23.2569,-24.97108 -35.58256,-58.55817 -37.27682,-92.42073c-13.45491,-9.58464 12.56556,-16.55834 15.7355,-5.95607c-7.24909,8.79617 -0.22592,22.59306 0.80432,33.36646c11.47956,50.91395 56.38975,91.60496 107.78628,98.82449c13.14264,5.82442 16.6395,-2.00252 14.39308,-13.99509c2.81267,-9.48175 -7.44086,-6.60333 -13.57417,-8.37358c-40.52152,-7.1041 -75.7263,-38.65041 -86.11595,-78.75394c-2.97659,-11.47399 -3.94458,-24.11363 -7.5694,-33.51495c7.70256,-6.02401 26.19639,-1.60448 15.97076,9.15671c1.09565,45.56244 38.91488,85.76277 83.65269,91.48959c9.24995,4.52249 8.18915,-3.21457 7.85701,-9.40932c4.90146,-15.06035 -9.71606,-12.79654 -19.53952,-16.50067c-27.62657,-9.39215 -47.87568,-36.35101 -49.79039,-65.51331c-13.2153,-11.51691 15.74928,-17.53994 15.95383,-5.55531c-7.59098,8.84892 0.96818,23.21689 5.54156,32.6564c10.3335,16.84724 28.24842,28.22102 47.83452,30.47823c0,-7.52246 0,-15.04491 0,-22.56738c-18.20905,-2.81535 -32.7534,-18.72141 -34.8131,-36.97318c-12.40635,-10.10166 14.58986,-14.97282 16.53119,-5.29626c-6.736,5.28018 -1.66743,13.75206 2.28733,19.47478c2.82583,3.38407 16.81124,15.16281 15.99458,6.28913c0,-10.03232 0,-20.06463 0,-30.09695c-8.52963,-5.41637 3.21713,-9.02356 -1.91258,-15.41792c2.95047,-6.63559 4.28693,-23.79965 6.49635,-24.00391c7.40089,10.5439 4.63795,25.17949 11.62167,34.34932c-3.85376,4.14688 -4.52328,8.74758 -3.86568,14.89357c0,8.05796 0,16.11592 0,24.17388c11.03737,-3.24367 21.02812,-12.42406 21.72646,-24.48188c-12.61211,-14.80839 30.69243,-11.52931 12.71999,1.59949c-1.87195,17.85434 -17.0993,32.57059 -34.44644,35.57887c0,7.49281 0,14.98562 0,22.47842c29.68999,-2.98224 55.87296,-29.1582 56.39926,-59.47436c-12.36238,-13.6567 27.91393,-12.75137 14.12813,-0.52898c-3.16423,14.80594 -6.23018,30.54218 -16.29872,42.63571c-12.70108,17.1765 -33.04718,27.37456 -53.98901,29.78134c0.16994,9.14496 -4.65584,28.46082 11.13493,20.75519c39.31322,-6.69104 72.74197,-39.63307 78.74797,-79.43351c5.73982,-8.84732 -8.70837,-25.00382 8.28397,-22.77648c10.50046,-2.44997 11.98193,6.34405 5.8692,11.72792c-2.04736,35.89314 -21.91298,70.45303 -53.09749,88.60141c-15.52945,9.13074 -33.16388,14.88533 -51.17824,15.85547c0.17836,7.53169 -0.4761,15.16116 0.61618,22.6142c35.31798,-2.81911 70.08339,-18.10321 93.11932,-45.67516c20.51892,-23.04272 31.08511,-53.43816 32.84753,-84.00375c-10.43478,-10.04525 11.39471,-11.61442 16.59445,-7.04305c-5.883,11.66189 -5.21661,27.04671 -9.11984,40.52295c-12.68921,53.08224 -58.41412,95.84925 -111.85593,105.51876c-7.32545,1.56883 -14.77785,2.36348 -22.20172,3.29227c-0.71042,9.09981 -0.50818,18.35449 11.59822,16.61531c20.59241,4.32626 40.36211,18.55411 46.94081,39.19469c-43.09088,0 -86.18179,0 -129.2727,0c0.31159,-0.88608 0.62314,-1.77219 0.93477,-2.65823zm-82.88959,-208.5947c-0.54892,-8.1144 4.33617,-25.42208 5.66115,-27.43132c2.27143,7.42761 12.58555,23.78434 4.72879,28.60384c-3.29131,-0.38358 -8.04816,1.57556 -10.38994,-1.17252zm34.52483,0.55147c-1.7146,-10.01769 5.4567,-19.41309 4.51432,-29.75311c3.2196,8.43034 16.36395,29.47998 1.96646,30.42084c-2.16732,-0.0773 -4.38702,0.03559 -6.48078,-0.66772zm35.62526,-0.17229c-1.52428,-9.82734 5.20364,-19.12723 4.61758,-29.264c3.98769,8.50923 17.39558,32.7104 -0.82941,30.07944l-1.91212,-0.12625l-1.87605,-0.68919l0,0zm34.60818,0.26421c-1.9521,-10.01891 5.40411,-19.48301 4.43661,-29.84504c3.27068,8.4848 16.29427,29.36411 1.98981,30.63179c-2.15335,-0.08198 -4.37302,0.0215 -6.42642,-0.78675zm69.2087,-0.38279c-1.5544,-10.07727 5.31645,-19.6095 4.34973,-30.05398c2.70531,5.08463 6.32187,13.73424 7.91895,20.50951c4.77353,11.03205 -3.95122,12.51878 -12.26868,9.54446zm35.71176,0.44493c-2.89404,-9.75608 5.30412,-19.55815 4.07715,-29.90718c3.42241,8.32418 12.40758,23.15913 6.53528,30.337c-3.53609,0.01955 -7.13571,0.41735 -10.61243,-0.42982zm34.8703,-0.20629c-2.23303,-8.13288 4.34842,-24.82986 5.07388,-28.23849c3.49849,8.39077 16.5291,33.58521 -2.7937,28.93562l-2.28018,-0.69713l0,0zm35.10023,-0.15336c-1.90784,-8.93159 5.20419,-21.786 4.83258,-28.71239c3.47043,8.02287 16.97986,32.30244 -0.94669,29.60343l-1.89111,-0.14957l-1.99478,-0.74147l0,0z", |
| | | "chair": "m118.11539,289.55515c-7.47328,-14.4328 15.76004,-21.83389 9.75156,-35.26642c-9.58212,-8.59285 -23.93785,-6.58557 -35.88018,-5.92961c-12.89955,-1.58955 -16.67669,11.62587 -24.11323,17.11729c-14.66394,-4.57965 -9.41961,-23.5907 3.95336,-25.69879c17.48831,-7.56879 36.79559,-3.21786 54.96046,-6.57193c13.14571,-7.65541 -3.09947,-24.09541 -13.42245,-25.84244c-17.08451,-6.9008 -38.18468,-7.0844 -51.24073,-21.62146c-5.1916,-11.32457 -3.84497,-32.04767 10.15321,-36.01445c6.34414,-10.73523 5.01785,-24.55999 3.35027,-36.47948c1.42348,-12.67513 -26.70474,-5.25126 -14.90233,-18.24577c10.64336,-8.15804 24.36629,-13.15867 37.81105,-12.959c10.96933,0.36309 11.71716,12.99065 -0.37628,9.89848c-12.30081,6.18077 -7.72121,23.86169 -7.25122,35.16668c5.93514,11.39347 22.04794,5.36764 32.49831,7.07384c14.8665,0.39955 21.73593,0.44463 35.83476,5.23605c14.25958,-1.05464 8.64325,-20.61657 0.17079,-21.97119c-13.03212,-2.87206 -25.91483,-10.25501 -33.20317,-21.62909c-4.07215,-13.26593 1.69855,-27.24597 4.77583,-40.18096c9.18196,-28.0861 34.13237,-54.57027 65.33606,-54.63913c19.15414,0.28833 38.85675,14.48402 42.13089,33.82922c2.48616,20.34066 -5.57245,41.0622 -0.32005,61.11538c12.75343,7.04288 -8.70227,17.78406 -9.16336,27.50478c-5.43883,14.13736 6.97403,30.55498 -3.65417,43.29654c-6.64983,9.38159 -22.16026,14.5639 -22.43275,27.04953c-3.81845,11.24202 -21.47061,10.39703 -30.28923,17.71931c-9.74564,2.86838 -15.08257,19.17726 -0.15649,15.9317c14.55153,-0.35892 29.03516,-5.81784 43.55118,-3.3181c10.39314,7.10063 -0.45073,21.22018 -10.9113,14.54475c-5.46445,0.08383 -25.63857,2.80356 -18.76688,8.69054c17.18895,4.015 35.8273,9.2104 46.95854,24.0352c10.43184,13.90863 -12.73763,17.22995 -17.34935,5.0022c-19.29245,-15.75378 -48.30531,-24.24933 -70.97163,-10.48508c-13.71143,5.73386 -10.53542,20.53958 -11.98199,31.56015c-5.57972,6.09451 -13.26627,-2.5275 -14.84946,-7.91876zm100.26077,-153.99353c-4.62421,-8.64436 -27.69229,-17.16811 -30.82967,-4.71919c1.76141,12.68575 19.62196,15.68971 29.15408,10.51048c1.73547,-1.32053 2.45361,-3.74493 1.67558,-5.79129z", |
| | | |
| | | |
| | | "bone": "m273.3559,119.27242c-11.58661,5.90293 -23.89537,9.95385 -36.67676,12.27164c-53.42084,0.2984 -105.13121,0.41397 -158.74251,2.97562c-14.28426,-2.65407 -30.58815,0.18161 -42.82426,-9.13783c-9.06827,-7.25944 -28.17529,-2.4415 -25.05096,11.36483c6.17649,14.08824 -14.61965,21.70474 -7.59176,36.00003c6.11589,14.67987 24.54805,9.02721 35.59484,4.1729c20.29636,-4.79665 40.55842,-9.8537 60.92737,-14.38416c42.52868,-4.82219 82.54949,-1.83121 124.59118,1.02063c11.68694,2.54654 23.55803,4.03351 35.45654,5.38187c10.1839,0.16006 18.34979,7.46698 27.92017,8.65919c12.6539,-1.22533 16.41983,-19.19981 7.59747,-27.17406c-13.18918,-8.72406 6.75436,-24.14882 -8.14166,-31.38885c-4.25287,-2.31086 -8.733,-0.75754 -13.05966,0.23817z", |
| | | "raph_gear2": "m162.95016,254.38129c-2.80937,0.26439 -5.68164,0.44717 -8.63573,0.44717l0,0c-2.64238,0 -5.20918,-0.14467 -7.71307,-0.35916l0,0l-21.68047,27.86606l-5.33187,-1.51157c-6.25791,-1.75732 -12.33638,-3.96201 -18.18163,-6.60748l0,0l-5.06733,-2.29276l1.30382,-35.00255c-4.60764,-3.22517 -8.90648,-6.81548 -12.88757,-10.75204l0,0l-34.27816,7.36342l-3.13052,-4.59854c-3.67223,-5.39792 -6.80273,-11.05444 -9.57725,-16.77345l0,0l-2.40936,-4.99521l23.2742,-25.7621c-1.45512,-5.4549 -2.41877,-11.08614 -2.91638,-16.82405l0,0l-30.84222,-16.30753l0.56056,-5.52432c0.66148,-6.60759 1.94003,-12.93144 3.46751,-19.00977l0,0l1.36378,-5.39204l34.401,-4.76184c2.45332,-5.17765 5.34148,-10.08439 8.59473,-14.69526l0,0l-13.12671,-32.31919l3.96201,-3.8801c4.65784,-4.53519 9.64348,-8.64822 14.84618,-12.40874l0,0l4.50686,-3.24997l29.69582,18.65062c5.00454,-2.30524 10.23878,-4.20122 15.66204,-5.65638l0,0l10.76474,-33.40262l5.54927,-0.4219c2.98885,-0.22039 6.20128,-0.47875 9.69389,-0.47875l0,0c3.48323,0 6.68608,0.25836 9.67506,0.47875l0,0l5.54912,0.4219l10.88121,33.74931c5.21544,1.45478 10.27031,3.31305 15.11414,5.56818l0,0l30.11157,-18.91571l4.52254,3.25032c5.20284,3.75422 10.19766,7.8798 14.84639,12.39616l0,0l3.97758,3.8801l-13.52985,33.27679c2.94791,4.28308 5.60591,8.81837 7.87672,13.58657l0,0l35.47502,4.91299l1.37939,5.39169c1.54953,6.07229 2.82196,12.39613 3.46741,19.01633l0,0l0.56073,5.52397l-31.91942,16.87434c-0.47862,5.23462 -1.32898,10.3871 -2.59824,15.40709l0,0l24.04893,26.56871l-2.41867,5.01361c-2.76517,5.73837 -5.88004,11.41356 -9.56799,16.79272l0,0l-3.13049,4.58539l-35.12848,-7.52676c-3.72264,3.72243 -7.75381,7.14909 -12.06235,10.24184l0,0l1.33846,35.68912l-5.07996,2.29913c-5.85167,2.6329 -11.92058,4.84381 -18.17828,6.6012l0,0l-5.351,1.51169l-21.72769,-27.93539l0,0zm27.87856,8.93823c1.87401,-0.62378 3.71637,-1.29791 5.53973,-2.01599l0,0l-1.25342,-33.70486l3.95258,-2.53862c5.92082,-3.84203 11.31258,-8.453 16.09976,-13.68709l0,0l3.18718,-3.48941l33.239,7.11739c0.99838,-1.66928 1.96515,-3.37619 2.89732,-5.12077l0,0l-22.73553,-25.13866l1.41093,-4.49123c2.00607,-6.46886 3.14622,-13.40402 3.48315,-20.64091l0,0l0.20787,-4.71185l30.19965,-15.961c-0.31488,-1.93385 -0.67691,-3.85492 -1.0896,-5.78259l0,0l-33.60109,-4.64815l-1.80759,-4.34639c-2.7023,-6.50063 -6.27693,-12.58513 -10.54437,-18.19731l0,0l-2.82191,-3.74155l12.78032,-31.43731c-1.48026,-1.29786 -2.99829,-2.5574 -4.55721,-3.77935l0,0l-28.5273,17.90761l-4.2014,-2.2175c-6.22311,-3.27536 -12.95352,-5.76342 -20.05234,-7.37577l0,0l-4.59178,-1.0518l-10.30167,-31.94773c-1.00163,-0.05022 -1.97475,-0.07566 -2.92271,-0.07566l0,0c-0.96696,0 -1.94005,0.02544 -2.94794,0.07566l0,0l-10.22914,31.73996l-4.65805,0.99522c-7.22169,1.54925 -14.10935,4.07524 -20.52469,7.39468l0,0l-4.19198,2.17928l-28.06441,-17.62396c-1.54948,1.22195 -3.07073,2.48149 -4.53823,3.77935l0,0l12.44003,30.61225l-2.9225,3.74755c-4.55724,5.8516 -8.34605,12.26398 -11.18684,19.14856l0,0l-1.79825,4.3651l-32.5209,4.49724c-0.41253,1.92767 -0.77778,3.84874 -1.08328,5.78259l0,0l29.15414,15.41315l0.17944,4.74907c0.30542,7.66602 1.58731,15.02303 3.79182,21.90135l0,0l1.44259,4.52234l-22.01771,24.35774c0.92602,1.75093 1.88968,3.45782 2.89761,5.127l0,0l32.33173,-6.96017l3.21879,3.48952c4.96029,5.42989 10.62607,10.14755 16.86828,14.06561l0,0l4.02816,2.51289l-1.23148,33.18852c1.82667,0.71808 3.67535,1.39221 5.54923,2.01599l0,0l20.46497,-26.31657l4.67366,0.57292c3.52736,0.4473 6.96019,0.73706 10.37738,0.73706l0,0c3.67532,0 7.3821,-0.32111 11.17093,-0.85657l0,0l4.71475,-0.66118l20.62231,26.52434l0,0zm9.32855,-68.34235l4.50986,6.92841l-28.59032,18.60074l-10.14731,-15.61513l0,0c-3.69124,0.90065 -7.5713,1.43016 -11.60878,1.43016l0,0c-27.93851,0 -50.57646,-22.64441 -50.57646,-50.55453l0,0c0,-27.93514 22.63795,-50.5733 50.57646,-50.5733l0,0c27.90698,0 50.55104,22.63816 50.55104,50.5733l0,0c0,11.46997 -3.85472,22.09612 -10.31726,30.58083l0,0l5.60277,8.62953m-19.23358,2.66414l0.89128,-0.56667l-8.15065,-12.54086l4.72406,-4.72429c6.17615,-6.1917 9.96483,-14.63838 9.96483,-24.04268l0,0c-0.03468,-18.80183 -15.2589,-34.02641 -34.03877,-34.064l0,0c-18.8241,0.0376 -34.03256,15.24316 -34.06407,34.064l0,0c0.03151,18.78311 15.25571,34.00732 34.06407,34.04527l0,0c4.20117,0 8.24515,-0.86304 12.15982,-2.36212l0,0l6.24211,-2.39357l8.20732,12.58492l0,0z", |
| | | "raph_gear": "m245.88898,160.48737l33.405,-17.66776c-0.65668,-6.5461 -1.92581,-12.89622 -3.51349,-19.1387l-37.10818,-5.13857c-3.21184,-7.73717 -7.45319,-14.91318 -12.43881,-21.50042l14.14514,-34.78872c-4.65118,-4.53608 -9.67427,-8.67167 -14.96115,-12.47703l-31.50966,19.78136c-7.38905,-3.88574 -15.35004,-6.83701 -23.70718,-8.73246l-11.3871,-35.2773c-3.22949,-0.24387 -6.45805,-0.50152 -9.75151,-0.50152s-6.51289,0.2517 -9.75209,0.50152l-11.27429,34.96482c-8.58116,1.83471 -16.71793,4.82026 -24.29691,8.75396l-31.01895,-19.49038c-5.28019,3.80536 -10.30307,7.94096 -14.95388,12.47703l13.75587,33.82779c-5.36137,6.87132 -9.85005,14.45284 -13.22145,22.62391l-35.93671,4.97007c-1.58098,6.23371 -2.85675,12.5771 -3.50667,19.13792l32.25408,17.06512c0.36542,8.98315 1.85477,17.68929 4.49208,25.88777l-24.33074,26.9024c2.83031,5.87039 5.9814,11.56342 9.6267,16.90457l35.82153,-7.69016c5.87321,6.39034 12.56474,11.98932 19.94749,16.61948l-1.35777,36.65076c5.88309,2.65335 11.99571,4.87399 18.29496,6.64899l22.66223,-29.13004c4.02098,0.51334 8.09276,0.85909 12.24583,0.85909c4.49908,0 8.89894,-0.40645 13.22795,-1.00122l22.78024,29.29164c6.30914,-1.77295 12.41245,-3.99347 18.29494,-6.64697l-1.38397,-37.30896c7.03673,-4.55559 13.41745,-10.00571 19.04277,-16.15907l36.75313,7.88618c3.64532,-5.34033 6.79684,-11.0273 9.62613,-16.9026l-25.11879,-27.78322c2.41295,-7.76558 3.76083,-15.96324 4.15324,-24.41928zm-55.52159,42.4395l-15.83789,10.31044l-9.74136,-14.9669c-5.0676,1.94922 -10.52345,3.13446 -16.2748,3.13446c-25.11868,0 -45.47503,-20.36435 -45.47503,-45.47913c0,-25.1158 20.35635,-45.47227 45.47503,-45.47227c25.11212,0 45.47591,20.35647 45.47591,45.47227c0,12.5506 -5.08424,23.89621 -13.30255,32.12807l9.68069,14.87306z", |
| | |
| | | "raph_hammer": "m63.36809,285.67313c6.96776,3.59244 16.47661,11.9801 23.84013,8.91132c4.83001,-1.9863 7.65633,-13.23322 10.6572,-19.15341c22.58896,-44.50285 47.13901,-95.11987 65.00839,-138.42389c0,-1.93199 1.02618,-3.42567 -0.49857,-6.05217c9.99582,-16.27104 16.78117,-34.14814 27.70221,-52.25417c3.45876,-5.75348 6.97752,-13.7377 11.82889,-16.03837l8.95993,-3.73985c11.39044,-2.92912 19.71024,-2.82827 27.65184,4.81071c4.0269,3.89508 5.87952,10.31972 9.77467,14.18769c2.63412,2.64196 12.67062,9.14025 16.40283,8.13548c2.89996,-0.78365 5.28986,-3.70498 7.32275,-7.40622l7.07837,-13.07806c1.98428,-3.72042 3.11331,-7.30138 2.18805,-10.16062c-1.19101,-3.68168 -12.12384,-8.54287 -15.78421,-9.30328c-5.37122,-1.15219 -11.73761,0.82254 -17.20779,-0.41896c-10.75037,-2.47131 -15.38852,-9.37697 -19.15163,-20.54245c-26.52289,-15.59208 -62.23056,-25.72946 -103.80629,-12.65136c-11.27793,3.54983 -22.08852,6.24227 -29.50239,13.45449c-1.48589,4.18987 1.45297,5.02407 4.53523,4.97355c-2.41113,2.19592 -6.30618,3.46841 -4.05797,8.62437c25.3744,-11.6543 74.64912,-15.68129 77.99525,8.17434c0.73132,5.31115 -4.01729,12.62416 -6.93675,18.66467c-9.2043,19.05656 -20.45122,34.51673 -28.60803,51.77705c-3.03192,0.17072 -3.72249,1.82726 -5.34029,2.91743c-26.48211,38.64464 -55.43742,86.86412 -80.34243,130.11772c-3.31706,5.75339 -11.16743,14.25751 -10.19173,19.38232c1.46458,7.8407 13.51648,11.49146 20.48232,15.09167z", |
| | | "raph_lock": "m222.74843,140.97418l0,-31.60164l-0.00876,0c-0.01239,-39.003 -31.62297,-70.60465 -70.62114,-70.60465s-70.62597,31.6186 -70.62597,70.62157l0,0l0,31.58472l-25.54068,0l0,135.66266l192.32891,0l0,-135.66266l-25.53236,0zm-118.94279,-31.58472c0,0 0,0 0,0c0,-26.65088 21.67455,-48.3259 48.3129,-48.3259c26.65535,0 48.32988,21.67502 48.32988,48.30898c0,0 0,0 0,0l0,31.60164l-96.64278,0l0,-31.58472z" |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
| | | |
| | | The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software. |
| | | The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software. |
| | |
| | | "logo_apple": "M21.367,4.494c-3.318,0.611-4.42,3.39-4.463,4.979c1.824,0.132,2.967-0.899,3.432-1.502 C21.097,7.115,21.281,5.91,21.367,4.494z M21.775,9.983c-2.399,0-3.739,0.98-4.398,0.991c-0.759-0.059-2.967-0.947-4.255-0.961 c-4.51,0.134-5.8,5.035-5.744,7.142c0.367,8.065,5.289,10.148,6.093,10.343c0.646,0.127,2.821-0.995,4.42-0.943 c1.747,0.182,2.969,0.905,3.669,0.855c0.889-0.062,3.783-2.4,4.656-6.007c-1.758-1.487-2.844-2.836-2.941-4.114 c-0.046-0.579,0.825-3.85,2.212-4.769c0.2-1.13-1.86-2.564-3.476-2.532C21.931,9.985,21.853,9.983,21.775,9.983z", |
| | | "raph_feed": "M4.135,16.762c3.078,0,5.972,1.205,8.146,3.391c2.179,2.187,3.377,5.101,3.377,8.202h4.745c0-9.008-7.299-16.335-16.269-16.335V16.762zM4.141,8.354c10.973,0,19.898,8.975,19.898,20.006h4.743c0-13.646-11.054-24.749-24.642-24.749V8.354zM10.701,25.045c0,1.815-1.471,3.287-3.285,3.287s-3.285-1.472-3.285-3.287c0-1.813,1.471-3.285,3.285-3.285S10.701,23.231,10.701,25.045z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "skull": "m74.9404,81.44109c-2.88919,16.35929 -10.26919,31.99403 -10.76614,48.86361c0.66122,9.76746 -5.89156,15.01402 -14.86213,14.8293c-9.64813,10.00099 1.19087,25.80647 12.10749,29.84357c11.14103,7.47832 24.96226,-0.87791 35.99846,5.83044c14.65424,11.4554 20.77205,31.76607 15.71635,49.57211c-5.02672,14.69893 20.70476,9.35306 11.02628,-2.39693c-7.47506,-11.48471 14.09103,-7.68764 8.56998,3.21603c-1.04326,8.75262 6.45616,11.58562 3.11867,20.06531c8.69472,4.98558 -0.72885,7.77708 -6.02475,8.71843c-12.40178,6.18225 2.24324,-11.07452 -7.58144,-16.17874c-8.99694,1.95532 -2.90059,17.02136 -5.98875,15.28125c-6.3575,-4.97824 -6.35281,-23.59047 -17.02285,-11.44621c-3.54128,-14.96387 2.92009,-30.54814 -2.05737,-45.42514c2.03897,-11.11034 -15.50281,-14.9426 -13.28409,-2.05647c0.88449,19.66696 -5.0876,39.29475 -1.66005,58.86481c4.72071,12.07065 17.92378,17.50833 26.2104,26.82291c6.80557,7.18207 15.6284,14.86087 26.22089,12.5997c12.0141,-0.52078 24.05035,-1.63034 36.01024,0.2771c15.04311,0.47446 26.52666,-11.41623 39.36443,-17.5242c15.0918,-11.98355 12.71564,-33.38867 11.21118,-50.43889c-1.84476,-10.52664 2.20334,-21.05807 1.44894,-31.48618c-10.88037,-13.31276 -19.80722,10.08708 -16.70779,20.14043c-0.00076,12.64635 2.42783,28.93701 -9.63577,37.17496c-9.95572,-0.25104 -19.43069,3.36517 -29.4632,1.4744c-8.14081,4.83435 -21.32692,4.71021 -24.01404,-6.79811c-1.07281,-10.22015 3.55807,-20.93494 -2.73401,-30.47318c5.52835,4.7614 15.17361,-4.11226 9.79822,6.56248c-6.55643,8.68922 5.55173,22.07874 10.10989,9.25331c1.51227,-8.60512 -6.54141,-20.02596 6.69714,-18.18237c2.6998,3.03528 -9.21959,24.26701 7.07346,18.90152c11.61606,-2.54445 -2.06659,-20.76607 13.66382,-20.82939c7.61295,-8.9626 5.56317,-25.76184 17.20825,-32.56114c12.98419,-8.78706 33.2569,-2.44315 42.52423,-17.32399c7.89911,-7.61507 4.18182,-28.72154 -9.44128,-21.72794c-17.02448,1.65962 -3.51318,-23.0582 -3.98819,-32.32024c4.01126,-8.06691 -4.87137,-25.04774 -1.81268,-26.84933c5.77948,8.84253 7.84946,19.18484 6.60651,29.51878c-0.10681,8.76352 -3.8233,32.51385 8.36014,17.87288c4.12442,-10.20347 2.92487,-21.76073 5.86331,-32.37626c5.66748,-22.91865 -4.48026,-45.85004 -15.79309,-65.262c-9.63495,-10.45038 -21.86679,-18.78104 -33.35342,-26.98327c-19.32092,-7.26658 -40.65421,-8.56836 -61.06006,-6.74718c-18.04979,3.12863 -37.13738,6.42709 -51.51633,18.73374c-14.01352,8.25707 -27.43441,19.22373 -32.97453,35.08961c-4.82798,12.78156 -13.28239,25.798 -9.43994,39.99647c3.67479,11.83601 1.72576,24.12813 2.32075,36.22574c6.26442,13.82637 12.1788,-7.07504 11.59255,-13.98853c0.3468,-13.11021 7.26362,-24.71465 12.36033,-36.35318zm115.06042,28.12622c12.88235,0.92311 29.19336,8.09689 29.54492,23.0528c1.95883,15.00865 -10.16846,29.55684 -25.7099,28.08501c-14.11661,-1.15955 -23.14499,-13.35332 -22.20761,-27.06258c-4.7262,-9.82969 2.6286,-20.35741 12.49942,-22.61709c1.91415,-0.64365 3.88168,-1.12543 5.87317,-1.45815zm-86.93419,1.27835c14.94448,-2.65778 31.94749,6.61306 31.99739,23.15527c1.40359,15.99194 -15.57494,19.12508 -27.15695,23.1313c-8.01422,5.17467 -16.3391,0.35667 -22.99829,-4.85698c-8.63997,-9.0434 -6.10048,-27.26721 3.02245,-35.52229c4.42388,-3.27404 9.90028,-4.56108 15.1354,-5.9073zm51.1378,42.18812c7.2348,9.94383 15.92023,25.10751 6.56407,36.39339c-8.30571,6.66107 -9.35284,-9.47466 -18.07048,-1.8754c-8.17816,-7.1624 -0.63536,-21.73717 5.10291,-29.01329c1.8913,-2.09525 4.05559,-3.93987 6.4035,-5.5047z", |
| | | "raph_flag": "m240.17992,78.9644c1.22598,-4.74799 1.33473,-12.52493 0.24789,-17.29984l-3.59653,-15.765c-1.08669,-4.77488 -5.91939,-9.3663 -10.74547,-10.20189l-33.14604,-5.72574c-4.82259,-0.83558 -12.72205,-0.80831 -17.53783,0.06101l-35.90382,6.46623c-4.82602,0.8693 -12.72192,0.95758 -17.56489,0.20381l-35.12959,-5.47475c0.04414,0.16981 0.12224,0.31943 0.15971,0.48924l24.04452,114.23236l11.00362,1.90157c4.82584,0.83569 12.71503,0.80153 17.54104,-0.06088l35.89362,-6.47302c4.81578,-0.86253 12.72198,-0.95078 17.56494,-0.19707l38.54257,6.01137c4.84297,0.75369 8.06601,-2.56096 7.18282,-7.38327l-4.31631,-23.36539c-0.88985,-4.81586 -0.61493,-12.63371 0.60435,-17.38171l5.1554,-20.03702zm-172.47275,-52.27992c-4.81902,1.01868 -7.89938,5.72567 -6.88394,10.53465l51.30882,243.74065l18.18635,0l-52.06276,-247.38807c-1.03241,-4.82942 -5.7429,-7.90624 -10.54846,-6.88723z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "raph_plugin": "M26.33,15.836l-3.893-1.545l3.136-7.9c0.28-0.705-0.064-1.505-0.771-1.785c-0.707-0.28-1.506,0.065-1.785,0.771l-3.136,7.9l-4.88-1.937l3.135-7.9c0.281-0.706-0.064-1.506-0.77-1.786c-0.706-0.279-1.506,0.065-1.785,0.771l-3.136,7.9L8.554,8.781l-1.614,4.066l2.15,0.854l-2.537,6.391c-0.61,1.54,0.143,3.283,1.683,3.895l1.626,0.646L8.985,26.84c-0.407,1.025,0.095,2.188,1.122,2.596l0.93,0.369c1.026,0.408,2.188-0.095,2.596-1.121l0.877-2.207l1.858,0.737c1.54,0.611,3.284-0.142,3.896-1.682l2.535-6.391l1.918,0.761L26.33,15.836z", |
| | | "raph_folder": "M29.124,12.75c-0.004-2.208-1.792-3.997-3.999-4V8.749H12.868c-0.505-1.622-2.011-2.808-3.805-2.811H6.188c-2.208,0.002-3.997,1.792-4.001,4v14.188c0.004,2.206,1.793,3.995,4.001,3.999h18.938c2.205-0.004,3.995-1.793,3.999-3.999V12.75zM6.188,7.937h2.875c1.046-0.004,1.917,0.834,1.983,1.876l0.058,0.937h14.022c1.093,0.002,1.997,0.906,1.999,2v0.495c-0.591-0.345-1.268-0.557-2-0.558H6.187c-0.732,0.001-1.41,0.214-2,0.559V9.937C4.19,8.843,5.094,7.939,6.188,7.937zM25.125,26.125H6.188c-1.093-0.002-1.997-0.908-2.001-2v-7.438h0.001c0.002-1.095,0.906-1.999,2-2.001h18.938c1.093,0.002,1.991,0.901,2,1.991v7.447C27.122,25.219,26.218,26.123,25.125,26.125z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "size": 32, |
| | | "fill": true, |
| | | "data": { |
| | | "raph_sun": "M15.502,7.504c-4.35,0-7.873,3.523-7.873,7.873c0,4.347,3.523,7.872,7.873,7.872c4.346,0,7.871-3.525,7.871-7.872C23.374,11.027,19.85,7.504,15.502,7.504zM15.502,21.25c-3.244-0.008-5.866-2.63-5.874-5.872c0.007-3.243,2.63-5.866,5.874-5.874c3.242,0.008,5.864,2.631,5.871,5.874C21.366,18.62,18.744,21.242,15.502,21.25zM15.502,6.977c0.553,0,1-0.448,1-1.001V1.125c-0.002-0.553-0.448-1-1-1c-0.553,0-1.001,0.449-1,1.002v4.85C14.502,6.528,14.949,6.977,15.502,6.977zM18.715,7.615c0.125,0.053,0.255,0.076,0.382,0.077c0.394,0,0.765-0.233,0.925-0.618l1.856-4.483c0.21-0.511-0.031-1.095-0.541-1.306c-0.511-0.211-1.096,0.031-1.308,0.541L18.174,6.31C17.963,6.82,18.205,7.405,18.715,7.615zM21.44,9.436c0.195,0.194,0.451,0.293,0.707,0.293s0.512-0.098,0.707-0.293l3.43-3.433c0.391-0.39,0.39-1.023,0-1.415c-0.392-0.39-1.025-0.39-1.415,0.002L21.44,8.021C21.049,8.412,21.049,9.045,21.44,9.436zM23.263,12.16c0.158,0.385,0.531,0.617,0.923,0.617c0.127,0,0.257-0.025,0.383-0.078l4.48-1.857c0.511-0.211,0.753-0.797,0.541-1.307s-0.796-0.752-1.307-0.54l-4.481,1.857C23.292,11.064,23.051,11.65,23.263,12.16zM29.752,14.371l-4.851,0.001c-0.552,0-1,0.448-0.998,1.001c0,0.553,0.447,0.999,0.998,0.999l4.852-0.002c0.553,0,0.999-0.449,0.999-1C30.752,14.817,30.304,14.369,29.752,14.371zM29.054,19.899l-4.482-1.854c-0.512-0.212-1.097,0.03-1.307,0.541c-0.211,0.511,0.031,1.096,0.541,1.308l4.482,1.854c0.126,0.051,0.256,0.075,0.383,0.075c0.393,0,0.765-0.232,0.925-0.617C29.806,20.695,29.563,20.109,29.054,19.899zM22.86,21.312c-0.391-0.391-1.023-0.391-1.414,0.001c-0.391,0.39-0.39,1.022,0,1.413l3.434,3.429c0.195,0.195,0.45,0.293,0.706,0.293s0.513-0.098,0.708-0.293c0.391-0.392,0.389-1.025,0-1.415L22.86,21.312zM20.029,23.675c-0.211-0.511-0.796-0.752-1.307-0.541c-0.51,0.212-0.752,0.797-0.54,1.308l1.86,4.48c0.159,0.385,0.531,0.617,0.925,0.617c0.128,0,0.258-0.024,0.383-0.076c0.511-0.211,0.752-0.797,0.54-1.309L20.029,23.675zM15.512,23.778c-0.553,0-1,0.448-1,1l0.004,4.851c0,0.553,0.449,0.999,1,0.999c0.553,0,1-0.448,0.998-1l-0.003-4.852C16.511,24.226,16.062,23.777,15.512,23.778zM12.296,23.142c-0.51-0.21-1.094,0.031-1.306,0.543l-1.852,4.483c-0.21,0.511,0.033,1.096,0.543,1.307c0.125,0.052,0.254,0.076,0.382,0.076c0.392,0,0.765-0.234,0.924-0.619l1.853-4.485C13.051,23.937,12.807,23.353,12.296,23.142zM9.57,21.325c-0.392-0.391-1.025-0.389-1.415,0.002L4.729,24.76c-0.391,0.392-0.389,1.023,0.002,1.415c0.195,0.194,0.45,0.292,0.706,0.292c0.257,0,0.513-0.098,0.708-0.293l3.427-3.434C9.961,22.349,9.961,21.716,9.57,21.325zM7.746,18.604c-0.213-0.509-0.797-0.751-1.307-0.54L1.96,19.925c-0.511,0.212-0.752,0.798-0.54,1.308c0.16,0.385,0.531,0.616,0.924,0.616c0.127,0,0.258-0.024,0.383-0.076l4.479-1.861C7.715,19.698,7.957,19.113,7.746,18.604zM7.1,15.392c0-0.553-0.447-0.999-1-0.999l-4.851,0.006c-0.553,0-1.001,0.448-0.999,1.001c0.001,0.551,0.449,1,1,0.998l4.852-0.006C6.654,16.392,7.102,15.942,7.1,15.392zM1.944,10.869l4.485,1.85c0.125,0.053,0.254,0.076,0.381,0.076c0.393,0,0.766-0.232,0.925-0.618c0.212-0.511-0.032-1.097-0.544-1.306L2.708,9.021c-0.511-0.21-1.095,0.032-1.306,0.542C1.19,10.074,1.435,10.657,1.944,10.869zM8.137,9.451c0.195,0.193,0.449,0.291,0.705,0.291s0.513-0.098,0.709-0.295c0.391-0.389,0.389-1.023-0.004-1.414L6.113,4.609C5.723,4.219,5.088,4.221,4.699,4.612c-0.391,0.39-0.389,1.024,0.002,1.414L8.137,9.451zM10.964,7.084c0.16,0.384,0.532,0.615,0.923,0.615c0.128,0,0.258-0.025,0.384-0.077c0.51-0.212,0.753-0.798,0.54-1.307l-1.864-4.479c-0.212-0.51-0.798-0.751-1.308-0.539C9.129,1.51,8.888,2.096,9.1,2.605L10.964,7.084z", |
| | | "raph_sun": "M15.502,7.504c-4.35,0-7.873,3.523-7.873,7.873c0,4.347,3.523,7.872,7.873,7.872c4.346,0,7.871-3.525,7.871-7.872C23.374,11.027,19.85,7.504,15.502,7.504zM15.502,21.25c-3.244-0.008-5.866-2.63-5.874-5.872c0.007-3.243,2.63-5.866,5.874-5.874c3.242,0.008,5.864,2.631,5.871,5.874C21.366,18.62,18.744,21.242,15.502,21.25zM15.502,6.977c0.553,0,1-0.448,1-1.001V1.125c-0.002-0.553-0.448-1-1-1c-0.553,0-1.001,0.449-1,1.002v4.85C14.502,6.528,14.949,6.977,15.502,6.977zM18.715,7.615c0.125,0.053,0.255,0.076,0.382,0.077c0.394,0,0.765-0.233,0.925-0.618l1.856-4.483c0.21-0.511-0.031-1.095-0.541-1.306c-0.511-0.211-1.096,0.031-1.308,0.541L18.174,6.31C17.963,6.82,18.205,7.405,18.715,7.615zM21.44,9.436c0.195,0.194,0.451,0.293,0.707,0.293s0.512-0.098,0.707-0.293l3.43-3.433c0.391-0.39,0.39-1.023,0-1.415c-0.392-0.39-1.025-0.39-1.415,0.002L21.44,8.021C21.049,8.412,21.049,9.045,21.44,9.436zM23.263,12.16c0.158,0.385,0.531,0.617,0.923,0.617c0.127,0,0.257-0.025,0.383-0.078l4.48-1.857c0.511-0.211,0.753-0.797,0.541-1.307s-0.796-0.752-1.307-0.54l-4.481,1.857C23.292,11.064,23.051,11.65,23.263,12.16zM29.752,14.371l-4.851,0.001c-0.552,0-1,0.448-0.998,1.001c0,0.553,0.447,0.999,0.998,0.999l4.852-0.002c0.553,0,0.999-0.449,0.999-1C30.752,14.817,30.304,14.369,29.752,14.371zM29.054,19.899l-4.482-1.854c-0.512-0.212-1.097,0.03-1.307,0.541c-0.211,0.511,0.031,1.096,0.541,1.308l4.482,1.854c0.126,0.051,0.256,0.075,0.383,0.075c0.393,0,0.765-0.232,0.925-0.617C29.806,20.695,29.563,20.109,29.054,19.899zM22.86,21.312c-0.391-0.391-1.023-0.391-1.414,0.001c-0.391,0.39-0.39,1.022,0,1.413l3.434,3.429c0.195,0.195,0.45,0.293,0.706,0.293s0.513-0.098,0.708-0.293c0.391-0.392,0.389-1.025,0-1.415L22.86,21.312zM20.029,23.675c-0.211-0.511-0.796-0.752-1.307-0.541c-0.51,0.212-0.752,0.797-0.54,1.308l1.86,4.48c0.159,0.385,0.531,0.617,0.925,0.617c0.128,0,0.258-0.024,0.383-0.076c0.511-0.211,0.752-0.797,0.54-1.309L20.029,23.675zM15.512,23.778c-0.553,0-1,0.448-1,1l0.004,4.851c0,0.553,0.449,0.999,1,0.999c0.553,0,1-0.448,0.998-1l-0.003-4.852C16.511,24.226,16.062,23.777,15.512,23.778zM12.296,23.142c-0.51-0.21-1.094,0.031-1.306,0.543l-1.852,4.483c-0.21,0.511,0.033,1.096,0.543,1.307c0.125,0.052,0.254,0.076,0.382,0.076c0.392,0,0.765-0.234,0.924-0.619l1.853-4.485C13.051,23.937,12.807,23.353,12.296,23.142zM9.57,21.325c-0.392-0.391-1.025-0.389-1.415,0.002L4.729,24.76c-0.391,0.392-0.389,1.023,0.002,1.415c0.195,0.194,0.45,0.292,0.706,0.292c0.257,0,0.513-0.098,0.708-0.293l3.427-3.434C9.961,22.349,9.961,21.716,9.57,21.325zM7.746,18.604c-0.213-0.509-0.797-0.751-1.307-0.54L1.96,19.925c-0.511,0.212-0.752,0.798-0.54,1.308c0.16,0.385,0.531,0.616,0.924,0.616c0.127,0,0.258-0.024,0.383-0.076l4.479-1.861C7.715,19.698,7.957,19.113,7.746,18.604zM7.1,15.392c0-0.553-0.447-0.999-1-0.999l-4.851,0.006c-0.553,0-1.001,0.448-0.999,1.001c0.001,0.551,0.449,1,1,0.998l4.852-0.006C6.654,16.392,7.102,15.942,7.1,15.392zM1.944,10.869l4.485,1.85c0.125,0.053,0.254,0.076,0.381,0.076c0.393,0,0.766-0.232,0.925-0.618c0.212-0.511-0.032-1.097-0.544-1.306L2.708,9.021c-0.511-0.21-1.095,0.032-1.306,0.542C1.19,10.074,1.435,10.657,1.944,10.869zM8.137,9.451c0.195,0.193,0.449,0.291,0.705,0.291s0.513-0.098,0.709-0.295c0.391-0.389,0.389-1.023-0.004-1.414L6.113,4.609C5.723,4.219,5.088,4.221,4.699,4.612c-0.391,0.39-0.389,1.024,0.002,1.414L8.137,9.451zM10.964,7.084c0.16,0.384,0.532,0.615,0.923,0.615c0.128,0,0.258-0.025,0.384-0.077c0.51-0.212,0.753-0.798,0.54-1.307l-1.864-4.479c-0.212-0.51-0.798-0.751-1.308-0.539C9.129,1.51,8.888,2.096,9.1,2.605L10.964,7.084z", |
| | | "raph_thunder": "M25.371,7.306c-0.092-3.924-3.301-7.077-7.248-7.079c-2.638,0.001-4.942,1.412-6.208,3.517c-0.595-0.327-1.28-0.517-2.01-0.517C7.626,3.229,5.772,5.033,5.689,7.293c-2.393,0.786-4.125,3.025-4.127,5.686c0,3.312,2.687,6,6,6v-0.002h5.271l-2.166,3.398l1.977-0.411L10,30.875l9.138-10.102L17,21l2.167-2.023h4.269c3.312,0,6-2.688,6-6C29.434,10.34,27.732,8.11,25.371,7.306zM23.436,16.979H7.561c-2.209-0.006-3.997-1.792-4.001-4.001c-0.002-1.982,1.45-3.618,3.35-3.931c0.265-0.043,0.502-0.191,0.657-0.414C7.722,8.41,7.779,8.136,7.73,7.87C7.702,7.722,7.685,7.582,7.685,7.446C7.689,6.221,8.68,5.23,9.905,5.228c0.647,0,1.217,0.278,1.633,0.731c0.233,0.257,0.587,0.375,0.927,0.309c0.342-0.066,0.626-0.307,0.748-0.63c0.749-1.992,2.662-3.412,4.911-3.41c2.899,0.004,5.244,2.35,5.251,5.249c0,0.161-0.009,0.326-0.027,0.497c-0.049,0.517,0.305,0.984,0.815,1.079c1.86,0.344,3.274,1.966,3.271,3.923C27.43,15.186,25.645,16.973,23.436,16.979z", |
| | | "raph_snow": "M25.372,6.912c-0.093-3.925-3.302-7.078-7.248-7.08c-2.638,0.002-4.942,1.412-6.208,3.518c-0.595-0.327-1.28-0.518-2.01-0.518C7.627,2.834,5.773,4.639,5.69,6.898c-2.393,0.786-4.125,3.025-4.127,5.686c0,3.312,2.687,6,6,6v-0.002h15.875c3.312,0,6-2.688,6-6C29.434,9.944,27.732,7.715,25.372,6.912zM23.436,16.584H7.562c-2.209-0.006-3.997-1.793-4.001-4c-0.002-1.983,1.45-3.619,3.35-3.933c0.265-0.043,0.502-0.19,0.657-0.414C7.723,8.015,7.78,7.74,7.731,7.475C7.703,7.326,7.686,7.187,7.686,7.051c0.004-1.225,0.995-2.217,2.22-2.219c0.647,0,1.217,0.278,1.633,0.731c0.233,0.257,0.587,0.375,0.927,0.31c0.342-0.066,0.626-0.308,0.748-0.631c0.749-1.992,2.662-3.412,4.911-3.41c2.898,0.004,5.244,2.351,5.251,5.25c0,0.16-0.009,0.325-0.026,0.496c-0.05,0.518,0.305,0.984,0.814,1.079c1.859,0.345,3.273,1.966,3.271,3.923C27.43,14.791,25.645,16.578,23.436,16.584zM16.667,24.09l1.119-1.119c0.389-0.391,0.389-1.025,0-1.416c-0.392-0.391-1.025-0.391-1.415,0l-1.119,1.119l-1.119-1.119c-0.391-0.391-1.025-0.391-1.415,0c-0.391,0.391-0.391,1.025,0,1.416l1.118,1.117l-1.12,1.121c-0.389,0.393-0.389,1.021,0,1.414c0.195,0.188,0.451,0.293,0.707,0.293c0.256,0,0.512-0.104,0.708-0.293l1.12-1.119l1.12,1.119c0.195,0.188,0.451,0.293,0.708,0.293c0.256,0,0.512-0.104,0.707-0.293c0.391-0.396,0.391-1.021,0-1.414L16.667,24.09zM25.119,21.817c-0.393-0.392-1.025-0.392-1.415,0l-1.12,1.121l-1.12-1.121c-0.391-0.392-1.022-0.392-1.414,0c-0.39,0.392-0.39,1.022,0,1.416l1.119,1.119l-1.119,1.119c-0.39,0.391-0.39,1.022,0,1.413c0.195,0.195,0.451,0.294,0.707,0.294c0.257,0,0.513-0.099,0.707-0.294l1.12-1.118l1.12,1.118c0.194,0.195,0.45,0.294,0.707,0.294c0.256,0,0.513-0.099,0.708-0.294c0.389-0.391,0.389-1.022,0-1.413l-1.12-1.119l1.12-1.119C25.507,22.842,25.507,22.209,25.119,21.817zM9.334,23.953l1.119-1.119c0.389-0.394,0.389-1.021,0-1.414c-0.391-0.394-1.025-0.394-1.415,0l-1.119,1.119l-1.12-1.121c-0.391-0.39-1.023-0.39-1.415,0c-0.391,0.396-0.391,1.024,0,1.418l1.119,1.117l-1.12,1.118c-0.391,0.394-0.391,1.025,0,1.414c0.196,0.195,0.452,0.293,0.708,0.293c0.256,0,0.511-0.098,0.707-0.293l1.12-1.119l1.121,1.121c0.195,0.195,0.451,0.293,0.707,0.293s0.513-0.098,0.708-0.293c0.389-0.391,0.389-1.022,0-1.416L9.334,23.953z", |
| | | "raph_hail": "M25.372,6.912c-0.093-3.925-3.302-7.078-7.248-7.08c-2.638,0.002-4.942,1.412-6.208,3.518c-0.595-0.327-1.28-0.518-2.01-0.518C7.627,2.834,5.773,4.639,5.69,6.898c-2.393,0.786-4.125,3.025-4.127,5.686c0,3.312,2.687,6,6,6v-0.002h15.875c3.312,0,6-2.688,6-6C29.434,9.944,27.732,7.715,25.372,6.912zM23.436,16.584H7.562c-2.209-0.006-3.997-1.793-4.001-4c-0.002-1.983,1.45-3.619,3.35-3.933c0.265-0.043,0.502-0.19,0.657-0.414C7.723,8.015,7.78,7.74,7.731,7.475C7.703,7.326,7.686,7.187,7.686,7.051c0.004-1.225,0.995-2.217,2.22-2.219c0.647,0,1.217,0.278,1.633,0.731c0.233,0.257,0.587,0.375,0.927,0.31c0.342-0.066,0.626-0.308,0.748-0.631c0.749-1.992,2.662-3.412,4.911-3.41c2.898,0.004,5.244,2.351,5.251,5.25c0,0.16-0.009,0.325-0.026,0.496c-0.05,0.518,0.305,0.984,0.814,1.079c1.859,0.345,3.273,1.966,3.271,3.923C27.43,14.791,25.645,16.578,23.436,16.584zM11.503,23.709c-0.784-0.002-1.418-0.636-1.418-1.416c0-0.785,0.634-1.416,1.418-1.418c0.78,0.002,1.413,0.633,1.416,1.418C12.917,23.073,12.284,23.707,11.503,23.709zM19.002,23.709c-0.783-0.002-1.418-0.636-1.418-1.416c0-0.785,0.635-1.416,1.418-1.418c0.779,0.002,1.414,0.633,1.414,1.418C20.417,23.073,19.784,23.707,19.002,23.709zM7.503,28.771c-0.783-0.002-1.417-0.637-1.417-1.418s0.634-1.414,1.417-1.416c0.78,0.002,1.415,0.635,1.415,1.416C8.917,28.135,8.284,28.77,7.503,28.771zM15.001,28.771c-0.782-0.002-1.417-0.637-1.417-1.418s0.634-1.414,1.417-1.416c0.78,0.002,1.413,0.635,1.415,1.416C16.415,28.135,15.784,28.77,15.001,28.771zM22.5,28.771c-0.782-0.002-1.416-0.634-1.416-1.416c0-0.785,0.634-1.418,1.416-1.42c0.781,0.002,1.414,0.635,1.418,1.42C23.915,28.138,23.282,28.77,22.5,28.771z", |
| | |
| | | "sun": "M29.166,15.999l-5.279,1.878v-3.754L29.166,15.999z M25.333,6.748l-2.405,5.062l-2.654-2.656L25.333,6.748z M16.083,2.917l1.877,5.28h-3.755L16.083,2.917z M6.832,6.748l5.061,2.406l-2.655,2.656L6.832,6.748z M3,15.999l5.28-1.876v3.754 L3,15.999z M6.832,25.25l2.406-5.06l2.655,2.655L6.832,25.25L6.832,25.25z M16.083,29.084l-1.878-5.281h3.755L16.083,29.084z M25.333,25.25l-5.06-2.404l2.654-2.655L25.333,25.25z M9.542,15.999L9.542,15.999c0-3.612,2.929-6.541,6.542-6.541 c3.612,0,6.542,2.929,6.542,6.541c0,3.613-2.93,6.542-6.542,6.542C12.47,22.541,9.542,19.612,9.542,15.999L9.542,15.999z", |
| | | "umbrella": "M15.009,3.37v2.508C8.637,6.23,3.618,9.962,3.618,14.514c0-0.82,1.387-1.486,3.095-1.486 c1.709,0,3.096,0.666,3.096,1.486c0-0.82,1.386-1.486,3.095-1.486c0.813,0,1.552,0.156,2.105,0.402v12.228 c0,0.547-0.444,0.99-0.99,0.99c-0.547,0-0.991-0.443-0.991-0.99v-0.496h-1.981v0.496c0,1.641,1.332,2.973,2.972,2.973 s2.971-1.332,2.971-2.973V13.43c0.553-0.247,1.293-0.402,2.106-0.402c1.707,0,3.096,0.666,3.096,1.486 c0-0.82,1.387-1.486,3.094-1.486c1.711,0,3.098,0.666,3.098,1.486c0-4.551-5.02-8.283-11.393-8.636V3.37H15.009z" |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | 1. Create the SVG master file that includes all icons: |
| | | |
| | | The master SVG icon-containing file is an SVG file that contains |
| | | The master SVG icon-containing file is an SVG file that contains |
| | | <g> elements. Each <g> element should contain the markup of an SVG |
| | | icon. The <g> element has an ID that should |
| | | correspond with the ID of the HTML element used on the page that should contain |
| | | icon. The <g> 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". |
| | | |
| | |
| | | |
| | | - '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. |
| | | |
| | |
| | | |
| | | - '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 |
| | | |
| | | - '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 <img> |
| | | element (may be faster, help for browser consistency) |
| | | |
| | |
| | | $.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) |
| | | |
| | |
| | | |
| | | $(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. |
| | | // No options have been set, so all icons will automatically be inserted |
| | | // into HTML elements that match the same IDs. |
| | | }); |
| | | |
| | | Example usage #2: |
| | |
| | | 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 |
| | | |
| | | callback: function(icons) { // Sets background color for "close" icon |
| | | icons['close'].css('background','red'); |
| | | }, |
| | | |
| | | |
| | | svgz: true // Indicates that an SVGZ file is being used |
| | | |
| | | |
| | | }) |
| | | }); |
| | | |
| | |
| | | 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 = $('<object data="' + file + '" type=image/svg+xml>').appendTo('body').hide(); |
| | | try { |
| | |
| | | if(err.responseText) { |
| | | svgdoc = parser.parseFromString(err.responseText, "text/xml"); |
| | | if(!svgdoc.childNodes.length) { |
| | | $(useFallback); |
| | | $(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" |
| | | // 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')); |
| | |
| | | } |
| | | 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, |
| | |
| | | },500); |
| | | } |
| | | } |
| | | |
| | | |
| | | var setIcon = function(target, icon, id, setID) { |
| | | if(isOpera) icon.css('visibility','hidden'); |
| | | if(opts.replace) { |
| | |
| | | if(cl) icon.attr('class','svg_icon '+cl); |
| | | target.replaceWith(icon); |
| | | } else { |
| | | |
| | | |
| | | target.append(icon); |
| | | } |
| | | if(isOpera) { |
| | |
| | | },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) { |
| | |
| | | 'height': icon_h, |
| | | 'alt': 'icon' |
| | | }); |
| | | |
| | | |
| | | addIcon(icon, id); |
| | | }); |
| | | } else { |
| | |
| | | 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); |
| | |
| | | // 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 |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | if(opts.placement) { |
| | | $.each(opts.placement, function(sel, id) { |
| | | if(!svg_icons[id]) return; |
| | |
| | | |
| | | 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(!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 + ')'; |
| | | |
| | |
| | | }); |
| | | return svg_el; |
| | | } |
| | | |
| | | |
| | | function useFallback() { |
| | | if(file.indexOf('.svgz') != -1) { |
| | | var reg_file = file.replace('.svgz','.svg'); |
| | |
| | | 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 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) { |
| | | |
| | | $.getSvgIcon = function(id, uniqueClone) { |
| | | var icon = svg_icons[id]; |
| | | if(uniqueClone && icon) { |
| | | icon = fixIDs(icon, 0, true).clone(true); |
| | | } |
| | | return icon; |
| | | 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; |
| | |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | })(jQuery); |
| | | |
| | | })(jQuery); |
| | |
| | | <?xml version="1.0" standalone="no"?>
<!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
x="0px" y="0px" width="27px" height="27px"
>
<path d="M 1 25 L 5 25 L 5 13 L 11 13 L 11 25 L 16 25 L 16 7 L 22 7 L 22 25 L 26 25 L 26 26 L 1 26 L 1 25 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 Z" fill="#000000"/>
</svg> |
| | | <?xml version="1.0" standalone="no"?> |
| | | <!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 --> |
| | | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| | | <svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1" |
| | | xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" |
| | | x="0px" y="0px" width="27px" height="27px" |
| | | > |
| | | <path d="M 1 25 L 5 25 L 5 13 L 11 13 L 11 25 L 16 25 L 16 7 L 22 7 L 22 25 L 26 25 L 26 26 L 1 26 L 1 25 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 Z" fill="#000000"/> |
| | | </svg> |
| | |
| | | <?xml version="1.0" standalone="no"?>
<!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
x="0px" y="0px" width="27px" height="27px"
>
<g id="Layer%201">
<path d="M 13 1 L 14 1 L 14 6 L 22 6 L 22 12 L 14 12 L 14 15 L 19 15 L 19 21 L 14 21 L 14 26 L 13 26 L 13 21 L 8 21 L 8 15 L 13 15 L 13 12 L 5 12 L 5 6 L 13 6 L 13 1 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 Z" fill="#000000"/>
</g>
</svg> |
| | | <?xml version="1.0" standalone="no"?> |
| | | <!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 --> |
| | | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| | | <svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1" |
| | | xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" |
| | | x="0px" y="0px" width="27px" height="27px" |
| | | > |
| | | <g id="Layer%201"> |
| | | <path d="M 13 1 L 14 1 L 14 6 L 22 6 L 22 12 L 14 12 L 14 15 L 19 15 L 19 21 L 14 21 L 14 26 L 13 26 L 13 21 L 8 21 L 8 15 L 13 15 L 13 12 L 5 12 L 5 6 L 13 6 L 13 1 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 Z" fill="#000000"/> |
| | | </g> |
| | | </svg> |
| | |
| | | <?xml version="1.0" standalone="no"?>
<!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
x="0px" y="0px" width="27px" height="27px"
>
<path d="M 2 1 L 2 5 L 14 5 L 14 11 L 2 11 L 2 16 L 20 16 L 20 22 L 2 22 L 2 26 L 1 26 L 1 1 L 2 1 ZM 27 0 L 0 0 L 0 27 L 27 27 L 27 0 Z" fill="#000000"/>
</svg> |
| | | <?xml version="1.0" standalone="no"?> |
| | | <!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 --> |
| | | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| | | <svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1" |
| | | xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" |
| | | x="0px" y="0px" width="27px" height="27px" |
| | | > |
| | | <path d="M 2 1 L 2 5 L 14 5 L 14 11 L 2 11 L 2 16 L 20 16 L 20 22 L 2 22 L 2 26 L 1 26 L 1 1 L 2 1 ZM 27 0 L 0 0 L 0 27 L 27 27 L 27 0 Z" fill="#000000"/> |
| | | </svg> |
| | |
| | | <?xml version="1.0" standalone="no"?>
<!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
x="0px" y="0px" width="27px" height="27px"
>
<path d="M 26 13 L 26 14 L 21 14 L 21 22 L 15 22 L 15 14 L 12 14 L 12 19 L 6 19 L 6 14 L 1 14 L 1 13 L 6 13 L 6 8 L 12 8 L 12 13 L 15 13 L 15 5 L 21 5 L 21 13 L 26 13 ZM 27 0 L 0 0 L 0 27 L 27 27 L 27 0 Z" fill="#000000"/>
</svg> |
| | | <?xml version="1.0" standalone="no"?> |
| | | <!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 --> |
| | | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| | | <svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1" |
| | | xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" |
| | | x="0px" y="0px" width="27px" height="27px" |
| | | > |
| | | <path d="M 26 13 L 26 14 L 21 14 L 21 22 L 15 22 L 15 14 L 12 14 L 12 19 L 6 19 L 6 14 L 1 14 L 1 13 L 6 13 L 6 8 L 12 8 L 12 13 L 15 13 L 15 5 L 21 5 L 21 13 L 26 13 ZM 27 0 L 0 0 L 0 27 L 27 27 L 27 0 Z" fill="#000000"/> |
| | | </svg> |
| | |
| | | <?xml version="1.0" standalone="no"?>
<!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
x="0px" y="0px" width="27px" height="27px"
>
<path d="M 25 1 L 25 5 L 13 5 L 13 11 L 25 11 L 25 16 L 7 16 L 7 22 L 25 22 L 25 26 L 26 26 L 26 1 L 25 1 ZM 0 0 L 27 0 L 27 27 L 0 27 L 0 0 Z" fill="#000000"/>
</svg> |
| | | <?xml version="1.0" standalone="no"?> |
| | | <!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 --> |
| | | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| | | <svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1" |
| | | xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" |
| | | x="0px" y="0px" width="27px" height="27px" |
| | | > |
| | | <path d="M 25 1 L 25 5 L 13 5 L 13 11 L 25 11 L 25 16 L 7 16 L 7 22 L 25 22 L 25 26 L 26 26 L 26 1 L 25 1 ZM 0 0 L 27 0 L 27 27 L 0 27 L 0 0 Z" fill="#000000"/> |
| | | </svg> |
| | |
| | | <?xml version="1.0" standalone="no"?>
<!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
x="0px" y="0px" width="27px" height="27px"
>
<path d="M 1 2 L 5 2 L 5 14 L 11 14 L 11 2 L 16 2 L 16 20 L 22 20 L 22 2 L 26 2 L 26 1 L 1 1 L 1 2 ZM 0 27 L 0 0 L 27 0 L 27 27 L 0 27 Z" fill="#000000"/>
</svg> |
| | | <?xml version="1.0" standalone="no"?> |
| | | <!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 --> |
| | | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| | | <svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1" |
| | | xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" |
| | | x="0px" y="0px" width="27px" height="27px" |
| | | > |
| | | <path d="M 1 2 L 5 2 L 5 14 L 11 14 L 11 2 L 16 2 L 16 20 L 22 20 L 22 2 L 26 2 L 26 1 L 1 1 L 1 2 ZM 0 27 L 0 0 L 27 0 L 27 27 L 0 27 Z" fill="#000000"/> |
| | | </svg> |
| | |
| | | </svg> |
| | | </g> |
| | | <g id="svg_eof"/> |
| | | </svg> |
| | | </svg> |
| | |
| | | <?xml version="1.0" standalone="no"?>
<!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg id="eye-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
x="0px" y="0px" width="27px" height="27px"
>
<path d="M 26.575 14.5 C 25.0764 18.8131 19.7906 22 13.5 22 C 7.2094 22 1.9236 18.8131 0.425 14.5 C 1.9236 10.1869 7.2094 7 13.5 7 C 19.7906 7 25.0764 10.1869 26.575 14.5 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 ZM 20.5226 14.5 C 20.5226 10.9101 16.5538 8.0625 14.0226 8 C 13.8544 7.9958 14.6876 9.0074 14.5226 9.02 C 16.6163 9 18.5226 11.0783 18.5226 14.5 C 18.5226 17.9217 16.7413 19.625 14.5226 19.98 C 14.6876 19.9926 13.8543 21 14.0226 21 C 16.5851 21 20.5226 18.0899 20.5226 14.5 ZM 6 14.5 C 6 18.0899 9.9375 21 12.5 21 C 12.6682 21 11.835 19.9926 12 19.98 C 9.7813 19.625 8 17.9217 8 14.5 C 8 11.0783 9.9063 9 12 9.02 C 11.835 9.0074 12.6682 7.9958 12.5 8 C 9.9688 8.0625 6 10.9101 6 14.5 Z" fill="#000000"/>
</svg> |
| | | <?xml version="1.0" standalone="no"?> |
| | | <!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 --> |
| | | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| | | <svg id="eye-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1" |
| | | xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" |
| | | x="0px" y="0px" width="27px" height="27px" |
| | | > |
| | | <path d="M 26.575 14.5 C 25.0764 18.8131 19.7906 22 13.5 22 C 7.2094 22 1.9236 18.8131 0.425 14.5 C 1.9236 10.1869 7.2094 7 13.5 7 C 19.7906 7 25.0764 10.1869 26.575 14.5 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 ZM 20.5226 14.5 C 20.5226 10.9101 16.5538 8.0625 14.0226 8 C 13.8544 7.9958 14.6876 9.0074 14.5226 9.02 C 16.6163 9 18.5226 11.0783 18.5226 14.5 C 18.5226 17.9217 16.7413 19.625 14.5226 19.98 C 14.6876 19.9926 13.8543 21 14.0226 21 C 16.5851 21 20.5226 18.0899 20.5226 14.5 ZM 6 14.5 C 6 18.0899 9.9375 21 12.5 21 C 12.6682 21 11.835 19.9926 12 19.98 C 9.7813 19.625 8 17.9217 8 14.5 C 8 11.0783 9.9063 9 12 9.02 C 11.835 9.0074 12.6682 7.9958 12.5 8 C 9.9688 8.0625 6 10.9101 6 14.5 Z" fill="#000000"/> |
| | | </svg> |
| | |
| | | <?xml version="1.0" standalone="no"?>
<!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg id="eye-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
x="0px" y="0px" width="27px" height="27px"
>
<g id="Layer%201">
<path d="M 16.6855 8.9536 L 12.8818 22.146 C 12.6714 22.9009 12.5664 23.396 12.5664 23.6304 C 12.5664 23.7671 12.6221 23.8931 12.7334 24.0112 C 12.8447 24.1284 12.9619 24.187 13.0859 24.187 C 13.2959 24.187 13.5063 24.0942 13.7168 23.9087 C 14.2734 23.4517 14.9414 22.6226 15.7207 21.4224 L 16.3516 21.7935 C 14.4834 25.0474 12.498 26.6733 10.3955 26.6733 C 9.5913 26.6733 8.9512 26.4478 8.4751 25.9956 C 7.9985 25.5444 7.7607 24.9731 7.7607 24.2798 C 7.7607 23.8228 7.8657 23.2407 8.0762 22.5356 L 10.6553 13.6665 C 10.9023 12.813 11.0264 12.1704 11.0264 11.7368 C 11.0264 11.4653 10.9087 11.2241 10.6738 11.0132 C 10.4385 10.8032 10.1172 10.6978 9.709 10.6978 C 9.5234 10.6978 9.3008 10.7046 9.041 10.7163 L 9.2822 9.9741 L 15.5723 8.9536 L 16.6855 8.9536 ZM 15.5352 0.4185 C 16.3018 0.4185 16.9482 0.6851 17.4741 1.2163 C 17.9995 1.7485 18.2627 2.3921 18.2627 3.146 C 18.2627 3.9009 17.9966 4.5444 17.4648 5.0757 C 16.9326 5.6079 16.2896 5.8735 15.5352 5.8735 C 14.793 5.8735 14.1558 5.6079 13.624 5.0757 C 13.0918 4.5444 12.8262 3.9009 12.8262 3.146 C 12.8262 2.3921 13.0889 1.7485 13.6147 1.2163 C 14.1401 0.6851 14.7803 0.4185 15.5352 0.4185 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 Z" fill="#000000"/>
</g>
</svg> |
| | | <?xml version="1.0" standalone="no"?> |
| | | <!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 --> |
| | | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| | | <svg id="eye-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1" |
| | | xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" |
| | | x="0px" y="0px" width="27px" height="27px" |
| | | > |
| | | <g id="Layer%201"> |
| | | <path d="M 16.6855 8.9536 L 12.8818 22.146 C 12.6714 22.9009 12.5664 23.396 12.5664 23.6304 C 12.5664 23.7671 12.6221 23.8931 12.7334 24.0112 C 12.8447 24.1284 12.9619 24.187 13.0859 24.187 C 13.2959 24.187 13.5063 24.0942 13.7168 23.9087 C 14.2734 23.4517 14.9414 22.6226 15.7207 21.4224 L 16.3516 21.7935 C 14.4834 25.0474 12.498 26.6733 10.3955 26.6733 C 9.5913 26.6733 8.9512 26.4478 8.4751 25.9956 C 7.9985 25.5444 7.7607 24.9731 7.7607 24.2798 C 7.7607 23.8228 7.8657 23.2407 8.0762 22.5356 L 10.6553 13.6665 C 10.9023 12.813 11.0264 12.1704 11.0264 11.7368 C 11.0264 11.4653 10.9087 11.2241 10.6738 11.0132 C 10.4385 10.8032 10.1172 10.6978 9.709 10.6978 C 9.5234 10.6978 9.3008 10.7046 9.041 10.7163 L 9.2822 9.9741 L 15.5723 8.9536 L 16.6855 8.9536 ZM 15.5352 0.4185 C 16.3018 0.4185 16.9482 0.6851 17.4741 1.2163 C 17.9995 1.7485 18.2627 2.3921 18.2627 3.146 C 18.2627 3.9009 17.9966 4.5444 17.4648 5.0757 C 16.9326 5.6079 16.2896 5.8735 15.5352 5.8735 C 14.793 5.8735 14.1558 5.6079 13.624 5.0757 C 13.0918 4.5444 12.8262 3.9009 12.8262 3.146 C 12.8262 2.3921 13.0889 1.7485 13.6147 1.2163 C 14.1401 0.6851 14.7803 0.4185 15.5352 0.4185 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 Z" fill="#000000"/> |
| | | </g> |
| | | </svg> |
| | |
| | | <?xml version="1.0" standalone="no"?>
<!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg id="eye-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
x="0px" y="0px" width="27px" height="27px"
>
<g id="Layer%201">
<path d="M 13.6027 0.5027 L 26.844 10.2723 L 21.6443 25.8845 L 5.1894 25.7637 L 0.2195 10.0769 L 13.6027 0.5027 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 Z" fill="#000000"/>
</g>
</svg> |
| | | <?xml version="1.0" standalone="no"?> |
| | | <!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 --> |
| | | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| | | <svg id="eye-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1" |
| | | xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" |
| | | x="0px" y="0px" width="27px" height="27px" |
| | | > |
| | | <g id="Layer%201"> |
| | | <path d="M 13.6027 0.5027 L 26.844 10.2723 L 21.6443 25.8845 L 5.1894 25.7637 L 0.2195 10.0769 L 13.6027 0.5027 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 Z" fill="#000000"/> |
| | | </g> |
| | | </svg> |
| | |
| | | <!DOCTYPE html> |
| | | <html> |
| | | <head> |
| | | <meta http-equiv="Content-type" content="text/html;charset=UTF-8" /> |
| | | <meta http-equiv="X-UA-Compatible" content="chrome=1"/> |
| | | <link rel="icon" type="image/png" href="images/logo.png"/> |
| | | <meta http-equiv="Content-type" content="text/html;charset=UTF-8" /> |
| | | <meta http-equiv="X-UA-Compatible" content="chrome=1"/> |
| | | <link rel="icon" type="image/png" href="images/logo.png"/> |
| | | |
| | | <!--{if svg_edit_release}> |
| | | <link rel="stylesheet" href="css/method-draw.compiled.css" type="text/css"/> |
| | | <!{else}--> |
| | | <!--{if svg_edit_release}> |
| | | <link rel="stylesheet" href="css/method-draw.compiled.css" type="text/css"/> |
| | | <!{else}--> |
| | | <link rel="stylesheet" href="lib/jgraduate/css/jPicker.css" type="text/css"/> |
| | | <link rel="stylesheet" href="lib/jgraduate/css/jgraduate.css" type="text/css"/> |
| | | <link rel="stylesheet" href="css/method-draw.css" type="text/css"/> |
| | | <link rel="stylesheet" href="css/fonts.css" type="text/css"/> |
| | | <!--{endif}--> |
| | | <!--{endif}--> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> |
| | | <meta name="apple-mobile-web-app-capable" content="yes"/> |
| | | |
| | |
| | | <script type="text/javascript" src="lib/jquery.js"></script> |
| | | |
| | | |
| | | <!--{if svg_edit_release}> |
| | | <script type="text/javascript" src="method-draw.compiled.js"></script> |
| | | <!{else}--> |
| | | <!--{if svg_edit_release}> |
| | | <script type="text/javascript" src="method-draw.compiled.js"></script> |
| | | <!{else}--> |
| | | <script type="text/javascript" src="lib/pathseg.js"></script> |
| | | <script type="text/javascript" src="lib/touch.js"></script> |
| | | <script type="text/javascript" src="lib/js-hotkeys/jquery.hotkeys.min.js"></script> |
| | |
| | | <script type="text/javascript" src="lib/requestanimationframe.js"></script> |
| | | <script type="text/javascript" src="lib/taphold.js"></script> |
| | | <script type="text/javascript" src="lib/filesaver.js"></script> |
| | | <!--{endif}--> |
| | | <!--{endif}--> |
| | | |
| | | |
| | | <title>Method Draw</title> |
| | | <title>Method Draw</title> |
| | | </head> |
| | | <body > |
| | | <div id="svg_editor"> |
| | | |
| | | <div id="rulers"> |
| | | <div id="ruler_corner"></div> |
| | | <div id="ruler_x"> |
| | | <div id="ruler_x_cursor"></div> |
| | | <div> |
| | | <canvas height="15"></canvas> |
| | | </div> |
| | | </div> |
| | | <div id="ruler_y"> |
| | | <div id="ruler_y_cursor"></div> |
| | | <div> |
| | | <canvas width="15"></canvas> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="workarea"> |
| | | <div id="svgcanvas" style="position:relative"> |
| | | |
| | | </div> |
| | | </div> |
| | | v |
| | | <div id="menu_bar"> |
| | | <!-- <a class="menu">--> |
| | | <!-- <div class="menu_title" id="logo"></div>--> |
| | | <!-- <div class="menu_list">--> |
| | | <!-- <div id="tool_about" class="menu_item">About this Editor...</div>--> |
| | | <!-- <div class="separator"></div>--> |
| | | <!-- <div id="tool_about" class="menu_item">Keyboard Shortcuts...</div>--> |
| | | <!-- </div>--> |
| | | <!-- </a>--> |
| | | |
| | | <div style="opacity: 0" class="menu"> |
| | | <div class="menu_title">File</div> |
| | | <div class="menu_list" id="file_menu"> |
| | | <div id="tool_clear" class="menu_item">New Document</div> |
| | | <div id="tool_open" class="menu_item" style="display: none;"><div id="fileinputs"></div>Open SVG...</div> |
| | | <div id="tool_import" class="menu_item" style="display: none;"><div id="fileinputs_import"></div>Import Image...</div> |
| | | <div id="tool_save" class="menu_item">Save Image... <span class="shortcut">⌘S</span></div> |
| | | <div id="tool_export" class="menu_item">Export as PNG</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="opacity: 0" class="menu"> |
| | | <div class="menu_title">Edit</div> |
| | | <div class="menu_list" id="edit_menu"> |
| | | <div class="menu_item" id="tool_undo">Undo <span class="shortcut">⌘Z</span></div> |
| | | <div class="menu_item" id="tool_redo">Redo <span class="shortcut">⌘Y</span></div> |
| | | <div class="separator"></div> |
| | | <div class="menu_item action_selected disabled" id="tool_cut">Cut <span class="shortcut">⌘X</span></div> |
| | | <div class="menu_item action_selected disabled" id="tool_copy">Copy <span class="shortcut">⌘C</span></div> |
| | | <div class="menu_item action_selected disabled" id="tool_paste">Paste <span class="shortcut">⌘V</span></div> |
| | | <div class="menu_item action_selected disabled" id="tool_clone">Duplicate <span class="shortcut">⌘D</span></div> |
| | | <div class="menu_item action_selected disabled" id="tool_delete">Delete <span>⌫</span></div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="opacity: 0" class="menu"> |
| | | <div class="menu_title">Object</div> |
| | | <div class="menu_list" id="object_menu"> |
| | | <div class="menu_item action_selected disabled" id="tool_move_top">Bring to Front <span class="shortcut">⌘⇧↑</span></div> |
| | | <div class="menu_item action_selected disabled" id="tool_move_up">Bring Forward <span class="shortcut">⌘↑</span></div> |
| | | <div class="menu_item action_selected disabled" id="tool_move_down">Send Backward <span class="shortcut">⌘↓</span></div> |
| | | <div class="menu_item action_selected disabled" id="tool_move_bottom">Send to Back <span class="shortcut">⌘⇧↓</span></div> |
| | | <div class="separator"></div> |
| | | <div class="menu_item action_multi_selected disabled" id="tool_group">Group Elements <span class="shortcut">⌘G</span></div> |
| | | <div class="menu_item action_group_selected disabled" id="tool_ungroup">Ungroup Elements <span class="shortcut">⌘⇧G</span></div> |
| | | <div class="separator"></div> |
| | | <div class="menu_item action_path_convert_selected disabled" id="tool_topath">Convert to Path</div> |
| | | <div class="menu_item action_path_selected disabled" id="tool_reorient">Reorient path</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="opacity: 0" class="menu"> |
| | | <div class="menu_title">View</div> |
| | | <div class="menu_list" id="view_menu"> |
| | | <div class="menu_item push_button_pressed" id="tool_rulers">View Rulers</div> |
| | | <div class="menu_item" id="tool_wireframe">View Wireframe</div> |
| | | <div class="menu_item" id="tool_snap">Snap to Grid</div> |
| | | <div class="separator"></div> |
| | | <div class="menu_item" id="tool_source">Source... <span class="shortcut">⌘U</span></div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </div> |
| | | |
| | | <div id="tools_top" class="tools_panel"> |
| | | |
| | | <div id="canvas_panel" class="context_panel"> |
| | | |
| | | <h4 class="clearfix">画布</h4> |
| | | |
| | | <label data-title="Change canvas width"> |
| | | <input size="3" id="canvas_width" type="text" pattern="[0-9]*" /> |
| | | <span class="icon_label">宽度</span> |
| | | </label> |
| | | <label data-title="Change canvas height"> |
| | | <input id="canvas_height" size="3" type="text" pattern="[0-9]*" /> |
| | | <span class="icon_label">高度</span> |
| | | </label> |
| | | |
| | | |
| | | <label data-title="Change canvas color" class="draginput"> |
| | | <span>颜色</span> |
| | | <div id="color_canvas_tools"> |
| | | <div class="color_tool active" id="tool_canvas"> |
| | | <div class="color_block"> |
| | | <div id="canvas_bg"></div> |
| | | <div id="canvas_color"></div> |
| | | </div> |
| | | </div> |
| | | <div id="rulers"> |
| | | <div id="ruler_corner"></div> |
| | | <div id="ruler_x"> |
| | | <div id="ruler_x_cursor"></div> |
| | | <div> |
| | | <canvas height="15"></canvas> |
| | | </div> |
| | | </label> |
| | | </div> |
| | | <div id="ruler_y"> |
| | | <div id="ruler_y_cursor"></div> |
| | | <div> |
| | | <canvas width="15"></canvas> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="draginput"> |
| | | <span>画布大小</span> |
| | | <select id="resolution"> |
| | | <option id="selectedPredefined" selected="selected">默认</option> |
| | | <option>640x480</option> |
| | | <option>800x600</option> |
| | | <option>1024x768</option> |
| | | <option>1280x960</option> |
| | | <option>1600x1200</option> |
| | | <option id="fitToContent" value="content">适应内容</option> |
| | | </select> |
| | | <div class="caret"></div> |
| | | <label id="resolution_label">默认</label> |
| | | <div id="workarea"> |
| | | <div id="svgcanvas" style="position:relative"> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="menu_bar"> |
| | | <!-- <a class="menu">--> |
| | | <!-- <div class="menu_title" id="logo"></div>--> |
| | | <!-- <div class="menu_list">--> |
| | | <!-- <div id="tool_about" class="menu_item">About this Editor...</div>--> |
| | | <!-- <div class="separator"></div>--> |
| | | <!-- <div id="tool_about" class="menu_item">Keyboard Shortcuts...</div>--> |
| | | <!-- </div>--> |
| | | <!-- </a>--> |
| | | |
| | | <div style="opacity: 0" class="menu"> |
| | | <div class="menu_title">File</div> |
| | | <div class="menu_list" id="file_menu"> |
| | | <div id="tool_clear" class="menu_item">New Document</div> |
| | | <div id="tool_open" class="menu_item" style="display: none;"><div id="fileinputs"></div>Open SVG...</div> |
| | | <div id="tool_import" class="menu_item" style="display: none;"><div id="fileinputs_import"></div>Import Image...</div> |
| | | <div id="tool_save" class="menu_item">Save Image... <span class="shortcut">⌘S</span></div> |
| | | <div id="tool_export" class="menu_item">Export as PNG</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="opacity: 0" class="menu"> |
| | | <div class="menu_title">Edit</div> |
| | | <div class="menu_list" id="edit_menu"> |
| | | <div class="menu_item" id="tool_undo">Undo <span class="shortcut">⌘Z</span></div> |
| | | <div class="menu_item" id="tool_redo">Redo <span class="shortcut">⌘Y</span></div> |
| | | <div class="separator"></div> |
| | | <div class="menu_item action_selected disabled" id="tool_cut">Cut <span class="shortcut">⌘X</span></div> |
| | | <div class="menu_item action_selected disabled" id="tool_copy">Copy <span class="shortcut">⌘C</span></div> |
| | | <div class="menu_item action_selected disabled" id="tool_paste">Paste <span class="shortcut">⌘V</span></div> |
| | | <div class="menu_item action_selected disabled" id="tool_clone">Duplicate <span class="shortcut">⌘D</span></div> |
| | | <div class="menu_item action_selected disabled" id="tool_delete">Delete <span>⌫</span></div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="opacity: 0" class="menu"> |
| | | <div class="menu_title">Object</div> |
| | | <div class="menu_list" id="object_menu"> |
| | | <div class="menu_item action_selected disabled" id="tool_move_top">Bring to Front <span class="shortcut">⌘⇧↑</span></div> |
| | | <div class="menu_item action_selected disabled" id="tool_move_up">Bring Forward <span class="shortcut">⌘↑</span></div> |
| | | <div class="menu_item action_selected disabled" id="tool_move_down">Send Backward <span class="shortcut">⌘↓</span></div> |
| | | <div class="menu_item action_selected disabled" id="tool_move_bottom">Send to Back <span class="shortcut">⌘⇧↓</span></div> |
| | | <div class="separator"></div> |
| | | <div class="menu_item action_multi_selected disabled" id="tool_group">Group Elements <span class="shortcut">⌘G</span></div> |
| | | <div class="menu_item action_group_selected disabled" id="tool_ungroup">Ungroup Elements <span class="shortcut">⌘⇧G</span></div> |
| | | <div class="separator"></div> |
| | | <div class="menu_item action_path_convert_selected disabled" id="tool_topath">Convert to Path</div> |
| | | <div class="menu_item action_path_selected disabled" id="tool_reorient">Reorient path</div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="opacity: 0" class="menu"> |
| | | <div class="menu_title">View</div> |
| | | <div class="menu_list" id="view_menu"> |
| | | <div class="menu_item push_button_pressed" id="tool_rulers">View Rulers</div> |
| | | <div class="menu_item" id="tool_wireframe">View Wireframe</div> |
| | | <div class="menu_item" id="tool_snap">Snap to Grid</div> |
| | | <div class="separator"></div> |
| | | <div class="menu_item" id="tool_source">Source... <span class="shortcut">⌘U</span></div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </div> |
| | | |
| | | <div id="rect_panel" class="context_panel"> |
| | | <h4 class="clearfix">矩形</h4> |
| | | <label> |
| | | <input id="rect_x" class="attr_changer" data-title="Change X coordinate" size="3" data-attr="x" pattern="[0-9]*" /> |
| | | <span>X</span> |
| | | </label> |
| | | <label> |
| | | <input id="rect_y" class="attr_changer" data-title="Change Y coordinate" size="3" data-attr="y" pattern="[0-9]*" /> |
| | | <span>Y</span> |
| | | </label> |
| | | <label id="rect_width_tool attr_changer" data-title="Change rectangle width"> |
| | | <input id="rect_width" class="attr_changer" size="3" data-attr="width" type="text" pattern="[0-9]*" /> |
| | | <span class="icon_label">宽度</span> |
| | | </label> |
| | | <label id="rect_height_tool" data-title="Change rectangle height"> |
| | | <input id="rect_height" class="attr_changer" size="3" data-attr="height" type="text" pattern="[0-9]*" /> |
| | | <span class="icon_label">高度</span> |
| | | </label> |
| | | </div> |
| | | <div id="tools_top" class="tools_panel"> |
| | | |
| | | <div id="path_panel" class="context_panel clearfix"> |
| | | <h4 class="clearfix">路径</h4> |
| | | <label> |
| | | <input id="path_x" class="attr_changer" data-title="Change ellipse's cx coordinate" size="3" data-attr="x" pattern="[0-9]*" /> |
| | | <span>X</span> |
| | | </label> |
| | | <label> |
| | | <input id="path_y" class="attr_changer" data-title="Change ellipse's cy coordinate" size="3" data-attr="y" pattern="[0-9]*" /> |
| | | <span>Y</span> |
| | | </label> |
| | | </div> |
| | | <div id="canvas_panel" class="context_panel"> |
| | | |
| | | <div id="image_panel" class="context_panel clearfix"> |
| | | <h4>图片</h4> |
| | | <label> |
| | | <input id="image_x" class="attr_changer" data-title="Change X coordinate" size="3" data-attr="x" pattern="[0-9]*"/> |
| | | <span>X</span> |
| | | </label> |
| | | <label> |
| | | <input id="image_y" class="attr_changer" data-title="Change Y coordinate" size="3" data-attr="y" pattern="[0-9]*"/> |
| | | <span>Y</span> |
| | | </label> |
| | | <label> |
| | | <input id="image_width" class="attr_changer" data-title="Change image width" size="3" data-attr="width" pattern="[0-9]*" /> |
| | | <span class="icon_label">宽度</span> |
| | | </label> |
| | | <label> |
| | | <input id="image_height" class="attr_changer" data-title="Change image height" size="3" data-attr="height" pattern="[0-9]*" /> |
| | | <span class="icon_label">高度</span> |
| | | </label> |
| | | </div> |
| | | <h4 class="clearfix">画布</h4> |
| | | |
| | | <div id="circle_panel" class="context_panel"> |
| | | <h4>圆</h4> |
| | | <label id="tool_circle_cx"> |
| | | <span>中心X轴</span> |
| | | <input id="circle_cx" class="attr_changer" title="Change circle's cx coordinate" size="3" data-attr="cx"/> |
| | | </label> |
| | | <label id="tool_circle_cy"> |
| | | <span>中心Y轴</span> |
| | | <input id="circle_cy" class="attr_changer" title="Change circle's cy coordinate" size="3" data-attr="cy"/> |
| | | </label> |
| | | <label id="tool_circle_r"> |
| | | <span>半径</span> |
| | | <input id="circle_r" class="attr_changer" title="Change circle's radius" size="3" data-attr="r"/> |
| | | </label> |
| | | </div> |
| | | <label data-title="Change canvas width"> |
| | | <input size="3" id="canvas_width" type="text" pattern="[0-9]*" /> |
| | | <span class="icon_label">宽度</span> |
| | | </label> |
| | | <label data-title="Change canvas height"> |
| | | <input id="canvas_height" size="3" type="text" pattern="[0-9]*" /> |
| | | <span class="icon_label">高度</span> |
| | | </label> |
| | | |
| | | <div id="ellipse_panel" class="context_panel clearfix"> |
| | | <h4>椭圆</h4> |
| | | <label id="tool_ellipse_cx"> |
| | | <input id="ellipse_cx" class="attr_changer" data-title="Change ellipse's cx coordinate" size="3" data-attr="cx" pattern="[0-9]*" /> |
| | | <span>X</span> |
| | | </label> |
| | | <label id="tool_ellipse_cy"> |
| | | <input id="ellipse_cy" class="attr_changer" data-title="Change ellipse's cy coordinate" size="3" data-attr="cy" pattern="[0-9]*" /> |
| | | <span>Y</span> |
| | | </label> |
| | | <label id="tool_ellipse_rx"> |
| | | <input id="ellipse_rx" class="attr_changer" data-title="Change ellipse's x radius" size="3" data-attr="rx" pattern="[0-9]*" /> |
| | | <span>半径X</span> |
| | | </label> |
| | | <label id="tool_ellipse_ry"> |
| | | <input id="ellipse_ry" class="attr_changer" data-title="Change ellipse's y radius" size="3" data-attr="ry" pattern="[0-9]*" /> |
| | | <span>半径Y</span> |
| | | </label> |
| | | </div> |
| | | |
| | | <div id="line_panel" class="context_panel clearfix"> |
| | | <h4>线条</h4> |
| | | <label id="tool_line_x1"> |
| | | <input id="line_x1" class="attr_changer" data-title="Change line's starting x coordinate" size="3" data-attr="x1" pattern="[0-9]*" /> |
| | | <span>左上X轴</span> |
| | | </label> |
| | | <label id="tool_line_y1"> |
| | | <input id="line_y1" class="attr_changer" data-title="Change line's starting y coordinate" size="3" data-attr="y1" pattern="[0-9]*" /> |
| | | <span>左上Y轴</span> |
| | | </label> |
| | | <label id="tool_line_x2"> |
| | | <input id="line_x2" class="attr_changer" data-title="Change line's ending x coordinate" size="3" data-attr="x2" pattern="[0-9]*" /> |
| | | <span>右下X轴</span> |
| | | </label> |
| | | <label id="tool_line_y2"> |
| | | <input id="line_y2" class="attr_changer" data-title="Change line's ending y coordinate" size="3" data-attr="y2" pattern="[0-9]*" /> |
| | | <span>右下Y轴</span> |
| | | </label> |
| | | </div> |
| | | <!-- <label data-title="Change canvas color" class="draginput">--> |
| | | <!-- <span>颜色</span>--> |
| | | <!-- <div id="color_canvas_tools">--> |
| | | <!-- <div class="color_tool active" id="tool_canvas">--> |
| | | <!-- <div class="color_block">--> |
| | | <!-- <div id="canvas_bg"></div>--> |
| | | <!-- <div id="canvas_color"></div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </label>--> |
| | | |
| | | <div id="text_panel" class="context_panel"> |
| | | <h4>文本</h4> |
| | | <label> |
| | | <input id="text_x" class="attr_changer" data-title="Change text x coordinate" size="3" data-attr="x" pattern="[0-9]*" /> |
| | | <span>X</span> |
| | | </label> |
| | | <label> |
| | | <input id="text_y" class="attr_changer" data-title="Change text y coordinate" size="3" data-attr="y" pattern="[0-9]*" /> |
| | | <span>Y</span> |
| | | </label> |
| | | <div class="draginput"> |
| | | <span>画布大小</span> |
| | | <select id="resolution"> |
| | | <option id="selectedPredefined" selected="selected">默认</option> |
| | | <option>200x200</option> |
| | | <option>640x480</option> |
| | | <option>800x600</option> |
| | | <option>1024x768</option> |
| | | <option>1280x960</option> |
| | | <option>1600x1200</option> |
| | | <option id="fitToContent" value="content">适应内容</option> |
| | | </select> |
| | | <div class="caret"></div> |
| | | <label id="resolution_label">默认</label> |
| | | </div> |
| | | |
| | | <div class="toolset draginput select twocol" id="tool_font_family"> |
| | | </div> |
| | | |
| | | <div id="rect_panel" class="context_panel"> |
| | | <h4 class="clearfix">矩形</h4> |
| | | <label> |
| | | <input id="rect_x" class="attr_changer" data-title="Change X coordinate" size="3" data-attr="x" pattern="[0-9]*" /> |
| | | <span>X</span> |
| | | </label> |
| | | <label> |
| | | <input id="rect_y" class="attr_changer" data-title="Change Y coordinate" size="3" data-attr="y" pattern="[0-9]*" /> |
| | | <span>Y</span> |
| | | </label> |
| | | <label id="rect_width_tool attr_changer" data-title="Change rectangle width"> |
| | | <input id="rect_width" class="attr_changer" size="3" data-attr="width" type="text" pattern="[0-9]*" /> |
| | | <span class="icon_label">宽度</span> |
| | | </label> |
| | | <label id="rect_height_tool" data-title="Change rectangle height"> |
| | | <input id="rect_height" class="attr_changer" size="3" data-attr="height" type="text" pattern="[0-9]*" /> |
| | | <span class="icon_label">高度</span> |
| | | </label> |
| | | </div> |
| | | |
| | | <div id="path_panel" class="context_panel clearfix"> |
| | | <h4 class="clearfix">路径</h4> |
| | | <label> |
| | | <input id="path_x" class="attr_changer" data-title="Change ellipse's cx coordinate" size="3" data-attr="x" pattern="[0-9]*" /> |
| | | <span>X</span> |
| | | </label> |
| | | <label> |
| | | <input id="path_y" class="attr_changer" data-title="Change ellipse's cy coordinate" size="3" data-attr="y" pattern="[0-9]*" /> |
| | | <span>Y</span> |
| | | </label> |
| | | </div> |
| | | |
| | | <div id="image_panel" class="context_panel clearfix"> |
| | | <h4>图片</h4> |
| | | <label> |
| | | <input id="image_x" class="attr_changer" data-title="Change X coordinate" size="3" data-attr="x" pattern="[0-9]*"/> |
| | | <span>X</span> |
| | | </label> |
| | | <label> |
| | | <input id="image_y" class="attr_changer" data-title="Change Y coordinate" size="3" data-attr="y" pattern="[0-9]*"/> |
| | | <span>Y</span> |
| | | </label> |
| | | <label> |
| | | <input id="image_width" class="attr_changer" data-title="Change image width" size="3" data-attr="width" pattern="[0-9]*" /> |
| | | <span class="icon_label">宽度</span> |
| | | </label> |
| | | <label> |
| | | <input id="image_height" class="attr_changer" data-title="Change image height" size="3" data-attr="height" pattern="[0-9]*" /> |
| | | <span class="icon_label">高度</span> |
| | | </label> |
| | | </div> |
| | | |
| | | <div id="circle_panel" class="context_panel"> |
| | | <h4>圆</h4> |
| | | <label id="tool_circle_cx"> |
| | | <span>中心X轴</span> |
| | | <input id="circle_cx" class="attr_changer" title="Change circle's cx coordinate" size="3" data-attr="cx"/> |
| | | </label> |
| | | <label id="tool_circle_cy"> |
| | | <span>中心Y轴</span> |
| | | <input id="circle_cy" class="attr_changer" title="Change circle's cy coordinate" size="3" data-attr="cy"/> |
| | | </label> |
| | | <label id="tool_circle_r"> |
| | | <span>半径</span> |
| | | <input id="circle_r" class="attr_changer" title="Change circle's radius" size="3" data-attr="r"/> |
| | | </label> |
| | | </div> |
| | | |
| | | <div id="ellipse_panel" class="context_panel clearfix"> |
| | | <h4>椭圆</h4> |
| | | <label id="tool_ellipse_cx"> |
| | | <input id="ellipse_cx" class="attr_changer" data-title="Change ellipse's cx coordinate" size="3" data-attr="cx" pattern="[0-9]*" /> |
| | | <span>X</span> |
| | | </label> |
| | | <label id="tool_ellipse_cy"> |
| | | <input id="ellipse_cy" class="attr_changer" data-title="Change ellipse's cy coordinate" size="3" data-attr="cy" pattern="[0-9]*" /> |
| | | <span>Y</span> |
| | | </label> |
| | | <label id="tool_ellipse_rx"> |
| | | <input id="ellipse_rx" class="attr_changer" data-title="Change ellipse's x radius" size="3" data-attr="rx" pattern="[0-9]*" /> |
| | | <span>半径X</span> |
| | | </label> |
| | | <label id="tool_ellipse_ry"> |
| | | <input id="ellipse_ry" class="attr_changer" data-title="Change ellipse's y radius" size="3" data-attr="ry" pattern="[0-9]*" /> |
| | | <span>半径Y</span> |
| | | </label> |
| | | </div> |
| | | |
| | | <div id="line_panel" class="context_panel clearfix"> |
| | | <h4>线条</h4> |
| | | <label id="tool_line_x1"> |
| | | <input id="line_x1" class="attr_changer" data-title="Change line's starting x coordinate" size="3" data-attr="x1" pattern="[0-9]*" /> |
| | | <span>左上X轴</span> |
| | | </label> |
| | | <label id="tool_line_y1"> |
| | | <input id="line_y1" class="attr_changer" data-title="Change line's starting y coordinate" size="3" data-attr="y1" pattern="[0-9]*" /> |
| | | <span>左上Y轴</span> |
| | | </label> |
| | | <label id="tool_line_x2"> |
| | | <input id="line_x2" class="attr_changer" data-title="Change line's ending x coordinate" size="3" data-attr="x2" pattern="[0-9]*" /> |
| | | <span>右下X轴</span> |
| | | </label> |
| | | <label id="tool_line_y2"> |
| | | <input id="line_y2" class="attr_changer" data-title="Change line's ending y coordinate" size="3" data-attr="y2" pattern="[0-9]*" /> |
| | | <span>右下Y轴</span> |
| | | </label> |
| | | </div> |
| | | |
| | | <div id="text_panel" class="context_panel"> |
| | | <h4>文本</h4> |
| | | <label> |
| | | <input id="text_x" class="attr_changer" data-title="Change text x coordinate" size="3" data-attr="x" pattern="[0-9]*" /> |
| | | <span>X</span> |
| | | </label> |
| | | <label> |
| | | <input id="text_y" class="attr_changer" data-title="Change text y coordinate" size="3" data-attr="y" pattern="[0-9]*" /> |
| | | <span>Y</span> |
| | | </label> |
| | | |
| | | <div class="toolset draginput select twocol" id="tool_font_family"> |
| | | <!-- Font family --> |
| | | <span>字体</span> |
| | | <div id="preview_font" style="font-family: Helvetica, Arial, sans-serif;">Helvetica</div> |
| | | <div class="caret"></div> |
| | | <input id="font_family" data-title="Change Font Family" size="12" type="hidden" /> |
| | | <select id="font_family_dropdown"> |
| | | <span>字体</span> |
| | | <div id="preview_font" style="font-family: Helvetica, Arial, sans-serif;">Helvetica</div> |
| | | <div class="caret"></div> |
| | | <input id="font_family" data-title="Change Font Family" size="12" type="hidden" /> |
| | | <select id="font_family_dropdown"> |
| | | <option value="Arvo, sans-serif">Arvo</option> |
| | | <option value="'Courier New', Courier, monospace">Courier</option> |
| | | <option value="Euphoria, sans-serif">Euphoria</option> |
| | |
| | | <option value="'Shadows Into Light', serif">Shadows Into Light</option> |
| | | <option value="'Simonetta', serif">Simonetta</option> |
| | | <option value="'Times New Roman', Times, serif">Times</option> |
| | | </select> |
| | | <div class="tool_button" id="tool_bold" data-title="Bold Text [B]">B</div> |
| | | <div class="tool_button" id="tool_italic" data-title="Italic Text [I]">i</div> |
| | | </div> |
| | | |
| | | <label id="tool_font_size" data-title="Change Font Size"> |
| | | <input id="font_size" size="3" value="0" /> |
| | | <span id="font_sizeLabel" class="icon_label">字体大小</span> |
| | | </label> |
| | | <!-- Not visible, but still used --> |
| | | <input id="text" type="text" size="35"/> |
| | | </div> |
| | | |
| | | <!-- formerly gsvg_panel --> |
| | | <div id="container_panel" class="context_panel clearfix"> |
| | | </div> |
| | | |
| | | <div id="use_panel" class="context_panel clearfix"> |
| | | <div class="tool_button clearfix" id="tool_unlink_use" data-title="Break link to reference element (make unique)">Break link reference</div> |
| | | </div> |
| | | |
| | | <div id="g_panel" class="context_panel clearfix"> |
| | | <h4>组合</h4> |
| | | <label> |
| | | <input id="g_x" class="attr_changer" data-title="Change groups's x coordinate" size="3" data-attr="x" pattern="[0-9]*" /> |
| | | <span>X</span> |
| | | </label> |
| | | <label> |
| | | <input id="g_y" class="attr_changer" data-title="Change groups's y coordinate" size="3" data-attr="y" pattern="[0-9]*" /> |
| | | <span>Y</span> |
| | | </label> |
| | | </div> |
| | | |
| | | <div id="path_node_panel" class="context_panel clearfix"> |
| | | <h4>编辑路径</h4> |
| | | |
| | | <label id="tool_node_x"> |
| | | <input id="path_node_x" class="attr_changer" data-title="Change node's x coordinate" size="3" data-attr="x" /> |
| | | <span>X</span> |
| | | </label> |
| | | <label id="tool_node_y"> |
| | | <input id="path_node_y" class="attr_changer" data-title="Change node's y coordinate" size="3" data-attr="y" /> |
| | | <span>Y</span> |
| | | </label> |
| | | |
| | | <div id="segment_type" class="draginput label"> |
| | | <span>分段类型</span> |
| | | <select id="seg_type" data-title="Change Segment type"> |
| | | <option id="straight_segments" selected="selected" value="4">直线</option> |
| | | <option id="curve_segments" value="6">曲线</option> |
| | | </select> |
| | | <div class="caret"></div> |
| | | <label id="seg_type_label">直线</label> |
| | | </div> |
| | | |
| | | <!-- |
| | | <label class="draginput checkbox" data-title="Link Control Points"> |
| | | <span>Linked Control Points</span> |
| | | <div class="push_bottom"><input type="checkbox" id="tool_node_link" checked="checked" /></div> |
| | | </label> |
| | | --> |
| | | |
| | | <div class="clearfix"></div> |
| | | <div class="tool_button" id="tool_node_clone" title="Adds a node">添加节点</div> |
| | | <div class="tool_button" id="tool_node_delete" title="Delete Node">删除节点</div> |
| | | <div class="tool_button" id="tool_openclose_path" title="Open/close sub-path">打开路径</div> |
| | | <!--<div class="tool_button" id="tool_add_subpath" title="Add sub-path"></div>--> |
| | | </div> |
| | | |
| | | <!-- Buttons when a single element is selected --> |
| | | <div id="selected_panel" class="context_panel"> |
| | | |
| | | <label id="tool_angle" data-title="Change rotation angle" class="draginput"> |
| | | <input id="angle" class="attr_changer" size="2" value="0" data-attr="transform" data-min="-180" data-max="180" type="text"/> |
| | | <span class="icon_label">旋转</span> |
| | | <div id="tool_angle_indicator"> |
| | | <div id="tool_angle_indicator_cursor"></div> |
| | | </select> |
| | | <div class="tool_button" id="tool_bold" data-title="Bold Text [B]">B</div> |
| | | <div class="tool_button" id="tool_italic" data-title="Italic Text [I]">i</div> |
| | | </div> |
| | | </label> |
| | | |
| | | <label id="tool_font_size" data-title="Change Font Size"> |
| | | <input id="font_size" size="3" value="0" /> |
| | | <span id="font_sizeLabel" class="icon_label">字体大小</span> |
| | | </label> |
| | | <!-- Not visible, but still used --> |
| | | <input id="text" type="text" size="35"/> |
| | | </div> |
| | | |
| | | <!-- formerly gsvg_panel --> |
| | | <div id="container_panel" class="context_panel clearfix"> |
| | | </div> |
| | | |
| | | <div id="use_panel" class="context_panel clearfix"> |
| | | <div class="tool_button clearfix" id="tool_unlink_use" data-title="Break link to reference element (make unique)">Break link reference</div> |
| | | </div> |
| | | |
| | | <div id="g_panel" class="context_panel clearfix"> |
| | | <h4>组合</h4> |
| | | <label> |
| | | <input id="g_x" class="attr_changer" data-title="Change groups's x coordinate" size="3" data-attr="x" pattern="[0-9]*" /> |
| | | <span>X</span> |
| | | </label> |
| | | <label> |
| | | <input id="g_y" class="attr_changer" data-title="Change groups's y coordinate" size="3" data-attr="y" pattern="[0-9]*" /> |
| | | <span>Y</span> |
| | | </label> |
| | | </div> |
| | | |
| | | <div id="path_node_panel" class="context_panel clearfix"> |
| | | <h4>编辑路径</h4> |
| | | |
| | | <label id="tool_node_x"> |
| | | <input id="path_node_x" class="attr_changer" data-title="Change node's x coordinate" size="3" data-attr="x" /> |
| | | <span>X</span> |
| | | </label> |
| | | <label id="tool_node_y"> |
| | | <input id="path_node_y" class="attr_changer" data-title="Change node's y coordinate" size="3" data-attr="y" /> |
| | | <span>Y</span> |
| | | </label> |
| | | |
| | | <div id="segment_type" class="draginput label"> |
| | | <span>分段类型</span> |
| | | <select id="seg_type" data-title="Change Segment type"> |
| | | <option id="straight_segments" selected="selected" value="4">直线</option> |
| | | <option id="curve_segments" value="6">曲线</option> |
| | | </select> |
| | | <div class="caret"></div> |
| | | <label id="seg_type_label">直线</label> |
| | | </div> |
| | | |
| | | <!-- |
| | | <label class="draginput checkbox" data-title="Link Control Points"> |
| | | <span>Linked Control Points</span> |
| | | <div class="push_bottom"><input type="checkbox" id="tool_node_link" checked="checked" /></div> |
| | | </label> |
| | | --> |
| | | |
| | | <div class="clearfix"></div> |
| | | <div class="tool_button" id="tool_node_clone" title="Adds a node">添加节点</div> |
| | | <div class="tool_button" id="tool_node_delete" title="Delete Node">删除节点</div> |
| | | <div class="tool_button" id="tool_openclose_path" title="Open/close sub-path">打开路径</div> |
| | | <!--<div class="tool_button" id="tool_add_subpath" title="Add sub-path"></div>--> |
| | | </div> |
| | | |
| | | <!-- Buttons when a single element is selected --> |
| | | <div id="selected_panel" class="context_panel"> |
| | | |
| | | <label id="tool_angle" data-title="Change rotation angle" class="draginput"> |
| | | <input id="angle" class="attr_changer" size="2" value="0" data-attr="transform" data-min="-180" data-max="180" type="text"/> |
| | | <span class="icon_label">旋转</span> |
| | | <div id="tool_angle_indicator"> |
| | | <div id="tool_angle_indicator_cursor"></div> |
| | | </div> |
| | | </label> |
| | | |
| | | <label class="toolset" id="tool_opacity" data-title="Change selected item opacity"> |
| | | <input id="group_opacity" class="attr_changer" data-attr="opacity" data-multiplier="0.01" size="3" value="100" step="5" min="0" max="100" /> |
| | | <span id="group_opacityLabel" class="icon_label">透明度</span> |
| | | </label> |
| | | |
| | | <div class="toolset" id="tool_blur" data-title="Change gaussian blur value"> |
| | | <label> |
| | | <input id="blur" size="2" value="0" step=".1" min="0" max="10" /> |
| | | <span class="icon_label">模糊度</span> |
| | | <div class="toolset" id="tool_blur" data-title="Change gaussian blur value"> |
| | | <label> |
| | | <input id="blur" size="2" value="0" step=".1" min="0" max="10" /> |
| | | <span class="icon_label">模糊度</span> |
| | | </label> |
| | | </div> |
| | | |
| | | <label id="cornerRadiusLabel" data-title="Change Rectangle Corner Radius"> |
| | | <input id="rect_rx" size="3" value="0" data-attr="rx" class="attr_changer" type="text" pattern="[0-9]*" /> |
| | | <span class="icon_label">圆度</span> |
| | | </label> |
| | | </div> |
| | | |
| | | <label id="cornerRadiusLabel" data-title="Change Rectangle Corner Radius"> |
| | | <input id="rect_rx" size="3" value="0" data-attr="rx" class="attr_changer" type="text" pattern="[0-9]*" /> |
| | | <span class="icon_label">圆度</span> |
| | | </label> |
| | | |
| | | <div class="clearfix"></div> |
| | | <div id="align_tools"> |
| | | <h4>对齐方式</h4> |
| | | <div class="toolset align_buttons" id="tool_position"> |
| | | <div class="clearfix"></div> |
| | | <div id="align_tools"> |
| | | <h4>对齐方式</h4> |
| | | <div class="toolset align_buttons" id="tool_position"> |
| | | <label> |
| | | <div class="col last clear" id="position_opts"> |
| | | <div class="draginput_cell" id="tool_posleft" title="左对齐"></div> |
| | |
| | | <div class="draginput_cell" id="tool_posbottom" title="下对齐"></div> |
| | | </div> |
| | | </label> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- Buttons when multiple elements are selected --> |
| | | <div id="multiselected_panel" class="context_panel clearfix"> |
| | | <h4 class="hidable">对齐方式</h4> |
| | | <!-- Buttons when multiple elements are selected --> |
| | | <div id="multiselected_panel" class="context_panel clearfix"> |
| | | <h4 class="hidable">对齐方式</h4> |
| | | |
| | | <div class="toolset align_buttons" style="position: relative"> |
| | | <label id="tool_align_relative" style="margin-top: 10px;"> |
| | | <select id="align_relative_to" title="Align relative to ..."> |
| | | <option id="selected_objects" value="selected">与对象对齐</option> |
| | | <option id="page" value="page">与页面对齐</option> |
| | | </select> |
| | | </label> |
| | | <h4>.</h4> |
| | | <div class="toolset align_buttons" style="position: relative"> |
| | | <label id="tool_align_relative" style="margin-top: 10px;"> |
| | | <select id="align_relative_to" title="Align relative to ..."> |
| | | <option id="selected_objects" value="selected">与对象对齐</option> |
| | | <option id="page" value="page">与页面对齐</option> |
| | | </select> |
| | | </label> |
| | | <h4>.</h4> |
| | | <div class="col last clear"> |
| | | <div class="draginput_cell" id="tool_alignleft" title="左对齐"></div> |
| | | <div class="draginput_cell" id="tool_aligncenter" title="水平居中"></div> |
| | |
| | | <div class="draginput_cell" id="tool_alignmiddle" title="垂直居中"></div> |
| | | <div class="draginput_cell" id="tool_alignbottom" title="下对齐"></div> |
| | | </div> |
| | | </div> |
| | | <div class="clearfix"></div> |
| | | |
| | | </div> |
| | | <div class="clearfix"></div> |
| | | |
| | | </div> |
| | | <div id="stroke_panel" class="context_panel clearfix"> |
| | | <div class="clearfix"></div> |
| | | <h4>边框</h4> |
| | | <div class="toolset" data-title="Change stroke"> |
| | | <label> |
| | | <input id="stroke_width" size="2" value="5" data-attr="stroke-width" min="0" max="99" step="1" /> |
| | | <span class="icon_label">边宽</span> |
| | | </label> |
| | | </div> |
| | | <div class="stroke_tool draginput"> |
| | | <span>线条样式</span> |
| | | <select id="stroke_style" data-title="Change stroke dash style"> |
| | | <option selected="selected" value="none">—</option> |
| | | <option value="2,2">···</option> |
| | | <option value="5,5">- -</option> |
| | | <option value="5,2,2,2">-·-</option> |
| | | <option value="5,2,2,2,2,2">-··-</option> |
| | | </select> |
| | | <div class="caret"></div> |
| | | <label id="stroke_style_label">—</label> |
| | | </div> |
| | | |
| | | <div id="stroke_panel" class="context_panel clearfix"> |
| | | <div class="clearfix"></div> |
| | | <h4>边框</h4> |
| | | <div class="toolset" data-title="Change stroke"> |
| | | <label> |
| | | <input id="stroke_width" size="2" value="5" data-attr="stroke-width" min="0" max="99" step="1" /> |
| | | <span class="icon_label">边宽</span> |
| | | <label style="display: none;"> |
| | | <span class="icon_label">Stroke Join</span> |
| | | </label> |
| | | |
| | | <label style="display: none;"> |
| | | <span class="icon_label">Stroke Cap</span> |
| | | </label> |
| | | </div> |
| | | <div class="stroke_tool draginput"> |
| | | <span>线条样式</span> |
| | | <select id="stroke_style" data-title="Change stroke dash style"> |
| | | <option selected="selected" value="none">—</option> |
| | | <option value="2,2">···</option> |
| | | <option value="5,5">- -</option> |
| | | <option value="5,2,2,2">-·-</option> |
| | | <option value="5,2,2,2,2,2">-··-</option> |
| | | </select> |
| | | <div class="caret"></div> |
| | | <label id="stroke_style_label">—</label> |
| | | </div> |
| | | |
| | | <label style="display: none;"> |
| | | <span class="icon_label">Stroke Join</span> |
| | | </label> |
| | | |
| | | <label style="display: none;"> |
| | | <span class="icon_label">Stroke Cap</span> |
| | | </label> |
| | | </div> |
| | | |
| | | </div> <!-- tools_top --> |
| | | </div> <!-- tools_top --> |
| | | <div id="cur_context_panel"> |
| | | |
| | | </div> |
| | | |
| | | |
| | | <div id="tools_left" class="tools_panel"> |
| | | <div class="tool_button" id="tool_select" title="选择工具[V]"></div> |
| | | <div class="tool_button" id="tool_fhpath" title="铅笔工具[P]"></div> |
| | | <div class="tool_button" id="tool_line" title="连线工具[L]"></div> |
| | | <div class="tool_button" id="tool_rect" title="方形/矩形 [R]"></div> |
| | | <div class="tool_button" id="tool_ellipse" title="椭圆/圆 [C]"></div> |
| | | <div class="tool_button" id="tool_path" title="路径工具 [P]"></div> |
| | | <div class="tool_button" id="tool_text" title="文本工具 [T]"></div> |
| | | <div class="tool_button" id="tool_zoom" title="缩放工具 [Z]"></div> |
| | | <div id="tools_left" class="tools_panel"> |
| | | <div class="tool_button" id="tool_select" title="选择工具[V]"></div> |
| | | <div class="tool_button" id="tool_fhpath" title="铅笔工具[P]"></div> |
| | | <div class="tool_button" id="tool_line" title="连线工具[L]"></div> |
| | | <div class="tool_button" id="tool_rect" title="方形/矩形 [R]"></div> |
| | | <div class="tool_button" id="tool_ellipse" title="椭圆/圆 [C]"></div> |
| | | <div class="tool_button" id="tool_path" title="路径工具 [P]"></div> |
| | | <div class="tool_button" id="tool_text" title="文本工具 [T]"></div> |
| | | <div class="tool_button" id="tool_zoom" title="缩放工具 [Z]"></div> |
| | | |
| | | <div id="color_tools"> |
| | | <div id="tool_switch" title="Switch stroke and fill colors [X]"></div> |
| | | <div class="color_tool active" id="tool_fill"> |
| | | <label class="icon_label" title="Change fill color"></label> |
| | | <div class="color_block"> |
| | | <div id="fill_bg"></div> |
| | | <div id="fill_color" class="color_block"></div> |
| | | </div> |
| | | <div id="color_tools"> |
| | | <div id="tool_switch" title="Switch stroke and fill colors [X]"></div> |
| | | <div class="color_tool active" id="tool_fill"> |
| | | <label class="icon_label" title="Change fill color"></label> |
| | | <div class="color_block"> |
| | | <div id="fill_bg"></div> |
| | | <div id="fill_color" class="color_block"></div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="color_tool" id="tool_stroke"> |
| | | <label class="icon_label" title="Change stroke color"></label> |
| | | <div class="color_block"> |
| | | <div id="stroke_bg"></div> |
| | | <div id="stroke_color" class="color_block" title="Change stroke color"></div> |
| | | </div> |
| | | <div class="color_tool" id="tool_stroke"> |
| | | <label class="icon_label" title="Change stroke color"></label> |
| | | <div class="color_block"> |
| | | <div id="stroke_bg"></div> |
| | | <div id="stroke_color" class="color_block" title="Change stroke color"></div> |
| | | </div> |
| | | </div> |
| | | </div> <!-- tools_left --> |
| | | </div> |
| | | </div> |
| | | </div> <!-- tools_left --> |
| | | |
| | | <div id="tools_bottom" class="tools_panel"> |
| | | <div id="tools_bottom" class="tools_panel"> |
| | | |
| | | <!-- Zoom buttons --> |
| | | <div id="zoom_panel" class="toolset" title="Change zoom level"> |
| | | <div class="draginput select" id="zoom_label"> |
| | | <span id="zoomLabel" class="zoom_tool icon_label"></span> |
| | | <select id="zoom_select"> |
| | | <option value="6">6%</option> |
| | | <option value="12">12%</option> |
| | | <option value="16">16%</option> |
| | | <option value="25">25%</option> |
| | | <option value="50">50%</option> |
| | | <option value="75">75%</option> |
| | | <option value="100" selected="selected">100%</option> |
| | | <option value="150">150%</option> |
| | | <option value="200">200%</option> |
| | | <option value="300">300%</option> |
| | | <option value="400">400%</option> |
| | | <option value="600">600%</option> |
| | | <option value="800">800%</option> |
| | | <option value="1600">1600%</option> |
| | | </select> |
| | | <div class="caret"></div> |
| | | <input id="zoom" size="3" value="100%" type="text" readonly="readonly" /> |
| | | <div id="zoom_panel" class="toolset" title="Change zoom level"> |
| | | <div class="draginput select" id="zoom_label"> |
| | | <span id="zoomLabel" class="zoom_tool icon_label"></span> |
| | | <select id="zoom_select"> |
| | | <option value="6">6%</option> |
| | | <option value="12">12%</option> |
| | | <option value="16">16%</option> |
| | | <option value="25">25%</option> |
| | | <option value="50">50%</option> |
| | | <option value="75">75%</option> |
| | | <option value="100" selected="selected">100%</option> |
| | | <option value="150">150%</option> |
| | | <option value="200">200%</option> |
| | | <option value="300">300%</option> |
| | | <option value="400">400%</option> |
| | | <option value="600">600%</option> |
| | | <option value="800">800%</option> |
| | | <option value="1600">1600%</option> |
| | | </select> |
| | | <div class="caret"></div> |
| | | <input id="zoom" size="3" value="100%" type="text" readonly="readonly" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="tools_bottom_3"> |
| | | <div id="palette" title="Click to change fill color, shift-click to change stroke color"></div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="tools_bottom_3"> |
| | | <div id="palette" title="Click to change fill color, shift-click to change stroke color"></div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- hidden divs --> |
| | | <div id="color_picker"></div> |
| | | <!-- hidden divs --> |
| | | <div id="color_picker"></div> |
| | | |
| | | </div> <!-- svg_editor --> |
| | | |
| | |
| | | /* |
| | | * canvg.js - Javascript SVG parser and renderer on Canvas |
| | | * MIT Licensed |
| | | * MIT Licensed |
| | | * Gabe Lerner (gabelerner@gmail.com) |
| | | * http://code.google.com/p/canvg/ |
| | | * |
| | |
| | | canvg(c, div.innerHTML); |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | opts = opts || {}; |
| | | |
| | | |
| | | if (typeof target == 'string') { |
| | | target = document.getElementById(target); |
| | | } |
| | | |
| | | |
| | | // reuse class per canvas |
| | | var svg; |
| | | if (target.svg == null) { |
| | |
| | | svg.stop(); |
| | | } |
| | | svg.opts = opts; |
| | | |
| | | |
| | | var ctx = target.getContext('2d'); |
| | | if (typeof(s.documentElement) != 'undefined') { |
| | | // load from xml doc |
| | |
| | | |
| | | function build() { |
| | | var svg = { }; |
| | | |
| | | |
| | | svg.FRAMERATE = 30; |
| | | svg.MAX_VIRTUAL_PIXELS = 30000; |
| | | |
| | | |
| | | // globals |
| | | svg.init = function(ctx) { |
| | | svg.Definitions = {}; |
| | |
| | | if (d != null && typeof(d) == 'number') return d; |
| | | if (d == 'x') return this.width(); |
| | | if (d == 'y') return this.height(); |
| | | return Math.sqrt(Math.pow(this.width(), 2) + Math.pow(this.height(), 2)) / Math.sqrt(2); |
| | | return Math.sqrt(Math.pow(this.width(), 2) + Math.pow(this.height(), 2)) / Math.sqrt(2); |
| | | } |
| | | }); |
| | | } |
| | | svg.init(); |
| | | |
| | | |
| | | // images loaded |
| | | svg.ImagesLoaded = function() { |
| | | svg.ImagesLoaded = function() { |
| | | for (var i=0; i<svg.Images.length; i++) { |
| | | if (!svg.Images[i].loaded) return false; |
| | | } |
| | |
| | | |
| | | // trim |
| | | svg.trim = function(s) { return s.replace(/^\s+|\s+$/g, ''); } |
| | | |
| | | |
| | | // compress spaces |
| | | svg.compressSpaces = function(s) { return s.replace(/[\s\r\t\n]+/gm,' '); } |
| | | |
| | | |
| | | // ajax |
| | | svg.ajax = function(url) { |
| | | var AJAX; |
| | |
| | | return AJAX.responseText; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | |
| | | // parse xml |
| | | svg.parseXml = function(xml) { |
| | | if (window.DOMParser) |
| | |
| | | var parser = new DOMParser(); |
| | | return parser.parseFromString(xml, 'text/xml'); |
| | | } |
| | | else |
| | | else |
| | | { |
| | | xml = xml.replace(/<!DOCTYPE svg[^>]*>/, ''); |
| | | var xmlDoc = new ActiveXObject('Microsoft.XMLDOM'); |
| | | xmlDoc.async = 'false'; |
| | | xmlDoc.loadXML(xml); |
| | | xmlDoc.loadXML(xml); |
| | | return xmlDoc; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | svg.Property = function(name, value) { |
| | | this.name = name; |
| | | this.value = value; |
| | | |
| | | |
| | | this.hasValue = function() { |
| | | return (this.value != null && this.value !== ''); |
| | | } |
| | | |
| | | |
| | | // return the numerical value of the property |
| | | this.numValue = function() { |
| | | if (!this.hasValue()) return 0; |
| | | |
| | | |
| | | var n = parseFloat(this.value); |
| | | if ((this.value + '').match(/%$/)) { |
| | | n = n / 100.0; |
| | | } |
| | | return n; |
| | | } |
| | | |
| | | |
| | | this.valueOrDefault = function(def) { |
| | | if (this.hasValue()) return this.value; |
| | | return def; |
| | | } |
| | | |
| | | |
| | | this.numValueOrDefault = function(def) { |
| | | if (this.hasValue()) return this.numValue(); |
| | | return def; |
| | | } |
| | | |
| | | |
| | | /* EXTENSIONS */ |
| | | var that = this; |
| | | |
| | | |
| | | // color extensions |
| | | this.Color = { |
| | | // augment the current color value with the opacity |
| | |
| | | return new svg.Property(that.name, newValue); |
| | | } |
| | | } |
| | | |
| | | |
| | | // definition extensions |
| | | this.Definition = { |
| | | // get the definition from the definitions table |
| | |
| | | var name = that.value.replace(/^(url\()?#([^\)]+)\)?$/, '$2'); |
| | | return svg.Definitions[name]; |
| | | }, |
| | | |
| | | |
| | | isUrl: function() { |
| | | return that.value.indexOf('url(') == 0 |
| | | }, |
| | | |
| | | |
| | | getFillStyle: function(e) { |
| | | var def = this.getDefinition(); |
| | | |
| | | |
| | | // gradient |
| | | if (def != null && def.createGradient) { |
| | | return def.createGradient(svg.ctx, e); |
| | | } |
| | | |
| | | |
| | | // pattern |
| | | if (def != null && def.createPattern) { |
| | | return def.createPattern(svg.ctx, e); |
| | | } |
| | | |
| | | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | // length extensions |
| | | this.Length = { |
| | | DPI: function(viewPort) { |
| | | return 96.0; // TODO: compute? |
| | | }, |
| | | |
| | | |
| | | EM: function(viewPort) { |
| | | var em = 12; |
| | | |
| | | |
| | | var fontSize = new svg.Property('fontSize', svg.Font.Parse(svg.ctx.font).fontSize); |
| | | if (fontSize.hasValue()) em = fontSize.Length.toPixels(viewPort); |
| | | |
| | | |
| | | return em; |
| | | }, |
| | | |
| | | |
| | | // get the length as pixels |
| | | toPixels: function(viewPort) { |
| | | if (!that.hasValue()) return 0; |
| | |
| | | return that.numValue(); |
| | | } |
| | | } |
| | | |
| | | |
| | | // time extensions |
| | | this.Time = { |
| | | // get the time as milliseconds |
| | |
| | | return that.numValue(); |
| | | } |
| | | } |
| | | |
| | | |
| | | // angle extensions |
| | | this.Angle = { |
| | | // get the angle as radians |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // fonts |
| | | svg.Font = new (function() { |
| | | this.Styles = ['normal','italic','oblique','inherit']; |
| | | this.Variants = ['normal','small-caps','inherit']; |
| | | this.Weights = ['normal','bold','bolder','lighter','100','200','300','400','500','600','700','800','900','inherit']; |
| | | |
| | | this.CreateFont = function(fontStyle, fontVariant, fontWeight, fontSize, fontFamily, inherit) { |
| | | |
| | | this.CreateFont = function(fontStyle, fontVariant, fontWeight, fontSize, fontFamily, inherit) { |
| | | var f = inherit != null ? this.Parse(inherit) : this.CreateFont('', '', '', '', '', svg.ctx.font); |
| | | return { |
| | | fontFamily: fontFamily || f.fontFamily, |
| | | fontSize: fontSize || f.fontSize, |
| | | fontStyle: fontStyle || f.fontStyle, |
| | | fontWeight: fontWeight || f.fontWeight, |
| | | return { |
| | | fontFamily: fontFamily || f.fontFamily, |
| | | fontSize: fontSize || f.fontSize, |
| | | fontStyle: fontStyle || f.fontStyle, |
| | | fontWeight: fontWeight || f.fontWeight, |
| | | fontVariant: fontVariant || f.fontVariant, |
| | | toString: function () { return [this.fontStyle, this.fontVariant, this.fontWeight, this.fontSize, this.fontFamily].join(' ') } |
| | | } |
| | | toString: function () { return [this.fontStyle, this.fontVariant, this.fontWeight, this.fontSize, this.fontFamily].join(' ') } |
| | | } |
| | | } |
| | | |
| | | |
| | | var that = this; |
| | | this.Parse = function(s) { |
| | | var f = {}; |
| | |
| | | return f; |
| | | } |
| | | }); |
| | | |
| | | |
| | | // points and paths |
| | | svg.ToNumberArray = function(s) { |
| | | var a = svg.trim(svg.compressSpaces((s || '').replace(/,/g, ' '))).split(' '); |
| | |
| | | a[i] = parseFloat(a[i]); |
| | | } |
| | | return a; |
| | | } |
| | | } |
| | | svg.Point = function(x, y) { |
| | | this.x = x; |
| | | this.y = y; |
| | | |
| | | |
| | | this.angleTo = function(p) { |
| | | return Math.atan2(p.y - this.y, p.x - this.x); |
| | | } |
| | | |
| | | |
| | | this.applyTransform = function(v) { |
| | | var xp = this.x * v[0] + this.y * v[2] + v[4]; |
| | | var yp = this.x * v[1] + this.y * v[3] + v[5]; |
| | |
| | | } |
| | | return path; |
| | | } |
| | | |
| | | |
| | | // bounding box |
| | | svg.BoundingBox = function(x1, y1, x2, y2) { // pass in initial points if you want |
| | | this.x1 = Number.NaN; |
| | | this.y1 = Number.NaN; |
| | | this.x2 = Number.NaN; |
| | | this.y2 = Number.NaN; |
| | | |
| | | |
| | | this.x = function() { return this.x1; } |
| | | this.y = function() { return this.y1; } |
| | | this.width = function() { return this.x2 - this.x1; } |
| | | this.height = function() { return this.y2 - this.y1; } |
| | | |
| | | this.addPoint = function(x, y) { |
| | | |
| | | this.addPoint = function(x, y) { |
| | | if (x != null) { |
| | | if (isNaN(this.x1) || isNaN(this.x2)) { |
| | | this.x1 = x; |
| | |
| | | if (x < this.x1) this.x1 = x; |
| | | if (x > this.x2) this.x2 = x; |
| | | } |
| | | |
| | | |
| | | if (y != null) { |
| | | if (isNaN(this.y1) || isNaN(this.y2)) { |
| | | this.y1 = y; |
| | |
| | | if (y < this.y1) this.y1 = y; |
| | | if (y > this.y2) this.y2 = y; |
| | | } |
| | | } |
| | | } |
| | | this.addX = function(x) { this.addPoint(x, null); } |
| | | this.addY = function(y) { this.addPoint(null, y); } |
| | | |
| | | |
| | | this.addBoundingBox = function(bb) { |
| | | this.addPoint(bb.x1, bb.y1); |
| | | this.addPoint(bb.x2, bb.y2); |
| | | } |
| | | |
| | | |
| | | this.addQuadraticCurve = function(p0x, p0y, p1x, p1y, p2x, p2y) { |
| | | var cp1x = p0x + 2/3 * (p1x - p0x); // CP1 = QP0 + 2/3 *(QP1-QP0) |
| | | var cp1y = p0y + 2/3 * (p1y - p0y); // CP1 = QP0 + 2/3 *(QP1-QP0) |
| | |
| | | var cp2y = cp1y + 1/3 * (p2y - p0y); // CP2 = CP1 + 1/3 *(QP2-QP0) |
| | | this.addBezierCurve(p0x, p0y, cp1x, cp2x, cp1y, cp2y, p2x, p2y); |
| | | } |
| | | |
| | | |
| | | this.addBezierCurve = function(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y) { |
| | | // from http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html |
| | | var p0 = [p0x, p0y], p1 = [p1x, p1y], p2 = [p2x, p2y], p3 = [p3x, p3y]; |
| | | this.addPoint(p0[0], p0[1]); |
| | | this.addPoint(p3[0], p3[1]); |
| | | |
| | | |
| | | for (i=0; i<=1; i++) { |
| | | var f = function(t) { |
| | | var f = function(t) { |
| | | return Math.pow(1-t, 3) * p0[i] |
| | | + 3 * Math.pow(1-t, 2) * t * p1[i] |
| | | + 3 * (1-t) * Math.pow(t, 2) * p2[i] |
| | | + Math.pow(t, 3) * p3[i]; |
| | | } |
| | | |
| | | |
| | | var b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i]; |
| | | var a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i]; |
| | | var c = 3 * p1[i] - 3 * p0[i]; |
| | | |
| | | |
| | | if (a == 0) { |
| | | if (b == 0) continue; |
| | | var t = -c / b; |
| | |
| | | } |
| | | continue; |
| | | } |
| | | |
| | | |
| | | var b2ac = Math.pow(b, 2) - 4 * c * a; |
| | | if (b2ac < 0) continue; |
| | | var t1 = (-b + Math.sqrt(b2ac)) / (2 * a); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | this.isPointInBox = function(x, y) { |
| | | return (this.x1 <= x && x <= this.x2 && this.y1 <= y && y <= this.y2); |
| | | } |
| | | |
| | | |
| | | this.addPoint(x1, y1); |
| | | this.addPoint(x2, y2); |
| | | } |
| | | |
| | | |
| | | // transforms |
| | | svg.Transform = function(v) { |
| | | svg.Transform = function(v) { |
| | | var that = this; |
| | | this.Type = {} |
| | | |
| | | |
| | | // translate |
| | | this.Type.translate = function(s) { |
| | | this.p = svg.CreatePoint(s); |
| | | this.p = svg.CreatePoint(s); |
| | | this.apply = function(ctx) { |
| | | ctx.translate(this.p.x || 0.0, this.p.y || 0.0); |
| | | } |
| | |
| | | p.applyTransform([1, 0, 0, 1, this.p.x || 0.0, this.p.y || 0.0]); |
| | | } |
| | | } |
| | | |
| | | |
| | | // rotate |
| | | this.Type.rotate = function(s) { |
| | | var a = svg.ToNumberArray(s); |
| | |
| | | p.applyTransform([1, 0, 0, 1, this.p.x || 0.0, this.p.y || 0.0]); |
| | | p.applyTransform([Math.cos(a), Math.sin(a), -Math.sin(a), Math.cos(a), 0, 0]); |
| | | p.applyTransform([1, 0, 0, 1, -this.p.x || 0.0, -this.p.y || 0.0]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | this.Type.scale = function(s) { |
| | | this.p = svg.CreatePoint(s); |
| | | this.apply = function(ctx) { |
| | |
| | | } |
| | | this.applyToPoint = function(p) { |
| | | p.applyTransform([this.p.x || 0.0, 0, 0, this.p.y || 0.0, 0, 0]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | this.Type.matrix = function(s) { |
| | | this.m = svg.ToNumberArray(s); |
| | | this.apply = function(ctx) { |
| | |
| | | } |
| | | this.applyToPoint = function(p) { |
| | | p.applyTransform(this.m); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | this.Type.SkewBase = function(s) { |
| | | this.base = that.Type.matrix; |
| | | this.base(s); |
| | | this.angle = new svg.Property('angle', s); |
| | | } |
| | | this.Type.SkewBase.prototype = new this.Type.matrix; |
| | | |
| | | |
| | | this.Type.skewX = function(s) { |
| | | this.base = that.Type.SkewBase; |
| | | this.base(s); |
| | | this.m = [1, 0, Math.tan(this.angle.Angle.toRadians()), 1, 0, 0]; |
| | | } |
| | | this.Type.skewX.prototype = new this.Type.SkewBase; |
| | | |
| | | |
| | | this.Type.skewY = function(s) { |
| | | this.base = that.Type.SkewBase; |
| | | this.base(s); |
| | | this.m = [1, Math.tan(this.angle.Angle.toRadians()), 0, 1, 0, 0]; |
| | | } |
| | | this.Type.skewY.prototype = new this.Type.SkewBase; |
| | | |
| | | |
| | | this.transforms = []; |
| | | |
| | | |
| | | this.apply = function(ctx) { |
| | | for (var i=0; i<this.transforms.length; i++) { |
| | | this.transforms[i].apply(ctx); |
| | | } |
| | | } |
| | | |
| | | |
| | | this.applyToPoint = function(p) { |
| | | for (var i=0; i<this.transforms.length; i++) { |
| | | this.transforms[i].applyToPoint(p); |
| | | } |
| | | } |
| | | |
| | | |
| | | var data = svg.trim(svg.compressSpaces(v)).split(/\s(?=[a-z])/); |
| | | for (var i=0; i<data.length; i++) { |
| | | var type = data[i].split('(')[0]; |
| | |
| | | this.transforms.push(transform); |
| | | } |
| | | } |
| | | |
| | | |
| | | // aspect ratio |
| | | svg.AspectRatio = function(ctx, aspectRatio, width, desiredWidth, height, desiredHeight, minX, minY, refX, refY) { |
| | | // aspect ratio - http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute |
| | | aspectRatio = svg.compressSpaces(aspectRatio); |
| | | aspectRatio = aspectRatio.replace(/^defer\s/,''); // ignore defer |
| | | var align = aspectRatio.split(' ')[0] || 'xMidYMid'; |
| | | var meetOrSlice = aspectRatio.split(' ')[1] || 'meet'; |
| | | |
| | | var meetOrSlice = aspectRatio.split(' ')[1] || 'meet'; |
| | | |
| | | // calculate scale |
| | | var scaleX = width / desiredWidth; |
| | | var scaleY = height / desiredHeight; |
| | | var scaleMin = Math.min(scaleX, scaleY); |
| | | var scaleMax = Math.max(scaleX, scaleY); |
| | | if (meetOrSlice == 'meet') { desiredWidth *= scaleMin; desiredHeight *= scaleMin; } |
| | | if (meetOrSlice == 'slice') { desiredWidth *= scaleMax; desiredHeight *= scaleMax; } |
| | | |
| | | if (meetOrSlice == 'slice') { desiredWidth *= scaleMax; desiredHeight *= scaleMax; } |
| | | |
| | | refX = new svg.Property('refX', refX); |
| | | refY = new svg.Property('refY', refY); |
| | | if (refX.hasValue() && refY.hasValue()) { |
| | | if (refX.hasValue() && refY.hasValue()) { |
| | | ctx.translate(-scaleMin * refX.Length.toPixels('x'), -scaleMin * refY.Length.toPixels('y')); |
| | | } |
| | | else { |
| | | // align |
| | | if (align.match(/^xMid/) && ((meetOrSlice == 'meet' && scaleMin == scaleY) || (meetOrSlice == 'slice' && scaleMax == scaleY))) ctx.translate(width / 2.0 - desiredWidth / 2.0, 0); |
| | | if (align.match(/YMid$/) && ((meetOrSlice == 'meet' && scaleMin == scaleX) || (meetOrSlice == 'slice' && scaleMax == scaleX))) ctx.translate(0, height / 2.0 - desiredHeight / 2.0); |
| | | if (align.match(/^xMax/) && ((meetOrSlice == 'meet' && scaleMin == scaleY) || (meetOrSlice == 'slice' && scaleMax == scaleY))) ctx.translate(width - desiredWidth, 0); |
| | | if (align.match(/YMax$/) && ((meetOrSlice == 'meet' && scaleMin == scaleX) || (meetOrSlice == 'slice' && scaleMax == scaleX))) ctx.translate(0, height - desiredHeight); |
| | | } |
| | | |
| | | else { |
| | | // align |
| | | if (align.match(/^xMid/) && ((meetOrSlice == 'meet' && scaleMin == scaleY) || (meetOrSlice == 'slice' && scaleMax == scaleY))) ctx.translate(width / 2.0 - desiredWidth / 2.0, 0); |
| | | if (align.match(/YMid$/) && ((meetOrSlice == 'meet' && scaleMin == scaleX) || (meetOrSlice == 'slice' && scaleMax == scaleX))) ctx.translate(0, height / 2.0 - desiredHeight / 2.0); |
| | | if (align.match(/^xMax/) && ((meetOrSlice == 'meet' && scaleMin == scaleY) || (meetOrSlice == 'slice' && scaleMax == scaleY))) ctx.translate(width - desiredWidth, 0); |
| | | if (align.match(/YMax$/) && ((meetOrSlice == 'meet' && scaleMin == scaleX) || (meetOrSlice == 'slice' && scaleMax == scaleX))) ctx.translate(0, height - desiredHeight); |
| | | } |
| | | |
| | | // scale |
| | | if (align == 'none') ctx.scale(scaleX, scaleY); |
| | | else if (meetOrSlice == 'meet') ctx.scale(scaleMin, scaleMin); |
| | | else if (meetOrSlice == 'slice') ctx.scale(scaleMax, scaleMax); |
| | | |
| | | else if (meetOrSlice == 'meet') ctx.scale(scaleMin, scaleMin); |
| | | else if (meetOrSlice == 'slice') ctx.scale(scaleMax, scaleMax); |
| | | |
| | | // translate |
| | | ctx.translate(minX == null ? 0 : -minX, minY == null ? 0 : -minY); |
| | | ctx.translate(minX == null ? 0 : -minX, minY == null ? 0 : -minY); |
| | | } |
| | | |
| | | |
| | | // elements |
| | | svg.Element = {} |
| | | |
| | | svg.Element.ElementBase = function(node) { |
| | | |
| | | svg.Element.ElementBase = function(node) { |
| | | this.attributes = {}; |
| | | this.styles = {}; |
| | | this.children = []; |
| | | |
| | | |
| | | // get or create attribute |
| | | this.attribute = function(name, createIfNotExists) { |
| | | var a = this.attributes[name]; |
| | | if (a != null) return a; |
| | | |
| | | |
| | | a = new svg.Property(name, ''); |
| | | if (createIfNotExists == true) this.attributes[name] = a; |
| | | return a; |
| | | } |
| | | |
| | | |
| | | // get or create style, crawls up node tree |
| | | this.style = function(name, createIfNotExists) { |
| | | var s = this.styles[name]; |
| | | if (s != null) return s; |
| | | |
| | | |
| | | var a = this.attribute(name); |
| | | if (a != null && a.hasValue()) { |
| | | return a; |
| | | } |
| | | |
| | | |
| | | var p = this.parent; |
| | | if (p != null) { |
| | | var ps = p.style(name); |
| | |
| | | return ps; |
| | | } |
| | | } |
| | | |
| | | |
| | | s = new svg.Property(name, ''); |
| | | if (createIfNotExists == true) this.styles[name] = s; |
| | | return s; |
| | | } |
| | | |
| | | |
| | | // base render |
| | | this.render = function(ctx) { |
| | | // don't render display=none |
| | | if (this.style('display').value == 'none') return; |
| | | |
| | | |
| | | // don't render visibility=hidden |
| | | if (this.attribute('visibility').value == 'hidden') return; |
| | | |
| | | |
| | | ctx.save(); |
| | | this.setContext(ctx); |
| | | // mask |
| | |
| | | var filter = this.style('filter').Definition.getDefinition(); |
| | | if (filter != null) filter.apply(ctx, this); |
| | | } |
| | | else this.renderChildren(ctx); |
| | | else this.renderChildren(ctx); |
| | | this.clearContext(ctx); |
| | | ctx.restore(); |
| | | } |
| | | |
| | | |
| | | // base set context |
| | | this.setContext = function(ctx) { |
| | | // OVERRIDE ME! |
| | | } |
| | | |
| | | |
| | | // base clear context |
| | | this.clearContext = function(ctx) { |
| | | // OVERRIDE ME! |
| | | } |
| | | |
| | | } |
| | | |
| | | // base render children |
| | | this.renderChildren = function(ctx) { |
| | | for (var i=0; i<this.children.length; i++) { |
| | | this.children[i].render(ctx); |
| | | } |
| | | } |
| | | |
| | | |
| | | this.addChild = function(childNode, create) { |
| | | var child = childNode; |
| | | if (create) child = svg.CreateElement(childNode); |
| | | child.parent = this; |
| | | this.children.push(child); |
| | | this.children.push(child); |
| | | } |
| | | |
| | | |
| | | if (node != null && node.nodeType == 1) { //ELEMENT_NODE |
| | | // add children |
| | | for (var i=0; i<node.childNodes.length; i++) { |
| | | var childNode = node.childNodes[i]; |
| | | if (childNode.nodeType == 1) this.addChild(childNode, true); //ELEMENT_NODE |
| | | } |
| | | |
| | | |
| | | // add attributes |
| | | for (var i=0; i<node.attributes.length; i++) { |
| | | var attribute = node.attributes[i]; |
| | | this.attributes[attribute.nodeName] = new svg.Property(attribute.nodeName, attribute.nodeValue); |
| | | } |
| | | |
| | | |
| | | // add tag styles |
| | | var styles = svg.Styles[node.nodeName]; |
| | | if (styles != null) { |
| | | for (var name in styles) { |
| | | this.styles[name] = styles[name]; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | // add class styles |
| | | if (this.attribute('class').hasValue()) { |
| | | var classes = svg.compressSpaces(this.attribute('class').value).split(' '); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // add inline styles |
| | | if (this.attribute('style').hasValue()) { |
| | | var styles = this.attribute('style').value.split(';'); |
| | |
| | | this.styles[name] = new svg.Property(name, value); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // add id |
| | | if (this.attribute('id').hasValue()) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | svg.Element.RenderedElementBase = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.setContext = function(ctx) { |
| | | // fill |
| | | if (this.style('fill').Definition.isUrl()) { |
| | |
| | | if (this.style('fill-opacity').hasValue()) fillStyle = fillStyle.Color.addOpacity(this.style('fill-opacity').value); |
| | | ctx.fillStyle = (fillStyle.value == 'none' ? 'rgba(0,0,0,0)' : fillStyle.value); |
| | | } |
| | | |
| | | |
| | | // stroke |
| | | if (this.style('stroke').Definition.isUrl()) { |
| | | var fs = this.style('stroke').Definition.getFillStyle(this); |
| | |
| | | |
| | | // font |
| | | if (typeof(ctx.font) != 'undefined') { |
| | | ctx.font = svg.Font.CreateFont( |
| | | this.style('font-style').value, |
| | | this.style('font-variant').value, |
| | | this.style('font-weight').value, |
| | | this.style('font-size').hasValue() ? this.style('font-size').Length.toPixels() + 'px' : '', |
| | | ctx.font = svg.Font.CreateFont( |
| | | this.style('font-style').value, |
| | | this.style('font-variant').value, |
| | | this.style('font-weight').value, |
| | | this.style('font-size').hasValue() ? this.style('font-size').Length.toPixels() + 'px' : '', |
| | | this.style('font-family').value).toString(); |
| | | } |
| | | |
| | | |
| | | // transform |
| | | if (this.attribute('transform').hasValue()) { |
| | | if (this.attribute('transform').hasValue()) { |
| | | var transform = new svg.Transform(this.attribute('transform').value); |
| | | transform.apply(ctx); |
| | | } |
| | | |
| | | |
| | | // clip |
| | | if (this.attribute('clip-path').hasValue()) { |
| | | var clip = this.attribute('clip-path').Definition.getDefinition(); |
| | | if (clip != null) clip.apply(ctx); |
| | | } |
| | | |
| | | |
| | | // opacity |
| | | if (this.style('opacity').hasValue()) { |
| | | ctx.globalAlpha = this.style('opacity').numValue(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | svg.Element.RenderedElementBase.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | svg.Element.PathElementBase = function(node) { |
| | | this.base = svg.Element.RenderedElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.path = function(ctx) { |
| | | if (ctx != null) ctx.beginPath(); |
| | | return new svg.BoundingBox(); |
| | | } |
| | | |
| | | |
| | | this.renderChildren = function(ctx) { |
| | | this.path(ctx); |
| | | svg.Mouse.checkPath(this, ctx); |
| | | if (ctx.fillStyle != '') ctx.fill(); |
| | | if (ctx.strokeStyle != '') ctx.stroke(); |
| | | |
| | | |
| | | var markers = this.getMarkers(); |
| | | if (markers != null) { |
| | | if (this.style('marker-start').Definition.isUrl()) { |
| | |
| | | var marker = this.style('marker-end').Definition.getDefinition(); |
| | | marker.render(ctx, markers[markers.length-1][0], markers[markers.length-1][1]); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | this.getBoundingBox = function() { |
| | | return this.path(); |
| | | } |
| | | |
| | | |
| | | this.getMarkers = function() { |
| | | return null; |
| | | } |
| | | } |
| | | svg.Element.PathElementBase.prototype = new svg.Element.RenderedElementBase; |
| | | |
| | | |
| | | // svg element |
| | | svg.Element.svg = function(node) { |
| | | this.base = svg.Element.RenderedElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.baseClearContext = this.clearContext; |
| | | this.clearContext = function(ctx) { |
| | | this.baseClearContext(ctx); |
| | | svg.ViewPort.RemoveCurrent(); |
| | | } |
| | | |
| | | |
| | | this.baseSetContext = this.setContext; |
| | | this.setContext = function(ctx) { |
| | | // initial values |
| | | ctx.strokeStyle = 'rgba(0,0,0,0)'; |
| | | ctx.lineCap = 'butt'; |
| | | ctx.lineJoin = 'miter'; |
| | | ctx.miterLimit = 4; |
| | | |
| | | ctx.miterLimit = 4; |
| | | |
| | | this.baseSetContext(ctx); |
| | | |
| | | |
| | | // create new view port |
| | | if (this.attribute('x').hasValue() && this.attribute('y').hasValue()) { |
| | | ctx.translate(this.attribute('x').Length.toPixels('x'), this.attribute('y').Length.toPixels('y')); |
| | | } |
| | | |
| | | |
| | | var width = svg.ViewPort.width(); |
| | | var height = svg.ViewPort.height(); |
| | | if (typeof(this.root) == 'undefined' && this.attribute('width').hasValue() && this.attribute('height').hasValue()) { |
| | | width = this.attribute('width').Length.toPixels('x'); |
| | | height = this.attribute('height').Length.toPixels('y'); |
| | | |
| | | |
| | | var x = 0; |
| | | var y = 0; |
| | | if (this.attribute('refX').hasValue() && this.attribute('refY').hasValue()) { |
| | | x = -this.attribute('refX').Length.toPixels('x'); |
| | | y = -this.attribute('refY').Length.toPixels('y'); |
| | | } |
| | | |
| | | |
| | | ctx.beginPath(); |
| | | ctx.moveTo(x, y); |
| | | ctx.lineTo(width, y); |
| | |
| | | ctx.closePath(); |
| | | ctx.clip(); |
| | | } |
| | | svg.ViewPort.SetCurrent(width, height); |
| | | |
| | | svg.ViewPort.SetCurrent(width, height); |
| | | |
| | | // viewbox |
| | | if (this.attribute('viewBox').hasValue()) { |
| | | if (this.attribute('viewBox').hasValue()) { |
| | | var viewBox = svg.ToNumberArray(this.attribute('viewBox').value); |
| | | var minX = viewBox[0]; |
| | | var minY = viewBox[1]; |
| | | width = viewBox[2]; |
| | | height = viewBox[3]; |
| | | |
| | | |
| | | svg.AspectRatio(ctx, |
| | | this.attribute('preserveAspectRatio').value, |
| | | svg.ViewPort.width(), |
| | | this.attribute('preserveAspectRatio').value, |
| | | svg.ViewPort.width(), |
| | | width, |
| | | svg.ViewPort.height(), |
| | | height, |
| | |
| | | minY, |
| | | this.attribute('refX').value, |
| | | this.attribute('refY').value); |
| | | |
| | | svg.ViewPort.RemoveCurrent(); |
| | | svg.ViewPort.SetCurrent(viewBox[2], viewBox[3]); |
| | | } |
| | | |
| | | svg.ViewPort.RemoveCurrent(); |
| | | svg.ViewPort.SetCurrent(viewBox[2], viewBox[3]); |
| | | } |
| | | } |
| | | } |
| | | svg.Element.svg.prototype = new svg.Element.RenderedElementBase; |
| | |
| | | svg.Element.rect = function(node) { |
| | | this.base = svg.Element.PathElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.path = function(ctx) { |
| | | var x = this.attribute('x').Length.toPixels('x'); |
| | | var y = this.attribute('y').Length.toPixels('y'); |
| | |
| | | var ry = this.attribute('ry').Length.toPixels('y'); |
| | | if (this.attribute('rx').hasValue() && !this.attribute('ry').hasValue()) ry = rx; |
| | | if (this.attribute('ry').hasValue() && !this.attribute('rx').hasValue()) rx = ry; |
| | | |
| | | |
| | | if (ctx != null) { |
| | | ctx.beginPath(); |
| | | ctx.moveTo(x + rx, y); |
| | |
| | | ctx.quadraticCurveTo(x, y, x + rx, y) |
| | | ctx.closePath(); |
| | | } |
| | | |
| | | |
| | | return new svg.BoundingBox(x, y, x + width, y + height); |
| | | } |
| | | } |
| | | svg.Element.rect.prototype = new svg.Element.PathElementBase; |
| | | |
| | | |
| | | // circle element |
| | | svg.Element.circle = function(node) { |
| | | this.base = svg.Element.PathElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.path = function(ctx) { |
| | | var cx = this.attribute('cx').Length.toPixels('x'); |
| | | var cy = this.attribute('cy').Length.toPixels('y'); |
| | | var r = this.attribute('r').Length.toPixels(); |
| | | |
| | | |
| | | if (ctx != null) { |
| | | ctx.beginPath(); |
| | | ctx.arc(cx, cy, r, 0, Math.PI * 2, true); |
| | | ctx.arc(cx, cy, r, 0, Math.PI * 2, true); |
| | | ctx.closePath(); |
| | | } |
| | | |
| | | |
| | | return new svg.BoundingBox(cx - r, cy - r, cx + r, cy + r); |
| | | } |
| | | } |
| | | svg.Element.circle.prototype = new svg.Element.PathElementBase; |
| | | svg.Element.circle.prototype = new svg.Element.PathElementBase; |
| | | |
| | | // ellipse element |
| | | svg.Element.ellipse = function(node) { |
| | | this.base = svg.Element.PathElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.path = function(ctx) { |
| | | var KAPPA = 4 * ((Math.sqrt(2) - 1) / 3); |
| | | var rx = this.attribute('rx').Length.toPixels('x'); |
| | | var ry = this.attribute('ry').Length.toPixels('y'); |
| | | var cx = this.attribute('cx').Length.toPixels('x'); |
| | | var cy = this.attribute('cy').Length.toPixels('y'); |
| | | |
| | | |
| | | if (ctx != null) { |
| | | ctx.beginPath(); |
| | | ctx.moveTo(cx, cy - ry); |
| | |
| | | ctx.bezierCurveTo(cx - rx, cy - (KAPPA * ry), cx - (KAPPA * rx), cy - ry, cx, cy - ry); |
| | | ctx.closePath(); |
| | | } |
| | | |
| | | |
| | | return new svg.BoundingBox(cx - rx, cy - ry, cx + rx, cy + ry); |
| | | } |
| | | } |
| | | svg.Element.ellipse.prototype = new svg.Element.PathElementBase; |
| | | |
| | | svg.Element.ellipse.prototype = new svg.Element.PathElementBase; |
| | | |
| | | // line element |
| | | svg.Element.line = function(node) { |
| | | this.base = svg.Element.PathElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.getPoints = function() { |
| | | return [ |
| | | new svg.Point(this.attribute('x1').Length.toPixels('x'), this.attribute('y1').Length.toPixels('y')), |
| | | new svg.Point(this.attribute('x2').Length.toPixels('x'), this.attribute('y2').Length.toPixels('y'))]; |
| | | } |
| | | |
| | | |
| | | this.path = function(ctx) { |
| | | var points = this.getPoints(); |
| | | |
| | | |
| | | if (ctx != null) { |
| | | ctx.beginPath(); |
| | | ctx.moveTo(points[0].x, points[0].y); |
| | | ctx.lineTo(points[1].x, points[1].y); |
| | | } |
| | | |
| | | |
| | | return new svg.BoundingBox(points[0].x, points[0].y, points[1].x, points[1].y); |
| | | } |
| | | |
| | | |
| | | this.getMarkers = function() { |
| | | var points = this.getPoints(); |
| | | var points = this.getPoints(); |
| | | var a = points[0].angleTo(points[1]); |
| | | return [[points[0], a], [points[1], a]]; |
| | | } |
| | | } |
| | | svg.Element.line.prototype = new svg.Element.PathElementBase; |
| | | |
| | | svg.Element.line.prototype = new svg.Element.PathElementBase; |
| | | |
| | | // polyline element |
| | | svg.Element.polyline = function(node) { |
| | | this.base = svg.Element.PathElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.points = svg.CreatePath(this.attribute('points').value); |
| | | this.path = function(ctx) { |
| | | var bb = new svg.BoundingBox(this.points[0].x, this.points[0].y); |
| | |
| | | } |
| | | return bb; |
| | | } |
| | | |
| | | |
| | | this.getMarkers = function() { |
| | | var markers = []; |
| | | for (var i=0; i<this.points.length - 1; i++) { |
| | |
| | | } |
| | | markers.push([this.points[this.points.length-1], markers[markers.length-1][1]]); |
| | | return markers; |
| | | } |
| | | } |
| | | } |
| | | svg.Element.polyline.prototype = new svg.Element.PathElementBase; |
| | | |
| | | svg.Element.polyline.prototype = new svg.Element.PathElementBase; |
| | | |
| | | // polygon element |
| | | svg.Element.polygon = function(node) { |
| | | this.base = svg.Element.polyline; |
| | | this.base(node); |
| | | |
| | | |
| | | this.basePath = this.path; |
| | | this.path = function(ctx) { |
| | | var bb = this.basePath(ctx); |
| | |
| | | svg.Element.path = function(node) { |
| | | this.base = svg.Element.PathElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | var d = this.attribute('d').value; |
| | | // TODO: convert to real lexer based on http://www.w3.org/TR/SVG11/paths.html#PathDataBNF |
| | | d = d.replace(/,/gm,' '); // get rid of all commas |
| | |
| | | d = svg.trim(d); |
| | | this.PathParser = new (function(d) { |
| | | this.tokens = d.split(' '); |
| | | |
| | | |
| | | this.reset = function() { |
| | | this.i = -1; |
| | | this.command = ''; |
| | |
| | | this.points = []; |
| | | this.angles = []; |
| | | } |
| | | |
| | | |
| | | this.isEnd = function() { |
| | | return this.i >= this.tokens.length - 1; |
| | | } |
| | | |
| | | |
| | | this.isCommandOrEnd = function() { |
| | | if (this.isEnd()) return true; |
| | | return this.tokens[this.i + 1].match(/^[A-Za-z]$/) != null; |
| | | } |
| | | |
| | | |
| | | this.isRelativeCommand = function() { |
| | | return this.command == this.command.toLowerCase(); |
| | | } |
| | | |
| | | |
| | | this.getToken = function() { |
| | | this.i = this.i + 1; |
| | | return this.tokens[this.i]; |
| | | } |
| | | |
| | | |
| | | this.getScalar = function() { |
| | | return parseFloat(this.getToken()); |
| | | } |
| | | |
| | | |
| | | this.nextCommand = function() { |
| | | this.previousCommand = this.command; |
| | | this.command = this.getToken(); |
| | | } |
| | | |
| | | } |
| | | |
| | | this.getPoint = function() { |
| | | var p = new svg.Point(this.getScalar(), this.getScalar()); |
| | | return this.makeAbsolute(p); |
| | | } |
| | | |
| | | |
| | | this.getAsControlPoint = function() { |
| | | var p = this.getPoint(); |
| | | this.control = p; |
| | | return p; |
| | | } |
| | | |
| | | |
| | | this.getAsCurrentPoint = function() { |
| | | var p = this.getPoint(); |
| | | this.current = p; |
| | | return p; |
| | | return p; |
| | | } |
| | | |
| | | |
| | | this.getReflectedControlPoint = function() { |
| | | if (this.previousCommand.toLowerCase() != 'c' && this.previousCommand.toLowerCase() != 's') { |
| | | return this.current; |
| | | } |
| | | |
| | | |
| | | // reflect point |
| | | var p = new svg.Point(2 * this.current.x - this.control.x, 2 * this.current.y - this.control.y); |
| | | var p = new svg.Point(2 * this.current.x - this.control.x, 2 * this.current.y - this.control.y); |
| | | return p; |
| | | } |
| | | |
| | | |
| | | this.makeAbsolute = function(p) { |
| | | if (this.isRelativeCommand()) { |
| | | p.x = this.current.x + p.x; |
| | |
| | | } |
| | | return p; |
| | | } |
| | | |
| | | |
| | | this.addMarker = function(p, from, priorTo) { |
| | | // if the last angle isn't filled in because we didn't have this point yet ... |
| | | if (priorTo != null && this.angles.length > 0 && this.angles[this.angles.length-1] == null) { |
| | |
| | | } |
| | | this.addMarkerAngle(p, from == null ? null : from.angleTo(p)); |
| | | } |
| | | |
| | | |
| | | this.addMarkerAngle = function(p, a) { |
| | | this.points.push(p); |
| | | this.angles.push(a); |
| | | } |
| | | |
| | | } |
| | | |
| | | this.getMarkerPoints = function() { return this.points; } |
| | | this.getMarkerAngles = function() { |
| | | for (var i=0; i<this.angles.length; i++) { |
| | |
| | | this.getMarkers = function() { |
| | | var points = this.PathParser.getMarkerPoints(); |
| | | var angles = this.PathParser.getMarkerAngles(); |
| | | |
| | | |
| | | var markers = []; |
| | | for (var i=0; i<points.length; i++) { |
| | | markers.push([points[i], angles[i]]); |
| | |
| | | } |
| | | } |
| | | svg.Element.path.prototype = new svg.Element.PathElementBase; |
| | | |
| | | |
| | | // pattern element |
| | | svg.Element.pattern = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.createPattern = function(ctx, element) { |
| | | // render me using a temporary svg element |
| | | var tempSvg = new svg.Element.svg(); |
| | |
| | | tempSvg.attributes['width'] = new svg.Property('width', this.attribute('width').value); |
| | | tempSvg.attributes['height'] = new svg.Property('height', this.attribute('height').value); |
| | | tempSvg.children = this.children; |
| | | |
| | | |
| | | var c = document.createElement('canvas'); |
| | | c.width = this.attribute('width').Length.toPixels('x'); |
| | | c.height = this.attribute('height').Length.toPixels('y'); |
| | | tempSvg.render(c.getContext('2d')); |
| | | tempSvg.render(c.getContext('2d')); |
| | | return ctx.createPattern(c, 'repeat'); |
| | | } |
| | | } |
| | | svg.Element.pattern.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // marker element |
| | | svg.Element.marker = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.baseRender = this.render; |
| | | this.render = function(ctx, point, angle) { |
| | | ctx.translate(point.x, point.y); |
| | | if (this.attribute('orient').valueOrDefault('auto') == 'auto') ctx.rotate(angle); |
| | | if (this.attribute('markerUnits').valueOrDefault('strokeWidth') == 'strokeWidth') ctx.scale(ctx.lineWidth, ctx.lineWidth); |
| | | ctx.save(); |
| | | |
| | | |
| | | // render me using a temporary svg element |
| | | var tempSvg = new svg.Element.svg(); |
| | | tempSvg.attributes['viewBox'] = new svg.Property('viewBox', this.attribute('viewBox').value); |
| | |
| | | tempSvg.attributes['stroke'] = new svg.Property('stroke', this.attribute('stroke').valueOrDefault('none')); |
| | | tempSvg.children = this.children; |
| | | tempSvg.render(ctx); |
| | | |
| | | |
| | | ctx.restore(); |
| | | if (this.attribute('markerUnits').valueOrDefault('strokeWidth') == 'strokeWidth') ctx.scale(1/ctx.lineWidth, 1/ctx.lineWidth); |
| | | if (this.attribute('orient').valueOrDefault('auto') == 'auto') ctx.rotate(-angle); |
| | |
| | | } |
| | | } |
| | | svg.Element.marker.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // definitions element |
| | | svg.Element.defs = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | this.base(node); |
| | | |
| | | this.render = function(ctx) { |
| | | // NOOP |
| | | } |
| | | } |
| | | svg.Element.defs.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // base for gradients |
| | | svg.Element.GradientBase = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.gradientUnits = this.attribute('gradientUnits').valueOrDefault('objectBoundingBox'); |
| | | |
| | | this.stops = []; |
| | | |
| | | this.stops = []; |
| | | for (var i=0; i<this.children.length; i++) { |
| | | var child = this.children[i]; |
| | | this.stops.push(child); |
| | | } |
| | | |
| | | } |
| | | |
| | | this.getGradient = function() { |
| | | // OVERRIDE ME! |
| | | } |
| | | } |
| | | |
| | | this.createGradient = function(ctx, element) { |
| | | var stopsContainer = this; |
| | | if (this.attribute('xlink:href').hasValue()) { |
| | | stopsContainer = this.attribute('xlink:href').Definition.getDefinition(); |
| | | } |
| | | |
| | | |
| | | var g = this.getGradient(ctx, element); |
| | | for (var i=0; i<stopsContainer.stops.length; i++) { |
| | | g.addColorStop(stopsContainer.stops[i].offset, stopsContainer.stops[i].color); |
| | | } |
| | | |
| | | |
| | | if (this.attribute('gradientTransform').hasValue()) { |
| | | // render as transformed pattern on temporary canvas |
| | | var rootView = svg.ViewPort.viewPorts[0]; |
| | | |
| | | |
| | | var rect = new svg.Element.rect(); |
| | | rect.attributes['x'] = new svg.Property('x', -svg.MAX_VIRTUAL_PIXELS/3.0); |
| | | rect.attributes['y'] = new svg.Property('y', -svg.MAX_VIRTUAL_PIXELS/3.0); |
| | | rect.attributes['width'] = new svg.Property('width', svg.MAX_VIRTUAL_PIXELS); |
| | | rect.attributes['height'] = new svg.Property('height', svg.MAX_VIRTUAL_PIXELS); |
| | | |
| | | |
| | | var group = new svg.Element.g(); |
| | | group.attributes['transform'] = new svg.Property('transform', this.attribute('gradientTransform').value); |
| | | group.children = [ rect ]; |
| | | |
| | | |
| | | var tempSvg = new svg.Element.svg(); |
| | | tempSvg.attributes['x'] = new svg.Property('x', 0); |
| | | tempSvg.attributes['y'] = new svg.Property('y', 0); |
| | | tempSvg.attributes['width'] = new svg.Property('width', rootView.width); |
| | | tempSvg.attributes['height'] = new svg.Property('height', rootView.height); |
| | | tempSvg.children = [ group ]; |
| | | |
| | | |
| | | var c = document.createElement('canvas'); |
| | | c.width = rootView.width; |
| | | c.height = rootView.height; |
| | | var tempCtx = c.getContext('2d'); |
| | | tempCtx.fillStyle = g; |
| | | tempSvg.render(tempCtx); |
| | | tempSvg.render(tempCtx); |
| | | return tempCtx.createPattern(c, 'no-repeat'); |
| | | } |
| | | |
| | | return g; |
| | | |
| | | return g; |
| | | } |
| | | } |
| | | svg.Element.GradientBase.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // linear gradient element |
| | | svg.Element.linearGradient = function(node) { |
| | | this.base = svg.Element.GradientBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.getGradient = function(ctx, element) { |
| | | var bb = element.getBoundingBox(); |
| | | |
| | | var x1 = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.x() + bb.width() * this.attribute('x1').numValue() |
| | | |
| | | var x1 = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.x() + bb.width() * this.attribute('x1').numValue() |
| | | : this.attribute('x1').Length.toPixels('x')); |
| | | var y1 = (this.gradientUnits == 'objectBoundingBox' |
| | | var y1 = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.y() + bb.height() * this.attribute('y1').numValue() |
| | | : this.attribute('y1').Length.toPixels('y')); |
| | | var x2 = (this.gradientUnits == 'objectBoundingBox' |
| | | var x2 = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.x() + bb.width() * this.attribute('x2').numValue() |
| | | : this.attribute('x2').Length.toPixels('x')); |
| | | var y2 = (this.gradientUnits == 'objectBoundingBox' |
| | | var y2 = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.y() + bb.height() * this.attribute('y2').numValue() |
| | | : this.attribute('y2').Length.toPixels('y')); |
| | | |
| | |
| | | } |
| | | } |
| | | svg.Element.linearGradient.prototype = new svg.Element.GradientBase; |
| | | |
| | | |
| | | // radial gradient element |
| | | svg.Element.radialGradient = function(node) { |
| | | this.base = svg.Element.GradientBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.getGradient = function(ctx, element) { |
| | | var bb = element.getBoundingBox(); |
| | | |
| | | var cx = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.x() + bb.width() * this.attribute('cx').numValue() |
| | | |
| | | var cx = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.x() + bb.width() * this.attribute('cx').numValue() |
| | | : this.attribute('cx').Length.toPixels('x')); |
| | | var cy = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.y() + bb.height() * this.attribute('cy').numValue() |
| | | var cy = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.y() + bb.height() * this.attribute('cy').numValue() |
| | | : this.attribute('cy').Length.toPixels('y')); |
| | | |
| | | |
| | | var fx = cx; |
| | | var fy = cy; |
| | | if (this.attribute('fx').hasValue()) { |
| | | fx = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.x() + bb.width() * this.attribute('fx').numValue() |
| | | fx = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.x() + bb.width() * this.attribute('fx').numValue() |
| | | : this.attribute('fx').Length.toPixels('x')); |
| | | } |
| | | if (this.attribute('fy').hasValue()) { |
| | | fy = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.y() + bb.height() * this.attribute('fy').numValue() |
| | | fy = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.y() + bb.height() * this.attribute('fy').numValue() |
| | | : this.attribute('fy').Length.toPixels('y')); |
| | | } |
| | | |
| | | var r = (this.gradientUnits == 'objectBoundingBox' |
| | | |
| | | var r = (this.gradientUnits == 'objectBoundingBox' |
| | | ? (bb.width() + bb.height()) / 2.0 * this.attribute('r').numValue() |
| | | : this.attribute('r').Length.toPixels()); |
| | | |
| | | |
| | | return ctx.createRadialGradient(fx, fy, 0, cx, cy, r); |
| | | } |
| | | } |
| | | svg.Element.radialGradient.prototype = new svg.Element.GradientBase; |
| | | |
| | | |
| | | // gradient stop element |
| | | svg.Element.stop = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.offset = this.attribute('offset').numValue(); |
| | | |
| | | |
| | | var stopColor = this.style('stop-color'); |
| | | if (this.style('stop-opacity').hasValue()) stopColor = stopColor.Color.addOpacity(this.style('stop-opacity').value); |
| | | this.color = stopColor.value; |
| | | } |
| | | svg.Element.stop.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // animation base element |
| | | svg.Element.AnimateBase = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | svg.Animations.push(this); |
| | | |
| | | |
| | | this.duration = 0.0; |
| | | this.begin = this.attribute('begin').Time.toMilliseconds(); |
| | | this.maxDuration = this.begin + this.attribute('dur').Time.toMilliseconds(); |
| | | |
| | | |
| | | this.getProperty = function() { |
| | | var attributeType = this.attribute('attributeType').value; |
| | | var attributeName = this.attribute('attributeName').value; |
| | | |
| | | |
| | | if (attributeType == 'CSS') { |
| | | return this.parent.style(attributeName, true); |
| | | } |
| | | return this.parent.attribute(attributeName, true); |
| | | return this.parent.attribute(attributeName, true); |
| | | }; |
| | | |
| | | |
| | | this.initialValue = null; |
| | | this.removed = false; |
| | | this.removed = false; |
| | | |
| | | this.calcValue = function() { |
| | | // OVERRIDE ME! |
| | | return ''; |
| | | } |
| | | |
| | | this.update = function(delta) { |
| | | |
| | | this.update = function(delta) { |
| | | // set initial value |
| | | if (this.initialValue == null) { |
| | | this.initialValue = this.getProperty().value; |
| | | } |
| | | |
| | | |
| | | // if we're past the end time |
| | | if (this.duration > this.maxDuration) { |
| | | // loop for indefinitely repeating animations |
| | |
| | | else { |
| | | return false; // no updates made |
| | | } |
| | | } |
| | | } |
| | | this.duration = this.duration + delta; |
| | | |
| | | |
| | | // if we're past the begin time |
| | | var updated = false; |
| | | if (this.begin < this.duration) { |
| | | var newValue = this.calcValue(); // tween |
| | | |
| | | |
| | | if (this.attribute('type').hasValue()) { |
| | | // for transform, etc. |
| | | var type = this.attribute('type').value; |
| | | newValue = type + '(' + newValue + ')'; |
| | | } |
| | | |
| | | |
| | | this.getProperty().value = newValue; |
| | | updated = true; |
| | | } |
| | | |
| | | |
| | | return updated; |
| | | } |
| | | |
| | | |
| | | // fraction of duration we've covered |
| | | this.progress = function() { |
| | | return ((this.duration - this.begin) / (this.maxDuration - this.begin)); |
| | | } |
| | | } |
| | | } |
| | | svg.Element.AnimateBase.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // animate element |
| | | svg.Element.animate = function(node) { |
| | | this.base = svg.Element.AnimateBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.calcValue = function() { |
| | | var from = this.attribute('from').numValue(); |
| | | var to = this.attribute('to').numValue(); |
| | | |
| | | |
| | | // tween value linearly |
| | | return from + (to - from) * this.progress(); |
| | | return from + (to - from) * this.progress(); |
| | | }; |
| | | } |
| | | svg.Element.animate.prototype = new svg.Element.AnimateBase; |
| | | |
| | | |
| | | // animate color element |
| | | svg.Element.animateColor = function(node) { |
| | | this.base = svg.Element.AnimateBase; |
| | |
| | | this.calcValue = function() { |
| | | var from = new RGBColor(this.attribute('from').value); |
| | | var to = new RGBColor(this.attribute('to').value); |
| | | |
| | | |
| | | if (from.ok && to.ok) { |
| | | // tween color linearly |
| | | var r = from.r + (to.r - from.r) * this.progress(); |
| | |
| | | }; |
| | | } |
| | | svg.Element.animateColor.prototype = new svg.Element.AnimateBase; |
| | | |
| | | |
| | | // animate transform element |
| | | svg.Element.animateTransform = function(node) { |
| | | this.base = svg.Element.animate; |
| | | this.base(node); |
| | | } |
| | | svg.Element.animateTransform.prototype = new svg.Element.animate; |
| | | |
| | | |
| | | // font element |
| | | svg.Element.font = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | this.horizAdvX = this.attribute('horiz-adv-x').numValue(); |
| | | |
| | | this.horizAdvX = this.attribute('horiz-adv-x').numValue(); |
| | | |
| | | this.isRTL = false; |
| | | this.isArabic = false; |
| | | this.fontFace = null; |
| | | this.missingGlyph = null; |
| | | this.glyphs = []; |
| | | this.glyphs = []; |
| | | for (var i=0; i<this.children.length; i++) { |
| | | var child = this.children[i]; |
| | | if (child.type == 'font-face') { |
| | |
| | | this.glyphs[child.unicode] = child; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | svg.Element.font.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // font-face element |
| | | svg.Element.fontface = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | this.base(node); |
| | | |
| | | this.ascent = this.attribute('ascent').value; |
| | | this.descent = this.attribute('descent').value; |
| | | this.unitsPerEm = this.attribute('units-per-em').numValue(); |
| | | this.unitsPerEm = this.attribute('units-per-em').numValue(); |
| | | } |
| | | svg.Element.fontface.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // missing-glyph element |
| | | svg.Element.missingglyph = function(node) { |
| | | this.base = svg.Element.path; |
| | | this.base(node); |
| | | |
| | | this.base(node); |
| | | |
| | | this.horizAdvX = 0; |
| | | } |
| | | svg.Element.missingglyph.prototype = new svg.Element.path; |
| | | |
| | | |
| | | // glyph element |
| | | svg.Element.glyph = function(node) { |
| | | this.base = svg.Element.path; |
| | | this.base(node); |
| | | |
| | | this.base(node); |
| | | |
| | | this.horizAdvX = this.attribute('horiz-adv-x').numValue(); |
| | | this.unicode = this.attribute('unicode').value; |
| | | this.arabicForm = this.attribute('arabic-form').value; |
| | | } |
| | | svg.Element.glyph.prototype = new svg.Element.path; |
| | | |
| | | |
| | | // text element |
| | | svg.Element.text = function(node) { |
| | | this.base = svg.Element.RenderedElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | if (node != null) { |
| | | // add children |
| | | this.children = []; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | this.baseSetContext = this.setContext; |
| | | this.setContext = function(ctx) { |
| | | this.baseSetContext(ctx); |
| | | if (this.style('dominant-baseline').hasValue()) ctx.textBaseline = this.style('dominant-baseline').value; |
| | | if (this.style('alignment-baseline').hasValue()) ctx.textBaseline = this.style('alignment-baseline').value; |
| | | } |
| | | |
| | | |
| | | this.renderChildren = function(ctx) { |
| | | var textAnchor = this.style('text-anchor').valueOrDefault('start'); |
| | | var x = this.attribute('x').Length.toPixels('x'); |
| | | var y = this.attribute('y').Length.toPixels('y'); |
| | | for (var i=0; i<this.children.length; i++) { |
| | | var child = this.children[i]; |
| | | |
| | | |
| | | if (child.attribute('x').hasValue()) { |
| | | child.x = child.attribute('x').Length.toPixels('x'); |
| | | } |
| | |
| | | if (child.attribute('dx').hasValue()) x += child.attribute('dx').Length.toPixels('x'); |
| | | child.x = x; |
| | | } |
| | | |
| | | |
| | | var childLength = child.measureText(ctx); |
| | | if (textAnchor != 'start' && (i==0 || child.attribute('x').hasValue())) { // new group? |
| | | // loop through rest of children |
| | |
| | | child.x -= (textAnchor == 'end' ? groupLength : groupLength / 2.0); |
| | | } |
| | | x = child.x + childLength; |
| | | |
| | | |
| | | if (child.attribute('y').hasValue()) { |
| | | child.y = child.attribute('y').Length.toPixels('y'); |
| | | } |
| | | else { |
| | | if (child.attribute('dy').hasValue()) y += child.attribute('dy').Length.toPixels('y'); |
| | | child.y = y; |
| | | } |
| | | } |
| | | y = child.y; |
| | | |
| | | |
| | | child.render(ctx); |
| | | } |
| | | } |
| | | } |
| | | svg.Element.text.prototype = new svg.Element.RenderedElementBase; |
| | | |
| | | |
| | | // text base |
| | | svg.Element.TextElementBase = function(node) { |
| | | this.base = svg.Element.RenderedElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.getGlyph = function(font, text, i) { |
| | | var c = text[i]; |
| | | var glyph = null; |
| | | if (font.isArabic) { |
| | | var arabicForm = 'isolated'; |
| | | if ((i==0 || text[i-1]==' ') && i<text.length-2 && text[i+1]!=' ') arabicForm = 'terminal'; |
| | | if ((i==0 || text[i-1]==' ') && i<text.length-2 && text[i+1]!=' ') arabicForm = 'terminal'; |
| | | if (i>0 && text[i-1]!=' ' && i<text.length-2 && text[i+1]!=' ') arabicForm = 'medial'; |
| | | if (i>0 && text[i-1]!=' ' && (i == text.length-1 || text[i+1]==' ')) arabicForm = 'initial'; |
| | | if (typeof(font.glyphs[c]) != 'undefined') { |
| | |
| | | if (glyph == null) glyph = font.missingGlyph; |
| | | return glyph; |
| | | } |
| | | |
| | | |
| | | this.renderChildren = function(ctx) { |
| | | var customFont = this.parent.style('font-family').Definition.getDefinition(); |
| | | if (customFont != null) { |
| | |
| | | var fontStyle = this.parent.style('font-style').valueOrDefault(svg.Font.Parse(svg.ctx.font).fontStyle); |
| | | var text = this.getText(); |
| | | if (customFont.isRTL) text = text.split("").reverse().join(""); |
| | | |
| | | |
| | | var dx = svg.ToNumberArray(this.parent.attribute('dx').value); |
| | | for (var i=0; i<text.length; i++) { |
| | | var glyph = this.getGlyph(customFont, text, i); |
| | |
| | | if (fontStyle == 'italic') ctx.transform(1, 0, -.4, 1, 0, 0); |
| | | ctx.lineWidth = lw; |
| | | ctx.scale(1/scale, -1/scale); |
| | | ctx.translate(-this.x, -this.y); |
| | | |
| | | ctx.translate(-this.x, -this.y); |
| | | |
| | | this.x += fontSize * (glyph.horizAdvX || customFont.horizAdvX) / customFont.fontFace.unitsPerEm; |
| | | if (typeof(dx[i]) != 'undefined' && !isNaN(dx[i])) { |
| | | this.x += dx[i]; |
| | |
| | | } |
| | | return; |
| | | } |
| | | |
| | | |
| | | if (ctx.strokeStyle != '') ctx.strokeText(svg.compressSpaces(this.getText()), this.x, this.y); |
| | | if (ctx.fillStyle != '') ctx.fillText(svg.compressSpaces(this.getText()), this.x, this.y); |
| | | } |
| | | |
| | | |
| | | this.getText = function() { |
| | | // OVERRIDE ME |
| | | } |
| | | |
| | | |
| | | this.measureText = function(ctx) { |
| | | var customFont = this.parent.style('font-family').Definition.getDefinition(); |
| | | if (customFont != null) { |
| | |
| | | } |
| | | return measure; |
| | | } |
| | | |
| | | |
| | | var textToMeasure = svg.compressSpaces(this.getText()); |
| | | if (!ctx.measureText) return textToMeasure.length * 10; |
| | | |
| | | |
| | | ctx.save(); |
| | | this.setContext(ctx); |
| | | var width = ctx.measureText(textToMeasure).width; |
| | |
| | | } |
| | | } |
| | | svg.Element.TextElementBase.prototype = new svg.Element.RenderedElementBase; |
| | | |
| | | // tspan |
| | | |
| | | // tspan |
| | | svg.Element.tspan = function(node) { |
| | | this.base = svg.Element.TextElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.text = node.nodeType == 3 ? node.nodeValue : // text |
| | | node.childNodes.length > 0 ? node.childNodes[0].nodeValue : // element |
| | | node.text; |
| | |
| | | } |
| | | } |
| | | svg.Element.tspan.prototype = new svg.Element.TextElementBase; |
| | | |
| | | |
| | | // tref |
| | | svg.Element.tref = function(node) { |
| | | this.base = svg.Element.TextElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.getText = function() { |
| | | var element = this.attribute('xlink:href').Definition.getDefinition(); |
| | | if (element != null) return element.children[0].getText(); |
| | | } |
| | | } |
| | | svg.Element.tref.prototype = new svg.Element.TextElementBase; |
| | | |
| | | svg.Element.tref.prototype = new svg.Element.TextElementBase; |
| | | |
| | | // a element |
| | | svg.Element.a = function(node) { |
| | | this.base = svg.Element.TextElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.hasText = true; |
| | | for (var i=0; i<node.childNodes.length; i++) { |
| | | if (node.childNodes[i].nodeType != 3) this.hasText = false; |
| | | } |
| | | |
| | | |
| | | // this might contain text |
| | | this.text = this.hasText ? node.childNodes[0].nodeValue : ''; |
| | | this.getText = function() { |
| | | return this.text; |
| | | } |
| | | } |
| | | |
| | | this.baseRenderChildren = this.renderChildren; |
| | | this.renderChildren = function(ctx) { |
| | |
| | | // render as text element |
| | | this.baseRenderChildren(ctx); |
| | | var fontSize = new svg.Property('fontSize', svg.Font.Parse(svg.ctx.font).fontSize); |
| | | svg.Mouse.checkBoundingBox(this, new svg.BoundingBox(this.x, this.y - fontSize.Length.toPixels('y'), this.x + this.measureText(ctx), this.y)); |
| | | svg.Mouse.checkBoundingBox(this, new svg.BoundingBox(this.x, this.y - fontSize.Length.toPixels('y'), this.x + this.measureText(ctx), this.y)); |
| | | } |
| | | else { |
| | | // render as temporary group |
| | |
| | | g.render(ctx); |
| | | } |
| | | } |
| | | |
| | | |
| | | this.onclick = function() { |
| | | window.open(this.attribute('xlink:href').value); |
| | | } |
| | | |
| | | |
| | | this.onmousemove = function() { |
| | | svg.ctx.canvas.style.cursor = 'pointer'; |
| | | } |
| | | } |
| | | svg.Element.a.prototype = new svg.Element.TextElementBase; |
| | | |
| | | svg.Element.a.prototype = new svg.Element.TextElementBase; |
| | | |
| | | // image element |
| | | svg.Element.image = function(node) { |
| | | this.base = svg.Element.RenderedElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | svg.Images.push(this); |
| | | this.img = document.createElement('img'); |
| | | this.loaded = false; |
| | | var that = this; |
| | | this.img.onload = function() { that.loaded = true; } |
| | | this.img.src = this.attribute('xlink:href').value; |
| | | |
| | | |
| | | this.renderChildren = function(ctx) { |
| | | var x = this.attribute('x').Length.toPixels('x'); |
| | | var y = this.attribute('y').Length.toPixels('y'); |
| | | |
| | | |
| | | var width = this.attribute('width').Length.toPixels('x'); |
| | | var height = this.attribute('height').Length.toPixels('y'); |
| | | var height = this.attribute('height').Length.toPixels('y'); |
| | | if (width == 0 || height == 0) return; |
| | | |
| | | |
| | | ctx.save(); |
| | | ctx.translate(x, y); |
| | | svg.AspectRatio(ctx, |
| | |
| | | height, |
| | | this.img.height, |
| | | 0, |
| | | 0); |
| | | ctx.drawImage(this.img, 0, 0); |
| | | 0); |
| | | ctx.drawImage(this.img, 0, 0); |
| | | ctx.restore(); |
| | | } |
| | | } |
| | | svg.Element.image.prototype = new svg.Element.RenderedElementBase; |
| | | |
| | | |
| | | // group element |
| | | svg.Element.g = function(node) { |
| | | this.base = svg.Element.RenderedElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.getBoundingBox = function() { |
| | | var bb = new svg.BoundingBox(); |
| | | for (var i=0; i<this.children.length; i++) { |
| | |
| | | svg.Element.symbol = function(node) { |
| | | this.base = svg.Element.RenderedElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.baseSetContext = this.setContext; |
| | | this.setContext = function(ctx) { |
| | | this.setContext = function(ctx) { |
| | | this.baseSetContext(ctx); |
| | | |
| | | |
| | | // viewbox |
| | | if (this.attribute('viewBox').hasValue()) { |
| | | if (this.attribute('viewBox').hasValue()) { |
| | | var viewBox = svg.ToNumberArray(this.attribute('viewBox').value); |
| | | var minX = viewBox[0]; |
| | | var minY = viewBox[1]; |
| | | width = viewBox[2]; |
| | | height = viewBox[3]; |
| | | |
| | | |
| | | svg.AspectRatio(ctx, |
| | | this.attribute('preserveAspectRatio').value, |
| | | this.attribute('preserveAspectRatio').value, |
| | | this.attribute('width').Length.toPixels('x'), |
| | | width, |
| | | this.attribute('height').Length.toPixels('y'), |
| | |
| | | minX, |
| | | minY); |
| | | |
| | | svg.ViewPort.SetCurrent(viewBox[2], viewBox[3]); |
| | | svg.ViewPort.SetCurrent(viewBox[2], viewBox[3]); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | svg.Element.symbol.prototype = new svg.Element.RenderedElementBase; |
| | | |
| | | svg.Element.symbol.prototype = new svg.Element.RenderedElementBase; |
| | | |
| | | // style element |
| | | svg.Element.style = function(node) { |
| | | svg.Element.style = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | // text, or spaces then CDATA |
| | | var css = node.childNodes[0].nodeValue + (node.childNodes.length > 1 ? node.childNodes[1].nodeValue : ''); |
| | | css = css.replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm, ''); // remove comments |
| | |
| | | } |
| | | } |
| | | svg.Element.style.prototype = new svg.Element.ElementBase; |
| | | |
| | | // use element |
| | | |
| | | // use element |
| | | svg.Element.use = function(node) { |
| | | this.base = svg.Element.RenderedElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.baseSetContext = this.setContext; |
| | | this.setContext = function(ctx) { |
| | | this.baseSetContext(ctx); |
| | | if (this.attribute('x').hasValue()) ctx.translate(this.attribute('x').Length.toPixels('x'), 0); |
| | | if (this.attribute('y').hasValue()) ctx.translate(0, this.attribute('y').Length.toPixels('y')); |
| | | } |
| | | |
| | | |
| | | this.getDefinition = function() { |
| | | var element = this.attribute('xlink:href').Definition.getDefinition(); |
| | | if (this.attribute('width').hasValue()) element.attribute('width', true).value = this.attribute('width').value; |
| | | if (this.attribute('height').hasValue()) element.attribute('height', true).value = this.attribute('height').value; |
| | | return element; |
| | | } |
| | | |
| | | |
| | | this.path = function(ctx) { |
| | | var element = this.getDefinition(); |
| | | if (element != null) element.path(ctx); |
| | | } |
| | | |
| | | |
| | | this.renderChildren = function(ctx) { |
| | | var element = this.getDefinition(); |
| | | if (element != null) element.render(ctx); |
| | | } |
| | | } |
| | | svg.Element.use.prototype = new svg.Element.RenderedElementBase; |
| | | |
| | | |
| | | // mask element |
| | | svg.Element.mask = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.apply = function(ctx, element) { |
| | | // render as temp svg |
| | | // render as temp svg |
| | | var x = this.attribute('x').Length.toPixels('x'); |
| | | var y = this.attribute('y').Length.toPixels('y'); |
| | | var width = this.attribute('width').Length.toPixels('x'); |
| | | var height = this.attribute('height').Length.toPixels('y'); |
| | | |
| | | |
| | | // temporarily remove mask to avoid recursion |
| | | var mask = element.attribute('mask').value; |
| | | element.attribute('mask').value = ''; |
| | | |
| | | |
| | | var cMask = document.createElement('canvas'); |
| | | cMask.width = x + width; |
| | | cMask.height = y + height; |
| | | var maskCtx = cMask.getContext('2d'); |
| | | this.renderChildren(maskCtx); |
| | | |
| | | |
| | | var c = document.createElement('canvas'); |
| | | c.width = x + width; |
| | | c.height = y + height; |
| | |
| | | tempCtx.globalCompositeOperation = 'destination-in'; |
| | | tempCtx.fillStyle = maskCtx.createPattern(cMask, 'no-repeat'); |
| | | tempCtx.fillRect(0, 0, x + width, y + height); |
| | | |
| | | |
| | | ctx.fillStyle = tempCtx.createPattern(c, 'no-repeat'); |
| | | ctx.fillRect(0, 0, x + width, y + height); |
| | | |
| | | |
| | | // reassign mask |
| | | element.attribute('mask').value = mask; |
| | | element.attribute('mask').value = mask; |
| | | } |
| | | |
| | | |
| | | this.render = function(ctx) { |
| | | // NO RENDER |
| | | } |
| | | } |
| | | svg.Element.mask.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // clip element |
| | | svg.Element.clipPath = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.apply = function(ctx) { |
| | | for (var i=0; i<this.children.length; i++) { |
| | | if (this.children[i].path) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | this.render = function(ctx) { |
| | | // NO RENDER |
| | | } |
| | |
| | | svg.Element.filter = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.apply = function(ctx, element) { |
| | | // render as temp svg |
| | | // render as temp svg |
| | | var bb = element.getBoundingBox(); |
| | | var x = this.attribute('x').Length.toPixels('x'); |
| | | var y = this.attribute('y').Length.toPixels('y'); |
| | |
| | | width = bb.width(); |
| | | height = bb.height(); |
| | | } |
| | | |
| | | |
| | | // temporarily remove filter to avoid recursion |
| | | var filter = element.style('filter').value; |
| | | element.style('filter').value = ''; |
| | | |
| | | |
| | | // max filter distance |
| | | var extraPercent = .20; |
| | | var px = extraPercent * width; |
| | | var py = extraPercent * height; |
| | | |
| | | |
| | | var c = document.createElement('canvas'); |
| | | c.width = width + 2*px; |
| | | c.height = height + 2*py; |
| | | var tempCtx = c.getContext('2d'); |
| | | tempCtx.translate(-x + px, -y + py); |
| | | element.render(tempCtx); |
| | | |
| | | |
| | | // apply filters |
| | | for (var i=0; i<this.children.length; i++) { |
| | | this.children[i].apply(tempCtx, 0, 0, width + 2*px, height + 2*py); |
| | | } |
| | | |
| | | |
| | | // render on me |
| | | ctx.drawImage(c, 0, 0, width + 2*px, height + 2*py, x - px, y - py, width + 2*px, height + 2*py); |
| | | |
| | | |
| | | // reassign filter |
| | | element.style('filter', true).value = filter; |
| | | element.style('filter', true).value = filter; |
| | | } |
| | | |
| | | |
| | | this.render = function(ctx) { |
| | | // NO RENDER |
| | | } |
| | | } |
| | | } |
| | | svg.Element.filter.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | svg.Element.feGaussianBlur = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | this.base(node); |
| | | |
| | | function make_fgauss(sigma) { |
| | | sigma = Math.max(sigma, 0.01); |
| | | var len = Math.ceil(sigma * 4.0) + 1; |
| | | mask = []; |
| | | for (var i = 0; i < len; i++) { |
| | | mask[i] = Math.exp(-0.5 * (i / sigma) * (i / sigma)); |
| | | } |
| | | return mask; |
| | | sigma = Math.max(sigma, 0.01); |
| | | var len = Math.ceil(sigma * 4.0) + 1; |
| | | mask = []; |
| | | for (var i = 0; i < len; i++) { |
| | | mask[i] = Math.exp(-0.5 * (i / sigma) * (i / sigma)); |
| | | } |
| | | return mask; |
| | | } |
| | | |
| | | |
| | | function normalize(mask) { |
| | | var sum = 0; |
| | | for (var i = 1; i < mask.length; i++) { |
| | |
| | | } |
| | | return mask; |
| | | } |
| | | |
| | | |
| | | function convolve_even(src, dst, mask, width, height) { |
| | | for (var y = 0; y < height; y++) { |
| | | for (var x = 0; x < width; x++) { |
| | | var a = imGet(src, x, y, width, height, 3)/255; |
| | | for (var rgba = 0; rgba < 4; rgba++) { |
| | | for (var rgba = 0; rgba < 4; rgba++) { |
| | | var sum = mask[0] * (a==0?255:imGet(src, x, y, width, height, rgba)) * (a==0||rgba==3?1:a); |
| | | for (var i = 1; i < mask.length; i++) { |
| | | var a1 = imGet(src, Math.max(x-i,0), y, width, height, 3)/255; |
| | | var a2 = imGet(src, Math.min(x+i, width-1), y, width, height, 3)/255; |
| | | sum += mask[i] * |
| | | ((a1==0?255:imGet(src, Math.max(x-i,0), y, width, height, rgba)) * (a1==0||rgba==3?1:a1) + |
| | | sum += mask[i] * |
| | | ((a1==0?255:imGet(src, Math.max(x-i,0), y, width, height, rgba)) * (a1==0||rgba==3?1:a1) + |
| | | (a2==0?255:imGet(src, Math.min(x+i, width-1), y, width, height, rgba)) * (a2==0||rgba==3?1:a2)); |
| | | } |
| | | imSet(dst, y, x, height, width, rgba, sum); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | function imGet(img, x, y, width, height, rgba) { |
| | | return img[y*width*4 + x*4 + rgba]; |
| | | } |
| | | |
| | | |
| | | function imSet(img, x, y, width, height, rgba, val) { |
| | | img[y*width*4 + x*4 + rgba] = val; |
| | | } |
| | | |
| | | |
| | | function blur(ctx, width, height, sigma) |
| | | { |
| | | var srcData = ctx.getImageData(0, 0, width, height); |
| | |
| | | convolve_even(tmp, srcData.data, mask, height, width); |
| | | ctx.clearRect(0, 0, width, height); |
| | | ctx.putImageData(srcData, 0, 0); |
| | | } |
| | | |
| | | } |
| | | |
| | | this.apply = function(ctx, x, y, width, height) { |
| | | // assuming x==0 && y==0 for now |
| | | blur(ctx, width, height, this.attribute('stdDeviation').numValue()); |
| | | } |
| | | } |
| | | svg.Element.filter.prototype = new svg.Element.feGaussianBlur; |
| | | |
| | | |
| | | // title element, do nothing |
| | | svg.Element.title = function(node) { |
| | | } |
| | |
| | | // desc element, do nothing |
| | | svg.Element.desc = function(node) { |
| | | } |
| | | svg.Element.desc.prototype = new svg.Element.ElementBase; |
| | | |
| | | svg.Element.desc.prototype = new svg.Element.ElementBase; |
| | | |
| | | svg.Element.MISSING = function(node) { |
| | | console.log('ERROR: Element \'' + node.nodeName + '\' not yet implemented.'); |
| | | } |
| | | svg.Element.MISSING.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // element factory |
| | | svg.CreateElement = function(node) { |
| | | svg.CreateElement = function(node) { |
| | | var className = node.nodeName.replace(/^[^:]+:/,''); // remove namespace |
| | | className = className.replace(/\-/g,''); // remove dashes |
| | | var e = null; |
| | |
| | | e.type = node.nodeName; |
| | | return e; |
| | | } |
| | | |
| | | |
| | | // load from url |
| | | svg.load = function(ctx, url) { |
| | | svg.loadXml(ctx, svg.ajax(url)); |
| | | } |
| | | |
| | | |
| | | // load from xml |
| | | svg.loadXml = function(ctx, xml) { |
| | | svg.loadXmlDoc(ctx, svg.parseXml(xml)); |
| | | } |
| | | |
| | | |
| | | svg.loadXmlDoc = function(ctx, dom) { |
| | | svg.init(ctx); |
| | | |
| | | |
| | | var mapXY = function(p) { |
| | | var e = ctx.canvas; |
| | | while (e) { |
| | |
| | | if (window.scrollY) p.y += window.scrollY; |
| | | return p; |
| | | } |
| | | |
| | | |
| | | // bind mouse |
| | | if (svg.opts['ignoreMouse'] != true) { |
| | | ctx.canvas.onclick = function(e) { |
| | |
| | | svg.Mouse.onmousemove(p.x, p.y); |
| | | }; |
| | | } |
| | | |
| | | |
| | | var e = svg.CreateElement(dom.documentElement); |
| | | e.root = true; |
| | | |
| | | |
| | | // render loop |
| | | var isFirstRender = true; |
| | | var draw = function() { |
| | | svg.ViewPort.Clear(); |
| | | if (ctx.canvas.parentNode) svg.ViewPort.SetCurrent(ctx.canvas.parentNode.clientWidth, ctx.canvas.parentNode.clientHeight); |
| | | |
| | | |
| | | if (svg.opts['ignoreDimensions'] != true) { |
| | | // set canvas size |
| | | if (e.style('width').hasValue()) { |
| | |
| | | } |
| | | var cWidth = ctx.canvas.clientWidth || ctx.canvas.width; |
| | | var cHeight = ctx.canvas.clientHeight || ctx.canvas.height; |
| | | svg.ViewPort.SetCurrent(cWidth, cHeight); |
| | | |
| | | svg.ViewPort.SetCurrent(cWidth, cHeight); |
| | | |
| | | if (svg.opts != null && svg.opts['offsetX'] != null) e.attribute('x', true).value = svg.opts['offsetX']; |
| | | if (svg.opts != null && svg.opts['offsetY'] != null) e.attribute('y', true).value = svg.opts['offsetY']; |
| | | if (svg.opts != null && svg.opts['scaleWidth'] != null && svg.opts['scaleHeight'] != null) { |
| | | var xRatio = 1, yRatio = 1; |
| | | if (e.attribute('width').hasValue()) xRatio = e.attribute('width').Length.toPixels('x') / svg.opts['scaleWidth']; |
| | | if (e.attribute('height').hasValue()) yRatio = e.attribute('height').Length.toPixels('y') / svg.opts['scaleHeight']; |
| | | |
| | | |
| | | e.attribute('width', true).value = svg.opts['scaleWidth']; |
| | | e.attribute('height', true).value = svg.opts['scaleHeight']; |
| | | e.attribute('height', true).value = svg.opts['scaleHeight']; |
| | | e.attribute('viewBox', true).value = '0 0 ' + (cWidth * xRatio) + ' ' + (cHeight * yRatio); |
| | | e.attribute('preserveAspectRatio', true).value = 'none'; |
| | | } |
| | | |
| | | |
| | | // clear and render |
| | | if (svg.opts['ignoreClear'] != true) { |
| | | ctx.clearRect(0, 0, cWidth, cHeight); |
| | |
| | | if (isFirstRender) { |
| | | isFirstRender = false; |
| | | if (svg.opts != null && typeof(svg.opts['renderCallback']) == 'function') svg.opts['renderCallback'](); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | var waitingForImages = true; |
| | | if (svg.ImagesLoaded()) { |
| | | waitingForImages = false; |
| | | draw(); |
| | | } |
| | | svg.intervalID = setInterval(function() { |
| | | svg.intervalID = setInterval(function() { |
| | | var needUpdate = false; |
| | | |
| | | |
| | | if (waitingForImages && svg.ImagesLoaded()) { |
| | | waitingForImages = false; |
| | | needUpdate = true; |
| | | } |
| | | |
| | | |
| | | // need update from mouse events? |
| | | if (svg.opts['ignoreMouse'] != true) { |
| | | needUpdate = needUpdate | svg.Mouse.hasEvents(); |
| | | } |
| | | |
| | | |
| | | // need update from animations? |
| | | if (svg.opts['ignoreAnimation'] != true) { |
| | | for (var i=0; i<svg.Animations.length; i++) { |
| | | needUpdate = needUpdate | svg.Animations[i].update(1000 / svg.FRAMERATE); |
| | | } |
| | | } |
| | | |
| | | |
| | | // need update from redraw? |
| | | if (svg.opts != null && typeof(svg.opts['forceRedraw']) == 'function') { |
| | | if (svg.opts['forceRedraw']() == true) needUpdate = true; |
| | | } |
| | | |
| | | |
| | | // render if needed |
| | | if (needUpdate) { |
| | | draw(); |
| | | draw(); |
| | | svg.Mouse.runEvents(); // run and clear our events |
| | | } |
| | | }, 1000 / svg.FRAMERATE); |
| | | } |
| | | |
| | | |
| | | svg.stop = function() { |
| | | if (svg.intervalID) { |
| | | clearInterval(svg.intervalID); |
| | | } |
| | | } |
| | | |
| | | |
| | | svg.Mouse = new (function() { |
| | | this.events = []; |
| | | this.hasEvents = function() { return this.events.length != 0; } |
| | | |
| | | |
| | | this.onclick = function(x, y) { |
| | | this.events.push({ type: 'onclick', x: x, y: y, |
| | | this.events.push({ type: 'onclick', x: x, y: y, |
| | | run: function(e) { if (e.onclick) e.onclick(); } |
| | | }); |
| | | } |
| | | |
| | | |
| | | this.onmousemove = function(x, y) { |
| | | this.events.push({ type: 'onmousemove', x: x, y: y, |
| | | run: function(e) { if (e.onmousemove) e.onmousemove(); } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | this.eventElements = []; |
| | | |
| | | |
| | | this.checkPath = function(element, ctx) { |
| | | for (var i=0; i<this.events.length; i++) { |
| | | var e = this.events[i]; |
| | | if (ctx.isPointInPath && ctx.isPointInPath(e.x, e.y)) this.eventElements[i] = element; |
| | | } |
| | | } |
| | | |
| | | |
| | | this.checkBoundingBox = function(element, bb) { |
| | | for (var i=0; i<this.events.length; i++) { |
| | | var e = this.events[i]; |
| | | if (bb.isPointInBox(e.x, e.y)) this.eventElements[i] = element; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | this.runEvents = function() { |
| | | svg.ctx.canvas.style.cursor = ''; |
| | | |
| | | |
| | | for (var i=0; i<this.events.length; i++) { |
| | | var e = this.events[i]; |
| | | var element = this.eventElements[i]; |
| | |
| | | e.run(element); |
| | | element = element.parent; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | // done running, clear |
| | | this.events = []; |
| | | this.events = []; |
| | | this.eventElements = []; |
| | | } |
| | | }); |
| | | |
| | | |
| | | return svg; |
| | | } |
| | | })(); |
| | | |
| | | if (CanvasRenderingContext2D) { |
| | | CanvasRenderingContext2D.prototype.drawSvg = function(s, dx, dy, dw, dh) { |
| | | canvg(this.canvas, s, { |
| | | ignoreMouse: true, |
| | | ignoreAnimation: true, |
| | | ignoreDimensions: true, |
| | | ignoreClear: true, |
| | | offsetX: dx, |
| | | offsetY: dy, |
| | | scaleWidth: dw, |
| | | canvg(this.canvas, s, { |
| | | ignoreMouse: true, |
| | | ignoreAnimation: true, |
| | | ignoreDimensions: true, |
| | | ignoreClear: true, |
| | | offsetX: dx, |
| | | offsetY: dy, |
| | | scaleWidth: dw, |
| | | scaleHeight: dh |
| | | }); |
| | | } |
| | | } |
| | | } |
| | |
| | | /** |
| | | * Package: svgedit.contextmenu |
| | | * |
| | | * |
| | | * Licensed under the Apache License, Version 2 |
| | | * |
| | | * |
| | | * Author: Adam Bender |
| | | */ |
| | | // Dependencies: |
| | |
| | | $("#cmenu_canvas").append("<li class='separator'>"); |
| | | } |
| | | var shortcut = menuItem.shortcut || ""; |
| | | $("#cmenu_canvas").append("<li class='disabled'><a href='#" + menuItem.id + "'>" |
| | | $("#cmenu_canvas").append("<li class='disabled'><a href='#" + menuItem.id + "'>" |
| | | + menuItem.label + "<span class='shortcut'>" |
| | | + shortcut + "</span></a></li>"); |
| | | } |
| | |
| | | var menuItemIsValid = function(menuItem) { |
| | | return menuItem && menuItem.id && menuItem.label && menuItem.action && typeof menuItem.action == 'function'; |
| | | } |
| | | |
| | | |
| | | // Defer injection to wait out initial menu processing. This probably goes away once all context |
| | | // menu behavior is brought here. |
| | | methodDraw.ready(function() { |
| | |
| | | var doc = $(document); |
| | | |
| | | $.extend($.fn, { |
| | | |
| | | |
| | | contextMenu: function(o, callback) { |
| | | // Defaults |
| | | if( o.menu == undefined ) return false; |
| | |
| | | $(this).each( function() { |
| | | var el = $(this); |
| | | var offset = $(el).offset(); |
| | | |
| | | |
| | | var menu = $('#' + o.menu); |
| | | |
| | | // Add contextMenu class |
| | |
| | | open_context_menu(e,e, srcElement); |
| | | }) |
| | | } |
| | | |
| | | |
| | | var open_context_menu = function(e, evt, srcElement) { |
| | | if (typeof evt == 'undefined') evt = e; |
| | | e.stopPropagation(); |
| | | |
| | | |
| | | // Get this context menu |
| | | |
| | | |
| | | if( el.hasClass('disabled') || evt.altKey ) return false; |
| | | |
| | | |
| | | // Detect mouse position |
| | | var d = {}, x = e.pageX, y = e.pageY; |
| | | if (svgedit.browser.isTouch()) var d = {}, x = e.originalEvent.touches[0].pageX, y = e.originalEvent.touches[0].pageY; |
| | | |
| | | var x_off = win.width() - menu.width(), |
| | | |
| | | var x_off = win.width() - menu.width(), |
| | | y_off = win.height() - menu.height(); |
| | | |
| | | |
| | | if(x > x_off - 15) x = x_off-15; |
| | | if(y > y_off - 30) y = y_off-30; // 30 is needed to prevent scrollbars in FF |
| | | |
| | | if(svgedit.browser.isTouch()) |
| | | |
| | | if(svgedit.browser.isTouch()) |
| | | y = y - (menu.height()/2) |
| | | |
| | | |
| | | // Show the menu |
| | | doc.unbind('click'); |
| | | menu.css({ top: y, left: x }).fadeIn(o.inSpeed); |
| | |
| | | }).mouseout( function() { |
| | | menu.find('LI.hover').removeClass('hover'); |
| | | }); |
| | | |
| | | |
| | | // Keyboard |
| | | doc.keypress( function(e) { |
| | | switch( e.keyCode ) { |
| | |
| | | break |
| | | } |
| | | }); |
| | | |
| | | |
| | | // When items are selected |
| | | menu.find('A').unbind('mouseup'); |
| | | menu.find('LI:not(.disabled) A').mouseup( function() { |
| | |
| | | if( callback ) callback( $(this).attr('href').substr(1), $(srcElement), {x: x - offset.left, y: y - offset.top, docX: x, docY: y} ); |
| | | return false; |
| | | }); |
| | | |
| | | |
| | | // Hide bindings |
| | | setTimeout( function() { // Delay for Mozilla |
| | | doc.click( function() { |
| | |
| | | }); |
| | | }, 0); |
| | | } |
| | | |
| | | |
| | | |
| | | // Disable browser context menu (requires both selectors to work in IE/Safari + FF/Chrome) |
| | | $(el).add($('UL.contextMenu')).bind('contextmenu', function() { return false; }); |
| | | |
| | | |
| | | }); |
| | | return $(this); |
| | | }, |
| | | |
| | | |
| | | // Disable context menu items on the fly |
| | | disableContextMenuItems: function(o) { |
| | | if( o == undefined ) { |
| | |
| | | var d = o.split(','); |
| | | for( var i = 0; i < d.length; i++ ) { |
| | | $(this).find('A[href="' + d[i] + '"]').parent().addClass('disabled'); |
| | | |
| | | |
| | | } |
| | | } |
| | | }); |
| | | return( $(this) ); |
| | | }, |
| | | |
| | | |
| | | // Enable context menu items on the fly |
| | | enableContextMenuItems: function(o) { |
| | | if( o == undefined ) { |
| | |
| | | var d = o.split(','); |
| | | for( var i = 0; i < d.length; i++ ) { |
| | | $(this).find('A[href="' + d[i] + '"]').parent().removeClass('disabled'); |
| | | |
| | | |
| | | } |
| | | } |
| | | }); |
| | | return( $(this) ); |
| | | }, |
| | | |
| | | |
| | | // Disable context menu(s) |
| | | disableContextMenu: function() { |
| | | $(this).each( function() { |
| | |
| | | }); |
| | | return( $(this) ); |
| | | }, |
| | | |
| | | |
| | | // Enable context menu(s) |
| | | enableContextMenu: function() { |
| | | $(this).each( function() { |
| | |
| | | }); |
| | | return( $(this) ); |
| | | }, |
| | | |
| | | |
| | | // Destroy context menu(s) |
| | | destroyContextMenu: function() { |
| | | // Destroy specified context menus |
| | |
| | | }); |
| | | return( $(this) ); |
| | | } |
| | | |
| | | |
| | | }); |
| | | })(jQuery); |
| | | })(jQuery); |
| | |
| | | } |
| | | |
| | | #svg_editor .jPicker div.Map { |
| | | |
| | | |
| | | border: solid #000 1px; |
| | | |
| | | |
| | | cursor: crosshair; |
| | | |
| | | |
| | | height: 260px; |
| | | |
| | | |
| | | margin: 0; |
| | | |
| | | |
| | | overflow: hidden; |
| | | |
| | | |
| | | padding: 0; |
| | | |
| | | |
| | | position: relative; |
| | | |
| | | |
| | | width: 260px; |
| | | |
| | | |
| | | } |
| | | #svg_editor .jPicker div[class="Map"] { |
| | | height: 256px; |
| | |
| | | /* |
| | | /* |
| | | * jGraduate Default CSS |
| | | * |
| | | * |
| | | * Copyright (c) 2010 Jeff Schiller |
| | | * http://blog.codedread.com/ |
| | | * |
| | |
| | | display: none; |
| | | } |
| | | |
| | | .jGraduate_gradPick { |
| | | .jGraduate_gradPick { |
| | | display: none; |
| | | overflow: visible; |
| | | /* position: relative;*/ |
| | |
| | | } |
| | | div.jGraduate_GradContainer { |
| | | border: solid #000 1px; |
| | | background-image: url(../images/map-opacity.png); |
| | | background-image: url(../images/map-opacity.png); |
| | | background-position: 0px 0px; |
| | | height: 256px; |
| | | width: 256px; |
| | |
| | | div.jGraduate_stopPicker { |
| | | position: absolute; |
| | | display: none; |
| | | background: |
| | | background: |
| | | white; |
| | | padding: 20px; |
| | | border-radius: 3px; |
| | | width: 530px; |
| | | height: 300px; |
| | | box-shadow: 0 5px 25px |
| | | box-shadow: 0 5px 25px |
| | | black; |
| | | } |
| | | |
| | |
| | | s, |
| | | v, |
| | | changeEvents = new Array(), |
| | | fireChangeEvents = |
| | | fireChangeEvents = |
| | | function(context) |
| | | { |
| | | for (var i = 0; i < changeEvents.length; i++) changeEvents[i].call($this, $this, context); |
| | |
| | | } |
| | | } |
| | | }; |
| | | })(jQuery, '1.1.6'); |
| | | })(jQuery, '1.1.6'); |
| | |
| | | |
| | | $this.addClass('jGraduate_Picker'); |
| | | $this.html('<ul class="jGraduate_tabs">' + |
| | | '<li class="jGraduate_tab_color jGraduate_tab_current" data-type="col">颜色</li>' + |
| | | '<li class="jGraduate_tab_lingrad" data-type="lg">线性渐变</li>' + |
| | | '<li class="jGraduate_tab_radgrad" data-type="rg">径向渐变</li>' + |
| | | '<li class="jGraduate_tab_color jGraduate_tab_current" data-type="col">Solid Color</li>' + |
| | | '<li class="jGraduate_tab_lingrad" data-type="lg">Linear Gradient</li>' + |
| | | '<li class="jGraduate_tab_radgrad" data-type="rg">Radial Gradient</li>' + |
| | | '</ul>' + |
| | | '<div class="jGraduate_colPick"></div>' + |
| | | '<div class="jGraduate_gradPick"></div>' + |
| | |
| | | '</div>' + |
| | | '<div class="jGraduate_Form jGraduate_Points jGraduate_lg_field">' + |
| | | '<div class="jGraduate_StopSection">' + |
| | | '<label class="jGraduate_Form_Heading">起点</label>' + |
| | | '<label class="jGraduate_Form_Heading">Begin Point</label>' + |
| | | '<div class="jGraduate_Form_Section">' + |
| | | '<label>x:</label>' + |
| | | '<input type="text" id="' + id + '_jGraduate_x1" size="3" title="输入介于0.0和1.0之间的起始x值"/>' + |
| | | '<input type="text" id="' + id + '_jGraduate_x1" size="3" title="Enter starting x value between 0.0 and 1.0"/>' + |
| | | '<label> y:</label>' + |
| | | '<input type="text" id="' + id + '_jGraduate_y1" size="3" title="输入介于0.0和1.0之间的起始y值"/>' + |
| | | '<input type="text" id="' + id + '_jGraduate_y1" size="3" title="Enter starting y value between 0.0 and 1.0"/>' + |
| | | '</div>' + |
| | | '</div>' + |
| | | '<div class="jGraduate_StopSection">' + |
| | | '<label class="jGraduate_Form_Heading">终点</label>' + |
| | | '<label class="jGraduate_Form_Heading">End Point</label>' + |
| | | '<div class="jGraduate_Form_Section">' + |
| | | '<label>x:</label>' + |
| | | '<input type="text" id="' + id + '_jGraduate_x2" size="3" title="输入介于0.0和1.0之间的起始x值"/>' + |
| | | '<input type="text" id="' + id + '_jGraduate_x2" size="3" title="Enter ending x value between 0.0 and 1.0"/>' + |
| | | '<label> y:</label>' + |
| | | '<input type="text" id="' + id + '_jGraduate_y2" size="3" title="输入介于0.0和1.0之间的起始y值"/>' + |
| | | '<input type="text" id="' + id + '_jGraduate_y2" size="3" title="Enter ending y value between 0.0 and 1.0"/>' + |
| | | '</div>' + |
| | | '</div>' + |
| | | '</div>' + |
| | | '<div class="jGraduate_Form jGraduate_Points jGraduate_rg_field">' + |
| | | '<div class="jGraduate_StopSection">' + |
| | | '<label class="jGraduate_Form_Heading">中心点</label>' + |
| | | '<label class="jGraduate_Form_Heading">Center Point</label>' + |
| | | '<div class="jGraduate_Form_Section">' + |
| | | '<label>x:</label>' + |
| | | '<input type="text" id="' + id + '_jGraduate_cx" size="3" title="输入介于0.0和1.0之间的起始x值"/>' + |
| | | '<input type="text" id="' + id + '_jGraduate_cx" size="3" title="Enter x value between 0.0 and 1.0"/>' + |
| | | '<label> y:</label>' + |
| | | '<input type="text" id="' + id + '_jGraduate_cy" size="3" title="输入介于0.0和1.0之间的起始y值"/>' + |
| | | '<input type="text" id="' + id + '_jGraduate_cy" size="3" title="Enter y value between 0.0 and 1.0"/>' + |
| | | '</div>' + |
| | | '</div>' + |
| | | '<div class="jGraduate_StopSection">' + |
| | | '<label class="jGraduate_Form_Heading">焦点</label>' + |
| | | '<label class="jGraduate_Form_Heading">Focal Point</label>' + |
| | | '<div class="jGraduate_Form_Section">' + |
| | | '<label>Match center: <input type="checkbox" checked="checked" id="' + id + '_jGraduate_match_ctr"/></label><br/>' + |
| | | '<label>x:</label>' + |
| | | '<input type="text" id="' + id + '_jGraduate_fx" size="3" title="输入介于0.0和1.0之间的起始x值"/>' + |
| | | '<input type="text" id="' + id + '_jGraduate_fx" size="3" title="Enter x value between 0.0 and 1.0"/>' + |
| | | '<label> y:</label>' + |
| | | '<input type="text" id="' + id + '_jGraduate_fy" size="3" title="输入介于0.0和1.0之间的起始y值"/>' + |
| | | '<input type="text" id="' + id + '_jGraduate_fy" size="3" title="Enter y value between 0.0 and 1.0"/>' + |
| | | '</div>' + |
| | | '</div>' + |
| | | '</div>' + |
| | | '<div class="jGraduate_StopSection jGraduate_SpreadMethod">' + |
| | | '<label class="jGraduate_Form_Heading">扩散方式</label>' + |
| | | '<label class="jGraduate_Form_Heading">Spread method</label>' + |
| | | '<div class="jGraduate_Form_Section">' + |
| | | '<select class="jGraduate_spreadMethod">' + |
| | | '<option value=pad selected>延长</option>' + |
| | | '<option value=reflect>映射</option>' + |
| | | '<option value=repeat>重复</option>' + |
| | | '<option value=pad selected>Pad</option>' + |
| | | '<option value=reflect>Reflect</option>' + |
| | | '<option value=repeat>Repeat</option>' + |
| | | '</select>' + |
| | | '</div>' + |
| | | '</div>' + |
| | | '<div class="jGraduate_Form">' + |
| | | '<div class="jGraduate_Slider jGraduate_RadiusField jGraduate_rg_field">' + |
| | | '<label class="prelabel">半径:</label>' + |
| | | '<label class="prelabel">Radius:</label>' + |
| | | '<div id="' + id + '_jGraduate_Radius" class="jGraduate_SliderBar jGraduate_Radius" title="Click to set radius">' + |
| | | '<img id="' + id + '_jGraduate_RadiusArrows" class="jGraduate_RadiusArrows" src="' + $settings.images.clientPath + 'rangearrows2.gif">' + |
| | | '</div>' + |
| | | '<label><input type="text" id="' + id + '_jGraduate_RadiusInput" size="3" value="100"/>%</label>' + |
| | | '</div>' + |
| | | '<div class="jGraduate_Slider jGraduate_EllipField jGraduate_rg_field">' + |
| | | '<label class="prelabel">椭圆:</label>' + |
| | | '<label class="prelabel">Ellip:</label>' + |
| | | '<div id="' + id + '_jGraduate_Ellip" class="jGraduate_SliderBar jGraduate_Ellip" title="Click to set Ellip">' + |
| | | '<img id="' + id + '_jGraduate_EllipArrows" class="jGraduate_EllipArrows" src="' + $settings.images.clientPath + 'rangearrows2.gif">' + |
| | | '</div>' + |
| | | '<label><input type="text" id="' + id + '_jGraduate_EllipInput" size="3" value="0"/>%</label>' + |
| | | '</div>' + |
| | | '<div class="jGraduate_Slider jGraduate_AngleField jGraduate_rg_field">' + |
| | | '<label class="prelabel">角度:</label>' + |
| | | '<label class="prelabel">Angle:</label>' + |
| | | '<div id="' + id + '_jGraduate_Angle" class="jGraduate_SliderBar jGraduate_Angle" title="Click to set Angle">' + |
| | | '<img id="' + id + '_jGraduate_AngleArrows" class="jGraduate_AngleArrows" src="' + $settings.images.clientPath + 'rangearrows2.gif">' + |
| | | '</div>' + |
| | | '<label><input type="text" id="' + id + '_jGraduate_AngleInput" size="3" value="0"/>º </label>' + |
| | | '</div>' + |
| | | '<div class="jGraduate_Slider jGraduate_OpacField">' + |
| | | '<label class="prelabel">透明度:</label>' + |
| | | '<label class="prelabel">Opac:</label>' + |
| | | '<div id="' + id + '_jGraduate_Opac" class="jGraduate_SliderBar jGraduate_Opac" title="Click to set Opac">' + |
| | | '<img id="' + id + '_jGraduate_OpacArrows" class="jGraduate_OpacArrows" src="' + $settings.images.clientPath + 'rangearrows2.gif">' + |
| | | '</div>' + |
| | |
| | | (e.paint.alpha*255/100).toString(16);n.length<2;)n="0"+n;n=n.split(".")[0];u=e.paint.solidColor=="none"?"":e.paint.solidColor+n;ba||(u=D[0].getAttribute("stop-color"));$.extend($.fn.jPicker.defaults.window,{alphaSupport:true,effects:{type:"show",speed:0}});Ca.jPicker({window:{title:o.window.pickerTitle},images:{clientPath:o.images.clientPath},color:{active:u,alphaSupport:true}},function(c){e.paint.type="solidColor";e.paint.alpha=c.val("ahex")?Math.round(c.val("a")/255*100):100;e.paint.solidColor= |
| | | c.val("hex")?c.val("hex"):"none";e.paint.radialGradient=null;ma()},null,function(){na()});var ka=$(s+" .jGraduate_tabs li");ka.click(function(){ka.removeClass("jGraduate_tab_current");$(this).addClass("jGraduate_tab_current");$(s+" > div").hide();var c=$(this).attr("data-type");$(s+" .jGraduate_gradPick").show();if(c==="rg"||c==="lg"){$(".jGraduate_"+c+"_field").show();$(".jGraduate_"+(c==="lg"?"rg":"lg")+"_field").hide();$("#"+b+"_jgraduate_rect")[0].setAttribute("fill","url(#"+b+"_"+c+"_jgraduate_grad)"); |
| | | p=c==="lg"?"linearGradient":"radialGradient";$("#"+b+"_jGraduate_OpacInput").val(e.paint.alpha).change();var a=$("#"+b+"_"+c+"_jgraduate_grad")[0];if(g!==a){var d=$(g).find("stop");$(a).empty().append(d);g=a;a=ua.val();g.setAttribute("spreadMethod",a)}E=c==="rg"&&g.getAttribute("fx")!=null&&!(ca==qa&&da==ra);$("#"+b+"_jGraduate_focusCoord").toggle(E);if(E)$("#"+b+"_jGraduate_match_ctr")[0].checked=false}else{$(s+" .jGraduate_gradPick").hide();$(s+" .jGraduate_colPick").show()}});$(s+" > div").hide(); |
| | | ka.removeClass("jGraduate_tab_current");var ea;switch(e.paint.type){case "linearGradient":ea=$(s+" .jGraduate_tab_lingrad");break;case "radialGradient":ea=$(s+" .jGraduate_tab_radgrad");break;default:ea=$(s+" .jGraduate_tab_color")}e.show();setTimeout(function(){ea.addClass("jGraduate_tab_current").click()},10)}else alert("Container element must have an id attribute to maintain unique id strings for sub-elements.")})}})(); |
| | | ka.removeClass("jGraduate_tab_current");var ea;switch(e.paint.type){case "linearGradient":ea=$(s+" .jGraduate_tab_lingrad");break;case "radialGradient":ea=$(s+" .jGraduate_tab_radgrad");break;default:ea=$(s+" .jGraduate_tab_color")}e.show();setTimeout(function(){ea.addClass("jGraduate_tab_current").click()},10)}else alert("Container element must have an id attribute to maintain unique id strings for sub-elements.")})}})(); |
| | |
| | | var isTouch = svgedit.browser.isTouch(); |
| | | var completed = true //for mousewheel |
| | | var $cursor = (area && this.dragCfg.cursor) |
| | | ? $("<div class='draginput_cursor' />").appendTo($label) |
| | | ? $("<div class='draginput_cursor' />").appendTo($label) |
| | | : false |
| | | $input.attr("readonly", "readonly") |
| | | if ($cursor && !isNaN(this.dragCfg.start)) $cursor.css("top", (this.dragCfg.start*-1)/scale+cursorHeight) |
| | | |
| | | //this is where all the magic happens |
| | | |
| | | //this is where all the magic happens |
| | | this.adjustValue = function(i, completed){ |
| | | var v; |
| | | i = parseFloat(i); |
| | |
| | | $label.attr("data-value", v) |
| | | if ($.isFunction(this.dragCfg.callback)) this.dragCfg.callback(this, completed) |
| | | }; |
| | | |
| | | |
| | | $label.toggleClass("draginput", $label.is("label")) |
| | | |
| | | |
| | | // when the mouse is down and moving |
| | | this.move = function(e, oy, val) { |
| | | if (isTouch) { |
| | |
| | | var fixed = (step < 1) ? 1 : 0 |
| | | this.adjustValue(val.toFixed(fixed)) //no undo true |
| | | }; |
| | | |
| | | |
| | | //when the mouse is released |
| | | this.stop = function() { |
| | | var selectedElems = canvas.getSelectedElems(); |
| | |
| | | } |
| | | this.adjustValue(0, completed) |
| | | } |
| | | |
| | | |
| | | this.updateCursor = function(){ |
| | | var value = parseFloat(this.value); |
| | | var pos = (value*-1)/scale+cursorHeight; |
| | | $cursor.css("top", pos); |
| | | } |
| | | |
| | | |
| | | this.launch = function(e) { |
| | | var selectedElems = canvas.getSelectedElems(); |
| | | if (isTouch) e = e.originalEvent.touches[0]; |
| | |
| | | $(window).bind("mousemove.draginput touchmove.draginput", function(e){el.move(e, oy, parseFloat(val))}) |
| | | $(window).bind("mouseup.draginput touchend.draginput", function(e){el.stop()}) |
| | | } |
| | | |
| | | |
| | | $(this) |
| | | .attr("readonly", "readonly") |
| | | .attr("data-scale", scale) |
| | | .attr("data-domain", cursorHeight) |
| | | .attr("data-cursor", ($cursor != false)) |
| | | |
| | | |
| | | .bind("mousedown touchstart", function(e){ |
| | | this.blur(); |
| | | this.launch(e); |
| | | }) |
| | | |
| | | |
| | | .bind("dblclick taphold", function(e) { |
| | | this.removeAttribute("readonly", "readonly"); |
| | | this.focus(); |
| | | this.select(); |
| | | }) |
| | | |
| | | |
| | | .keydown(function(e){ |
| | | // Respond to up/down arrow keys. |
| | | switch(e.keyCode){ |
| | | case 13: this.adjustValue(0); this.blur(); break; // Enter |
| | | } |
| | | }) |
| | | |
| | | |
| | | .focus(function(e){ |
| | | if (this.getAttribute("readonly") === "readonly") this.blur() |
| | | }) |
| | | |
| | | |
| | | .blur(function(e){ |
| | | this.setAttribute("readonly", "readonly") |
| | | }) |
| | | |
| | | |
| | | .bind("mousewheel", function(e, delta, deltaX, deltaY){ |
| | | var selectedElems = canvas.getSelectedElems(); |
| | | if (completed) canvas.undoMgr.beginUndoableChange(attr, selectedElems) |
| | |
| | | window.undoTimeout = setTimeout(function(){ |
| | | wheel_input.stop() |
| | | },200) |
| | | |
| | | |
| | | var wheel_input = this; |
| | | if (deltaY > 0) |
| | | this.adjustValue(this.dragCfg.step); |
| | | else if (deltaY < 0) |
| | | this.adjustValue(-this.dragCfg.step); |
| | | e.preventDefault(); |
| | | |
| | | |
| | | }) |
| | | |
| | | }); |
| | | |
| | | |
| | | }; |
| | | |
| | | // public function |
| | |
| | | * jquery.ui.core.js |
| | | * jquery.ui.mouse.js |
| | | * jquery.ui.widget.js |
| | | */(function(a,b){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",g=d.values&&d.values.length||1,h=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":"")),this.range=a([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),d.values.length&&d.values.length!==2&&(d.values=[d.values[0],d.values[0]])),this.range=a("<div></div>").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;i<g;i+=1)h.push(f);this.handles=e.add(a(h.join("")).appendTo(b.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){d.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){d.disabled?a(this).blur():(a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-state-focus"))}).blur(function(){a(this).removeClass("ui-state-focus")}),this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)}),this.handles.keydown(function(d){var e=!0,f=a(this).data("index.ui-slider-handle"),g,h,i,j;if(!b.options.disabled){switch(d.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:e=!1;if(!b._keySliding){b._keySliding=!0,a(this).addClass("ui-state-active"),g=b._start(d,f);if(g===!1)return}}j=b.options.step,b.options.values&&b.options.values.length?h=i=b.values(f):h=i=b.value();switch(d.keyCode){case a.ui.keyCode.HOME:i=b._valueMin();break;case a.ui.keyCode.END:i=b._valueMax();break;case a.ui.keyCode.PAGE_UP:i=b._trimAlignValue(h+(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.PAGE_DOWN:i=b._trimAlignValue(h-(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(h===b._valueMax())return;i=b._trimAlignValue(h+j);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(h===b._valueMin())return;i=b._trimAlignValue(h-j)}b._slide(d,f,i);return e}}).keyup(function(c){var d=a(this).data("index.ui-slider-handle");b._keySliding&&(b._keySliding=!1,b._stop(c,d),b._change(c,d),a(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy();return this},_mouseCapture:function(b){var c=this.options,d,e,f,g,h,i,j,k,l;if(c.disabled)return!1;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),d={x:b.pageX,y:b.pageY},e=this._normValueFromMouse(d),f=this._valueMax()-this._valueMin()+1,h=this,this.handles.each(function(b){var c=Math.abs(e-h.values(b));f>c&&(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().andSelf().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&&c<d)&&(c=d),c!==this.values(b)&&(e=this.values(),e[b]=c,f=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e}),d=this.values(b?0:1),f!==!1&&this.values(b,c,!0))):c!==this.value()&&(f=this._trigger("slide",a,{handle:this.handles[b],value:c}),f!==!1&&this.value(c))},_stop: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()),this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){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()),this._trigger("change",a,c)}},value:function(a){if(arguments.length)this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0);else return this._value()},values:function(b,c){var d,e,f;if(arguments.length>1)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<d.length;f+=1)d[f]=this._trimAlignValue(e[f]),this._change(null,f);this._refreshValue()}},_setOption:function(b,c){var d,e=0;a.isArray(this.options.values)&&(e=this.options.values.length),a.Widget.prototype._setOption.apply(this,arguments);switch(b){case"disabled":c?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(d=0;d<e;d+=1)this._change(null,d);this._animateOff=!1}},_value:function(){var a=this.options.value;a=this._trimAlignValue(a);return a},_values:function(a){var b,c,d;if(arguments.length){b=this.options.values[a],b=this._trimAlignValue(b);return b}c=this.options.values.slice();for(d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=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){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",g=d.values&&d.values.length||1,h=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":"")),this.range=a([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),d.values.length&&d.values.length!==2&&(d.values=[d.values[0],d.values[0]])),this.range=a("<div></div>").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;i<g;i+=1)h.push(f);this.handles=e.add(a(h.join("")).appendTo(b.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){d.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){d.disabled?a(this).blur():(a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-state-focus"))}).blur(function(){a(this).removeClass("ui-state-focus")}),this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)}),this.handles.keydown(function(d){var e=!0,f=a(this).data("index.ui-slider-handle"),g,h,i,j;if(!b.options.disabled){switch(d.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:e=!1;if(!b._keySliding){b._keySliding=!0,a(this).addClass("ui-state-active"),g=b._start(d,f);if(g===!1)return}}j=b.options.step,b.options.values&&b.options.values.length?h=i=b.values(f):h=i=b.value();switch(d.keyCode){case a.ui.keyCode.HOME:i=b._valueMin();break;case a.ui.keyCode.END:i=b._valueMax();break;case a.ui.keyCode.PAGE_UP:i=b._trimAlignValue(h+(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.PAGE_DOWN:i=b._trimAlignValue(h-(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(h===b._valueMax())return;i=b._trimAlignValue(h+j);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(h===b._valueMin())return;i=b._trimAlignValue(h-j)}b._slide(d,f,i);return e}}).keyup(function(c){var d=a(this).data("index.ui-slider-handle");b._keySliding&&(b._keySliding=!1,b._stop(c,d),b._change(c,d),a(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy();return this},_mouseCapture:function(b){var c=this.options,d,e,f,g,h,i,j,k,l;if(c.disabled)return!1;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),d={x:b.pageX,y:b.pageY},e=this._normValueFromMouse(d),f=this._valueMax()-this._valueMin()+1,h=this,this.handles.each(function(b){var c=Math.abs(e-h.values(b));f>c&&(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().andSelf().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&&c<d)&&(c=d),c!==this.values(b)&&(e=this.values(),e[b]=c,f=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e}),d=this.values(b?0:1),f!==!1&&this.values(b,c,!0))):c!==this.value()&&(f=this._trigger("slide",a,{handle:this.handles[b],value:c}),f!==!1&&this.value(c))},_stop: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()),this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){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()),this._trigger("change",a,c)}},value:function(a){if(arguments.length)this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0);else return this._value()},values:function(b,c){var d,e,f;if(arguments.length>1)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<d.length;f+=1)d[f]=this._trimAlignValue(e[f]),this._change(null,f);this._refreshValue()}},_setOption:function(b,c){var d,e=0;a.isArray(this.options.values)&&(e=this.options.values.length),a.Widget.prototype._setOption.apply(this,arguments);switch(b){case"disabled":c?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(d=0;d<e;d+=1)this._change(null,d);this._animateOff=!1}},_value:function(){var a=this.options.value;a=this._trimAlignValue(a);return a},_values:function(a){var b,c,d;if(arguments.length){b=this.options.values[a],b=this._trimAlignValue(b);return b}c=this.options.values.slice();for(d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=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); |
| | |
| | | * jquery.ui.core.js |
| | | * jquery.ui.mouse.js |
| | | * jquery.ui.widget.js |
| | | */(function(b){var a=5;b.widget("ui.slider",b.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var c=this,d=this.options;this._keySliding=false;this._mouseSliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");if(d.disabled){this.element.addClass("ui-slider-disabled ui-disabled")}this.range=b([]);if(d.range){if(d.range===true){this.range=b("<div></div>");if(!d.values){d.values=[this._valueMin(),this._valueMin()]}if(d.values.length&&d.values.length!=2){d.values=[d.values[0],d.values[0]]}}else{this.range=b("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(d.range=="min"||d.range=="max"){this.range.addClass("ui-slider-range-"+d.range)}this.range.addClass("ui-widget-header")}if(b(".ui-slider-handle",this.element).length==0){b('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}if(d.values&&d.values.length){while(b(".ui-slider-handle",this.element).length<d.values.length){b('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=b(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(e){e.preventDefault()}).hover(function(){if(!d.disabled){b(this).addClass("ui-state-hover")}},function(){b(this).removeClass("ui-state-hover")}).focus(function(){if(!d.disabled){b(".ui-slider .ui-state-focus").removeClass("ui-state-focus");b(this).addClass("ui-state-focus")}else{b(this).blur()}}).blur(function(){b(this).removeClass("ui-state-focus")});this.handles.each(function(e){b(this).data("index.ui-slider-handle",e)});this.handles.keydown(function(j){var g=true;var f=b(this).data("index.ui-slider-handle");if(c.options.disabled){return}switch(j.keyCode){case b.ui.keyCode.HOME:case b.ui.keyCode.END:case b.ui.keyCode.PAGE_UP:case b.ui.keyCode.PAGE_DOWN:case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:g=false;if(!c._keySliding){c._keySliding=true;b(this).addClass("ui-state-active");c._start(j,f)}break}var h,e,i=c._step();if(c.options.values&&c.options.values.length){h=e=c.values(f)}else{h=e=c.value()}switch(j.keyCode){case b.ui.keyCode.HOME:e=c._valueMin();break;case b.ui.keyCode.END:e=c._valueMax();break;case b.ui.keyCode.PAGE_UP:e=h+((c._valueMax()-c._valueMin())/a);break;case b.ui.keyCode.PAGE_DOWN:e=h-((c._valueMax()-c._valueMin())/a);break;case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:if(h==c._valueMax()){return}e=h+i;break;case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:if(h==c._valueMin()){return}e=h-i;break}c._slide(j,f,e);return g}).keyup(function(f){var e=b(this).data("index.ui-slider-handle");if(c._keySliding){c._keySliding=false;c._stop(f,e);c._change(f,e);b(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();return this},_mouseCapture:function(e){var f=this.options;if(f.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var i={x:e.pageX,y:e.pageY};var k=this._normValueFromMouse(i);var d=this._valueMax()-this._valueMin()+1,g;var l=this,j;this.handles.each(function(m){var n=Math.abs(k-l.values(m));if(d>n){d=n;g=b(this);j=m}});if(f.range==true&&this.values(1)==f.min){g=b(this.handles[++j])}this._start(e,j);this._mouseSliding=true;l._handleIndex=j;g.addClass("ui-state-active").focus();var h=g.offset();var c=!b(e.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=c?{left:0,top:0}:{left:e.pageX-h.left-(g.width()/2),top:e.pageY-h.top-(g.height()/2)-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)};k=this._normValueFromMouse(i);this._slide(e,j,k);this._animateOff=true;return true},_mouseStart:function(c){return true},_mouseDrag:function(e){var c={x:e.pageX,y:e.pageY};var d=this._normValueFromMouse(c);this._slide(e,this._handleIndex,d);return false},_mouseStop:function(c){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(c,this._handleIndex);this._change(c,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var d,i;if("horizontal"==this.orientation){d=this.elementSize.width;i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{d=this.elementSize.height;i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var g=(i/d);if(g>1){g=1}if(g<0){g=0}if("vertical"==this.orientation){g=1-g}var f=this._valueMax()-this._valueMin(),j=g*f,c=j%this.options.step,h=this._valueMin()+j-c;if(c>(this.options.step/2)){h+=this.options.step}return parseFloat(h.toFixed(5))},_start:function(e,d){var c={handle:this.handles[d],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(d);c.values=this.values()}this._trigger("start",e,c)},_slide:function(g,f,e){var h=this.handles[f];if(this.options.values&&this.options.values.length){var c=this.values(f?0:1);if((this.options.values.length==2&&this.options.range===true)&&((f==0&&e>c)||(f==1&&e<c))){e=c}if(e!=this.values(f)){var d=this.values();d[f]=e;var i=this._trigger("slide",g,{handle:this.handles[f],value:e,values:d});var c=this.values(f?0:1);if(i!==false){this.values(f,e,true)}}}else{if(e!=this.value()){var i=this._trigger("slide",g,{handle:this.handles[f],value:e});if(i!==false){this.value(e)}}}},_stop:function(e,d){var c={handle:this.handles[d],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(d);c.values=this.values()}this._trigger("stop",e,c)},_change:function(e,d){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[d],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(d);c.values=this.values()}this._trigger("change",e,c)}},value:function(c){if(arguments.length){this.options.value=this._trimValue(c);this._refreshValue();this._change(null,0)}return this._value()},values:function(e,h){if(arguments.length>1){this.options.values[e]=this._trimValue(h);this._refreshValue();this._change(null,e)}if(arguments.length){if(b.isArray(arguments[0])){var g=this.options.values,d=arguments[0];for(var f=0,c=g.length;f<c;f++){g[f]=this._trimValue(d[f]);this._change(null,f)}this._refreshValue()}else{if(this.options.values&&this.options.values.length){return this._values(e)}else{return this.value()}}}else{return this._values()}},_setOption:function(d,e){var c,f=0;if(jQuery.isArray(this.options.values)){f=this.options.values.length}b.Widget.prototype._setOption.apply(this,arguments);switch(d){case"disabled":if(e){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(c=0;c<f;c++){this._change(null,c)}this._animateOff=false;break}},_step:function(){var c=this.options.step;return c},_value:function(){var c=this.options.value;c=this._trimValue(c);return c},_values:function(d){if(arguments.length){var g=this.options.values[d];g=this._trimValue(g);return g}else{var f=this.options.values.slice();for(var e=0,c=f.length;e<c;e++){f[e]=this._trimValue(f[e])}return f}},_trimValue:function(c){if(c<this._valueMin()){c=this._valueMin()}if(c>this._valueMax()){c=this._valueMax()}return c},_valueMin:function(){var c=this.options.min;return c},_valueMax:function(){var c=this.options.max;return c},_refreshValue:function(){var g=this.options.range,e=this.options,m=this;var d=(!this._animateOff)?e.animate:false;if(this.options.values&&this.options.values.length){var j,i;this.handles.each(function(q,o){var p=(m.values(q)-m._valueMin())/(m._valueMax()-m._valueMin())*100;var n={};n[m.orientation=="horizontal"?"left":"bottom"]=p+"%";b(this).stop(1,1)[d?"animate":"css"](n,e.animate);if(m.options.range===true){if(m.orientation=="horizontal"){(q==0)&&m.range.stop(1,1)[d?"animate":"css"]({left:p+"%"},e.animate);(q==1)&&m.range[d?"animate":"css"]({width:(p-lastValPercent)+"%"},{queue:false,duration:e.animate})}else{(q==0)&&m.range.stop(1,1)[d?"animate":"css"]({bottom:(p)+"%"},e.animate);(q==1)&&m.range[d?"animate":"css"]({height:(p-lastValPercent)+"%"},{queue:false,duration:e.animate})}}lastValPercent=p})}else{var k=this.value(),h=this._valueMin(),l=this._valueMax(),f=l!=h?(k-h)/(l-h)*100:0;var c={};c[m.orientation=="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[d?"animate":"css"](c,e.animate);(g=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[d?"animate":"css"]({width:f+"%"},e.animate);(g=="max")&&(this.orientation=="horizontal")&&this.range[d?"animate":"css"]({width:(100-f)+"%"},{queue:false,duration:e.animate});(g=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[d?"animate":"css"]({height:f+"%"},e.animate);(g=="max")&&(this.orientation=="vertical")&&this.range[d?"animate":"css"]({height:(100-f)+"%"},{queue:false,duration:e.animate})}}});b.extend(b.ui.slider,{version:"1.8"})})(jQuery);; |
| | | */(function(b){var a=5;b.widget("ui.slider",b.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var c=this,d=this.options;this._keySliding=false;this._mouseSliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");if(d.disabled){this.element.addClass("ui-slider-disabled ui-disabled")}this.range=b([]);if(d.range){if(d.range===true){this.range=b("<div></div>");if(!d.values){d.values=[this._valueMin(),this._valueMin()]}if(d.values.length&&d.values.length!=2){d.values=[d.values[0],d.values[0]]}}else{this.range=b("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(d.range=="min"||d.range=="max"){this.range.addClass("ui-slider-range-"+d.range)}this.range.addClass("ui-widget-header")}if(b(".ui-slider-handle",this.element).length==0){b('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}if(d.values&&d.values.length){while(b(".ui-slider-handle",this.element).length<d.values.length){b('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=b(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(e){e.preventDefault()}).hover(function(){if(!d.disabled){b(this).addClass("ui-state-hover")}},function(){b(this).removeClass("ui-state-hover")}).focus(function(){if(!d.disabled){b(".ui-slider .ui-state-focus").removeClass("ui-state-focus");b(this).addClass("ui-state-focus")}else{b(this).blur()}}).blur(function(){b(this).removeClass("ui-state-focus")});this.handles.each(function(e){b(this).data("index.ui-slider-handle",e)});this.handles.keydown(function(j){var g=true;var f=b(this).data("index.ui-slider-handle");if(c.options.disabled){return}switch(j.keyCode){case b.ui.keyCode.HOME:case b.ui.keyCode.END:case b.ui.keyCode.PAGE_UP:case b.ui.keyCode.PAGE_DOWN:case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:g=false;if(!c._keySliding){c._keySliding=true;b(this).addClass("ui-state-active");c._start(j,f)}break}var h,e,i=c._step();if(c.options.values&&c.options.values.length){h=e=c.values(f)}else{h=e=c.value()}switch(j.keyCode){case b.ui.keyCode.HOME:e=c._valueMin();break;case b.ui.keyCode.END:e=c._valueMax();break;case b.ui.keyCode.PAGE_UP:e=h+((c._valueMax()-c._valueMin())/a);break;case b.ui.keyCode.PAGE_DOWN:e=h-((c._valueMax()-c._valueMin())/a);break;case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:if(h==c._valueMax()){return}e=h+i;break;case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:if(h==c._valueMin()){return}e=h-i;break}c._slide(j,f,e);return g}).keyup(function(f){var e=b(this).data("index.ui-slider-handle");if(c._keySliding){c._keySliding=false;c._stop(f,e);c._change(f,e);b(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();return this},_mouseCapture:function(e){var f=this.options;if(f.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var i={x:e.pageX,y:e.pageY};var k=this._normValueFromMouse(i);var d=this._valueMax()-this._valueMin()+1,g;var l=this,j;this.handles.each(function(m){var n=Math.abs(k-l.values(m));if(d>n){d=n;g=b(this);j=m}});if(f.range==true&&this.values(1)==f.min){g=b(this.handles[++j])}this._start(e,j);this._mouseSliding=true;l._handleIndex=j;g.addClass("ui-state-active").focus();var h=g.offset();var c=!b(e.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=c?{left:0,top:0}:{left:e.pageX-h.left-(g.width()/2),top:e.pageY-h.top-(g.height()/2)-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)};k=this._normValueFromMouse(i);this._slide(e,j,k);this._animateOff=true;return true},_mouseStart:function(c){return true},_mouseDrag:function(e){var c={x:e.pageX,y:e.pageY};var d=this._normValueFromMouse(c);this._slide(e,this._handleIndex,d);return false},_mouseStop:function(c){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(c,this._handleIndex);this._change(c,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var d,i;if("horizontal"==this.orientation){d=this.elementSize.width;i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{d=this.elementSize.height;i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var g=(i/d);if(g>1){g=1}if(g<0){g=0}if("vertical"==this.orientation){g=1-g}var f=this._valueMax()-this._valueMin(),j=g*f,c=j%this.options.step,h=this._valueMin()+j-c;if(c>(this.options.step/2)){h+=this.options.step}return parseFloat(h.toFixed(5))},_start:function(e,d){var c={handle:this.handles[d],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(d);c.values=this.values()}this._trigger("start",e,c)},_slide:function(g,f,e){var h=this.handles[f];if(this.options.values&&this.options.values.length){var c=this.values(f?0:1);if((this.options.values.length==2&&this.options.range===true)&&((f==0&&e>c)||(f==1&&e<c))){e=c}if(e!=this.values(f)){var d=this.values();d[f]=e;var i=this._trigger("slide",g,{handle:this.handles[f],value:e,values:d});var c=this.values(f?0:1);if(i!==false){this.values(f,e,true)}}}else{if(e!=this.value()){var i=this._trigger("slide",g,{handle:this.handles[f],value:e});if(i!==false){this.value(e)}}}},_stop:function(e,d){var c={handle:this.handles[d],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(d);c.values=this.values()}this._trigger("stop",e,c)},_change:function(e,d){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[d],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(d);c.values=this.values()}this._trigger("change",e,c)}},value:function(c){if(arguments.length){this.options.value=this._trimValue(c);this._refreshValue();this._change(null,0)}return this._value()},values:function(e,h){if(arguments.length>1){this.options.values[e]=this._trimValue(h);this._refreshValue();this._change(null,e)}if(arguments.length){if(b.isArray(arguments[0])){var g=this.options.values,d=arguments[0];for(var f=0,c=g.length;f<c;f++){g[f]=this._trimValue(d[f]);this._change(null,f)}this._refreshValue()}else{if(this.options.values&&this.options.values.length){return this._values(e)}else{return this.value()}}}else{return this._values()}},_setOption:function(d,e){var c,f=0;if(jQuery.isArray(this.options.values)){f=this.options.values.length}b.Widget.prototype._setOption.apply(this,arguments);switch(d){case"disabled":if(e){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(c=0;c<f;c++){this._change(null,c)}this._animateOff=false;break}},_step:function(){var c=this.options.step;return c},_value:function(){var c=this.options.value;c=this._trimValue(c);return c},_values:function(d){if(arguments.length){var g=this.options.values[d];g=this._trimValue(g);return g}else{var f=this.options.values.slice();for(var e=0,c=f.length;e<c;e++){f[e]=this._trimValue(f[e])}return f}},_trimValue:function(c){if(c<this._valueMin()){c=this._valueMin()}if(c>this._valueMax()){c=this._valueMax()}return c},_valueMin:function(){var c=this.options.min;return c},_valueMax:function(){var c=this.options.max;return c},_refreshValue:function(){var g=this.options.range,e=this.options,m=this;var d=(!this._animateOff)?e.animate:false;if(this.options.values&&this.options.values.length){var j,i;this.handles.each(function(q,o){var p=(m.values(q)-m._valueMin())/(m._valueMax()-m._valueMin())*100;var n={};n[m.orientation=="horizontal"?"left":"bottom"]=p+"%";b(this).stop(1,1)[d?"animate":"css"](n,e.animate);if(m.options.range===true){if(m.orientation=="horizontal"){(q==0)&&m.range.stop(1,1)[d?"animate":"css"]({left:p+"%"},e.animate);(q==1)&&m.range[d?"animate":"css"]({width:(p-lastValPercent)+"%"},{queue:false,duration:e.animate})}else{(q==0)&&m.range.stop(1,1)[d?"animate":"css"]({bottom:(p)+"%"},e.animate);(q==1)&&m.range[d?"animate":"css"]({height:(p-lastValPercent)+"%"},{queue:false,duration:e.animate})}}lastValPercent=p})}else{var k=this.value(),h=this._valueMin(),l=this._valueMax(),f=l!=h?(k-h)/(l-h)*100:0;var c={};c[m.orientation=="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[d?"animate":"css"](c,e.animate);(g=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[d?"animate":"css"]({width:f+"%"},e.animate);(g=="max")&&(this.orientation=="horizontal")&&this.range[d?"animate":"css"]({width:(100-f)+"%"},{queue:false,duration:e.animate});(g=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[d?"animate":"css"]({height:f+"%"},e.animate);(g=="max")&&(this.orientation=="vertical")&&this.range[d?"animate":"css"]({height:(100-f)+"%"},{queue:false,duration:e.animate})}}});b.extend(b.ui.slider,{version:"1.8"})})(jQuery);; |
| | |
| | | #About |
| | | **jQuery Hotkeys** is a plug-in that lets you easily add and remove handlers for keyboard events anywhere in your code supporting almost any key combination. |
| | | **jQuery Hotkeys** is a plug-in that lets you easily add and remove handlers for keyboard events anywhere in your code supporting almost any key combination. |
| | | |
| | | This plugin is based off of the plugin by Tzury Bar Yochay: [jQuery.hotkeys](http://github.com/tzuryby/hotkeys) |
| | | |
| | |
| | | |
| | | $(expression).bind(types, keys, handler); |
| | | $(expression).unbind(types, handler); |
| | | |
| | | |
| | | $(document).bind('keydown', 'ctrl+a', fn); |
| | | |
| | | |
| | | // e.g. replace '$' sign with 'EUR' |
| | | $('input.foo').bind('keyup', '$', function(){ |
| | | this.value = this.value.replace('$', 'EUR'); |
| | |
| | | |
| | | Others, (IE) either let you handle built-in short-cuts, but will add their functionality after your code has executed. Or (Opera/Safari) will *not* pass those events to the DOM at all. |
| | | |
| | | *So, if you bind `Ctrl-Q` or `Alt-F4` and your Safari/Opera window is closed don't be surprised.* |
| | | *So, if you bind `Ctrl-Q` or `Alt-F4` and your Safari/Opera window is closed don't be surprised.* |
| | |
| | | * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/ |
| | | */ |
| | | |
| | | (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<f;j++){if(g[e[j]]){return c.apply(this,arguments)}}}}b.each(["keydown","keyup","keypress"],function(){b.event.special[this]={add:a}})})(jQuery); |
| | | (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<f;j++){if(g[e[j]]){return c.apply(this,arguments)}}}}b.each(["keydown","keyup","keypress"],function(){b.event.special[this]={add:a}})})(jQuery); |
| | |
| | | * Thanks to: Seamus Leahy for adding deltaX and deltaY |
| | | * |
| | | * Version: 3.0.6 |
| | | * |
| | | * |
| | | * Requires: 1.2.2+ |
| | | */ |
| | | |
| | |
| | | this.onmousewheel = handler; |
| | | } |
| | | }, |
| | | |
| | | |
| | | teardown: function() { |
| | | if ( this.removeEventListener ) { |
| | | for ( var i=types.length; i; ) { |
| | |
| | | mousewheel: function(fn) { |
| | | return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); |
| | | }, |
| | | |
| | | |
| | | unmousewheel: function(fn) { |
| | | return this.unbind("mousewheel", fn); |
| | | } |
| | |
| | | var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0; |
| | | event = $.event.fix(orgEvent); |
| | | event.type = "mousewheel"; |
| | | |
| | | |
| | | // Old school scrollwheel delta |
| | | if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; } |
| | | if ( orgEvent.detail ) { delta = -orgEvent.detail/3; } |
| | | |
| | | |
| | | // New school multidimensional scroll (touchpads) deltas |
| | | deltaY = delta; |
| | | |
| | | |
| | | // Gecko |
| | | if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { |
| | | deltaY = 0; |
| | | deltaX = -1*delta; |
| | | } |
| | | |
| | | |
| | | // Webkit |
| | | if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; } |
| | | if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; } |
| | | |
| | | |
| | | // Add event and delta to the front of the arguments |
| | | args.unshift(event, delta, deltaX, deltaY); |
| | | |
| | | |
| | | return ($.event.dispatch || $.event.handle).apply(this, args); |
| | | } |
| | | |
| | | })(jQuery); |
| | | })(jQuery); |
| | |
| | | return builder.pathSegList; |
| | | } |
| | | } |
| | | }()); |
| | | }()); |
| | |
| | | var vendors = ['ms', 'moz', 'webkit', 'o']; |
| | | for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { |
| | | window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; |
| | | window.cancelAnimationFrame = |
| | | window.cancelAnimationFrame = |
| | | window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame']; |
| | | } |
| | | |
| | | |
| | | if (!window.requestAnimationFrame) |
| | | window.requestAnimationFrame = function(callback, element) { |
| | | var currTime = new Date().getTime(); |
| | | var timeToCall = Math.max(0, 16 - (currTime - lastTime)); |
| | | var id = window.setTimeout(function() { callback(currTime + timeToCall); }, |
| | | var id = window.setTimeout(function() { callback(currTime + timeToCall); }, |
| | | timeToCall); |
| | | lastTime = currTime + timeToCall; |
| | | return id; |
| | | }; |
| | | |
| | | |
| | | if (!window.cancelAnimationFrame) |
| | | window.cancelAnimationFrame = function(id) { |
| | | clearTimeout(id); |
| | |
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | * See the License for the specific language governing permissions and |
| | | * limitations under the License. |
| | | * |
| | | * |
| | | * @author Guido Marucci Blas - guido@zaubersoftware.com |
| | | * @description Adds a handler for a custom event 'taphold' that handles a |
| | | * tap and hold on touch interfaces. |
| | |
| | | startTapAndHoldDetector.call(this, event) |
| | | var element = $(this); |
| | | element.bind(TOUCHMOVE, onTouchMove); |
| | | element.bind(TOUCHEND, onTouchEnd); |
| | | element.bind(TOUCHEND, onTouchEnd); |
| | | } else { |
| | | stopTapAndHoldDetector.call(this); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | function onTouchMove(event) { |
| | |
| | | var e = event.originalEvent; |
| | | var x = (e.changedTouches) ? e.changedTouches[0].pageX: e.pageX; |
| | | var y = (e.changedTouches) ? e.changedTouches[0].pageY: e.pageY; |
| | | |
| | | |
| | | var tapAndHoldPoint = $(this).data("taphold.point"); |
| | | var euclideanDistance = calculateEuclideanDistance(tapAndHoldPoint.x, tapAndHoldPoint.y, x, y); |
| | | |
| | | |
| | | if (euclideanDistance > MAX_DISTANCE_ALLOWED_IN_TAP_AND_HOLD_EVENT) { |
| | | stopTapAndHoldDetector.call(this); |
| | | } |
| | |
| | | function clear() { |
| | | tapAndHoldTimer = null; |
| | | $(this).unbind(TOUCHMOVE, onTouchMove); |
| | | $(this).unbind(TOUCHEND, onTouchEnd); |
| | | $(this).unbind(TOUCHEND, onTouchEnd); |
| | | }; |
| | | |
| | | function startTapAndHoldDetector(event) { |
| | |
| | | |
| | | function stopTapAndHoldDetector() { |
| | | clearTimeout(tapAndHoldTimer); |
| | | clear.call(this); |
| | | clear.call(this); |
| | | }; |
| | | |
| | | $.event.special["taphold"] = { |
| | | setup: function() { |
| | | |
| | | |
| | | }, |
| | | |
| | | add: function(handleObj) { |
| | |
| | | }, |
| | | |
| | | teardown: function() { |
| | | |
| | | |
| | | } |
| | | }; |
| | | |
| | | })(jQuery); |
| | | })(jQuery); |
| | |
| | | function touchHandler(event) |
| | | { |
| | | |
| | | { |
| | | |
| | | var touches = event.changedTouches, |
| | | first = touches[0], |
| | | type = ""; |
| | | switch(event.type) |
| | | { |
| | | case "touchstart": type="mousedown"; break; |
| | | case "touchmove": type="mousemove"; break; |
| | | case "touchmove": type="mousemove"; break; |
| | | case "touchend": type="mouseup"; break; |
| | | default: return; |
| | | } |
| | | |
| | | //initMouseEvent(type, canBubble, cancelable, view, clickCount, |
| | | // screenX, screenY, clientX, clientY, ctrlKey, |
| | | //initMouseEvent(type, canBubble, cancelable, view, clickCount, |
| | | // screenX, screenY, clientX, clientY, ctrlKey, |
| | | // altKey, shiftKey, metaKey, button, relatedTarget); |
| | | |
| | | |
| | | var simulatedEvent = document.createEvent("MouseEvent"); |
| | | simulatedEvent.initMouseEvent(type, true, true, window, 1, |
| | | first.screenX, first.screenY, |
| | | first.clientX, first.clientY, false, |
| | | simulatedEvent.initMouseEvent(type, true, true, window, 1, |
| | | first.screenX, first.screenY, |
| | | first.clientX, first.clientY, false, |
| | | false, false, false, 0/*left*/, null); |
| | | if(touches.length < 2) { |
| | | first.target.dispatchEvent(simulatedEvent); |
| | |
| | | var supportsNativeSVGTransformLists_ = (function() { |
| | | var rect = document.createElementNS(svgns, 'rect'); |
| | | var rxform = rect.transform.baseVal; |
| | | |
| | | |
| | | var t1 = svg.createSVGTransform(); |
| | | rxform.appendItem(t1); |
| | | return rxform.getItem(0) == t1; |
| | |
| | | // 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 |
| | | // 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('<p>'+msg.replace(/\n/g,'</p><p>')+'</p>') |
| | | .toggleClass('prompt',(type=='prompt')); |
| | | btn_holder.empty(); |
| | | |
| | | |
| | | var ok = $('<input type="button" value="' + uiStrings.common.ok + '">').appendTo(btn_holder); |
| | | |
| | | |
| | | if(type != 'alert') { |
| | | $('<input type="button" value="' + uiStrings.common.cancel + '">') |
| | | .appendTo(btn_holder) |
| | | .on("click touchstart", function() { box.hide();callback(false)}); |
| | | } |
| | | |
| | | |
| | | if(type == 'prompt') { |
| | | var input = $('<input type="text">').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() { |
| | | |
| | | 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);}; |
| | | }()); |
| | | }()); |
| | |
| | | |
| | | reader.readAsDataURL(e.dataTransfer.files[0]); |
| | | }, false); |
| | | } |
| | | } |
| | |
| | | |
| | | // Called to ensure that drawings will or will not have randomized ids. |
| | | // The current_drawing will have its nonce set if it doesn't already. |
| | | // |
| | | // |
| | | // Params: |
| | | // enableRandomization - flag indicating if documents should have randomized ids |
| | | svgedit.draw.randomizeIds = function(enableRandomization, current_drawing) { |
| | |
| | | * @type {SVGSVGElement} |
| | | */ |
| | | this.svgElem_ = svgElem; |
| | | |
| | | |
| | | /** |
| | | * The latest object number used in this drawing. |
| | | * @type {number} |
| | | */ |
| | | this.obj_num = 0; |
| | | |
| | | |
| | | /** |
| | | * The prefix to prepend to each element id in the drawing. |
| | | * @type {String} |
| | | */ |
| | | this.idPrefix = opt_idPrefix || "svg_"; |
| | | |
| | | |
| | | /** |
| | | * An array of released element ids to immediately reuse. |
| | | * @type {Array.<number>} |
| | |
| | | var oldObjNum = this.obj_num; |
| | | var restoreOldObjNum = false; |
| | | |
| | | // If there are any released numbers in the release stack, |
| | | // If there are any released numbers in the release stack, |
| | | // use the last one instead of the next obj_num. |
| | | // We need to temporarily use obj_num as that is what getId() depends on. |
| | | if (this.releasedNums.length > 0) { |
| | |
| | | if (typeof num != typeof 1 || num <= 0 || this.releasedNums.indexOf(num) != -1) { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | // push the released number into the released queue |
| | | this.releasedNums.push(num); |
| | | |
| | |
| | | |
| | | // Function: svgedit.draw.Drawing.getNumLayers |
| | | // Returns the number of layers in the current drawing. |
| | | // |
| | | // |
| | | // Returns: |
| | | // The number of layers in the current drawing. |
| | | svgedit.draw.Drawing.prototype.getNumLayers = function() { |
| | |
| | | // |
| | | // Parameters: |
| | | // i - the zero-based index of the layer you are querying. |
| | | // |
| | | // |
| | | // Returns: |
| | | // The name of the ith layer |
| | | svgedit.draw.Drawing.prototype.getLayerName = function(i) { |
| | |
| | | }; |
| | | |
| | | // Function: getCurrentLayerName |
| | | // Returns the name of the currently selected layer. If an error occurs, an empty string |
| | | // Returns the name of the currently selected layer. If an error occurs, an empty string |
| | | // is returned. |
| | | // |
| | | // Returns: |
| | |
| | | |
| | | |
| | | // Function: svgedit.draw.Drawing.deleteCurrentLayer |
| | | // Deletes the current layer from the drawing and then clears the selection. This function |
| | | // Deletes the current layer from the drawing and then clears the selection. This function |
| | | // then calls the 'changed' handler. This is an undoable action. |
| | | // Returns: |
| | | // The SVGGElement of the layer removed or null. |
| | |
| | | if (child.tagName == "g") { |
| | | childgroups = true; |
| | | var name = $("title",child).text(); |
| | | |
| | | |
| | | // Hack for Opera 10.60 |
| | | if(!name && svgedit.browser.isOpera() && child.querySelectorAll) { |
| | | name = $(child.querySelectorAll('title')).text(); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // create a new layer and add all the orphans to it |
| | | var svgdoc = this.svgElem_.ownerDocument; |
| | | if (orphans.length > 0 || !childgroups) { |
| | |
| | | }; |
| | | |
| | | // Function: svgedit.draw.Drawing.createLayer |
| | | // Creates a new top-level layer in the drawing with the given name and |
| | | // Creates a new top-level layer in the drawing with the given name and |
| | | // sets the current layer to it. |
| | | // |
| | | // Parameters: |
| | |
| | | }; |
| | | |
| | | // Function: svgedit.draw.Drawing.setLayerVisibility |
| | | // Sets the visibility of the layer. If the layer name is not valid, this function return |
| | | // Sets the visibility of the layer. If the layer name is not valid, this function return |
| | | // false, otherwise it returns true. This is an undo-able action. |
| | | // |
| | | // Parameters: |
| | |
| | | } |
| | | } |
| | | if (!layer) return null; |
| | | |
| | | |
| | | var oldDisplay = layer.getAttribute("display"); |
| | | if (!oldDisplay) oldDisplay = "inline"; |
| | | layer.setAttribute("display", bVisible ? "inline" : "none"); |
| | |
| | | // Function: svgedit.draw.Drawing.getLayerOpacity |
| | | // Returns the opacity of the given layer. If the input name is not a layer, null is returned. |
| | | // |
| | | // Parameters: |
| | | // Parameters: |
| | | // layername - name of the layer on which to get the opacity |
| | | // |
| | | // Returns: |
| | |
| | | //initialize communication |
| | | this.frame = frame; |
| | | this.stack = []; //callback stack |
| | | |
| | | |
| | | var editapi = this; |
| | | |
| | | |
| | | window.addEventListener("message", function(e){ |
| | | if(e.data.substr(0,5) == "ERROR"){ |
| | | editapi.stack.splice(0,1)[0](e.data,"error") |
| | |
| | | } |
| | | }) |
| | | |
| | | Everything is done with the same API as the real svg-edit, |
| | | Everything is done with the same API as the real svg-edit, |
| | | and all documentation is unchanged. The only difference is |
| | | when handling returns, the callback notation is used instead. |
| | | when handling returns, the callback notation is used instead. |
| | | |
| | | var blah = new embedded_svg_edit(window.frames['svgedit']); |
| | | blah.clearSelection("woot","blah",1337,[1,2,3,4,5,"moo"],-42,{a: "tree",b:6, c: 9})(function(){console.log("GET DATA",arguments)}) |
| | |
| | | this.encode = embedded_svg_edit.encode; |
| | | //List of functions extracted with this: |
| | | //Run in firebug on http://svg-edit.googlecode.com/svn/trunk/docs/files/svgcanvas-js.html |
| | | |
| | | |
| | | //for(var i=0,q=[],f = document.querySelectorAll("div.CFunction h3.CTitle a");i<f.length;i++){q.push(f[i].name)};q |
| | | //var functions = ["clearSelection", "addToSelection", "removeFromSelection", "open", "save", "getSvgString", "setSvgString", |
| | | //"createLayer", "deleteCurrentLayer", "setCurrentLayer", "renameCurrentLayer", "setCurrentLayerPosition", "setLayerVisibility", |
| | | //"moveSelectedToLayer", "clear"]; |
| | | |
| | | |
| | | |
| | | |
| | | //Newer, well, it extracts things that aren't documented as well. All functions accessible through the normal thingy can now be accessed though the API |
| | | //var l=[];for(var i in svgCanvas){if(typeof svgCanvas[i] == "function"){l.push(i)}}; |
| | | //run in svgedit itself |
| | |
| | | "getStrokedBBox", "getVisibleElements", "cycleElement", "getUndoStackSize", "getRedoStackSize", "getNextUndoCommandText", |
| | | "getNextRedoCommandText", "undo", "redo", "cloneSelectedElements", "alignSelectedElements", "getZoom", "getVersion", |
| | | "setIconSize", "setLang", "setCustomHandlers"]; |
| | | |
| | | |
| | | //TODO: rewrite the following, it's pretty scary. |
| | | for(var i = 0; i < functions.length; i++){ |
| | | this[functions[i]] = (function(d){ |
| | |
| | | args.push(arguments[g]); |
| | | } |
| | | var cbid = t.send(d,args, function(){}) //the callback (currently it's nothing, but will be set later |
| | | |
| | | |
| | | return function(newcallback){ |
| | | t.callbacks[cbid] = newcallback; //set callback |
| | | } |
| | |
| | | //simple partial JSON encoder implementation |
| | | if(window.JSON && JSON.stringify) return JSON.stringify(obj); |
| | | var enc = arguments.callee; //for purposes of recursion |
| | | |
| | | |
| | | if(typeof obj == "boolean" || typeof obj == "number"){ |
| | | return obj+'' //should work... |
| | | }else if(typeof obj == "string"){ |
| | |
| | | if (handler) { |
| | | handler.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_UNAPPLY, this); |
| | | } |
| | | |
| | | |
| | | this.elem = this.oldParent.insertBefore(this.elem, this.oldNextSibling); |
| | | |
| | | if (handler) { |
| | |
| | | |
| | | // Function: svgedit.history.InsertElementCommand.apply |
| | | // Re-Inserts the new element |
| | | svgedit.history.InsertElementCommand.prototype.apply = function(handler) { |
| | | svgedit.history.InsertElementCommand.prototype.apply = function(handler) { |
| | | if (handler) { |
| | | handler.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_APPLY, this); |
| | | } |
| | | |
| | | this.elem = this.parent.insertBefore(this.elem, this.nextSibling); |
| | | this.elem = this.parent.insertBefore(this.elem, this.nextSibling); |
| | | |
| | | if (handler) { |
| | | handler.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_APPLY, this); |
| | |
| | | |
| | | // Function: RemoveElementCommand.apply |
| | | // Re-removes the new element |
| | | svgedit.history.RemoveElementCommand.prototype.apply = function(handler) { |
| | | svgedit.history.RemoveElementCommand.prototype.apply = function(handler) { |
| | | if (handler) { |
| | | handler.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_APPLY, this); |
| | | } |
| | |
| | | |
| | | // Function: RemoveElementCommand.unapply |
| | | // Re-adds the new element |
| | | svgedit.history.RemoveElementCommand.prototype.unapply = function(handler) { |
| | | svgedit.history.RemoveElementCommand.prototype.unapply = function(handler) { |
| | | if (handler) { |
| | | handler.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_UNAPPLY, this); |
| | | } |
| | |
| | | |
| | | // Class: svgedit.history.ChangeElementCommand |
| | | // implements svgedit.history.HistoryCommand |
| | | // History command to make a change to an element. |
| | | // History command to make a change to an element. |
| | | // Usually an attribute change, but can also be textcontent. |
| | | // |
| | | // Parameters: |
| | |
| | | this.undoChangeStackPointer = -1; |
| | | this.undoableChangeStack = []; |
| | | }; |
| | | |
| | | |
| | | // Function: svgedit.history.UndoManager.resetUndoStack |
| | | // Resets the undo stack, effectively clearing the undo/redo history |
| | | svgedit.history.UndoManager.prototype.resetUndoStack = function() { |
| | |
| | | }; |
| | | |
| | | // Function: svgedit.history.UndoManager.getUndoStackSize |
| | | // Returns: |
| | | // Returns: |
| | | // Integer with the current size of the undo history stack |
| | | svgedit.history.UndoManager.prototype.getUndoStackSize = function() { |
| | | return this.undoStackPointer; |
| | | }; |
| | | |
| | | // Function: svgedit.history.UndoManager.getRedoStackSize |
| | | // Returns: |
| | | // Returns: |
| | | // Integer with the current size of the redo history stack |
| | | svgedit.history.UndoManager.prototype.getRedoStackSize = function() { |
| | | return this.undoStack.length - this.undoStackPointer; |
| | | }; |
| | | |
| | | // Function: svgedit.history.UndoManager.getNextUndoCommandText |
| | | // Returns: |
| | | // Returns: |
| | | // String associated with the next undo command |
| | | svgedit.history.UndoManager.prototype.getNextUndoCommandText = function() { |
| | | svgedit.history.UndoManager.prototype.getNextUndoCommandText = function() { |
| | | return this.undoStackPointer > 0 ? this.undoStack[this.undoStackPointer-1].getText() : ""; |
| | | }; |
| | | |
| | | // Function: svgedit.history.UndoManager.getNextRedoCommandText |
| | | // Returns: |
| | | // Returns: |
| | | // String associated with the next redo command |
| | | svgedit.history.UndoManager.prototype.getNextRedoCommandText = function() { |
| | | svgedit.history.UndoManager.prototype.getNextRedoCommandText = function() { |
| | | return this.undoStackPointer < this.undoStack.length ? this.undoStack[this.undoStackPointer].getText() : ""; |
| | | }; |
| | | |
| | |
| | | } |
| | | }; |
| | | |
| | | // Function: svgedit.history.UndoManager.redo |
| | | // Function: svgedit.history.UndoManager.redo |
| | | // Performs a redo step |
| | | svgedit.history.UndoManager.prototype.redo = function() { |
| | | if (this.undoStackPointer < this.undoStack.length && this.undoStack.length > 0) { |
| | |
| | | cmd.apply(this.handler_); |
| | | } |
| | | }; |
| | | |
| | | |
| | | // Function: svgedit.history.UndoManager.addCommandToHistory |
| | | // Adds a command object to the undo history stack |
| | | // |
| | | // Parameters: |
| | | // Parameters: |
| | | // cmd - The command object to add |
| | | svgedit.history.UndoManager.prototype.addCommandToHistory = function(cmd) { |
| | | // FIXME: we MUST compress consecutive text changes to the same element |
| | | // (right now each keystroke is saved as a separate command that includes the |
| | | // entire text contents of the text element) |
| | | // TODO: consider limiting the history that we store here (need to do some slicing) |
| | | |
| | | |
| | | // if our stack pointer is not at the end, then we have to remove |
| | | // all commands after the pointer and insert the new command |
| | | if (this.undoStackPointer < this.undoStack.length && this.undoStack.length > 0) { |
| | |
| | | |
| | | |
| | | // Function: svgedit.history.UndoManager.beginUndoableChange |
| | | // This function tells the canvas to remember the old values of the |
| | | // attrName attribute for each element sent in. The elements and values |
| | | // are stored on a stack, so the next call to finishUndoableChange() will |
| | | // This function tells the canvas to remember the old values of the |
| | | // attrName attribute for each element sent in. The elements and values |
| | | // are stored on a stack, so the next call to finishUndoableChange() will |
| | | // pop the elements and old values off the stack, gets the current values |
| | | // from the DOM and uses all of these to construct the undo-able command. |
| | | // |
| | | // Parameters: |
| | | // Parameters: |
| | | // attrName - The name of the attribute being changed |
| | | // elems - Array of DOM elements being changed |
| | | svgedit.history.UndoManager.prototype.beginUndoableChange = function(attrName, elems) { |
| | |
| | | // change since beginUndoableChange was called. The command can then |
| | | // be added to the command history |
| | | // |
| | | // Returns: |
| | | // Returns: |
| | | // Batch command object with resulting changes |
| | | svgedit.history.UndoManager.prototype.finishUndoableChange = function() { |
| | | var p = this.undoChangeStackPointer--; |
| | |
| | | }; |
| | | |
| | | |
| | | })(); |
| | | })(); |
| | |
| | | // Function: svgedit.math.transformPoint |
| | | // A (hopefully) quicker function to transform a point by a matrix |
| | | // (this function avoids any DOM calls and just does the math) |
| | | // |
| | | // |
| | | // Parameters: |
| | | // x - Float representing the x coordinate |
| | | // y - Float representing the y coordinate |
| | |
| | | |
| | | |
| | | // Function: svgedit.math.isIdentity |
| | | // Helper function to check if the matrix performs no actual transform |
| | | // Helper function to check if the matrix performs no actual transform |
| | | // (i.e. exists for identity purposes) |
| | | // |
| | | // Parameters: |
| | | // Parameters: |
| | | // m - The matrix object to check |
| | | // |
| | | // Returns: |
| | |
| | | // Function: svgedit.math.matrixMultiply |
| | | // This function tries to return a SVGMatrix that is the multiplication m1*m2. |
| | | // We also round to zero when it's near zero |
| | | // |
| | | // |
| | | // Parameters: |
| | | // >= 2 Matrix objects to multiply |
| | | // |
| | | // Returns: |
| | | // Returns: |
| | | // The matrix object resulting from the calculation |
| | | svgedit.math.matrixMultiply = function() { |
| | | var args = arguments, i = args.length, m = args[i-1]; |
| | | |
| | | |
| | | while(i-- > 1) { |
| | | var m1 = args[i-1]; |
| | | m = m1.multiply(m); |
| | |
| | | if (Math.abs(m.d) < NEAR_ZERO) m.d = 0; |
| | | if (Math.abs(m.e) < NEAR_ZERO) m.e = 0; |
| | | if (Math.abs(m.f) < NEAR_ZERO) m.f = 0; |
| | | |
| | | |
| | | return m; |
| | | }; |
| | | |
| | | // Function: svgedit.math.hasMatrixTransform |
| | | // See if the given transformlist includes a non-indentity matrix transform |
| | | // |
| | | // Parameters: |
| | | // Parameters: |
| | | // tlist - The transformlist to check |
| | | // |
| | | // Returns: |
| | | // Returns: |
| | | // Boolean on whether or not a matrix transform was found |
| | | svgedit.math.hasMatrixTransform = function(tlist) { |
| | | if(!tlist) return false; |
| | |
| | | // w - Float with the box width |
| | | // h - Float with the box height |
| | | // m - Matrix object to transform the box by |
| | | // |
| | | // |
| | | // Returns: |
| | | // An object with the following values: |
| | | // * tl - The top left coordinate (x,y object) |
| | |
| | | miny = Math.min(miny, botright.y); |
| | | maxy = Math.max(maxy, botright.y); |
| | | |
| | | return {tl:topleft, tr:topright, bl:botleft, br:botright, |
| | | return {tl:topleft, tr:topright, bl:botleft, br:botright, |
| | | aabox: {x:minx, y:miny, width:(maxx-minx), height:(maxy-miny)} }; |
| | | }; |
| | | |
| | |
| | | // (this is the equivalent of SVGTransformList.consolidate() but unlike |
| | | // that method, this one does not modify the actual SVGTransformList) |
| | | // This function is very liberal with its min,max arguments |
| | | // |
| | | // |
| | | // Parameters: |
| | | // tlist - The transformlist object |
| | | // min - Optional integer indicating start transform position |
| | |
| | | var m = svg.createSVGMatrix(); |
| | | for (var i = min; i <= max; ++i) { |
| | | // if our indices are out of range, just use a harmless identity matrix |
| | | var mtom = (i >= 0 && i < tlist.numberOfItems ? |
| | | var mtom = (i >= 0 && i < tlist.numberOfItems ? |
| | | tlist.getItem(i).matrix : |
| | | svg.createSVGMatrix()); |
| | | m = svgedit.math.matrixMultiply(m, mtom); |
| | |
| | | // |
| | | // Parameters: |
| | | // elem - The DOM element to check |
| | | // |
| | | // |
| | | // Returns: |
| | | // The matrix object associated with the element's transformlist |
| | | svgedit.math.getMatrix = function(elem) { |
| | |
| | | |
| | | |
| | | // Function: svgedit.math.snapToAngle |
| | | // Returns a 45 degree angle coordinate associated with the two given |
| | | // Returns a 45 degree angle coordinate associated with the two given |
| | | // coordinates |
| | | // |
| | | // |
| | | // Parameters: |
| | | // x1 - First coordinate's x value |
| | | // x2 - Second coordinate's x value |
| | | // y1 - First coordinate's y value |
| | | // y2 - Second coordinate's y value |
| | | // |
| | | // Returns: |
| | | // Returns: |
| | | // Object with the following values: |
| | | // x - The angle-snapped x value |
| | | // y - The angle-snapped y value |
| | |
| | | var angle = Math.atan2(dy,dx); |
| | | var dist = Math.sqrt(dx * dx + dy * dy); |
| | | var snapangle= Math.round(angle/snap)*snap; |
| | | var x = x1 + dist*Math.cos(snapangle); |
| | | var x = x1 + dist*Math.cos(snapangle); |
| | | var y = y1 + dist*Math.sin(snapangle); |
| | | //console.log(x1,y1,x2,y2,x,y,angle) |
| | | return {x:x, y:y, a:snapangle}; |
| | |
| | | // Boolean that's true if rectangles intersect |
| | | svgedit.math.rectsIntersect = function(r1, r2) { |
| | | if (!r1 || !r2) return false; |
| | | return r2.x < (r1.x+r1.width) && |
| | | return r2.x < (r1.x+r1.width) && |
| | | (r2.x+r2.width) > r1.x && |
| | | r2.y < (r1.y+r1.height) && |
| | | (r2.y+r2.height) > r1.y; |
| | | }; |
| | | |
| | | |
| | | })(); |
| | | })(); |
| | |
| | | |
| | | if(!window.methodDraw) window.methodDraw = function($) { |
| | | var svgCanvas; |
| | | var loadSvgString; |
| | | var Editor = {}; |
| | | var is_ready = false; |
| | | curConfig = { |
| | |
| | | }, |
| | | uiStrings = Editor.uiStrings = { |
| | | common: { |
| | | "ok":"OK", |
| | | "cancel":"Cancel", |
| | | "key_up":"Up", |
| | | "key_down":"Down", |
| | | "key_backspace":"Backspace", |
| | | "key_del":"Del" |
| | | "ok":"确认", |
| | | "cancel":"取消", |
| | | "key_up":"上一步", |
| | | "key_down":"下一步", |
| | | "key_backspace":"返回", |
| | | "key_del":"删除" |
| | | |
| | | }, |
| | | // This is needed if the locale is English, since the locale strings are not read in that instance. |
| | |
| | | "noteTheseIssues": "Also note the following issues: ", |
| | | "unsavedChanges": "There are unsaved changes.", |
| | | "enterNewLinkURL": "Enter the new hyperlink URL", |
| | | "errorLoadingSVG": "错误: 无法读取SVG数据", |
| | | "errorLoadingSVG": "当前没有数据,请绘制SVG数据", |
| | | "URLloadFail": "Unable to load from URL", |
| | | "retrieving": 'Retrieving "%s" ...' |
| | | } |
| | |
| | | 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" |
| | | ], |
| | | var palette =[], |
| | | isMac = (navigator.platform.indexOf("Mac") >= 0), |
| | | isWebkit = (navigator.userAgent.indexOf("AppleWebKit") >= 0), |
| | | modKey = (isMac ? "meta+" : "ctrl+"), // ⌘ |
| | |
| | | if (is_background) picker = 'canvas' |
| | | // var opacity = (picker == 'stroke' ? $('#stroke_opacity') : $('#fill_opacity')); |
| | | var paint = Editor.paintBox[picker].paint; |
| | | |
| | | var title = (picker == 'stroke' ? 'Pick a Stroke Paint and Opacity' : 'Pick a Fill Paint and Opacity'); |
| | | var was_none = false; |
| | | var pos = is_background ? {'right': 175, 'top': 50} : {'left': 50, 'bottom': 50} |
| | | |
| | | $("#color_picker") |
| | | .draggable({cancel:'.jGraduate_tabs, .jGraduate_colPick, .jGraduate_gradPick, .jPicker', containment: 'window'}) |
| | | .removeAttr("style") |
| | | .css(pos) |
| | | .jGraduate( |
| | | { |
| | | paint: paint, |
| | | window: { pickerTitle: title }, |
| | | images: { clientPath: curConfig.jGraduatePath }, |
| | | newstop: 'inverse' |
| | | }, |
| | | function(p) { |
| | | paint = new $.jGraduate.Paint(p); |
| | | |
| | | Editor.paintBox[picker].setPaint(paint); |
| | | svgCanvas.setPaint(picker, paint); |
| | | |
| | | $('#color_picker').hide(); |
| | | }, |
| | | function(p) { |
| | | $('#color_picker').hide(); |
| | | }); |
| | | // $("#color_picker") |
| | | // .draggable({cancel:'.jGraduate_tabs, .jGraduate_colPick, .jGraduate_gradPick, .jPicker', containment: 'window'}) |
| | | // .removeAttr("style") |
| | | // .css(pos) |
| | | // .jGraduate( |
| | | // { |
| | | // paint: paint, |
| | | // window: { pickerTitle: title }, |
| | | // images: { clientPath: curConfig.jGraduatePath }, |
| | | // newstop: 'inverse' |
| | | // }, |
| | | // function(p) { |
| | | // paint = new $.jGraduate.Paint(p); |
| | | // |
| | | // Editor.paintBox[picker].setPaint(paint); |
| | | // svgCanvas.setPaint(picker, paint); |
| | | // |
| | | // $('#color_picker').hide(); |
| | | // }, |
| | | // function(p) { |
| | | // $('#color_picker').hide(); |
| | | // }); |
| | | }; |
| | | |
| | | var PaintBox = function(container, type) { |
| | |
| | | // set up gradients to be used for the buttons |
| | | var svgdocbox = new DOMParser().parseFromString( |
| | | '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150 150"><rect width="100%" height="100%"\ |
| | | fill="#' + cur.color + '" opacity="' + cur.opacity + '"/>\ |
| | | fill="none" opacity="' + cur.opacity + '"/>\ |
| | | <defs><linearGradient id="gradbox_"/></defs></svg>', 'text/xml'); |
| | | var docElem = svgdocbox.documentElement; |
| | | // docElem.setAttribute('viewBox', '0 0 150 150') |
| | | docElem = $(container)[0].appendChild(document.importNode(docElem, true)); |
| | | // docElem = $(container)[0].appendChild(document.importNode(docElem, true)); |
| | | if (type === 'canvas') docElem.setAttribute('width',60.5); |
| | | else docElem.setAttribute('width',"100%"); |
| | | |
| | |
| | | var blur_test = svgdocbox.createElementNS('http://www.w3.org/2000/svg', 'feGaussianBlur'); |
| | | if(typeof blur_test.stdDeviationX === "undefined") { |
| | | $('#tool_blur').hide(); |
| | | } |
| | | } |
| | | $(blur_test).remove(); |
| | | |
| | | |
| | |
| | | $('#resolution').change(function(){ |
| | | var w = $('#canvas_width')[0]; |
| | | var h = $('#canvas_height')[0]; |
| | | console.log(w,h,'www hhh') |
| | | console.log(w.value,h.value,'w.value ww h.value hh') |
| | | if(!this.selectedIndex) { |
| | | $('#resolution_label').html("Custom"); |
| | | $('#resolution_label').html("默认"); |
| | | w.removeAttribute("readonly"); |
| | | w.focus(); |
| | | w.select(); |
| | |
| | | if(success) { |
| | | callback(true); |
| | | } else { |
| | | $.alert(uiStrings.notification.errorLoadingSVG, function() { |
| | | callback(false); |
| | | }); |
| | | callback(false); |
| | | // $.alert(uiStrings.notification.errorLoadingSVG, function() { |
| | | // callback(false); |
| | | // }); |
| | | } |
| | | } |
| | | |
| | |
| | | is_ready = true; |
| | | var data = window.parent.document.getElementById("svgContentId").value |
| | | svgCanvas.clear() |
| | | if(data){ |
| | | // if(data){ |
| | | console.log(data,'data data') |
| | | window.methodDraw.loadSvgString(data) |
| | | window.methodDraw.updateCanvas() |
| | | } |
| | | // } |
| | | // alert(data+'inputValue') |
| | | }; |
| | | |
| | |
| | | |
| | | svgedit.path.init = function(editorContext) { |
| | | editorContext_ = editorContext; |
| | | |
| | | |
| | | pathFuncs = [0,'ClosePath']; |
| | | var pathFuncsStrs = ['Moveto', 'Lineto', 'CurvetoCubic', 'CurvetoQuadratic', 'Arc', |
| | | 'LinetoHorizontal', 'LinetoVertical','CurvetoCubicSmooth','CurvetoQuadraticSmooth']; |
| | |
| | | svgedit.path.addCtrlGrip = function(id) { |
| | | var pointGrip = svgedit.utilities.getElem("ctrlpointgrip_"+id); |
| | | if(pointGrip) return pointGrip; |
| | | |
| | | |
| | | pointGrip = document.createElementNS(svgns, "circle"); |
| | | svgedit.utilities.assignAttributes(pointGrip, { |
| | | 'id': "ctrlpointgrip_" + id, |
| | |
| | | var item = seg.item; |
| | | var index = seg.index; |
| | | if(!item || !("x1" in item) || !("x2" in item)) return null; |
| | | var cpt = {}; |
| | | var cpt = {}; |
| | | var pointGripContainer = svgedit.path.getGripContainer(); |
| | | |
| | | // Note that this is intentionally not seg.prev.item |
| | |
| | | 'd': 'M0,0 0,0' |
| | | }); |
| | | pointGripContainer.appendChild(segLine); |
| | | } |
| | | } |
| | | |
| | | if(update) { |
| | | var prev = seg.prev; |
| | |
| | | |
| | | // Function: smoothControlPoints |
| | | // Takes three points and creates a smoother line based on them |
| | | // |
| | | // Parameters: |
| | | // |
| | | // Parameters: |
| | | // ct1 - Object with x and y values (first control point) |
| | | // ct2 - Object with x and y values (second control point) |
| | | // pt - Object with x and y values (third point) |
| | | // |
| | | // Returns: |
| | | // Returns: |
| | | // Array of two "smoothed" point objects |
| | | svgedit.path.smoothControlPoints = this.smoothControlPoints = function(ct1, ct2, pt) { |
| | | // each point must not be the origin |
| | |
| | | y1 = ct1.y - pt.y, |
| | | x2 = ct2.x - pt.x, |
| | | y2 = ct2.y - pt.y; |
| | | |
| | | |
| | | if ( (x1 != 0 || y1 != 0) && (x2 != 0 || y2 != 0) ) { |
| | | var anglea = Math.atan2(y1,x1), |
| | | angleb = Math.atan2(y2,x2), |
| | | r1 = Math.sqrt(x1*x1+y1*y1), |
| | | r2 = Math.sqrt(x2*x2+y2*y2), |
| | | nct1 = editorContext_.getSVGRoot().createSVGPoint(), |
| | | nct2 = editorContext_.getSVGRoot().createSVGPoint(); |
| | | nct2 = editorContext_.getSVGRoot().createSVGPoint(); |
| | | if (anglea < 0) { anglea += 2*Math.PI; } |
| | | if (angleb < 0) { angleb += 2*Math.PI; } |
| | | |
| | | |
| | | var angleBetween = Math.abs(anglea - angleb), |
| | | angleDiff = Math.abs(Math.PI - angleBetween)/2; |
| | | |
| | | |
| | | var new_anglea, new_angleb; |
| | | if (anglea - angleb > 0) { |
| | | new_anglea = angleBetween < Math.PI ? (anglea + angleDiff) : (anglea - angleDiff); |
| | |
| | | new_anglea = angleBetween < Math.PI ? (anglea - angleDiff) : (anglea + angleDiff); |
| | | new_angleb = angleBetween < Math.PI ? (angleb + angleDiff) : (angleb - angleDiff); |
| | | } |
| | | |
| | | |
| | | // rotate the points |
| | | nct1.x = r1 * Math.cos(new_anglea) + pt.x; |
| | | nct1.y = r1 * Math.sin(new_anglea) + pt.y; |
| | | nct2.x = r2 * Math.cos(new_angleb) + pt.x; |
| | | nct2.y = r2 * Math.sin(new_angleb) + pt.y; |
| | | |
| | | |
| | | return [nct1, nct2]; |
| | | } |
| | | return undefined; |
| | |
| | | this.index = index; |
| | | this.item = item; |
| | | this.type = item.pathSegType; |
| | | |
| | | |
| | | this.ctrlpts = []; |
| | | this.ptgrip = null; |
| | | this.segsel = null; |
| | |
| | | this.type = this.item.pathSegType; |
| | | } |
| | | svgedit.path.getControlPoints(this); |
| | | } |
| | | } |
| | | // this.segsel.setAttribute("display", y?"inline":"none"); |
| | | } |
| | | }; |
| | |
| | | var item = this.item; |
| | | // fix for path tool dom breakage, amending item does bad things now, so we take a copy and use that. Can probably improve to just take a shallow copy of object |
| | | var cloneItem = $.extend({}, item); |
| | | var cur_pts = (this.ctrlpts) |
| | | ? [cloneItem.x += dx, cloneItem.y += dy, |
| | | cloneItem.x1, cloneItem.y1, |
| | | var cur_pts = (this.ctrlpts) |
| | | ? [cloneItem.x += dx, cloneItem.y += dy, |
| | | cloneItem.x1, cloneItem.y1, |
| | | cloneItem.x2 += dx, cloneItem.y2 += dy] |
| | | : [cloneItem.x += dx, cloneItem.y += dy]; |
| | | |
| | | |
| | | svgedit.path.replacePathSeg(this.type, this.index, cur_pts); |
| | | |
| | | if(this.next && this.next.ctrlpts) { |
| | | var next = this.next.item; |
| | | var next_pts = [next.x, next.y, |
| | | var next_pts = [next.x, next.y, |
| | | next.x1 += dx, next.y1 += dy, next.x2, next.y2]; |
| | | svgedit.path.replacePathSeg(this.next.type, this.next.index, next_pts); |
| | | } |
| | |
| | | cloneItem['x' + anum ] = pt.x + (pt.x - this.item['x' + num]); |
| | | cloneItem['y' + anum ] = pt.y + (pt.y - this.item['y' + num]); |
| | | |
| | | var pts = [ |
| | | var pts = [ |
| | | cloneItem.x, cloneItem.y, |
| | | cloneItem.x1, cloneItem.y1, |
| | | cloneItem.x2, cloneItem.y2 |
| | |
| | | |
| | | var pts = [item.x,item.y, |
| | | item.x1,item.y1, item.x2,item.y2]; |
| | | |
| | | |
| | | svgedit.path.replacePathSeg(this.type, this.index, pts); |
| | | this.update(true); |
| | | }; |
| | |
| | | this.segs = []; |
| | | this.selected_pts = []; |
| | | this.first_seg = null; |
| | | |
| | | |
| | | // Set up segs array |
| | | for(var i=0; i < len; i++) { |
| | | var item = segList.getItem(i); |
| | | var segment = new svgedit.path.Segment(i, item); |
| | | segment.path = this; |
| | | this.segs.push(segment); |
| | | } |
| | | |
| | | } |
| | | |
| | | var segs = this.segs; |
| | | var start_i = null; |
| | | |
| | | for(var i=0; i < len; i++) { |
| | | var seg = segs[i]; |
| | | var seg = segs[i]; |
| | | var next_seg = (i+1) >= len ? null : segs[i+1]; |
| | | var prev_seg = (i-1) < 0 ? null : segs[i-1]; |
| | | |
| | | |
| | | if(seg.type === 2) { |
| | | if(prev_seg && prev_seg.type !== 1) { |
| | | // New sub-path, last one is open, |
| | |
| | | // This is the last real segment of a closed sub-path |
| | | // Next is first seg after "M" |
| | | seg.next = segs[start_i+1]; |
| | | |
| | | |
| | | // First seg after "M"'s prev is this |
| | | seg.next.prev = seg; |
| | | seg.mate = segs[start_i]; |
| | |
| | | } else if(seg.type !== 1){ |
| | | // Regular segment, so add grip and its "next" |
| | | seg.addGrip(); |
| | | |
| | | |
| | | // Don't set its "next" if it's an "M" |
| | | if(next_seg && next_seg.type !== 2) { |
| | | seg.next = next_seg; |
| | |
| | | svgedit.path.Path.prototype.deleteSeg = function(index) { |
| | | var seg = this.segs[index]; |
| | | var list = this.elem.pathSegList; |
| | | |
| | | |
| | | seg.show(false); |
| | | var next = seg.next; |
| | | if(seg.mate) { |
| | | // Make the next point be the "M" point |
| | | var pt = [next.item.x, next.item.y]; |
| | | svgedit.path.replacePathSeg(2, next.index, pt); |
| | | |
| | | |
| | | // Reposition last node |
| | | svgedit.path.replacePathSeg(4, seg.index, pt); |
| | | |
| | | |
| | | list.removeItem(seg.mate.index); |
| | | } else if(!seg.prev) { |
| | | // First node of open path, make next point the M |
| | |
| | | var pt = [next.item.x, next.item.y]; |
| | | svgedit.path.replacePathSeg(2, seg.next.index, pt); |
| | | list.removeItem(index); |
| | | |
| | | |
| | | } else { |
| | | list.removeItem(index); |
| | | } |
| | |
| | | return false; |
| | | } |
| | | }); |
| | | |
| | | |
| | | return closed; |
| | | }; |
| | | |
| | |
| | | var pos = this.selected_pts.indexOf(index); |
| | | if(pos == -1) { |
| | | return; |
| | | } |
| | | } |
| | | this.segs[index].select(false); |
| | | this.selected_pts.splice(pos, 1); |
| | | }; |
| | |
| | | return this; |
| | | }; |
| | | |
| | | // Move selected points |
| | | // Move selected points |
| | | svgedit.path.Path.prototype.movePts = function(d_x, d_y) { |
| | | var i = this.selected_pts.length; |
| | | while(i--) { |
| | |
| | | var text; |
| | | while(i--) { |
| | | var sel_pt = this.selected_pts[i]; |
| | | |
| | | |
| | | // Selected seg |
| | | var cur = this.segs[sel_pt]; |
| | | var prev = cur.prev; |
| | | if(!prev) continue; |
| | | |
| | | |
| | | if(!new_type) { // double-click, so just toggle |
| | | text = "Toggle Path Segment Type"; |
| | | |
| | | // Toggle segment to curve/straight line |
| | | var old_type = cur.type; |
| | | |
| | | |
| | | new_type = (old_type == 6) ? 4 : 6; |
| | | } |
| | | |
| | | } |
| | | |
| | | new_type = new_type-0; |
| | | |
| | | |
| | | var cur_x = cur.item.x; |
| | | var cur_y = cur.item.y; |
| | | var prev_x = prev.item.x; |
| | |
| | | break; |
| | | case 4: |
| | | points = [cur_x,cur_y]; |
| | | |
| | | |
| | | // Store original prevve segment nums |
| | | cur.olditem = cur.item; |
| | | break; |
| | | } |
| | | |
| | | |
| | | cur.setType(new_type, points); |
| | | } |
| | | svgedit.path.path.endChanges(text); |
| | |
| | | this.addPtsToSelection(pt); |
| | | if(ctrl_num) { |
| | | this.dragctrl = ctrl_num; |
| | | |
| | | |
| | | if(link_control_pts) { |
| | | this.segs[pt].setLinked(ctrl_num); |
| | | } |
| | |
| | | var getRotVals = function(x, y, oldcx, oldcy, newcx, newcy, angle) { |
| | | dx = x - oldcx; |
| | | dy = y - oldcy; |
| | | |
| | | |
| | | // rotate the point around the old center |
| | | r = Math.sqrt(dx*dx + dy*dy); |
| | | theta = Math.atan2(dy,dx) + angle; |
| | | dx = r * Math.cos(theta) + oldcx; |
| | | dy = r * Math.sin(theta) + oldcy; |
| | | |
| | | |
| | | // dx,dy should now hold the actual coordinates of each |
| | | // point after being rotated |
| | | |
| | | // now we want to rotate them around the new center in the reverse direction |
| | | dx -= newcx; |
| | | dy -= newcy; |
| | | |
| | | |
| | | r = Math.sqrt(dx*dx + dy*dy); |
| | | theta = Math.atan2(dy,dx) - angle; |
| | | return {'x':(r * Math.cos(theta) + newcx)/1, |
| | |
| | | }; |
| | | |
| | | // If the path was rotated, we must now pay the piper: |
| | | // Every path point must be rotated into the rotated coordinate system of |
| | | // Every path point must be rotated into the rotated coordinate system of |
| | | // its old center, then determine the new center, then rotate it back |
| | | // This is because we want the path to remember its rotation |
| | | |
| | |
| | | oldcy = oldbox.y + oldbox.height/2, |
| | | newcx = box.x + box.width/2, |
| | | newcy = box.y + box.height/2, |
| | | |
| | | |
| | | // un-rotate the new center to the proper position |
| | | dx = newcx - oldcx, |
| | | dy = newcy - oldcy, |
| | | r = Math.sqrt(dx*dx + dy*dy), |
| | | theta = Math.atan2(dy,dx) + angle; |
| | | |
| | | |
| | | newcx = r * Math.cos(theta) + oldcx; |
| | | newcy = r * Math.sin(theta) + oldcy; |
| | | |
| | | |
| | | var list = current_path.pathSegList, |
| | | i = list.numberOfItems; |
| | | while (i) { |
| | |
| | | var seg = list.getItem(i), |
| | | type = seg.pathSegType; |
| | | if(type == 1) continue; |
| | | |
| | | |
| | | var rvals = getRotVals(seg.x,seg.y, oldcx, oldcy, newcx, newcy, angle), |
| | | points = [rvals.x, rvals.y]; |
| | | if(seg.x1 != null && seg.x2 != null) { |
| | |
| | | svgedit.path.replacePathSeg(type, i, points); |
| | | } // loop for each point |
| | | |
| | | box = svgedit.utilities.getBBox(current_path); |
| | | box = svgedit.utilities.getBBox(current_path); |
| | | // selectedBBoxes[0].x = box.x; selectedBBoxes[0].y = box.y; |
| | | // selectedBBoxes[0].width = box.width; selectedBBoxes[0].height = box.height; |
| | | |
| | | |
| | | // now we must set the new transform to be rotated around the new center |
| | | var R_nc = svgroot.createSVGTransform(), |
| | | tlist = svgedit.transformlist.getTransformList(current_path); |
| | |
| | | "title": [], |
| | | "tspan": ["class", "clip-path", "clip-rule", "dx", "dy", "fill", "fill-opacity", "fill-rule", "filter", "font-family", "font-size", "font-style", "font-weight", "id", "mask", "opacity", "requiredFeatures", "rotate", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "style", "systemLanguage", "text-anchor", "textLength", "transform", "x", "xml:space", "y"], |
| | | "use": ["class", "clip-path", "clip-rule", "fill", "fill-opacity", "fill-rule", "filter", "height", "id", "mask", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "style", "transform", "width", "x", "xlink:href", "y"], |
| | | |
| | | |
| | | // MathML Elements |
| | | "annotation": ["encoding"], |
| | | "annotation-xml": ["encoding"], |
| | |
| | | var parent = node.parentNode; |
| | | // can parent ever be null here? I think the root node's parent is the document... |
| | | if (!doc || !parent) return; |
| | | |
| | | |
| | | var allowedAttrs = svgWhiteList_[node.nodeName]; |
| | | var allowedAttrsNS = svgWhiteListNS_[node.nodeName]; |
| | | |
| | |
| | | if (allowedAttrs != undefined) { |
| | | |
| | | var se_attrs = []; |
| | | |
| | | |
| | | var i = node.attributes.length; |
| | | while (i--) { |
| | | // if the attribute is not in our whitelist, then remove it |
| | |
| | | var attrName = attr.nodeName; |
| | | var attrLocalName = attr.localName; |
| | | var attrNsURI = attr.namespaceURI; |
| | | // Check that an attribute with the correct localName in the correct namespace is on |
| | | // Check that an attribute with the correct localName in the correct namespace is on |
| | | // our whitelist or is a namespace declaration for one of our allowed namespaces |
| | | if (!(allowedAttrsNS.hasOwnProperty(attrLocalName) && attrNsURI == allowedAttrsNS[attrLocalName] && attrNsURI != xmlnsns) && |
| | | !(attrNsURI == xmlnsns && nsMap_[attr.nodeValue]) ) |
| | | !(attrNsURI == xmlnsns && nsMap_[attr.nodeValue]) ) |
| | | { |
| | | // TODO(codedread): Programmatically add the se: attributes to the NS-aware whitelist. |
| | | // Bypassing the whitelist to allow se: prefixes. Is there |
| | | // a more appropriate way to do this? |
| | | if(attrName.indexOf('se:') == 0) { |
| | | se_attrs.push([attrName, attr.nodeValue]); |
| | | } |
| | | } |
| | | node.removeAttributeNS(attrNsURI, attrLocalName); |
| | | } |
| | | |
| | | |
| | | // Add spaces before negative signs where necessary |
| | | if(svgedit.browser.isGecko()) { |
| | | switch ( attrName ) { |
| | |
| | | node.setAttribute(attrName, val); |
| | | } |
| | | } |
| | | |
| | | |
| | | // for the style attribute, rewrite it in terms of XML presentational attributes |
| | | if (attrName == "style") { |
| | | var props = attr.nodeValue.split(";"), |
| | |
| | | node.removeAttribute('style'); |
| | | } |
| | | } |
| | | |
| | | |
| | | $.each(se_attrs, function(i, attr) { |
| | | node.setAttributeNS(se_ns, attr[0], attr[1]); |
| | | }); |
| | | |
| | | |
| | | // for some elements that have a xlink:href, ensure the URI refers to a local element |
| | | // (but not for links) |
| | | var href = svgedit.utilities.getHref(node); |
| | | if(href && |
| | | if(href && |
| | | ["filter", "linearGradient", "pattern", |
| | | "radialGradient", "textPath", "use"].indexOf(node.nodeName) >= 0) |
| | | { |
| | |
| | | node.removeAttributeNS(xlinkns, "href"); |
| | | } |
| | | } |
| | | |
| | | |
| | | // Safari crashes on a <use> without a xlink:href, so we just remove the node here |
| | | if (node.nodeName == "use" && !svgedit.utilities.getHref(node)) { |
| | | parent.removeChild(node); |
| | | return; |
| | | } |
| | | // if the element has attributes pointing to a non-local reference, |
| | | // if the element has attributes pointing to a non-local reference, |
| | | // need to remove the attribute |
| | | $.each(["clip-path", "fill", "filter", "marker-end", "marker-mid", "marker-start", "mask", "stroke"],function(i,attr) { |
| | | var val = node.getAttribute(attr); |
| | |
| | | } |
| | | } |
| | | }); |
| | | |
| | | |
| | | // recurse to children |
| | | i = node.childNodes.length; |
| | | while (i--) { svgedit.sanitize.sanitizeSvg(node.childNodes.item(i)); } |
| | |
| | | |
| | | // Class: svgedit.select.Selector |
| | | // Private class for DOM element selection boxes |
| | | // |
| | | // |
| | | // Parameters: |
| | | // id - integer to internally indentify the selector |
| | | // elem - DOM element associated with this selector |
| | |
| | | } |
| | | }) |
| | | ); |
| | | |
| | | |
| | | if (svgedit.browser.isTouch()) { |
| | | this.selectorRect.setAttribute("stroke-opacity", 0.3); |
| | | } |
| | |
| | | }; |
| | | |
| | | |
| | | // Function: svgedit.select.Selector.reset |
| | | // Function: svgedit.select.Selector.reset |
| | | // Used to reset the id and element that the selector is attached to |
| | | // |
| | | // Parameters: |
| | | // Parameters: |
| | | // e - DOM element associated with this selector |
| | | svgedit.select.Selector.prototype.reset = function(e) { |
| | | this.locked = true; |
| | |
| | | var bbox = svgedit.utilities.getBBox(selected); |
| | | if(tagName === 'g' && !$.data(selected, 'gsvg')) { |
| | | // The bbox for a group does not include stroke vals, so we |
| | | // get the bbox based on its children. |
| | | // get the bbox based on its children. |
| | | var stroked_bbox = svgFactory_.getStrokedBBox(selected.childNodes); |
| | | if(stroked_bbox) { |
| | | bbox = stroked_bbox; |
| | |
| | | |
| | | // we need to handle temporary transforms too |
| | | // if skewed, get its transformed box, then find its axis-aligned bbox |
| | | |
| | | |
| | | //* |
| | | offset *= current_zoom; |
| | | |
| | | |
| | | var nbox = svgedit.math.transformBox(l*current_zoom, t*current_zoom, w*current_zoom, h*current_zoom, m), |
| | | aabox = nbox.aabox, |
| | | nbax = aabox.x - offset, |
| | | nbay = aabox.y - offset, |
| | | nbaw = aabox.width + (offset * 2), |
| | | nbah = aabox.height + (offset * 2); |
| | | |
| | | |
| | | // now if the shape is rotated, un-rotate it |
| | | var cx = nbax + nbaw/2, |
| | | cy = nbay + nbah/2; |
| | |
| | | + ' ' + (nbax+nbaw) + ',' + (nbay+nbah) |
| | | + ' ' + nbax + ',' + (nbay+nbah) + 'z'; |
| | | selectedBox.setAttribute('d', dstr); |
| | | |
| | | |
| | | var xform = angle ? 'rotate(' + [angle,cx,cy].join(',') + ')' : ''; |
| | | this.selectorGroup.setAttribute('transform', xform); |
| | | |
| | |
| | | selectedGrips[dir].setAttribute('x', coords[0]); |
| | | selectedGrips[dir].setAttribute('y', coords[1]); |
| | | }; |
| | | |
| | | |
| | | this.rotateCoords = { |
| | | 'nw': [nbax, nbay], |
| | | 'ne': [nbax+nbaw+8, nbay], |
| | | 'sw': [nbax, nbay+nbah+8], |
| | | 'se': [nbax+nbaw+8, nbay+nbah+8] |
| | | }; |
| | | |
| | | |
| | | for(var dir in this.rotateCoords) { |
| | | var coords = this.rotateCoords[dir]; |
| | | mgr.rotateGrips[dir].setAttribute('cx', coords[0]); |
| | | mgr.rotateGrips[dir].setAttribute('cx', coords[0]); |
| | | mgr.rotateGrips[dir].setAttribute('cy', coords[1]); |
| | | } |
| | | |
| | |
| | | } |
| | | }); |
| | | if (svgedit.browser.isTouch()) { |
| | | |
| | | |
| | | grip.setAttribute("width", 30.5) |
| | | grip.setAttribute("height", 30.5) |
| | | grip.setAttribute("fill-opacity", 0.3) |
| | | } |
| | | |
| | | |
| | | $.data(grip, 'dir', dir); |
| | | $.data(grip, 'type', 'resize'); |
| | | this.selectorGrips[dir] = this.selectorGripsGroup.appendChild(grip); |
| | |
| | | 'id': 'placeholder_defs' |
| | | } |
| | | }) |
| | | |
| | | |
| | | var pattern = svgFactory_.createSVGElement({ |
| | | 'element': 'pattern', |
| | | 'attr': { |
| | |
| | | 'viewBox': '0 0 10 10' |
| | | } |
| | | }) |
| | | |
| | | |
| | | var pattern_bg = svgFactory_.createSVGElement({ |
| | | 'element': 'rect', |
| | | 'attr': { |
| | |
| | | 'fill': "#eee" |
| | | } |
| | | }) |
| | | |
| | | |
| | | var pattern_square2 = svgFactory_.createSVGElement({ |
| | | 'element': 'rect', |
| | | 'attr': { |
| | |
| | | }; |
| | | |
| | | // Function: svgedit.select.SelectorManager.releaseSelector |
| | | // Removes the selector of the given element (hides selection box) |
| | | // Removes the selector of the given element (hides selection box) |
| | | // |
| | | // Parameters: |
| | | // elem - DOM element to remove the selector for |
| | |
| | | 'fill': 'none', |
| | | 'stroke': '#666', |
| | | 'stroke-width': 1, |
| | | 'stroke-dasharray': '3,2', |
| | | 'stroke-dasharray': '3,2', |
| | | 'display': 'none', |
| | | 'style': 'pointer-events:none' |
| | | } |
| | |
| | | return selectorManager_; |
| | | }; |
| | | |
| | | })(); |
| | | })(); |
| | |
| | | var curConfig = { |
| | | show_outside_canvas: true, |
| | | selectNew: true, |
| | | dimensions: [640, 480] |
| | | dimensions: [200, 200] |
| | | }; |
| | | |
| | | // Update config with new one if given |
| | |
| | | |
| | | |
| | | // ************************************************************************************** |
| | | // SVGTransformList implementation for Webkit |
| | | // SVGTransformList implementation for Webkit |
| | | // These methods do not currently raise any exceptions. |
| | | // These methods also do not check that transforms are being inserted. This is basically |
| | | // implementing as much of SVGTransformList that we need to get the job done. |
| | | // |
| | | // interface SVGEditTransformList { |
| | | // interface SVGEditTransformList { |
| | | // attribute unsigned long numberOfItems; |
| | | // void clear ( ) |
| | | // SVGTransform initialize ( in SVGTransform newItem ) |
| | |
| | | // Transform attribute parser |
| | | var str = this._elem.getAttribute("transform"); |
| | | if(!str) return; |
| | | |
| | | |
| | | // TODO: Add skew support in future |
| | | var re = /\s*((scale|matrix|rotate|translate)\s*\(.*?\))\s*,?\s*/; |
| | | var arr = []; |
| | |
| | | var xform = svgroot.createSVGTransform(); |
| | | var fname = 'set' + name.charAt(0).toUpperCase() + name.slice(1); |
| | | var values = name=='matrix'?[mtx]:val_arr; |
| | | |
| | | |
| | | if (name == 'scale' && values.length == 1) { |
| | | values.push(values[0]); |
| | | } else if (name == 'translate' && values.length == 1) { |
| | |
| | | } |
| | | } |
| | | }; |
| | | |
| | | |
| | | this.numberOfItems = 0; |
| | | this.clear = function() { |
| | | this.clear = function() { |
| | | this.numberOfItems = 0; |
| | | this._xforms = []; |
| | | }; |
| | | |
| | | |
| | | this.initialize = function(newItem) { |
| | | this.numberOfItems = 1; |
| | | this._removeFromOtherLists(newItem); |
| | | this._xforms = [newItem]; |
| | | }; |
| | | |
| | | |
| | | this.getItem = function(index) { |
| | | if (index < this.numberOfItems && index >= 0) { |
| | | return this._xforms[index]; |
| | | } |
| | | throw {code: 1}; // DOMException with code=INDEX_SIZE_ERR |
| | | }; |
| | | |
| | | |
| | | this.insertItemBefore = function(newItem, index) { |
| | | var retValue = null; |
| | | if (index >= 0) { |
| | |
| | | } |
| | | return retValue; |
| | | }; |
| | | |
| | | |
| | | this.replaceItem = function(newItem, index) { |
| | | var retValue = null; |
| | | if (index < this.numberOfItems && index >= 0) { |
| | |
| | | } |
| | | return retValue; |
| | | }; |
| | | |
| | | |
| | | this.removeItem = function(index) { |
| | | if (index < this.numberOfItems && index >= 0) { |
| | | var retValue = this._xforms[index]; |
| | |
| | | throw {code: 1}; // DOMException with code=INDEX_SIZE_ERR |
| | | } |
| | | }; |
| | | |
| | | |
| | | this.appendItem = function(newItem) { |
| | | this._removeFromOtherLists(newItem); |
| | | this._xforms.push(newItem); |
| | |
| | | }; |
| | | |
| | | |
| | | })(); |
| | | })(); |
| | |
| | | // Function: svgedit.units.shortFloat |
| | | // Rounds a given value to a float with number of digits defined in save_options |
| | | // |
| | | // Parameters: |
| | | // Parameters: |
| | | // val - The value as a String, Number or Array of two numbers to be rounded |
| | | // |
| | | // Returns: |
| | |
| | | // Function: svgedit.units.setUnitAttr |
| | | // Sets an element's attribute based on the unit in its current value. |
| | | // |
| | | // Parameters: |
| | | // Parameters: |
| | | // elem - DOM element to be changed |
| | | // attr - String with the name of the attribute associated with the value |
| | | // val - String with the attribute value to convert |
| | |
| | | if(!isNaN(val)) { |
| | | // New value is a number, so check currently used unit |
| | | var old_val = elem.getAttribute(attr); |
| | | |
| | | |
| | | // Enable this for alternate mode |
| | | // if(old_val !== null && (isNaN(old_val) || elementContainer_.getBaseUnit() !== 'px')) { |
| | | // // Old value was a number, so get unit, then convert |
| | |
| | | // } |
| | | // val = val / typeMap_[unit]; |
| | | // } |
| | | // |
| | | // |
| | | // val += unit; |
| | | // } |
| | | } |
| | |
| | | }; |
| | | |
| | | // Function: svgedit.units.convertToNum |
| | | // Converts given values to numbers. Attributes must be supplied in |
| | | // Converts given values to numbers. Attributes must be supplied in |
| | | // case a percentage is given |
| | | // |
| | | // Parameters: |
| | |
| | | svgedit.units.convertToNum = function(attr, val) { |
| | | // Return a number if that's what it already is |
| | | if(!isNaN(val)) return val-0; |
| | | |
| | | |
| | | if(val.substr(-1) === '%') { |
| | | // Deal with percentage, depends on attribute |
| | | var num = val.substr(0, val.length-1)/100; |
| | | var width = elementContainer_.getWidth(); |
| | | var height = elementContainer_.getHeight(); |
| | | |
| | | |
| | | if(w_attrs.indexOf(attr) >= 0) { |
| | | return num * width; |
| | | } else if(h_attrs.indexOf(attr) >= 0) { |
| | |
| | | // Function: svgedit.units.isValidUnit |
| | | // Check if an attribute's value is in a valid format |
| | | // |
| | | // Parameters: |
| | | // Parameters: |
| | | // attr - String with the name of the attribute associated with the value |
| | | // val - String with the attribute value to check |
| | | svgedit.units.isValidUnit = function(attr, val, selectedElement) { |
| | |
| | | } else { |
| | | valid = true; |
| | | } |
| | | |
| | | |
| | | return valid; |
| | | }; |
| | | |
| | | |
| | | })(); |
| | | })(); |
| | |
| | | <glyph unicode="™" horiz-adv-x="3623" d="M1577 0v172h144v1153h-144v191h480l481 -1309l487 1309h455v-191h-143v-1153h143v-172h-492v172h162v1164l-530 -1336h-170l-537 1339v-1167h156v-172h-492zM41 1116v400h1352v-400h-205v236h-400v-1180h156v-172h-491v172h139v1180h-346v-236h-205z" /> |
| | | <glyph unicode="" horiz-adv-x="1035" d="M0 1035h1035v-1035h-1035v1035z" /> |
| | | </font> |
| | | </defs></svg> |
| | | </defs></svg> |
| | |
| | | <glyph unicode="−" horiz-adv-x="1331" d="M102 496v137h1127v-137h-1127z" /> |
| | | <glyph unicode="" horiz-adv-x="1125" d="M0 1125h1125v-1125h-1125v1125z" /> |
| | | </font> |
| | | </defs></svg> |
| | | </defs></svg> |
| | |
| | | <glyph unicode="fi" horiz-adv-x="772" d="M20 934v186h105v31q0 45 1 69.5t7 77t22.5 84t43 67.5t72.5 53.5t108 17.5q33 0 69.5 -4.5t57.5 -8.5l20 -2v-184q-41 12 -110 12q-31 0 -50.5 -18.5t-25.5 -58t-7 -54t-1 -53.5v-29h358v-1120h-207v934h-151v-934h-207v934h-105z" /> |
| | | <glyph unicode="fl" horiz-adv-x="772" d="M20 934v186h105v31q0 45 1 69.5t7 77t22.5 84t43 67.5t72.5 53.5t108 17.5q33 0 69.5 -4.5t57.5 -8.5l20 -2h164v-1505h-207v1329q-37 4 -67.5 4t-50 -18.5t-25.5 -58t-7 -54t-1 -53.5v-29h104v-186h-104v-934h-207v934h-105z" /> |
| | | </font> |
| | | </defs></svg> |
| | | </defs></svg> |
| | |
| | | <glyph d="M71 154q0 37 11.5 66.5t32.5 49t35 28.5t34 19q5 3 9.5 4.5t6.5 2.5h2l-2 2q-3 1 -8 4t-11 7q-101 69 -101 158q0 68 49.5 115.5t120.5 47.5q67 0 112.5 -42t45.5 -108q0 -16 -2 -30t-7 -26.5t-9.5 -22.5t-13.5 -20t-14 -16.5t-15.5 -15t-14.5 -12t-15 -11t-12 -8.5 q-9 -7 -9 -8t9 -6q1 -1 17 -9.5t23 -14l22.5 -17t24 -24t19 -29.5t15 -38.5t4.5 -45.5q0 -72 -50 -116t-132 -44q-73 0 -125 45t-52 115zM124 164q0 -63 35 -102.5t93 -39.5q50 0 81.5 39t31.5 92q0 40 -19.5 70.5t-40 45t-59.5 35.5q-22 12 -27 12q-3 0 -33 -21 q-62 -46 -62 -131zM138 507q0 -64 69 -118q34 -26 54 -35l16 -7q3 0 14 10q26 23 49 65t23 78q0 64 -32 100t-83 36q-50 0 -80 -37.5t-30 -91.5z" /> |
| | | <glyph d="M60 204q0 89 55 141.5t138 52.5q87 0 143.5 -62t56.5 -174q0 -70 -26.5 -130t-68 -99.5t-88.5 -70.5t-91 -47.5t-71.5 -24.5t-34.5 -8q-4 0 -7 9t-3 16q0 2 24 9.5t62 24t79 42t80 71t59 102.5l3 7l3 10.5t0 3.5q-2 0 -20 -12q-54 -33 -125 -33q-77 0 -122.5 47.5 t-45.5 124.5zM125 214q0 -60 35 -105.5t95 -45.5q96 0 126 52q6 11 6 57q0 50 -13 92.5t-43.5 73t-74.5 30.5q-64 0 -97.5 -43.5t-33.5 -110.5z" /> |
| | | </font> |
| | | </defs></svg> |
| | | </defs></svg> |
| | |
| | | <glyph horiz-adv-x="415" d="M45 130q0 34 14.5 66t35 54.5t41.5 39.5t35.5 27t14.5 12q0 1 -10.5 10.5t-25 25t-29 35.5t-25 47t-10.5 53q0 71 48 116t124 45q62 0 99.5 -35.5t37.5 -98.5q0 -29 -13.5 -58t-32.5 -49.5t-38.5 -37t-33 -26.5t-13.5 -12q0 -1 11.5 -11.5t28 -28.5t32.5 -40t27.5 -53 t11.5 -61q0 -67 -52.5 -110t-129.5 -43q-68 0 -108 33.5t-40 99.5zM99 145q0 -55 30.5 -89t72.5 -34q48 0 81 35.5t33 82.5q0 22 -11.5 48.5t-27.5 48t-33.5 39.5t-29.5 28.5t-14 10.5q-7 0 -30 -20.5t-47 -62.5t-24 -87zM139 534q0 -36 25.5 -79.5t51 -69.5t30.5 -26 q7 0 30.5 21.5t46.5 62.5t23 82q0 48 -28 80.5t-74 32.5q-48 0 -76.5 -32t-28.5 -72z" /> |
| | | <glyph horiz-adv-x="437" d="M-6 -185q0 2 32 13q114 40 235 186q20 23 20 32q-2 1 -5 0.5t-12 -4t-12 -4.5q-41 -13 -74 -13q-62 0 -100 45.5t-38 121.5q0 89 62 145.5t146 56.5q70 0 109.5 -52.5t39.5 -138.5q0 -77 -39 -150.5t-101 -125.5q-49 -41 -111.5 -74t-99 -45.5t-43.5 -12.5q-9 0 -9 20z M99 173q0 -55 26.5 -88t79.5 -33q44 0 74 13q25 11 42.5 64t17.5 111q0 61 -25.5 94.5t-66.5 33.5q-66 0 -107 -60.5t-41 -134.5z" /> |
| | | </font> |
| | | </defs></svg> |
| | | </defs></svg> |
| | |
| | | </head> |
| | | <body> |
| | | <h2>@font-face in SVG</h2> |
| | | |
| | | |
| | | <p style="width: 500px"><strong>Problem:</strong> I'm trying trying to place an images in svg format with custom fonts. It works in <code>svg</code> but not in <code>img</code>. If you open the image in a new tab you will see it rendered with the proper font. The font is served from this same website in this directory.</p> |
| | | |
| | | |
| | | <a href="test_ff.svg">Link to the test.svg</a> |
| | | |
| | | |
| | | <table> |
| | | <tr><td> |
| | | <svg width="500" height="200" version="1.1" xmlns = 'http://www.w3.org/2000/svg' xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 500 200"> |
| | | <svg width="500" height="200" version="1.1" xmlns = 'http://www.w3.org/2000/svg' xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 500 200"> |
| | | <defs> |
| | | <style type="text/css"> |
| | | @font-face { |
| | |
| | | </td> |
| | | <td> |
| | | <pre> |
| | | <svg width="500" height="200" version="1.1" xmlns = 'http://www.w3.org/2000/svg' xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 500 200"> |
| | | <svg width="500" height="200" version="1.1" xmlns = 'http://www.w3.org/2000/svg' xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 500 200"> |
| | | <defs> |
| | | <style type="text/css"> |
| | | @font-face { |
| | |
| | | </pre> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | |
| | | |
| | | </table> |
| | | |
| | | |
| | | </body> |
| | | </html> |
| | |
| | | |
| | | <svg width="300" height="300" version="1.1" xmlns = 'http://www.w3.org/2000/svg' viewBox="0 0 300 300"> |
| | | <svg width="300" height="300" version="1.1" xmlns = 'http://www.w3.org/2000/svg' viewBox="0 0 300 300"> |
| | | <defs> |
| | | <style type="text/css"> |
| | | @font-face { |
| | |
| | | </defs> |
| | | <rect x="0" y="0" height="300" width="300" fill="#eee" /> |
| | | <text x="100" y="100" font-family="Arvo" font-weight="normal" font-size="32">Text using CSS @font-face</text> |
| | | </svg> |
| | | </svg> |
| | |
| | | |
| | | |
| | | <svg width="500" height="200" version="1.1" xmlns = 'http://www.w3.org/2000/svg' xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 500 200"> |
| | | <svg width="500" height="200" version="1.1" xmlns = 'http://www.w3.org/2000/svg' xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 500 200"> |
| | | <defs> |
| | | <style type="text/css"> |
| | | @font-face { |
| | |
| | | </defs> |
| | | <rect x="0" y="0" height="100" width="500" fill="#eee" /> |
| | | <text x="20" y="50" font-family="Arvo" font-weight="normal" font-size="32">Text using CSS @font-face</text> |
| | | </svg> |
| | | </svg> |
| | |
| | | <svg width="500" height="200" version="1.1" xmlns = 'http://www.w3.org/2000/svg' xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 500 200"> |
| | | <svg width="500" height="200" version="1.1" xmlns = 'http://www.w3.org/2000/svg' xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 500 200"> |
| | | <defs> |
| | | <font-face font-family="Arvo"> |
| | | <font-face-src> |
| | |
| | | </defs> |
| | | <rect x="0" y="0" height="100" width="500" fill="#eee" /> |
| | | <text x="20" y="50" font-family="Arvo" font-weight="normal" font-size="32">Text using CSS @font-face</text> |
| | | </svg> |
| | | </svg> |
| | |
| | | src: url('font-files/fanwood_italic-webfont.woff') format('woff'); |
| | | font-weight: normal; |
| | | font-style: italic; |
| | | } |
| | | } |
| | |
| | | #stroke_style_label{font-size:30px;margin-top:33px;letter-spacing:-1px} |
| | | .stroke_tool .caret{top:60%} |
| | | #tool_align_relative{position:absolute;top:-5px;left:0;right:20px;display:block} |
| | | #tool_align_relative select{width:100%;display:block} |
| | | #tool_align_relative select{width:100%;display:block} |
| | |
| | | vertical-align: top; |
| | | } |
| | | |
| | | .touch .menu_title { |
| | | .touch .menu_title { |
| | | padding: 7px 17px; |
| | | height: 26px; |
| | | line-height: 26px; |
| | |
| | | |
| | | .menu_list .menu_item.push_button_pressed { |
| | | background: transparent; |
| | | border: none; |
| | | border: none; |
| | | width: auto; |
| | | height: auto; |
| | | margin: 0; |
| | |
| | | margin-top: -16px; |
| | | } |
| | | |
| | | #ruler_x > div, |
| | | #ruler_x > div, |
| | | #ruler_y > div { |
| | | overflow: hidden; |
| | | } |
| | |
| | | |
| | | .touch #tool_switch { |
| | | display: none; |
| | | } |
| | | } |
| | | |
| | | #use_panel .tool_button, #path_node_panel .tool_button { |
| | | color: #999; |
| | | border: solid #3F3F3C 1px; |
| | | border-radius: 3px; |
| | | padding: 3px 10px 3px 40px; |
| | | background: |
| | | background: |
| | | transparent; |
| | | position: relative; |
| | | margin-top: 10px; |
| | |
| | | position: absolute; |
| | | top: 10px; |
| | | width: 14px; |
| | | |
| | | |
| | | } |
| | | |
| | | #color_tools #tool_switch { |
| | |
| | | position: absolute; |
| | | } |
| | | |
| | | .tool_button, |
| | | .tool_button, |
| | | .tool_button_current, |
| | | .tool_button_pressed { |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .tool_button:hover, |
| | | .tool_button:hover, |
| | | .push_button:hover, |
| | | .buttonup:hover, |
| | | .buttondown, |
| | |
| | | color: #999; |
| | | } |
| | | |
| | | div#font-selector { |
| | | width:140px; |
| | | height:300px; |
| | | overflow:auto; |
| | | margin:0 auto; |
| | | position:absolute; |
| | | div#font-selector { |
| | | width:140px; |
| | | height:300px; |
| | | overflow:auto; |
| | | margin:0 auto; |
| | | position:absolute; |
| | | top:27px; |
| | | right:0; |
| | | border:1px solid black; |
| | | padding:10px; |
| | | display:none; |
| | | border:1px solid black; |
| | | padding:10px; |
| | | display:none; |
| | | background-color:white; |
| | | z-index: 10; |
| | | border-radius: 3px; |
| | |
| | | right: 50%; |
| | | border: solid transparent 5px; |
| | | border-bottom-color: #fff; |
| | | |
| | | |
| | | } |
| | | |
| | | .dropdown li.special.down:after { |
| | |
| | | top: auto; |
| | | border: solid transparent 5px; |
| | | border-top-color: #fff; |
| | | |
| | | |
| | | } |
| | | |
| | | .tool_button, |
| | | .tool_button, |
| | | .push_button, |
| | | .tool_button_current, |
| | | .push_button_pressed |
| | | .push_button_pressed |
| | | { |
| | | height: 27px; |
| | | width: 27px; |
| | |
| | | overflow: hidden; |
| | | } |
| | | |
| | | #tool_open input, |
| | | #tool_open input, |
| | | #tool_import input, |
| | | #tool_import_bitmap input { |
| | | position: absolute; |
| | |
| | | left: -9999px; |
| | | } |
| | | |
| | | #tool_bold span, #tool_italic span { |
| | | #tool_bold span, #tool_italic span { |
| | | position: absolute; |
| | | width: 100%; |
| | | height: 100%; |
| | |
| | | margin: 5px; |
| | | border-radius: 0px; |
| | | -moz-border-radius: 0px; |
| | | -webkit-border-radius: 0px; |
| | | -webkit-border-radius: 0px; |
| | | border-width: 0; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | .contextMenu .shortcut { |
| | | width: 115px; |
| | | width: 115px; |
| | | text-align:right; |
| | | float:right; |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | #tool_bold, #tool_italic { |
| | | #tool_bold, #tool_italic { |
| | | font: bold 20px/35px serif; |
| | | text-align: center; |
| | | position: absolute; |
| | |
| | | } |
| | | |
| | | |
| | | .draginput input, .draginput input:hover, .draginput input:active { |
| | | .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 { |
| | | .draginput input[type="checkbox"], .draginput input[type="checkbox"]:hover, .draginput input[type="checkbox"]:active { |
| | | cursor: pointer; |
| | | } |
| | | |
| | |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .draginput.active input, .draginput.active input:hover, .draginput.active input:active { |
| | | .draginput.active input, .draginput.active input:hover, .draginput.active input:active { |
| | | cursor: url(../images/dragging.png), move; |
| | | cursor: -webkit-grabbing; |
| | | cursor: -moz-grabbing; |
| | |
| | | margin: 0; |
| | | z-index: 1; |
| | | top: 0; |
| | | left: 0; |
| | | left: 0; |
| | | } |
| | | |
| | | |
| | |
| | | #tool_align_relative select { |
| | | width: 100%; |
| | | display: block; |
| | | } |
| | | } |
| | |
| | | function init_embed() { |
| | | var frame = document.getElementById('svgedit'); |
| | | svgCanvas = new embedded_svg_edit(frame); |
| | | |
| | | |
| | | // Hide main button, as we will be controlling new/load/save etc from the host document |
| | | var doc; |
| | | doc = frame.contentDocument; |
| | |
| | | { |
| | | doc = frame.contentWindow.document; |
| | | } |
| | | |
| | | |
| | | var mainButton = doc.getElementById('main_button'); |
| | | mainButton.style.display = 'none'; |
| | | mainButton.style.display = 'none'; |
| | | } |
| | | |
| | | |
| | | function handleSvgData(data, error) { |
| | | if (error) |
| | | { |
| | |
| | | else |
| | | { |
| | | alert('Congratulations. Your SVG string is back in the host page, do with it what you will\n\n' + data); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | function loadSvg() { |
| | | var svgexample = '<svg width="640" height="480" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"><g><title>Layer 1</title><rect stroke-width="5" stroke="#000000" fill="#FF0000" id="svg_1" height="35" width="51" y="35" x="32"/><ellipse ry="15" rx="24" stroke-width="5" stroke="#000000" fill="#0000ff" id="svg_2" cy="60" cx="66"/></g></svg>'; |
| | | svgCanvas.setSvgString(svgexample); |
| | | } |
| | | |
| | | function saveSvg() { |
| | | |
| | | function saveSvg() { |
| | | svgCanvas.getSvgString()(handleSvgData); |
| | | } |
| | | </script> |
| | |
| | | <button onclick="saveSvg();">Save data</button> |
| | | <br/> |
| | | |
| | | <iframe src="index.html" width="900px" height="600px" id="svgedit" onload="init_embed()"></iframe> |
| | | <iframe src="index.html" width="900px" height="600px" id="svgedit" onload="init_embed()"></iframe> |
| | | </body> |
| | | </html> |
| | |
| | | </g> |
| | | |
| | | <g id="svg_eof"/> |
| | | </svg> |
| | | </svg> |
| | |
| | | * |
| | | */ |
| | | |
| | | |
| | | |
| | | methodDraw.addExtension("Arrows", function(S) { |
| | | var svgcontent = S.svgcontent, |
| | | addElem = S.addSvgElementFromJson, |
| | |
| | | |
| | | svgCanvas.bind('setnonce', setArrowNonce); |
| | | svgCanvas.bind('unsetnonce', unsetArrowNonce); |
| | | |
| | | |
| | | var lang_list = { |
| | | "en":[ |
| | | {"id": "arrow_none", "textContent": "No arrow" } |
| | |
| | | {"id": "arrow_none", "textContent": "Sans flèche" } |
| | | ] |
| | | }; |
| | | |
| | | |
| | | var prefix = 'se_arrow_'; |
| | | if (randomize_ids) { |
| | | var arrowprefix = prefix + nonce + '_'; |
| | |
| | | fw: {d:"m0,0l10,5l-10,5l5,-5l-5,-5z", refx:8, id: arrowprefix + 'fw'}, |
| | | bk: {d:"m10,0l-10,5l10,5l-5,-5l5,-5z", refx:2, id: arrowprefix + 'bk'} |
| | | } |
| | | |
| | | |
| | | function setArrowNonce(window, n) { |
| | | randomize_ids = true; |
| | | arrowprefix = prefix + n + '_'; |
| | |
| | | } |
| | | return S.getElem(m[1]); |
| | | } |
| | | |
| | | |
| | | function showPanel(on) { |
| | | $('#arrow_panel').toggle(on); |
| | | |
| | | |
| | | if(on) { |
| | | var el = selElems[0]; |
| | | var end = el.getAttribute("marker-end"); |
| | | var start = el.getAttribute("marker-start"); |
| | | var mid = el.getAttribute("marker-mid"); |
| | | var val; |
| | | |
| | | |
| | | if(end && start) { |
| | | val = "both"; |
| | | } else if(end) { |
| | |
| | | val = "mid_bk"; |
| | | } |
| | | } |
| | | |
| | | |
| | | if(!start && !mid && !end) { |
| | | val = "none"; |
| | | } |
| | | |
| | | |
| | | $("#arrow_list").val(val); |
| | | } |
| | | } |
| | | |
| | | |
| | | function resetMarker() { |
| | | var el = selElems[0]; |
| | | el.removeAttribute("marker-start"); |
| | | el.removeAttribute("marker-mid"); |
| | | el.removeAttribute("marker-end"); |
| | | } |
| | | |
| | | |
| | | function addMarker(dir, type, id) { |
| | | // TODO: Make marker (or use?) per arrow type, since refX can be different |
| | | id = id || arrowprefix + dir; |
| | | |
| | | |
| | | var marker = S.getElem(id); |
| | | |
| | | var data = pathdata[dir]; |
| | | |
| | | |
| | | if(type == "mid") { |
| | | data.refx = 5; |
| | | } |
| | |
| | | }); |
| | | marker.appendChild(arrow); |
| | | S.findDefs().appendChild(marker); |
| | | } |
| | | |
| | | } |
| | | |
| | | marker.setAttribute('refX', data.refx); |
| | | |
| | | |
| | | return marker; |
| | | } |
| | | |
| | | |
| | | function setArrow() { |
| | | var type = this.value; |
| | | resetMarker(); |
| | | |
| | | |
| | | if(type == "none") { |
| | | return; |
| | | } |
| | | |
| | | |
| | | // Set marker on element |
| | | var dir = "fw"; |
| | | if(type == "mid_bk") { |
| | |
| | | } else if (type == "start") { |
| | | dir = "bk"; |
| | | } |
| | | |
| | | |
| | | addMarker(dir, type); |
| | | svgCanvas.changeSelectedAttribute("marker-"+type, "url(#" + pathdata[dir].id + ")"); |
| | | S.call("changed", selElems); |
| | | } |
| | | |
| | | |
| | | function colorChanged(elem) { |
| | | var color = elem.getAttribute('stroke'); |
| | | |
| | | |
| | | var mtypes = ['start','mid','end']; |
| | | var defs = S.findDefs(); |
| | | |
| | | |
| | | $.each(mtypes, function(i, type) { |
| | | var marker = getLinked(elem, 'marker-'+type); |
| | | if(!marker) return; |
| | | |
| | | |
| | | var cur_color = $(marker).children().attr('fill'); |
| | | var cur_d = $(marker).children().attr('d'); |
| | | var new_marker = null; |
| | | if(cur_color === color) return; |
| | | |
| | | |
| | | var all_markers = $(defs).find('marker'); |
| | | // Different color, check if already made |
| | | all_markers.each(function() { |
| | |
| | | new_marker = this; |
| | | } |
| | | }); |
| | | |
| | | |
| | | if(!new_marker) { |
| | | // Create a new marker with this color |
| | | var last_id = marker.id; |
| | | var dir = last_id.indexOf('_fw') !== -1?'fw':'bk'; |
| | | |
| | | |
| | | new_marker = addMarker(dir, type, arrowprefix + dir + all_markers.length); |
| | | |
| | | $(new_marker).children().attr('fill', color); |
| | | } |
| | | |
| | | |
| | | $(elem).attr('marker-'+type, "url(#" + new_marker.id + ")"); |
| | | |
| | | |
| | | // Check if last marker can be removed |
| | | var remove = true; |
| | | $(S.svgcontent).find('line, polyline, path, polygon').each(function() { |
| | |
| | | }); |
| | | if(!remove) return false; |
| | | }); |
| | | |
| | | |
| | | // Not found, so can safely remove |
| | | if(remove) { |
| | | $(marker).remove(); |
| | | } |
| | | |
| | | }); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | return { |
| | | name: "Arrows", |
| | | context_tools: [{ |
| | |
| | | }; |
| | | }, |
| | | selectedChanged: function(opts) { |
| | | |
| | | |
| | | // Use this to update the current selected elements |
| | | selElems = opts.elems; |
| | | |
| | | |
| | | var i = selElems.length; |
| | | var marker_elems = ['line','path','polyline','polygon']; |
| | | |
| | | |
| | | while(i--) { |
| | | var elem = selElems[i]; |
| | | if(elem && $.inArray(elem.tagName, marker_elems) != -1) { |
| | |
| | | // Has marker, so see if it should match color |
| | | colorChanged(elem); |
| | | } |
| | | |
| | | |
| | | } |
| | | }; |
| | | }); |
| | |
| | | if (path) updateButton(path); |
| | | } |
| | | }, |
| | | |
| | | |
| | | toggleClosed = function() { |
| | | var path = selElems[0]; |
| | | if (path) { |
| | | var seglist = path.pathSegList, |
| | | last = seglist.numberOfItems - 1; |
| | | last = seglist.numberOfItems - 1; |
| | | // is closed |
| | | if(seglist.getItem(last).pathSegType == 1) { |
| | | seglist.removeItem(last); |
| | |
| | | updateButton(path); |
| | | } |
| | | }; |
| | | |
| | | |
| | | return { |
| | | name: "ClosePath", |
| | | svgicons: "extensions/closepath_icons.svg", |
| | |
| | | selectedChanged: function(opts) { |
| | | selElems = opts.elems; |
| | | var i = selElems.length; |
| | | |
| | | |
| | | while(i--) { |
| | | var elem = selElems[i]; |
| | | if(elem && elem.tagName == 'path') { |
| | |
| | | * Copyright(c) 2010 Alexis Deveria |
| | | * |
| | | */ |
| | | |
| | | |
| | | methodDraw.addExtension("Connector", function(S) { |
| | | var svgcontent = S.svgcontent, |
| | | svgroot = S.svgroot, |
| | |
| | | se_ns, |
| | | // connect_str = "-SE_CONNECT-", |
| | | selElems = []; |
| | | |
| | | |
| | | elData = $.data; |
| | | |
| | | |
| | | var lang_list = { |
| | | "en":[ |
| | | {"id": "mode_connect", "title": "Connect two objects" } |
| | |
| | | {"id": "mode_connect", "title": "Connecter deux objets"} |
| | | ] |
| | | }; |
| | | |
| | | |
| | | function getOffset(side, line) { |
| | | var give_offset = !!line.getAttribute('marker-' + side); |
| | | // var give_offset = $(line).data(side+'_off'); |
| | |
| | | var size = line.getAttribute('stroke-width') * 5; |
| | | return give_offset ? size : 0; |
| | | } |
| | | |
| | | |
| | | function showPanel(on) { |
| | | var conn_rules = $('#connector_rules'); |
| | | if(!conn_rules.length) { |
| | | conn_rules = $('<style id="connector_rules"><\/style>').appendTo('head'); |
| | | } |
| | | } |
| | | conn_rules.text(!on?"":"#tool_clone, #tool_topath, #tool_angle, #xy_panel { display: none !important; }"); |
| | | $('#connector_panel').toggle(on); |
| | | } |
| | | |
| | | |
| | | function setPoint(elem, pos, x, y, setMid) { |
| | | var pts = elem.points; |
| | | var pt = svgroot.createSVGPoint(); |
| | |
| | | pt_arr[i] = x + ',' + y; |
| | | } |
| | | } |
| | | elem.setAttribute("points",pt_arr.join(" ")); |
| | | elem.setAttribute("points",pt_arr.join(" ")); |
| | | } |
| | | |
| | | |
| | | if(setMid) { |
| | | // Add center point |
| | | var pt_start = pts.getItem(0); |
| | |
| | | setPoint(elem, 1, (pt_end.x + pt_start.x)/2, (pt_end.y + pt_start.y)/2); |
| | | } |
| | | } |
| | | |
| | | |
| | | function updateLine(diff_x, diff_y) { |
| | | // Update line with element |
| | | var i = connections.length; |
| | |
| | | var conn = connections[i]; |
| | | var line = conn.connector; |
| | | var elem = conn.elem; |
| | | |
| | | |
| | | var pre = conn.is_start?'start':'end'; |
| | | // var sw = line.getAttribute('stroke-width') * 5; |
| | | |
| | | |
| | | // Update bbox for this element |
| | | var bb = elData(line, pre+'_bb'); |
| | | bb.x = conn.start_x + diff_x; |
| | | bb.y = conn.start_y + diff_y; |
| | | elData(line, pre+'_bb', bb); |
| | | |
| | | |
| | | var alt_pre = conn.is_start?'end':'start'; |
| | | |
| | | |
| | | // Get center pt of connected element |
| | | var bb2 = elData(line, alt_pre+'_bb'); |
| | | var src_x = bb2.x + bb2.width/2; |
| | | var src_y = bb2.y + bb2.height/2; |
| | | |
| | | |
| | | // Set point of element being moved |
| | | var pt = getBBintersect(src_x, src_y, bb, getOffset(pre, line)); // $(line).data(pre+'_off')?sw:0 |
| | | setPoint(line, conn.is_start?0:'end', pt.x, pt.y, true); |
| | | |
| | | |
| | | // Set point of connected element |
| | | var pt2 = getBBintersect(pt.x, pt.y, elData(line, alt_pre + '_bb'), getOffset(alt_pre, line)); |
| | | setPoint(line, conn.is_start?'end':0, pt2.x, pt2.y, true); |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | function findConnectors(elems) { |
| | | if(!elems) elems = selElems; |
| | | var connectors = $(svgcontent).find(conn_sel); |
| | |
| | | connectors.each(function() { |
| | | var start = elData(this, "c_start"); |
| | | var end = elData(this, "c_end"); |
| | | |
| | | |
| | | var parts = [getElem(start), getElem(end)]; |
| | | for(var i=0; i<2; i++) { |
| | | var c_elem = parts[i]; |
| | |
| | | add_this = true; |
| | | } |
| | | }); |
| | | |
| | | |
| | | if(!c_elem || !c_elem.parentNode) { |
| | | $(this).remove(); |
| | | continue; |
| | |
| | | is_start: (i === 0), |
| | | start_x: bb.x, |
| | | start_y: bb.y |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | function updateConnectors(elems) { |
| | | // Updates connector lines based on selected elements |
| | | // Is not used on mousemove, as it runs getStrokedBBox every time, |
| | |
| | | |
| | | var sw = line.getAttribute('stroke-width') * 5; |
| | | var pre = conn.is_start?'start':'end'; |
| | | |
| | | |
| | | // Update bbox for this element |
| | | var bb = svgCanvas.getStrokedBBox([elem]); |
| | | bb.x = conn.start_x; |
| | | bb.y = conn.start_y; |
| | | elData(line, pre+'_bb', bb); |
| | | var add_offset = elData(line, pre+'_off'); |
| | | |
| | | |
| | | var alt_pre = conn.is_start?'end':'start'; |
| | | |
| | | |
| | | // Get center pt of connected element |
| | | var bb2 = elData(line, alt_pre+'_bb'); |
| | | var src_x = bb2.x + bb2.width/2; |
| | | var src_y = bb2.y + bb2.height/2; |
| | | |
| | | |
| | | // Set point of element being moved |
| | | var pt = getBBintersect(src_x, src_y, bb, getOffset(pre, line)); |
| | | setPoint(line, conn.is_start?0:'end', pt.x, pt.y, true); |
| | | |
| | | |
| | | // Set point of connected element |
| | | var pt2 = getBBintersect(pt.x, pt.y, elData(line, alt_pre + '_bb'), getOffset(alt_pre, line)); |
| | | setPoint(line, conn.is_start?'end':0, pt2.x, pt2.y, true); |
| | | |
| | | |
| | | // Update points attribute manually for webkit |
| | | if(navigator.userAgent.indexOf('AppleWebKit') != -1) { |
| | | var pts = line.points; |
| | |
| | | for(var j=0; j< len; j++) { |
| | | var pt = pts.getItem(j); |
| | | pt_arr[j] = pt.x + ',' + pt.y; |
| | | } |
| | | line.setAttribute("points",pt_arr.join(" ")); |
| | | } |
| | | line.setAttribute("points",pt_arr.join(" ")); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | function getBBintersect(x, y, bb, offset) { |
| | | if(offset) { |
| | | offset -= 0; |
| | |
| | | bb.x -= offset/2; |
| | | bb.y -= offset/2; |
| | | } |
| | | |
| | | |
| | | var mid_x = bb.x + bb.width/2; |
| | | var mid_y = bb.y + bb.height/2; |
| | | var len_x = x - mid_x; |
| | | var len_y = y - mid_y; |
| | | |
| | | |
| | | var slope = Math.abs(len_y/len_x); |
| | | |
| | | |
| | | var ratio; |
| | | |
| | | |
| | | if(slope < bb.height/bb.width) { |
| | | ratio = (bb.width/2) / Math.abs(len_x); |
| | | } else { |
| | | ratio = (bb.height/2) / Math.abs(len_y); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | return { |
| | | x: mid_x + len_x * ratio, |
| | | y: mid_y + len_y * ratio |
| | | } |
| | | } |
| | | |
| | | |
| | | // Do once |
| | | (function() { |
| | | var gse = svgCanvas.groupSelectedElements; |
| | | |
| | | |
| | | svgCanvas.groupSelectedElements = function() { |
| | | svgCanvas.removeFromSelection($(conn_sel).toArray()); |
| | | return gse.apply(this, arguments); |
| | | } |
| | | |
| | | |
| | | var mse = svgCanvas.moveSelectedElements; |
| | | |
| | | |
| | | svgCanvas.moveSelectedElements = function() { |
| | | svgCanvas.removeFromSelection($(conn_sel).toArray()); |
| | | var cmd = mse.apply(this, arguments); |
| | | updateConnectors(); |
| | | return cmd; |
| | | } |
| | | |
| | | |
| | | se_ns = svgCanvas.getEditorNS(); |
| | | }()); |
| | | |
| | | |
| | | // Do on reset |
| | | function init() { |
| | | // Make sure all connectors have data set |
| | | $(svgcontent).find('*').each(function() { |
| | | $(svgcontent).find('*').each(function() { |
| | | var conn = this.getAttributeNS(se_ns, "connector"); |
| | | if(conn) { |
| | | this.setAttribute('class', conn_sel.substr(1)); |
| | |
| | | }); |
| | | // updateConnectors(); |
| | | } |
| | | |
| | | |
| | | // $(svgroot).parent().mousemove(function(e) { |
| | | // // if(started |
| | | // // if(started |
| | | // // || svgCanvas.getMode() != "connector" |
| | | // // || e.target.parentNode.parentNode != svgcontent) return; |
| | | // |
| | | // |
| | | // console.log('y') |
| | | // // if(e.target.parentNode.parentNode === svgcontent) { |
| | | // // |
| | | // // |
| | | // // } |
| | | // }); |
| | | |
| | | |
| | | return { |
| | | name: "Connector", |
| | | svgicons: "images/conn.svg", |
| | |
| | | start_x = opts.start_x, |
| | | start_y = opts.start_y; |
| | | var mode = svgCanvas.getMode(); |
| | | |
| | | |
| | | if(mode == "connector") { |
| | | |
| | | |
| | | if(started) return; |
| | | |
| | | |
| | | var mouse_target = e.target; |
| | | |
| | | |
| | | var parents = $(mouse_target).parents(); |
| | | |
| | | |
| | | if($.inArray(svgcontent, parents) != -1) { |
| | | // Connectable element |
| | | |
| | | |
| | | // If child of foreignObject, use parent |
| | | var fo = $(mouse_target).closest("foreignObject"); |
| | | start_elem = fo.length ? fo[0] : mouse_target; |
| | | |
| | | |
| | | // Get center of source element |
| | | var bb = svgCanvas.getStrokedBBox([start_elem]); |
| | | var x = bb.x + bb.width/2; |
| | | var y = bb.y + bb.height/2; |
| | | |
| | | |
| | | started = true; |
| | | cur_line = addElem({ |
| | | "element": "polyline", |
| | |
| | | var e = opts.event; |
| | | var x = opts.mouse_x/zoom; |
| | | var y = opts.mouse_y/zoom; |
| | | |
| | | |
| | | var diff_x = x - start_x, |
| | | diff_y = y - start_y; |
| | | |
| | | |
| | | var mode = svgCanvas.getMode(); |
| | | |
| | | |
| | | if(mode == "connector" && started) { |
| | | |
| | | |
| | | var sw = cur_line.getAttribute('stroke-width') * 3; |
| | | // Set start point (adjusts based on bb) |
| | | var pt = getBBintersect(x, y, elData(cur_line, 'start_bb'), getOffset('start', cur_line)); |
| | | start_x = pt.x; |
| | | start_y = pt.y; |
| | | |
| | | |
| | | setPoint(cur_line, 0, pt.x, pt.y, true); |
| | | |
| | | |
| | | // Set end point |
| | | setPoint(cur_line, 'end', x, y, true); |
| | | } else if(mode == "select") { |
| | | var slen = selElems.length; |
| | | |
| | | |
| | | while(slen--) { |
| | | var elem = selElems[slen]; |
| | | // Look for selected connector elements |
| | |
| | | if(connections.length) { |
| | | updateLine(diff_x, diff_y); |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | mouseUp: function(opts) { |
| | | var zoom = svgCanvas.getZoom(); |
| | |
| | | x = opts.mouse_x/zoom, |
| | | y = opts.mouse_y/zoom, |
| | | mouse_target = e.target; |
| | | |
| | | |
| | | if(svgCanvas.getMode() == "connector") { |
| | | var fo = $(mouse_target).closest("foreignObject"); |
| | | if(fo.length) mouse_target = fo[0]; |
| | | |
| | | |
| | | var parents = $(mouse_target).parents(); |
| | | |
| | | if(mouse_target == start_elem) { |
| | |
| | | keep: true, |
| | | element: null, |
| | | started: started |
| | | } |
| | | } |
| | | } else if($.inArray(svgcontent, parents) === -1) { |
| | | // Not a valid target element, so remove line |
| | | $(cur_line).remove(); |
| | |
| | | } else { |
| | | // Valid end element |
| | | end_elem = mouse_target; |
| | | |
| | | |
| | | var start_id = start_elem.id, end_id = end_elem.id; |
| | | var conn_str = start_id + " " + end_id; |
| | | var alt_str = end_id + " " + start_id; |
| | |
| | | started: false |
| | | } |
| | | } |
| | | |
| | | |
| | | var bb = svgCanvas.getStrokedBBox([end_elem]); |
| | | |
| | | |
| | | var pt = getBBintersect(start_x, start_y, bb, getOffset('start', cur_line)); |
| | | setPoint(cur_line, 'end', pt.x, pt.y, true); |
| | | $(cur_line) |
| | |
| | | selectedChanged: function(opts) { |
| | | // TODO: Find better way to skip operations if no connectors are in use |
| | | if(!$(svgcontent).find(conn_sel).length) return; |
| | | |
| | | |
| | | if(svgCanvas.getMode() == 'connector') { |
| | | svgCanvas.setMode('select'); |
| | | } |
| | | |
| | | |
| | | // Use this to update the current selected elements |
| | | selElems = opts.elems; |
| | | |
| | | |
| | | var i = selElems.length; |
| | | |
| | | |
| | | while(i--) { |
| | | var elem = selElems[i]; |
| | | if(elem && elData(elem, 'c_start')) { |
| | |
| | | svgcontent = elem; |
| | | init(); |
| | | } |
| | | |
| | | |
| | | // Has marker, so change offset |
| | | if(elem && ( |
| | | elem.getAttribute("marker-start") || |
| | |
| | | $(elem) |
| | | .data("start_off", !!start) |
| | | .data("end_off", !!end); |
| | | |
| | | |
| | | if(elem.tagName == "line" && mid) { |
| | | // Convert to polyline to accept mid-arrow |
| | | |
| | | |
| | | var x1 = elem.getAttribute('x1')-0; |
| | | var x2 = elem.getAttribute('x2')-0; |
| | | var y1 = elem.getAttribute('y1')-0; |
| | | var y2 = elem.getAttribute('y2')-0; |
| | | var id = elem.id; |
| | | |
| | | |
| | | var mid_pt = (' '+((x1+x2)/2)+','+((y1+y2)/2) + ' '); |
| | | var pline = addElem({ |
| | | "element": "polyline", |
| | |
| | | ChangeElementCommand = svgedit.history.ChangeElementCommand, |
| | | addToHistory = function(cmd) { svgCanvas.undoMgr.addCommandToHistory(cmd); }, |
| | | currentStyle = {fillPaint: "red", fillOpacity: 1.0, |
| | | strokePaint: "black", strokeOpacity: 1.0, |
| | | strokePaint: "black", strokeOpacity: 1.0, |
| | | strokeWidth: 5, strokeDashArray: null, |
| | | opacity: 1.0, |
| | | strokeLinecap: 'butt', |
| | |
| | | var tool = $('#tool_eyedropper'); |
| | | |
| | | } |
| | | |
| | | |
| | | var getPaint = function(color, opac, type) { |
| | | // update the editor's fill paint |
| | | var opts = null; |
| | |
| | | |
| | | opts = { alpha: opac }; |
| | | opts[refElem.tagName] = refElem; |
| | | } |
| | | } |
| | | else if (color.indexOf("#") === 0) { |
| | | opts = { |
| | | alpha: opac, |
| | |
| | | } |
| | | return new $.jGraduate.Paint(opts); |
| | | }; |
| | | |
| | | |
| | | return { |
| | | name: "eyedropper", |
| | | svgicons: "extensions/eyedropper-icon.xml", |
| | |
| | | } |
| | | } |
| | | }], |
| | | |
| | | |
| | | mouseDown: function(opts) { |
| | | var mode = svgCanvas.getMode(); |
| | | var e = opts.event; |
| | |
| | | } |
| | | } |
| | | }; |
| | | }); |
| | | }); |
| | |
| | | * |
| | | * Licensed under the Apache License, Version 2 |
| | | * |
| | | * Copyright(c) 2010 Jacques Distler |
| | | * Copyright(c) 2010 Alexis Deveria |
| | | * Copyright(c) 2010 Jacques Distler |
| | | * Copyright(c) 2010 Alexis Deveria |
| | | * |
| | | */ |
| | | |
| | |
| | | svgdoc = S.svgroot.parentNode.ownerDocument, |
| | | started, |
| | | newFO; |
| | | |
| | | |
| | | |
| | | |
| | | var properlySourceSizeTextArea = function(){ |
| | | // TODO: remove magic numbers here and get values from CSS |
| | | var height = $('#svg_source_container').height() - 80; |
| | |
| | | var fc_rules = $('#fc_rules'); |
| | | if(!fc_rules.length) { |
| | | fc_rules = $('<style id="fc_rules"><\/style>').appendTo('head'); |
| | | } |
| | | } |
| | | fc_rules.text(!on?"":" #tool_topath { display: none !important; }"); |
| | | $('#foreignObject_panel').toggle(on); |
| | | } |
| | |
| | | $('#tool_source_save, #tool_source_cancel').toggle(!on); |
| | | $('#foreign_save, #foreign_cancel').toggle(on); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // Function: setForeignString(xmlString, elt) |
| | | // This function sets the content of element elt to the input XML. |
| | | // |
| | |
| | | console.log(e); |
| | | return false; |
| | | } |
| | | |
| | | |
| | | return true; |
| | | }; |
| | | |
| | |
| | | properlySourceSizeTextArea(); |
| | | $('#svg_source_textarea').focus(); |
| | | } |
| | | |
| | | |
| | | function setAttr(attr, val) { |
| | | svgCanvas.changeSelectedAttribute(attr, val); |
| | | S.call("changed", selElems); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | return { |
| | | name: "foreignObject", |
| | | svgicons: "extensions/foreignobject-icons.xml", |
| | |
| | | } |
| | | } |
| | | }], |
| | | |
| | | |
| | | context_tools: [{ |
| | | type: "input", |
| | | panel: "foreignObject_panel", |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | ], |
| | | callback: function() { |
| | | $('#foreignObject_panel').hide(); |
| | |
| | | } |
| | | |
| | | // TODO: Needs to be done after orig icon loads |
| | | setTimeout(function() { |
| | | setTimeout(function() { |
| | | // Create source save/cancel buttons |
| | | var save = $('#tool_source_save').clone() |
| | | .hide().attr('id', 'foreign_save').unbind() |
| | | .appendTo("#tool_source_back").click(function() { |
| | | |
| | | |
| | | if (!editingforeign) return; |
| | | |
| | | if (!setForeignString($('#svg_source_textarea').val())) { |
| | |
| | | } else { |
| | | endChanges(); |
| | | } |
| | | // setSelectMode(); |
| | | // setSelectMode(); |
| | | }); |
| | | |
| | | |
| | | var cancel = $('#tool_source_cancel').clone() |
| | | .hide().attr('id', 'foreign_cancel').unbind() |
| | | .appendTo("#tool_source_back").click(function() { |
| | | endChanges(); |
| | | }); |
| | | |
| | | |
| | | }, 3000); |
| | | }, |
| | | mouseDown: function(opts) { |
| | | var e = opts.event; |
| | | |
| | | |
| | | if(svgCanvas.getMode() == "foreign") { |
| | | |
| | | started = true; |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | }, |
| | | selectedChanged: function(opts) { |
| | | // Use this to update the current selected elements |
| | | selElems = opts.elems; |
| | | |
| | | |
| | | var i = selElems.length; |
| | | |
| | | |
| | | while(i--) { |
| | | var elem = selElems[i]; |
| | | if(elem && elem.tagName == "foreignObject") { |
| | |
| | | $('#foreign_font_size').val(elem.getAttribute("font-size")); |
| | | $('#foreign_width').val(elem.getAttribute("width")); |
| | | $('#foreign_height').val(elem.getAttribute("height")); |
| | | |
| | | |
| | | showPanel(true); |
| | | } else { |
| | | showPanel(false); |
| | |
| | | var svgCanvas = methodDraw.canvas; |
| | | var showGrid = false; |
| | | var assignAttributes = s.assignAttributes; |
| | | |
| | | |
| | | var hcanvas = document.createElement('canvas'); |
| | | $(hcanvas).hide().appendTo('body'); |
| | | |
| | |
| | | 'overflow': 'visible', |
| | | 'display': 'none' |
| | | }); |
| | | |
| | | |
| | | var canvBG = $('#canvas_background'); |
| | | canvBG.after(canvasgrid); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // grid-pattern |
| | | var gridPattern = svgdoc.createElementNS(svgns, "pattern"); |
| | |
| | | 'width': 100, |
| | | 'height': 100 |
| | | }); |
| | | |
| | | |
| | | var gridimg = svgdoc.createElementNS(svgns, "image"); |
| | | assignAttributes(gridimg, { |
| | | 'x': 0, |
| | |
| | | 'width': 100, |
| | | 'height': 100 |
| | | }); |
| | | |
| | | |
| | | gridPattern.appendChild(gridimg); |
| | | $('#svgroot defs').append(gridPattern); |
| | | |
| | |
| | | |
| | | function updateGrid(zoom) { |
| | | // TODO: Try this with <line> elements, then compare performance difference |
| | | |
| | | |
| | | var bgwidth = +canvBG.attr('width'); |
| | | var bgheight = +canvBG.attr('height'); |
| | | |
| | | |
| | | var units = svgedit.units.getTypeMap(); |
| | | var unit = units[methodDraw.curConfig.baseUnit]; // 1 = 1px |
| | | var r_intervals = [.01, .1, 1, 10, 100, 1000]; |
| | | |
| | | |
| | | var d = 0; |
| | | var is_x = (d === 0); |
| | | var dim = is_x ? 'x' : 'y'; |
| | | var lentype = is_x?'width':'height'; |
| | | var c_elem = svgCanvas.getContentElem(); |
| | | var content_d = c_elem.getAttribute(dim)-0; |
| | | |
| | | |
| | | var hcanv = hcanvas; |
| | | |
| | | |
| | | var u_multi = unit * zoom; |
| | | |
| | | |
| | | // Calculate the main number interval |
| | | var raw_m = 100 / u_multi; |
| | | var multi = 1; |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | var big_int = multi * u_multi; |
| | | |
| | | // Set the canvas size to the width of the container |
| | |
| | | hcanv.height = big_int; |
| | | var ctx = hcanv.getContext("2d"); |
| | | |
| | | var ruler_d = 0; |
| | | var ruler_d = 0; |
| | | var cur_d = .5; |
| | | |
| | | |
| | | var part = big_int / 10; |
| | | |
| | | ctx.globalAlpha = 0.2; |
| | |
| | | ctx.lineTo(line_num ,sub_d); |
| | | } |
| | | ctx.stroke(); |
| | | ctx.beginPath(); |
| | | ctx.beginPath(); |
| | | ctx.globalAlpha = 0.5; |
| | | ctx.moveTo(cur_d, big_int); |
| | | ctx.lineTo(cur_d, 0); |
| | |
| | | * Copyright(c) 2010 Alexis Deveria |
| | | * |
| | | */ |
| | | |
| | | /* |
| | | |
| | | /* |
| | | This is a very basic SVG-Edit extension. It adds a "Hello World" button in |
| | | the left panel. Clicking on the button, and then the canvas will show the |
| | | user the point on the canvas that was clicked on. |
| | | */ |
| | | |
| | | |
| | | methodDraw.addExtension("Hello World", function() { |
| | | |
| | | return { |
| | |
| | | // For more notes on how to make an icon file, see the source of |
| | | // the hellorworld-icon.xml |
| | | svgicons: "extensions/helloworld-icon.xml", |
| | | |
| | | |
| | | // Multiple buttons can be added in this array |
| | | buttons: [{ |
| | | // Must match the icon ID in helloworld-icon.xml |
| | | id: "hello_world", |
| | | |
| | | id: "hello_world", |
| | | |
| | | // This indicates that the button will be added to the "mode" |
| | | // button panel on the left side |
| | | type: "mode", |
| | | |
| | | type: "mode", |
| | | |
| | | // Tooltip text |
| | | title: "Say 'Hello World'", |
| | | |
| | | title: "Say 'Hello World'", |
| | | |
| | | // Events |
| | | events: { |
| | | 'click': function() { |
| | | // The action taken when the button is clicked on. |
| | | // For "mode" buttons, any other button will |
| | | // For "mode" buttons, any other button will |
| | | // automatically be de-pressed. |
| | | svgCanvas.setMode("hello_world"); |
| | | } |
| | | } |
| | | }], |
| | | // This is triggered when the main mouse button is pressed down |
| | | // This is triggered when the main mouse button is pressed down |
| | | // on the editor canvas (not the tool panels) |
| | | mouseDown: function() { |
| | | // Check the mode on mousedown |
| | | if(svgCanvas.getMode() == "hello_world") { |
| | | |
| | | // The returned object must include "started" with |
| | | |
| | | // The returned object must include "started" with |
| | | // a value of true in order for mouseUp to be triggered |
| | | return {started: true}; |
| | | } |
| | | }, |
| | | |
| | | |
| | | // This is triggered from anywhere, but "started" must have been set |
| | | // to true (see above). Note that "opts" is an object with event info |
| | | mouseUp: function(opts) { |
| | | // Check the mode on mouseup |
| | | if(svgCanvas.getMode() == "hello_world") { |
| | | var zoom = svgCanvas.getZoom(); |
| | | |
| | | |
| | | // Get the actual coordinate by dividing by the zoom value |
| | | var x = opts.mouse_x / zoom; |
| | | var y = opts.mouse_y / zoom; |
| | | |
| | | var text = "Hello World!\n\nYou clicked here: " |
| | | |
| | | var text = "Hello World!\n\nYou clicked here: " |
| | | + x + ", " + y; |
| | | |
| | | |
| | | // Show the text using the custom alert function |
| | | $.alert(text); |
| | | } |
| | |
| | | methodDraw.addExtension("imagelib", function() { |
| | | |
| | | var uiStrings = methodDraw.uiStrings; |
| | | |
| | | |
| | | $.extend(uiStrings, { |
| | | imagelib: { |
| | | select_lib: 'Select an image library', |
| | |
| | | name: 'Demo library (local)', |
| | | url: 'extensions/imagelib/index.html', |
| | | description: 'Demonstration library for SVG-edit on this server' |
| | | }, |
| | | }, |
| | | { |
| | | name: 'IAN Symbol Libraries', |
| | | url: 'http://ian.umces.edu/symbols/catalog/svgedit/album_chooser.php', |
| | | description: 'Free library of illustrations' |
| | | } |
| | | ]; |
| | | |
| | | |
| | | var xlinkns = "http://www.w3.org/1999/xlink"; |
| | | |
| | | function closeBrowser() { |
| | | $('#imgbrowse_holder').hide(); |
| | | } |
| | | |
| | | |
| | | function importImage(url) { |
| | | var newImage = svgCanvas.addSvgElementFromJson({ |
| | | "element": "image", |
| | |
| | | var cur_meta; |
| | | var tranfer_stopped = false; |
| | | var pending = {}; |
| | | |
| | | |
| | | window.addEventListener("message", function(evt) { |
| | | // Receive postMessage data |
| | | var response = evt.data; |
| | | |
| | | |
| | | if(!response) { |
| | | // Do nothing |
| | | return; |
| | | } |
| | | |
| | | |
| | | var char1 = response.charAt(0); |
| | | |
| | | |
| | | var svg_str; |
| | | var img_str; |
| | | |
| | | |
| | | if(char1 != "{" && tranfer_stopped) { |
| | | tranfer_stopped = false; |
| | | return; |
| | | } |
| | | |
| | | |
| | | if(char1 == '|') { |
| | | var secondpos = response.indexOf('|', 1); |
| | | var id = response.substr(1, secondpos-1); |
| | |
| | | char1 = response.charAt(0); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // Hide possible transfer dialog box |
| | | $('#dialog_box').hide(); |
| | | |
| | | |
| | | switch (char1) { |
| | | case '{': |
| | | // Metadata |
| | | tranfer_stopped = false; |
| | | var cur_meta = JSON.parse(response); |
| | | |
| | | |
| | | pending[cur_meta.id] = cur_meta; |
| | | |
| | | |
| | | var name = (cur_meta.name || 'file'); |
| | | |
| | | |
| | | var message = uiStrings.notification.retrieving.replace('%s', name); |
| | | |
| | | |
| | | if(mode != 'm') { |
| | | $.process_cancel(message, function() { |
| | | tranfer_stopped = true; |
| | | // Should a message be sent back to the frame? |
| | | |
| | | |
| | | $('#dialog_box').hide(); |
| | | }); |
| | | } else { |
| | |
| | | preview.append(entry); |
| | | cur_meta.entry = entry; |
| | | } |
| | | |
| | | |
| | | return; |
| | | case '<': |
| | | svg_str = true; |
| | |
| | | default: |
| | | // TODO: See if there's a way to base64 encode the binary data stream |
| | | // var str = 'data:;base64,' + svgCanvas.Utils.encode64(response, true); |
| | | |
| | | |
| | | // Assume it's raw image data |
| | | // importImage(str); |
| | | |
| | | |
| | | // Don't give warning as postMessage may have been used by something else |
| | | if(mode !== 'm') { |
| | | closeBrowser(); |
| | |
| | | // }); |
| | | return; |
| | | } |
| | | |
| | | |
| | | switch (mode) { |
| | | case 's': |
| | | // Import one |
| | |
| | | } else { |
| | | var entry = '<img src="' + response + '">'; |
| | | } |
| | | |
| | | |
| | | if(cur_meta) { |
| | | preview.children().each(function() { |
| | | if($(this).data('id') == id) { |
| | |
| | | break; |
| | | } |
| | | }, true); |
| | | |
| | | |
| | | var preview, submit; |
| | | |
| | | function toggleMulti(show) { |
| | | |
| | | |
| | | $('#lib_framewrap, #imglib_opts').css({right: (show ? 200 : 10)}); |
| | | if(!preview) { |
| | | preview = $('<div id=imglib_preview>').css({ |
| | |
| | | background: '#fff', |
| | | overflow: 'auto' |
| | | }).insertAfter('#lib_framewrap'); |
| | | |
| | | |
| | | submit = $('<button disabled>Import selected</button>').appendTo('#imgbrowse').click(function() { |
| | | $.each(multi_arr, function(i) { |
| | | var type = this[0]; |
| | |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | preview.toggle(show); |
| | | submit.toggle(show); |
| | | } |
| | |
| | | |
| | | var lib_opts = $('<ul id=imglib_opts>').appendTo(browser); |
| | | var frame = $('<iframe/>').prependTo(browser).hide().wrap('<div id=lib_framewrap>'); |
| | | |
| | | |
| | | var header = $('<h1>').prependTo(browser).text(all_libs).css({ |
| | | position: 'absolute', |
| | | top: 0, |
| | | left: 0, |
| | | width: '100%' |
| | | }); |
| | | |
| | | |
| | | var cancel = $('<button>' + uiStrings.common.cancel + '</button>').appendTo(browser).click(function() { |
| | | $('#imgbrowse_holder').hide(); |
| | | }).css({ |
| | |
| | | top: 5, |
| | | right: -10 |
| | | }); |
| | | |
| | | |
| | | var leftBlock = $('<span>').css({position:'absolute',top:5,left:10}).appendTo(browser); |
| | | |
| | | |
| | | var back = $('<button hidden>' + uiStrings.imagelib.show_list + '</button>').appendTo(leftBlock).click(function() { |
| | | frame.attr('src', 'about:blank').hide(); |
| | | lib_opts.show(); |
| | |
| | | }).css({ |
| | | 'margin-right': 5 |
| | | }).hide(); |
| | | |
| | | var type = $('<select><option value=s>' + |
| | | |
| | | var type = $('<select><option value=s>' + |
| | | uiStrings.imagelib.import_single + '</option><option value=m>' + |
| | | uiStrings.imagelib.import_multi + '</option><option value=o>' + |
| | | uiStrings.imagelib.open + '</option></select>').appendTo(leftBlock).change(function() { |
| | |
| | | case 'o': |
| | | toggleMulti(false); |
| | | break; |
| | | |
| | | |
| | | case 'm': |
| | | // Import multiple |
| | | toggleMulti(true); |
| | |
| | | }).css({ |
| | | 'margin-top': 10 |
| | | }); |
| | | |
| | | |
| | | cancel.prepend($.getSvgIcon('cancel', true)); |
| | | back.prepend($.getSvgIcon('tool_imagelib', true)); |
| | | |
| | | |
| | | $.each(img_libs, function(i, opts) { |
| | | $('<li>').appendTo(lib_opts).text(opts.name).click(function() { |
| | | frame.attr('src', opts.url).show(); |
| | |
| | | back.show(); |
| | | }).append('<span>' + opts.description + '</span>'); |
| | | }); |
| | | |
| | | |
| | | } else { |
| | | $('#imgbrowse_holder').show(); |
| | | } |
| | | } |
| | | |
| | | |
| | | return { |
| | | buttons: [{ |
| | | id: "tool_imagelib", |
| | |
| | | } |
| | | }], |
| | | callback: function() { |
| | | |
| | | |
| | | $('<style>').text('\ |
| | | #imgbrowse_holder {\ |
| | | position: absolute;\ |
| | |
| | | </g> |
| | | </svg> |
| | | </g> |
| | | </svg> |
| | | </svg> |
| | |
| | | * |
| | | * Licensed under the Apache License, Version 2 |
| | | * |
| | | * Copyright(c) 2010 Will Schleter |
| | | * Copyright(c) 2010 Will Schleter |
| | | * based on ext-arrows.js by Copyright(c) 2010 Alexis Deveria |
| | | * |
| | | * This extension provides for the addition of markers to the either end |
| | | * or the middle of a line, polyline, path, polygon. |
| | | * |
| | | * or the middle of a line, polyline, path, polygon. |
| | | * |
| | | * Markers may be either a graphic or arbitary text |
| | | * |
| | | * |
| | | * to simplify the coding and make the implementation as robust as possible, |
| | | * markers are not shared - every object has its own set of markers. |
| | | * this relationship is maintained by a naming convention between the |
| | | * ids of the markers and the ids of the object |
| | | * |
| | | * |
| | | * The following restrictions exist for simplicty of use and programming |
| | | * objects and their markers to have the same color |
| | | * marker size is fixed |
| | | * text marker font, size, and attributes are fixed |
| | | * an application specific attribute - se_type - is added to each marker element |
| | | * to store the type of marker |
| | | * |
| | | * |
| | | * TODO: |
| | | * remove some of the restrictions above |
| | | * add option for keeping text aligned to horizontal |
| | |
| | | |
| | | var marker_prefix = 'se_marker_'; |
| | | var id_prefix = 'mkr_'; |
| | | |
| | | |
| | | // note - to add additional marker types add them below with a unique id |
| | | // and add the associated icon(s) to marker-icons.svg |
| | | // the geometry is normallized to a 100x100 box with the origin at lower left |
| | | // Safari did not like negative values for low left of viewBox |
| | | // remember that the coordinate system has +y downward |
| | | var marker_types = { |
| | | nomarker: {}, |
| | | leftarrow: |
| | | nomarker: {}, |
| | | leftarrow: |
| | | {element:'path', attr:{d:'M0,50 L100,90 L70,50 L100,10 Z'}}, |
| | | rightarrow: |
| | | {element:'path', attr:{d:'M100,50 L0,90 L30,50 L0,10 Z'}}, |
| | |
| | | mcircle: |
| | | {element:'circle', attr:{r:30, cx:50, cy:50}} |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | var lang_list = { |
| | | "en":[ |
| | | {id: "start_marker_list", title: "Select start marker type" }, |
| | |
| | | $.each(['leftarrow','rightarrow','box','star','mcircle','triangle'],function(i,v) { |
| | | marker_types[v+'_o'] = marker_types[v]; |
| | | }); |
| | | |
| | | |
| | | // elem = a graphic element will have an attribute like marker-start |
| | | // attr - marker-start, marker-mid, or marker-end |
| | | // returns the marker element that is linked to the graphic element |
| | |
| | | txtbox.hide() // hide text box |
| | | } |
| | | } |
| | | txtbox.val(val); |
| | | txtbox.val(val); |
| | | setIcon(pos,ci); |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | | function addMarker(id, val) { |
| | | var txt_box_bg = '#ffffff'; |
| | | var txt_box_border = 'none'; |
| | | var txt_box_stroke_width = 0; |
| | | |
| | | |
| | | var marker = S.getElem(id); |
| | | |
| | | if (marker) return; |
| | | |
| | | if (val=='' || val=='\\nomarker') return; |
| | | |
| | | var el = selElems[0]; |
| | | var el = selElems[0]; |
| | | var color = el.getAttribute('stroke'); |
| | | //NOTE: Safari didn't like a negative value in viewBox |
| | | //so we use a standardized 0 0 100 100 |
| | |
| | | else se_type='textmarker'; |
| | | |
| | | if (!marker_types[se_type]) return; // an unknown type! |
| | | |
| | | |
| | | // create a generic marker |
| | | marker = addElem({ |
| | | "element": "marker", |
| | |
| | | marker.setAttribute("orient",0); |
| | | marker.appendChild(box); |
| | | marker.appendChild(text); |
| | | } |
| | | } |
| | | |
| | | marker.setAttribute("viewBox",viewBox); |
| | | marker.setAttribute("markerWidth", markerWidth); |
| | |
| | | var m = elem.getAttribute(nam); |
| | | if (m) pline.setAttribute(nam,elem.getAttribute(nam)); |
| | | }); |
| | | |
| | | |
| | | var batchCmd = new S.BatchCommand(); |
| | | batchCmd.addSubCommand(new S.RemoveElementCommand(elem, elem.parentNode)); |
| | | batchCmd.addSubCommand(new S.InsertElementCommand(pline)); |
| | | |
| | | |
| | | $(elem).after(pline).remove(); |
| | | svgCanvas.clearSelection(); |
| | | pline.id = id; |
| | |
| | | //if (val.substr(0,1)=='\\') txtbox.hide(); |
| | | //else txtbox.show(); |
| | | } |
| | | |
| | | |
| | | function setIcon(pos,id) { |
| | | if (id.substr(0,1)!='\\') id='\\textmarker' |
| | | var ci = '#'+id_prefix+pos+'_'+id.substr(1); |
| | | methodDraw.setIcon('#cur_' + pos +'_marker_list', $(ci).children()); |
| | | $(ci).addClass('current').siblings().removeClass('current'); |
| | | } |
| | | |
| | | |
| | | function setMarkerSet(obj) { |
| | | var parts = this.id.split('_'); |
| | | var set = parts[2]; |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | function showTextPrompt(pos) { |
| | | var def = $('#'+pos+'_marker').val(); |
| | | if (def.substr(0,1)=='\\') def=''; |
| | | $.prompt('Enter text for ' + pos + ' marker', def , function(txt) { if (txt) triggerTextEntry(pos,txt); }); |
| | | } |
| | | |
| | | |
| | | // callback function for a toolbar button click |
| | | function setArrowFromButton(obj) { |
| | | |
| | | |
| | | var parts = this.id.split('_'); |
| | | var pos = parts[1]; |
| | | var val = parts[2]; |
| | | if (parts[3]) val+='_'+parts[3]; |
| | | |
| | | |
| | | if (val!='textmarker') { |
| | | triggerTextEntry(pos,'\\'+val); |
| | | } else { |
| | | showTextPrompt(pos); |
| | | } |
| | | } |
| | | |
| | | |
| | | function getTitle(lang,id) { |
| | | var list = lang_list[lang]; |
| | | for (var i in list) { |
| | |
| | | } |
| | | return id; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // build the toolbar button array from the marker definitions |
| | | // TODO: need to incorporate language specific titles |
| | | function buildButtonList() { |
| | |
| | | } ], |
| | | callback: function() { |
| | | $('#marker_panel').addClass('toolset').hide(); |
| | | |
| | | |
| | | }, |
| | | addLangData: function(lang) { |
| | | return { data: lang_list[lang] }; |
| | |
| | | } |
| | | }, |
| | | |
| | | elementChanged: function(opts) { |
| | | elementChanged: function(opts) { |
| | | //console.log('elementChanged',opts); |
| | | var elem = opts.elems[0]; |
| | | if(elem && ( |
| | |
| | | callback: function() { |
| | | |
| | | var save_svg_action = '/+modify'; |
| | | |
| | | |
| | | // Create upload target (hidden iframe) |
| | | var target = $('<iframe name="output_frame" src="#"/>').hide().appendTo('body'); |
| | | |
| | | |
| | | methodDraw.setCustomHandlers({ |
| | | save: function(win, data) { |
| | | var svg = "<?xml version=\"1.0\"?>\n" + data; |
| | |
| | | top.window.location = '/'+name; |
| | | }, |
| | | }); |
| | | |
| | | |
| | | } |
| | | }); |
| | | |
| | |
| | | |
| | | //var save_svg_action = 'extensions/filesave.php'; |
| | | //var save_png_action = 'extensions/filesave.php'; |
| | | |
| | | |
| | | // Create upload target (hidden iframe) |
| | | var target = $('<iframe name="output_frame" />').hide().appendTo('body'); |
| | | |
| | | |
| | | //methodDraw.setCustomHandlers({ |
| | | // save: function(win, data) { |
| | | // var svg = "<?xml version=\"1.0\"?>\n" + data; |
| | | // |
| | | // |
| | | // var title = svgCanvas.getDocumentTitle(); |
| | | // var filename = title.replace(/[^a-z0-9\.\_\-]+/gi, '_'); |
| | | // |
| | | // |
| | | // var form = $('<form>').attr({ |
| | | // method: 'post', |
| | | // action: save_svg_action, |
| | |
| | | // }, |
| | | // pngsave: function(win, data) { |
| | | // var issues = data.issues; |
| | | // |
| | | // |
| | | // if(!$('#export_canvas').length) { |
| | | // $('<canvas>', {id: 'export_canvas'}).hide().appendTo('body'); |
| | | // } |
| | | // var c = $('#export_canvas')[0]; |
| | | // |
| | | // |
| | | // c.width = svgCanvas.contentW; |
| | | // c.height = svgCanvas.contentH; |
| | | // canvg(c, data.svg, {renderCallback: function() { |
| | | // var datauri = c.toDataURL('image/png'); |
| | | // |
| | | // |
| | | // var uiStrings = methodDraw.uiStrings; |
| | | // var note = ''; |
| | | // |
| | | // |
| | | // // Check if there's issues |
| | | // if(issues.length) { |
| | | // var pre = "\n \u2022 "; |
| | | // note += ("\n\n" + pre + issues.join(pre)); |
| | | // } |
| | | // |
| | | // } |
| | | // |
| | | // if(note.length) { |
| | | // alert(note); |
| | | // } |
| | | // |
| | | // |
| | | // var title = svgCanvas.getDocumentTitle(); |
| | | // var filename = title.replace(/[^a-z0-9\.\_\-]+/gi, '_'); |
| | | // |
| | | // |
| | | // var form = $('<form>').attr({ |
| | | // method: 'post', |
| | | // action: save_png_action, |
| | |
| | | // .submit().remove(); |
| | | // }}); |
| | | // |
| | | // |
| | | // |
| | | // } |
| | | //}); |
| | | |
| | | |
| | | // Do nothing if client support is found |
| | | if(window.FileReader) return; |
| | | |
| | | |
| | | var cancelled = false; |
| | | |
| | | |
| | | // Change these to appropriate script file |
| | | var open_svg_action = 'extensions/fileopen.php?type=load_svg'; |
| | | var import_svg_action = 'extensions/fileopen.php?type=import_svg'; |
| | | var import_img_action = 'extensions/fileopen.php?type=import_img'; |
| | | |
| | | |
| | | // Set up function for PHP uploader to use |
| | | methodDraw.processFile = function(str64, type) { |
| | | if(cancelled) { |
| | | cancelled = false; |
| | | return; |
| | | } |
| | | |
| | | |
| | | $('#dialog_box').hide(); |
| | | |
| | | |
| | | if(type != 'import_img') { |
| | | var xmlstr = svgCanvas.Utils.decode64(str64); |
| | | } |
| | | |
| | | |
| | | switch ( type ) { |
| | | case 'load_svg': |
| | | svgCanvas.clear(); |
| | |
| | | break; |
| | | case 'import_svg': |
| | | svgCanvas.importSvgString(xmlstr); |
| | | methodDraw.updateCanvas(); |
| | | methodDraw.updateCanvas(); |
| | | break; |
| | | case 'import_img': |
| | | svgCanvas.setGoodImage(str64); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | // Create upload form |
| | | var open_svg_form = $('<form>'); |
| | | open_svg_form.attr({ |
| | |
| | | action: open_svg_action, |
| | | target: 'output_frame' |
| | | }); |
| | | |
| | | |
| | | // Create import form |
| | | var import_svg_form = open_svg_form.clone().attr('action', import_svg_action); |
| | | |
| | | |
| | | // Create image form |
| | | var import_img_form = open_svg_form.clone().attr('action', import_img_action); |
| | | |
| | | // It appears necessory to rebuild this input every time a file is |
| | | |
| | | // It appears necessory to rebuild this input every time a file is |
| | | // selected so the same file can be picked and the change event can fire. |
| | | function rebuildInput(form) { |
| | | form.empty(); |
| | | var inp = $('<input type="file" name="svg_file">').appendTo(form); |
| | | |
| | | |
| | | |
| | | |
| | | function submit() { |
| | | // This submits the form, which returns the file data using methodDraw.uploadSVG |
| | | form.submit(); |
| | | |
| | | |
| | | rebuildInput(form); |
| | | $.process_cancel("Uploading...", function() { |
| | | cancelled = true; |
| | | $('#dialog_box').hide(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | if(form[0] == open_svg_form[0]) { |
| | | inp.change(function() { |
| | | // This takes care of the "are you sure" dialog box |
| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | // Create the input elements |
| | | rebuildInput(open_svg_form); |
| | | rebuildInput(import_svg_form); |
| | |
| | | */ |
| | | |
| | | methodDraw.addExtension("shapes", function() { |
| | | |
| | | |
| | | |
| | | var current_d, cur_shape_id; |
| | | var canv = methodDraw.canvas; |
| | |
| | | var start_x, start_y; |
| | | var svgroot = canv.getRootElem(); |
| | | var lastBBox = {}; |
| | | |
| | | |
| | | // This populates the category list |
| | | var categories = { |
| | | basic: 'Basic', |
| | |
| | | ui: 'User Interface', |
| | | social: 'Social Web' |
| | | }; |
| | | |
| | | |
| | | var library = { |
| | | 'basic': { |
| | | data: { |
| | |
| | | "divide": "m150,0.99785l0,0c25.17819,0 45.58916,20.41097 45.58916,45.58916c0,25.17821 -20.41096,45.58916 -45.58916,45.58916c-25.17822,0 -45.58916,-20.41093 -45.58916,-45.58916c0,-25.1782 20.41093,-45.58916 45.58916,-45.58916zm0,296.25203c-25.17822,0 -45.58916,-20.41095 -45.58916,-45.58917c0,-25.17819 20.41093,-45.58916 45.58916,-45.58916c25.17819,0 45.58916,20.41096 45.58916,45.58916c0,25.17822 -20.41096,45.58917 -45.58916,45.58917zm-134.06754,-193.71518l268.13507,0l0,91.17833l-268.13507,0z", |
| | | "minus": "m0.99887,102.39503l297.49445,0l0,95.2112l-297.49445,0z", |
| | | "times": "m1.00089,73.36786l72.36697,-72.36697l76.87431,76.87368l76.87431,-76.87368l72.36765,72.36697l-76.87433,76.87431l76.87433,76.87431l-72.36765,72.36765l-76.87431,-76.87433l-76.87431,76.87433l-72.36697,-72.36765l76.87368,-76.87431l-76.87368,-76.87431z" |
| | | |
| | | |
| | | |
| | | }, |
| | | buttons: [] |
| | | } |
| | | }; |
| | | |
| | | |
| | | var cur_lib = library.basic; |
| | | |
| | | |
| | | var mode_id = 'shapelib'; |
| | | |
| | | |
| | | function loadIcons() { |
| | | $('#shape_buttons').empty(); |
| | | |
| | | |
| | | // Show lib ones |
| | | $('#shape_buttons').append(cur_lib.buttons); |
| | | } |
| | | |
| | | |
| | | function loadLibrary(cat_id) { |
| | | |
| | | |
| | | var lib = library[cat_id]; |
| | | |
| | | |
| | | if(!lib) { |
| | | $('#shape_buttons').html('Loading...'); |
| | | $.getJSON('extensions/shapelib/' + cat_id + '.json', function(result, textStatus) { |
| | |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | |
| | | cur_lib = lib; |
| | | if(!lib.buttons.length) makeButtons(cat_id, lib); |
| | | loadIcons(); |
| | | } |
| | | |
| | | |
| | | function makeButtons(cat, shapes) { |
| | | var size = cur_lib.size || 300; |
| | | var fill = cur_lib.fill || false; |
| | | var off = size * .05; |
| | | var vb = [-off, -off, size + off*2, size + off*2].join(' '); |
| | | var stroke = fill ? 0: (size/30); |
| | | |
| | | |
| | | var shape_icon = new DOMParser().parseFromString( |
| | | '<svg xmlns="http://www.w3.org/2000/svg"><svg viewBox="' + vb + '"><path fill="#333" stroke="transparent" stroke-width="' + stroke + '" /><\/svg><\/svg>', |
| | | 'text/xml'); |
| | |
| | | shape_icon.documentElement.setAttribute('width', width); |
| | | shape_icon.documentElement.setAttribute('height', height); |
| | | var svg_elem = $(document.importNode(shape_icon.documentElement,true)); |
| | | |
| | | |
| | | var data = shapes.data; |
| | | |
| | | |
| | | cur_lib.buttons = []; |
| | | |
| | | |
| | | for(var id in data) { |
| | | var path_d = data[id]; |
| | | var icon = svg_elem.clone(); |
| | | icon.find('path').attr('d', path_d); |
| | | |
| | | |
| | | var icon_btn = icon.wrap('<div class="tool_button">').parent().attr({ |
| | | id: mode_id + '_' + id, |
| | | title: id |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | // Store for later use |
| | | cur_lib.buttons.push(icon_btn[0]); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | return { |
| | | svgicons: "extensions/ext-shapes.xml", |
| | | buttons: [{ |
| | |
| | | }], |
| | | callback: function() { |
| | | |
| | | |
| | | |
| | | var btn_div = $('<div id="shape_buttons">'); |
| | | $('#tools_shapelib > *').wrapAll(btn_div); |
| | | |
| | | |
| | | var shower = $('#tools_shapelib_show'); |
| | | |
| | | |
| | | |
| | | loadLibrary('basic'); |
| | | |
| | | |
| | | // Do mouseup on parent element rather than each button |
| | | $('#shape_buttons').mouseup(function(evt) { |
| | | var btn = $(evt.target).closest('div.tool_button'); |
| | | |
| | | |
| | | if(!btn.length) return; |
| | | |
| | | |
| | | var copy = btn.children().clone().attr({width: 24, height: 24}); |
| | | shower.children(':not(.flyout_arrow_horiz)').remove(); |
| | | shower |
| | |
| | | .attr('data-curopt', '#' + btn[0].id) // This sets the current mode |
| | | .mouseup(); |
| | | canv.setMode(mode_id); |
| | | |
| | | |
| | | cur_shape_id = btn[0].id.substr((mode_id+'_').length); |
| | | current_d = cur_lib.data[cur_shape_id]; |
| | | |
| | | |
| | | $('.tools_flyout').fadeOut(); |
| | | |
| | | }); |
| | | |
| | | // |
| | | // |
| | | var shape_cats = $('<div id="shape_cats">'); |
| | | var cat_str = ''; |
| | | |
| | | |
| | | $.each(categories, function(id, label) { |
| | | cat_str += '<div data-cat=' + id + '>' + label + '</div>'; |
| | | }); |
| | | |
| | | |
| | | shape_cats.html(cat_str).children().bind('mouseup', function() { |
| | | var catlink = $(this); |
| | | catlink.siblings().removeClass('current'); |
| | | catlink.addClass('current'); |
| | | |
| | | |
| | | loadLibrary(catlink.attr('data-cat')); |
| | | // Get stuff |
| | | |
| | | |
| | | return false; |
| | | }); |
| | | |
| | | |
| | | shape_cats.children().eq(0).addClass('current'); |
| | | |
| | | |
| | | $('#tools_shapelib').prepend(shape_cats); |
| | | |
| | | shower.mouseup(function() { |
| | | canv.setMode(current_d ? mode_id : 'select'); |
| | | }); |
| | | |
| | | |
| | | |
| | | $('#tool_shapelib').remove(); |
| | | |
| | | |
| | | var h = $('#tools_shapelib').height(); |
| | | $('#tools_shapelib').css({ |
| | | 'margin-top': -(h/2), |
| | | 'margin-left': 3 |
| | | }); |
| | | |
| | | |
| | | |
| | | }, |
| | | mouseDown: function(opts) { |
| | | var mode = canv.getMode(); |
| | | if(mode !== mode_id) return; |
| | | |
| | | |
| | | var e = opts.event; |
| | | var x = start_x = opts.start_x; |
| | | var y = start_y = opts.start_y; |
| | |
| | | cur_shape.setAttribute('d', current_d); |
| | | canv.pathActions.fixEnd(cur_shape); |
| | | } |
| | | |
| | | cur_shape.setAttribute('transform', "translate(" + x + "," + y + ") scale(0.005) translate(" + -x + "," + -y + ")"); |
| | | |
| | | cur_shape.setAttribute('transform', "translate(" + x + "," + y + ") scale(0.005) translate(" + -x + "," + -y + ")"); |
| | | // console.time('b'); |
| | | canv.recalculateDimensions(cur_shape); |
| | | var tlist = canv.getTransformList(cur_shape); |
| | |
| | | mouseMove: function(opts) { |
| | | var mode = canv.getMode(); |
| | | if(mode !== mode_id) return; |
| | | |
| | | |
| | | var zoom = canv.getZoom(); |
| | | var evt = opts.event |
| | | |
| | | |
| | | var x = opts.mouse_x/zoom; |
| | | var y = opts.mouse_y/zoom; |
| | | |
| | | |
| | | var tlist = canv.getTransformList(cur_shape), |
| | | box = cur_shape.getBBox(), |
| | | box = cur_shape.getBBox(), |
| | | left = box.x, top = box.y, width = box.width, |
| | | height = box.height; |
| | | var dx = (x-start_x), dy = (y-start_y); |
| | |
| | | |
| | | var ts = null, |
| | | tx = 0, ty = 0, |
| | | sy = height ? (height+dy)/height : 1, |
| | | sy = height ? (height+dy)/height : 1, |
| | | sx = width ? (width+dx)/width : 1; |
| | | |
| | | var sx = newbox.width / lastBBox.width; |
| | | var sy = newbox.height / lastBBox.height; |
| | | |
| | | |
| | | sx = sx || 1; |
| | | sy = sy || 1; |
| | | |
| | | |
| | | // Not perfect, but mostly works... |
| | | |
| | | |
| | | if(x < start_x) { |
| | | tx = lastBBox.width; |
| | | } |
| | | if(y < start_y) ty = lastBBox.height; |
| | | |
| | | |
| | | // update the transform list with translate,scale,translate |
| | | var translateOrigin = svgroot.createSVGTransform(), |
| | | scale = svgroot.createSVGTransform(), |
| | | translateBack = svgroot.createSVGTransform(); |
| | | |
| | | |
| | | translateOrigin.setTranslate(-(left+tx), -(top+ty)); |
| | | if(evt.shiftKey) { |
| | | replaced = true |
| | |
| | | mouseUp: function(opts) { |
| | | var mode = canv.getMode(); |
| | | if(mode !== mode_id) return; |
| | | |
| | | |
| | | if(opts.mouse_x == start_x && opts.mouse_y == start_y) { |
| | | return { |
| | | keep: false, |
| | |
| | | element: cur_shape, |
| | | started: false |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | |
| | | l3.445-6.979l3.447,6.98l7.702,1.121l-5.573,5.434L20.328,24.166z"/> |
| | | </svg> |
| | | </g> |
| | | </svg> |
| | | </svg> |
| | |
| | | l-2.5,2.482l0.167,0.166c0.46,0.457,0.46,1.197,0,1.655l-1.5,1.489c-0.46,0.456-1.207,0.456-1.667,0l-0.333-0.332L7.708,22.809l-0.223,0.037c-1.787,0.296-3.805,1.978-3.826,1.995l-0.496,0.417L2.702,24.801z"/> |
| | | </svg> |
| | | </g> |
| | | |
| | | |
| | | <g id="svg_eof"/> |
| | | </svg> |
| | | </svg> |
| | |
| | | */ |
| | | // Very minimal PHP file, all we do is Base64 encode the uploaded file and |
| | | // return it to the editor |
| | | |
| | | |
| | | $file = $_FILES['svg_file']['tmp_name']; |
| | | |
| | | |
| | | $output = file_get_contents($file); |
| | | |
| | | |
| | | $type = $_REQUEST['type']; |
| | | |
| | | |
| | | $prefix = ''; |
| | | |
| | | |
| | | // Make Data URL prefix for import image |
| | | if($type == 'import_img') { |
| | | $info = getimagesize($file); |
| | |
| | | * Copyright(c) 2010 Alexis Deveria |
| | | * |
| | | */ |
| | | |
| | | |
| | | if(!isset($_POST['output_svg']) && !isset($_POST['output_png'])) { |
| | | die('post fail'); |
| | | } |
| | |
| | | header("Content-Disposition: attachment; filename=" . $file); |
| | | header("Content-Type: " . $mime); |
| | | header("Content-Transfer-Encoding: binary"); |
| | | |
| | | |
| | | echo $contents; |
| | | |
| | | ?> |
| | | |
| | | ?> |
| | |
| | | </g> |
| | | </svg> |
| | | </g> |
| | | |
| | | |
| | | <g id="edit_foreign"> |
| | | <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="34 38 170 170" overflow="hidden"> |
| | | <g fill="#000088"> |
| | |
| | | </g> |
| | | </svg> |
| | | </g> |
| | | |
| | | |
| | | <g id="svg_eof"/> |
| | | </svg> |
| | | </svg> |
| | |
| | | <svg xmlns="http://www.w3.org/2000/svg"> |
| | | <!-- |
| | | <!-- |
| | | Sample icons file. This file looks like an SVG file with groups as its |
| | | children. Each group element has an ID that must match the ID of the button given |
| | | in the extension. The SVG inside the group makes up the actual icon, and |
| | | needs use a viewBox instead of width/height for it to scale properly. |
| | | |
| | | |
| | | Multiple icons can be included, each within their own group. |
| | | --> |
| | | <g id="view_grid"> |
| | |
| | | <svg xmlns="http://www.w3.org/2000/svg"> |
| | | <!-- |
| | | <!-- |
| | | Sample icons file. This file looks like an SVG file with groups as its |
| | | children. Each group element has an ID that must match the ID of the button given |
| | | in the extension. The SVG inside the group makes up the actual icon, and |
| | | needs use a viewBox instead of width/height for it to scale properly. |
| | | |
| | | |
| | | Multiple icons can be included, each within their own group. |
| | | --> |
| | | <g id="hello_world"> |
| | |
| | | </g> |
| | | </svg> |
| | | </g> |
| | | </svg> |
| | | </svg> |
| | |
| | | $('a').click(function() { |
| | | var href = this.href; |
| | | var target = window.parent; |
| | | // Convert Non-SVG images to data URL first |
| | | // Convert Non-SVG images to data URL first |
| | | // (this could also have been done server-side by the library) |
| | | if(this.href.indexOf('.svg') === -1) { |
| | | |
| | |
| | | id: href |
| | | }); |
| | | target.postMessage(meta_str, "*"); |
| | | |
| | | |
| | | var img = new Image(); |
| | | img.onload = function() { |
| | | var canvas = document.createElement("canvas"); |
| | |
| | | data = '|' + href + '|' + data; |
| | | // This is where the magic happens! |
| | | target.postMessage(data, "*"); |
| | | |
| | | |
| | | }, 'html'); // 'html' is necessary to keep returned data as a string |
| | | } |
| | | return false; |
| | |
| | | <stop stop-color="#ffff00" offset="1"/> |
| | | </linearGradient> |
| | | </defs> |
| | | </svg> |
| | | </svg> |
| | |
| | | </g> |
| | | <g id="textmarker"> |
| | | <svg viewBox="-60 -60 120 120" xmlns="http://www.w3.org/2000/svg"> |
| | | <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="120" y="40" x="0" stroke-width="0" stroke="#ff7f00" fill="#ff7f00">T</text> |
| | | <text xml:space="preserve" text-anchor="middle" font-family="serif" font-size="120" y="40" x="0" stroke-width="0" stroke="#ff7f00" fill="#ff7f00">T</text> |
| | | </svg> |
| | | </g> |
| | | <g id="mkr_markers_off"> |
| | |
| | | "u_turn": "m1.00059,299.00055l0,-167.62497l0,0c0,-72.00411 58.37087,-130.37499 130.375,-130.37499l0,0l0,0c34.57759,0 67.73898,13.7359 92.18906,38.18595c24.45006,24.45005 38.18593,57.61144 38.18593,92.18904l0,18.625l37.24997,0l-74.49995,74.50002l-74.50002,-74.50002l37.25,0l0,-18.625c0,-30.8589 -25.0161,-55.87498 -55.87498,-55.87498l0,0l0,0c-30.85892,0 -55.875,25.01608 -55.875,55.87498l0,167.62497z", |
| | | "up": "m1.49805,149.64304l148.50121,-148.00241l148.50121,148.00241l-74.25061,0l0,148.71457l-148.5012,0l0,-148.71457z", |
| | | "3_ways": "m1,159.61292l52.87097,-52.87097l0,26.43549l69.69355,0l0,-79.30646l-26.43549,0l52.87096,-52.87097l52.87097,52.87097l-26.43549,0l0,79.30646l69.69356,0l0,-26.43549l52.87096,52.87097l-52.87096,52.87097l0,-26.43549l-192.25807,0l0,26.43549l-52.87097,-52.87097z", |
| | | |
| | | |
| | | "maximize_2": "m1,149.99998l67.05,-67.05l0,33.52501l48.425,0l0,-48.425l-33.52501,0l67.05,-67.05l67.04999,67.05l-33.52499,0l0,48.425l48.42502,0l0,-33.52501l67.04997,67.05l-67.04997,67.04999l0,-33.52499l-48.42502,0l0,48.42502l33.52499,0l-67.04999,67.04997l-67.05,-67.04997l33.52501,0l0,-48.42502l-48.425,0l0,33.52499l-67.05,-67.04999z", |
| | | "raph_download": "m149.92238,36.82233c-65.72484,0 -119.00005,53.27818 -119.00005,119c0,65.72183 53.27521,119 119.00005,119c65.7218,0 118.99995,-53.27817 118.99995,-119c0,-65.72182 -53.27815,-119 -118.99995,-119zm0,223.73889c-12.68407,0 -22.97548,-10.28841 -22.97548,-22.97537s10.28215,-22.97583 22.97548,-22.97583c12.69009,0 22.97223,10.28247 22.97223,22.97583s-10.28214,22.97537 -22.97223,22.97537zm0,-63.08578l-64.34113,-53.72815l28.40379,0l0,-71.87465l71.88103,0l0,71.87465l28.39413,0l-64.33783,53.72815z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "raph_talkq": "m151.95413,37.83469c-77.87229,0 -140.99913,47.34782 -140.99913,105.75328c0,19.94707 7.46298,38.60376 20.30468,54.52449l-20.30468,44.51276l56.5302,-14.49918c23.55888,13.25453 52.74399,21.2072 84.46893,21.2072c77.87204,0 141.00085,-47.3481 141.00085,-105.74527s-63.12881,-105.75328 -141.00085,-105.75328zm8.74214,165.54159l-19.83006,0l0,-19.02583l19.83006,0l0,19.02583zm-0.96628,-33.04105l-17.89746,0l-1.77126,-81.41087l21.28053,0l-1.61182,81.41087z", |
| | | "raph_talke": "m151.46997,37.82469c-78.14881,0 -141.49997,47.50852 -141.49997,106.12126c0,20.02579 7.4895,38.74088 20.37584,54.71835l-20.37584,44.67868l56.73113,-14.55873c23.6405,13.30168 52.9314,21.29042 84.76884,21.29042c78.149,0 141.50003,-47.51628 141.50003,-106.12872s-63.35103,-106.12126 -141.50003,-106.12126zm9.92621,166.12944l-19.90253,0l0,-19.09268l19.90253,0l0,19.09268zm0,-39.48112l0,6.31543l-19.90253,0l0,-7.77286c0,-23.45735 26.69424,-27.17406 26.69424,-43.83023c0,-7.60336 -6.79172,-13.43297 -15.69612,-13.43297c-9.21872,0 -17.31352,6.79367 -17.31352,6.79367l-11.32195,-14.0807c0,0 11.15999,-11.65153 30.41292,-11.65153c18.29469,0 35.27467,11.32766 35.27467,30.41285c0.0097,26.71156 -28.14772,29.78053 -28.14772,47.24634z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "punched_tape": "m1.00047,30.80047l0,0c0,16.45808 33.35479,29.8 74.50001,29.8c41.1452,0 74.49998,-13.34192 74.49998,-29.8l0,0c0,-16.45809 33.3548,-29.8 74.50002,-29.8c41.14522,0 74.49998,13.34192 74.49998,29.8l0,238.4c0,-16.45808 -33.35477,-29.80002 -74.49998,-29.80002c-41.14522,0 -74.50002,13.34193 -74.50002,29.80002c0,16.45807 -33.35478,29.79999 -74.49998,29.79999c-41.14522,0 -74.50001,-13.34192 -74.50001,-29.79999z", |
| | | "wave": "m1,37.20809c99.33355,-125.42461 198.66708,125.4246 298.00061,0l0,225.76426c-99.33353,125.42462 -198.66706,-125.42459 -298.00061,0z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "chess_queen": "m59.54884,298.46313c-11.18457,2.51251 -19.80814,-14.30008 -5.94004,-16.129c12.20336,0.23074 -3.0349,-11.94995 7.98012,-16.05304c12.67021,-12.36537 25.23749,-25.26018 33.3575,-41.17609c-4.09126,-5.42482 -10.84344,-10.60782 -9.96117,-18.03085c7.964,-2.71161 19.82806,-0.87375 20.29981,-13.44502c7.24239,-22.68985 9.1741,-46.67986 10.76167,-70.3136c-7.99255,-6.33596 -24.45116,-0.33371 -35.62089,-3.56097c-16.94488,-4.5746 6.31873,-13.33291 13.78075,-12.6113c6.70493,0.01006 16.63324,-4.12222 5.41084,-7.2804c9.46686,-0.43687 23.08297,-12.44518 7.51486,-16.77373c11.54188,-8.28655 2.64816,-26.31929 -2.17102,-36.68976c-7.265,-12.52285 -19.21146,-21.59242 -32.71435,-26.42871c-2.18616,-12.77 18.63421,-8.99565 27.07909,-9.65835c12.78728,0.48775 25.82639,-0.15282 36.96732,-7.11507c15.05278,-6.96464 27.8495,4.65901 41.61934,7.11611c13.92807,0.89699 28.41634,-2.50577 41.97807,1.44028c4.20209,2.98911 11.18788,7.71034 2.77457,9.97613c-16.06789,8.94404 -31.07338,22.15693 -35.10127,40.92605c-6.0766,10.44077 4.6955,19.50048 -5.15381,26.98807c-0.10249,8.80961 22.85634,10.04067 10.00395,14.37878c8.80815,4.77542 27.69864,1.76332 29.62625,12.3696c-7.99612,6.2903 -19.2092,3.80788 -28.79007,4.39512c-3.2489,1.10706 -11.41316,-2.70125 -10.17032,2.89742c-0.6366,25.08775 5.87923,49.75521 12.1806,73.83221c0.00804,11.79608 29.09497,5.10777 12.92737,18.49597c-11.94247,10.28146 5.56685,24.68452 11.63272,33.82986c8.25099,10.03221 22.89711,15.11021 21.67468,29.8362c8.40468,0.60507 18.40166,13.69095 6.78131,16.95151c-62.8902,1.31946 -125.82766,2.22778 -188.72791,1.83258z", |
| | | "chess_rock": "m70.40736,299.11804c-15.60727,2.87628 -15.90823,-19.81082 -1.8931,-20.53482c-4.2011,-9.73361 -0.98556,-21.67557 5.22356,-30.68398c8.90442,-15.05035 22.29623,-30.00999 19.52936,-48.8515c-0.95786,-9.8022 -13.10349,-27.37677 5.72565,-24.85997c5.09087,-9.77498 2.13017,-24.16621 5.9483,-35.39389c3.33424,-21.28385 10.75552,-43.9948 2.86147,-65.09612c-4.97705,-11.23243 -17.62387,-18.62589 -16.26645,-32.35733c-1.42947,-13.39034 -0.95647,-26.88279 0.60455,-40.23392c6.07738,0.50975 12.84039,-1.27954 18.38155,1.475c-0.04153,12.96106 12.26991,10.08973 10.7935,-0.92486c3.23881,-1.28251 8.60017,-0.18413 12.6562,-0.55014c18.03256,0 36.06522,0 54.09778,0c-2.06311,7.51434 3.5195,17.19948 10.5887,8.35272c-1.93379,-11.75267 14.25911,-7.86334 10.37854,2.24694c0.22855,13.39515 1.87041,27.25403 -1.89201,40.29753c-6.12787,5.2086 -6.22449,15.45995 -13.90137,21.60233c-6.16908,11.51656 -3.45045,25.43306 -2.7644,37.9428c2.61279,18.51363 6.92676,36.79671 8.00221,55.52328c-0.76923,10.18126 20.18948,7.18474 11.15244,19.71645c-9.87662,8.41151 -4.0954,22.61668 -0.18413,32.66171c7.71916,17.36203 23.99019,32.95758 21.5343,53.32025c-1.94743,8.89606 14.16618,5.88821 9.97758,17.34372c-0.12151,14.11871 -21.10172,5.04239 -30.39526,8.00793c-46.7146,0.56656 -93.44374,1.44144 -140.159,0.99585z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "times": "m1.00089,73.36786l72.36697,-72.36697l76.87431,76.87368l76.87431,-76.87368l72.36765,72.36697l-76.87433,76.87431l76.87433,76.87431l-72.36765,72.36765l-76.87431,-76.87433l-76.87431,76.87433l-72.36697,-72.36765l76.87368,-76.87431l-76.87368,-76.87431z", |
| | | "plus": "m1.00211,102.40185l101.39974,0l0,-101.39975l95.45412,0l0,101.39975l101.3997,0l0,95.45412l-101.3997,0l0,101.3997l-95.45412,0l0,-101.3997l-101.39974,0z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "note_half": "m126.15042,298.46863c-16.82465,-2.00256 -23.94094,-21.72537 -20.50175,-36.48892c5.91676,-23.32147 29.06407,-39.43811 52.28738,-42.05833c8.81128,-0.72736 18.52644,-0.60411 25.78337,4.94891c5.95566,-2.36537 1.76544,-11.69408 2.85246,-17.2854c0,-68.81003 0,-137.6201 0,-206.43012c14.97716,-2.18183 5.30603,19.02521 7.94768,27.71113c-0.09924,75.95386 0.62134,151.91534 -0.76007,227.86198c-7.30341,28.38443 -39.39244,46.36703 -67.60907,41.74075zm2.8452,-12.40747c22.98492,-7.3089 44.37535,-22.56259 55.31068,-44.49013c0.95541,-13.55527 -16.00528,-10.73553 -23.6718,-6.15868c-13.5024,6.76553 -26.21068,15.65268 -36.74068,26.51123c-6.99238,6.4256 -15.89267,26.17618 0.78696,25.05563l2.30408,-0.3252l2.01074,-0.59286l0,0z", |
| | | "note_whole": "m130.51953,195.65829c-18.47874,-2.9818 -38.13104,-9.41365 -49.81914,-24.96915c-4.87284,-6.5025 -6.85786,-14.78229 -6.23731,-22.81049c-0.81288,-10.41815 5.23877,-19.78279 13.11027,-26.04227c15.71593,-12.69998 36.4436,-17.12403 56.18739,-18.21444c21.01479,-0.84168 42.85126,2.6237 61.20964,13.32044c11.19275,6.86285 21.10484,18.66567 20.54733,32.45548c0.612,8.09668 -0.91914,16.68852 -6.59294,22.84065c-11.24144,13.63681 -28.92738,19.59387 -45.72455,22.87505c-14.06622,2.54445 -28.55254,2.69426 -42.68069,0.54472zm34.33258,-7.95905c9.06644,-1.9348 15.01314,-11.03741 14.88672,-20.03276c1.54852,-18.89767 -4.73529,-39.56404 -20.09192,-51.52234c-8.61502,-6.06224 -20.8895,-6.65757 -30.00668,-1.42353c-6.79661,4.10276 -9.33514,12.23845 -9.31819,19.7824c-0.73656,16.04378 3.97748,32.8201 14.66045,45.0217c7.49542,7.87076 19.3475,12.08484 29.86963,8.17453z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "shark": "M 0.0576 184.3533 C -1 180.6667 16.109 171.9119 28.5757 164.4365 C 38.4736 158.5251 49.2812 151.3596 59.5749 145.0374 C 68.1791 139.7532 87.1667 130.8333 89.3069 125.0559 C 91.8073 118.3062 96.2785 105.8677 101.081 96.5857 C 104.7343 89.4927 111.6667 80.1667 115.4351 80.0032 C 116.8965 79.9398 118.1484 83.3223 118.1484 83.3223 C 118.1484 83.3223 122.1099 105.8601 130.8815 116.7246 C 134.3825 121.0713 144.5294 120.8968 148.261 120.6279 C 173.1667 118.8333 205.8755 122.4387 205.8755 122.4387 C 205.8755 122.4387 216.5042 115.1404 218.2813 114.3643 C 222.787 112.4434 218.2767 117.0532 229.4009 125.4153 C 235.5 130 238.8499 128.6677 243.6637 127.1807 C 245.6044 126.5642 246.7613 124.552 248.3672 123.3879 C 250.4222 121.9041 291.7726 94.0098 295.9696 92.7549 C 300.1667 91.5 299.9836 99.5272 299.2917 101.4797 C 291.6667 123 270.9678 137.8057 270.9678 137.8057 C 270.9678 137.8057 269.3696 140.9553 270.0887 144.2822 C 270.7395 147.3027 281.8333 169.5 276.0176 168.1533 C 273.6004 168.4127 267.6419 165.6692 267.6419 165.6692 C 267.6419 165.6692 261.6635 162.3462 257.3862 157.6331 C 254.3608 154.2813 252.5989 149.0752 252.5989 149.0752 C 252.5989 149.0752 251.2239 144.8431 247.1571 143.6204 C 237.3333 140.6667 229.9983 144.0425 227.4753 146.9565 C 225.3138 149.4482 226.6418 153.6443 226.6418 153.6443 C 226.6418 153.6443 229.6977 156.9539 227.8292 157.125 C 219.7236 157.823 215.9372 151.9265 210.3013 148.6626 C 208.3377 147.5349 205.3333 145.6667 200.2473 149.5073 C 197.6903 151.4382 195.8333 161.3333 191.8562 164.625 C 189.1771 166.8424 184.8923 164.2864 184.8923 164.2864 C 184.8923 164.2864 178.3735 162.0303 173.7651 161.9048 C 152.75 172.25 114.5828 181.7512 114.5828 181.7512 C 114.5828 181.7512 119.6706 187.7639 122.3383 191.9104 C 123.6625 193.978 123.6093 195.7603 123.6093 195.7603 C 123.6093 195.7603 124.9374 198.5923 122.1708 198.9861 C 120.5306 199.2144 104.5744 196.5801 96.0502 193.2532 C 88.873 190.4495 83.203 186.3447 83.203 186.3447 C 83.203 186.3447 57.0849 188.4819 40.3333 189.1667 C 30.5761 189.551 1.5102 189.4165 0.0576 184.3533 Z", |
| | | "dolphin": "M151.054, 51.526c-5.487, 2.029-10.494, 4.734-15.541, 7.145c-1.72, 0.821-3.674, 2.126-5.268, 2.525c-4.062, 1.013-10.418-0.759-15.596-0.944c-12.942-0.459-21.321, 0.493-31.96, 2.097c-4.979, 0.749-10.134, 1.451-14.504, 2.732c-3.733, 1.095-8.013, 3.542-12.19, 5.6c-6.601, 3.253-11.097, 6.316-16.244, 10.238 c-8.603, 6.551-14.019, 14.798-20.314, 23.859c-2.749, 3.955-6.708, 9.848-6.905, 14.528c-3.639, 5.515-9.168, 8.882-10.555, 16.955c1.939, 4.721, 6.964, 0.523, 9.992-1.049c2.504-1.304, 5.198-2.862, 7.417-3.487c11.533-3.251, 27.605, 1.396, 38.834-1.583c3.98-1.055, 7.428-3.185, 11.382-4.087c3.755-0.859, 6.627, 0.662, 9.304, 1.818c1.422, 0.616, 2.92, 1.45, 4.212, 2.113 c8.366, 4.323, 16.728, 8.906, 27.96, 10.632c9.015, 1.383, 16.847-1.256, 24.175-2.682c1.86-0.363, 4.263-0.231, 5.674-1.819 c-5.849-1.321-10.703-3.574-16.811-5.979c-8.023-3.156-14.255-5.291-17.287-11.627c3.591-0.94, 7.75-0.243, 11.488, 0.412 c4.082, 0.712, 8.133, 1.381, 12.05, 2.025c16.539, 2.723, 28.995, 7.294, 41.585, 13.224c6.116, 2.877, 11.752, 6.886, 16.936, 10.251 c10.617, 6.9, 19.68, 15.468, 28.228, 24.802c3.869, 4.226, 7.325, 9.518, 11.521, 14.562c1.834, 2.205, 3.678, 4.665, 5.638, 7.388 c1.873, 2.587, 4.731, 5.758, 5.127, 8.021c0.446, 2.499-0.881, 5.239-1.549, 7.97c-1.155, 4.744-2.007, 9.833-1.62, 14.704 c0.506, 6.3, 1.914, 12.436, 4.866, 17.209c1.281-1.139, 1.804-3.144, 2.464-4.98c3.236-4.136, 7.541-8.267, 7.648-15.15 c8.839, 4.568, 26.008, 4.185, 36.316, 4.066c3.099-0.036, 6.256, 0.292, 8.823-0.913c-5.414-3.138-9.388-7.109-14.094-11.163c-7.12-6.125-13.009-11.285-23.505-14.562c-3.402-1.062-7.297-1.637-9.161-3.605c-1.433-1.506-1.869-4.842-2.596-8.055 c-1.955-8.687-4.497-17.904-6.765-25.215c-6.806-21.976-17.194-41.507-31.015-56.675c-7.004-7.692-15.368-13.956-24.386-20.921 c-1.541-2.416-4.428-5.675-5.024-9.359c-0.61-3.793, 0.49-7.122, 2.834-9.67c5.128-3.742, 13.185-4.156, 16.669-9.757 c-4.555-3.279-10.207-4.24-15.753-4.776C171.573, 47.185, 160.348, 48.085, 151.054, 51.526z", |
| | | "he_hen": "m176.04681,296.29803c-8.82596,-3.77927 -18.43298,1.74493 -27.86224,-3.75964c7.62581,-0.4744 19.08463,-0.03574 17.06104,-11.34488c3.33665,-13.20654 -3.43475,-27.06163 2.20258,-38.55534c-8.82878,-8.42361 -18.09561,-18.39673 -22.80272,-30.16238c-0.9447,4.74663 -1.81537,8.52257 -3.158,0.33916c-0.76965,-4.00471 -0.30261,9.89931 -3.24527,0.14346c-3.10373,-8.67493 -11.4597,-31.29446 -14.05236,-10.31462c-1.0768,10.8262 -4.45592,3.14465 -6.0004,-3.72562c-1.56924,-13.22943 -7.23737,-25.48523 -8.72193,-38.68883c5.80227,-8.36407 -0.82715,-9.5029 -3.91098,-1.15848c-3.39584,13.23767 -6.30494,26.33923 -2.7624,39.9769c-4.70789,3.85124 -13.79493,-17.92216 -9.61541,-26.27414c3.62592,-9.45018 2.81974,-19.09607 3.42313,-25.48878c3.31529,-7.21146 -3.22571,-15.04807 0.25123,-22.73853c-8.88477,9.68631 -16.83011,16.38615 -14.33428,31.58234c-1.10283,3.79079 3.703,25.58844 0.64231,17.56184c-5.77861,-15.66916 -5.78305,-33.02271 -1.43442,-49.01125c0.00535,-12.20366 -9.89253,21.0744 -9.16187,4.76299c-0.93676,-12.30159 4.13303,-25.82869 8.93452,-35.55499c-5.46675,-6.50523 -23.17289,-1.89566 -14.79648,-15.70558c8.24343,-7.01884 7.35999,-16.67057 -3.85936,-8.18394c-17.3246,12.72424 -31.69814,29.07174 -47.58007,43.52234c15.25898,-19.61487 32.46107,-38.59572 53.7519,-51.75492c20.64337,-12.99951 50.5769,-14.34346 68.38963,4.28573c4.53072,7.97979 15.06177,13.26968 17.57275,20.45337c-1.84586,10.76744 5.10652,16.10654 5.85289,25.57021c4.38731,7.30244 -3.95828,20.43125 8.52597,16.64671c14.20137,-0.01996 33.63664,-3.16645 34.74754,-20.87874c5.66772,-25.50935 8.27689,-54.0092 26.4256,-74.31131c10.08655,-5.89642 3.82147,-4.32716 -3.54926,-5.29837c-6.51613,-7.58361 6.57724,-19.75743 13.02319,-21.14511c-1.112,-17.9227 10.53479,10.74471 13.86426,-2.41437c4.99586,0.09501 7.43144,12.08141 10.46855,2.29789c9.05719,7.66376 18.6297,19.25661 6.66562,29.92943c13.61102,6.52517 -13.86911,2.29947 -2.14532,12.29652c9.6759,9.35194 2.83621,26.62759 -5.10654,34.15639c-0.3085,5.66077 9.31277,13.88494 11.24728,20.75249c9.99454,19.34809 11.9986,42.36646 8.16797,63.56847c-5.39346,19.98318 -25.46588,28.67906 -39.65833,41.37386c-12.12337,9.93893 -7.85776,27.37115 -13.59781,40.42342c0.57072,7.5369 4.77751,16.1196 10.7547,20.66925c8.66214,4.84064 18.81006,7.96561 25.81393,15.05286c-6.39667,3.34055 -19.43893,-10.21753 -19.56508,0.39017c-9.50252,-12.34393 -23.7677,-4.06104 -34.21234,-13.55405c8.69193,1.65643 19.99033,0.8027 10.47188,-9.61145c-3.75841,-8.80696 -15.07852,-11.84618 -15.37883,-22.49022c-10.66643,6.69647 -17.92447,15.81358 -25.66988,24.90395c-12.85808,-0.80322 -13.41248,25.11618 0.47165,24.73163c5.7019,1.45825 27.10161,9.40335 10.25006,7.35107c-5.02289,-0.89746 -10.47203,-4.04099 -10.31842,1.85727c-2.30338,-0.41431 -4.35982,-1.56003 -6.48019,-2.47418z", |
| | | "hen": "m131.70792,299.20142c-2.65045,-8.04401 -50.59061,2.01245 -25.50379,-8.40613c9.71836,-2.24731 29.67359,0.57056 9.8335,-5.50568c22.5928,7.62228 32.60569,-19.08859 34.06422,-37.09636c-21.02885,-6.55212 -24.67069,-31.02429 -46.83106,-37.61485c-16.88445,-13.23645 -41.63732,-12.83168 -52.35418,-33.24014c-10.17476,-18.17259 -4.4284,-40.29292 -2.74405,-59.92338c4.00956,-20.72375 12.14967,-41.69897 10.53991,-62.75727c-16.41068,9.44812 -22.4106,-11.67328 -22.78485,-18.27062c-12.07958,3.08904 -19.7317,3.22594 -6.59584,-7.5194c5.87008,-8.14037 8.78346,-25.92081 18.16113,-23.25189c2.47408,-10.763 9.04029,4.89351 16.30021,-4.61621c4.44867,3.35889 13.85731,7.10325 3.42817,13.02555c18.83147,9.50194 34.07959,23.95835 41.92437,42.43233c7.86127,18.77559 23.52317,39.06593 48.8149,33.98585c22.90038,3.93186 49.73083,-9.80992 48.68822,-32.86776c0.44391,-16.33654 16.52325,-54.48924 38.19395,-35.09801c16.24046,6.22802 34.92778,21.65468 31.09642,39.16159c-2.21887,18.0508 -0.50452,36.25767 1.60162,54.45551c-13.60181,10.0825 -11.15982,27.59631 -20.65894,40.7838c7.8804,18.56862 0.29095,38.62871 -12.60841,53.70848c-12.90314,13.89935 -31.76248,26.24356 -52.66508,24.4381c-7.98578,13.29396 9.42929,24.99069 15.57339,25.73553c-16.01053,-5.1321 -13.75549,4.70874 -8.47672,15.2244c4.94576,19.6875 -10.58037,-17.53909 -20.60904,0.27255c-7.77597,7.68976 -38.86531,10.29276 -13.69539,1.07587c21.48048,-7.96875 -24.12099,-12.95142 -13.99879,5.00586c3.34996,7.49203 22.77361,10.79092 2.32814,7.93628c-9.02753,-4.74515 -13.85625,12.10397 -21.02202,8.92599zm43.09088,-34.62769c7.8596,-9.56569 10.12141,-37.24054 -6.87671,-17.06372c-13.43553,10.88889 -18.29311,29.6301 6.87671,17.06372z", |
| | | "hen": "m131.70792,299.20142c-2.65045,-8.04401 -50.59061,2.01245 -25.50379,-8.40613c9.71836,-2.24731 29.67359,0.57056 9.8335,-5.50568c22.5928,7.62228 32.60569,-19.08859 34.06422,-37.09636c-21.02885,-6.55212 -24.67069,-31.02429 -46.83106,-37.61485c-16.88445,-13.23645 -41.63732,-12.83168 -52.35418,-33.24014c-10.17476,-18.17259 -4.4284,-40.29292 -2.74405,-59.92338c4.00956,-20.72375 12.14967,-41.69897 10.53991,-62.75727c-16.41068,9.44812 -22.4106,-11.67328 -22.78485,-18.27062c-12.07958,3.08904 -19.7317,3.22594 -6.59584,-7.5194c5.87008,-8.14037 8.78346,-25.92081 18.16113,-23.25189c2.47408,-10.763 9.04029,4.89351 16.30021,-4.61621c4.44867,3.35889 13.85731,7.10325 3.42817,13.02555c18.83147,9.50194 34.07959,23.95835 41.92437,42.43233c7.86127,18.77559 23.52317,39.06593 48.8149,33.98585c22.90038,3.93186 49.73083,-9.80992 48.68822,-32.86776c0.44391,-16.33654 16.52325,-54.48924 38.19395,-35.09801c16.24046,6.22802 34.92778,21.65468 31.09642,39.16159c-2.21887,18.0508 -0.50452,36.25767 1.60162,54.45551c-13.60181,10.0825 -11.15982,27.59631 -20.65894,40.7838c7.8804,18.56862 0.29095,38.62871 -12.60841,53.70848c-12.90314,13.89935 -31.76248,26.24356 -52.66508,24.4381c-7.98578,13.29396 9.42929,24.99069 15.57339,25.73553c-16.01053,-5.1321 -13.75549,4.70874 -8.47672,15.2244c4.94576,19.6875 -10.58037,-17.53909 -20.60904,0.27255c-7.77597,7.68976 -38.86531,10.29276 -13.69539,1.07587c21.48048,-7.96875 -24.12099,-12.95142 -13.99879,5.00586c3.34996,7.49203 22.77361,10.79092 2.32814,7.93628c-9.02753,-4.74515 -13.85625,12.10397 -21.02202,8.92599zm43.09088,-34.62769c7.8596,-9.56569 10.12141,-37.24054 -6.87671,-17.06372c-13.43553,10.88889 -18.29311,29.6301 6.87671,17.06372z", |
| | | "mythic_unicorn_2": "m182.0204,297.85391c-5.77818,-7.90314 -14.7635,-8.80438 -16.9241,-20.05347c-1.69348,-6.11859 -17.65829,-14.32483 -8.20955,-3.3428c7.2961,6.61768 15.96432,31.02682 -1.98563,23.31473c-13.65228,-5.01041 -14.2377,-20.48209 -17.89716,-32.06519c-11.90031,-8.25644 3.07674,-25.71408 -9.73651,-36.29276c-10.87482,-11.04288 -3.30119,-31.72456 -18.8404,-39.55457c-7.79965,-3.16566 -11.1757,18.69177 -12.48895,2.70163c-4.27309,-16.17242 -19.36451,7.86156 -29.42789,5.31358c-8.12057,-0.70595 13.58361,-6.35143 3.22626,-7.87068c-6.08933,3.33348 -11.72343,9.09727 -12.68681,-0.44351c-7.3251,-4.35046 -22.68599,-11.29797 -22.28696,-18.20909c6.3611,-1.99829 27.83545,3.78387 24.11403,-4.25029c-6.38573,-2.42343 -7.54573,-9.04803 0.27553,-4.60205c15.41352,0.48352 33.48255,-5.66917 46.30758,6.09853c6.68958,4.11612 13.26701,18.87857 16.84827,4.53223c11.5443,-13.92389 34.83883,-15.10329 41.95536,-33.13124c1.72211,-8.72215 -5.28903,-13.69839 -11.24521,-15.46512c-1.15878,-2.86641 -3.13139,-15.03612 -8.05675,-8.8949c0.22449,-5.37502 4.84473,-18.22859 -5.38927,-12.53831c-1.03801,-11.44846 8.74879,-22.87025 -4.19783,-31.20716c12.13029,2.25027 9.73825,-11.57887 7.09616,-13.77212c7.19073,-1.02106 15.62939,-7.49186 11.66467,-15.50808c7.80894,14.17675 8.07971,-17.19902 14.50877,-3.67512c11.83272,1.93988 -3.67599,-10.57163 7.20721,-7.77902c6.21443,0.21264 4.83423,-6.80917 10.41692,-1.50957c7.3886,-4.03149 -5.66409,-16.21531 6.26559,-7.74985c4.01033,3.484 16.77809,12.60911 14.48726,0.56772c11.33586,12.0923 20.25659,-11.23169 29.67625,-16.06186c3.73633,-4.47003 11.8613,-9.20071 4.36795,-0.66791c-4.97461,10.87669 -21.85179,22.64296 -17.31131,33.45053c-4.10985,3.74163 8.29224,8.44421 -1.58034,7.02768c-5.8488,6.31351 7.84134,18.1257 8.93388,28.06219c-3.13588,6.80826 -15.07657,14.53744 -19.90688,14.29315c1.76543,-8.76564 -2.06178,-20.19066 -13.24036,-15.23595c6.26202,11.45789 14.72818,22.40379 20.03253,34.86404c5.18462,12.24902 13.59059,26.39416 24.64981,10.62966c7.04883,-10.04763 27.18559,-9.90218 21.65419,6.41521c-2.82767,16.0232 4.74286,37.1706 -9.80374,48.20794c-8.77531,16.90973 -18.50392,-6.2874 -11.60965,-15.06308c-1.75673,-2.50781 -3.11575,-4.27809 2.02489,-7.7061c-1.06146,-2.57137 14.7939,-12.24554 6.80286,-18.18176c-9.0885,10.30594 -22.38708,22.23511 -18.69125,37.55475c2.99957,10.26601 -21.73944,27.86615 -19.76117,10.82875c0.44312,-6.62131 9.89648,-19.45415 7.72044,-21.10741c-6.90181,12.95006 -16.71997,25.39136 -31.55621,29.23625c-12.34084,0.73132 -18.80547,10.66779 -12.94504,21.69241c1.11998,15.62238 -7.12646,29.76141 -9.02499,44.972c3.52914,16.13283 25.01552,19.39287 27.93198,35.84959c5.01138,11.05234 -7.52405,9.41898 -13.36446,6.32639zm-30.55545,-48.12944c-1.80891,-7.29253 -5.53151,18.95699 -0.94273,5.02481l0.68695,-2.46143l0.25578,-2.56339z", |
| | | |
| | | |
| | | "rhino":"M 31.2973 189.1916 C 30.374 186.1509 30.2876 182.8892 30.2876 182.8892 C 30.2876 182.8892 18.6488 172.7592 12.9338 167.0182 C 8.1162 162.1747 0.1206 148.2926 0.1206 148.2926 C 0.1206 148.2926 -0.3045 144.7842 0.4415 144.6859 C 1.6515 144.5302 7.9245 150.0048 14.0462 153.201 C 20.3518 156.4936 27.5875 158.6592 27.5875 158.6592 L 35.5018 158.6592 C 35.5018 158.6592 29.0012 141.5758 37.34 143.8147 C 40.3528 144.0688 42.0178 150.5315 46.6067 151.2422 C 51.9836 149.9209 54.6313 134.4272 54.6313 134.4272 C 54.6313 134.4272 52.9961 131.5424 53.0697 128.803 C 53.129 126.9918 54.9114 124.9244 54.9114 124.9244 C 54.9114 124.9244 51.1096 125.5576 48.5035 124.7196 C 46.155 123.9635 42.5672 121.0233 41.6173 118.8496 C 40.4416 116.1589 40.7466 113.1821 39.4977 111.4715 C 39.3738 110.1291 41.1021 109.6715 42.02 110.3015 C 45.4753 112.6733 50.0547 112.9256 51.043 113.4111 C 55.1783 115.443 62.1528 115.7264 63.1698 115.3193 C 54.0175 103.9211 65.6289 101.5547 67.2467 101.3131 C 69.2713 103.514 72.3221 106.16 73.1967 108.5642 C 74.3559 110.0273 74.2616 107.9475 74.2616 107.9475 C 74.2616 107.9475 74.3209 101.8131 76.9637 97.2195 C 77.5729 96.1479 80.9405 92.7265 83.1856 92.4271 C 83.9995 92.3186 85.7254 92.0741 87.5618 90.4255 C 92.2537 86.2132 105.0561 86.9177 105.0561 86.9177 C 105.0561 86.9177 106.0924 87.3971 108.0301 87.3889 C 109.7409 87.3788 139.8456 85.6026 152.1574 90.03 C 160.433 93.0059 175.2345 92.1159 193.0635 87.0243 C 198.6909 85.4173 214.9442 85 214.9442 85 C 214.9442 85 221.0913 85.3409 226.0806 87.0274 C 233.8591 89.6567 248.6718 88.6388 257.7491 89.6018 C 261.2524 89.9747 267.9599 93.2576 273.5101 96.3221 C 290.9601 105.9565 301.1294 127.5316 299.8999 134.8799 C 297.5037 149.2014 283.2316 173.735 276.9266 184.5226 C 274.3758 188.8869 273.0623 195.5137 273.6205 200.5527 C 273.7831 202.0202 271.6895 205.6906 267.7195 208.1928 C 262.1246 211.7193 266.3419 216.8904 266.8591 219.2671 C 267.3741 221.6376 267.2024 224.6782 265.6837 225.3544 C 264.1713 226.0263 242.5547 229.81 241.9206 224.7663 C 238.7548 219.072 254.3001 210.4229 252.5226 200.3702 C 247.4359 193.6818 246.2545 178.7816 245.4402 176.4947 C 244.5885 166.2041 227.9237 182.3253 219.5206 185.6245 C 195.3696 195.1066 168.116 190.8322 165.9726 190.0358 C 163.0314 198.9738 166.1362 203.3924 166.3365 204.4804 C 165.6754 210.5755 172.1837 220.3454 173.6375 226.3336 C 174.8277 231.1329 154.4893 231.1329 148.9116 230.9416 C 144.3201 229.7082 151.2226 220.7226 152.3475 219.7199 C 153.8791 212.0003 145.337 205.08 145.337 205.08 C 145.337 205.08 144.7269 212.0003 143.029 217.8104 C 143.0998 220.549 145.8231 222.5392 146.2197 224.9814 C 146.6408 227.5896 144.6581 227.9297 144.6581 227.9297 C 144.6581 227.9297 129.0663 230.7259 125.1382 227.4769 C 123.1681 226.8586 121.4508 227.8662 120.0711 226.7946 C 119.1125 226.0447 120.6945 221.7545 121.8821 220.5681 C 122.8979 219.5479 129.6764 219.3277 129.7289 211.1167 C 128.0493 196.5313 114.2192 190.4252 113.1891 184.7516 C 106.4906 187.3721 99.4475 182.4468 99.4475 182.4468 C 99.4475 182.4468 97.6059 184.5796 95.5782 184.9831 C 93.9512 185.3028 87.9826 181.4695 85.9838 179.2361 C 85.3387 187.9827 78.1289 185.6491 78.1289 185.6491 C 78.1289 185.6491 75.58 189.9465 71.5288 192.0231 C 61.5427 197.142 59.7122 196.7349 55.59 200.6408 C 53.2684 202.8405 49.1881 199.5904 46.4922 200.6021 C 36.7298 204.2658 30.8317 199.5844 31.2973 189.1916 Z", |
| | | |
| | | |
| | | "tree": "M 27.2254 74.2515 C 25.9396 74.2515 25.2787 72.9597 25.2787 71.4106 C 25.2787 70.1191 25.6091 68.8652 26.5645 68.8652 C 27.2254 68.8652 28.2203 70.1191 28.5507 71.4106 C 29.2116 73.291 28.5507 74.2515 27.2254 74.2515 ZM 247.0194 147.96 C 249.9611 147.96 250.6219 148.2913 248.9661 150.5051 C 248.0107 152.0542 246.0245 153.3457 245.0691 153.3457 C 244.0743 153.3457 243.0829 152.0542 243.0829 150.5051 C 243.0829 148.918 244.4083 147.96 247.0194 147.96 ZM 41.6425 57.7979 C 38.7009 57.1711 38.3704 53.9971 41.6425 53.0388 C 43.2982 52.7437 44.2537 53.6655 44.2537 55.5842 C 44.2537 57.1711 43.2982 58.0933 41.6425 57.7979 ZM 4.9748 158.0671 C 8.9113 157.1448 8.9113 156.4819 7.586 154.3042 C 6.5946 152.719 6.2642 150.8005 6.9251 150.1736 C 7.2555 149.2136 8.9113 150.1736 9.8667 152.0542 C 11.192 154.5996 12.1833 154.9329 14.7945 153.3457 C 16.4144 152.3875 17.7361 151.759 17.7361 152.719 C 17.7361 153.3457 18.731 152.719 20.0168 151.4275 C 22.0031 149.5469 22.3335 145.4146 20.3473 143.2007 C 18.731 141.3201 10.5276 141.947 8.2469 144.1589 C 6.9251 145.7461 5.9302 145.4146 4.6444 142.574 C 2.6582 137.8508 2.6582 137.1877 7.2555 136.8926 C 11.192 136.8926 11.192 136.8926 7.9164 134.9741 C 6.2642 134.0518 4.6444 132.1335 4.6444 130.8796 C 4.6444 127.7058 9.2058 125.8252 11.192 128.0391 C 11.8529 128.9612 13.1388 129.9197 14.4641 129.9197 C 17.0753 129.9197 29.542 119.1853 29.542 116.9714 C 29.542 116.0115 30.8314 115.3848 32.1532 116.0115 C 33.773 116.3447 36.7147 115.3848 39.6958 113.7976 C 43.9232 111.2524 43.9232 110.957 41.6425 106.8264 C 40.0262 103.9858 38.04 103.0256 33.4426 103.0256 C 28.2203 103.0256 26.895 103.6526 25.2787 107.4534 C 24.6142 109.9985 22.6281 111.8792 21.3422 111.8792 C 19.0615 111.8792 18.4006 109.0403 20.6813 107.4534 C 21.6726 106.8264 22.3335 104.6128 22.3335 102.3989 C 22.3335 98.9312 21.6726 98.3044 17.4057 99.2268 C 13.1388 99.8535 13.1388 99.5581 14.1336 94.7988 C 14.7945 91.9583 15.7499 89.4131 16.4144 89.1177 C 17.0753 88.7864 17.7361 85.9456 17.7361 83.105 C 17.7361 77.4233 19.6864 76.4651 23.2925 80.5596 C 24.9446 82.7734 25.9396 83.105 26.5645 81.1863 C 27.2254 79.9326 29.542 79.6372 33.1481 80.2639 C 38.04 81.5178 38.3704 81.1863 37.7095 77.4233 C 37.3791 75.2097 37.0451 72.6643 36.7147 72.0376 C 36.7147 71.0791 35.0984 69.8237 33.1481 68.8652 C 29.2116 67.2786 28.2203 63.4795 31.8228 63.4795 C 32.8177 63.4795 33.773 62.8525 33.773 61.5969 C 33.773 60.6384 35.7593 60.0117 38.3704 60.3052 C 41.9765 60.6384 43.9232 59.3833 48.851 52.7437 C 52.4571 47.9844 55.0682 45.4392 55.3987 46.7307 C 55.7291 48.3159 57.3849 49.238 59.0047 49.238 C 61.6159 49.238 61.9464 48.3159 60.991 44.1853 C 60.657 41.3445 59.0047 37.8772 58.0099 36.29 C 55.0682 32.7849 55.0682 28.6904 58.0099 29.9438 C 60.3265 31.1995 67.535 27.7319 67.535 25.5181 C 67.535 24.5581 68.494 23.9312 69.8157 23.9312 C 71.1411 23.9312 71.766 25.8496 71.766 28.3589 C 71.766 31.531 72.4269 32.7849 74.0827 31.8625 C 75.3685 31.1995 76.3635 29.3171 76.3635 28.0635 C 76.3635 24.2625 86.844 17.6228 89.4551 19.5051 C 90.4501 20.1323 91.4413 19.5051 91.7755 17.2915 C 92.7308 12.8638 98.6499 9.3962 101.261 11.6101 C 102.5864 12.5322 103.8723 12.2371 104.2063 11.2788 C 104.8671 10.0232 107.4783 9.0649 110.4199 8.7693 C 113.3615 8.438 117.298 7.1824 118.9538 5.8909 C 125.1674 1.7964 131.3847 2.0918 133.9958 6.5198 C 135.6516 9.6917 136.3124 9.6917 136.3124 7.4778 C 136.3124 4.637 137.6019 4.3057 145.4713 5.2642 C 157.9381 6.5198 159.8884 6.5198 164.4858 4.9326 C 167.4274 4.0103 168.4222 4.3057 168.4222 6.8508 C 168.4222 8.438 169.3777 9.6917 170.703 9.6917 C 171.6943 9.6917 172.6497 8.7693 172.6497 7.8093 C 172.6497 5.2642 177.9116 4.0103 182.5089 5.2642 C 186.0755 6.5198 186.4059 6.8508 185.4505 15.373 C 185.1201 20.4636 185.4505 23.9312 186.0755 23.9312 C 186.7363 23.9312 187.4008 21.7173 187.4008 18.5452 C 187.4008 13.1953 191.0033 10.9832 192.3286 15.373 C 192.6591 16.9583 193.6144 16.3313 194.2753 13.824 C 195.9312 7.1824 199.5372 10.6499 198.5422 17.9185 C 197.551 23.9312 197.551 23.9312 200.4926 21.7173 C 202.1483 20.759 203.4341 18.25 203.4341 16.6646 C 203.4341 15.0776 204.4291 13.1953 205.7509 12.5322 C 208.3619 11.2788 211.3072 16.0361 210.3482 19.5051 C 210.0178 21.0906 210.0178 22.3459 210.9731 22.3459 C 211.6376 22.3459 212.2985 21.4238 212.2985 20.759 C 212.2985 19.8367 213.9183 19.5051 215.9045 20.1323 C 220.1679 21.0906 220.7928 23.6357 217.1904 25.1848 C 216.235 25.8496 215.2401 27.3987 215.2401 28.6904 C 215.2401 30.9043 215.9045 30.9043 219.507 28.6904 C 225.3902 24.8914 228.0013 25.1848 228.9963 29.3171 C 229.6571 31.531 230.9465 32.491 232.2683 31.531 C 233.5936 31.1995 236.5352 32.491 238.816 34.7031 C 240.8022 36.5854 243.7438 38.1707 245.0691 38.1707 C 247.0194 38.1707 247.0194 39.7578 246.3549 44.1853 C 245.6941 48.9446 245.6941 49.5713 247.6803 47.6531 C 250.2914 44.5168 251.2828 44.812 252.2418 49.238 C 252.5722 51.4519 254.8888 53.0388 257.5 53.9971 C 260.4416 54.626 262.0615 56.2109 262.0615 58.0933 C 262.0615 60.0117 263.0527 62.2239 264.0477 63.4795 C 266.6589 65.6931 265.9944 72.3328 263.0527 74.5466 C 262.0615 75.2097 260.7721 74.8782 260.4416 73.9199 C 259.7808 72.9597 257.5 72.9597 253.233 73.9199 C 246.3549 76.1318 245.0691 76.7605 246.6854 79.6372 C 247.6803 81.5178 259.1198 80.8911 265.3694 78.6772 C 267.3197 77.7188 267.9806 78.6772 267.9806 83.105 C 267.9806 86.2769 267.3197 88.7864 266.3284 88.7864 C 265.6639 88.7864 265.039 89.7446 265.039 91.3315 C 265.039 95.1321 266.6589 94.7988 270.9258 90.373 C 273.2029 87.8279 274.5282 87.1992 276.1481 88.7864 C 277.8003 90.373 278.1343 90.373 278.1343 87.8279 C 278.1343 86.2769 277.4698 84.9873 276.4786 84.9873 C 275.8536 84.9873 275.1891 83.7317 275.1891 82.4778 C 275.1891 80.8911 276.1481 79.6372 277.4698 79.6372 C 278.4647 79.6372 279.7865 80.2639 279.7865 81.1863 C 279.7865 82.1467 281.0759 83.4001 282.7317 83.7317 C 285.0089 84.6919 285.6733 85.9456 285.3428 89.7446 C 284.6784 97.0127 286.0038 99.2268 290.8956 97.9731 C 293.2123 97.3442 294.498 97.9731 293.5068 99.2268 C 293.2123 99.8535 293.5068 101.4407 294.1677 102.1033 C 296.8183 103.9858 295.8234 108.4119 292.8818 108.4119 C 289.2758 108.4119 288.2844 109.9985 290.2348 112.8394 C 291.5565 114.4263 292.5514 114.72 293.8372 113.4663 C 296.8183 110.2942 297.4433 112.8394 297.7737 125.4939 C 297.7737 131.8379 298.4346 136.8926 299.0955 136.8926 C 300.7153 136.8926 300.0904 143.8655 297.7737 146.7061 C 296.4843 148.2913 296.4843 149.8403 297.4433 151.1318 C 299.7599 153.9727 297.4433 162.1995 294.498 162.1995 C 291.887 162.1995 286.9591 168.2122 286.9591 171.053 C 286.9591 174.5225 282.7317 171.053 281.7368 167.2539 C 280.7455 163.7864 280.7455 163.7864 280.081 166.2939 C 279.4561 169.1724 283.0262 178.0259 286.0038 180.5349 C 287.954 182.4536 284.348 185.6255 281.7368 184.334 C 280.4114 183.7073 279.7865 181.8267 279.7865 179.9082 C 279.7865 174.5225 271.5866 160.9456 265.3694 155.8552 C 262.0615 153.3457 259.1198 150.5051 259.1198 149.5469 C 259.1198 147.6284 248.6357 141.6516 242.7525 139.7332 C 239.4768 138.7732 238.4855 139.1064 238.4855 141.6516 C 238.4855 143.5322 237.8606 144.1589 236.5352 143.5322 C 233.5936 142.2783 232.2683 145.1194 234.8795 147.96 C 238.4855 151.4275 237.8606 155.5596 233.9241 153.9727 C 231.277 153.0144 230.9465 153.3457 231.9379 158.7319 C 232.2683 161.8679 232.9328 166 232.9328 167.8806 C 232.9328 169.7991 233.5936 171.053 234.2545 171.053 C 235.2136 171.053 235.5439 170.426 234.8795 169.4678 C 234.5491 168.5076 235.2136 167.5854 236.5352 167.5854 C 237.5302 167.5854 238.4855 168.8408 238.4855 170.0945 C 238.4855 171.3862 237.1962 172.6396 234.8795 172.3086 C 232.9328 172.3086 231.277 171.3862 231.277 170.7593 C 231.277 167.8806 222.4486 148.2913 219.8375 145.4146 C 216.8958 142.2783 218.8461 141.3201 195.6006 156.1865 C 191.9982 158.4004 188.0617 163.1594 186.0755 166.6272 C 184.4556 170.0945 181.8445 173.6001 180.5227 174.2268 C 179.1974 174.8538 174.3055 179.9082 170.0385 185.2942 C 151.6849 209.0139 154.666 211.8547 155.9519 260.2944 C 161.5082 297 161.5082 297 161.5082 297 C 148.4129 297 148.4129 297 148.4129 297 C 137.6019 297 137.6019 297 137.6019 297 C 138.5932 263.1331 138.5932 263.1331 138.5932 263.1331 C 139.254 260.2944 139.5881 254.5752 139.9186 251.4028 C 140.249 249.5205 130.7238 241.2937 131.0543 239.4133 C 131.0543 237.8264 140.9099 242.2542 140.9099 240.667 C 142.5297 217.574 140.9099 199.2021 136.6429 189.4246 C 135.6516 183.4116 127.4482 164.0818 126.1624 164.0818 C 125.8319 164.0818 123.5153 162.1995 121.2346 159.9856 C 117.298 155.8552 115.6818 155.5596 93.7221 154.3042 C 70.1462 153.0144 70.1462 153.0144 70.1462 153.0144 C 64.5575 157.4404 64.5575 157.4404 64.5575 157.4404 C 61.2855 160.3188 58.0099 162.1995 57.0544 162.1995 C 55.0682 162.1995 46.8648 168.8408 43.2982 172.6396 C 42.9678 172.6396 42.6374 172.3086 42.6374 172.0129 C 42.3069 172.0129 42.3069 172.0129 42.3069 171.6814 C 41.9765 170.7593 41.6425 169.7991 40.9816 168.8408 C 42.9678 167.2539 44.5876 166.2939 45.2485 166.6272 C 46.2398 167.2539 47.1988 166.6272 47.1988 165.04 C 47.1988 163.4548 45.2485 162.8262 40.0262 163.4548 C 33.773 164.4133 32.1532 164.7446 31.1619 168.5076 C 29.542 170.426 29.2116 173.2668 30.1706 175.4807 C 29.8365 178.3213 29.8365 180.2397 30.1706 180.2397 C 30.501 180.2397 30.8314 179.613 31.8228 178.9482 C 31.8228 179.2798 32.1532 179.613 32.4872 179.9082 C 29.2116 180.8665 27.5558 183.7073 27.8898 186.5479 C 26.2341 187.8394 24.6142 188.4663 22.6281 189.4246 C 22.6281 189.4246 22.6281 189.0933 22.3335 189.0933 C 23.6229 186.2527 24.2838 183.0803 24.6142 178.3213 C 25.2787 172.9712 24.9446 169.4678 23.9534 169.4678 C 23.2925 169.4678 22.6281 170.7593 22.6281 172.6396 C 22.9584 174.2268 22.3335 175.812 21.0117 176.1074 C 20.0168 176.4387 19.356 175.812 19.356 174.2268 C 19.356 170.426 18.0701 170.426 15.1249 173.8936 C 13.8032 175.1851 11.192 176.7344 8.9113 177.3992 C 5.9302 178.3213 4.9748 177.6943 3.6495 174.2268 C 2.6582 171.3862 1.9973 168.2122 2.6582 166.9585 C 2.9886 165.3716 2.9886 164.0818 1.7028 164.0818 C -1.9033 164.0818 0.7079 159.0271 4.9748 158.0671 ZM 33.1481 85.3186 C 31.1619 84.9873 29.542 84.0649 28.8812 82.7734 C 28.5507 80.8911 28.2203 80.8911 28.2203 82.7734 C 28.2203 84.0649 26.895 84.9873 25.6091 85.3186 C 23.2925 85.3186 23.2925 85.6501 25.9396 86.9058 C 27.5558 87.5325 29.2116 88.4907 29.542 88.4907 C 29.8365 88.4907 31.4923 87.5325 33.1481 86.9058 C 36.0897 85.3186 36.0897 85.3186 33.1481 85.3186 ZM 292.8818 136.2656 C 293.5068 136.8926 294.1677 135.9324 294.1677 134.3472 C 294.1677 133.0918 293.5068 131.8379 292.8818 131.8379 C 291.887 131.8379 291.2261 132.4648 291.2261 133.387 C 291.2261 134.3472 291.887 135.6387 292.8818 136.2656 ZM 290.5652 139.1064 C 290.2348 138.1462 288.6149 136.8926 287.2896 136.8926 C 286.3342 136.8926 285.6733 138.1462 286.3342 139.1064 C 286.6287 140.0647 287.954 140.6917 289.2758 140.6917 C 290.5652 140.6917 290.8956 140.0647 290.5652 139.1064 ZM 287.6236 153.3457 C 288.6149 153.3457 289.9402 153.0144 289.9402 152.719 C 289.9402 152.0542 288.6149 151.4275 287.6236 150.8005 C 286.3342 150.1736 285.3428 150.5051 285.3428 151.4275 C 285.3428 152.3875 286.3342 153.3457 287.6236 153.3457 ZM 290.2348 123.28 C 291.5565 122.6528 292.2209 121.6929 291.887 120.7705 C 290.8956 118.5208 285.3428 118.5208 285.3428 120.7705 C 285.3428 123.28 287.2896 124.2383 290.2348 123.28 ZM 272.2476 99.5581 C 270.5918 100.5183 269.6005 102.3989 269.9308 103.3589 C 271.5866 105.8665 273.537 105.2395 275.1891 101.145 C 276.809 97.3442 276.1481 96.7175 272.2476 99.5581 ZM 265.9944 148.2913 C 274.5282 156.8132 274.8587 157.1448 274.8587 154.3042 C 274.8587 152.719 274.1978 151.4275 273.2029 151.4275 C 272.2476 151.4275 270.5918 149.8403 269.6005 147.96 C 268.645 146.0774 266.6589 144.1589 265.039 144.1589 C 262.0615 144.1589 262.0615 144.4922 265.9944 148.2913 ZM 259.1198 133.387 C 261.1025 133.387 262.0615 132.7603 260.7721 132.4648 C 259.7808 131.8379 258.1609 131.8379 257.1696 132.4648 C 256.1746 132.7603 257.1696 133.387 259.1198 133.387 ZM 249.6306 90.373 C 250.6219 91.3315 253.5635 92.5852 256.1746 93.2139 C 260.7721 94.1721 261.1025 94.1721 258.4913 91.627 C 255.5138 88.4907 247.3499 87.5325 249.6306 90.373 ZM 229.6571 37.8772 C 228.6658 38.7993 228.3354 40.7178 228.6658 41.9714 C 229.3267 44.5168 231.277 42.303 231.277 38.5039 C 231.277 36.5854 230.9465 36.29 229.6571 37.8772 ZM 239.4768 106.1997 C 242.088 107.7847 243.0829 107.7847 244.4083 105.571 C 247.0194 102.1033 245.3636 100.5183 240.4717 102.7305 C 236.5352 104.2813 236.5352 104.2813 239.4768 106.1997 ZM 232.9328 90.373 C 237.8606 86.9058 237.8606 86.9058 233.9241 86.9058 C 231.277 86.9058 229.3267 88.1592 228.3354 90.373 C 227.7104 92.5852 227.046 93.8408 227.3764 93.8408 C 227.3764 93.8408 229.9876 91.9583 232.9328 90.373 ZM 225.7242 141.6516 C 228.0013 145.1194 231.9379 145.1194 230.652 141.3201 C 230.3216 140.0647 229.9876 138.4795 229.9876 138.1462 C 229.9876 137.8508 228.6658 137.8508 227.046 138.4795 C 224.3989 139.1064 224.3989 140.0647 225.7242 141.6516 ZM 215.5705 128.6658 C 218.1816 132.1335 219.507 132.4648 222.4486 129.9197 C 224.3989 128.3345 224.3989 128.3345 222.4486 128.0391 C 221.4573 128.0391 218.8461 127.7058 216.5654 127.0789 C 213.2898 125.8252 213.2898 125.8252 215.5705 128.6658 ZM 215.2401 94.1721 C 216.8958 94.1721 218.8461 89.1177 217.8513 87.5325 C 216.5654 85.9456 213.9183 88.4907 213.9183 91.3315 C 213.9183 92.9185 214.5792 94.1721 215.2401 94.1721 ZM 199.2067 115.6799 C 197.2205 116.9714 197.551 117.2671 200.1622 117.2671 C 201.8179 117.2671 203.7646 116.6382 204.4291 115.6799 C 205.4203 113.1709 202.1483 113.1709 199.2067 115.6799 ZM 199.5372 143.5322 C 199.8317 143.8655 200.823 143.2007 201.8179 141.6516 C 202.8091 140.3601 205.7509 138.7732 208.0315 138.1462 C 210.9731 137.1877 212.2985 135.6387 212.2985 133.387 C 212.2985 128.0391 207.7011 129.624 202.8091 136.561 C 200.823 140.0647 199.2067 142.9055 199.5372 143.5322 ZM 195.9312 128.9612 C 198.8727 125.4939 198.8727 124.865 196.556 123.9067 C 193.9449 122.6528 191.9982 125.4939 191.9982 130.5464 C 191.6642 134.3472 191.6642 134.3472 195.9312 128.9612 ZM 190.6729 91.627 C 191.0033 94.1721 191.6642 93.8408 193.6144 89.1177 C 195.9312 84.0649 195.9312 83.4001 193.9449 83.4001 C 192.6591 83.4001 191.3337 84.3586 191.0033 85.9456 C 190.3424 87.1992 190.3424 90.0779 190.6729 91.627 ZM 189.053 65.6931 C 189.053 66.9829 189.6779 70.1191 190.3424 72.3328 C 191.3337 76.7605 191.3337 76.7605 192.3286 72.9597 C 193.6144 69.1609 192.3286 63.4795 190.3424 63.4795 C 189.3834 63.4795 189.053 64.4375 189.053 65.6931 ZM 166.1056 76.1318 C 164.4858 78.3457 164.4858 80.5596 165.7716 87.1992 C 166.4361 91.9583 168.0919 96.7175 169.0472 97.6399 C 170.703 99.2268 171.0334 97.6399 171.3638 87.8279 C 171.3638 75.8381 169.7081 72.0376 166.1056 76.1318 ZM 169.0472 109.6672 C 169.3777 110.2942 170.0385 109.0403 169.7081 107.158 C 169.7081 105.2395 169.3777 104.9441 168.7168 106.1997 C 168.4222 107.4534 168.4222 109.0403 169.0472 109.6672 ZM 180.8531 79.9326 C 180.5227 80.5596 180.5227 84.9873 181.514 89.7446 C 182.5089 97.9731 182.8034 98.3044 183.1339 92.2915 C 183.4643 82.4778 182.8034 77.7188 180.8531 79.9326 ZM 169.7081 169.1724 C 171.6943 165.3716 174.9664 159.0271 177.2471 155.2266 C 179.8582 151.1318 181.514 145.7461 182.1749 140.3601 C 183.1339 131.8379 183.1339 131.8379 183.1339 131.8379 C 179.1974 136.561 179.1974 136.561 179.1974 136.561 C 177.2471 139.1064 175.9253 141.947 175.9253 142.9055 C 175.9253 145.4146 169.7081 161.241 167.7578 164.0818 C 166.7665 165.6667 165.1107 169.1724 164.8162 171.6814 C 163.1604 178.9482 166.1056 177.6943 169.7081 169.1724 ZM 146.4626 201.7476 C 147.4575 208.0557 147.4575 208.0557 150.7296 194.4792 C 152.6799 187.1746 155.6215 175.4807 157.6077 168.2122 C 160.2188 159.0271 161.2137 151.4275 161.2137 140.6917 C 161.2137 126.7473 160.8797 126.4519 158.2686 128.0391 C 152.3494 132.1335 149.0738 143.5322 147.752 165.6667 C 147.1271 177.0676 146.4626 188.4663 145.8018 190.9756 C 145.4713 193.5208 145.8018 198.28 146.4626 201.7476 ZM 147.1271 120.7705 C 148.4129 123.9067 149.7383 126.4519 149.7383 126.4519 C 150.0687 126.4519 151.6849 124.5334 153.0103 122.0244 C 154.666 119.8123 157.2772 117.2671 158.2686 116.3447 C 162.1691 113.4663 163.1604 104.6128 159.8884 98.5999 C 157.2772 93.2139 150.0687 87.1992 148.7433 89.1177 C 148.0825 89.7446 147.1271 95.7593 146.4626 102.7305 C 145.1409 113.1709 145.1409 116.3447 147.1271 120.7705 ZM 145.1409 48.3159 C 145.8018 48.9446 146.4626 48.6113 146.4626 47.6531 C 146.4626 46.3975 145.8018 45.1436 145.1409 44.5168 C 144.146 43.8521 143.521 44.1853 143.521 45.4392 C 143.521 46.3975 144.146 47.6531 145.1409 48.3159 ZM 39.0313 133.387 C 43.5927 133.7202 43.5927 133.7202 43.5927 133.7202 C 48.1901 133.7202 52.7875 129.624 52.7875 126.1206 C 52.7875 123.9067 52.4571 123.9067 39.0313 133.387 ZM 40.9816 124.5334 C 40.9816 125.4939 41.6425 126.4519 42.6374 126.4519 C 44.2537 126.4519 48.851 120.7705 47.8597 119.8123 C 46.8648 118.5208 40.9816 122.6528 40.9816 124.5334 ZM 44.5876 102.7305 C 49.5155 109.0403 51.7962 109.6672 54.4073 105.571 C 57.0544 101.7722 54.7378 99.2268 46.8648 98.3044 C 40.3207 97.3442 40.3207 97.3442 44.5876 102.7305 ZM 40.9816 84.9873 C 40.9816 85.6501 43.2982 87.1992 45.9094 88.4907 C 58.0099 94.5037 60.3265 94.5037 59.996 88.7864 C 59.996 85.3186 55.0682 77.7188 53.1179 77.7188 C 50.8013 77.7188 40.9816 83.7317 40.9816 84.9873 ZM 58.6743 129.9197 C 62.2768 129.9197 62.6072 128.9612 59.6656 127.4121 C 58.3403 127.0789 57.0544 127.4121 56.724 128.3345 C 56.0595 129.2925 57.0544 129.9197 58.6743 129.9197 ZM 61.2855 55.5842 C 59.0047 53.9971 56.0595 53.3704 54.7378 53.9971 C 52.4571 55.2527 52.7875 55.5842 56.0595 56.5422 C 57.6794 57.1711 60.991 57.7979 62.6072 58.0933 C 64.5575 58.0933 64.5575 57.4646 61.2855 55.5842 ZM 60.991 66.9829 C 62.9376 66.9829 63.2717 66.6514 61.9464 65.6931 C 60.991 65.3979 59.6656 65.3979 59.0047 66.0247 C 58.6743 66.6514 59.6656 67.2786 60.991 66.9829 ZM 62.9376 74.2515 C 58.3403 74.2515 58.3403 74.5466 60.991 77.092 C 64.263 79.9326 65.2184 80.2639 66.5438 78.3457 C 68.8244 75.8381 67.2046 74.2515 62.9376 74.2515 ZM 69.4854 38.5039 C 68.16 36.917 67.8296 39.7578 68.494 43.2253 C 68.8244 45.4392 70.1462 47.3574 70.8107 47.3574 C 72.0965 47.3574 71.1411 40.3845 69.4854 38.5039 ZM 79.9659 80.2639 C 79.3051 80.5596 80.9608 82.4778 82.9111 84.0649 C 84.8973 85.6501 86.5135 86.2769 86.5135 85.3186 C 86.5135 83.105 80.9608 78.9727 79.9659 80.2639 ZM 71.766 82.4778 C 68.8244 84.6919 70.4802 90.373 74.7436 91.3315 C 77.0243 91.9583 80.6304 94.5037 82.9111 97.0127 C 84.8973 99.5581 86.5135 100.5183 86.5135 99.5581 C 86.5135 96.386 73.4218 81.1863 71.766 82.4778 ZM 85.1918 108.7451 C 83.2416 103.6526 80.9608 101.145 76.6938 99.5581 C 73.4218 98.3044 70.1462 97.6399 69.1549 97.9731 C 68.16 98.3044 72.0965 102.3989 77.6888 107.158 C 88.1693 115.3848 88.1693 115.3848 85.1918 108.7451 ZM 102.5864 60.0117 C 101.9255 60.0117 101.261 61.2656 101.261 62.5193 C 101.261 64.1062 101.9255 65.0647 102.5864 65.0647 C 103.5418 65.0647 104.2063 64.1062 104.2063 62.5193 C 104.2063 61.2656 103.5418 60.0117 102.5864 60.0117 ZM 99.6089 85.9456 C 99.6089 88.1592 105.1976 86.5725 107.4783 83.7317 C 110.7504 78.9727 110.4199 77.7188 106.153 77.7188 C 103.2114 77.7188 99.6089 82.1467 99.6089 85.9456 ZM 109.1341 17.6228 C 108.1392 21.7173 107.4783 25.1848 107.8088 25.5181 C 108.8036 26.772 111.4149 17.2915 111.4149 13.4907 C 111.4149 11.9055 110.4199 13.824 109.1341 17.6228 ZM 126.1624 81.5178 C 124.5066 81.5178 123.2207 82.1467 123.2207 83.4001 C 123.2207 84.3586 124.1761 84.9873 125.1674 84.9873 C 126.4927 84.9873 127.7786 84.3586 128.1126 83.4001 C 128.7735 82.1467 127.7786 81.5178 126.1624 81.5178 ZM 122.2258 140.9868 C 124.1761 146.7061 127.1177 152.0542 128.7735 153.3457 C 130.4293 154.3042 133.7013 158.7319 135.6516 163.1594 C 137.6019 167.5854 139.5881 171.053 139.9186 171.053 C 141.5348 171.053 138.2628 141.947 135.9821 133.0918 C 133.9958 125.4939 133.3708 118.5208 133.7013 107.4534 C 133.9958 99.2268 133.7013 91.9583 133.0405 91.3315 C 132.71 90.7046 130.4293 90.7046 128.4431 91.3315 C 124.837 92.5852 124.5066 93.5454 124.5066 100.5183 C 124.5066 105.8665 123.8456 108.7451 122.2258 109.9985 C 117.6285 112.8394 117.9589 128.9612 122.2258 140.9868 ZM 112.7366 98.5999 C 112.0757 93.8408 111.4149 93.2139 107.8088 93.2139 C 103.5418 93.2139 103.5418 93.5454 103.8723 100.1851 C 103.8723 104.2813 104.5367 109.0403 104.8671 111.2524 C 105.1976 113.4663 106.487 115.6799 107.8088 116.0115 C 110.4199 117.5986 113.3615 106.5313 112.7366 98.5999 ZM 107.8088 130.5464 C 104.8671 126.7473 102.881 122.6528 102.5864 121.6929 C 102.5864 120.4392 100.9307 117.2671 98.9839 114.4263 C 96.9977 111.5857 94.717 108.0803 93.7221 106.8264 C 90.4501 102.3989 91.1109 106.1997 94.717 116.0115 C 96.9977 122.6528 100.9307 128.6658 105.528 133.7202 C 114.0259 142.2783 115.0173 140.6917 107.8088 130.5464 ZM 102.5864 146.0774 C 106.153 146.0774 105.8585 145.7461 100.9307 140.6917 C 97.6586 137.5193 95.3779 134.0518 95.3779 132.4648 C 95.3779 131.2112 91.1109 126.7473 86.1832 122.6528 C 81.2912 118.5208 76.6938 114.4263 76.033 113.1709 C 75.3685 111.5857 75.0381 111.5857 75.0381 113.4663 C 75.0381 115.3848 73.4218 115.6799 68.16 114.72 C 64.5575 114.093 61.6159 114.093 61.6159 114.4263 C 61.6159 115.0532 62.9376 118.8523 64.263 122.6528 C 66.5438 128.9612 67.535 130.2529 74.7436 132.7603 C 79.3051 134.3472 86.5135 138.1462 91.1109 140.9868 C 95.3779 143.8655 100.6002 146.0774 102.5864 146.0774 ZM 51.4622 156.8132 C 52.7875 156.8132 54.7378 156.1865 56.0595 155.2266 C 58.3403 153.0144 56.3936 153.0144 52.1266 155.2266 C 50.1763 156.1865 49.8459 156.4819 51.4622 156.8132 ZM 47.8597 148.918 C 51.1318 147.6284 61.6159 146.3728 71.1411 146.3728 C 89.1248 146.0774 92.7308 145.1194 85.5222 143.2007 C 83.2416 142.574 78.0192 140.9868 73.7523 139.4016 C 66.2133 136.561 50.8013 137.5193 49.185 140.6917 C 48.851 141.3201 47.1988 141.6516 45.579 141.3201 C 42.3069 140.3601 39.0313 142.9055 38.04 147.96 C 36.7147 152.0542 39.0313 152.3875 47.8597 148.918 ZM 21.6726 156.1865 C 22.3335 158.7319 25.6091 159.0271 28.2203 156.8132 C 29.8365 155.5596 29.8365 154.9329 28.2203 153.0144 C 26.895 151.1318 25.9396 151.1318 23.9534 152.719 C 22.6281 153.6414 21.6726 155.2266 21.6726 156.1865 ZM 11.192 178.3213 C 12.4779 178.3213 13.1388 179.2798 12.4779 181.1621 C 12.1833 182.4536 11.192 183.7073 10.5276 183.7073 C 9.5363 183.7073 8.9113 182.4536 8.9113 181.1621 C 8.9113 179.613 9.8667 178.3213 11.192 178.3213 Z", |
| | | |
| | | "maple-leaf": "M 82.7949 242.2583 C 77.6862 252.9512 74.1093 258.564 56.7309 264.1697 C 53.66 265.6975 57.7499 269.2642 59.8018 268.7527 C 75.1283 262.6421 78.7051 257.541 85.8658 246.3296 C 89.4427 260.6033 97.6154 269.7756 111.4169 275.3813 L 112.4428 272.3191 C 131.3531 282.5146 145.6606 284.554 157.9232 282.0032 C 169.6797 279.4526 183.4743 277.4204 194.7248 278.9482 C 187.571 273.342 183.4743 266.7134 181.9492 258.564 C 193.6989 246.3296 216.699 250.9192 227.9426 243.7856 L 225.3847 238.1729 C 249.9168 230.0234 270.872 216.7727 300 220.8511 L 251.9617 186.1934 L 252.9807 181.6035 C 238.6732 170.9036 222.3208 168.3528 203.9166 175.4932 C 210.0513 157.6528 203.9166 138.2915 220.7888 124.5298 C 216.699 116.8848 220.7888 106.1848 227.9426 96.5007 C 228.9686 78.1558 234.0704 61.8464 243.2691 47.0679 C 228.4487 56.752 213.6351 65.4128 198.3017 73.0613 L 195.7438 67.4521 C 189.616 77.1394 180.9233 84.2729 169.1668 88.3442 L 167.1219 82.7385 C 151.2755 98.5398 132.3721 106.6892 120.6155 129.6306 C 124.1924 107.2007 117.5447 85.2891 108.3461 67.4521 L 104.7692 71.0222 C 98.1284 49.1072 74.6222 34.8369 59.8018 17 C 65.9296 65.9243 48.0383 72.0383 48.5581 99.0513 L 42.4165 99.5557 C 51.1091 127.0801 39.3525 139.8193 44.9744 158.6758 C 30.6669 151.5422 12.2626 156.6365 0 145.425 C 14.8204 168.8713 19.9362 197.4048 44.9744 216.7727 L 41.3975 218.3005 C 50.5961 228.489 62.3527 237.157 82.7949 242.2583 Z", |
| | | |
| | | |
| | | "butterfly": "M 132.1899 141.4731 C 133.2701 142.188 135.5561 140.834 136.6667 140.6667 C 135.4167 139.0417 140.125 131.125 138.5 128.25 C 138 121.75 125.3439 107.0776 123.75 105.375 C 124.358 104.2332 131.1718 105.2957 130.9684 105.4595 C 128.125 107.75 140.5635 120.8953 142 128.5 C 144.6469 128.3535 148.1237 127.3618 149.6667 129 C 151.1076 127.4255 162.2255 115.3953 162.8333 105 C 162.9204 103.5103 168.9546 104.4531 167.8195 105.3611 C 166 111.8333 153.1691 130.0051 152.1667 130.6667 C 153.3333 136.3333 152.861 136.7217 160.3125 141.1279 C 163.666 133.2534 170.8113 126.5691 177.3557 119.9163 C 184.7454 112.4465 189.7048 105.2905 197.845 97.5144 C 208.5609 87.6365 222.2463 78.6233 234.7805 73.2429 C 243.5 69.5 258.1094 66.2913 260.349 66.0813 C 264.498 65.6785 268.25 65.75 273.1679 66.4807 C 280.4244 67.5588 287.5098 68.1609 295.1284 71.7371 C 302.2921 76.3269 299.8157 82.0793 298.48 87.4675 C 287.4467 99.6348 276.1462 114.2068 272.5872 129.1147 C 271.3906 134.6348 269.2391 144.147 264.1613 150.1221 C 255.9979 159.313 246.0071 158.9731 236.6201 160.219 C 242.3398 161.8567 248.5434 167.2041 254.1089 172.5776 C 262.7908 181.0295 267.0212 189.697 264.7792 199.1331 C 264.3019 201.1123 256.0239 216.1243 251.975 220.8347 C 236.6072 238.771 215.6852 250.9351 198.8225 248.9609 C 192.75 248.25 176 235.5 172.9885 231.7378 C 165.5126 222.3984 159.372 211.1333 159.1196 201.2981 C 158.1903 200.3696 157.0538 200.301 157.5549 199.0588 C 156.6237 201.9033 153.6667 211.1667 149.289 217.0229 C 142.9601 225.4893 137.1667 212.8333 134.8217 202.5698 C 134.0178 199.0515 134.6078 198.4424 133.6702 196.3386 C 129.2367 198.0208 131.5711 202.8984 129.8312 206.8386 C 128.3561 210.2698 121.75 220.75 119.9257 223.1392 C 114.0942 230.7764 101 242.3333 91.5037 245.1064 C 82.69 247.6802 75.22 247.3191 68.1365 243.686 C 59 239 46.124 228.1169 38.2026 219.2678 C 28.1746 208.3184 19.4099 191.8674 27.7518 180.2795 C 33.0762 173.0493 43.0985 162.2744 52.8922 159.6267 C 45.9788 158.78 30.683 154.2236 24.9946 141.5679 C 23.1688 137.5554 22.4915 131.3167 22.0271 126.853 C 21.2715 119.4836 17.9091 111.0168 15.1179 103.7605 C 12.8741 97.1265 8.9083 88.6335 4.7579 81.3755 C 0.4083 73.759 -3.1577 61.1648 4.4119 54.9631 C 7.0561 52.7964 15.2436 50.2693 16.9547 50.0891 C 22.936 49.4504 31.085 52.3877 37.1343 54.1499 C 41.0975 55.314 58.487 61.5269 63.2961 64.9478 C 95 87.5 117.5438 115.5918 132.1899 141.4731 Z", |
| | | "leaf_1": "m35.63904,285.5213c9.77121,-31.99348 23.14531,-59.08864 35.83149,-72.59245c13.5912,-14.46718 7.56125,-20.74258 -6.45918,-6.72212c-5.89857,5.89853 -7.58387,1.61555 -7.58387,-19.2735c0,-49.83961 25.83589,-80.67891 87.99842,-105.04016c52.59872,-20.61333 91.37741,-43.79435 107.45589,-64.23479l13.10197,-16.65652l0,28.9807c0,35.83507 -11.11781,89.97318 -23.42422,114.0641c-13.0549,25.55626 -57.80217,72.72934 -79.76038,84.08435c-19.67261,10.17316 -61.687,13.16808 -84.14172,5.99792c-11.19011,-3.57314 -14.7415,-0.84308 -20.53963,15.78944c-3.8556,11.06018 -7.0102,26.79501 -7.0102,34.96616c0,9.27652 -3.72057,14.8566 -9.90572,14.8566c-7.3461,0 -8.78352,-3.67429 -5.56284,-14.21973z", |
| | | "drop": "m115.15536,295.759c-42.01334,-15.78687 -72.12711,-65.94934 -65.28346,-108.74701c4.3154,-26.98718 95.35947,-190.81818 103.3105,-185.90417c2.59511,1.60386 25.68835,39.79974 51.31831,84.87975c41.0565,72.21342 46.5999,85.67899 46.5999,113.19665c0,55.77716 -44.6394,101.46498 -98.23825,100.54555c-15.6409,-0.26834 -32.60906,-2.05518 -37.707,-3.97076zm42.09262,-28.05386c1.39066,-7.22116 -1.85785,-10.74289 -9.90955,-10.74289c-18.35065,0 -43.80598,-23.24161 -49.49309,-45.18889c-6.0666,-23.41179 -22.15186,-26.19615 -24.52774,-4.24574c-4.57746,42.29059 76.21872,100.22086 83.93037,60.17752z", |
| | | "feather":"M 188.7044 276.8495 C 188.7044 276.8495 159.7298 274.7077 144.3849 266.5197 C 129.04 258.3316 121.8791 247.8918 121.8791 247.8918 C 121.8791 247.8918 129.932 256.8966 141.2327 263.7194 C 148.1224 267.879 156.2198 271.2277 164.4356 271.2277 C 164.4356 271.2277 151.7511 264.0633 142.2365 269.1805 C 142.2365 269.1805 149.0907 264.4724 160.9574 268.0547 C 172.8248 271.6369 178.7574 269.5897 178.7574 269.5897 C 178.7574 269.5897 158.7075 269.4874 150.0116 263.7557 C 141.3156 258.024 139.1672 254.7494 139.1672 254.7494 C 139.1672 254.7494 148.1699 264.0633 155.1263 265.1892 C 162.0827 266.3151 174.0517 264.9839 174.0517 264.9839 C 174.0517 264.9839 161.6738 265.2915 157.7859 263.5511 C 153.8987 261.8116 138.5538 258.3316 135.792 265.5983 C 135.792 265.5983 138.8605 257.9217 152.8756 260.1735 C 166.8907 262.4253 168.2213 261.7093 168.2213 261.7093 C 168.2213 261.7093 143.3618 252.0877 129.449 257.5126 C 115.5361 262.9374 116.4569 267.5432 116.4569 267.5432 C 116.4569 267.5432 117.3778 251.5763 151.3414 254.4418 C 151.3414 254.4418 135.4853 252.0877 129.6534 247.3797 C 123.8231 242.6716 123.4134 239.6015 123.4134 239.6015 C 123.4134 239.6015 130.0624 249.7337 138.2471 249.836 C 146.4311 249.939 148.784 249.2223 148.784 249.2223 C 148.784 249.2223 132.825 245.5378 125.2544 246.356 C 117.6845 247.1751 105.4089 249.836 98.9636 238.168 C 98.9636 238.168 104.9992 249.3246 121.4702 245.4355 C 137.9404 241.5457 148.2721 245.8446 148.2721 245.8446 C 148.2721 245.8446 123.3111 241.0342 118.1957 236.2239 C 113.081 231.4135 112.4676 223.1224 112.4676 223.1224 C 112.4676 223.1224 114.616 237.0421 125.1521 238.3734 C 135.6898 239.7038 151.6481 239.3962 155.8427 244.2073 C 155.8427 244.2073 145.3058 236.4284 134.3592 237.452 C 123.4134 238.4756 106.5335 252.5999 97.9405 248.9154 C 89.3476 245.2309 85.4597 248.301 85.4597 248.301 C 85.4597 248.301 89.0409 244.7188 95.1779 246.356 C 101.3165 247.9941 102.6463 250.4504 113.1832 243.1837 C 123.7201 235.917 141.6224 226.91 152.9779 234.6881 C 152.9779 234.6881 99.9193 219.9849 94.1912 190.099 C 94.1912 190.099 99.2355 210.0254 125.1521 218.8946 C 151.0695 227.7638 152.5689 227.0827 152.5689 227.0827 C 152.5689 227.0827 112.6046 222.8512 93.9171 186.8237 C 93.9171 186.8237 110.148 214.8002 135.3831 218.4847 C 135.3831 218.4847 114.1041 211.1158 97.599 188.5989 C 81.0962 166.0812 80.4116 158.5744 80.4116 158.5744 C 80.4116 158.5744 100.4645 194.6018 138.3849 201.0169 C 138.3849 201.0169 108.6819 192.5198 87.4036 165.3971 C 66.1254 138.2744 72.7751 132.9519 72.7751 132.9519 C 72.7751 132.9519 68.1716 123.2288 71.649 121.0793 C 71.649 121.0793 64.7948 113.3004 66.7388 106.955 C 66.7388 106.955 71.649 131.0069 96.713 146.7693 C 121.7769 162.5309 123.9253 164.4758 123.9253 164.4758 C 123.9253 164.4758 97.9405 146.667 89.7565 138.0691 C 81.5725 129.4719 72.3654 122.8189 67.0455 104.3964 C 67.0455 104.3964 72.161 122.6143 88.3245 135.1013 C 104.4873 147.5883 107.6595 147.383 107.6595 147.383 C 107.6595 147.383 74.5138 130.3932 66.6366 102.2469 C 66.6366 102.2469 71.2401 123.0242 107.7618 142.8802 C 107.7618 142.8802 71.1379 121.2839 66.6366 98.2548 C 66.6366 98.2548 65.8187 94.8772 67.3529 93.2399 C 67.3529 93.2399 65.5112 88.8386 66.1254 83.3115 C 66.7388 77.7851 67.4552 71.8489 67.4552 71.8489 C 67.4552 71.8489 65.8187 95.1848 88.529 113.1982 C 88.529 113.1982 61.7263 81.0583 71.2757 54.5849 C 71.2757 54.5849 69.228 69.1872 75.6392 75.8736 C 75.6392 75.8736 70.1822 64.1389 72.7751 50.3548 C 72.7751 50.3548 72.0921 64.9572 78.9129 78.1943 C 85.7338 91.4314 107.5573 117.0872 107.5573 117.0872 C 107.5573 117.0872 81.9148 87.0635 77.8224 70.1419 C 73.7308 53.2203 76.0481 42.1668 76.0481 42.1668 C 76.0481 42.1668 73.7308 57.9959 83.6876 73.8271 C 93.6444 89.6577 97.0552 91.4314 97.0552 91.4314 C 97.0552 91.4314 69.6369 62.9085 80.0027 31.249 C 80.0027 31.249 79.3219 63.3184 90.6426 77.1018 C 101.9655 90.8858 105.3733 91.295 105.3733 91.295 C 105.3733 91.295 82.0489 72.8717 82.8668 47.0795 C 83.6861 21.2872 88.0526 19.9227 88.0526 19.9227 C 88.0526 19.9227 78.3662 41.7555 93.9156 62.7729 C 109.4657 83.7903 106.329 79.8316 106.329 79.8316 C 106.329 79.8316 84.2329 51.1739 88.5979 28.7926 C 92.9629 6.4114 101.2824 6.6849 101.2824 6.6849 C 101.2824 6.6849 92.145 12.6886 92.5539 26.4719 C 92.9629 40.2553 106.0578 67.0029 106.0578 67.0029 C 106.0578 67.0029 91.4619 30.2943 95.418 18.9665 C 99.3726 7.6395 107.6944 4.2285 107.6944 4.2285 C 107.6944 4.2285 91.4604 13.5084 100.872 38.3459 C 100.872 38.3459 95.0076 14.7387 110.6925 3.6845 C 110.6925 3.6845 99.5089 14.3296 104.1458 34.1167 C 104.1458 34.1167 102.7819 9.8239 117.6489 1.5002 C 117.6489 1.5002 108.1033 9.0071 107.9662 24.1549 C 107.9662 24.1549 110.0124 8.8692 121.3324 0.272 C 121.3324 0.272 112.7387 13.3727 113.2854 32.2051 C 113.2854 32.2051 119.6966 13.6477 122.8348 0 C 122.8348 0 123.3786 7.3697 121.0605 16.5117 C 118.7424 25.6551 117.6512 26.4734 117.6512 26.4734 C 117.6512 26.4734 125.9707 14.1917 126.3804 2.1828 C 126.3804 2.1828 126.7894 13.9197 123.2437 23.7458 C 123.2437 23.7458 129.9972 18.3128 130.8477 6.2743 C 130.861 6.0949 130.8714 5.914 130.8817 5.7317 C 130.8817 5.7317 132.7901 23.3344 125.8337 38.2103 C 118.8773 53.0869 115.6035 54.4507 115.6035 54.4507 C 115.6035 54.4507 131.0188 39.8476 133.3369 19.6514 C 133.3369 19.6514 133.6095 30.9769 129.5179 40.8023 C 125.4262 50.6283 121.0605 58.1352 121.0605 58.1352 C 121.0605 58.1352 141.6564 39.437 138.2471 5.8681 C 138.2471 5.8681 142.2017 24.5626 138.6561 38.7558 C 135.1104 52.949 117.6489 74.7833 117.6489 74.7833 C 117.6489 74.7833 144.7946 50.764 146.0214 12.6901 C 146.0214 12.6901 149.2952 35.207 136.8143 55.6767 C 136.8143 55.6767 155.2285 34.7978 154.8196 14.9418 C 154.8196 14.9418 158.912 24.9717 155.433 38.6869 C 151.9555 52.402 135.3831 84.5397 118.1957 92.3186 C 118.1957 92.3186 164.8446 67.14 161.776 23.9489 C 161.776 23.9489 166.8907 43.5996 160.5485 62.6373 C 154.2062 81.6742 130.0624 110.7418 130.0624 110.7418 C 130.0624 110.7418 164.6401 78.8087 169.7556 44.0087 C 169.7556 44.0087 171.3921 33.3651 169.3459 27.0189 C 169.3459 27.0189 177.7351 30.7034 178.3485 46.4658 C 178.9619 62.2274 170.7787 83.5168 165.0498 98.4594 C 159.3209 113.4027 147.0453 133.2587 147.0453 133.2587 C 147.0453 133.2587 186.9422 72.258 181.2126 42.3714 C 181.2126 42.3714 191.4435 55.2675 190.2152 72.0535 C 188.9884 88.8386 180.3947 135.5105 156.4568 156.5946 C 156.4568 156.5946 182.2364 136.1249 189.3973 98.8693 C 189.3973 98.8693 193.08 79.0133 192.4659 68.1636 C 192.4659 68.1636 197.5806 91.0904 195.7396 108.2855 C 193.8986 125.4806 174.6658 163.9644 174.6658 163.9644 C 174.6658 163.9644 195.7396 131.826 197.1716 111.7654 C 197.1716 111.7654 199.4223 123.8425 197.7858 134.8968 C 196.1493 145.9503 186.7377 166.6253 178.7574 178.7024 C 178.7574 178.7024 195.5351 154.5482 199.0133 143.9031 C 202.4916 133.2587 201.8774 127.1179 201.8774 127.1179 C 201.8774 127.1179 205.9698 160.2799 199.4223 175.8369 C 192.8748 191.3939 172.2107 214.5253 170.7787 225.3742 C 170.7787 225.3742 180.3947 200.1964 201.264 196.3066 C 222.1333 192.4175 234 198.3538 234 198.3538 C 234 198.3538 202.2871 188.1186 185.3049 207.3608 C 185.3049 207.3608 176.712 217.8006 176.5068 227.2168 C 176.5068 227.2168 198.6044 211.6598 202.0819 190.3703 C 205.5608 169.0816 221.7244 165.8062 221.7244 165.8062 C 221.7244 165.8062 203.7191 172.5615 203.9236 190.9848 C 204.1281 209.408 183.4632 231.1059 178.553 230.4922 C 178.553 230.4922 195.3307 225.7841 201.264 211.6598 C 201.264 211.6598 197.3761 225.9886 188.9884 234.279 C 180.5992 242.5693 183.361 246.1515 183.361 246.1515 C 183.361 246.1515 186.2258 237.2475 194.6143 229.7754 C 203.0035 222.3041 214.0515 209.408 214.1538 200.7078 C 214.256 192.0084 223.3609 183.3082 223.3609 183.3082 C 223.3609 183.3082 216.2 192.4175 215.8925 198.9682 C 215.5858 205.5182 216.6089 215.7534 204.64 224.3513 C 192.6703 232.9485 187.6578 248.4033 187.8623 255.1585 C 187.8623 255.1585 196.2174 231.0377 220.7702 226.2621 C 220.7702 226.2621 197.3079 230.9013 188.9884 257.377 C 188.9884 257.377 204.537 230.9028 225.2707 223.9429 C 225.2707 223.9429 203.1739 233.3591 192.5347 256.4223 C 192.5347 256.4223 198.8089 240.044 218.4499 239.3629 C 218.4499 239.3629 202.0819 241.5457 195.3996 256.9671 C 195.3996 256.9671 198.3999 250.4186 209.5851 248.0979 C 220.7702 245.7772 230.1803 237.7255 227.8622 230.0823 C 227.8622 230.0823 230.7263 240.7252 216.1326 247.8229 C 201.5374 254.9206 195.4055 271.9161 195.4055 271.9161 C 195.4055 271.9161 207.2904 283.1744 216.8995 292.6617 C 216.1409 297.9746 213.5212 299.4365 211.0835 299.9987 C 210.2119 300.1997 189.8638 277.3056 188.7044 276.8495 Z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "raph_boy": "m210.33144,143.89894c-6.95941,-12.57172 -15.47375,-22.74984 -24.01424,-29.86983c-9.96541,7.29803 -22.10274,11.74199 -35.33479,11.74199c-13.25803,0 -25.41282,-4.45262 -35.36066,-11.74199c-8.54047,7.11999 -17.06351,17.29811 -24.04,29.86983c-16.19487,29.18793 -17.97591,59.1273 -3.98808,66.89018c6.26434,3.49693 12.83241,0.89052 19.61797,-5.6474c-1.19028,6.62904 -1.88538,13.81406 -1.88538,21.32939c0,33.38869 12.97153,60.43492 28.95753,60.43492c9.6353,0 14.40506,-9.84814 16.69862,-24.92639c2.2851,15.07825 7.05482,24.92639 16.6552,24.92639c16.01227,0 28.98392,-27.04623 28.98392,-60.43492c0,-7.51534 -0.69533,-14.70035 -1.91148,-21.32939c6.80278,6.53792 13.36221,9.14433 19.64394,5.6474c13.97922,-7.76288 12.17188,-37.70226 -4.02254,-66.89018zm-59.36613,-29.51799c26.89833,0 48.71428,-21.8159 48.71428,-48.72745s-21.81595,-48.72751 -48.71428,-48.72751c-26.90748,0 -48.74066,21.82024 -48.74066,48.72751s21.83318,48.72745 48.74066,48.72745z", |
| | | "raph_girl": "m210.47775,159.31802c-6.5556,-11.85419 -14.5853,-21.4483 -22.63556,-28.15549c-9.39328,6.87933 -20.83389,11.06407 -33.31883,11.06407c-12.49292,0 -23.95,-4.19719 -33.33109,-11.06407c-8.05025,6.70718 -16.07988,16.3013 -22.66017,28.15549c-15.26108,27.50842 -16.94806,55.72913 -3.76718,63.05058c5.9046,3.29617 12.09998,0.83537 18.49591,-5.32317c-1.12607,6.24446 -1.79353,13.01715 -1.79353,20.10512c0,31.47218 12.22685,56.96574 27.29962,56.96574c9.078,0 13.57817,-9.28665 15.73595,-23.49945c2.15787,14.2128 6.65384,23.49945 15.71159,23.49945c15.09309,0 27.3199,-25.49356 27.3199,-56.96574c0,-7.08797 -0.65509,-13.86066 -1.80157,-20.10512c6.41638,6.15854 12.59937,8.61934 18.5162,5.32317c13.20151,-7.32146 11.4939,-35.54216 -3.77124,-63.05058zm-55.96663,-27.82361c25.36684,0 45.93047,-20.56793 45.93047,-45.93063s-20.56363,-45.93048 -45.93047,-45.93048c-25.36276,0 -45.94283,20.56364 -45.94283,45.93048s20.58006,45.93063 45.94283,45.93063zm31.37788,-94.27703c13.25461,4.88095 5.27805,-7.78414 5.27805,-16.43626s8.1813,-19.23294 -5.27805,-14.92929c-14.12682,4.52865 -25.57977,7.01829 -25.57977,15.68267s11.45296,10.47439 25.57977,15.68288zm-31.29187,-6.16252c8.39418,0 3.70572,-4.25034 3.70572,-9.48752c0,-5.24121 4.70074,-9.47933 -3.70572,-9.47933s-4.01289,4.25037 -4.01289,9.47933c0,5.24941 -4.38142,9.48752 4.01289,9.48752zm-31.47208,6.16252c14.12683,-5.1963 25.57968,-7.02252 25.57968,-15.68288s-11.45285,-11.15402 -25.57968,-15.68267c-13.45937,-4.31592 -5.28221,6.26888 -5.28221,14.92929s-7.98471,21.30898 5.28221,16.43626z", |
| | | "raph_pen": "m146.83684,115.71881c-0.45042,-0.67755 -1.00925,-1.34163 -1.72177,-1.85109c-3.04871,-2.2215 -7.351,-1.54391 -9.58611,1.52216c-2.23131,3.07336 -1.52603,7.36902 1.52969,9.59677c2.77647,2.01186 6.48155,1.52948 8.8457,-0.83739l-64.87093,89.42747l-20.16745,73.20351l63.32053,-41.89926l144.20293,-198.7902l-43.17049,-31.31054l-13.91629,19.18622c-0.79611,-3.19165 -2.57372,-6.18823 -5.45471,-8.29767c-6.68427,-4.84662 -16.02917,-3.38049 -20.87282,3.3172c-27.75597,38.28942 -12.36926,48.48591 -38.13829,86.73282zm-31.75805,119.69107l-32.57163,21.55399l10.37183,-37.68758l22.19981,16.13359zm38.36887,-121.63963c19.98219,-29.52283 18.07886,-37.52791 35.18015,-63.73244c2.82889,1.94135 6.07655,2.62617 9.2648,2.45808l-44.44495,61.27437z", |
| | | "raph_clip": "m254.98035,21.30912c-21.11665,-15.11687 -50.51465,-10.26612 -65.65204,10.86102l-118.72278,165.76295c-10.80711,15.07626 -7.34069,36.07983 7.75584,46.88922c15.09648,10.78922 36.07957,7.32249 46.88668,-7.77365l83.82764,-117.02809l-10.92749,-7.83544l-83.81487,117.03815l0,0c-6.49191,9.03548 -19.08845,11.1275 -28.12135,4.6667c-9.04539,-6.47157 -11.11713,-19.07556 -4.63807,-28.13162l0,0l118.70741,-165.75288l0.01529,-0.01052l-0.02554,-0.01006c10.79433,-15.04511 31.84402,-18.52175 46.89943,-7.74307c15.05548,10.78889 18.53748,31.84415 7.75841,46.89928l0,-0.01001l-130.12462,181.67987l0.01277,0.02063c-15.10905,21.08588 -44.57393,25.95731 -65.66481,10.86099c-21.09067,-15.12738 -25.94428,-44.56136 -10.84798,-65.66789l94.56806,-132.03191l-10.93002,-7.82487l-94.56529,132.03193c-19.45266,27.15742 -13.20177,64.92889 13.96575,84.37384c27.16738,19.46548 64.93915,13.20953 84.39181,-13.93738l130.12166,-181.69052c15.09668,-21.11655 10.25589,-50.49928 -10.87589,-65.63668z", |
| | | "raph_tshirt": "m191.01682,41.7402c-6.65135,16.37186 -22.65103,27.93963 -41.39505,27.93963c-18.75568,0 -34.7588,-11.56777 -41.3954,-27.93963l-101.36017,42.98543l28.51685,67.20866l31.32125,-13.28813l0,137.02332l166.93693,0l0,-136.53912l30.19667,12.81158l28.52783,-67.2086l-101.34891,-42.99313z", |
| | | "raph_clip": "m254.98035,21.30912c-21.11665,-15.11687 -50.51465,-10.26612 -65.65204,10.86102l-118.72278,165.76295c-10.80711,15.07626 -7.34069,36.07983 7.75584,46.88922c15.09648,10.78922 36.07957,7.32249 46.88668,-7.77365l83.82764,-117.02809l-10.92749,-7.83544l-83.81487,117.03815l0,0c-6.49191,9.03548 -19.08845,11.1275 -28.12135,4.6667c-9.04539,-6.47157 -11.11713,-19.07556 -4.63807,-28.13162l0,0l118.70741,-165.75288l0.01529,-0.01052l-0.02554,-0.01006c10.79433,-15.04511 31.84402,-18.52175 46.89943,-7.74307c15.05548,10.78889 18.53748,31.84415 7.75841,46.89928l0,-0.01001l-130.12462,181.67987l0.01277,0.02063c-15.10905,21.08588 -44.57393,25.95731 -65.66481,10.86099c-21.09067,-15.12738 -25.94428,-44.56136 -10.84798,-65.66789l94.56806,-132.03191l-10.93002,-7.82487l-94.56529,132.03193c-19.45266,27.15742 -13.20177,64.92889 13.96575,84.37384c27.16738,19.46548 64.93915,13.20953 84.39181,-13.93738l130.12166,-181.69052c15.09668,-21.11655 10.25589,-50.49928 -10.87589,-65.63668z", |
| | | "raph_tshirt": "m191.01682,41.7402c-6.65135,16.37186 -22.65103,27.93963 -41.39505,27.93963c-18.75568,0 -34.7588,-11.56777 -41.3954,-27.93963l-101.36017,42.98543l28.51685,67.20866l31.32125,-13.28813l0,137.02332l166.93693,0l0,-136.53912l30.19667,12.81158l28.52783,-67.2086l-101.34891,-42.99313z", |
| | | "ball": "m1.36762,144.54343c-0.61252,-24.33647 11.43968,-48.24649 31.71385,-61.85355c33.0555,-25.12355 76.68359,-36.57172 117.69406,-29.65477c20.30775,-3.13354 29.29549,17.94864 22.15137,34.18353c-11.04268,10.79923 -30.25032,0.52836 -44.5518,6.11385c-46.3661,5.97041 -92.1348,26.12911 -123.47163,61.54787c-0.19116,-3.78908 -5.04203,-6.31387 -3.53584,-10.33693zm0.56006,21.59657c2.46893,-17.16783 19.59014,-26.10648 31.49495,-36.53964c40.07716,-28.36518 90.31613,-39.61352 138.89854,-37.70576c1.20387,19.56051 -8.00084,38.23036 -19.07559,53.7263c-15.20721,8.47826 -34.11861,-1.17561 -50.23914,6.54221c-28.27367,6.8441 -59.74523,15.46761 -77.84163,40.11734c-6.57559,19.79451 -20.47401,-0.35286 -21.54921,-12.00313c-1.52846,-4.62877 -1.3158,-9.384 -1.6879,-14.13731zm7.76269,-58.70418c2.42006,-21.53997 16.61662,-39.35048 29.64042,-55.76294c14.68114,-17.49181 34.66698,-30.31521 57.12629,-35.01287c17.80165,-4.64955 36.14864,-6.58389 54.39959,-8.53692c13.84103,10.63111 22.64574,29.11792 20.32661,46.60463c-10.75017,2.72292 -29.7578,-6.48294 -44.25362,-4.23798c-41.11142,0.38721 -83.13954,16.86419 -110.9226,47.60359c-2.31326,2.96635 -4.3931,6.11006 -6.31669,9.34248zm-2.20363,84.97105c15.37329,12.3277 15.8773,33.69405 25.32488,49.77684c-11.32475,-14.57886 -21.29314,-31.61081 -25.32488,-49.77684zm12.17333,11.7446c4.82258,-13.28815 19.94093,-31.96367 32.55468,-30.57486c5.04242,12.98813 7.22698,27.06129 15.42273,38.77007c22.00548,40.39473 62.27551,75.33984 110.15025,76.43997c7.82913,1.58691 28.58411,-3.6853 27.74063,-1.50394c-20.00963,9.82742 -43.17618,11.98239 -65.22374,11.19174c-40.94611,-2.71915 -81.7309,-22.38535 -106.34646,-55.65858c-6.96676,-11.95032 -10.92698,-25.33659 -14.29809,-38.66251zm33.70255,-33.88084c11.04849,-5.13829 31.74819,-20.7682 40.05036,-8.17067c20.26116,39.90601 54.51507,73.83781 96.68548,89.7942c21.8947,7.30453 46.52556,7.18939 67.87685,-1.92662c-8.90472,13.82597 -23.64018,22.69292 -37.52655,30.83714c-35.49046,15.14874 -78.39111,6.93469 -108.29421,-16.68286c-28.94243,-22.9118 -51.66176,-55.70389 -58.71476,-92.285l-0.04169,-0.84726l-0.03548,-0.71893l0,0l0,0zm14.80587,-143.69432c26.85995,-18.47492 60.14433,-27.13922 92.60995,-24.83766c-16.61871,10.60714 -37.47179,6.57748 -55.695,12.32051c-12.71339,2.76803 -25.33243,6.4903 -36.91495,12.51714zm23.19239,130.17215c17.68391,-8.37067 37.80864,-8.2348 56.92004,-7.08942c11.52194,17.94525 19.73788,38.80402 37.6284,51.74121c20.84937,18.617 51.18832,23.87227 77.45898,15.12419c9.02167,-6.09496 19.03778,-2.20023 14.1109,9.88971c-5.93085,20.07378 -26.98962,28.88977 -46.28781,29.86346c-39.48146,3.94382 -75.60028,-18.48682 -102.27098,-45.57831c-15.55914,-15.57706 -28.70033,-33.74123 -37.55954,-53.95085zm59.9713,-149.25921c14.39017,-11.41684 33.98842,-1.08634 48.71259,4.37706c14.6449,12.52997 16.60739,33.37817 20.47758,51.17717c6.47049,41.78263 3.85324,86.6684 -15.69031,124.8082c-4.67027,13.36929 -18.09242,20.61154 -26.69522,6.15724c-9.99724,-11.02568 -17.64142,-23.85532 -24.85538,-36.77173c-4.26648,-12.35977 9.69913,-21.07201 12.62395,-32.37317c5.6987,-11.2672 7.1479,-23.94022 7.7876,-36.27168c2.68518,-18.44756 0.04341,-37.58501 -4.80806,-55.44724c-3.40224,-9.88385 -8.92734,-19.45691 -17.55275,-25.65586zm41.36089,197.33399c28.32747,-32.0033 32.81847,-77.44762 30.6862,-118.36129c-1.29825,-24.12249 -4.96657,-49.05092 -17.68674,-70.0582c13.14473,0.40704 27.28206,12.75397 37.58124,21.8466c29.18982,37.11403 37.77368,91.40852 15.58273,134.05255c-8.72922,17.24329 -20.55305,32.80717 -34.43375,46.22929c-11.62009,-0.9548 -23.39864,-5.3515 -31.72969,-13.70895zm32.30334,13.89389c30.50691,-29.40305 52.59978,-71.66214 46.00664,-114.99303c-2.62479,-20.29454 -10.03497,-39.89902 -21.13239,-57.06778c20.32477,12.66527 31.62595,35.09759 41.79111,55.93748c14.61285,36.42265 6.66864,80.8159 -19.44537,109.92648c-13.41086,7.60643 -32.33356,8.77071 -47.21999,6.19685zm50.22404,-6.80072c10.46527,-18.28113 22.34006,-36.81323 23.43076,-58.50224c1.62656,-7.25171 -0.89633,14.22787 -1.77191,18.74721c-2.78329,15.96013 -6.41766,32.99399 -16.3092,46.01608c-2.27573,-1.26239 -1.2605,-7.4102 -5.34964,-6.26105z", |
| | | "bolt": "m178.14388,74.00616l-108.49727,68.79685l107.15599,23.63498l-99.04335,73.85934l-39.98779,-12.47227l28.36194,71.19228l112.7131,-31.06076l-47.58928,-12.98325l129.22581,-106.08589l-118.12698,-19.22734l114.07071,-71.6874l-65.0681,-10.76349l70.86891,-45.56109l-26.03423,-0.65478l-109.97452,62.50492l51.92505,10.50792z", |
| | | "car_smart": "m28.92024,238.37814c-20.54175,-8.15092 -27.36674,-32.3504 -27.6178,-52.52942c-2.7836,-14.94118 14.71887,-25.93048 8.95686,-41.2937c-2.18657,-22.71175 4.68564,-45.20703 14.9548,-65.22043c0.32475,-12.85873 10.87969,-17.84956 22.37955,-17.11762c37.15603,-4.71741 74.98359,-4.84966 112.15372,-0.39277c22.18198,4.11681 39.85953,19.32546 58.61859,30.81274c11.63586,8.63808 25.21985,14.32888 36.92355,22.63131c12.64026,10.62529 24.51556,22.47708 33.27448,36.57193c3.15143,14.09033 7.38165,28.09947 9.54742,42.2829c4.39661,13.27223 -4.6037,21.62047 -11.41214,30.84103c-10.34,12.57306 -29.90723,17.53416 -44.71561,10.78313c-10.28528,-3.75465 -14.07077,-19.70746 -25.7968,-18.60466c-44.20906,-0.65964 -88.41812,-1.31926 -132.62719,-1.97884c-10.24168,13.44736 -24.40165,28.14365 -42.91705,26.05086c-4.02312,-0.33679 -7.97831,-1.33774 -11.7224,-2.83646z", |
| | |
| | | "dagger": "m1.57422,47.21264c-2.775,14.24454 5.08469,27.79975 11.2199,40.10517c13.07098,21.70464 28.2358,42.59465 47.26681,59.46329c12.98537,10.6889 24.68548,22.99878 39.38902,31.4678c19.22253,12.95224 39.86254,23.55869 61.26455,32.3793c15.9138,6.93546 32.60274,11.85577 49.65401,15.08282c4.95967,1.28564 18.82625,4.91663 10.19991,-3.60251c-7.15544,-3.02133 -14.76756,-5.22583 -21.96236,-8.37695c-34.92769,-14.34082 -72.04247,-26.94104 -100.21951,-53.10463c-4.66899,-6.20064 8.95855,3.3492 11.3067,5.96803c23.50703,16.73581 50.36192,27.95749 76.84653,39.04178c13.47301,4.46384 28.20039,13.97903 42.51408,7.22675c12.36502,-4.72467 -2.95702,-5.44891 -8.42033,-7.24844c-24.28337,-6.90491 -48.85286,-13.54227 -71.13893,-25.76019c-12.72568,-4.65573 -23.42126,-13.22678 -34.85331,-20.29132c-12.35065,-8.53128 -23.65424,-18.49934 -35.67798,-27.49634c-7.86864,-5.96642 -15.68669,-11.98865 -22.20108,-19.46664c-11.01625,-11.02383 -21.70009,-22.36108 -31.68482,-34.33246c-6.52307,-7.36439 -13.86146,-14.10685 -18.44664,-22.93894l-5.05655,-8.11652zm256.45175,139.13108c-1.50562,-0.04745 -3.06,0.28214 -4.36211,1.15021c-9.72246,4.86124 -7.63908,13.88922 -13.19478,20.83386c-4.16678,5.55569 -9.028,8.33356 -15.97261,10.41693c1.38892,2.77783 4.16675,6.94461 4.16675,10.41693c0,7.63907 -9.02798,14.58368 -15.97261,13.88922c-2.77786,-0.69446 -9.028,-4.16678 -11.11139,0c-0.69446,1.38895 -0.69446,2.77786 0,3.47232c0,2.77786 3.47231,4.16678 6.25015,5.55569c7.63908,2.08337 15.97263,-0.69446 22.22279,-4.86124c4.86122,-2.77783 8.33353,-7.63907 9.72246,-13.19479l1.38892,-9.02798c0.69446,-2.77783 3.47232,-3.47232 6.94463,-8.33353c4.16676,-5.55569 8.33354,-15.2782 13.88924,-19.44495c2.08337,-1.38892 4.16675,-2.0834 6.94461,-2.77786c-1.38892,-2.08337 -2.77786,-3.47229 -4.16678,-5.55566c-1.38892,-0.69449 -2.77783,-2.0834 -4.16675,-2.0834c-0.78128,-0.26041 -1.6792,-0.42728 -2.58252,-0.45575zm29.4061,26.21594c-2.61084,-0.02899 -5.33868,0.54254 -8.07312,1.32382l5.55569,3.47232c-1.38895,2.77783 -4.86121,8.33353 -4.16678,11.80585c0.69449,6.94461 10.41693,6.94461 14.58371,2.77783c4.86124,-5.55569 4.86124,-13.88922 -2.08337,-18.056c-1.82297,-0.91147 -3.78549,-1.30127 -5.81613,-1.32382zm-13.39011,3.40723c-0.54364,0.00192 -1.07498,0.00705 -1.60593,0.0217c-3.8486,0.21091 -7.69568,0.50116 -11.54541,0.67276c-2.41867,0.03116 -4.88754,-0.00473 -7.22676,0.69446c-3.17285,2.02515 -5.29396,5.38272 -6.53229,8.87607c-0.16666,0.50345 -0.30807,1.02072 -0.41234,1.54083c3.86218,1.74924 8.17189,1.5618 12.30499,1.41064c2.50439,-0.06696 5.00949,0.24561 7.50888,0.36893c1.7876,0.07916 3.57104,0.32327 5.36038,0.26044c2.19412,-0.07278 4.22598,-1.3168 5.38205,-3.16849c0.99927,-1.58255 1.9447,-3.21933 2.56085,-4.99146c0.49768,-1.59048 0.5896,-3.80087 -1.06339,-4.75272c-1.43857,-0.79446 -3.10013,-0.93906 -4.73105,-0.93317zm2.53915,15.9726c-0.69449,0.69446 -1.38892,0.69446 -2.0834,1.38892c-0.69446,3.47232 8.33356,11.80588 9.72247,4.16678c-3.47232,-1.38892 -5.55573,-2.77786 -7.63907,-5.55569z", |
| | | "menorah": "m86.17095,270.72717c9.02267,-23.09398 33.59461,-36.70894 57.45916,-38.45409c0,-4.91623 0,-9.83244 0,-14.74866c-38.305,-2.75075 -76.20534,-18.86525 -101.66333,-48.29793c-23.2569,-24.97108 -35.58256,-58.55817 -37.27682,-92.42073c-13.45491,-9.58464 12.56556,-16.55834 15.7355,-5.95607c-7.24909,8.79617 -0.22592,22.59306 0.80432,33.36646c11.47956,50.91395 56.38975,91.60496 107.78628,98.82449c13.14264,5.82442 16.6395,-2.00252 14.39308,-13.99509c2.81267,-9.48175 -7.44086,-6.60333 -13.57417,-8.37358c-40.52152,-7.1041 -75.7263,-38.65041 -86.11595,-78.75394c-2.97659,-11.47399 -3.94458,-24.11363 -7.5694,-33.51495c7.70256,-6.02401 26.19639,-1.60448 15.97076,9.15671c1.09565,45.56244 38.91488,85.76277 83.65269,91.48959c9.24995,4.52249 8.18915,-3.21457 7.85701,-9.40932c4.90146,-15.06035 -9.71606,-12.79654 -19.53952,-16.50067c-27.62657,-9.39215 -47.87568,-36.35101 -49.79039,-65.51331c-13.2153,-11.51691 15.74928,-17.53994 15.95383,-5.55531c-7.59098,8.84892 0.96818,23.21689 5.54156,32.6564c10.3335,16.84724 28.24842,28.22102 47.83452,30.47823c0,-7.52246 0,-15.04491 0,-22.56738c-18.20905,-2.81535 -32.7534,-18.72141 -34.8131,-36.97318c-12.40635,-10.10166 14.58986,-14.97282 16.53119,-5.29626c-6.736,5.28018 -1.66743,13.75206 2.28733,19.47478c2.82583,3.38407 16.81124,15.16281 15.99458,6.28913c0,-10.03232 0,-20.06463 0,-30.09695c-8.52963,-5.41637 3.21713,-9.02356 -1.91258,-15.41792c2.95047,-6.63559 4.28693,-23.79965 6.49635,-24.00391c7.40089,10.5439 4.63795,25.17949 11.62167,34.34932c-3.85376,4.14688 -4.52328,8.74758 -3.86568,14.89357c0,8.05796 0,16.11592 0,24.17388c11.03737,-3.24367 21.02812,-12.42406 21.72646,-24.48188c-12.61211,-14.80839 30.69243,-11.52931 12.71999,1.59949c-1.87195,17.85434 -17.0993,32.57059 -34.44644,35.57887c0,7.49281 0,14.98562 0,22.47842c29.68999,-2.98224 55.87296,-29.1582 56.39926,-59.47436c-12.36238,-13.6567 27.91393,-12.75137 14.12813,-0.52898c-3.16423,14.80594 -6.23018,30.54218 -16.29872,42.63571c-12.70108,17.1765 -33.04718,27.37456 -53.98901,29.78134c0.16994,9.14496 -4.65584,28.46082 11.13493,20.75519c39.31322,-6.69104 72.74197,-39.63307 78.74797,-79.43351c5.73982,-8.84732 -8.70837,-25.00382 8.28397,-22.77648c10.50046,-2.44997 11.98193,6.34405 5.8692,11.72792c-2.04736,35.89314 -21.91298,70.45303 -53.09749,88.60141c-15.52945,9.13074 -33.16388,14.88533 -51.17824,15.85547c0.17836,7.53169 -0.4761,15.16116 0.61618,22.6142c35.31798,-2.81911 70.08339,-18.10321 93.11932,-45.67516c20.51892,-23.04272 31.08511,-53.43816 32.84753,-84.00375c-10.43478,-10.04525 11.39471,-11.61442 16.59445,-7.04305c-5.883,11.66189 -5.21661,27.04671 -9.11984,40.52295c-12.68921,53.08224 -58.41412,95.84925 -111.85593,105.51876c-7.32545,1.56883 -14.77785,2.36348 -22.20172,3.29227c-0.71042,9.09981 -0.50818,18.35449 11.59822,16.61531c20.59241,4.32626 40.36211,18.55411 46.94081,39.19469c-43.09088,0 -86.18179,0 -129.2727,0c0.31159,-0.88608 0.62314,-1.77219 0.93477,-2.65823zm-82.88959,-208.5947c-0.54892,-8.1144 4.33617,-25.42208 5.66115,-27.43132c2.27143,7.42761 12.58555,23.78434 4.72879,28.60384c-3.29131,-0.38358 -8.04816,1.57556 -10.38994,-1.17252zm34.52483,0.55147c-1.7146,-10.01769 5.4567,-19.41309 4.51432,-29.75311c3.2196,8.43034 16.36395,29.47998 1.96646,30.42084c-2.16732,-0.0773 -4.38702,0.03559 -6.48078,-0.66772zm35.62526,-0.17229c-1.52428,-9.82734 5.20364,-19.12723 4.61758,-29.264c3.98769,8.50923 17.39558,32.7104 -0.82941,30.07944l-1.91212,-0.12625l-1.87605,-0.68919l0,0zm34.60818,0.26421c-1.9521,-10.01891 5.40411,-19.48301 4.43661,-29.84504c3.27068,8.4848 16.29427,29.36411 1.98981,30.63179c-2.15335,-0.08198 -4.37302,0.0215 -6.42642,-0.78675zm69.2087,-0.38279c-1.5544,-10.07727 5.31645,-19.6095 4.34973,-30.05398c2.70531,5.08463 6.32187,13.73424 7.91895,20.50951c4.77353,11.03205 -3.95122,12.51878 -12.26868,9.54446zm35.71176,0.44493c-2.89404,-9.75608 5.30412,-19.55815 4.07715,-29.90718c3.42241,8.32418 12.40758,23.15913 6.53528,30.337c-3.53609,0.01955 -7.13571,0.41735 -10.61243,-0.42982zm34.8703,-0.20629c-2.23303,-8.13288 4.34842,-24.82986 5.07388,-28.23849c3.49849,8.39077 16.5291,33.58521 -2.7937,28.93562l-2.28018,-0.69713l0,0zm35.10023,-0.15336c-1.90784,-8.93159 5.20419,-21.786 4.83258,-28.71239c3.47043,8.02287 16.97986,32.30244 -0.94669,29.60343l-1.89111,-0.14957l-1.99478,-0.74147l0,0z", |
| | | "chair": "m118.11539,289.55515c-7.47328,-14.4328 15.76004,-21.83389 9.75156,-35.26642c-9.58212,-8.59285 -23.93785,-6.58557 -35.88018,-5.92961c-12.89955,-1.58955 -16.67669,11.62587 -24.11323,17.11729c-14.66394,-4.57965 -9.41961,-23.5907 3.95336,-25.69879c17.48831,-7.56879 36.79559,-3.21786 54.96046,-6.57193c13.14571,-7.65541 -3.09947,-24.09541 -13.42245,-25.84244c-17.08451,-6.9008 -38.18468,-7.0844 -51.24073,-21.62146c-5.1916,-11.32457 -3.84497,-32.04767 10.15321,-36.01445c6.34414,-10.73523 5.01785,-24.55999 3.35027,-36.47948c1.42348,-12.67513 -26.70474,-5.25126 -14.90233,-18.24577c10.64336,-8.15804 24.36629,-13.15867 37.81105,-12.959c10.96933,0.36309 11.71716,12.99065 -0.37628,9.89848c-12.30081,6.18077 -7.72121,23.86169 -7.25122,35.16668c5.93514,11.39347 22.04794,5.36764 32.49831,7.07384c14.8665,0.39955 21.73593,0.44463 35.83476,5.23605c14.25958,-1.05464 8.64325,-20.61657 0.17079,-21.97119c-13.03212,-2.87206 -25.91483,-10.25501 -33.20317,-21.62909c-4.07215,-13.26593 1.69855,-27.24597 4.77583,-40.18096c9.18196,-28.0861 34.13237,-54.57027 65.33606,-54.63913c19.15414,0.28833 38.85675,14.48402 42.13089,33.82922c2.48616,20.34066 -5.57245,41.0622 -0.32005,61.11538c12.75343,7.04288 -8.70227,17.78406 -9.16336,27.50478c-5.43883,14.13736 6.97403,30.55498 -3.65417,43.29654c-6.64983,9.38159 -22.16026,14.5639 -22.43275,27.04953c-3.81845,11.24202 -21.47061,10.39703 -30.28923,17.71931c-9.74564,2.86838 -15.08257,19.17726 -0.15649,15.9317c14.55153,-0.35892 29.03516,-5.81784 43.55118,-3.3181c10.39314,7.10063 -0.45073,21.22018 -10.9113,14.54475c-5.46445,0.08383 -25.63857,2.80356 -18.76688,8.69054c17.18895,4.015 35.8273,9.2104 46.95854,24.0352c10.43184,13.90863 -12.73763,17.22995 -17.34935,5.0022c-19.29245,-15.75378 -48.30531,-24.24933 -70.97163,-10.48508c-13.71143,5.73386 -10.53542,20.53958 -11.98199,31.56015c-5.57972,6.09451 -13.26627,-2.5275 -14.84946,-7.91876zm100.26077,-153.99353c-4.62421,-8.64436 -27.69229,-17.16811 -30.82967,-4.71919c1.76141,12.68575 19.62196,15.68971 29.15408,10.51048c1.73547,-1.32053 2.45361,-3.74493 1.67558,-5.79129z", |
| | | |
| | | |
| | | "bone": "m273.3559,119.27242c-11.58661,5.90293 -23.89537,9.95385 -36.67676,12.27164c-53.42084,0.2984 -105.13121,0.41397 -158.74251,2.97562c-14.28426,-2.65407 -30.58815,0.18161 -42.82426,-9.13783c-9.06827,-7.25944 -28.17529,-2.4415 -25.05096,11.36483c6.17649,14.08824 -14.61965,21.70474 -7.59176,36.00003c6.11589,14.67987 24.54805,9.02721 35.59484,4.1729c20.29636,-4.79665 40.55842,-9.8537 60.92737,-14.38416c42.52868,-4.82219 82.54949,-1.83121 124.59118,1.02063c11.68694,2.54654 23.55803,4.03351 35.45654,5.38187c10.1839,0.16006 18.34979,7.46698 27.92017,8.65919c12.6539,-1.22533 16.41983,-19.19981 7.59747,-27.17406c-13.18918,-8.72406 6.75436,-24.14882 -8.14166,-31.38885c-4.25287,-2.31086 -8.733,-0.75754 -13.05966,0.23817z", |
| | | "raph_gear2": "m162.95016,254.38129c-2.80937,0.26439 -5.68164,0.44717 -8.63573,0.44717l0,0c-2.64238,0 -5.20918,-0.14467 -7.71307,-0.35916l0,0l-21.68047,27.86606l-5.33187,-1.51157c-6.25791,-1.75732 -12.33638,-3.96201 -18.18163,-6.60748l0,0l-5.06733,-2.29276l1.30382,-35.00255c-4.60764,-3.22517 -8.90648,-6.81548 -12.88757,-10.75204l0,0l-34.27816,7.36342l-3.13052,-4.59854c-3.67223,-5.39792 -6.80273,-11.05444 -9.57725,-16.77345l0,0l-2.40936,-4.99521l23.2742,-25.7621c-1.45512,-5.4549 -2.41877,-11.08614 -2.91638,-16.82405l0,0l-30.84222,-16.30753l0.56056,-5.52432c0.66148,-6.60759 1.94003,-12.93144 3.46751,-19.00977l0,0l1.36378,-5.39204l34.401,-4.76184c2.45332,-5.17765 5.34148,-10.08439 8.59473,-14.69526l0,0l-13.12671,-32.31919l3.96201,-3.8801c4.65784,-4.53519 9.64348,-8.64822 14.84618,-12.40874l0,0l4.50686,-3.24997l29.69582,18.65062c5.00454,-2.30524 10.23878,-4.20122 15.66204,-5.65638l0,0l10.76474,-33.40262l5.54927,-0.4219c2.98885,-0.22039 6.20128,-0.47875 9.69389,-0.47875l0,0c3.48323,0 6.68608,0.25836 9.67506,0.47875l0,0l5.54912,0.4219l10.88121,33.74931c5.21544,1.45478 10.27031,3.31305 15.11414,5.56818l0,0l30.11157,-18.91571l4.52254,3.25032c5.20284,3.75422 10.19766,7.8798 14.84639,12.39616l0,0l3.97758,3.8801l-13.52985,33.27679c2.94791,4.28308 5.60591,8.81837 7.87672,13.58657l0,0l35.47502,4.91299l1.37939,5.39169c1.54953,6.07229 2.82196,12.39613 3.46741,19.01633l0,0l0.56073,5.52397l-31.91942,16.87434c-0.47862,5.23462 -1.32898,10.3871 -2.59824,15.40709l0,0l24.04893,26.56871l-2.41867,5.01361c-2.76517,5.73837 -5.88004,11.41356 -9.56799,16.79272l0,0l-3.13049,4.58539l-35.12848,-7.52676c-3.72264,3.72243 -7.75381,7.14909 -12.06235,10.24184l0,0l1.33846,35.68912l-5.07996,2.29913c-5.85167,2.6329 -11.92058,4.84381 -18.17828,6.6012l0,0l-5.351,1.51169l-21.72769,-27.93539l0,0zm27.87856,8.93823c1.87401,-0.62378 3.71637,-1.29791 5.53973,-2.01599l0,0l-1.25342,-33.70486l3.95258,-2.53862c5.92082,-3.84203 11.31258,-8.453 16.09976,-13.68709l0,0l3.18718,-3.48941l33.239,7.11739c0.99838,-1.66928 1.96515,-3.37619 2.89732,-5.12077l0,0l-22.73553,-25.13866l1.41093,-4.49123c2.00607,-6.46886 3.14622,-13.40402 3.48315,-20.64091l0,0l0.20787,-4.71185l30.19965,-15.961c-0.31488,-1.93385 -0.67691,-3.85492 -1.0896,-5.78259l0,0l-33.60109,-4.64815l-1.80759,-4.34639c-2.7023,-6.50063 -6.27693,-12.58513 -10.54437,-18.19731l0,0l-2.82191,-3.74155l12.78032,-31.43731c-1.48026,-1.29786 -2.99829,-2.5574 -4.55721,-3.77935l0,0l-28.5273,17.90761l-4.2014,-2.2175c-6.22311,-3.27536 -12.95352,-5.76342 -20.05234,-7.37577l0,0l-4.59178,-1.0518l-10.30167,-31.94773c-1.00163,-0.05022 -1.97475,-0.07566 -2.92271,-0.07566l0,0c-0.96696,0 -1.94005,0.02544 -2.94794,0.07566l0,0l-10.22914,31.73996l-4.65805,0.99522c-7.22169,1.54925 -14.10935,4.07524 -20.52469,7.39468l0,0l-4.19198,2.17928l-28.06441,-17.62396c-1.54948,1.22195 -3.07073,2.48149 -4.53823,3.77935l0,0l12.44003,30.61225l-2.9225,3.74755c-4.55724,5.8516 -8.34605,12.26398 -11.18684,19.14856l0,0l-1.79825,4.3651l-32.5209,4.49724c-0.41253,1.92767 -0.77778,3.84874 -1.08328,5.78259l0,0l29.15414,15.41315l0.17944,4.74907c0.30542,7.66602 1.58731,15.02303 3.79182,21.90135l0,0l1.44259,4.52234l-22.01771,24.35774c0.92602,1.75093 1.88968,3.45782 2.89761,5.127l0,0l32.33173,-6.96017l3.21879,3.48952c4.96029,5.42989 10.62607,10.14755 16.86828,14.06561l0,0l4.02816,2.51289l-1.23148,33.18852c1.82667,0.71808 3.67535,1.39221 5.54923,2.01599l0,0l20.46497,-26.31657l4.67366,0.57292c3.52736,0.4473 6.96019,0.73706 10.37738,0.73706l0,0c3.67532,0 7.3821,-0.32111 11.17093,-0.85657l0,0l4.71475,-0.66118l20.62231,26.52434l0,0zm9.32855,-68.34235l4.50986,6.92841l-28.59032,18.60074l-10.14731,-15.61513l0,0c-3.69124,0.90065 -7.5713,1.43016 -11.60878,1.43016l0,0c-27.93851,0 -50.57646,-22.64441 -50.57646,-50.55453l0,0c0,-27.93514 22.63795,-50.5733 50.57646,-50.5733l0,0c27.90698,0 50.55104,22.63816 50.55104,50.5733l0,0c0,11.46997 -3.85472,22.09612 -10.31726,30.58083l0,0l5.60277,8.62953m-19.23358,2.66414l0.89128,-0.56667l-8.15065,-12.54086l4.72406,-4.72429c6.17615,-6.1917 9.96483,-14.63838 9.96483,-24.04268l0,0c-0.03468,-18.80183 -15.2589,-34.02641 -34.03877,-34.064l0,0c-18.8241,0.0376 -34.03256,15.24316 -34.06407,34.064l0,0c0.03151,18.78311 15.25571,34.00732 34.06407,34.04527l0,0c4.20117,0 8.24515,-0.86304 12.15982,-2.36212l0,0l6.24211,-2.39357l8.20732,12.58492l0,0z", |
| | | "raph_gear": "m245.88898,160.48737l33.405,-17.66776c-0.65668,-6.5461 -1.92581,-12.89622 -3.51349,-19.1387l-37.10818,-5.13857c-3.21184,-7.73717 -7.45319,-14.91318 -12.43881,-21.50042l14.14514,-34.78872c-4.65118,-4.53608 -9.67427,-8.67167 -14.96115,-12.47703l-31.50966,19.78136c-7.38905,-3.88574 -15.35004,-6.83701 -23.70718,-8.73246l-11.3871,-35.2773c-3.22949,-0.24387 -6.45805,-0.50152 -9.75151,-0.50152s-6.51289,0.2517 -9.75209,0.50152l-11.27429,34.96482c-8.58116,1.83471 -16.71793,4.82026 -24.29691,8.75396l-31.01895,-19.49038c-5.28019,3.80536 -10.30307,7.94096 -14.95388,12.47703l13.75587,33.82779c-5.36137,6.87132 -9.85005,14.45284 -13.22145,22.62391l-35.93671,4.97007c-1.58098,6.23371 -2.85675,12.5771 -3.50667,19.13792l32.25408,17.06512c0.36542,8.98315 1.85477,17.68929 4.49208,25.88777l-24.33074,26.9024c2.83031,5.87039 5.9814,11.56342 9.6267,16.90457l35.82153,-7.69016c5.87321,6.39034 12.56474,11.98932 19.94749,16.61948l-1.35777,36.65076c5.88309,2.65335 11.99571,4.87399 18.29496,6.64899l22.66223,-29.13004c4.02098,0.51334 8.09276,0.85909 12.24583,0.85909c4.49908,0 8.89894,-0.40645 13.22795,-1.00122l22.78024,29.29164c6.30914,-1.77295 12.41245,-3.99347 18.29494,-6.64697l-1.38397,-37.30896c7.03673,-4.55559 13.41745,-10.00571 19.04277,-16.15907l36.75313,7.88618c3.64532,-5.34033 6.79684,-11.0273 9.62613,-16.9026l-25.11879,-27.78322c2.41295,-7.76558 3.76083,-15.96324 4.15324,-24.41928zm-55.52159,42.4395l-15.83789,10.31044l-9.74136,-14.9669c-5.0676,1.94922 -10.52345,3.13446 -16.2748,3.13446c-25.11868,0 -45.47503,-20.36435 -45.47503,-45.47913c0,-25.1158 20.35635,-45.47227 45.47503,-45.47227c25.11212,0 45.47591,20.35647 45.47591,45.47227c0,12.5506 -5.08424,23.89621 -13.30255,32.12807l9.68069,14.87306z", |
| | |
| | | "raph_hammer": "m63.36809,285.67313c6.96776,3.59244 16.47661,11.9801 23.84013,8.91132c4.83001,-1.9863 7.65633,-13.23322 10.6572,-19.15341c22.58896,-44.50285 47.13901,-95.11987 65.00839,-138.42389c0,-1.93199 1.02618,-3.42567 -0.49857,-6.05217c9.99582,-16.27104 16.78117,-34.14814 27.70221,-52.25417c3.45876,-5.75348 6.97752,-13.7377 11.82889,-16.03837l8.95993,-3.73985c11.39044,-2.92912 19.71024,-2.82827 27.65184,4.81071c4.0269,3.89508 5.87952,10.31972 9.77467,14.18769c2.63412,2.64196 12.67062,9.14025 16.40283,8.13548c2.89996,-0.78365 5.28986,-3.70498 7.32275,-7.40622l7.07837,-13.07806c1.98428,-3.72042 3.11331,-7.30138 2.18805,-10.16062c-1.19101,-3.68168 -12.12384,-8.54287 -15.78421,-9.30328c-5.37122,-1.15219 -11.73761,0.82254 -17.20779,-0.41896c-10.75037,-2.47131 -15.38852,-9.37697 -19.15163,-20.54245c-26.52289,-15.59208 -62.23056,-25.72946 -103.80629,-12.65136c-11.27793,3.54983 -22.08852,6.24227 -29.50239,13.45449c-1.48589,4.18987 1.45297,5.02407 4.53523,4.97355c-2.41113,2.19592 -6.30618,3.46841 -4.05797,8.62437c25.3744,-11.6543 74.64912,-15.68129 77.99525,8.17434c0.73132,5.31115 -4.01729,12.62416 -6.93675,18.66467c-9.2043,19.05656 -20.45122,34.51673 -28.60803,51.77705c-3.03192,0.17072 -3.72249,1.82726 -5.34029,2.91743c-26.48211,38.64464 -55.43742,86.86412 -80.34243,130.11772c-3.31706,5.75339 -11.16743,14.25751 -10.19173,19.38232c1.46458,7.8407 13.51648,11.49146 20.48232,15.09167z", |
| | | "raph_lock": "m222.74843,140.97418l0,-31.60164l-0.00876,0c-0.01239,-39.003 -31.62297,-70.60465 -70.62114,-70.60465s-70.62597,31.6186 -70.62597,70.62157l0,0l0,31.58472l-25.54068,0l0,135.66266l192.32891,0l0,-135.66266l-25.53236,0zm-118.94279,-31.58472c0,0 0,0 0,0c0,-26.65088 21.67455,-48.3259 48.3129,-48.3259c26.65535,0 48.32988,21.67502 48.32988,48.30898c0,0 0,0 0,0l0,31.60164l-96.64278,0l0,-31.58472z" |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
| | | |
| | | The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software. |
| | | The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software. |
| | |
| | | "raph_quote": "M14.505,5.873c-3.937,2.52-5.904,5.556-5.904,9.108c0,1.104,0.192,1.656,0.576,1.656l0.396-0.107c0.312-0.12,0.563-0.18,0.756-0.18c1.128,0,2.07,0.411,2.826,1.229c0.756,0.82,1.134,1.832,1.134,3.037c0,1.157-0.408,2.14-1.224,2.947c-0.816,0.807-1.801,1.211-2.952,1.211c-1.608,0-2.935-0.661-3.979-1.984c-1.044-1.321-1.565-2.98-1.565-4.977c0-2.259,0.443-4.327,1.332-6.203c0.888-1.875,2.243-3.57,4.067-5.085c1.824-1.514,2.988-2.272,3.492-2.272c0.336,0,0.612,0.162,0.828,0.486c0.216,0.324,0.324,0.606,0.324,0.846L14.505,5.873zM27.465,5.873c-3.937,2.52-5.904,5.556-5.904,9.108c0,1.104,0.192,1.656,0.576,1.656l0.396-0.107c0.312-0.12,0.563-0.18,0.756-0.18c1.104,0,2.04,0.411,2.808,1.229c0.769,0.82,1.152,1.832,1.152,3.037c0,1.157-0.408,2.14-1.224,2.947c-0.816,0.807-1.801,1.211-2.952,1.211c-1.608,0-2.935-0.661-3.979-1.984c-1.044-1.321-1.565-2.98-1.565-4.977c0-2.284,0.449-4.369,1.35-6.256c0.9-1.887,2.256-3.577,4.068-5.067c1.812-1.49,2.97-2.236,3.474-2.236c0.336,0,0.612,0.162,0.828,0.486c0.216,0.324,0.324,0.606,0.324,0.846L27.465,5.873z", |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | "logo_apple": "M21.367,4.494c-3.318,0.611-4.42,3.39-4.463,4.979c1.824,0.132,2.967-0.899,3.432-1.502 C21.097,7.115,21.281,5.91,21.367,4.494z M21.775,9.983c-2.399,0-3.739,0.98-4.398,0.991c-0.759-0.059-2.967-0.947-4.255-0.961 c-4.51,0.134-5.8,5.035-5.744,7.142c0.367,8.065,5.289,10.148,6.093,10.343c0.646,0.127,2.821-0.995,4.42-0.943 c1.747,0.182,2.969,0.905,3.669,0.855c0.889-0.062,3.783-2.4,4.656-6.007c-1.758-1.487-2.844-2.836-2.941-4.114 c-0.046-0.579,0.825-3.85,2.212-4.769c0.2-1.13-1.86-2.564-3.476-2.532C21.931,9.985,21.853,9.983,21.775,9.983z", |
| | | "raph_feed": "M4.135,16.762c3.078,0,5.972,1.205,8.146,3.391c2.179,2.187,3.377,5.101,3.377,8.202h4.745c0-9.008-7.299-16.335-16.269-16.335V16.762zM4.141,8.354c10.973,0,19.898,8.975,19.898,20.006h4.743c0-13.646-11.054-24.749-24.642-24.749V8.354zM10.701,25.045c0,1.815-1.471,3.287-3.285,3.287s-3.285-1.472-3.285-3.287c0-1.813,1.471-3.285,3.285-3.285S10.701,23.231,10.701,25.045z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "skull": "m74.9404,81.44109c-2.88919,16.35929 -10.26919,31.99403 -10.76614,48.86361c0.66122,9.76746 -5.89156,15.01402 -14.86213,14.8293c-9.64813,10.00099 1.19087,25.80647 12.10749,29.84357c11.14103,7.47832 24.96226,-0.87791 35.99846,5.83044c14.65424,11.4554 20.77205,31.76607 15.71635,49.57211c-5.02672,14.69893 20.70476,9.35306 11.02628,-2.39693c-7.47506,-11.48471 14.09103,-7.68764 8.56998,3.21603c-1.04326,8.75262 6.45616,11.58562 3.11867,20.06531c8.69472,4.98558 -0.72885,7.77708 -6.02475,8.71843c-12.40178,6.18225 2.24324,-11.07452 -7.58144,-16.17874c-8.99694,1.95532 -2.90059,17.02136 -5.98875,15.28125c-6.3575,-4.97824 -6.35281,-23.59047 -17.02285,-11.44621c-3.54128,-14.96387 2.92009,-30.54814 -2.05737,-45.42514c2.03897,-11.11034 -15.50281,-14.9426 -13.28409,-2.05647c0.88449,19.66696 -5.0876,39.29475 -1.66005,58.86481c4.72071,12.07065 17.92378,17.50833 26.2104,26.82291c6.80557,7.18207 15.6284,14.86087 26.22089,12.5997c12.0141,-0.52078 24.05035,-1.63034 36.01024,0.2771c15.04311,0.47446 26.52666,-11.41623 39.36443,-17.5242c15.0918,-11.98355 12.71564,-33.38867 11.21118,-50.43889c-1.84476,-10.52664 2.20334,-21.05807 1.44894,-31.48618c-10.88037,-13.31276 -19.80722,10.08708 -16.70779,20.14043c-0.00076,12.64635 2.42783,28.93701 -9.63577,37.17496c-9.95572,-0.25104 -19.43069,3.36517 -29.4632,1.4744c-8.14081,4.83435 -21.32692,4.71021 -24.01404,-6.79811c-1.07281,-10.22015 3.55807,-20.93494 -2.73401,-30.47318c5.52835,4.7614 15.17361,-4.11226 9.79822,6.56248c-6.55643,8.68922 5.55173,22.07874 10.10989,9.25331c1.51227,-8.60512 -6.54141,-20.02596 6.69714,-18.18237c2.6998,3.03528 -9.21959,24.26701 7.07346,18.90152c11.61606,-2.54445 -2.06659,-20.76607 13.66382,-20.82939c7.61295,-8.9626 5.56317,-25.76184 17.20825,-32.56114c12.98419,-8.78706 33.2569,-2.44315 42.52423,-17.32399c7.89911,-7.61507 4.18182,-28.72154 -9.44128,-21.72794c-17.02448,1.65962 -3.51318,-23.0582 -3.98819,-32.32024c4.01126,-8.06691 -4.87137,-25.04774 -1.81268,-26.84933c5.77948,8.84253 7.84946,19.18484 6.60651,29.51878c-0.10681,8.76352 -3.8233,32.51385 8.36014,17.87288c4.12442,-10.20347 2.92487,-21.76073 5.86331,-32.37626c5.66748,-22.91865 -4.48026,-45.85004 -15.79309,-65.262c-9.63495,-10.45038 -21.86679,-18.78104 -33.35342,-26.98327c-19.32092,-7.26658 -40.65421,-8.56836 -61.06006,-6.74718c-18.04979,3.12863 -37.13738,6.42709 -51.51633,18.73374c-14.01352,8.25707 -27.43441,19.22373 -32.97453,35.08961c-4.82798,12.78156 -13.28239,25.798 -9.43994,39.99647c3.67479,11.83601 1.72576,24.12813 2.32075,36.22574c6.26442,13.82637 12.1788,-7.07504 11.59255,-13.98853c0.3468,-13.11021 7.26362,-24.71465 12.36033,-36.35318zm115.06042,28.12622c12.88235,0.92311 29.19336,8.09689 29.54492,23.0528c1.95883,15.00865 -10.16846,29.55684 -25.7099,28.08501c-14.11661,-1.15955 -23.14499,-13.35332 -22.20761,-27.06258c-4.7262,-9.82969 2.6286,-20.35741 12.49942,-22.61709c1.91415,-0.64365 3.88168,-1.12543 5.87317,-1.45815zm-86.93419,1.27835c14.94448,-2.65778 31.94749,6.61306 31.99739,23.15527c1.40359,15.99194 -15.57494,19.12508 -27.15695,23.1313c-8.01422,5.17467 -16.3391,0.35667 -22.99829,-4.85698c-8.63997,-9.0434 -6.10048,-27.26721 3.02245,-35.52229c4.42388,-3.27404 9.90028,-4.56108 15.1354,-5.9073zm51.1378,42.18812c7.2348,9.94383 15.92023,25.10751 6.56407,36.39339c-8.30571,6.66107 -9.35284,-9.47466 -18.07048,-1.8754c-8.17816,-7.1624 -0.63536,-21.73717 5.10291,-29.01329c1.8913,-2.09525 4.05559,-3.93987 6.4035,-5.5047z", |
| | | "raph_flag": "m240.17992,78.9644c1.22598,-4.74799 1.33473,-12.52493 0.24789,-17.29984l-3.59653,-15.765c-1.08669,-4.77488 -5.91939,-9.3663 -10.74547,-10.20189l-33.14604,-5.72574c-4.82259,-0.83558 -12.72205,-0.80831 -17.53783,0.06101l-35.90382,6.46623c-4.82602,0.8693 -12.72192,0.95758 -17.56489,0.20381l-35.12959,-5.47475c0.04414,0.16981 0.12224,0.31943 0.15971,0.48924l24.04452,114.23236l11.00362,1.90157c4.82584,0.83569 12.71503,0.80153 17.54104,-0.06088l35.89362,-6.47302c4.81578,-0.86253 12.72198,-0.95078 17.56494,-0.19707l38.54257,6.01137c4.84297,0.75369 8.06601,-2.56096 7.18282,-7.38327l-4.31631,-23.36539c-0.88985,-4.81586 -0.61493,-12.63371 0.60435,-17.38171l5.1554,-20.03702zm-172.47275,-52.27992c-4.81902,1.01868 -7.89938,5.72567 -6.88394,10.53465l51.30882,243.74065l18.18635,0l-52.06276,-247.38807c-1.03241,-4.82942 -5.7429,-7.90624 -10.54846,-6.88723z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "raph_plugin": "M26.33,15.836l-3.893-1.545l3.136-7.9c0.28-0.705-0.064-1.505-0.771-1.785c-0.707-0.28-1.506,0.065-1.785,0.771l-3.136,7.9l-4.88-1.937l3.135-7.9c0.281-0.706-0.064-1.506-0.77-1.786c-0.706-0.279-1.506,0.065-1.785,0.771l-3.136,7.9L8.554,8.781l-1.614,4.066l2.15,0.854l-2.537,6.391c-0.61,1.54,0.143,3.283,1.683,3.895l1.626,0.646L8.985,26.84c-0.407,1.025,0.095,2.188,1.122,2.596l0.93,0.369c1.026,0.408,2.188-0.095,2.596-1.121l0.877-2.207l1.858,0.737c1.54,0.611,3.284-0.142,3.896-1.682l2.535-6.391l1.918,0.761L26.33,15.836z", |
| | | "raph_folder": "M29.124,12.75c-0.004-2.208-1.792-3.997-3.999-4V8.749H12.868c-0.505-1.622-2.011-2.808-3.805-2.811H6.188c-2.208,0.002-3.997,1.792-4.001,4v14.188c0.004,2.206,1.793,3.995,4.001,3.999h18.938c2.205-0.004,3.995-1.793,3.999-3.999V12.75zM6.188,7.937h2.875c1.046-0.004,1.917,0.834,1.983,1.876l0.058,0.937h14.022c1.093,0.002,1.997,0.906,1.999,2v0.495c-0.591-0.345-1.268-0.557-2-0.558H6.187c-0.732,0.001-1.41,0.214-2,0.559V9.937C4.19,8.843,5.094,7.939,6.188,7.937zM25.125,26.125H6.188c-1.093-0.002-1.997-0.908-2.001-2v-7.438h0.001c0.002-1.095,0.906-1.999,2-2.001h18.938c1.093,0.002,1.991,0.901,2,1.991v7.447C27.122,25.219,26.218,26.123,25.125,26.125z" |
| | | } |
| | | } |
| | | } |
| | |
| | | "size": 32, |
| | | "fill": true, |
| | | "data": { |
| | | "raph_sun": "M15.502,7.504c-4.35,0-7.873,3.523-7.873,7.873c0,4.347,3.523,7.872,7.873,7.872c4.346,0,7.871-3.525,7.871-7.872C23.374,11.027,19.85,7.504,15.502,7.504zM15.502,21.25c-3.244-0.008-5.866-2.63-5.874-5.872c0.007-3.243,2.63-5.866,5.874-5.874c3.242,0.008,5.864,2.631,5.871,5.874C21.366,18.62,18.744,21.242,15.502,21.25zM15.502,6.977c0.553,0,1-0.448,1-1.001V1.125c-0.002-0.553-0.448-1-1-1c-0.553,0-1.001,0.449-1,1.002v4.85C14.502,6.528,14.949,6.977,15.502,6.977zM18.715,7.615c0.125,0.053,0.255,0.076,0.382,0.077c0.394,0,0.765-0.233,0.925-0.618l1.856-4.483c0.21-0.511-0.031-1.095-0.541-1.306c-0.511-0.211-1.096,0.031-1.308,0.541L18.174,6.31C17.963,6.82,18.205,7.405,18.715,7.615zM21.44,9.436c0.195,0.194,0.451,0.293,0.707,0.293s0.512-0.098,0.707-0.293l3.43-3.433c0.391-0.39,0.39-1.023,0-1.415c-0.392-0.39-1.025-0.39-1.415,0.002L21.44,8.021C21.049,8.412,21.049,9.045,21.44,9.436zM23.263,12.16c0.158,0.385,0.531,0.617,0.923,0.617c0.127,0,0.257-0.025,0.383-0.078l4.48-1.857c0.511-0.211,0.753-0.797,0.541-1.307s-0.796-0.752-1.307-0.54l-4.481,1.857C23.292,11.064,23.051,11.65,23.263,12.16zM29.752,14.371l-4.851,0.001c-0.552,0-1,0.448-0.998,1.001c0,0.553,0.447,0.999,0.998,0.999l4.852-0.002c0.553,0,0.999-0.449,0.999-1C30.752,14.817,30.304,14.369,29.752,14.371zM29.054,19.899l-4.482-1.854c-0.512-0.212-1.097,0.03-1.307,0.541c-0.211,0.511,0.031,1.096,0.541,1.308l4.482,1.854c0.126,0.051,0.256,0.075,0.383,0.075c0.393,0,0.765-0.232,0.925-0.617C29.806,20.695,29.563,20.109,29.054,19.899zM22.86,21.312c-0.391-0.391-1.023-0.391-1.414,0.001c-0.391,0.39-0.39,1.022,0,1.413l3.434,3.429c0.195,0.195,0.45,0.293,0.706,0.293s0.513-0.098,0.708-0.293c0.391-0.392,0.389-1.025,0-1.415L22.86,21.312zM20.029,23.675c-0.211-0.511-0.796-0.752-1.307-0.541c-0.51,0.212-0.752,0.797-0.54,1.308l1.86,4.48c0.159,0.385,0.531,0.617,0.925,0.617c0.128,0,0.258-0.024,0.383-0.076c0.511-0.211,0.752-0.797,0.54-1.309L20.029,23.675zM15.512,23.778c-0.553,0-1,0.448-1,1l0.004,4.851c0,0.553,0.449,0.999,1,0.999c0.553,0,1-0.448,0.998-1l-0.003-4.852C16.511,24.226,16.062,23.777,15.512,23.778zM12.296,23.142c-0.51-0.21-1.094,0.031-1.306,0.543l-1.852,4.483c-0.21,0.511,0.033,1.096,0.543,1.307c0.125,0.052,0.254,0.076,0.382,0.076c0.392,0,0.765-0.234,0.924-0.619l1.853-4.485C13.051,23.937,12.807,23.353,12.296,23.142zM9.57,21.325c-0.392-0.391-1.025-0.389-1.415,0.002L4.729,24.76c-0.391,0.392-0.389,1.023,0.002,1.415c0.195,0.194,0.45,0.292,0.706,0.292c0.257,0,0.513-0.098,0.708-0.293l3.427-3.434C9.961,22.349,9.961,21.716,9.57,21.325zM7.746,18.604c-0.213-0.509-0.797-0.751-1.307-0.54L1.96,19.925c-0.511,0.212-0.752,0.798-0.54,1.308c0.16,0.385,0.531,0.616,0.924,0.616c0.127,0,0.258-0.024,0.383-0.076l4.479-1.861C7.715,19.698,7.957,19.113,7.746,18.604zM7.1,15.392c0-0.553-0.447-0.999-1-0.999l-4.851,0.006c-0.553,0-1.001,0.448-0.999,1.001c0.001,0.551,0.449,1,1,0.998l4.852-0.006C6.654,16.392,7.102,15.942,7.1,15.392zM1.944,10.869l4.485,1.85c0.125,0.053,0.254,0.076,0.381,0.076c0.393,0,0.766-0.232,0.925-0.618c0.212-0.511-0.032-1.097-0.544-1.306L2.708,9.021c-0.511-0.21-1.095,0.032-1.306,0.542C1.19,10.074,1.435,10.657,1.944,10.869zM8.137,9.451c0.195,0.193,0.449,0.291,0.705,0.291s0.513-0.098,0.709-0.295c0.391-0.389,0.389-1.023-0.004-1.414L6.113,4.609C5.723,4.219,5.088,4.221,4.699,4.612c-0.391,0.39-0.389,1.024,0.002,1.414L8.137,9.451zM10.964,7.084c0.16,0.384,0.532,0.615,0.923,0.615c0.128,0,0.258-0.025,0.384-0.077c0.51-0.212,0.753-0.798,0.54-1.307l-1.864-4.479c-0.212-0.51-0.798-0.751-1.308-0.539C9.129,1.51,8.888,2.096,9.1,2.605L10.964,7.084z", |
| | | "raph_sun": "M15.502,7.504c-4.35,0-7.873,3.523-7.873,7.873c0,4.347,3.523,7.872,7.873,7.872c4.346,0,7.871-3.525,7.871-7.872C23.374,11.027,19.85,7.504,15.502,7.504zM15.502,21.25c-3.244-0.008-5.866-2.63-5.874-5.872c0.007-3.243,2.63-5.866,5.874-5.874c3.242,0.008,5.864,2.631,5.871,5.874C21.366,18.62,18.744,21.242,15.502,21.25zM15.502,6.977c0.553,0,1-0.448,1-1.001V1.125c-0.002-0.553-0.448-1-1-1c-0.553,0-1.001,0.449-1,1.002v4.85C14.502,6.528,14.949,6.977,15.502,6.977zM18.715,7.615c0.125,0.053,0.255,0.076,0.382,0.077c0.394,0,0.765-0.233,0.925-0.618l1.856-4.483c0.21-0.511-0.031-1.095-0.541-1.306c-0.511-0.211-1.096,0.031-1.308,0.541L18.174,6.31C17.963,6.82,18.205,7.405,18.715,7.615zM21.44,9.436c0.195,0.194,0.451,0.293,0.707,0.293s0.512-0.098,0.707-0.293l3.43-3.433c0.391-0.39,0.39-1.023,0-1.415c-0.392-0.39-1.025-0.39-1.415,0.002L21.44,8.021C21.049,8.412,21.049,9.045,21.44,9.436zM23.263,12.16c0.158,0.385,0.531,0.617,0.923,0.617c0.127,0,0.257-0.025,0.383-0.078l4.48-1.857c0.511-0.211,0.753-0.797,0.541-1.307s-0.796-0.752-1.307-0.54l-4.481,1.857C23.292,11.064,23.051,11.65,23.263,12.16zM29.752,14.371l-4.851,0.001c-0.552,0-1,0.448-0.998,1.001c0,0.553,0.447,0.999,0.998,0.999l4.852-0.002c0.553,0,0.999-0.449,0.999-1C30.752,14.817,30.304,14.369,29.752,14.371zM29.054,19.899l-4.482-1.854c-0.512-0.212-1.097,0.03-1.307,0.541c-0.211,0.511,0.031,1.096,0.541,1.308l4.482,1.854c0.126,0.051,0.256,0.075,0.383,0.075c0.393,0,0.765-0.232,0.925-0.617C29.806,20.695,29.563,20.109,29.054,19.899zM22.86,21.312c-0.391-0.391-1.023-0.391-1.414,0.001c-0.391,0.39-0.39,1.022,0,1.413l3.434,3.429c0.195,0.195,0.45,0.293,0.706,0.293s0.513-0.098,0.708-0.293c0.391-0.392,0.389-1.025,0-1.415L22.86,21.312zM20.029,23.675c-0.211-0.511-0.796-0.752-1.307-0.541c-0.51,0.212-0.752,0.797-0.54,1.308l1.86,4.48c0.159,0.385,0.531,0.617,0.925,0.617c0.128,0,0.258-0.024,0.383-0.076c0.511-0.211,0.752-0.797,0.54-1.309L20.029,23.675zM15.512,23.778c-0.553,0-1,0.448-1,1l0.004,4.851c0,0.553,0.449,0.999,1,0.999c0.553,0,1-0.448,0.998-1l-0.003-4.852C16.511,24.226,16.062,23.777,15.512,23.778zM12.296,23.142c-0.51-0.21-1.094,0.031-1.306,0.543l-1.852,4.483c-0.21,0.511,0.033,1.096,0.543,1.307c0.125,0.052,0.254,0.076,0.382,0.076c0.392,0,0.765-0.234,0.924-0.619l1.853-4.485C13.051,23.937,12.807,23.353,12.296,23.142zM9.57,21.325c-0.392-0.391-1.025-0.389-1.415,0.002L4.729,24.76c-0.391,0.392-0.389,1.023,0.002,1.415c0.195,0.194,0.45,0.292,0.706,0.292c0.257,0,0.513-0.098,0.708-0.293l3.427-3.434C9.961,22.349,9.961,21.716,9.57,21.325zM7.746,18.604c-0.213-0.509-0.797-0.751-1.307-0.54L1.96,19.925c-0.511,0.212-0.752,0.798-0.54,1.308c0.16,0.385,0.531,0.616,0.924,0.616c0.127,0,0.258-0.024,0.383-0.076l4.479-1.861C7.715,19.698,7.957,19.113,7.746,18.604zM7.1,15.392c0-0.553-0.447-0.999-1-0.999l-4.851,0.006c-0.553,0-1.001,0.448-0.999,1.001c0.001,0.551,0.449,1,1,0.998l4.852-0.006C6.654,16.392,7.102,15.942,7.1,15.392zM1.944,10.869l4.485,1.85c0.125,0.053,0.254,0.076,0.381,0.076c0.393,0,0.766-0.232,0.925-0.618c0.212-0.511-0.032-1.097-0.544-1.306L2.708,9.021c-0.511-0.21-1.095,0.032-1.306,0.542C1.19,10.074,1.435,10.657,1.944,10.869zM8.137,9.451c0.195,0.193,0.449,0.291,0.705,0.291s0.513-0.098,0.709-0.295c0.391-0.389,0.389-1.023-0.004-1.414L6.113,4.609C5.723,4.219,5.088,4.221,4.699,4.612c-0.391,0.39-0.389,1.024,0.002,1.414L8.137,9.451zM10.964,7.084c0.16,0.384,0.532,0.615,0.923,0.615c0.128,0,0.258-0.025,0.384-0.077c0.51-0.212,0.753-0.798,0.54-1.307l-1.864-4.479c-0.212-0.51-0.798-0.751-1.308-0.539C9.129,1.51,8.888,2.096,9.1,2.605L10.964,7.084z", |
| | | "raph_thunder": "M25.371,7.306c-0.092-3.924-3.301-7.077-7.248-7.079c-2.638,0.001-4.942,1.412-6.208,3.517c-0.595-0.327-1.28-0.517-2.01-0.517C7.626,3.229,5.772,5.033,5.689,7.293c-2.393,0.786-4.125,3.025-4.127,5.686c0,3.312,2.687,6,6,6v-0.002h5.271l-2.166,3.398l1.977-0.411L10,30.875l9.138-10.102L17,21l2.167-2.023h4.269c3.312,0,6-2.688,6-6C29.434,10.34,27.732,8.11,25.371,7.306zM23.436,16.979H7.561c-2.209-0.006-3.997-1.792-4.001-4.001c-0.002-1.982,1.45-3.618,3.35-3.931c0.265-0.043,0.502-0.191,0.657-0.414C7.722,8.41,7.779,8.136,7.73,7.87C7.702,7.722,7.685,7.582,7.685,7.446C7.689,6.221,8.68,5.23,9.905,5.228c0.647,0,1.217,0.278,1.633,0.731c0.233,0.257,0.587,0.375,0.927,0.309c0.342-0.066,0.626-0.307,0.748-0.63c0.749-1.992,2.662-3.412,4.911-3.41c2.899,0.004,5.244,2.35,5.251,5.249c0,0.161-0.009,0.326-0.027,0.497c-0.049,0.517,0.305,0.984,0.815,1.079c1.86,0.344,3.274,1.966,3.271,3.923C27.43,15.186,25.645,16.973,23.436,16.979z", |
| | | "raph_snow": "M25.372,6.912c-0.093-3.925-3.302-7.078-7.248-7.08c-2.638,0.002-4.942,1.412-6.208,3.518c-0.595-0.327-1.28-0.518-2.01-0.518C7.627,2.834,5.773,4.639,5.69,6.898c-2.393,0.786-4.125,3.025-4.127,5.686c0,3.312,2.687,6,6,6v-0.002h15.875c3.312,0,6-2.688,6-6C29.434,9.944,27.732,7.715,25.372,6.912zM23.436,16.584H7.562c-2.209-0.006-3.997-1.793-4.001-4c-0.002-1.983,1.45-3.619,3.35-3.933c0.265-0.043,0.502-0.19,0.657-0.414C7.723,8.015,7.78,7.74,7.731,7.475C7.703,7.326,7.686,7.187,7.686,7.051c0.004-1.225,0.995-2.217,2.22-2.219c0.647,0,1.217,0.278,1.633,0.731c0.233,0.257,0.587,0.375,0.927,0.31c0.342-0.066,0.626-0.308,0.748-0.631c0.749-1.992,2.662-3.412,4.911-3.41c2.898,0.004,5.244,2.351,5.251,5.25c0,0.16-0.009,0.325-0.026,0.496c-0.05,0.518,0.305,0.984,0.814,1.079c1.859,0.345,3.273,1.966,3.271,3.923C27.43,14.791,25.645,16.578,23.436,16.584zM16.667,24.09l1.119-1.119c0.389-0.391,0.389-1.025,0-1.416c-0.392-0.391-1.025-0.391-1.415,0l-1.119,1.119l-1.119-1.119c-0.391-0.391-1.025-0.391-1.415,0c-0.391,0.391-0.391,1.025,0,1.416l1.118,1.117l-1.12,1.121c-0.389,0.393-0.389,1.021,0,1.414c0.195,0.188,0.451,0.293,0.707,0.293c0.256,0,0.512-0.104,0.708-0.293l1.12-1.119l1.12,1.119c0.195,0.188,0.451,0.293,0.708,0.293c0.256,0,0.512-0.104,0.707-0.293c0.391-0.396,0.391-1.021,0-1.414L16.667,24.09zM25.119,21.817c-0.393-0.392-1.025-0.392-1.415,0l-1.12,1.121l-1.12-1.121c-0.391-0.392-1.022-0.392-1.414,0c-0.39,0.392-0.39,1.022,0,1.416l1.119,1.119l-1.119,1.119c-0.39,0.391-0.39,1.022,0,1.413c0.195,0.195,0.451,0.294,0.707,0.294c0.257,0,0.513-0.099,0.707-0.294l1.12-1.118l1.12,1.118c0.194,0.195,0.45,0.294,0.707,0.294c0.256,0,0.513-0.099,0.708-0.294c0.389-0.391,0.389-1.022,0-1.413l-1.12-1.119l1.12-1.119C25.507,22.842,25.507,22.209,25.119,21.817zM9.334,23.953l1.119-1.119c0.389-0.394,0.389-1.021,0-1.414c-0.391-0.394-1.025-0.394-1.415,0l-1.119,1.119l-1.12-1.121c-0.391-0.39-1.023-0.39-1.415,0c-0.391,0.396-0.391,1.024,0,1.418l1.119,1.117l-1.12,1.118c-0.391,0.394-0.391,1.025,0,1.414c0.196,0.195,0.452,0.293,0.708,0.293c0.256,0,0.511-0.098,0.707-0.293l1.12-1.119l1.121,1.121c0.195,0.195,0.451,0.293,0.707,0.293s0.513-0.098,0.708-0.293c0.389-0.391,0.389-1.022,0-1.416L9.334,23.953z", |
| | | "raph_hail": "M25.372,6.912c-0.093-3.925-3.302-7.078-7.248-7.08c-2.638,0.002-4.942,1.412-6.208,3.518c-0.595-0.327-1.28-0.518-2.01-0.518C7.627,2.834,5.773,4.639,5.69,6.898c-2.393,0.786-4.125,3.025-4.127,5.686c0,3.312,2.687,6,6,6v-0.002h15.875c3.312,0,6-2.688,6-6C29.434,9.944,27.732,7.715,25.372,6.912zM23.436,16.584H7.562c-2.209-0.006-3.997-1.793-4.001-4c-0.002-1.983,1.45-3.619,3.35-3.933c0.265-0.043,0.502-0.19,0.657-0.414C7.723,8.015,7.78,7.74,7.731,7.475C7.703,7.326,7.686,7.187,7.686,7.051c0.004-1.225,0.995-2.217,2.22-2.219c0.647,0,1.217,0.278,1.633,0.731c0.233,0.257,0.587,0.375,0.927,0.31c0.342-0.066,0.626-0.308,0.748-0.631c0.749-1.992,2.662-3.412,4.911-3.41c2.898,0.004,5.244,2.351,5.251,5.25c0,0.16-0.009,0.325-0.026,0.496c-0.05,0.518,0.305,0.984,0.814,1.079c1.859,0.345,3.273,1.966,3.271,3.923C27.43,14.791,25.645,16.578,23.436,16.584zM11.503,23.709c-0.784-0.002-1.418-0.636-1.418-1.416c0-0.785,0.634-1.416,1.418-1.418c0.78,0.002,1.413,0.633,1.416,1.418C12.917,23.073,12.284,23.707,11.503,23.709zM19.002,23.709c-0.783-0.002-1.418-0.636-1.418-1.416c0-0.785,0.635-1.416,1.418-1.418c0.779,0.002,1.414,0.633,1.414,1.418C20.417,23.073,19.784,23.707,19.002,23.709zM7.503,28.771c-0.783-0.002-1.417-0.637-1.417-1.418s0.634-1.414,1.417-1.416c0.78,0.002,1.415,0.635,1.415,1.416C8.917,28.135,8.284,28.77,7.503,28.771zM15.001,28.771c-0.782-0.002-1.417-0.637-1.417-1.418s0.634-1.414,1.417-1.416c0.78,0.002,1.413,0.635,1.415,1.416C16.415,28.135,15.784,28.77,15.001,28.771zM22.5,28.771c-0.782-0.002-1.416-0.634-1.416-1.416c0-0.785,0.634-1.418,1.416-1.42c0.781,0.002,1.414,0.635,1.418,1.42C23.915,28.138,23.282,28.77,22.5,28.771z", |
| | |
| | | "sun": "M29.166,15.999l-5.279,1.878v-3.754L29.166,15.999z M25.333,6.748l-2.405,5.062l-2.654-2.656L25.333,6.748z M16.083,2.917l1.877,5.28h-3.755L16.083,2.917z M6.832,6.748l5.061,2.406l-2.655,2.656L6.832,6.748z M3,15.999l5.28-1.876v3.754 L3,15.999z M6.832,25.25l2.406-5.06l2.655,2.655L6.832,25.25L6.832,25.25z M16.083,29.084l-1.878-5.281h3.755L16.083,29.084z M25.333,25.25l-5.06-2.404l2.654-2.655L25.333,25.25z M9.542,15.999L9.542,15.999c0-3.612,2.929-6.541,6.542-6.541 c3.612,0,6.542,2.929,6.542,6.541c0,3.613-2.93,6.542-6.542,6.542C12.47,22.541,9.542,19.612,9.542,15.999L9.542,15.999z", |
| | | "umbrella": "M15.009,3.37v2.508C8.637,6.23,3.618,9.962,3.618,14.514c0-0.82,1.387-1.486,3.095-1.486 c1.709,0,3.096,0.666,3.096,1.486c0-0.82,1.386-1.486,3.095-1.486c0.813,0,1.552,0.156,2.105,0.402v12.228 c0,0.547-0.444,0.99-0.99,0.99c-0.547,0-0.991-0.443-0.991-0.99v-0.496h-1.981v0.496c0,1.641,1.332,2.973,2.972,2.973 s2.971-1.332,2.971-2.973V13.43c0.553-0.247,1.293-0.402,2.106-0.402c1.707,0,3.096,0.666,3.096,1.486 c0-0.82,1.387-1.486,3.094-1.486c1.711,0,3.098,0.666,3.098,1.486c0-4.551-5.02-8.283-11.393-8.636V3.37H15.009z" |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | 1. Create the SVG master file that includes all icons: |
| | | |
| | | The master SVG icon-containing file is an SVG file that contains |
| | | The master SVG icon-containing file is an SVG file that contains |
| | | <g> elements. Each <g> element should contain the markup of an SVG |
| | | icon. The <g> element has an ID that should |
| | | correspond with the ID of the HTML element used on the page that should contain |
| | | icon. The <g> 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". |
| | | |
| | |
| | | |
| | | - '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. |
| | | |
| | |
| | | |
| | | - '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 |
| | | |
| | | - '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 <img> |
| | | element (may be faster, help for browser consistency) |
| | | |
| | |
| | | $.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) |
| | | |
| | |
| | | |
| | | $(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. |
| | | // No options have been set, so all icons will automatically be inserted |
| | | // into HTML elements that match the same IDs. |
| | | }); |
| | | |
| | | Example usage #2: |
| | |
| | | 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 |
| | | |
| | | callback: function(icons) { // Sets background color for "close" icon |
| | | icons['close'].css('background','red'); |
| | | }, |
| | | |
| | | |
| | | svgz: true // Indicates that an SVGZ file is being used |
| | | |
| | | |
| | | }) |
| | | }); |
| | | |
| | |
| | | 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 = $('<object data="' + file + '" type=image/svg+xml>').appendTo('body').hide(); |
| | | try { |
| | |
| | | if(err.responseText) { |
| | | svgdoc = parser.parseFromString(err.responseText, "text/xml"); |
| | | if(!svgdoc.childNodes.length) { |
| | | $(useFallback); |
| | | $(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" |
| | | // 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')); |
| | |
| | | } |
| | | 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, |
| | |
| | | },500); |
| | | } |
| | | } |
| | | |
| | | |
| | | var setIcon = function(target, icon, id, setID) { |
| | | if(isOpera) icon.css('visibility','hidden'); |
| | | if(opts.replace) { |
| | |
| | | if(cl) icon.attr('class','svg_icon '+cl); |
| | | target.replaceWith(icon); |
| | | } else { |
| | | |
| | | |
| | | target.append(icon); |
| | | } |
| | | if(isOpera) { |
| | |
| | | },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) { |
| | |
| | | 'height': icon_h, |
| | | 'alt': 'icon' |
| | | }); |
| | | |
| | | |
| | | addIcon(icon, id); |
| | | }); |
| | | } else { |
| | |
| | | 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); |
| | |
| | | // 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 |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | if(opts.placement) { |
| | | $.each(opts.placement, function(sel, id) { |
| | | if(!svg_icons[id]) return; |
| | |
| | | |
| | | 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(!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 + ')'; |
| | | |
| | |
| | | }); |
| | | return svg_el; |
| | | } |
| | | |
| | | |
| | | function useFallback() { |
| | | if(file.indexOf('.svgz') != -1) { |
| | | var reg_file = file.replace('.svgz','.svg'); |
| | |
| | | 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 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) { |
| | | |
| | | $.getSvgIcon = function(id, uniqueClone) { |
| | | var icon = svg_icons[id]; |
| | | if(uniqueClone && icon) { |
| | | icon = fixIDs(icon, 0, true).clone(true); |
| | | } |
| | | return icon; |
| | | 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; |
| | |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | })(jQuery); |
| | | |
| | | })(jQuery); |
| | |
| | | <?xml version="1.0" standalone="no"?>
<!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
x="0px" y="0px" width="27px" height="27px"
>
<path d="M 1 25 L 5 25 L 5 13 L 11 13 L 11 25 L 16 25 L 16 7 L 22 7 L 22 25 L 26 25 L 26 26 L 1 26 L 1 25 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 Z" fill="#000000"/>
</svg> |
| | | <?xml version="1.0" standalone="no"?> |
| | | <!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 --> |
| | | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| | | <svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1" |
| | | xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" |
| | | x="0px" y="0px" width="27px" height="27px" |
| | | > |
| | | <path d="M 1 25 L 5 25 L 5 13 L 11 13 L 11 25 L 16 25 L 16 7 L 22 7 L 22 25 L 26 25 L 26 26 L 1 26 L 1 25 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 Z" fill="#000000"/> |
| | | </svg> |
| | |
| | | <?xml version="1.0" standalone="no"?>
<!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
x="0px" y="0px" width="27px" height="27px"
>
<g id="Layer%201">
<path d="M 13 1 L 14 1 L 14 6 L 22 6 L 22 12 L 14 12 L 14 15 L 19 15 L 19 21 L 14 21 L 14 26 L 13 26 L 13 21 L 8 21 L 8 15 L 13 15 L 13 12 L 5 12 L 5 6 L 13 6 L 13 1 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 Z" fill="#000000"/>
</g>
</svg> |
| | | <?xml version="1.0" standalone="no"?> |
| | | <!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 --> |
| | | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| | | <svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1" |
| | | xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" |
| | | x="0px" y="0px" width="27px" height="27px" |
| | | > |
| | | <g id="Layer%201"> |
| | | <path d="M 13 1 L 14 1 L 14 6 L 22 6 L 22 12 L 14 12 L 14 15 L 19 15 L 19 21 L 14 21 L 14 26 L 13 26 L 13 21 L 8 21 L 8 15 L 13 15 L 13 12 L 5 12 L 5 6 L 13 6 L 13 1 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 Z" fill="#000000"/> |
| | | </g> |
| | | </svg> |
| | |
| | | <?xml version="1.0" standalone="no"?>
<!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
x="0px" y="0px" width="27px" height="27px"
>
<path d="M 2 1 L 2 5 L 14 5 L 14 11 L 2 11 L 2 16 L 20 16 L 20 22 L 2 22 L 2 26 L 1 26 L 1 1 L 2 1 ZM 27 0 L 0 0 L 0 27 L 27 27 L 27 0 Z" fill="#000000"/>
</svg> |
| | | <?xml version="1.0" standalone="no"?> |
| | | <!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 --> |
| | | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| | | <svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1" |
| | | xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" |
| | | x="0px" y="0px" width="27px" height="27px" |
| | | > |
| | | <path d="M 2 1 L 2 5 L 14 5 L 14 11 L 2 11 L 2 16 L 20 16 L 20 22 L 2 22 L 2 26 L 1 26 L 1 1 L 2 1 ZM 27 0 L 0 0 L 0 27 L 27 27 L 27 0 Z" fill="#000000"/> |
| | | </svg> |
| | |
| | | <?xml version="1.0" standalone="no"?>
<!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
x="0px" y="0px" width="27px" height="27px"
>
<path d="M 26 13 L 26 14 L 21 14 L 21 22 L 15 22 L 15 14 L 12 14 L 12 19 L 6 19 L 6 14 L 1 14 L 1 13 L 6 13 L 6 8 L 12 8 L 12 13 L 15 13 L 15 5 L 21 5 L 21 13 L 26 13 ZM 27 0 L 0 0 L 0 27 L 27 27 L 27 0 Z" fill="#000000"/>
</svg> |
| | | <?xml version="1.0" standalone="no"?> |
| | | <!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 --> |
| | | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| | | <svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1" |
| | | xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" |
| | | x="0px" y="0px" width="27px" height="27px" |
| | | > |
| | | <path d="M 26 13 L 26 14 L 21 14 L 21 22 L 15 22 L 15 14 L 12 14 L 12 19 L 6 19 L 6 14 L 1 14 L 1 13 L 6 13 L 6 8 L 12 8 L 12 13 L 15 13 L 15 5 L 21 5 L 21 13 L 26 13 ZM 27 0 L 0 0 L 0 27 L 27 27 L 27 0 Z" fill="#000000"/> |
| | | </svg> |
| | |
| | | <?xml version="1.0" standalone="no"?>
<!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
x="0px" y="0px" width="27px" height="27px"
>
<path d="M 25 1 L 25 5 L 13 5 L 13 11 L 25 11 L 25 16 L 7 16 L 7 22 L 25 22 L 25 26 L 26 26 L 26 1 L 25 1 ZM 0 0 L 27 0 L 27 27 L 0 27 L 0 0 Z" fill="#000000"/>
</svg> |
| | | <?xml version="1.0" standalone="no"?> |
| | | <!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 --> |
| | | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| | | <svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1" |
| | | xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" |
| | | x="0px" y="0px" width="27px" height="27px" |
| | | > |
| | | <path d="M 25 1 L 25 5 L 13 5 L 13 11 L 25 11 L 25 16 L 7 16 L 7 22 L 25 22 L 25 26 L 26 26 L 26 1 L 25 1 ZM 0 0 L 27 0 L 27 27 L 0 27 L 0 0 Z" fill="#000000"/> |
| | | </svg> |
| | |
| | | <?xml version="1.0" standalone="no"?>
<!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
x="0px" y="0px" width="27px" height="27px"
>
<path d="M 1 2 L 5 2 L 5 14 L 11 14 L 11 2 L 16 2 L 16 20 L 22 20 L 22 2 L 26 2 L 26 1 L 1 1 L 1 2 ZM 0 27 L 0 0 L 27 0 L 27 27 L 0 27 Z" fill="#000000"/>
</svg> |
| | | <?xml version="1.0" standalone="no"?> |
| | | <!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 --> |
| | | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| | | <svg id="Untitled-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1" |
| | | xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" |
| | | x="0px" y="0px" width="27px" height="27px" |
| | | > |
| | | <path d="M 1 2 L 5 2 L 5 14 L 11 14 L 11 2 L 16 2 L 16 20 L 22 20 L 22 2 L 26 2 L 26 1 L 1 1 L 1 2 ZM 0 27 L 0 0 L 27 0 L 27 27 L 0 27 Z" fill="#000000"/> |
| | | </svg> |
| | |
| | | </svg> |
| | | </g> |
| | | <g id="svg_eof"/> |
| | | </svg> |
| | | </svg> |
| | |
| | | <?xml version="1.0" standalone="no"?>
<!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg id="eye-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
x="0px" y="0px" width="27px" height="27px"
>
<path d="M 26.575 14.5 C 25.0764 18.8131 19.7906 22 13.5 22 C 7.2094 22 1.9236 18.8131 0.425 14.5 C 1.9236 10.1869 7.2094 7 13.5 7 C 19.7906 7 25.0764 10.1869 26.575 14.5 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 ZM 20.5226 14.5 C 20.5226 10.9101 16.5538 8.0625 14.0226 8 C 13.8544 7.9958 14.6876 9.0074 14.5226 9.02 C 16.6163 9 18.5226 11.0783 18.5226 14.5 C 18.5226 17.9217 16.7413 19.625 14.5226 19.98 C 14.6876 19.9926 13.8543 21 14.0226 21 C 16.5851 21 20.5226 18.0899 20.5226 14.5 ZM 6 14.5 C 6 18.0899 9.9375 21 12.5 21 C 12.6682 21 11.835 19.9926 12 19.98 C 9.7813 19.625 8 17.9217 8 14.5 C 8 11.0783 9.9063 9 12 9.02 C 11.835 9.0074 12.6682 7.9958 12.5 8 C 9.9688 8.0625 6 10.9101 6 14.5 Z" fill="#000000"/>
</svg> |
| | | <?xml version="1.0" standalone="no"?> |
| | | <!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 --> |
| | | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| | | <svg id="eye-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1" |
| | | xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" |
| | | x="0px" y="0px" width="27px" height="27px" |
| | | > |
| | | <path d="M 26.575 14.5 C 25.0764 18.8131 19.7906 22 13.5 22 C 7.2094 22 1.9236 18.8131 0.425 14.5 C 1.9236 10.1869 7.2094 7 13.5 7 C 19.7906 7 25.0764 10.1869 26.575 14.5 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 ZM 20.5226 14.5 C 20.5226 10.9101 16.5538 8.0625 14.0226 8 C 13.8544 7.9958 14.6876 9.0074 14.5226 9.02 C 16.6163 9 18.5226 11.0783 18.5226 14.5 C 18.5226 17.9217 16.7413 19.625 14.5226 19.98 C 14.6876 19.9926 13.8543 21 14.0226 21 C 16.5851 21 20.5226 18.0899 20.5226 14.5 ZM 6 14.5 C 6 18.0899 9.9375 21 12.5 21 C 12.6682 21 11.835 19.9926 12 19.98 C 9.7813 19.625 8 17.9217 8 14.5 C 8 11.0783 9.9063 9 12 9.02 C 11.835 9.0074 12.6682 7.9958 12.5 8 C 9.9688 8.0625 6 10.9101 6 14.5 Z" fill="#000000"/> |
| | | </svg> |
| | |
| | | <?xml version="1.0" standalone="no"?>
<!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg id="eye-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
x="0px" y="0px" width="27px" height="27px"
>
<g id="Layer%201">
<path d="M 16.6855 8.9536 L 12.8818 22.146 C 12.6714 22.9009 12.5664 23.396 12.5664 23.6304 C 12.5664 23.7671 12.6221 23.8931 12.7334 24.0112 C 12.8447 24.1284 12.9619 24.187 13.0859 24.187 C 13.2959 24.187 13.5063 24.0942 13.7168 23.9087 C 14.2734 23.4517 14.9414 22.6226 15.7207 21.4224 L 16.3516 21.7935 C 14.4834 25.0474 12.498 26.6733 10.3955 26.6733 C 9.5913 26.6733 8.9512 26.4478 8.4751 25.9956 C 7.9985 25.5444 7.7607 24.9731 7.7607 24.2798 C 7.7607 23.8228 7.8657 23.2407 8.0762 22.5356 L 10.6553 13.6665 C 10.9023 12.813 11.0264 12.1704 11.0264 11.7368 C 11.0264 11.4653 10.9087 11.2241 10.6738 11.0132 C 10.4385 10.8032 10.1172 10.6978 9.709 10.6978 C 9.5234 10.6978 9.3008 10.7046 9.041 10.7163 L 9.2822 9.9741 L 15.5723 8.9536 L 16.6855 8.9536 ZM 15.5352 0.4185 C 16.3018 0.4185 16.9482 0.6851 17.4741 1.2163 C 17.9995 1.7485 18.2627 2.3921 18.2627 3.146 C 18.2627 3.9009 17.9966 4.5444 17.4648 5.0757 C 16.9326 5.6079 16.2896 5.8735 15.5352 5.8735 C 14.793 5.8735 14.1558 5.6079 13.624 5.0757 C 13.0918 4.5444 12.8262 3.9009 12.8262 3.146 C 12.8262 2.3921 13.0889 1.7485 13.6147 1.2163 C 14.1401 0.6851 14.7803 0.4185 15.5352 0.4185 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 Z" fill="#000000"/>
</g>
</svg> |
| | | <?xml version="1.0" standalone="no"?> |
| | | <!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 --> |
| | | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| | | <svg id="eye-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1" |
| | | xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" |
| | | x="0px" y="0px" width="27px" height="27px" |
| | | > |
| | | <g id="Layer%201"> |
| | | <path d="M 16.6855 8.9536 L 12.8818 22.146 C 12.6714 22.9009 12.5664 23.396 12.5664 23.6304 C 12.5664 23.7671 12.6221 23.8931 12.7334 24.0112 C 12.8447 24.1284 12.9619 24.187 13.0859 24.187 C 13.2959 24.187 13.5063 24.0942 13.7168 23.9087 C 14.2734 23.4517 14.9414 22.6226 15.7207 21.4224 L 16.3516 21.7935 C 14.4834 25.0474 12.498 26.6733 10.3955 26.6733 C 9.5913 26.6733 8.9512 26.4478 8.4751 25.9956 C 7.9985 25.5444 7.7607 24.9731 7.7607 24.2798 C 7.7607 23.8228 7.8657 23.2407 8.0762 22.5356 L 10.6553 13.6665 C 10.9023 12.813 11.0264 12.1704 11.0264 11.7368 C 11.0264 11.4653 10.9087 11.2241 10.6738 11.0132 C 10.4385 10.8032 10.1172 10.6978 9.709 10.6978 C 9.5234 10.6978 9.3008 10.7046 9.041 10.7163 L 9.2822 9.9741 L 15.5723 8.9536 L 16.6855 8.9536 ZM 15.5352 0.4185 C 16.3018 0.4185 16.9482 0.6851 17.4741 1.2163 C 17.9995 1.7485 18.2627 2.3921 18.2627 3.146 C 18.2627 3.9009 17.9966 4.5444 17.4648 5.0757 C 16.9326 5.6079 16.2896 5.8735 15.5352 5.8735 C 14.793 5.8735 14.1558 5.6079 13.624 5.0757 C 13.0918 4.5444 12.8262 3.9009 12.8262 3.146 C 12.8262 2.3921 13.0889 1.7485 13.6147 1.2163 C 14.1401 0.6851 14.7803 0.4185 15.5352 0.4185 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 Z" fill="#000000"/> |
| | | </g> |
| | | </svg> |
| | |
| | | <?xml version="1.0" standalone="no"?>
<!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg id="eye-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
x="0px" y="0px" width="27px" height="27px"
>
<g id="Layer%201">
<path d="M 13.6027 0.5027 L 26.844 10.2723 L 21.6443 25.8845 L 5.1894 25.7637 L 0.2195 10.0769 L 13.6027 0.5027 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 Z" fill="#000000"/>
</g>
</svg> |
| | | <?xml version="1.0" standalone="no"?> |
| | | <!-- Generator: Adobe Fireworks CS5, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1 --> |
| | | <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> |
| | | <svg id="eye-Page%201" viewBox="0 0 27 27" style="background-color:#ffffff00" version="1.1" |
| | | xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" |
| | | x="0px" y="0px" width="27px" height="27px" |
| | | > |
| | | <g id="Layer%201"> |
| | | <path d="M 13.6027 0.5027 L 26.844 10.2723 L 21.6443 25.8845 L 5.1894 25.7637 L 0.2195 10.0769 L 13.6027 0.5027 ZM 0 0 L 0 27 L 27 27 L 27 0 L 0 0 Z" fill="#000000"/> |
| | | </g> |
| | | </svg> |
| | |
| | | <div id="tool_about" class="menu_item">Keyboard Shortcuts...</div> |
| | | </div> |
| | | </a> |
| | | |
| | | |
| | | <div class="menu"> |
| | | <div class="menu_title">File</div> |
| | | <div class="menu_list" id="file_menu"> |
| | | <div class="menu_list" id="file_menu"> |
| | | <div id="tool_clear" class="menu_item">New Document</div> |
| | | <div id="tool_open" class="menu_item" style="display: none;"><div id="fileinputs"></div>Open SVG...</div> |
| | | <div id="tool_import" class="menu_item" style="display: none;"><div id="fileinputs_import"></div>Import Image...</div> |
| | |
| | | <div class="menu_item action_selected disabled" id="tool_delete">Delete <span>⌫</span></div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="menu"> |
| | | <div class="menu_title">Object</div> |
| | | <div class="menu_list" id="object_menu"> |
| | |
| | | <div class="menu_item" id="tool_source">Source... <span class="shortcut">⌘U</span></div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </div> |
| | | |
| | | <div id="tools_top" class="tools_panel"> |
| | | |
| | | <div id="canvas_panel" class="context_panel"> |
| | | |
| | | |
| | | <h4 class="clearfix">Canvas</h4> |
| | | |
| | | |
| | | <label data-title="Change canvas width"> |
| | | <input size="3" id="canvas_width" type="text" pattern="[0-9]*" /> |
| | | <span class="icon_label">Width</span> |
| | |
| | | <input id="canvas_height" size="3" type="text" pattern="[0-9]*" /> |
| | | <span class="icon_label">Height</span> |
| | | </label> |
| | | |
| | | |
| | | |
| | | |
| | | <label data-title="Change canvas color" class="draginput"> |
| | | <span>Color</span> |
| | | <div id="color_canvas_tools"> |
| | |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | |
| | | <div id="rect_panel" class="context_panel"> |
| | | <h4 class="clearfix">Rectangle</h4> |
| | | <label> |
| | | <input id="rect_x" class="attr_changer" data-title="Change X coordinate" size="3" data-attr="x" pattern="[0-9]*" /> |
| | | <span>X</span> |
| | | <span>X</span> |
| | | </label> |
| | | <label> |
| | | <input id="rect_y" class="attr_changer" data-title="Change Y coordinate" size="3" data-attr="y" pattern="[0-9]*" /> |
| | | <span>Y</span> |
| | | <span>Y</span> |
| | | </label> |
| | | <label id="rect_width_tool attr_changer" data-title="Change rectangle width"> |
| | | <input id="rect_width" class="attr_changer" size="3" data-attr="width" type="text" pattern="[0-9]*" /> |
| | |
| | | <span class="icon_label">Height</span> |
| | | </label> |
| | | </div> |
| | | |
| | | |
| | | <div id="path_panel" class="context_panel clearfix"> |
| | | <h4 class="clearfix">Path</h4> |
| | | <label> |
| | |
| | | <h4>Image</h4> |
| | | <label> |
| | | <input id="image_x" class="attr_changer" data-title="Change X coordinate" size="3" data-attr="x" pattern="[0-9]*"/> |
| | | <span>X</span> |
| | | <span>X</span> |
| | | </label> |
| | | <label> |
| | | <input id="image_y" class="attr_changer" data-title="Change Y coordinate" size="3" data-attr="y" pattern="[0-9]*"/> |
| | | <span>Y</span> |
| | | <span>Y</span> |
| | | </label> |
| | | <label> |
| | | <input id="image_width" class="attr_changer" data-title="Change image width" size="3" data-attr="width" pattern="[0-9]*" /> |
| | |
| | | <span class="icon_label">Height</span> |
| | | </label> |
| | | </div> |
| | | |
| | | |
| | | <div id="circle_panel" class="context_panel"> |
| | | <h4>Circle</h4> |
| | | <label id="tool_circle_cx"> |
| | |
| | | <input id="text_y" class="attr_changer" data-title="Change text y coordinate" size="3" data-attr="y" pattern="[0-9]*" /> |
| | | <span>Y</span> |
| | | </label> |
| | | |
| | | |
| | | <div class="toolset draginput select twocol" id="tool_font_family"> |
| | | <!-- Font family --> |
| | | <span>Font</span> |
| | |
| | | <!-- formerly gsvg_panel --> |
| | | <div id="container_panel" class="context_panel clearfix"> |
| | | </div> |
| | | |
| | | |
| | | <div id="use_panel" class="context_panel clearfix"> |
| | | <div class="tool_button clearfix" id="tool_unlink_use" data-title="Break link to reference element (make unique)">Break link reference</div> |
| | | </div> |
| | | |
| | | |
| | | <div id="g_panel" class="context_panel clearfix"> |
| | | <h4>Group</h4> |
| | | <label> |
| | |
| | | <span>Y</span> |
| | | </label> |
| | | </div> |
| | | |
| | | |
| | | <div id="path_node_panel" class="context_panel clearfix"> |
| | | <h4>Edit Path</h4> |
| | | |
| | |
| | | <input id="path_node_y" class="attr_changer" data-title="Change node's y coordinate" size="3" data-attr="y" /> |
| | | <span>Y</span> |
| | | </label> |
| | | |
| | | |
| | | <div id="segment_type" class="draginput label"> |
| | | <span>Segment Type</span> |
| | | <select id="seg_type" data-title="Change Segment type"> |
| | |
| | | <div class="caret"></div> |
| | | <label id="seg_type_label">Straight</label> |
| | | </div> |
| | | |
| | | |
| | | <!-- |
| | | <label class="draginput checkbox" data-title="Link Control Points"> |
| | | <span>Linked Control Points</span> |
| | | <div class="push_bottom"><input type="checkbox" id="tool_node_link" checked="checked" /></div> |
| | | </label> |
| | | --> |
| | | |
| | | |
| | | <div class="clearfix"></div> |
| | | <div class="tool_button" id="tool_node_clone" title="Adds a node">Add Node</div> |
| | | <div class="tool_button" id="tool_node_delete" title="Delete Node">Delete Node</div> |
| | | <div class="tool_button" id="tool_openclose_path" title="Open/close sub-path">Open Path</div> |
| | | <!--<div class="tool_button" id="tool_add_subpath" title="Add sub-path"></div>--> |
| | | </div> |
| | | |
| | | |
| | | <!-- Buttons when a single element is selected --> |
| | | <div id="selected_panel" class="context_panel"> |
| | | |
| | |
| | | <div id="tool_angle_indicator_cursor"></div> |
| | | </div> |
| | | </label> |
| | | |
| | | |
| | | <label class="toolset" id="tool_opacity" data-title="Change selected item opacity"> |
| | | <input id="group_opacity" class="attr_changer" data-attr="opacity" data-multiplier="0.01" size="3" value="100" step="5" min="0" max="100" /> |
| | | <span id="group_opacityLabel" class="icon_label">Opacity</span> |
| | | </label> |
| | | |
| | | |
| | | <div class="toolset" id="tool_blur" data-title="Change gaussian blur value"> |
| | | <label> |
| | | <input id="blur" size="2" value="0" step=".1" min="0" max="10" /> |
| | | <span class="icon_label">Blur</span> |
| | | </label> |
| | | </div> |
| | | |
| | | |
| | | <label id="cornerRadiusLabel" data-title="Change Rectangle Corner Radius"> |
| | | <input id="rect_rx" size="3" value="0" data-attr="rx" class="attr_changer" type="text" pattern="[0-9]*" /> |
| | | <span class="icon_label">Roundness</span> |
| | | </label> |
| | | |
| | | |
| | | <div class="clearfix"></div> |
| | | <div id="align_tools"> |
| | | <h4>Align</h4> |
| | |
| | | <div class="draginput_cell" id="tool_posbottom" title="Align Bottom"></div> |
| | | </div> |
| | | </label> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <!-- Buttons when multiple elements are selected --> |
| | | <div id="multiselected_panel" class="context_panel clearfix"> |
| | | <h4 class="hidable">Multiple Elements</h4> |
| | | |
| | | |
| | | <div class="toolset align_buttons" style="position: relative"> |
| | | <label id="tool_align_relative" style="margin-top: 10px;"> |
| | | <label id="tool_align_relative" style="margin-top: 10px;"> |
| | | <select id="align_relative_to" title="Align relative to ..."> |
| | | <option id="selected_objects" value="selected">Align to objects</option> |
| | | <option id="page" value="page">Align to page</option> |
| | |
| | | <div class="clearfix"></div> |
| | | |
| | | </div> |
| | | |
| | | |
| | | <div id="stroke_panel" class="context_panel clearfix"> |
| | | <div class="clearfix"></div> |
| | | <h4>Stroke</h4> |
| | |
| | | <span class="icon_label">Stroke Width</span> |
| | | </label> |
| | | </div> |
| | | <div class="stroke_tool draginput"> |
| | | <div class="stroke_tool draginput"> |
| | | <span>Stroke Dash</span> |
| | | <select id="stroke_style" data-title="Change stroke dash style"> |
| | | <option selected="selected" value="none">—</option> |
| | |
| | | <div class="caret"></div> |
| | | <label id="stroke_style_label">—</label> |
| | | </div> |
| | | |
| | | |
| | | <label style="display: none;"> |
| | | <span class="icon_label">Stroke Join</span> |
| | | </label> |
| | | |
| | | |
| | | <label style="display: none;"> |
| | | <span class="icon_label">Stroke Cap</span> |
| | | </label> |
| | |
| | | |
| | | </div> <!-- tools_top --> |
| | | <div id="cur_context_panel"> |
| | | |
| | | |
| | | </div> |
| | | |
| | | |
| | |
| | | <div class="tool_button" id="tool_path" title="Path Tool [P]"></div> |
| | | <div class="tool_button" id="tool_text" title="Text Tool [T]"></div> |
| | | <div class="tool_button" id="tool_zoom" title="Zoom Tool [Z]"></div> |
| | | |
| | | |
| | | <div id="color_tools"> |
| | | <div id="tool_switch" title="Switch stroke and fill colors [X]"></div> |
| | | <div class="color_tool active" id="tool_fill"> |
| | |
| | | /* |
| | | * canvg.js - Javascript SVG parser and renderer on Canvas |
| | | * MIT Licensed |
| | | * MIT Licensed |
| | | * Gabe Lerner (gabelerner@gmail.com) |
| | | * http://code.google.com/p/canvg/ |
| | | * |
| | |
| | | canvg(c, div.innerHTML); |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | opts = opts || {}; |
| | | |
| | | |
| | | if (typeof target == 'string') { |
| | | target = document.getElementById(target); |
| | | } |
| | | |
| | | |
| | | // reuse class per canvas |
| | | var svg; |
| | | if (target.svg == null) { |
| | |
| | | svg.stop(); |
| | | } |
| | | svg.opts = opts; |
| | | |
| | | |
| | | var ctx = target.getContext('2d'); |
| | | if (typeof(s.documentElement) != 'undefined') { |
| | | // load from xml doc |
| | |
| | | |
| | | function build() { |
| | | var svg = { }; |
| | | |
| | | |
| | | svg.FRAMERATE = 30; |
| | | svg.MAX_VIRTUAL_PIXELS = 30000; |
| | | |
| | | |
| | | // globals |
| | | svg.init = function(ctx) { |
| | | svg.Definitions = {}; |
| | |
| | | if (d != null && typeof(d) == 'number') return d; |
| | | if (d == 'x') return this.width(); |
| | | if (d == 'y') return this.height(); |
| | | return Math.sqrt(Math.pow(this.width(), 2) + Math.pow(this.height(), 2)) / Math.sqrt(2); |
| | | return Math.sqrt(Math.pow(this.width(), 2) + Math.pow(this.height(), 2)) / Math.sqrt(2); |
| | | } |
| | | }); |
| | | } |
| | | svg.init(); |
| | | |
| | | |
| | | // images loaded |
| | | svg.ImagesLoaded = function() { |
| | | svg.ImagesLoaded = function() { |
| | | for (var i=0; i<svg.Images.length; i++) { |
| | | if (!svg.Images[i].loaded) return false; |
| | | } |
| | |
| | | |
| | | // trim |
| | | svg.trim = function(s) { return s.replace(/^\s+|\s+$/g, ''); } |
| | | |
| | | |
| | | // compress spaces |
| | | svg.compressSpaces = function(s) { return s.replace(/[\s\r\t\n]+/gm,' '); } |
| | | |
| | | |
| | | // ajax |
| | | svg.ajax = function(url) { |
| | | var AJAX; |
| | |
| | | return AJAX.responseText; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | | |
| | | // parse xml |
| | | svg.parseXml = function(xml) { |
| | | if (window.DOMParser) |
| | |
| | | var parser = new DOMParser(); |
| | | return parser.parseFromString(xml, 'text/xml'); |
| | | } |
| | | else |
| | | else |
| | | { |
| | | xml = xml.replace(/<!DOCTYPE svg[^>]*>/, ''); |
| | | var xmlDoc = new ActiveXObject('Microsoft.XMLDOM'); |
| | | xmlDoc.async = 'false'; |
| | | xmlDoc.loadXML(xml); |
| | | xmlDoc.loadXML(xml); |
| | | return xmlDoc; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | svg.Property = function(name, value) { |
| | | this.name = name; |
| | | this.value = value; |
| | | |
| | | |
| | | this.hasValue = function() { |
| | | return (this.value != null && this.value !== ''); |
| | | } |
| | | |
| | | |
| | | // return the numerical value of the property |
| | | this.numValue = function() { |
| | | if (!this.hasValue()) return 0; |
| | | |
| | | |
| | | var n = parseFloat(this.value); |
| | | if ((this.value + '').match(/%$/)) { |
| | | n = n / 100.0; |
| | | } |
| | | return n; |
| | | } |
| | | |
| | | |
| | | this.valueOrDefault = function(def) { |
| | | if (this.hasValue()) return this.value; |
| | | return def; |
| | | } |
| | | |
| | | |
| | | this.numValueOrDefault = function(def) { |
| | | if (this.hasValue()) return this.numValue(); |
| | | return def; |
| | | } |
| | | |
| | | |
| | | /* EXTENSIONS */ |
| | | var that = this; |
| | | |
| | | |
| | | // color extensions |
| | | this.Color = { |
| | | // augment the current color value with the opacity |
| | |
| | | return new svg.Property(that.name, newValue); |
| | | } |
| | | } |
| | | |
| | | |
| | | // definition extensions |
| | | this.Definition = { |
| | | // get the definition from the definitions table |
| | |
| | | var name = that.value.replace(/^(url\()?#([^\)]+)\)?$/, '$2'); |
| | | return svg.Definitions[name]; |
| | | }, |
| | | |
| | | |
| | | isUrl: function() { |
| | | return that.value.indexOf('url(') == 0 |
| | | }, |
| | | |
| | | |
| | | getFillStyle: function(e) { |
| | | var def = this.getDefinition(); |
| | | |
| | | |
| | | // gradient |
| | | if (def != null && def.createGradient) { |
| | | return def.createGradient(svg.ctx, e); |
| | | } |
| | | |
| | | |
| | | // pattern |
| | | if (def != null && def.createPattern) { |
| | | return def.createPattern(svg.ctx, e); |
| | | } |
| | | |
| | | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | // length extensions |
| | | this.Length = { |
| | | DPI: function(viewPort) { |
| | | return 96.0; // TODO: compute? |
| | | }, |
| | | |
| | | |
| | | EM: function(viewPort) { |
| | | var em = 12; |
| | | |
| | | |
| | | var fontSize = new svg.Property('fontSize', svg.Font.Parse(svg.ctx.font).fontSize); |
| | | if (fontSize.hasValue()) em = fontSize.Length.toPixels(viewPort); |
| | | |
| | | |
| | | return em; |
| | | }, |
| | | |
| | | |
| | | // get the length as pixels |
| | | toPixels: function(viewPort) { |
| | | if (!that.hasValue()) return 0; |
| | |
| | | return that.numValue(); |
| | | } |
| | | } |
| | | |
| | | |
| | | // time extensions |
| | | this.Time = { |
| | | // get the time as milliseconds |
| | |
| | | return that.numValue(); |
| | | } |
| | | } |
| | | |
| | | |
| | | // angle extensions |
| | | this.Angle = { |
| | | // get the angle as radians |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // fonts |
| | | svg.Font = new (function() { |
| | | this.Styles = ['normal','italic','oblique','inherit']; |
| | | this.Variants = ['normal','small-caps','inherit']; |
| | | this.Weights = ['normal','bold','bolder','lighter','100','200','300','400','500','600','700','800','900','inherit']; |
| | | |
| | | this.CreateFont = function(fontStyle, fontVariant, fontWeight, fontSize, fontFamily, inherit) { |
| | | |
| | | this.CreateFont = function(fontStyle, fontVariant, fontWeight, fontSize, fontFamily, inherit) { |
| | | var f = inherit != null ? this.Parse(inherit) : this.CreateFont('', '', '', '', '', svg.ctx.font); |
| | | return { |
| | | fontFamily: fontFamily || f.fontFamily, |
| | | fontSize: fontSize || f.fontSize, |
| | | fontStyle: fontStyle || f.fontStyle, |
| | | fontWeight: fontWeight || f.fontWeight, |
| | | return { |
| | | fontFamily: fontFamily || f.fontFamily, |
| | | fontSize: fontSize || f.fontSize, |
| | | fontStyle: fontStyle || f.fontStyle, |
| | | fontWeight: fontWeight || f.fontWeight, |
| | | fontVariant: fontVariant || f.fontVariant, |
| | | toString: function () { return [this.fontStyle, this.fontVariant, this.fontWeight, this.fontSize, this.fontFamily].join(' ') } |
| | | } |
| | | toString: function () { return [this.fontStyle, this.fontVariant, this.fontWeight, this.fontSize, this.fontFamily].join(' ') } |
| | | } |
| | | } |
| | | |
| | | |
| | | var that = this; |
| | | this.Parse = function(s) { |
| | | var f = {}; |
| | |
| | | return f; |
| | | } |
| | | }); |
| | | |
| | | |
| | | // points and paths |
| | | svg.ToNumberArray = function(s) { |
| | | var a = svg.trim(svg.compressSpaces((s || '').replace(/,/g, ' '))).split(' '); |
| | |
| | | a[i] = parseFloat(a[i]); |
| | | } |
| | | return a; |
| | | } |
| | | } |
| | | svg.Point = function(x, y) { |
| | | this.x = x; |
| | | this.y = y; |
| | | |
| | | |
| | | this.angleTo = function(p) { |
| | | return Math.atan2(p.y - this.y, p.x - this.x); |
| | | } |
| | | |
| | | |
| | | this.applyTransform = function(v) { |
| | | var xp = this.x * v[0] + this.y * v[2] + v[4]; |
| | | var yp = this.x * v[1] + this.y * v[3] + v[5]; |
| | |
| | | } |
| | | return path; |
| | | } |
| | | |
| | | |
| | | // bounding box |
| | | svg.BoundingBox = function(x1, y1, x2, y2) { // pass in initial points if you want |
| | | this.x1 = Number.NaN; |
| | | this.y1 = Number.NaN; |
| | | this.x2 = Number.NaN; |
| | | this.y2 = Number.NaN; |
| | | |
| | | |
| | | this.x = function() { return this.x1; } |
| | | this.y = function() { return this.y1; } |
| | | this.width = function() { return this.x2 - this.x1; } |
| | | this.height = function() { return this.y2 - this.y1; } |
| | | |
| | | this.addPoint = function(x, y) { |
| | | |
| | | this.addPoint = function(x, y) { |
| | | if (x != null) { |
| | | if (isNaN(this.x1) || isNaN(this.x2)) { |
| | | this.x1 = x; |
| | |
| | | if (x < this.x1) this.x1 = x; |
| | | if (x > this.x2) this.x2 = x; |
| | | } |
| | | |
| | | |
| | | if (y != null) { |
| | | if (isNaN(this.y1) || isNaN(this.y2)) { |
| | | this.y1 = y; |
| | |
| | | if (y < this.y1) this.y1 = y; |
| | | if (y > this.y2) this.y2 = y; |
| | | } |
| | | } |
| | | } |
| | | this.addX = function(x) { this.addPoint(x, null); } |
| | | this.addY = function(y) { this.addPoint(null, y); } |
| | | |
| | | |
| | | this.addBoundingBox = function(bb) { |
| | | this.addPoint(bb.x1, bb.y1); |
| | | this.addPoint(bb.x2, bb.y2); |
| | | } |
| | | |
| | | |
| | | this.addQuadraticCurve = function(p0x, p0y, p1x, p1y, p2x, p2y) { |
| | | var cp1x = p0x + 2/3 * (p1x - p0x); // CP1 = QP0 + 2/3 *(QP1-QP0) |
| | | var cp1y = p0y + 2/3 * (p1y - p0y); // CP1 = QP0 + 2/3 *(QP1-QP0) |
| | |
| | | var cp2y = cp1y + 1/3 * (p2y - p0y); // CP2 = CP1 + 1/3 *(QP2-QP0) |
| | | this.addBezierCurve(p0x, p0y, cp1x, cp2x, cp1y, cp2y, p2x, p2y); |
| | | } |
| | | |
| | | |
| | | this.addBezierCurve = function(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y) { |
| | | // from http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html |
| | | var p0 = [p0x, p0y], p1 = [p1x, p1y], p2 = [p2x, p2y], p3 = [p3x, p3y]; |
| | | this.addPoint(p0[0], p0[1]); |
| | | this.addPoint(p3[0], p3[1]); |
| | | |
| | | |
| | | for (i=0; i<=1; i++) { |
| | | var f = function(t) { |
| | | var f = function(t) { |
| | | return Math.pow(1-t, 3) * p0[i] |
| | | + 3 * Math.pow(1-t, 2) * t * p1[i] |
| | | + 3 * (1-t) * Math.pow(t, 2) * p2[i] |
| | | + Math.pow(t, 3) * p3[i]; |
| | | } |
| | | |
| | | |
| | | var b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i]; |
| | | var a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i]; |
| | | var c = 3 * p1[i] - 3 * p0[i]; |
| | | |
| | | |
| | | if (a == 0) { |
| | | if (b == 0) continue; |
| | | var t = -c / b; |
| | |
| | | } |
| | | continue; |
| | | } |
| | | |
| | | |
| | | var b2ac = Math.pow(b, 2) - 4 * c * a; |
| | | if (b2ac < 0) continue; |
| | | var t1 = (-b + Math.sqrt(b2ac)) / (2 * a); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | this.isPointInBox = function(x, y) { |
| | | return (this.x1 <= x && x <= this.x2 && this.y1 <= y && y <= this.y2); |
| | | } |
| | | |
| | | |
| | | this.addPoint(x1, y1); |
| | | this.addPoint(x2, y2); |
| | | } |
| | | |
| | | |
| | | // transforms |
| | | svg.Transform = function(v) { |
| | | svg.Transform = function(v) { |
| | | var that = this; |
| | | this.Type = {} |
| | | |
| | | |
| | | // translate |
| | | this.Type.translate = function(s) { |
| | | this.p = svg.CreatePoint(s); |
| | | this.p = svg.CreatePoint(s); |
| | | this.apply = function(ctx) { |
| | | ctx.translate(this.p.x || 0.0, this.p.y || 0.0); |
| | | } |
| | |
| | | p.applyTransform([1, 0, 0, 1, this.p.x || 0.0, this.p.y || 0.0]); |
| | | } |
| | | } |
| | | |
| | | |
| | | // rotate |
| | | this.Type.rotate = function(s) { |
| | | var a = svg.ToNumberArray(s); |
| | |
| | | p.applyTransform([1, 0, 0, 1, this.p.x || 0.0, this.p.y || 0.0]); |
| | | p.applyTransform([Math.cos(a), Math.sin(a), -Math.sin(a), Math.cos(a), 0, 0]); |
| | | p.applyTransform([1, 0, 0, 1, -this.p.x || 0.0, -this.p.y || 0.0]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | this.Type.scale = function(s) { |
| | | this.p = svg.CreatePoint(s); |
| | | this.apply = function(ctx) { |
| | |
| | | } |
| | | this.applyToPoint = function(p) { |
| | | p.applyTransform([this.p.x || 0.0, 0, 0, this.p.y || 0.0, 0, 0]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | this.Type.matrix = function(s) { |
| | | this.m = svg.ToNumberArray(s); |
| | | this.apply = function(ctx) { |
| | |
| | | } |
| | | this.applyToPoint = function(p) { |
| | | p.applyTransform(this.m); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | this.Type.SkewBase = function(s) { |
| | | this.base = that.Type.matrix; |
| | | this.base(s); |
| | | this.angle = new svg.Property('angle', s); |
| | | } |
| | | this.Type.SkewBase.prototype = new this.Type.matrix; |
| | | |
| | | |
| | | this.Type.skewX = function(s) { |
| | | this.base = that.Type.SkewBase; |
| | | this.base(s); |
| | | this.m = [1, 0, Math.tan(this.angle.Angle.toRadians()), 1, 0, 0]; |
| | | } |
| | | this.Type.skewX.prototype = new this.Type.SkewBase; |
| | | |
| | | |
| | | this.Type.skewY = function(s) { |
| | | this.base = that.Type.SkewBase; |
| | | this.base(s); |
| | | this.m = [1, Math.tan(this.angle.Angle.toRadians()), 0, 1, 0, 0]; |
| | | } |
| | | this.Type.skewY.prototype = new this.Type.SkewBase; |
| | | |
| | | |
| | | this.transforms = []; |
| | | |
| | | |
| | | this.apply = function(ctx) { |
| | | for (var i=0; i<this.transforms.length; i++) { |
| | | this.transforms[i].apply(ctx); |
| | | } |
| | | } |
| | | |
| | | |
| | | this.applyToPoint = function(p) { |
| | | for (var i=0; i<this.transforms.length; i++) { |
| | | this.transforms[i].applyToPoint(p); |
| | | } |
| | | } |
| | | |
| | | |
| | | var data = svg.trim(svg.compressSpaces(v)).split(/\s(?=[a-z])/); |
| | | for (var i=0; i<data.length; i++) { |
| | | var type = data[i].split('(')[0]; |
| | |
| | | this.transforms.push(transform); |
| | | } |
| | | } |
| | | |
| | | |
| | | // aspect ratio |
| | | svg.AspectRatio = function(ctx, aspectRatio, width, desiredWidth, height, desiredHeight, minX, minY, refX, refY) { |
| | | // aspect ratio - http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute |
| | | aspectRatio = svg.compressSpaces(aspectRatio); |
| | | aspectRatio = aspectRatio.replace(/^defer\s/,''); // ignore defer |
| | | var align = aspectRatio.split(' ')[0] || 'xMidYMid'; |
| | | var meetOrSlice = aspectRatio.split(' ')[1] || 'meet'; |
| | | |
| | | var meetOrSlice = aspectRatio.split(' ')[1] || 'meet'; |
| | | |
| | | // calculate scale |
| | | var scaleX = width / desiredWidth; |
| | | var scaleY = height / desiredHeight; |
| | | var scaleMin = Math.min(scaleX, scaleY); |
| | | var scaleMax = Math.max(scaleX, scaleY); |
| | | if (meetOrSlice == 'meet') { desiredWidth *= scaleMin; desiredHeight *= scaleMin; } |
| | | if (meetOrSlice == 'slice') { desiredWidth *= scaleMax; desiredHeight *= scaleMax; } |
| | | |
| | | if (meetOrSlice == 'slice') { desiredWidth *= scaleMax; desiredHeight *= scaleMax; } |
| | | |
| | | refX = new svg.Property('refX', refX); |
| | | refY = new svg.Property('refY', refY); |
| | | if (refX.hasValue() && refY.hasValue()) { |
| | | if (refX.hasValue() && refY.hasValue()) { |
| | | ctx.translate(-scaleMin * refX.Length.toPixels('x'), -scaleMin * refY.Length.toPixels('y')); |
| | | } |
| | | else { |
| | | // align |
| | | if (align.match(/^xMid/) && ((meetOrSlice == 'meet' && scaleMin == scaleY) || (meetOrSlice == 'slice' && scaleMax == scaleY))) ctx.translate(width / 2.0 - desiredWidth / 2.0, 0); |
| | | if (align.match(/YMid$/) && ((meetOrSlice == 'meet' && scaleMin == scaleX) || (meetOrSlice == 'slice' && scaleMax == scaleX))) ctx.translate(0, height / 2.0 - desiredHeight / 2.0); |
| | | if (align.match(/^xMax/) && ((meetOrSlice == 'meet' && scaleMin == scaleY) || (meetOrSlice == 'slice' && scaleMax == scaleY))) ctx.translate(width - desiredWidth, 0); |
| | | if (align.match(/YMax$/) && ((meetOrSlice == 'meet' && scaleMin == scaleX) || (meetOrSlice == 'slice' && scaleMax == scaleX))) ctx.translate(0, height - desiredHeight); |
| | | } |
| | | |
| | | else { |
| | | // align |
| | | if (align.match(/^xMid/) && ((meetOrSlice == 'meet' && scaleMin == scaleY) || (meetOrSlice == 'slice' && scaleMax == scaleY))) ctx.translate(width / 2.0 - desiredWidth / 2.0, 0); |
| | | if (align.match(/YMid$/) && ((meetOrSlice == 'meet' && scaleMin == scaleX) || (meetOrSlice == 'slice' && scaleMax == scaleX))) ctx.translate(0, height / 2.0 - desiredHeight / 2.0); |
| | | if (align.match(/^xMax/) && ((meetOrSlice == 'meet' && scaleMin == scaleY) || (meetOrSlice == 'slice' && scaleMax == scaleY))) ctx.translate(width - desiredWidth, 0); |
| | | if (align.match(/YMax$/) && ((meetOrSlice == 'meet' && scaleMin == scaleX) || (meetOrSlice == 'slice' && scaleMax == scaleX))) ctx.translate(0, height - desiredHeight); |
| | | } |
| | | |
| | | // scale |
| | | if (align == 'none') ctx.scale(scaleX, scaleY); |
| | | else if (meetOrSlice == 'meet') ctx.scale(scaleMin, scaleMin); |
| | | else if (meetOrSlice == 'slice') ctx.scale(scaleMax, scaleMax); |
| | | |
| | | else if (meetOrSlice == 'meet') ctx.scale(scaleMin, scaleMin); |
| | | else if (meetOrSlice == 'slice') ctx.scale(scaleMax, scaleMax); |
| | | |
| | | // translate |
| | | ctx.translate(minX == null ? 0 : -minX, minY == null ? 0 : -minY); |
| | | ctx.translate(minX == null ? 0 : -minX, minY == null ? 0 : -minY); |
| | | } |
| | | |
| | | |
| | | // elements |
| | | svg.Element = {} |
| | | |
| | | svg.Element.ElementBase = function(node) { |
| | | |
| | | svg.Element.ElementBase = function(node) { |
| | | this.attributes = {}; |
| | | this.styles = {}; |
| | | this.children = []; |
| | | |
| | | |
| | | // get or create attribute |
| | | this.attribute = function(name, createIfNotExists) { |
| | | var a = this.attributes[name]; |
| | | if (a != null) return a; |
| | | |
| | | |
| | | a = new svg.Property(name, ''); |
| | | if (createIfNotExists == true) this.attributes[name] = a; |
| | | return a; |
| | | } |
| | | |
| | | |
| | | // get or create style, crawls up node tree |
| | | this.style = function(name, createIfNotExists) { |
| | | var s = this.styles[name]; |
| | | if (s != null) return s; |
| | | |
| | | |
| | | var a = this.attribute(name); |
| | | if (a != null && a.hasValue()) { |
| | | return a; |
| | | } |
| | | |
| | | |
| | | var p = this.parent; |
| | | if (p != null) { |
| | | var ps = p.style(name); |
| | |
| | | return ps; |
| | | } |
| | | } |
| | | |
| | | |
| | | s = new svg.Property(name, ''); |
| | | if (createIfNotExists == true) this.styles[name] = s; |
| | | return s; |
| | | } |
| | | |
| | | |
| | | // base render |
| | | this.render = function(ctx) { |
| | | // don't render display=none |
| | | if (this.style('display').value == 'none') return; |
| | | |
| | | |
| | | // don't render visibility=hidden |
| | | if (this.attribute('visibility').value == 'hidden') return; |
| | | |
| | | |
| | | ctx.save(); |
| | | this.setContext(ctx); |
| | | // mask |
| | |
| | | var filter = this.style('filter').Definition.getDefinition(); |
| | | if (filter != null) filter.apply(ctx, this); |
| | | } |
| | | else this.renderChildren(ctx); |
| | | else this.renderChildren(ctx); |
| | | this.clearContext(ctx); |
| | | ctx.restore(); |
| | | } |
| | | |
| | | |
| | | // base set context |
| | | this.setContext = function(ctx) { |
| | | // OVERRIDE ME! |
| | | } |
| | | |
| | | |
| | | // base clear context |
| | | this.clearContext = function(ctx) { |
| | | // OVERRIDE ME! |
| | | } |
| | | |
| | | } |
| | | |
| | | // base render children |
| | | this.renderChildren = function(ctx) { |
| | | for (var i=0; i<this.children.length; i++) { |
| | | this.children[i].render(ctx); |
| | | } |
| | | } |
| | | |
| | | |
| | | this.addChild = function(childNode, create) { |
| | | var child = childNode; |
| | | if (create) child = svg.CreateElement(childNode); |
| | | child.parent = this; |
| | | this.children.push(child); |
| | | this.children.push(child); |
| | | } |
| | | |
| | | |
| | | if (node != null && node.nodeType == 1) { //ELEMENT_NODE |
| | | // add children |
| | | for (var i=0; i<node.childNodes.length; i++) { |
| | | var childNode = node.childNodes[i]; |
| | | if (childNode.nodeType == 1) this.addChild(childNode, true); //ELEMENT_NODE |
| | | } |
| | | |
| | | |
| | | // add attributes |
| | | for (var i=0; i<node.attributes.length; i++) { |
| | | var attribute = node.attributes[i]; |
| | | this.attributes[attribute.nodeName] = new svg.Property(attribute.nodeName, attribute.nodeValue); |
| | | } |
| | | |
| | | |
| | | // add tag styles |
| | | var styles = svg.Styles[node.nodeName]; |
| | | if (styles != null) { |
| | | for (var name in styles) { |
| | | this.styles[name] = styles[name]; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | // add class styles |
| | | if (this.attribute('class').hasValue()) { |
| | | var classes = svg.compressSpaces(this.attribute('class').value).split(' '); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // add inline styles |
| | | if (this.attribute('style').hasValue()) { |
| | | var styles = this.attribute('style').value.split(';'); |
| | |
| | | this.styles[name] = new svg.Property(name, value); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // add id |
| | | if (this.attribute('id').hasValue()) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | svg.Element.RenderedElementBase = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.setContext = function(ctx) { |
| | | // fill |
| | | if (this.style('fill').Definition.isUrl()) { |
| | |
| | | if (this.style('fill-opacity').hasValue()) fillStyle = fillStyle.Color.addOpacity(this.style('fill-opacity').value); |
| | | ctx.fillStyle = (fillStyle.value == 'none' ? 'rgba(0,0,0,0)' : fillStyle.value); |
| | | } |
| | | |
| | | |
| | | // stroke |
| | | if (this.style('stroke').Definition.isUrl()) { |
| | | var fs = this.style('stroke').Definition.getFillStyle(this); |
| | |
| | | |
| | | // font |
| | | if (typeof(ctx.font) != 'undefined') { |
| | | ctx.font = svg.Font.CreateFont( |
| | | this.style('font-style').value, |
| | | this.style('font-variant').value, |
| | | this.style('font-weight').value, |
| | | this.style('font-size').hasValue() ? this.style('font-size').Length.toPixels() + 'px' : '', |
| | | ctx.font = svg.Font.CreateFont( |
| | | this.style('font-style').value, |
| | | this.style('font-variant').value, |
| | | this.style('font-weight').value, |
| | | this.style('font-size').hasValue() ? this.style('font-size').Length.toPixels() + 'px' : '', |
| | | this.style('font-family').value).toString(); |
| | | } |
| | | |
| | | |
| | | // transform |
| | | if (this.attribute('transform').hasValue()) { |
| | | if (this.attribute('transform').hasValue()) { |
| | | var transform = new svg.Transform(this.attribute('transform').value); |
| | | transform.apply(ctx); |
| | | } |
| | | |
| | | |
| | | // clip |
| | | if (this.attribute('clip-path').hasValue()) { |
| | | var clip = this.attribute('clip-path').Definition.getDefinition(); |
| | | if (clip != null) clip.apply(ctx); |
| | | } |
| | | |
| | | |
| | | // opacity |
| | | if (this.style('opacity').hasValue()) { |
| | | ctx.globalAlpha = this.style('opacity').numValue(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | svg.Element.RenderedElementBase.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | svg.Element.PathElementBase = function(node) { |
| | | this.base = svg.Element.RenderedElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.path = function(ctx) { |
| | | if (ctx != null) ctx.beginPath(); |
| | | return new svg.BoundingBox(); |
| | | } |
| | | |
| | | |
| | | this.renderChildren = function(ctx) { |
| | | this.path(ctx); |
| | | svg.Mouse.checkPath(this, ctx); |
| | | if (ctx.fillStyle != '') ctx.fill(); |
| | | if (ctx.strokeStyle != '') ctx.stroke(); |
| | | |
| | | |
| | | var markers = this.getMarkers(); |
| | | if (markers != null) { |
| | | if (this.style('marker-start').Definition.isUrl()) { |
| | |
| | | var marker = this.style('marker-end').Definition.getDefinition(); |
| | | marker.render(ctx, markers[markers.length-1][0], markers[markers.length-1][1]); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | this.getBoundingBox = function() { |
| | | return this.path(); |
| | | } |
| | | |
| | | |
| | | this.getMarkers = function() { |
| | | return null; |
| | | } |
| | | } |
| | | svg.Element.PathElementBase.prototype = new svg.Element.RenderedElementBase; |
| | | |
| | | |
| | | // svg element |
| | | svg.Element.svg = function(node) { |
| | | this.base = svg.Element.RenderedElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.baseClearContext = this.clearContext; |
| | | this.clearContext = function(ctx) { |
| | | this.baseClearContext(ctx); |
| | | svg.ViewPort.RemoveCurrent(); |
| | | } |
| | | |
| | | |
| | | this.baseSetContext = this.setContext; |
| | | this.setContext = function(ctx) { |
| | | // initial values |
| | | ctx.strokeStyle = 'rgba(0,0,0,0)'; |
| | | ctx.lineCap = 'butt'; |
| | | ctx.lineJoin = 'miter'; |
| | | ctx.miterLimit = 4; |
| | | |
| | | ctx.miterLimit = 4; |
| | | |
| | | this.baseSetContext(ctx); |
| | | |
| | | |
| | | // create new view port |
| | | if (this.attribute('x').hasValue() && this.attribute('y').hasValue()) { |
| | | ctx.translate(this.attribute('x').Length.toPixels('x'), this.attribute('y').Length.toPixels('y')); |
| | | } |
| | | |
| | | |
| | | var width = svg.ViewPort.width(); |
| | | var height = svg.ViewPort.height(); |
| | | if (typeof(this.root) == 'undefined' && this.attribute('width').hasValue() && this.attribute('height').hasValue()) { |
| | | width = this.attribute('width').Length.toPixels('x'); |
| | | height = this.attribute('height').Length.toPixels('y'); |
| | | |
| | | |
| | | var x = 0; |
| | | var y = 0; |
| | | if (this.attribute('refX').hasValue() && this.attribute('refY').hasValue()) { |
| | | x = -this.attribute('refX').Length.toPixels('x'); |
| | | y = -this.attribute('refY').Length.toPixels('y'); |
| | | } |
| | | |
| | | |
| | | ctx.beginPath(); |
| | | ctx.moveTo(x, y); |
| | | ctx.lineTo(width, y); |
| | |
| | | ctx.closePath(); |
| | | ctx.clip(); |
| | | } |
| | | svg.ViewPort.SetCurrent(width, height); |
| | | |
| | | svg.ViewPort.SetCurrent(width, height); |
| | | |
| | | // viewbox |
| | | if (this.attribute('viewBox').hasValue()) { |
| | | if (this.attribute('viewBox').hasValue()) { |
| | | var viewBox = svg.ToNumberArray(this.attribute('viewBox').value); |
| | | var minX = viewBox[0]; |
| | | var minY = viewBox[1]; |
| | | width = viewBox[2]; |
| | | height = viewBox[3]; |
| | | |
| | | |
| | | svg.AspectRatio(ctx, |
| | | this.attribute('preserveAspectRatio').value, |
| | | svg.ViewPort.width(), |
| | | this.attribute('preserveAspectRatio').value, |
| | | svg.ViewPort.width(), |
| | | width, |
| | | svg.ViewPort.height(), |
| | | height, |
| | |
| | | minY, |
| | | this.attribute('refX').value, |
| | | this.attribute('refY').value); |
| | | |
| | | svg.ViewPort.RemoveCurrent(); |
| | | svg.ViewPort.SetCurrent(viewBox[2], viewBox[3]); |
| | | } |
| | | |
| | | svg.ViewPort.RemoveCurrent(); |
| | | svg.ViewPort.SetCurrent(viewBox[2], viewBox[3]); |
| | | } |
| | | } |
| | | } |
| | | svg.Element.svg.prototype = new svg.Element.RenderedElementBase; |
| | |
| | | svg.Element.rect = function(node) { |
| | | this.base = svg.Element.PathElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.path = function(ctx) { |
| | | var x = this.attribute('x').Length.toPixels('x'); |
| | | var y = this.attribute('y').Length.toPixels('y'); |
| | |
| | | var ry = this.attribute('ry').Length.toPixels('y'); |
| | | if (this.attribute('rx').hasValue() && !this.attribute('ry').hasValue()) ry = rx; |
| | | if (this.attribute('ry').hasValue() && !this.attribute('rx').hasValue()) rx = ry; |
| | | |
| | | |
| | | if (ctx != null) { |
| | | ctx.beginPath(); |
| | | ctx.moveTo(x + rx, y); |
| | |
| | | ctx.quadraticCurveTo(x, y, x + rx, y) |
| | | ctx.closePath(); |
| | | } |
| | | |
| | | |
| | | return new svg.BoundingBox(x, y, x + width, y + height); |
| | | } |
| | | } |
| | | svg.Element.rect.prototype = new svg.Element.PathElementBase; |
| | | |
| | | |
| | | // circle element |
| | | svg.Element.circle = function(node) { |
| | | this.base = svg.Element.PathElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.path = function(ctx) { |
| | | var cx = this.attribute('cx').Length.toPixels('x'); |
| | | var cy = this.attribute('cy').Length.toPixels('y'); |
| | | var r = this.attribute('r').Length.toPixels(); |
| | | |
| | | |
| | | if (ctx != null) { |
| | | ctx.beginPath(); |
| | | ctx.arc(cx, cy, r, 0, Math.PI * 2, true); |
| | | ctx.arc(cx, cy, r, 0, Math.PI * 2, true); |
| | | ctx.closePath(); |
| | | } |
| | | |
| | | |
| | | return new svg.BoundingBox(cx - r, cy - r, cx + r, cy + r); |
| | | } |
| | | } |
| | | svg.Element.circle.prototype = new svg.Element.PathElementBase; |
| | | svg.Element.circle.prototype = new svg.Element.PathElementBase; |
| | | |
| | | // ellipse element |
| | | svg.Element.ellipse = function(node) { |
| | | this.base = svg.Element.PathElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.path = function(ctx) { |
| | | var KAPPA = 4 * ((Math.sqrt(2) - 1) / 3); |
| | | var rx = this.attribute('rx').Length.toPixels('x'); |
| | | var ry = this.attribute('ry').Length.toPixels('y'); |
| | | var cx = this.attribute('cx').Length.toPixels('x'); |
| | | var cy = this.attribute('cy').Length.toPixels('y'); |
| | | |
| | | |
| | | if (ctx != null) { |
| | | ctx.beginPath(); |
| | | ctx.moveTo(cx, cy - ry); |
| | |
| | | ctx.bezierCurveTo(cx - rx, cy - (KAPPA * ry), cx - (KAPPA * rx), cy - ry, cx, cy - ry); |
| | | ctx.closePath(); |
| | | } |
| | | |
| | | |
| | | return new svg.BoundingBox(cx - rx, cy - ry, cx + rx, cy + ry); |
| | | } |
| | | } |
| | | svg.Element.ellipse.prototype = new svg.Element.PathElementBase; |
| | | |
| | | svg.Element.ellipse.prototype = new svg.Element.PathElementBase; |
| | | |
| | | // line element |
| | | svg.Element.line = function(node) { |
| | | this.base = svg.Element.PathElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.getPoints = function() { |
| | | return [ |
| | | new svg.Point(this.attribute('x1').Length.toPixels('x'), this.attribute('y1').Length.toPixels('y')), |
| | | new svg.Point(this.attribute('x2').Length.toPixels('x'), this.attribute('y2').Length.toPixels('y'))]; |
| | | } |
| | | |
| | | |
| | | this.path = function(ctx) { |
| | | var points = this.getPoints(); |
| | | |
| | | |
| | | if (ctx != null) { |
| | | ctx.beginPath(); |
| | | ctx.moveTo(points[0].x, points[0].y); |
| | | ctx.lineTo(points[1].x, points[1].y); |
| | | } |
| | | |
| | | |
| | | return new svg.BoundingBox(points[0].x, points[0].y, points[1].x, points[1].y); |
| | | } |
| | | |
| | | |
| | | this.getMarkers = function() { |
| | | var points = this.getPoints(); |
| | | var points = this.getPoints(); |
| | | var a = points[0].angleTo(points[1]); |
| | | return [[points[0], a], [points[1], a]]; |
| | | } |
| | | } |
| | | svg.Element.line.prototype = new svg.Element.PathElementBase; |
| | | |
| | | svg.Element.line.prototype = new svg.Element.PathElementBase; |
| | | |
| | | // polyline element |
| | | svg.Element.polyline = function(node) { |
| | | this.base = svg.Element.PathElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.points = svg.CreatePath(this.attribute('points').value); |
| | | this.path = function(ctx) { |
| | | var bb = new svg.BoundingBox(this.points[0].x, this.points[0].y); |
| | |
| | | } |
| | | return bb; |
| | | } |
| | | |
| | | |
| | | this.getMarkers = function() { |
| | | var markers = []; |
| | | for (var i=0; i<this.points.length - 1; i++) { |
| | |
| | | } |
| | | markers.push([this.points[this.points.length-1], markers[markers.length-1][1]]); |
| | | return markers; |
| | | } |
| | | } |
| | | } |
| | | svg.Element.polyline.prototype = new svg.Element.PathElementBase; |
| | | |
| | | svg.Element.polyline.prototype = new svg.Element.PathElementBase; |
| | | |
| | | // polygon element |
| | | svg.Element.polygon = function(node) { |
| | | this.base = svg.Element.polyline; |
| | | this.base(node); |
| | | |
| | | |
| | | this.basePath = this.path; |
| | | this.path = function(ctx) { |
| | | var bb = this.basePath(ctx); |
| | |
| | | svg.Element.path = function(node) { |
| | | this.base = svg.Element.PathElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | var d = this.attribute('d').value; |
| | | // TODO: convert to real lexer based on http://www.w3.org/TR/SVG11/paths.html#PathDataBNF |
| | | d = d.replace(/,/gm,' '); // get rid of all commas |
| | |
| | | d = svg.trim(d); |
| | | this.PathParser = new (function(d) { |
| | | this.tokens = d.split(' '); |
| | | |
| | | |
| | | this.reset = function() { |
| | | this.i = -1; |
| | | this.command = ''; |
| | |
| | | this.points = []; |
| | | this.angles = []; |
| | | } |
| | | |
| | | |
| | | this.isEnd = function() { |
| | | return this.i >= this.tokens.length - 1; |
| | | } |
| | | |
| | | |
| | | this.isCommandOrEnd = function() { |
| | | if (this.isEnd()) return true; |
| | | return this.tokens[this.i + 1].match(/^[A-Za-z]$/) != null; |
| | | } |
| | | |
| | | |
| | | this.isRelativeCommand = function() { |
| | | return this.command == this.command.toLowerCase(); |
| | | } |
| | | |
| | | |
| | | this.getToken = function() { |
| | | this.i = this.i + 1; |
| | | return this.tokens[this.i]; |
| | | } |
| | | |
| | | |
| | | this.getScalar = function() { |
| | | return parseFloat(this.getToken()); |
| | | } |
| | | |
| | | |
| | | this.nextCommand = function() { |
| | | this.previousCommand = this.command; |
| | | this.command = this.getToken(); |
| | | } |
| | | |
| | | } |
| | | |
| | | this.getPoint = function() { |
| | | var p = new svg.Point(this.getScalar(), this.getScalar()); |
| | | return this.makeAbsolute(p); |
| | | } |
| | | |
| | | |
| | | this.getAsControlPoint = function() { |
| | | var p = this.getPoint(); |
| | | this.control = p; |
| | | return p; |
| | | } |
| | | |
| | | |
| | | this.getAsCurrentPoint = function() { |
| | | var p = this.getPoint(); |
| | | this.current = p; |
| | | return p; |
| | | return p; |
| | | } |
| | | |
| | | |
| | | this.getReflectedControlPoint = function() { |
| | | if (this.previousCommand.toLowerCase() != 'c' && this.previousCommand.toLowerCase() != 's') { |
| | | return this.current; |
| | | } |
| | | |
| | | |
| | | // reflect point |
| | | var p = new svg.Point(2 * this.current.x - this.control.x, 2 * this.current.y - this.control.y); |
| | | var p = new svg.Point(2 * this.current.x - this.control.x, 2 * this.current.y - this.control.y); |
| | | return p; |
| | | } |
| | | |
| | | |
| | | this.makeAbsolute = function(p) { |
| | | if (this.isRelativeCommand()) { |
| | | p.x = this.current.x + p.x; |
| | |
| | | } |
| | | return p; |
| | | } |
| | | |
| | | |
| | | this.addMarker = function(p, from, priorTo) { |
| | | // if the last angle isn't filled in because we didn't have this point yet ... |
| | | if (priorTo != null && this.angles.length > 0 && this.angles[this.angles.length-1] == null) { |
| | |
| | | } |
| | | this.addMarkerAngle(p, from == null ? null : from.angleTo(p)); |
| | | } |
| | | |
| | | |
| | | this.addMarkerAngle = function(p, a) { |
| | | this.points.push(p); |
| | | this.angles.push(a); |
| | | } |
| | | |
| | | } |
| | | |
| | | this.getMarkerPoints = function() { return this.points; } |
| | | this.getMarkerAngles = function() { |
| | | for (var i=0; i<this.angles.length; i++) { |
| | |
| | | this.getMarkers = function() { |
| | | var points = this.PathParser.getMarkerPoints(); |
| | | var angles = this.PathParser.getMarkerAngles(); |
| | | |
| | | |
| | | var markers = []; |
| | | for (var i=0; i<points.length; i++) { |
| | | markers.push([points[i], angles[i]]); |
| | |
| | | } |
| | | } |
| | | svg.Element.path.prototype = new svg.Element.PathElementBase; |
| | | |
| | | |
| | | // pattern element |
| | | svg.Element.pattern = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.createPattern = function(ctx, element) { |
| | | // render me using a temporary svg element |
| | | var tempSvg = new svg.Element.svg(); |
| | |
| | | tempSvg.attributes['width'] = new svg.Property('width', this.attribute('width').value); |
| | | tempSvg.attributes['height'] = new svg.Property('height', this.attribute('height').value); |
| | | tempSvg.children = this.children; |
| | | |
| | | |
| | | var c = document.createElement('canvas'); |
| | | c.width = this.attribute('width').Length.toPixels('x'); |
| | | c.height = this.attribute('height').Length.toPixels('y'); |
| | | tempSvg.render(c.getContext('2d')); |
| | | tempSvg.render(c.getContext('2d')); |
| | | return ctx.createPattern(c, 'repeat'); |
| | | } |
| | | } |
| | | svg.Element.pattern.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // marker element |
| | | svg.Element.marker = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.baseRender = this.render; |
| | | this.render = function(ctx, point, angle) { |
| | | ctx.translate(point.x, point.y); |
| | | if (this.attribute('orient').valueOrDefault('auto') == 'auto') ctx.rotate(angle); |
| | | if (this.attribute('markerUnits').valueOrDefault('strokeWidth') == 'strokeWidth') ctx.scale(ctx.lineWidth, ctx.lineWidth); |
| | | ctx.save(); |
| | | |
| | | |
| | | // render me using a temporary svg element |
| | | var tempSvg = new svg.Element.svg(); |
| | | tempSvg.attributes['viewBox'] = new svg.Property('viewBox', this.attribute('viewBox').value); |
| | |
| | | tempSvg.attributes['stroke'] = new svg.Property('stroke', this.attribute('stroke').valueOrDefault('none')); |
| | | tempSvg.children = this.children; |
| | | tempSvg.render(ctx); |
| | | |
| | | |
| | | ctx.restore(); |
| | | if (this.attribute('markerUnits').valueOrDefault('strokeWidth') == 'strokeWidth') ctx.scale(1/ctx.lineWidth, 1/ctx.lineWidth); |
| | | if (this.attribute('orient').valueOrDefault('auto') == 'auto') ctx.rotate(-angle); |
| | |
| | | } |
| | | } |
| | | svg.Element.marker.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // definitions element |
| | | svg.Element.defs = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | this.base(node); |
| | | |
| | | this.render = function(ctx) { |
| | | // NOOP |
| | | } |
| | | } |
| | | svg.Element.defs.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // base for gradients |
| | | svg.Element.GradientBase = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.gradientUnits = this.attribute('gradientUnits').valueOrDefault('objectBoundingBox'); |
| | | |
| | | this.stops = []; |
| | | |
| | | this.stops = []; |
| | | for (var i=0; i<this.children.length; i++) { |
| | | var child = this.children[i]; |
| | | this.stops.push(child); |
| | | } |
| | | |
| | | } |
| | | |
| | | this.getGradient = function() { |
| | | // OVERRIDE ME! |
| | | } |
| | | } |
| | | |
| | | this.createGradient = function(ctx, element) { |
| | | var stopsContainer = this; |
| | | if (this.attribute('xlink:href').hasValue()) { |
| | | stopsContainer = this.attribute('xlink:href').Definition.getDefinition(); |
| | | } |
| | | |
| | | |
| | | var g = this.getGradient(ctx, element); |
| | | for (var i=0; i<stopsContainer.stops.length; i++) { |
| | | g.addColorStop(stopsContainer.stops[i].offset, stopsContainer.stops[i].color); |
| | | } |
| | | |
| | | |
| | | if (this.attribute('gradientTransform').hasValue()) { |
| | | // render as transformed pattern on temporary canvas |
| | | var rootView = svg.ViewPort.viewPorts[0]; |
| | | |
| | | |
| | | var rect = new svg.Element.rect(); |
| | | rect.attributes['x'] = new svg.Property('x', -svg.MAX_VIRTUAL_PIXELS/3.0); |
| | | rect.attributes['y'] = new svg.Property('y', -svg.MAX_VIRTUAL_PIXELS/3.0); |
| | | rect.attributes['width'] = new svg.Property('width', svg.MAX_VIRTUAL_PIXELS); |
| | | rect.attributes['height'] = new svg.Property('height', svg.MAX_VIRTUAL_PIXELS); |
| | | |
| | | |
| | | var group = new svg.Element.g(); |
| | | group.attributes['transform'] = new svg.Property('transform', this.attribute('gradientTransform').value); |
| | | group.children = [ rect ]; |
| | | |
| | | |
| | | var tempSvg = new svg.Element.svg(); |
| | | tempSvg.attributes['x'] = new svg.Property('x', 0); |
| | | tempSvg.attributes['y'] = new svg.Property('y', 0); |
| | | tempSvg.attributes['width'] = new svg.Property('width', rootView.width); |
| | | tempSvg.attributes['height'] = new svg.Property('height', rootView.height); |
| | | tempSvg.children = [ group ]; |
| | | |
| | | |
| | | var c = document.createElement('canvas'); |
| | | c.width = rootView.width; |
| | | c.height = rootView.height; |
| | | var tempCtx = c.getContext('2d'); |
| | | tempCtx.fillStyle = g; |
| | | tempSvg.render(tempCtx); |
| | | tempSvg.render(tempCtx); |
| | | return tempCtx.createPattern(c, 'no-repeat'); |
| | | } |
| | | |
| | | return g; |
| | | |
| | | return g; |
| | | } |
| | | } |
| | | svg.Element.GradientBase.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // linear gradient element |
| | | svg.Element.linearGradient = function(node) { |
| | | this.base = svg.Element.GradientBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.getGradient = function(ctx, element) { |
| | | var bb = element.getBoundingBox(); |
| | | |
| | | var x1 = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.x() + bb.width() * this.attribute('x1').numValue() |
| | | |
| | | var x1 = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.x() + bb.width() * this.attribute('x1').numValue() |
| | | : this.attribute('x1').Length.toPixels('x')); |
| | | var y1 = (this.gradientUnits == 'objectBoundingBox' |
| | | var y1 = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.y() + bb.height() * this.attribute('y1').numValue() |
| | | : this.attribute('y1').Length.toPixels('y')); |
| | | var x2 = (this.gradientUnits == 'objectBoundingBox' |
| | | var x2 = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.x() + bb.width() * this.attribute('x2').numValue() |
| | | : this.attribute('x2').Length.toPixels('x')); |
| | | var y2 = (this.gradientUnits == 'objectBoundingBox' |
| | | var y2 = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.y() + bb.height() * this.attribute('y2').numValue() |
| | | : this.attribute('y2').Length.toPixels('y')); |
| | | |
| | |
| | | } |
| | | } |
| | | svg.Element.linearGradient.prototype = new svg.Element.GradientBase; |
| | | |
| | | |
| | | // radial gradient element |
| | | svg.Element.radialGradient = function(node) { |
| | | this.base = svg.Element.GradientBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.getGradient = function(ctx, element) { |
| | | var bb = element.getBoundingBox(); |
| | | |
| | | var cx = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.x() + bb.width() * this.attribute('cx').numValue() |
| | | |
| | | var cx = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.x() + bb.width() * this.attribute('cx').numValue() |
| | | : this.attribute('cx').Length.toPixels('x')); |
| | | var cy = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.y() + bb.height() * this.attribute('cy').numValue() |
| | | var cy = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.y() + bb.height() * this.attribute('cy').numValue() |
| | | : this.attribute('cy').Length.toPixels('y')); |
| | | |
| | | |
| | | var fx = cx; |
| | | var fy = cy; |
| | | if (this.attribute('fx').hasValue()) { |
| | | fx = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.x() + bb.width() * this.attribute('fx').numValue() |
| | | fx = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.x() + bb.width() * this.attribute('fx').numValue() |
| | | : this.attribute('fx').Length.toPixels('x')); |
| | | } |
| | | if (this.attribute('fy').hasValue()) { |
| | | fy = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.y() + bb.height() * this.attribute('fy').numValue() |
| | | fy = (this.gradientUnits == 'objectBoundingBox' |
| | | ? bb.y() + bb.height() * this.attribute('fy').numValue() |
| | | : this.attribute('fy').Length.toPixels('y')); |
| | | } |
| | | |
| | | var r = (this.gradientUnits == 'objectBoundingBox' |
| | | |
| | | var r = (this.gradientUnits == 'objectBoundingBox' |
| | | ? (bb.width() + bb.height()) / 2.0 * this.attribute('r').numValue() |
| | | : this.attribute('r').Length.toPixels()); |
| | | |
| | | |
| | | return ctx.createRadialGradient(fx, fy, 0, cx, cy, r); |
| | | } |
| | | } |
| | | svg.Element.radialGradient.prototype = new svg.Element.GradientBase; |
| | | |
| | | |
| | | // gradient stop element |
| | | svg.Element.stop = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.offset = this.attribute('offset').numValue(); |
| | | |
| | | |
| | | var stopColor = this.style('stop-color'); |
| | | if (this.style('stop-opacity').hasValue()) stopColor = stopColor.Color.addOpacity(this.style('stop-opacity').value); |
| | | this.color = stopColor.value; |
| | | } |
| | | svg.Element.stop.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // animation base element |
| | | svg.Element.AnimateBase = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | svg.Animations.push(this); |
| | | |
| | | |
| | | this.duration = 0.0; |
| | | this.begin = this.attribute('begin').Time.toMilliseconds(); |
| | | this.maxDuration = this.begin + this.attribute('dur').Time.toMilliseconds(); |
| | | |
| | | |
| | | this.getProperty = function() { |
| | | var attributeType = this.attribute('attributeType').value; |
| | | var attributeName = this.attribute('attributeName').value; |
| | | |
| | | |
| | | if (attributeType == 'CSS') { |
| | | return this.parent.style(attributeName, true); |
| | | } |
| | | return this.parent.attribute(attributeName, true); |
| | | return this.parent.attribute(attributeName, true); |
| | | }; |
| | | |
| | | |
| | | this.initialValue = null; |
| | | this.removed = false; |
| | | this.removed = false; |
| | | |
| | | this.calcValue = function() { |
| | | // OVERRIDE ME! |
| | | return ''; |
| | | } |
| | | |
| | | this.update = function(delta) { |
| | | |
| | | this.update = function(delta) { |
| | | // set initial value |
| | | if (this.initialValue == null) { |
| | | this.initialValue = this.getProperty().value; |
| | | } |
| | | |
| | | |
| | | // if we're past the end time |
| | | if (this.duration > this.maxDuration) { |
| | | // loop for indefinitely repeating animations |
| | |
| | | else { |
| | | return false; // no updates made |
| | | } |
| | | } |
| | | } |
| | | this.duration = this.duration + delta; |
| | | |
| | | |
| | | // if we're past the begin time |
| | | var updated = false; |
| | | if (this.begin < this.duration) { |
| | | var newValue = this.calcValue(); // tween |
| | | |
| | | |
| | | if (this.attribute('type').hasValue()) { |
| | | // for transform, etc. |
| | | var type = this.attribute('type').value; |
| | | newValue = type + '(' + newValue + ')'; |
| | | } |
| | | |
| | | |
| | | this.getProperty().value = newValue; |
| | | updated = true; |
| | | } |
| | | |
| | | |
| | | return updated; |
| | | } |
| | | |
| | | |
| | | // fraction of duration we've covered |
| | | this.progress = function() { |
| | | return ((this.duration - this.begin) / (this.maxDuration - this.begin)); |
| | | } |
| | | } |
| | | } |
| | | svg.Element.AnimateBase.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // animate element |
| | | svg.Element.animate = function(node) { |
| | | this.base = svg.Element.AnimateBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.calcValue = function() { |
| | | var from = this.attribute('from').numValue(); |
| | | var to = this.attribute('to').numValue(); |
| | | |
| | | |
| | | // tween value linearly |
| | | return from + (to - from) * this.progress(); |
| | | return from + (to - from) * this.progress(); |
| | | }; |
| | | } |
| | | svg.Element.animate.prototype = new svg.Element.AnimateBase; |
| | | |
| | | |
| | | // animate color element |
| | | svg.Element.animateColor = function(node) { |
| | | this.base = svg.Element.AnimateBase; |
| | |
| | | this.calcValue = function() { |
| | | var from = new RGBColor(this.attribute('from').value); |
| | | var to = new RGBColor(this.attribute('to').value); |
| | | |
| | | |
| | | if (from.ok && to.ok) { |
| | | // tween color linearly |
| | | var r = from.r + (to.r - from.r) * this.progress(); |
| | |
| | | }; |
| | | } |
| | | svg.Element.animateColor.prototype = new svg.Element.AnimateBase; |
| | | |
| | | |
| | | // animate transform element |
| | | svg.Element.animateTransform = function(node) { |
| | | this.base = svg.Element.animate; |
| | | this.base(node); |
| | | } |
| | | svg.Element.animateTransform.prototype = new svg.Element.animate; |
| | | |
| | | |
| | | // font element |
| | | svg.Element.font = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | this.horizAdvX = this.attribute('horiz-adv-x').numValue(); |
| | | |
| | | this.horizAdvX = this.attribute('horiz-adv-x').numValue(); |
| | | |
| | | this.isRTL = false; |
| | | this.isArabic = false; |
| | | this.fontFace = null; |
| | | this.missingGlyph = null; |
| | | this.glyphs = []; |
| | | this.glyphs = []; |
| | | for (var i=0; i<this.children.length; i++) { |
| | | var child = this.children[i]; |
| | | if (child.type == 'font-face') { |
| | |
| | | this.glyphs[child.unicode] = child; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | svg.Element.font.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // font-face element |
| | | svg.Element.fontface = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | this.base(node); |
| | | |
| | | this.ascent = this.attribute('ascent').value; |
| | | this.descent = this.attribute('descent').value; |
| | | this.unitsPerEm = this.attribute('units-per-em').numValue(); |
| | | this.unitsPerEm = this.attribute('units-per-em').numValue(); |
| | | } |
| | | svg.Element.fontface.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // missing-glyph element |
| | | svg.Element.missingglyph = function(node) { |
| | | this.base = svg.Element.path; |
| | | this.base(node); |
| | | |
| | | this.base(node); |
| | | |
| | | this.horizAdvX = 0; |
| | | } |
| | | svg.Element.missingglyph.prototype = new svg.Element.path; |
| | | |
| | | |
| | | // glyph element |
| | | svg.Element.glyph = function(node) { |
| | | this.base = svg.Element.path; |
| | | this.base(node); |
| | | |
| | | this.base(node); |
| | | |
| | | this.horizAdvX = this.attribute('horiz-adv-x').numValue(); |
| | | this.unicode = this.attribute('unicode').value; |
| | | this.arabicForm = this.attribute('arabic-form').value; |
| | | } |
| | | svg.Element.glyph.prototype = new svg.Element.path; |
| | | |
| | | |
| | | // text element |
| | | svg.Element.text = function(node) { |
| | | this.base = svg.Element.RenderedElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | if (node != null) { |
| | | // add children |
| | | this.children = []; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | this.baseSetContext = this.setContext; |
| | | this.setContext = function(ctx) { |
| | | this.baseSetContext(ctx); |
| | | if (this.style('dominant-baseline').hasValue()) ctx.textBaseline = this.style('dominant-baseline').value; |
| | | if (this.style('alignment-baseline').hasValue()) ctx.textBaseline = this.style('alignment-baseline').value; |
| | | } |
| | | |
| | | |
| | | this.renderChildren = function(ctx) { |
| | | var textAnchor = this.style('text-anchor').valueOrDefault('start'); |
| | | var x = this.attribute('x').Length.toPixels('x'); |
| | | var y = this.attribute('y').Length.toPixels('y'); |
| | | for (var i=0; i<this.children.length; i++) { |
| | | var child = this.children[i]; |
| | | |
| | | |
| | | if (child.attribute('x').hasValue()) { |
| | | child.x = child.attribute('x').Length.toPixels('x'); |
| | | } |
| | |
| | | if (child.attribute('dx').hasValue()) x += child.attribute('dx').Length.toPixels('x'); |
| | | child.x = x; |
| | | } |
| | | |
| | | |
| | | var childLength = child.measureText(ctx); |
| | | if (textAnchor != 'start' && (i==0 || child.attribute('x').hasValue())) { // new group? |
| | | // loop through rest of children |
| | |
| | | child.x -= (textAnchor == 'end' ? groupLength : groupLength / 2.0); |
| | | } |
| | | x = child.x + childLength; |
| | | |
| | | |
| | | if (child.attribute('y').hasValue()) { |
| | | child.y = child.attribute('y').Length.toPixels('y'); |
| | | } |
| | | else { |
| | | if (child.attribute('dy').hasValue()) y += child.attribute('dy').Length.toPixels('y'); |
| | | child.y = y; |
| | | } |
| | | } |
| | | y = child.y; |
| | | |
| | | |
| | | child.render(ctx); |
| | | } |
| | | } |
| | | } |
| | | svg.Element.text.prototype = new svg.Element.RenderedElementBase; |
| | | |
| | | |
| | | // text base |
| | | svg.Element.TextElementBase = function(node) { |
| | | this.base = svg.Element.RenderedElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.getGlyph = function(font, text, i) { |
| | | var c = text[i]; |
| | | var glyph = null; |
| | | if (font.isArabic) { |
| | | var arabicForm = 'isolated'; |
| | | if ((i==0 || text[i-1]==' ') && i<text.length-2 && text[i+1]!=' ') arabicForm = 'terminal'; |
| | | if ((i==0 || text[i-1]==' ') && i<text.length-2 && text[i+1]!=' ') arabicForm = 'terminal'; |
| | | if (i>0 && text[i-1]!=' ' && i<text.length-2 && text[i+1]!=' ') arabicForm = 'medial'; |
| | | if (i>0 && text[i-1]!=' ' && (i == text.length-1 || text[i+1]==' ')) arabicForm = 'initial'; |
| | | if (typeof(font.glyphs[c]) != 'undefined') { |
| | |
| | | if (glyph == null) glyph = font.missingGlyph; |
| | | return glyph; |
| | | } |
| | | |
| | | |
| | | this.renderChildren = function(ctx) { |
| | | var customFont = this.parent.style('font-family').Definition.getDefinition(); |
| | | if (customFont != null) { |
| | |
| | | var fontStyle = this.parent.style('font-style').valueOrDefault(svg.Font.Parse(svg.ctx.font).fontStyle); |
| | | var text = this.getText(); |
| | | if (customFont.isRTL) text = text.split("").reverse().join(""); |
| | | |
| | | |
| | | var dx = svg.ToNumberArray(this.parent.attribute('dx').value); |
| | | for (var i=0; i<text.length; i++) { |
| | | var glyph = this.getGlyph(customFont, text, i); |
| | |
| | | if (fontStyle == 'italic') ctx.transform(1, 0, -.4, 1, 0, 0); |
| | | ctx.lineWidth = lw; |
| | | ctx.scale(1/scale, -1/scale); |
| | | ctx.translate(-this.x, -this.y); |
| | | |
| | | ctx.translate(-this.x, -this.y); |
| | | |
| | | this.x += fontSize * (glyph.horizAdvX || customFont.horizAdvX) / customFont.fontFace.unitsPerEm; |
| | | if (typeof(dx[i]) != 'undefined' && !isNaN(dx[i])) { |
| | | this.x += dx[i]; |
| | |
| | | } |
| | | return; |
| | | } |
| | | |
| | | |
| | | if (ctx.strokeStyle != '') ctx.strokeText(svg.compressSpaces(this.getText()), this.x, this.y); |
| | | if (ctx.fillStyle != '') ctx.fillText(svg.compressSpaces(this.getText()), this.x, this.y); |
| | | } |
| | | |
| | | |
| | | this.getText = function() { |
| | | // OVERRIDE ME |
| | | } |
| | | |
| | | |
| | | this.measureText = function(ctx) { |
| | | var customFont = this.parent.style('font-family').Definition.getDefinition(); |
| | | if (customFont != null) { |
| | |
| | | } |
| | | return measure; |
| | | } |
| | | |
| | | |
| | | var textToMeasure = svg.compressSpaces(this.getText()); |
| | | if (!ctx.measureText) return textToMeasure.length * 10; |
| | | |
| | | |
| | | ctx.save(); |
| | | this.setContext(ctx); |
| | | var width = ctx.measureText(textToMeasure).width; |
| | |
| | | } |
| | | } |
| | | svg.Element.TextElementBase.prototype = new svg.Element.RenderedElementBase; |
| | | |
| | | // tspan |
| | | |
| | | // tspan |
| | | svg.Element.tspan = function(node) { |
| | | this.base = svg.Element.TextElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.text = node.nodeType == 3 ? node.nodeValue : // text |
| | | node.childNodes.length > 0 ? node.childNodes[0].nodeValue : // element |
| | | node.text; |
| | |
| | | } |
| | | } |
| | | svg.Element.tspan.prototype = new svg.Element.TextElementBase; |
| | | |
| | | |
| | | // tref |
| | | svg.Element.tref = function(node) { |
| | | this.base = svg.Element.TextElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.getText = function() { |
| | | var element = this.attribute('xlink:href').Definition.getDefinition(); |
| | | if (element != null) return element.children[0].getText(); |
| | | } |
| | | } |
| | | svg.Element.tref.prototype = new svg.Element.TextElementBase; |
| | | |
| | | svg.Element.tref.prototype = new svg.Element.TextElementBase; |
| | | |
| | | // a element |
| | | svg.Element.a = function(node) { |
| | | this.base = svg.Element.TextElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.hasText = true; |
| | | for (var i=0; i<node.childNodes.length; i++) { |
| | | if (node.childNodes[i].nodeType != 3) this.hasText = false; |
| | | } |
| | | |
| | | |
| | | // this might contain text |
| | | this.text = this.hasText ? node.childNodes[0].nodeValue : ''; |
| | | this.getText = function() { |
| | | return this.text; |
| | | } |
| | | } |
| | | |
| | | this.baseRenderChildren = this.renderChildren; |
| | | this.renderChildren = function(ctx) { |
| | |
| | | // render as text element |
| | | this.baseRenderChildren(ctx); |
| | | var fontSize = new svg.Property('fontSize', svg.Font.Parse(svg.ctx.font).fontSize); |
| | | svg.Mouse.checkBoundingBox(this, new svg.BoundingBox(this.x, this.y - fontSize.Length.toPixels('y'), this.x + this.measureText(ctx), this.y)); |
| | | svg.Mouse.checkBoundingBox(this, new svg.BoundingBox(this.x, this.y - fontSize.Length.toPixels('y'), this.x + this.measureText(ctx), this.y)); |
| | | } |
| | | else { |
| | | // render as temporary group |
| | |
| | | g.render(ctx); |
| | | } |
| | | } |
| | | |
| | | |
| | | this.onclick = function() { |
| | | window.open(this.attribute('xlink:href').value); |
| | | } |
| | | |
| | | |
| | | this.onmousemove = function() { |
| | | svg.ctx.canvas.style.cursor = 'pointer'; |
| | | } |
| | | } |
| | | svg.Element.a.prototype = new svg.Element.TextElementBase; |
| | | |
| | | svg.Element.a.prototype = new svg.Element.TextElementBase; |
| | | |
| | | // image element |
| | | svg.Element.image = function(node) { |
| | | this.base = svg.Element.RenderedElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | svg.Images.push(this); |
| | | this.img = document.createElement('img'); |
| | | this.loaded = false; |
| | | var that = this; |
| | | this.img.onload = function() { that.loaded = true; } |
| | | this.img.src = this.attribute('xlink:href').value; |
| | | |
| | | |
| | | this.renderChildren = function(ctx) { |
| | | var x = this.attribute('x').Length.toPixels('x'); |
| | | var y = this.attribute('y').Length.toPixels('y'); |
| | | |
| | | |
| | | var width = this.attribute('width').Length.toPixels('x'); |
| | | var height = this.attribute('height').Length.toPixels('y'); |
| | | var height = this.attribute('height').Length.toPixels('y'); |
| | | if (width == 0 || height == 0) return; |
| | | |
| | | |
| | | ctx.save(); |
| | | ctx.translate(x, y); |
| | | svg.AspectRatio(ctx, |
| | |
| | | height, |
| | | this.img.height, |
| | | 0, |
| | | 0); |
| | | ctx.drawImage(this.img, 0, 0); |
| | | 0); |
| | | ctx.drawImage(this.img, 0, 0); |
| | | ctx.restore(); |
| | | } |
| | | } |
| | | svg.Element.image.prototype = new svg.Element.RenderedElementBase; |
| | | |
| | | |
| | | // group element |
| | | svg.Element.g = function(node) { |
| | | this.base = svg.Element.RenderedElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.getBoundingBox = function() { |
| | | var bb = new svg.BoundingBox(); |
| | | for (var i=0; i<this.children.length; i++) { |
| | |
| | | svg.Element.symbol = function(node) { |
| | | this.base = svg.Element.RenderedElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.baseSetContext = this.setContext; |
| | | this.setContext = function(ctx) { |
| | | this.setContext = function(ctx) { |
| | | this.baseSetContext(ctx); |
| | | |
| | | |
| | | // viewbox |
| | | if (this.attribute('viewBox').hasValue()) { |
| | | if (this.attribute('viewBox').hasValue()) { |
| | | var viewBox = svg.ToNumberArray(this.attribute('viewBox').value); |
| | | var minX = viewBox[0]; |
| | | var minY = viewBox[1]; |
| | | width = viewBox[2]; |
| | | height = viewBox[3]; |
| | | |
| | | |
| | | svg.AspectRatio(ctx, |
| | | this.attribute('preserveAspectRatio').value, |
| | | this.attribute('preserveAspectRatio').value, |
| | | this.attribute('width').Length.toPixels('x'), |
| | | width, |
| | | this.attribute('height').Length.toPixels('y'), |
| | |
| | | minX, |
| | | minY); |
| | | |
| | | svg.ViewPort.SetCurrent(viewBox[2], viewBox[3]); |
| | | svg.ViewPort.SetCurrent(viewBox[2], viewBox[3]); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | svg.Element.symbol.prototype = new svg.Element.RenderedElementBase; |
| | | |
| | | svg.Element.symbol.prototype = new svg.Element.RenderedElementBase; |
| | | |
| | | // style element |
| | | svg.Element.style = function(node) { |
| | | svg.Element.style = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | // text, or spaces then CDATA |
| | | var css = node.childNodes[0].nodeValue + (node.childNodes.length > 1 ? node.childNodes[1].nodeValue : ''); |
| | | css = css.replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm, ''); // remove comments |
| | |
| | | } |
| | | } |
| | | svg.Element.style.prototype = new svg.Element.ElementBase; |
| | | |
| | | // use element |
| | | |
| | | // use element |
| | | svg.Element.use = function(node) { |
| | | this.base = svg.Element.RenderedElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.baseSetContext = this.setContext; |
| | | this.setContext = function(ctx) { |
| | | this.baseSetContext(ctx); |
| | | if (this.attribute('x').hasValue()) ctx.translate(this.attribute('x').Length.toPixels('x'), 0); |
| | | if (this.attribute('y').hasValue()) ctx.translate(0, this.attribute('y').Length.toPixels('y')); |
| | | } |
| | | |
| | | |
| | | this.getDefinition = function() { |
| | | var element = this.attribute('xlink:href').Definition.getDefinition(); |
| | | if (this.attribute('width').hasValue()) element.attribute('width', true).value = this.attribute('width').value; |
| | | if (this.attribute('height').hasValue()) element.attribute('height', true).value = this.attribute('height').value; |
| | | return element; |
| | | } |
| | | |
| | | |
| | | this.path = function(ctx) { |
| | | var element = this.getDefinition(); |
| | | if (element != null) element.path(ctx); |
| | | } |
| | | |
| | | |
| | | this.renderChildren = function(ctx) { |
| | | var element = this.getDefinition(); |
| | | if (element != null) element.render(ctx); |
| | | } |
| | | } |
| | | svg.Element.use.prototype = new svg.Element.RenderedElementBase; |
| | | |
| | | |
| | | // mask element |
| | | svg.Element.mask = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.apply = function(ctx, element) { |
| | | // render as temp svg |
| | | // render as temp svg |
| | | var x = this.attribute('x').Length.toPixels('x'); |
| | | var y = this.attribute('y').Length.toPixels('y'); |
| | | var width = this.attribute('width').Length.toPixels('x'); |
| | | var height = this.attribute('height').Length.toPixels('y'); |
| | | |
| | | |
| | | // temporarily remove mask to avoid recursion |
| | | var mask = element.attribute('mask').value; |
| | | element.attribute('mask').value = ''; |
| | | |
| | | |
| | | var cMask = document.createElement('canvas'); |
| | | cMask.width = x + width; |
| | | cMask.height = y + height; |
| | | var maskCtx = cMask.getContext('2d'); |
| | | this.renderChildren(maskCtx); |
| | | |
| | | |
| | | var c = document.createElement('canvas'); |
| | | c.width = x + width; |
| | | c.height = y + height; |
| | |
| | | tempCtx.globalCompositeOperation = 'destination-in'; |
| | | tempCtx.fillStyle = maskCtx.createPattern(cMask, 'no-repeat'); |
| | | tempCtx.fillRect(0, 0, x + width, y + height); |
| | | |
| | | |
| | | ctx.fillStyle = tempCtx.createPattern(c, 'no-repeat'); |
| | | ctx.fillRect(0, 0, x + width, y + height); |
| | | |
| | | |
| | | // reassign mask |
| | | element.attribute('mask').value = mask; |
| | | element.attribute('mask').value = mask; |
| | | } |
| | | |
| | | |
| | | this.render = function(ctx) { |
| | | // NO RENDER |
| | | } |
| | | } |
| | | svg.Element.mask.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // clip element |
| | | svg.Element.clipPath = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.apply = function(ctx) { |
| | | for (var i=0; i<this.children.length; i++) { |
| | | if (this.children[i].path) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | this.render = function(ctx) { |
| | | // NO RENDER |
| | | } |
| | |
| | | svg.Element.filter = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | |
| | | this.apply = function(ctx, element) { |
| | | // render as temp svg |
| | | // render as temp svg |
| | | var bb = element.getBoundingBox(); |
| | | var x = this.attribute('x').Length.toPixels('x'); |
| | | var y = this.attribute('y').Length.toPixels('y'); |
| | |
| | | width = bb.width(); |
| | | height = bb.height(); |
| | | } |
| | | |
| | | |
| | | // temporarily remove filter to avoid recursion |
| | | var filter = element.style('filter').value; |
| | | element.style('filter').value = ''; |
| | | |
| | | |
| | | // max filter distance |
| | | var extraPercent = .20; |
| | | var px = extraPercent * width; |
| | | var py = extraPercent * height; |
| | | |
| | | |
| | | var c = document.createElement('canvas'); |
| | | c.width = width + 2*px; |
| | | c.height = height + 2*py; |
| | | var tempCtx = c.getContext('2d'); |
| | | tempCtx.translate(-x + px, -y + py); |
| | | element.render(tempCtx); |
| | | |
| | | |
| | | // apply filters |
| | | for (var i=0; i<this.children.length; i++) { |
| | | this.children[i].apply(tempCtx, 0, 0, width + 2*px, height + 2*py); |
| | | } |
| | | |
| | | |
| | | // render on me |
| | | ctx.drawImage(c, 0, 0, width + 2*px, height + 2*py, x - px, y - py, width + 2*px, height + 2*py); |
| | | |
| | | |
| | | // reassign filter |
| | | element.style('filter', true).value = filter; |
| | | element.style('filter', true).value = filter; |
| | | } |
| | | |
| | | |
| | | this.render = function(ctx) { |
| | | // NO RENDER |
| | | } |
| | | } |
| | | } |
| | | svg.Element.filter.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | svg.Element.feGaussianBlur = function(node) { |
| | | this.base = svg.Element.ElementBase; |
| | | this.base(node); |
| | | |
| | | this.base(node); |
| | | |
| | | function make_fgauss(sigma) { |
| | | sigma = Math.max(sigma, 0.01); |
| | | var len = Math.ceil(sigma * 4.0) + 1; |
| | | mask = []; |
| | | for (var i = 0; i < len; i++) { |
| | | mask[i] = Math.exp(-0.5 * (i / sigma) * (i / sigma)); |
| | | } |
| | | return mask; |
| | | sigma = Math.max(sigma, 0.01); |
| | | var len = Math.ceil(sigma * 4.0) + 1; |
| | | mask = []; |
| | | for (var i = 0; i < len; i++) { |
| | | mask[i] = Math.exp(-0.5 * (i / sigma) * (i / sigma)); |
| | | } |
| | | return mask; |
| | | } |
| | | |
| | | |
| | | function normalize(mask) { |
| | | var sum = 0; |
| | | for (var i = 1; i < mask.length; i++) { |
| | |
| | | } |
| | | return mask; |
| | | } |
| | | |
| | | |
| | | function convolve_even(src, dst, mask, width, height) { |
| | | for (var y = 0; y < height; y++) { |
| | | for (var x = 0; x < width; x++) { |
| | | var a = imGet(src, x, y, width, height, 3)/255; |
| | | for (var rgba = 0; rgba < 4; rgba++) { |
| | | for (var rgba = 0; rgba < 4; rgba++) { |
| | | var sum = mask[0] * (a==0?255:imGet(src, x, y, width, height, rgba)) * (a==0||rgba==3?1:a); |
| | | for (var i = 1; i < mask.length; i++) { |
| | | var a1 = imGet(src, Math.max(x-i,0), y, width, height, 3)/255; |
| | | var a2 = imGet(src, Math.min(x+i, width-1), y, width, height, 3)/255; |
| | | sum += mask[i] * |
| | | ((a1==0?255:imGet(src, Math.max(x-i,0), y, width, height, rgba)) * (a1==0||rgba==3?1:a1) + |
| | | sum += mask[i] * |
| | | ((a1==0?255:imGet(src, Math.max(x-i,0), y, width, height, rgba)) * (a1==0||rgba==3?1:a1) + |
| | | (a2==0?255:imGet(src, Math.min(x+i, width-1), y, width, height, rgba)) * (a2==0||rgba==3?1:a2)); |
| | | } |
| | | imSet(dst, y, x, height, width, rgba, sum); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | function imGet(img, x, y, width, height, rgba) { |
| | | return img[y*width*4 + x*4 + rgba]; |
| | | } |
| | | |
| | | |
| | | function imSet(img, x, y, width, height, rgba, val) { |
| | | img[y*width*4 + x*4 + rgba] = val; |
| | | } |
| | | |
| | | |
| | | function blur(ctx, width, height, sigma) |
| | | { |
| | | var srcData = ctx.getImageData(0, 0, width, height); |
| | |
| | | convolve_even(tmp, srcData.data, mask, height, width); |
| | | ctx.clearRect(0, 0, width, height); |
| | | ctx.putImageData(srcData, 0, 0); |
| | | } |
| | | |
| | | } |
| | | |
| | | this.apply = function(ctx, x, y, width, height) { |
| | | // assuming x==0 && y==0 for now |
| | | blur(ctx, width, height, this.attribute('stdDeviation').numValue()); |
| | | } |
| | | } |
| | | svg.Element.filter.prototype = new svg.Element.feGaussianBlur; |
| | | |
| | | |
| | | // title element, do nothing |
| | | svg.Element.title = function(node) { |
| | | } |
| | |
| | | // desc element, do nothing |
| | | svg.Element.desc = function(node) { |
| | | } |
| | | svg.Element.desc.prototype = new svg.Element.ElementBase; |
| | | |
| | | svg.Element.desc.prototype = new svg.Element.ElementBase; |
| | | |
| | | svg.Element.MISSING = function(node) { |
| | | console.log('ERROR: Element \'' + node.nodeName + '\' not yet implemented.'); |
| | | } |
| | | svg.Element.MISSING.prototype = new svg.Element.ElementBase; |
| | | |
| | | |
| | | // element factory |
| | | svg.CreateElement = function(node) { |
| | | svg.CreateElement = function(node) { |
| | | var className = node.nodeName.replace(/^[^:]+:/,''); // remove namespace |
| | | className = className.replace(/\-/g,''); // remove dashes |
| | | var e = null; |
| | |
| | | e.type = node.nodeName; |
| | | return e; |
| | | } |
| | | |
| | | |
| | | // load from url |
| | | svg.load = function(ctx, url) { |
| | | svg.loadXml(ctx, svg.ajax(url)); |
| | | } |
| | | |
| | | |
| | | // load from xml |
| | | svg.loadXml = function(ctx, xml) { |
| | | svg.loadXmlDoc(ctx, svg.parseXml(xml)); |
| | | } |
| | | |
| | | |
| | | svg.loadXmlDoc = function(ctx, dom) { |
| | | svg.init(ctx); |
| | | |
| | | |
| | | var mapXY = function(p) { |
| | | var e = ctx.canvas; |
| | | while (e) { |
| | |
| | | if (window.scrollY) p.y += window.scrollY; |
| | | return p; |
| | | } |
| | | |
| | | |
| | | // bind mouse |
| | | if (svg.opts['ignoreMouse'] != true) { |
| | | ctx.canvas.onclick = function(e) { |
| | |
| | | svg.Mouse.onmousemove(p.x, p.y); |
| | | }; |
| | | } |
| | | |
| | | |
| | | var e = svg.CreateElement(dom.documentElement); |
| | | e.root = true; |
| | | |
| | | |
| | | // render loop |
| | | var isFirstRender = true; |
| | | var draw = function() { |
| | | svg.ViewPort.Clear(); |
| | | if (ctx.canvas.parentNode) svg.ViewPort.SetCurrent(ctx.canvas.parentNode.clientWidth, ctx.canvas.parentNode.clientHeight); |
| | | |
| | | |
| | | if (svg.opts['ignoreDimensions'] != true) { |
| | | // set canvas size |
| | | if (e.style('width').hasValue()) { |
| | |
| | | } |
| | | var cWidth = ctx.canvas.clientWidth || ctx.canvas.width; |
| | | var cHeight = ctx.canvas.clientHeight || ctx.canvas.height; |
| | | svg.ViewPort.SetCurrent(cWidth, cHeight); |
| | | |
| | | svg.ViewPort.SetCurrent(cWidth, cHeight); |
| | | |
| | | if (svg.opts != null && svg.opts['offsetX'] != null) e.attribute('x', true).value = svg.opts['offsetX']; |
| | | if (svg.opts != null && svg.opts['offsetY'] != null) e.attribute('y', true).value = svg.opts['offsetY']; |
| | | if (svg.opts != null && svg.opts['scaleWidth'] != null && svg.opts['scaleHeight'] != null) { |
| | | var xRatio = 1, yRatio = 1; |
| | | if (e.attribute('width').hasValue()) xRatio = e.attribute('width').Length.toPixels('x') / svg.opts['scaleWidth']; |
| | | if (e.attribute('height').hasValue()) yRatio = e.attribute('height').Length.toPixels('y') / svg.opts['scaleHeight']; |
| | | |
| | | |
| | | e.attribute('width', true).value = svg.opts['scaleWidth']; |
| | | e.attribute('height', true).value = svg.opts['scaleHeight']; |
| | | e.attribute('height', true).value = svg.opts['scaleHeight']; |
| | | e.attribute('viewBox', true).value = '0 0 ' + (cWidth * xRatio) + ' ' + (cHeight * yRatio); |
| | | e.attribute('preserveAspectRatio', true).value = 'none'; |
| | | } |
| | | |
| | | |
| | | // clear and render |
| | | if (svg.opts['ignoreClear'] != true) { |
| | | ctx.clearRect(0, 0, cWidth, cHeight); |
| | |
| | | if (isFirstRender) { |
| | | isFirstRender = false; |
| | | if (svg.opts != null && typeof(svg.opts['renderCallback']) == 'function') svg.opts['renderCallback'](); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | var waitingForImages = true; |
| | | if (svg.ImagesLoaded()) { |
| | | waitingForImages = false; |
| | | draw(); |
| | | } |
| | | svg.intervalID = setInterval(function() { |
| | | svg.intervalID = setInterval(function() { |
| | | var needUpdate = false; |
| | | |
| | | |
| | | if (waitingForImages && svg.ImagesLoaded()) { |
| | | waitingForImages = false; |
| | | needUpdate = true; |
| | | } |
| | | |
| | | |
| | | // need update from mouse events? |
| | | if (svg.opts['ignoreMouse'] != true) { |
| | | needUpdate = needUpdate | svg.Mouse.hasEvents(); |
| | | } |
| | | |
| | | |
| | | // need update from animations? |
| | | if (svg.opts['ignoreAnimation'] != true) { |
| | | for (var i=0; i<svg.Animations.length; i++) { |
| | | needUpdate = needUpdate | svg.Animations[i].update(1000 / svg.FRAMERATE); |
| | | } |
| | | } |
| | | |
| | | |
| | | // need update from redraw? |
| | | if (svg.opts != null && typeof(svg.opts['forceRedraw']) == 'function') { |
| | | if (svg.opts['forceRedraw']() == true) needUpdate = true; |
| | | } |
| | | |
| | | |
| | | // render if needed |
| | | if (needUpdate) { |
| | | draw(); |
| | | draw(); |
| | | svg.Mouse.runEvents(); // run and clear our events |
| | | } |
| | | }, 1000 / svg.FRAMERATE); |
| | | } |
| | | |
| | | |
| | | svg.stop = function() { |
| | | if (svg.intervalID) { |
| | | clearInterval(svg.intervalID); |
| | | } |
| | | } |
| | | |
| | | |
| | | svg.Mouse = new (function() { |
| | | this.events = []; |
| | | this.hasEvents = function() { return this.events.length != 0; } |
| | | |
| | | |
| | | this.onclick = function(x, y) { |
| | | this.events.push({ type: 'onclick', x: x, y: y, |
| | | this.events.push({ type: 'onclick', x: x, y: y, |
| | | run: function(e) { if (e.onclick) e.onclick(); } |
| | | }); |
| | | } |
| | | |
| | | |
| | | this.onmousemove = function(x, y) { |
| | | this.events.push({ type: 'onmousemove', x: x, y: y, |
| | | run: function(e) { if (e.onmousemove) e.onmousemove(); } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | this.eventElements = []; |
| | | |
| | | |
| | | this.checkPath = function(element, ctx) { |
| | | for (var i=0; i<this.events.length; i++) { |
| | | var e = this.events[i]; |
| | | if (ctx.isPointInPath && ctx.isPointInPath(e.x, e.y)) this.eventElements[i] = element; |
| | | } |
| | | } |
| | | |
| | | |
| | | this.checkBoundingBox = function(element, bb) { |
| | | for (var i=0; i<this.events.length; i++) { |
| | | var e = this.events[i]; |
| | | if (bb.isPointInBox(e.x, e.y)) this.eventElements[i] = element; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | this.runEvents = function() { |
| | | svg.ctx.canvas.style.cursor = ''; |
| | | |
| | | |
| | | for (var i=0; i<this.events.length; i++) { |
| | | var e = this.events[i]; |
| | | var element = this.eventElements[i]; |
| | |
| | | e.run(element); |
| | | element = element.parent; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | // done running, clear |
| | | this.events = []; |
| | | this.events = []; |
| | | this.eventElements = []; |
| | | } |
| | | }); |
| | | |
| | | |
| | | return svg; |
| | | } |
| | | })(); |
| | | |
| | | if (CanvasRenderingContext2D) { |
| | | CanvasRenderingContext2D.prototype.drawSvg = function(s, dx, dy, dw, dh) { |
| | | canvg(this.canvas, s, { |
| | | ignoreMouse: true, |
| | | ignoreAnimation: true, |
| | | ignoreDimensions: true, |
| | | ignoreClear: true, |
| | | offsetX: dx, |
| | | offsetY: dy, |
| | | scaleWidth: dw, |
| | | canvg(this.canvas, s, { |
| | | ignoreMouse: true, |
| | | ignoreAnimation: true, |
| | | ignoreDimensions: true, |
| | | ignoreClear: true, |
| | | offsetX: dx, |
| | | offsetY: dy, |
| | | scaleWidth: dw, |
| | | scaleHeight: dh |
| | | }); |
| | | } |
| | | } |
| | | } |
| | |
| | | /** |
| | | * Package: svgedit.contextmenu |
| | | * |
| | | * |
| | | * Licensed under the Apache License, Version 2 |
| | | * |
| | | * |
| | | * Author: Adam Bender |
| | | */ |
| | | // Dependencies: |
| | |
| | | $("#cmenu_canvas").append("<li class='separator'>"); |
| | | } |
| | | var shortcut = menuItem.shortcut || ""; |
| | | $("#cmenu_canvas").append("<li class='disabled'><a href='#" + menuItem.id + "'>" |
| | | $("#cmenu_canvas").append("<li class='disabled'><a href='#" + menuItem.id + "'>" |
| | | + menuItem.label + "<span class='shortcut'>" |
| | | + shortcut + "</span></a></li>"); |
| | | } |
| | |
| | | var menuItemIsValid = function(menuItem) { |
| | | return menuItem && menuItem.id && menuItem.label && menuItem.action && typeof menuItem.action == 'function'; |
| | | } |
| | | |
| | | |
| | | // Defer injection to wait out initial menu processing. This probably goes away once all context |
| | | // menu behavior is brought here. |
| | | methodDraw.ready(function() { |
| | |
| | | var doc = $(document); |
| | | |
| | | $.extend($.fn, { |
| | | |
| | | |
| | | contextMenu: function(o, callback) { |
| | | // Defaults |
| | | if( o.menu == undefined ) return false; |
| | |
| | | $(this).each( function() { |
| | | var el = $(this); |
| | | var offset = $(el).offset(); |
| | | |
| | | |
| | | var menu = $('#' + o.menu); |
| | | |
| | | // Add contextMenu class |
| | |
| | | open_context_menu(e,e, srcElement); |
| | | }) |
| | | } |
| | | |
| | | |
| | | var open_context_menu = function(e, evt, srcElement) { |
| | | if (typeof evt == 'undefined') evt = e; |
| | | e.stopPropagation(); |
| | | |
| | | |
| | | // Get this context menu |
| | | |
| | | |
| | | if( el.hasClass('disabled') || evt.altKey ) return false; |
| | | |
| | | |
| | | // Detect mouse position |
| | | var d = {}, x = e.pageX, y = e.pageY; |
| | | if (svgedit.browser.isTouch()) var d = {}, x = e.originalEvent.touches[0].pageX, y = e.originalEvent.touches[0].pageY; |
| | | |
| | | var x_off = win.width() - menu.width(), |
| | | |
| | | var x_off = win.width() - menu.width(), |
| | | y_off = win.height() - menu.height(); |
| | | |
| | | |
| | | if(x > x_off - 15) x = x_off-15; |
| | | if(y > y_off - 30) y = y_off-30; // 30 is needed to prevent scrollbars in FF |
| | | |
| | | if(svgedit.browser.isTouch()) |
| | | |
| | | if(svgedit.browser.isTouch()) |
| | | y = y - (menu.height()/2) |
| | | |
| | | |
| | | // Show the menu |
| | | doc.unbind('click'); |
| | | menu.css({ top: y, left: x }).fadeIn(o.inSpeed); |
| | |
| | | }).mouseout( function() { |
| | | menu.find('LI.hover').removeClass('hover'); |
| | | }); |
| | | |
| | | |
| | | // Keyboard |
| | | doc.keypress( function(e) { |
| | | switch( e.keyCode ) { |
| | |
| | | break |
| | | } |
| | | }); |
| | | |
| | | |
| | | // When items are selected |
| | | menu.find('A').unbind('mouseup'); |
| | | menu.find('LI:not(.disabled) A').mouseup( function() { |
| | |
| | | if( callback ) callback( $(this).attr('href').substr(1), $(srcElement), {x: x - offset.left, y: y - offset.top, docX: x, docY: y} ); |
| | | return false; |
| | | }); |
| | | |
| | | |
| | | // Hide bindings |
| | | setTimeout( function() { // Delay for Mozilla |
| | | doc.click( function() { |
| | |
| | | }); |
| | | }, 0); |
| | | } |
| | | |
| | | |
| | | |
| | | // Disable browser context menu (requires both selectors to work in IE/Safari + FF/Chrome) |
| | | $(el).add($('UL.contextMenu')).bind('contextmenu', function() { return false; }); |
| | | |
| | | |
| | | }); |
| | | return $(this); |
| | | }, |
| | | |
| | | |
| | | // Disable context menu items on the fly |
| | | disableContextMenuItems: function(o) { |
| | | if( o == undefined ) { |
| | |
| | | var d = o.split(','); |
| | | for( var i = 0; i < d.length; i++ ) { |
| | | $(this).find('A[href="' + d[i] + '"]').parent().addClass('disabled'); |
| | | |
| | | |
| | | } |
| | | } |
| | | }); |
| | | return( $(this) ); |
| | | }, |
| | | |
| | | |
| | | // Enable context menu items on the fly |
| | | enableContextMenuItems: function(o) { |
| | | if( o == undefined ) { |
| | |
| | | var d = o.split(','); |
| | | for( var i = 0; i < d.length; i++ ) { |
| | | $(this).find('A[href="' + d[i] + '"]').parent().removeClass('disabled'); |
| | | |
| | | |
| | | } |
| | | } |
| | | }); |
| | | return( $(this) ); |
| | | }, |
| | | |
| | | |
| | | // Disable context menu(s) |
| | | disableContextMenu: function() { |
| | | $(this).each( function() { |
| | |
| | | }); |
| | | return( $(this) ); |
| | | }, |
| | | |
| | | |
| | | // Enable context menu(s) |
| | | enableContextMenu: function() { |
| | | $(this).each( function() { |
| | |
| | | }); |
| | | return( $(this) ); |
| | | }, |
| | | |
| | | |
| | | // Destroy context menu(s) |
| | | destroyContextMenu: function() { |
| | | // Destroy specified context menus |
| | |
| | | }); |
| | | return( $(this) ); |
| | | } |
| | | |
| | | |
| | | }); |
| | | })(jQuery); |
| | | })(jQuery); |
| | |
| | | define([], function() { |
| | | return saveAs; |
| | | }); |
| | | } |
| | | } |
| | |
| | | |
| | | Apache License |
| | | Version 2.0, January 2004 |
| | | http://www.apache.org/licenses/ |
| | | |
| | | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION |
| | | |
| | | 1. Definitions. |
| | | |
| | | "License" shall mean the terms and conditions for use, reproduction, |
| | | and distribution as defined by Sections 1 through 9 of this document. |
| | | |
| | | "Licensor" shall mean the copyright owner or entity authorized by |
| | | the copyright owner that is granting the License. |
| | | |
| | | "Legal Entity" shall mean the union of the acting entity and all |
| | | other entities that control, are controlled by, or are under common |
| | | control with that entity. For the purposes of this definition, |
| | | "control" means (i) the power, direct or indirect, to cause the |
| | | direction or management of such entity, whether by contract or |
| | | otherwise, or (ii) ownership of fifty percent (50%) or more of the |
| | | outstanding shares, or (iii) beneficial ownership of such entity. |
| | | |
| | | "You" (or "Your") shall mean an individual or Legal Entity |
| | | exercising permissions granted by this License. |
| | | |
| | | "Source" form shall mean the preferred form for making modifications, |
| | | including but not limited to software source code, documentation |
| | | source, and configuration files. |
| | | |
| | | "Object" form shall mean any form resulting from mechanical |
| | | transformation or translation of a Source form, including but |
| | | not limited to compiled object code, generated documentation, |
| | | and conversions to other media types. |
| | | |
| | | "Work" shall mean the work of authorship, whether in Source or |
| | | Object form, made available under the License, as indicated by a |
| | | copyright notice that is included in or attached to the work |
| | | (an example is provided in the Appendix below). |
| | | |
| | | "Derivative Works" shall mean any work, whether in Source or Object |
| | | form, that is based on (or derived from) the Work and for which the |
| | | editorial revisions, annotations, elaborations, or other modifications |
| | | represent, as a whole, an original work of authorship. For the purposes |
| | | of this License, Derivative Works shall not include works that remain |
| | | separable from, or merely link (or bind by name) to the interfaces of, |
| | | the Work and Derivative Works thereof. |
| | | |
| | | "Contribution" shall mean any work of authorship, including |
| | | the original version of the Work and any modifications or additions |
| | | to that Work or Derivative Works thereof, that is intentionally |
| | | submitted to Licensor for inclusion in the Work by the copyright owner |
| | | or by an individual or Legal Entity authorized to submit on behalf of |
| | | the copyright owner. For the purposes of this definition, "submitted" |
| | | means any form of electronic, verbal, or written communication sent |
| | | to the Licensor or its representatives, including but not limited to |
| | | communication on electronic mailing lists, source code control systems, |
| | | and issue tracking systems that are managed by, or on behalf of, the |
| | | Licensor for the purpose of discussing and improving the Work, but |
| | | excluding communication that is conspicuously marked or otherwise |
| | | designated in writing by the copyright owner as "Not a Contribution." |
| | | |
| | | "Contributor" shall mean Licensor and any individual or Legal Entity |
| | | on behalf of whom a Contribution has been received by Licensor and |
| | | subsequently incorporated within the Work. |
| | | |
| | | 2. Grant of Copyright License. Subject to the terms and conditions of |
| | | this License, each Contributor hereby grants to You a perpetual, |
| | | worldwide, non-exclusive, no-charge, royalty-free, irrevocable |
| | | copyright license to reproduce, prepare Derivative Works of, |
| | | publicly display, publicly perform, sublicense, and distribute the |
| | | Work and such Derivative Works in Source or Object form. |
| | | |
| | | 3. Grant of Patent License. Subject to the terms and conditions of |
| | | this License, each Contributor hereby grants to You a perpetual, |
| | | worldwide, non-exclusive, no-charge, royalty-free, irrevocable |
| | | (except as stated in this section) patent license to make, have made, |
| | | use, offer to sell, sell, import, and otherwise transfer the Work, |
| | | where such license applies only to those patent claims licensable |
| | | by such Contributor that are necessarily infringed by their |
| | | Contribution(s) alone or by combination of their Contribution(s) |
| | | with the Work to which such Contribution(s) was submitted. If You |
| | | institute patent litigation against any entity (including a |
| | | cross-claim or counterclaim in a lawsuit) alleging that the Work |
| | | or a Contribution incorporated within the Work constitutes direct |
| | | or contributory patent infringement, then any patent licenses |
| | | granted to You under this License for that Work shall terminate |
| | | as of the date such litigation is filed. |
| | | |
| | | 4. Redistribution. You may reproduce and distribute copies of the |
| | | Work or Derivative Works thereof in any medium, with or without |
| | | modifications, and in Source or Object form, provided that You |
| | | meet the following conditions: |
| | | |
| | | (a) You must give any other recipients of the Work or |
| | | Derivative Works a copy of this License; and |
| | | |
| | | (b) You must cause any modified files to carry prominent notices |
| | | stating that You changed the files; and |
| | | |
| | | (c) You must retain, in the Source form of any Derivative Works |
| | | that You distribute, all copyright, patent, trademark, and |
| | | attribution notices from the Source form of the Work, |
| | | excluding those notices that do not pertain to any part of |
| | | the Derivative Works; and |
| | | |
| | | (d) If the Work includes a "NOTICE" text file as part of its |
| | | distribution, then any Derivative Works that You distribute must |
| | | include a readable copy of the attribution notices contained |
| | | within such NOTICE file, excluding those notices that do not |
| | | pertain to any part of the Derivative Works, in at least one |
| | | of the following places: within a NOTICE text file distributed |
| | | as part of the Derivative Works; within the Source form or |
| | | documentation, if provided along with the Derivative Works; or, |
| | | within a display generated by the Derivative Works, if and |
| | | wherever such third-party notices normally appear. The contents |
| | | of the NOTICE file are for informational purposes only and |
| | | do not modify the License. You may add Your own attribution |
| | | notices within Derivative Works that You distribute, alongside |
| | | or as an addendum to the NOTICE text from the Work, provided |
| | | that such additional attribution notices cannot be construed |
| | | as modifying the License. |
| | | |
| | | You may add Your own copyright statement to Your modifications and |
| | | may provide additional or different license terms and conditions |
| | | for use, reproduction, or distribution of Your modifications, or |
| | | for any such Derivative Works as a whole, provided Your use, |
| | | reproduction, and distribution of the Work otherwise complies with |
| | | the conditions stated in this License. |
| | | |
| | | 5. Submission of Contributions. Unless You explicitly state otherwise, |
| | | any Contribution intentionally submitted for inclusion in the Work |
| | | by You to the Licensor shall be under the terms and conditions of |
| | | this License, without any additional terms or conditions. |
| | | Notwithstanding the above, nothing herein shall supersede or modify |
| | | the terms of any separate license agreement you may have executed |
| | | with Licensor regarding such Contributions. |
| | | |
| | | 6. Trademarks. This License does not grant permission to use the trade |
| | | names, trademarks, service marks, or product names of the Licensor, |
| | | except as required for reasonable and customary use in describing the |
| | | origin of the Work and reproducing the content of the NOTICE file. |
| | | |
| | | 7. Disclaimer of Warranty. Unless required by applicable law or |
| | | agreed to in writing, Licensor provides the Work (and each |
| | | Contributor provides its Contributions) on an "AS IS" BASIS, |
| | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| | | implied, including, without limitation, any warranties or conditions |
| | | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A |
| | | PARTICULAR PURPOSE. You are solely responsible for determining the |
| | | appropriateness of using or redistributing the Work and assume any |
| | | risks associated with Your exercise of permissions under this License. |
| | | |
| | | 8. Limitation of Liability. In no event and under no legal theory, |
| | | whether in tort (including negligence), contract, or otherwise, |
| | | unless required by applicable law (such as deliberate and grossly |
| | | negligent acts) or agreed to in writing, shall any Contributor be |
| | | liable to You for damages, including any direct, indirect, special, |
| | | incidental, or consequential damages of any character arising as a |
| | | result of this License or out of the use or inability to use the |
| | | Work (including but not limited to damages for loss of goodwill, |
| | | work stoppage, computer failure or malfunction, or any and all |
| | | other commercial damages or losses), even if such Contributor |
| | | has been advised of the possibility of such damages. |
| | | |
| | | 9. Accepting Warranty or Additional Liability. While redistributing |
| | | the Work or Derivative Works thereof, You may choose to offer, |
| | | and charge a fee for, acceptance of support, warranty, indemnity, |
| | | or other liability obligations and/or rights consistent with this |
| | | License. However, in accepting such obligations, You may act only |
| | | on Your own behalf and on Your sole responsibility, not on behalf |
| | | of any other Contributor, and only if You agree to indemnify, |
| | | defend, and hold each Contributor harmless for any liability |
| | | incurred by, or claims asserted against, such Contributor by reason |
| | | of your accepting any such warranty or additional liability. |
| | | |
| | | END OF TERMS AND CONDITIONS |
| | | |
| | | APPENDIX: How to apply the Apache License to your work. |
| | | |
| | | To apply the Apache License to your work, attach the following |
| | | boilerplate notice, with the fields enclosed by brackets "[]" |
| | | replaced with your own identifying information. (Don't include |
| | | the brackets!) The text should be enclosed in the appropriate |
| | | comment syntax for the file format. We also recommend that a |
| | | file or class name and description of purpose be included on the |
| | | same "printed page" as the copyright notice for easier |
| | | identification within third-party archives. |
| | | |
| | | Copyright [yyyy] [name of copyright owner] |
| | | |
| | | Licensed under the Apache License, Version 2.0 (the "License"); |
| | | you may not use this file except in compliance with the License. |
| | | You may obtain a copy of the License at |
| | | |
| | | http://www.apache.org/licenses/LICENSE-2.0 |
| | | |
| | | Unless required by applicable law or agreed to in writing, software |
| | | distributed under the License is distributed on an "AS IS" BASIS, |
| | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | See the License for the specific language governing permissions and |
| | | limitations under the License. |
| | |
| | | jGraduate - A jQuery plugin for picking gradients |
| | | |
| | | Licensed under the Apache License 2. See LICENSE for more information. |
| | |
| | | } |
| | | |
| | | #svg_editor .jPicker div.Map { |
| | | |
| | | |
| | | border: solid #000 1px; |
| | | |
| | | |
| | | cursor: crosshair; |
| | | |
| | | |
| | | height: 260px; |
| | | |
| | | |
| | | margin: 0; |
| | | |
| | | |
| | | overflow: hidden; |
| | | |
| | | |
| | | padding: 0; |
| | | |
| | | |
| | | position: relative; |
| | | |
| | | |
| | | width: 260px; |
| | | |
| | | |
| | | } |
| | | #svg_editor .jPicker div[class="Map"] { |
| | | height: 256px; |
| | |
| | | /* |
| | | /* |
| | | * jGraduate Default CSS |
| | | * |
| | | * |
| | | * Copyright (c) 2010 Jeff Schiller |
| | | * http://blog.codedread.com/ |
| | | * |
| | |
| | | display: none; |
| | | } |
| | | |
| | | .jGraduate_gradPick { |
| | | .jGraduate_gradPick { |
| | | display: none; |
| | | overflow: visible; |
| | | /* position: relative;*/ |
| | |
| | | } |
| | | div.jGraduate_GradContainer { |
| | | border: solid #000 1px; |
| | | background-image: url(../images/map-opacity.png); |
| | | background-image: url(../images/map-opacity.png); |
| | | background-position: 0px 0px; |
| | | height: 256px; |
| | | width: 256px; |
| | |
| | | div.jGraduate_stopPicker { |
| | | position: absolute; |
| | | display: none; |
| | | background: |
| | | background: |
| | | white; |
| | | padding: 20px; |
| | | border-radius: 3px; |
| | | width: 530px; |
| | | height: 300px; |
| | | box-shadow: 0 5px 25px |
| | | box-shadow: 0 5px 25px |
| | | black; |
| | | } |
| | | |
| | |
| | | s, |
| | | v, |
| | | changeEvents = new Array(), |
| | | fireChangeEvents = |
| | | fireChangeEvents = |
| | | function(context) |
| | | { |
| | | for (var i = 0; i < changeEvents.length; i++) changeEvents[i].call($this, $this, context); |
| | |
| | | } |
| | | } |
| | | }; |
| | | })(jQuery, '1.1.6'); |
| | | })(jQuery, '1.1.6'); |
| | |
| | | window: { title: "Pick the start color and opacity for the gradient" }, |
| | | images: { clientPath: "images/" }, |
| | | paint: a Paint object, |
| | | newstop: String of value "same", "inverse", "black" or "white" |
| | | newstop: String of value "same", "inverse", "black" or "white" |
| | | OR object with one or both values {color: #Hex color, opac: number 0-1} |
| | | } |
| | | |
| | | |
| | | - the Paint object is: |
| | | Paint { |
| | | type: String, // one of "none", "solidColor", "linearGradient", "radialGradient" |
| | |
| | | |
| | | * |
| | | */ |
| | | |
| | | |
| | | (function() { |
| | | |
| | | |
| | | var ns = { svg: 'http://www.w3.org/2000/svg', xlink: 'http://www.w3.org/1999/xlink' }; |
| | | if(!window.console) { |
| | | window.console = new function() { |
| | |
| | | }; |
| | | } |
| | | |
| | | $.jGraduate = { |
| | | $.jGraduate = { |
| | | Paint: |
| | | function(opt) { |
| | | var options = opt || {}; |
| | |
| | | var $this = $(this), $settings = $.extend(true, {}, jQuery.fn.jGraduateDefaults, options), |
| | | id = $this.attr('id'), |
| | | idref = '#'+$this.attr('id')+' '; |
| | | |
| | | |
| | | if (!idref) |
| | | { |
| | | alert('Container element must have an id attribute to maintain unique id strings for sub-elements.'); |
| | | return; |
| | | } |
| | | |
| | | |
| | | var okClicked = function() { |
| | | switch ( $this.paint.type ) { |
| | | case "radialGradient": |
| | |
| | | if ($this.paint.type == "none") { |
| | | $this.paint = $.jGraduate.Paint({solidColor: 'ffffff'}); |
| | | } |
| | | |
| | | |
| | | $this.addClass('jGraduate_Picker'); |
| | | $this.html('<ul class="jGraduate_tabs">' + |
| | | '<li class="jGraduate_tab_color jGraduate_tab_current" data-type="col">Solid Color</li>' + |
| | |
| | | '<div class="jGraduate_gradPick"></div>' + |
| | | '<div class="jGraduate_LightBox"></div>' + |
| | | '<div id="' + id + '_jGraduate_stopPicker" class="jGraduate_stopPicker"></div>' |
| | | |
| | | |
| | | |
| | | |
| | | ); |
| | | var colPicker = $(idref + '> .jGraduate_colPick'); |
| | | var gradPicker = $(idref + '> .jGraduate_gradPick'); |
| | | |
| | | |
| | | gradPicker.html( |
| | | '<div id="' + id + '_jGraduate_Swatch" class="jGraduate_Swatch">' + |
| | | '<h2 class="jGraduate_Title">' + $settings.window.pickerTitle + '</h2>' + |
| | | '<div id="' + id + '_jGraduate_GradContainer" class="jGraduate_GradContainer"></div>' + |
| | | '<div id="' + id + '_jGraduate_StopSlider" class="jGraduate_StopSlider"></div>' + |
| | | '</div>' + |
| | | '</div>' + |
| | | '<div class="jGraduate_Form jGraduate_Points jGraduate_lg_field">' + |
| | | '<div class="jGraduate_StopSection">' + |
| | | '<label class="jGraduate_Form_Heading">Begin Point</label>' + |
| | |
| | | '<option value=pad selected>Pad</option>' + |
| | | '<option value=reflect>Reflect</option>' + |
| | | '<option value=repeat>Repeat</option>' + |
| | | '</select>' + |
| | | '</select>' + |
| | | '</div>' + |
| | | '</div>' + |
| | | '<div class="jGraduate_Form">' + |
| | |
| | | '<div id="' + id + '_jGraduate_Radius" class="jGraduate_SliderBar jGraduate_Radius" title="Click to set radius">' + |
| | | '<img id="' + id + '_jGraduate_RadiusArrows" class="jGraduate_RadiusArrows" src="' + $settings.images.clientPath + 'rangearrows2.gif">' + |
| | | '</div>' + |
| | | '<label><input type="text" id="' + id + '_jGraduate_RadiusInput" size="3" value="100"/>%</label>' + |
| | | '<label><input type="text" id="' + id + '_jGraduate_RadiusInput" size="3" value="100"/>%</label>' + |
| | | '</div>' + |
| | | '<div class="jGraduate_Slider jGraduate_EllipField jGraduate_rg_field">' + |
| | | '<label class="prelabel">Ellip:</label>' + |
| | | '<div id="' + id + '_jGraduate_Ellip" class="jGraduate_SliderBar jGraduate_Ellip" title="Click to set Ellip">' + |
| | | '<img id="' + id + '_jGraduate_EllipArrows" class="jGraduate_EllipArrows" src="' + $settings.images.clientPath + 'rangearrows2.gif">' + |
| | | '</div>' + |
| | | '<label><input type="text" id="' + id + '_jGraduate_EllipInput" size="3" value="0"/>%</label>' + |
| | | '<label><input type="text" id="' + id + '_jGraduate_EllipInput" size="3" value="0"/>%</label>' + |
| | | '</div>' + |
| | | '<div class="jGraduate_Slider jGraduate_AngleField jGraduate_rg_field">' + |
| | | '<label class="prelabel">Angle:</label>' + |
| | | '<div id="' + id + '_jGraduate_Angle" class="jGraduate_SliderBar jGraduate_Angle" title="Click to set Angle">' + |
| | | '<img id="' + id + '_jGraduate_AngleArrows" class="jGraduate_AngleArrows" src="' + $settings.images.clientPath + 'rangearrows2.gif">' + |
| | | '</div>' + |
| | | '<label><input type="text" id="' + id + '_jGraduate_AngleInput" size="3" value="0"/>º </label>' + |
| | | '<label><input type="text" id="' + id + '_jGraduate_AngleInput" size="3" value="0"/>º </label>' + |
| | | '</div>' + |
| | | '<div class="jGraduate_Slider jGraduate_OpacField">' + |
| | | '<label class="prelabel">Opac:</label>' + |
| | | '<div id="' + id + '_jGraduate_Opac" class="jGraduate_SliderBar jGraduate_Opac" title="Click to set Opac">' + |
| | | '<img id="' + id + '_jGraduate_OpacArrows" class="jGraduate_OpacArrows" src="' + $settings.images.clientPath + 'rangearrows2.gif">' + |
| | | '</div>' + |
| | | '<label><input type="text" id="' + id + '_jGraduate_OpacInput" size="3" value="100"/>%</label>' + |
| | | '<label><input type="text" id="' + id + '_jGraduate_OpacInput" size="3" value="100"/>%</label>' + |
| | | '</div>' + |
| | | '</div>' + |
| | | '<div class="jGraduate_OkCancel">' + |
| | | '<input type="button" id="' + id + '_jGraduate_Ok" class="jGraduate_Ok" value="OK"/>' + |
| | | '<input type="button" id="' + id + '_jGraduate_Cancel" class="jGraduate_Cancel" value="Cancel"/>' + |
| | | '</div>'); |
| | | |
| | | |
| | | // -------------- |
| | | // Set up all the SVG elements (the gradient, stops and rectangle) |
| | | var MAX = 256, MARGINX = 0, MARGINY = 0, STOP_RADIUS = 15/2, |
| | | SIZEX = MAX - 2*MARGINX, SIZEY = MAX - 2*MARGINY; |
| | | |
| | | var curType, curGradient, previewRect; |
| | | |
| | | |
| | | var curType, curGradient, previewRect; |
| | | |
| | | var attr_input = {}; |
| | | |
| | | |
| | | var SLIDERW = 145; |
| | | $('.jGraduate_SliderBar').width(SLIDERW); |
| | | |
| | | |
| | | var container = $('#' + id+'_jGraduate_GradContainer')[0]; |
| | | |
| | | |
| | | var svg = mkElem('svg', { |
| | | id: id + '_jgraduate_svg', |
| | | width: MAX, |
| | | height: MAX, |
| | | xmlns: ns.svg |
| | | }, container); |
| | | |
| | | // if we are sent a gradient, import it |
| | | |
| | | |
| | | // if we are sent a gradient, import it |
| | | |
| | | curType = curType || $this.paint.type; |
| | | |
| | | |
| | | var grad = curGradient = $this.paint[curType]; |
| | | |
| | | |
| | | var gradalpha = $this.paint.alpha; |
| | | |
| | | |
| | | var isSolid = curType === 'solidColor'; |
| | | |
| | | |
| | | // Make any missing gradients |
| | | switch ( curType ) { |
| | | case "solidColor": |
| | |
| | | y2: 0 |
| | | }, svg); |
| | | } |
| | | |
| | | |
| | | if(isSolid) { |
| | | grad = curGradient = $('#' + id + '_lg_jgraduate_grad')[0]; |
| | | var color = $this.paint[curType]; |
| | | mkStop(0, '#' + color, 1); |
| | | |
| | | |
| | | var type = typeof $settings.newstop; |
| | | |
| | | |
| | | if(type === 'string') { |
| | | switch ( $settings.newstop ) { |
| | | case 'same': |
| | | mkStop(1, '#' + color, 1); |
| | | mkStop(1, '#' + color, 1); |
| | | break; |
| | | |
| | | case 'inverse': |
| | |
| | | } |
| | | mkStop(1, '#' + inverted, 1); |
| | | break; |
| | | |
| | | |
| | | case 'white': |
| | | mkStop(1, '#ffffff', 1); |
| | | break; |
| | | |
| | | |
| | | case 'black': |
| | | mkStop(1, '#000000', 1); |
| | | break; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | var x1 = parseFloat(grad.getAttribute('x1')||0.0), |
| | | y1 = parseFloat(grad.getAttribute('y1')||0.0), |
| | | x2 = parseFloat(grad.getAttribute('x2')||1.0), |
| | | y2 = parseFloat(grad.getAttribute('y2')||0.0); |
| | | |
| | | |
| | | var cx = parseFloat(grad.getAttribute('cx')||0.5), |
| | | cy = parseFloat(grad.getAttribute('cy')||0.5), |
| | | fx = parseFloat(grad.getAttribute('fx')|| cx), |
| | | fy = parseFloat(grad.getAttribute('fy')|| cy); |
| | | |
| | | |
| | | |
| | | var previewRect = mkElem('rect', { |
| | | id: id + '_jgraduate_rect', |
| | | x: MARGINX, |
| | |
| | | fill: 'url(#'+id+'_jgraduate_grad)', |
| | | 'fill-opacity': gradalpha/100 |
| | | }, svg); |
| | | |
| | | |
| | | // stop visuals created here |
| | | var beginCoord = $('<div/>').attr({ |
| | | 'class': 'grad_coord jGraduate_lg_field', |
| | |
| | | top: y1 * MAX, |
| | | left: x1 * MAX |
| | | }).data('coord', 'start').appendTo(container); |
| | | |
| | | |
| | | var endCoord = beginCoord.clone().text(2).css({ |
| | | top: y2 * MAX, |
| | | left: x2 * MAX |
| | | }).attr('title', 'End stop').data('coord', 'end').appendTo(container); |
| | | |
| | | |
| | | var centerCoord = $('<div/>').attr({ |
| | | 'class': 'grad_coord jGraduate_rg_field', |
| | | title: 'Center stop' |
| | |
| | | top: cy * MAX, |
| | | left: cx * MAX |
| | | }).data('coord', 'center').appendTo(container); |
| | | |
| | | |
| | | var focusCoord = centerCoord.clone().text('F').css({ |
| | | top: fy * MAX, |
| | | left: fx * MAX, |
| | | display: 'none' |
| | | }).attr('title', 'Focus point').data('coord', 'focus').appendTo(container); |
| | | |
| | | |
| | | focusCoord[0].id = id + '_jGraduate_focusCoord'; |
| | | |
| | | |
| | | var coords = $(idref + ' .grad_coord'); |
| | | |
| | | |
| | | $.each(['x1', 'y1', 'x2', 'y2', 'cx', 'cy', 'fx', 'fy'], function(i, attr) { |
| | | var attrval = curGradient.getAttribute(attr); |
| | | |
| | | |
| | | var isRadial = isNaN(attr[1]); |
| | | |
| | | |
| | | if(!attrval) { |
| | | // Set defaults |
| | | if(isRadial) { |
| | |
| | | .change(function() { |
| | | // TODO: Support values < 0 and > 1 (zoomable preview?) |
| | | if (isNaN(parseFloat(this.value)) || this.value < 0) { |
| | | this.value = 0.0; |
| | | this.value = 0.0; |
| | | } else if(this.value > 1) { |
| | | this.value = 1.0; |
| | | } |
| | | |
| | | |
| | | if(!(attr[0] === 'f' && !showFocus)) { |
| | | if(isRadial && curType === 'radialGradient' || !isRadial && curType === 'linearGradient') { |
| | | curGradient.setAttribute(attr, this.value); |
| | | } |
| | | } |
| | | |
| | | |
| | | if(isRadial) { |
| | | var $elem = attr[0] === "c" ? centerCoord : focusCoord; |
| | | } else { |
| | | var $elem = attr[1] === "1" ? beginCoord : endCoord; |
| | | var $elem = attr[1] === "1" ? beginCoord : endCoord; |
| | | } |
| | | |
| | | |
| | | var cssName = attr.indexOf('x') >= 0 ? 'left' : 'top'; |
| | | |
| | | |
| | | $elem.css(cssName, this.value * MAX); |
| | | }).change(); |
| | | }); |
| | |
| | | curGradient.appendChild(stop); |
| | | } |
| | | if(opac === null) opac = 1; |
| | | |
| | | |
| | | var picker_d = 'M-6.2,0.9c3.6-4,6.7-4.3,6.7-12.4c-0.2,7.9,3.1,8.8,6.5,12.4c3.5,3.8,2.9,9.6,0,12.3c-3.1,2.8-10.4,2.7-13.2,0C-9.6,9.9-9.4,4.4-6.2,0.9z'; |
| | | |
| | | |
| | | var pathbg = mkElem('path',{ |
| | | d: picker_d, |
| | | fill: 'url(#jGraduate_trans)', |
| | | transform: 'translate(' + (10 + n * MAX) + ', 26)' |
| | | }, stopGroup); |
| | | |
| | | |
| | | var path = mkElem('path',{ |
| | | d: picker_d, |
| | | fill: color, |
| | |
| | | e.preventDefault(); |
| | | return false; |
| | | }).data('stop', stop).data('bg', pathbg).dblclick(function() { |
| | | $('div.jGraduate_LightBox').show(); |
| | | $('div.jGraduate_LightBox').show(); |
| | | var colorhandle = this; |
| | | var stopOpacity = +stop.getAttribute('stop-opacity') || 1; |
| | | var stopColor = stop.getAttribute('stop-color') || 1; |
| | |
| | | $('#'+id+'_jGraduate_stopPicker').hide(); |
| | | }); |
| | | }); |
| | | |
| | | |
| | | $(curGradient).find('stop').each(function() { |
| | | var cur_s = $(this); |
| | | if(+this.getAttribute('offset') > n) { |
| | |
| | | if(sel) selectStop(path); |
| | | return stop; |
| | | } |
| | | |
| | | |
| | | function remStop() { |
| | | delStop.setAttribute('display', 'none'); |
| | | var path = $(cur_stop); |
| | |
| | | var bg = path.data('bg'); |
| | | $([cur_stop, stop, bg]).remove(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | var stops, stopGroup; |
| | | |
| | | |
| | | var stopMakerDiv = $('#' + id + '_jGraduate_StopSlider'); |
| | | |
| | | var cur_stop, stopGroup, stopMakerSVG, drag; |
| | | |
| | | |
| | | var delStop = mkElem('path',{ |
| | | d:'m9.75,-6l-19.5,19.5m0,-19.5l19.5,19.5', |
| | | fill:'none', |
| | |
| | | display:'none' |
| | | }, stopMakerSVG); |
| | | |
| | | |
| | | |
| | | function selectStop(item) { |
| | | if(cur_stop) cur_stop.setAttribute('stroke', '#000'); |
| | | item.setAttribute('stroke', 'blue'); |
| | |
| | | // opac_select.val(cur_stop.attr('fill-opacity') || 1); |
| | | // root.append(delStop); |
| | | } |
| | | |
| | | |
| | | var stop_offset; |
| | | |
| | | |
| | | function remDrags() { |
| | | $win.unbind('mousemove', dragColor); |
| | | if(delStop.getAttribute('display') !== 'none') { |
| | |
| | | } |
| | | drag = null; |
| | | } |
| | | |
| | | |
| | | var scale_x = 1, scale_y = 1, angle = 0; |
| | | var c_x = cx; |
| | | var c_y = cy; |
| | | |
| | | |
| | | function xform() { |
| | | var rot = angle?'rotate(' + angle + ',' + c_x + ',' + c_y + ') ':''; |
| | | if(scale_x === 1 && scale_y === 1) { |
| | |
| | | // $('#ang').removeClass('dis'); |
| | | } |
| | | } |
| | | |
| | | |
| | | function dragColor(evt) { |
| | | |
| | | var x = evt.pageX - stop_offset.left; |
| | |
| | | } else { |
| | | delStop.setAttribute('display', 'none'); |
| | | } |
| | | |
| | | |
| | | drag.setAttribute('transform', xf_str); |
| | | $.data(drag, 'bg').setAttribute('transform', xf_str); |
| | | var stop = $.data(drag, 'stop'); |
| | | var s_x = (x - 10) / MAX; |
| | | |
| | | |
| | | stop.setAttribute('offset', s_x); |
| | | var last = 0; |
| | | |
| | | |
| | | $(curGradient).find('stop').each(function(i) { |
| | | var cur = this.getAttribute('offset'); |
| | | var t = $(this); |
| | |
| | | } |
| | | last = cur; |
| | | }); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | stopMakerSVG = mkElem('svg', { |
| | | width: '100%', |
| | | height: 45 |
| | | }, stopMakerDiv[0]); |
| | | |
| | | |
| | | var trans_pattern = mkElem('pattern', { |
| | | width: 16, |
| | | height: 16, |
| | | patternUnits: 'userSpaceOnUse', |
| | | id: 'jGraduate_trans' |
| | | }, stopMakerSVG); |
| | | |
| | | |
| | | var trans_img = mkElem('image', { |
| | | width: 16, |
| | | height: 16 |
| | | }, trans_pattern); |
| | | |
| | | |
| | | var bg_image = $settings.images.clientPath + 'map-opacity.png'; |
| | | |
| | | trans_img.setAttributeNS(ns.xlink, 'xlink:href', bg_image); |
| | | |
| | | |
| | | $(stopMakerSVG).on("click touchstart", function(evt) { |
| | | stop_offset = stopMakerDiv.offset(); |
| | | var target = evt.target; |
| | |
| | | mkStop(x / MAX, 0, 0, true); |
| | | evt.stopPropagation(); |
| | | }); |
| | | |
| | | |
| | | $(stopMakerSVG).mouseover(function() { |
| | | stopMakerSVG.appendChild(delStop); |
| | | }); |
| | | |
| | | |
| | | stopGroup = mkElem('g', {}, stopMakerSVG); |
| | | |
| | | |
| | | mkElem('line', { |
| | | x1: 10, |
| | | y1: 15, |
| | |
| | | 'stroke-width': 2, |
| | | stroke: '#000' |
| | | }, stopMakerSVG); |
| | | |
| | | |
| | | |
| | | |
| | | var spreadMethodOpt = gradPicker.find('.jGraduate_spreadMethod').change(function() { |
| | | curGradient.setAttribute('spreadMethod', $(this).val()); |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | // handle dragging the stop around the swatch |
| | | var draggingCoord = null; |
| | | |
| | | |
| | | var onCoordDrag = function(evt) { |
| | | var x = evt.pageX - offset.left; |
| | | var y = evt.pageY - offset.top; |
| | |
| | | // clamp stop to the swatch |
| | | x = x < 0 ? 0 : x > MAX ? MAX : x; |
| | | y = y < 0 ? 0 : y > MAX ? MAX : y; |
| | | |
| | | |
| | | draggingCoord.css('left', x).css('top', y); |
| | | |
| | | // calculate stop offset |
| | | // calculate stop offset |
| | | var fracx = x / SIZEX; |
| | | var fracy = y / SIZEY; |
| | | |
| | | |
| | | var type = draggingCoord.data('coord'); |
| | | var grad = curGradient; |
| | | |
| | | |
| | | switch ( type ) { |
| | | case 'start': |
| | | attr_input.x1.val(fracx); |
| | |
| | | grad.setAttribute('fy', fracy); |
| | | xform(); |
| | | } |
| | | |
| | | |
| | | evt.preventDefault(); |
| | | } |
| | | |
| | | |
| | | var onCoordUp = function() { |
| | | draggingCoord = null; |
| | | $win.unbind('mousemove', onCoordDrag).unbind('mouseup', onCoordUp); |
| | | } |
| | | |
| | | |
| | | // Linear gradient |
| | | // (function() { |
| | | |
| | | |
| | | |
| | | stops = curGradient.getElementsByTagNameNS(ns.svg, 'stop'); |
| | | |
| | | // if there are not at least two stops, then |
| | | // if there are not at least two stops, then |
| | | if (numstops < 2) { |
| | | while (numstops < 2) { |
| | | curGradient.appendChild( document.createElementNS(ns.svg, 'stop') ); |
| | |
| | | } |
| | | stops = curGradient.getElementsByTagNameNS(ns.svg, 'stop'); |
| | | } |
| | | |
| | | var numstops = stops.length; |
| | | |
| | | var numstops = stops.length; |
| | | for(var i = 0; i < numstops; i++) { |
| | | mkStop(0, 0, 0, 0, stops[i]); |
| | | } |
| | | |
| | | |
| | | spreadMethodOpt.val(curGradient.getAttribute('spreadMethod') || 'pad'); |
| | | |
| | | var offset; |
| | | |
| | | |
| | | // No match, so show focus point |
| | | var showFocus = false; |
| | | |
| | | var showFocus = false; |
| | | |
| | | previewRect.setAttribute('fill-opacity', gradalpha/100); |
| | | |
| | | |
| | | |
| | | $('#' + id + ' div.grad_coord').mousedown(function(evt) { |
| | | evt.preventDefault(); |
| | | draggingCoord = $(this); |
| | |
| | | offset = draggingCoord.parent().offset(); |
| | | $win.mousemove(onCoordDrag).mouseup(onCoordUp); |
| | | }); |
| | | |
| | | |
| | | // bind GUI elements |
| | | $('#'+id+'_jGraduate_Ok').bind('click touchstart', function() { |
| | | $this.paint.type = curType; |
| | |
| | | |
| | | if(curType === 'radialGradient') { |
| | | if(showFocus) { |
| | | focusCoord.show(); |
| | | focusCoord.show(); |
| | | } else { |
| | | focusCoord.hide(); |
| | | attr_input.fx.val(""); |
| | |
| | | } |
| | | |
| | | $("#" + id + "_jGraduate_match_ctr")[0].checked = !showFocus; |
| | | |
| | | |
| | | var lastfx, lastfy; |
| | | |
| | | |
| | | $("#" + id + "_jGraduate_match_ctr").change(function() { |
| | | showFocus = !this.checked; |
| | | focusCoord.toggle(showFocus); |
| | |
| | | attr_input.fy.val(fy); |
| | | } |
| | | }); |
| | | |
| | | |
| | | var stops = curGradient.getElementsByTagNameNS(ns.svg, 'stop'); |
| | | var numstops = stops.length; |
| | | // if there are not at least two stops, then |
| | | // if there are not at least two stops, then |
| | | if (numstops < 2) { |
| | | while (numstops < 2) { |
| | | curGradient.appendChild( document.createElementNS(ns.svg, 'stop') ); |
| | |
| | | } |
| | | stops = curGradient.getElementsByTagNameNS(ns.svg, 'stop'); |
| | | } |
| | | |
| | | |
| | | var slider; |
| | | |
| | | |
| | | var setSlider = function(e) { |
| | | var offset = slider.offset; |
| | | var div = slider.parent; |
| | |
| | | if (x <= 0) x = 0; |
| | | var posx = x - 5; |
| | | x /= SLIDERW; |
| | | |
| | | |
| | | switch ( slider.type ) { |
| | | case 'radius': |
| | | x = Math.pow(x * 2, 2.5); |
| | |
| | | x /= .5; // 2 |
| | | x = 2 - x; |
| | | scale_y = x <= 0 ? .01 : x; |
| | | } |
| | | } |
| | | xform(); |
| | | x -= 1; |
| | | if(scale_y === x + 1) { |
| | |
| | | x = Math.round(x*100); |
| | | slider.input.val(x); |
| | | }; |
| | | |
| | | |
| | | var ellip_val = 0, angle_val = 0; |
| | | |
| | | |
| | | if(curType === 'radialGradient') { |
| | | var tlist = curGradient.gradientTransform.baseVal; |
| | | if(tlist.numberOfItems === 2) { |
| | |
| | | if(t.type === 2 && s.type === 3) { |
| | | var m = s.matrix; |
| | | if(m.a !== 1) { |
| | | ellip_val = Math.round(-(1 - m.a) * 100); |
| | | ellip_val = Math.round(-(1 - m.a) * 100); |
| | | } else if(m.d !== 1) { |
| | | ellip_val = Math.round((1 - m.d) * 100); |
| | | } |
| | | } |
| | | } |
| | | } else if(tlist.numberOfItems === 3) { |
| | | // Assume [R][T][S] |
| | | var r = tlist.getItem(0); |
| | | var t = tlist.getItem(1); |
| | | var s = tlist.getItem(2); |
| | | |
| | | if(r.type === 4 |
| | | && t.type === 2 |
| | | |
| | | if(r.type === 4 |
| | | && t.type === 2 |
| | | && s.type === 3) { |
| | | |
| | | angle_val = Math.round(r.angle); |
| | | var m = s.matrix; |
| | | if(m.a !== 1) { |
| | | ellip_val = Math.round(-(1 - m.a) * 100); |
| | | ellip_val = Math.round(-(1 - m.a) * 100); |
| | | } else if(m.d !== 1) { |
| | | ellip_val = Math.round((1 - m.d) * 100); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | var sliders = { |
| | | radius: { |
| | | handle: '#' + id + '_jGraduate_RadiusArrows', |
| | |
| | | val: angle_val |
| | | } |
| | | } |
| | | |
| | | |
| | | $.each(sliders, function(type, data) { |
| | | var handle = $(data.handle); |
| | | handle.mousedown(function(evt) { |
| | |
| | | $win.mousemove(dragSlider).mouseup(stopSlider); |
| | | evt.preventDefault(); |
| | | }); |
| | | |
| | | |
| | | $(data.input).val(data.val).change(function() { |
| | | var val = +this.value; |
| | | var xpos = 0; |
| | |
| | | if(isRad) curGradient.setAttribute('r', val / 100); |
| | | xpos = (Math.pow(val / 100, 1 / 2.5) / 2) * SLIDERW; |
| | | break; |
| | | |
| | | |
| | | case 'opacity': |
| | | $this.paint.alpha = val; |
| | | previewRect.setAttribute('fill-opacity', val / 100); |
| | | xpos = val * (SLIDERW / 100); |
| | | break; |
| | | |
| | | |
| | | case 'ellip': |
| | | scale_x = scale_y = 1; |
| | | if(val === 0) { |
| | |
| | | xpos = SLIDERW * ((val + 100) / 2) / 100; |
| | | if(isRad) xform(); |
| | | break; |
| | | |
| | | |
| | | case 'angle': |
| | | angle = val; |
| | | xpos = angle / 180; |
| | |
| | | handle.css({'margin-left': xpos - 5}); |
| | | }).change(); |
| | | }); |
| | | |
| | | |
| | | var dragSlider = function(evt) { |
| | | setSlider(evt); |
| | | evt.preventDefault(); |
| | | }; |
| | | |
| | | |
| | | var stopSlider = function(evt) { |
| | | $win.unbind('mousemove', dragSlider).unbind('mouseup', stopSlider); |
| | | slider = null; |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | // -------------- |
| | | var thisAlpha = ($this.paint.alpha*255/100).toString(16); |
| | | while (thisAlpha.length < 2) { thisAlpha = "0" + thisAlpha; } |
| | | thisAlpha = thisAlpha.split(".")[0]; |
| | | color = $this.paint.solidColor == "none" ? "" : $this.paint.solidColor + thisAlpha; |
| | | |
| | | |
| | | if(!isSolid) { |
| | | color = stops[0].getAttribute('stop-color'); |
| | | } |
| | | |
| | | |
| | | // This should be done somewhere else, probably |
| | | $.extend($.fn.jPicker.defaults.window, { |
| | | alphaSupport: true, effects: {type: 'show',speed: 0} |
| | | }); |
| | | |
| | | |
| | | colPicker.jPicker( |
| | | { |
| | | window: { title: $settings.window.pickerTitle }, |
| | |
| | | $this.paint.alpha = color.val('ahex') ? Math.round((color.val('a') / 255) * 100) : 100; |
| | | $this.paint.solidColor = color.val('hex') ? color.val('hex') : "none"; |
| | | $this.paint.radialGradient = null; |
| | | okClicked(); |
| | | okClicked(); |
| | | }, |
| | | null, |
| | | function(){ cancelClicked(); } |
| | | ); |
| | | |
| | | |
| | | |
| | | var tabs = $(idref + ' .jGraduate_tabs li'); |
| | | tabs.on("click touchstart", function() { |
| | | tabs.removeClass('jGraduate_tab_current'); |
| | |
| | | // Show/hide appropriate fields |
| | | $('.jGraduate_' + type + '_field').show(); |
| | | $('.jGraduate_' + (type === 'lg' ? 'rg' : 'lg') + '_field').hide(); |
| | | |
| | | |
| | | $('#' + id + '_jgraduate_rect')[0].setAttribute('fill', 'url(#' + id + '_' + type + '_jgraduate_grad)'); |
| | | |
| | | |
| | | // Copy stops |
| | | |
| | | |
| | | curType = type === 'lg' ? 'linearGradient' : 'radialGradient'; |
| | | |
| | | |
| | | $('#' + id + '_jGraduate_OpacInput').val($this.paint.alpha).change(); |
| | | |
| | | |
| | | var newGrad = $('#' + id + '_' + type + '_jgraduate_grad')[0]; |
| | | |
| | | |
| | | if(curGradient !== newGrad) { |
| | | var cur_stops = $(curGradient).find('stop'); |
| | | var cur_stops = $(curGradient).find('stop'); |
| | | $(newGrad).empty().append(cur_stops); |
| | | curGradient = newGrad; |
| | | var sm = spreadMethodOpt.val(); |
| | |
| | | break; |
| | | } |
| | | $this.show(); |
| | | |
| | | |
| | | // jPicker will try to show after a 0ms timeout, so need to fire this after that |
| | | setTimeout(function() { |
| | | tab.addClass('jGraduate_tab_current').click(); |
| | | tab.addClass('jGraduate_tab_current').click(); |
| | | }, 10); |
| | | }); |
| | | }; |
| | | })(); |
| | | })(); |
| | |
| | | (e.paint.alpha*255/100).toString(16);n.length<2;)n="0"+n;n=n.split(".")[0];u=e.paint.solidColor=="none"?"":e.paint.solidColor+n;ba||(u=D[0].getAttribute("stop-color"));$.extend($.fn.jPicker.defaults.window,{alphaSupport:true,effects:{type:"show",speed:0}});Ca.jPicker({window:{title:o.window.pickerTitle},images:{clientPath:o.images.clientPath},color:{active:u,alphaSupport:true}},function(c){e.paint.type="solidColor";e.paint.alpha=c.val("ahex")?Math.round(c.val("a")/255*100):100;e.paint.solidColor= |
| | | c.val("hex")?c.val("hex"):"none";e.paint.radialGradient=null;ma()},null,function(){na()});var ka=$(s+" .jGraduate_tabs li");ka.click(function(){ka.removeClass("jGraduate_tab_current");$(this).addClass("jGraduate_tab_current");$(s+" > div").hide();var c=$(this).attr("data-type");$(s+" .jGraduate_gradPick").show();if(c==="rg"||c==="lg"){$(".jGraduate_"+c+"_field").show();$(".jGraduate_"+(c==="lg"?"rg":"lg")+"_field").hide();$("#"+b+"_jgraduate_rect")[0].setAttribute("fill","url(#"+b+"_"+c+"_jgraduate_grad)"); |
| | | p=c==="lg"?"linearGradient":"radialGradient";$("#"+b+"_jGraduate_OpacInput").val(e.paint.alpha).change();var a=$("#"+b+"_"+c+"_jgraduate_grad")[0];if(g!==a){var d=$(g).find("stop");$(a).empty().append(d);g=a;a=ua.val();g.setAttribute("spreadMethod",a)}E=c==="rg"&&g.getAttribute("fx")!=null&&!(ca==qa&&da==ra);$("#"+b+"_jGraduate_focusCoord").toggle(E);if(E)$("#"+b+"_jGraduate_match_ctr")[0].checked=false}else{$(s+" .jGraduate_gradPick").hide();$(s+" .jGraduate_colPick").show()}});$(s+" > div").hide(); |
| | | ka.removeClass("jGraduate_tab_current");var ea;switch(e.paint.type){case "linearGradient":ea=$(s+" .jGraduate_tab_lingrad");break;case "radialGradient":ea=$(s+" .jGraduate_tab_radgrad");break;default:ea=$(s+" .jGraduate_tab_color")}e.show();setTimeout(function(){ea.addClass("jGraduate_tab_current").click()},10)}else alert("Container element must have an id attribute to maintain unique id strings for sub-elements.")})}})(); |
| | | ka.removeClass("jGraduate_tab_current");var ea;switch(e.paint.type){case "linearGradient":ea=$(s+" .jGraduate_tab_lingrad");break;case "radialGradient":ea=$(s+" .jGraduate_tab_radgrad");break;default:ea=$(s+" .jGraduate_tab_color")}e.show();setTimeout(function(){ea.addClass("jGraduate_tab_current").click()},10)}else alert("Container element must have an id attribute to maintain unique id strings for sub-elements.")})}})(); |
| | |
| | | var isTouch = svgedit.browser.isTouch(); |
| | | var completed = true //for mousewheel |
| | | var $cursor = (area && this.dragCfg.cursor) |
| | | ? $("<div class='draginput_cursor' />").appendTo($label) |
| | | ? $("<div class='draginput_cursor' />").appendTo($label) |
| | | : false |
| | | $input.attr("readonly", "readonly") |
| | | if ($cursor && !isNaN(this.dragCfg.start)) $cursor.css("top", (this.dragCfg.start*-1)/scale+cursorHeight) |
| | | |
| | | //this is where all the magic happens |
| | | |
| | | //this is where all the magic happens |
| | | this.adjustValue = function(i, completed){ |
| | | var v; |
| | | i = parseFloat(i); |
| | |
| | | $label.attr("data-value", v) |
| | | if ($.isFunction(this.dragCfg.callback)) this.dragCfg.callback(this, completed) |
| | | }; |
| | | |
| | | |
| | | $label.toggleClass("draginput", $label.is("label")) |
| | | |
| | | |
| | | // when the mouse is down and moving |
| | | this.move = function(e, oy, val) { |
| | | if (isTouch) { |
| | |
| | | var fixed = (step < 1) ? 1 : 0 |
| | | this.adjustValue(val.toFixed(fixed)) //no undo true |
| | | }; |
| | | |
| | | |
| | | //when the mouse is released |
| | | this.stop = function() { |
| | | var selectedElems = canvas.getSelectedElems(); |
| | |
| | | } |
| | | this.adjustValue(0, completed) |
| | | } |
| | | |
| | | |
| | | this.updateCursor = function(){ |
| | | var value = parseFloat(this.value); |
| | | var pos = (value*-1)/scale+cursorHeight; |
| | | $cursor.css("top", pos); |
| | | } |
| | | |
| | | |
| | | this.launch = function(e) { |
| | | var selectedElems = canvas.getSelectedElems(); |
| | | if (isTouch) e = e.originalEvent.touches[0]; |
| | |
| | | $(window).bind("mousemove.draginput touchmove.draginput", function(e){el.move(e, oy, parseFloat(val))}) |
| | | $(window).bind("mouseup.draginput touchend.draginput", function(e){el.stop()}) |
| | | } |
| | | |
| | | |
| | | $(this) |
| | | .attr("readonly", "readonly") |
| | | .attr("data-scale", scale) |
| | | .attr("data-domain", cursorHeight) |
| | | .attr("data-cursor", ($cursor != false)) |
| | | |
| | | |
| | | .bind("mousedown touchstart", function(e){ |
| | | this.blur(); |
| | | this.launch(e); |
| | | }) |
| | | |
| | | |
| | | .bind("dblclick taphold", function(e) { |
| | | this.removeAttribute("readonly", "readonly"); |
| | | this.focus(); |
| | | this.select(); |
| | | }) |
| | | |
| | | |
| | | .keydown(function(e){ |
| | | // Respond to up/down arrow keys. |
| | | switch(e.keyCode){ |
| | | case 13: this.adjustValue(0); this.blur(); break; // Enter |
| | | } |
| | | }) |
| | | |
| | | |
| | | .focus(function(e){ |
| | | if (this.getAttribute("readonly") === "readonly") this.blur() |
| | | }) |
| | | |
| | | |
| | | .blur(function(e){ |
| | | this.setAttribute("readonly", "readonly") |
| | | }) |
| | | |
| | | |
| | | .bind("mousewheel", function(e, delta, deltaX, deltaY){ |
| | | var selectedElems = canvas.getSelectedElems(); |
| | | if (completed) canvas.undoMgr.beginUndoableChange(attr, selectedElems) |
| | |
| | | window.undoTimeout = setTimeout(function(){ |
| | | wheel_input.stop() |
| | | },200) |
| | | |
| | | |
| | | var wheel_input = this; |
| | | if (deltaY > 0) |
| | | this.adjustValue(this.dragCfg.step); |
| | | else if (deltaY < 0) |
| | | this.adjustValue(-this.dragCfg.step); |
| | | e.preventDefault(); |
| | | |
| | | |
| | | }) |
| | | |
| | | }); |
| | | |
| | | |
| | | }; |
| | | |
| | | // public function |
| | |
| | | * jquery.ui.core.js |
| | | * jquery.ui.mouse.js |
| | | * jquery.ui.widget.js |
| | | */(function(a,b){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",g=d.values&&d.values.length||1,h=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":"")),this.range=a([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),d.values.length&&d.values.length!==2&&(d.values=[d.values[0],d.values[0]])),this.range=a("<div></div>").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;i<g;i+=1)h.push(f);this.handles=e.add(a(h.join("")).appendTo(b.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){d.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){d.disabled?a(this).blur():(a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-state-focus"))}).blur(function(){a(this).removeClass("ui-state-focus")}),this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)}),this.handles.keydown(function(d){var e=!0,f=a(this).data("index.ui-slider-handle"),g,h,i,j;if(!b.options.disabled){switch(d.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:e=!1;if(!b._keySliding){b._keySliding=!0,a(this).addClass("ui-state-active"),g=b._start(d,f);if(g===!1)return}}j=b.options.step,b.options.values&&b.options.values.length?h=i=b.values(f):h=i=b.value();switch(d.keyCode){case a.ui.keyCode.HOME:i=b._valueMin();break;case a.ui.keyCode.END:i=b._valueMax();break;case a.ui.keyCode.PAGE_UP:i=b._trimAlignValue(h+(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.PAGE_DOWN:i=b._trimAlignValue(h-(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(h===b._valueMax())return;i=b._trimAlignValue(h+j);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(h===b._valueMin())return;i=b._trimAlignValue(h-j)}b._slide(d,f,i);return e}}).keyup(function(c){var d=a(this).data("index.ui-slider-handle");b._keySliding&&(b._keySliding=!1,b._stop(c,d),b._change(c,d),a(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy();return this},_mouseCapture:function(b){var c=this.options,d,e,f,g,h,i,j,k,l;if(c.disabled)return!1;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),d={x:b.pageX,y:b.pageY},e=this._normValueFromMouse(d),f=this._valueMax()-this._valueMin()+1,h=this,this.handles.each(function(b){var c=Math.abs(e-h.values(b));f>c&&(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().andSelf().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&&c<d)&&(c=d),c!==this.values(b)&&(e=this.values(),e[b]=c,f=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e}),d=this.values(b?0:1),f!==!1&&this.values(b,c,!0))):c!==this.value()&&(f=this._trigger("slide",a,{handle:this.handles[b],value:c}),f!==!1&&this.value(c))},_stop: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()),this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){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()),this._trigger("change",a,c)}},value:function(a){if(arguments.length)this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0);else return this._value()},values:function(b,c){var d,e,f;if(arguments.length>1)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<d.length;f+=1)d[f]=this._trimAlignValue(e[f]),this._change(null,f);this._refreshValue()}},_setOption:function(b,c){var d,e=0;a.isArray(this.options.values)&&(e=this.options.values.length),a.Widget.prototype._setOption.apply(this,arguments);switch(b){case"disabled":c?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(d=0;d<e;d+=1)this._change(null,d);this._animateOff=!1}},_value:function(){var a=this.options.value;a=this._trimAlignValue(a);return a},_values:function(a){var b,c,d;if(arguments.length){b=this.options.values[a],b=this._trimAlignValue(b);return b}c=this.options.values.slice();for(d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=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){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",g=d.values&&d.values.length||1,h=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":"")),this.range=a([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),d.values.length&&d.values.length!==2&&(d.values=[d.values[0],d.values[0]])),this.range=a("<div></div>").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;i<g;i+=1)h.push(f);this.handles=e.add(a(h.join("")).appendTo(b.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){d.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){d.disabled?a(this).blur():(a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-state-focus"))}).blur(function(){a(this).removeClass("ui-state-focus")}),this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)}),this.handles.keydown(function(d){var e=!0,f=a(this).data("index.ui-slider-handle"),g,h,i,j;if(!b.options.disabled){switch(d.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:e=!1;if(!b._keySliding){b._keySliding=!0,a(this).addClass("ui-state-active"),g=b._start(d,f);if(g===!1)return}}j=b.options.step,b.options.values&&b.options.values.length?h=i=b.values(f):h=i=b.value();switch(d.keyCode){case a.ui.keyCode.HOME:i=b._valueMin();break;case a.ui.keyCode.END:i=b._valueMax();break;case a.ui.keyCode.PAGE_UP:i=b._trimAlignValue(h+(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.PAGE_DOWN:i=b._trimAlignValue(h-(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(h===b._valueMax())return;i=b._trimAlignValue(h+j);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(h===b._valueMin())return;i=b._trimAlignValue(h-j)}b._slide(d,f,i);return e}}).keyup(function(c){var d=a(this).data("index.ui-slider-handle");b._keySliding&&(b._keySliding=!1,b._stop(c,d),b._change(c,d),a(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy();return this},_mouseCapture:function(b){var c=this.options,d,e,f,g,h,i,j,k,l;if(c.disabled)return!1;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),d={x:b.pageX,y:b.pageY},e=this._normValueFromMouse(d),f=this._valueMax()-this._valueMin()+1,h=this,this.handles.each(function(b){var c=Math.abs(e-h.values(b));f>c&&(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().andSelf().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&&c<d)&&(c=d),c!==this.values(b)&&(e=this.values(),e[b]=c,f=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e}),d=this.values(b?0:1),f!==!1&&this.values(b,c,!0))):c!==this.value()&&(f=this._trigger("slide",a,{handle:this.handles[b],value:c}),f!==!1&&this.value(c))},_stop: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()),this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){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()),this._trigger("change",a,c)}},value:function(a){if(arguments.length)this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0);else return this._value()},values:function(b,c){var d,e,f;if(arguments.length>1)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<d.length;f+=1)d[f]=this._trimAlignValue(e[f]),this._change(null,f);this._refreshValue()}},_setOption:function(b,c){var d,e=0;a.isArray(this.options.values)&&(e=this.options.values.length),a.Widget.prototype._setOption.apply(this,arguments);switch(b){case"disabled":c?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(d=0;d<e;d+=1)this._change(null,d);this._animateOff=!1}},_value:function(){var a=this.options.value;a=this._trimAlignValue(a);return a},_values:function(a){var b,c,d;if(arguments.length){b=this.options.values[a],b=this._trimAlignValue(b);return b}c=this.options.values.slice();for(d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=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); |
| | |
| | | * jquery.ui.core.js |
| | | * jquery.ui.mouse.js |
| | | * jquery.ui.widget.js |
| | | */(function(b){var a=5;b.widget("ui.slider",b.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var c=this,d=this.options;this._keySliding=false;this._mouseSliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");if(d.disabled){this.element.addClass("ui-slider-disabled ui-disabled")}this.range=b([]);if(d.range){if(d.range===true){this.range=b("<div></div>");if(!d.values){d.values=[this._valueMin(),this._valueMin()]}if(d.values.length&&d.values.length!=2){d.values=[d.values[0],d.values[0]]}}else{this.range=b("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(d.range=="min"||d.range=="max"){this.range.addClass("ui-slider-range-"+d.range)}this.range.addClass("ui-widget-header")}if(b(".ui-slider-handle",this.element).length==0){b('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}if(d.values&&d.values.length){while(b(".ui-slider-handle",this.element).length<d.values.length){b('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=b(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(e){e.preventDefault()}).hover(function(){if(!d.disabled){b(this).addClass("ui-state-hover")}},function(){b(this).removeClass("ui-state-hover")}).focus(function(){if(!d.disabled){b(".ui-slider .ui-state-focus").removeClass("ui-state-focus");b(this).addClass("ui-state-focus")}else{b(this).blur()}}).blur(function(){b(this).removeClass("ui-state-focus")});this.handles.each(function(e){b(this).data("index.ui-slider-handle",e)});this.handles.keydown(function(j){var g=true;var f=b(this).data("index.ui-slider-handle");if(c.options.disabled){return}switch(j.keyCode){case b.ui.keyCode.HOME:case b.ui.keyCode.END:case b.ui.keyCode.PAGE_UP:case b.ui.keyCode.PAGE_DOWN:case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:g=false;if(!c._keySliding){c._keySliding=true;b(this).addClass("ui-state-active");c._start(j,f)}break}var h,e,i=c._step();if(c.options.values&&c.options.values.length){h=e=c.values(f)}else{h=e=c.value()}switch(j.keyCode){case b.ui.keyCode.HOME:e=c._valueMin();break;case b.ui.keyCode.END:e=c._valueMax();break;case b.ui.keyCode.PAGE_UP:e=h+((c._valueMax()-c._valueMin())/a);break;case b.ui.keyCode.PAGE_DOWN:e=h-((c._valueMax()-c._valueMin())/a);break;case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:if(h==c._valueMax()){return}e=h+i;break;case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:if(h==c._valueMin()){return}e=h-i;break}c._slide(j,f,e);return g}).keyup(function(f){var e=b(this).data("index.ui-slider-handle");if(c._keySliding){c._keySliding=false;c._stop(f,e);c._change(f,e);b(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();return this},_mouseCapture:function(e){var f=this.options;if(f.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var i={x:e.pageX,y:e.pageY};var k=this._normValueFromMouse(i);var d=this._valueMax()-this._valueMin()+1,g;var l=this,j;this.handles.each(function(m){var n=Math.abs(k-l.values(m));if(d>n){d=n;g=b(this);j=m}});if(f.range==true&&this.values(1)==f.min){g=b(this.handles[++j])}this._start(e,j);this._mouseSliding=true;l._handleIndex=j;g.addClass("ui-state-active").focus();var h=g.offset();var c=!b(e.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=c?{left:0,top:0}:{left:e.pageX-h.left-(g.width()/2),top:e.pageY-h.top-(g.height()/2)-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)};k=this._normValueFromMouse(i);this._slide(e,j,k);this._animateOff=true;return true},_mouseStart:function(c){return true},_mouseDrag:function(e){var c={x:e.pageX,y:e.pageY};var d=this._normValueFromMouse(c);this._slide(e,this._handleIndex,d);return false},_mouseStop:function(c){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(c,this._handleIndex);this._change(c,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var d,i;if("horizontal"==this.orientation){d=this.elementSize.width;i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{d=this.elementSize.height;i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var g=(i/d);if(g>1){g=1}if(g<0){g=0}if("vertical"==this.orientation){g=1-g}var f=this._valueMax()-this._valueMin(),j=g*f,c=j%this.options.step,h=this._valueMin()+j-c;if(c>(this.options.step/2)){h+=this.options.step}return parseFloat(h.toFixed(5))},_start:function(e,d){var c={handle:this.handles[d],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(d);c.values=this.values()}this._trigger("start",e,c)},_slide:function(g,f,e){var h=this.handles[f];if(this.options.values&&this.options.values.length){var c=this.values(f?0:1);if((this.options.values.length==2&&this.options.range===true)&&((f==0&&e>c)||(f==1&&e<c))){e=c}if(e!=this.values(f)){var d=this.values();d[f]=e;var i=this._trigger("slide",g,{handle:this.handles[f],value:e,values:d});var c=this.values(f?0:1);if(i!==false){this.values(f,e,true)}}}else{if(e!=this.value()){var i=this._trigger("slide",g,{handle:this.handles[f],value:e});if(i!==false){this.value(e)}}}},_stop:function(e,d){var c={handle:this.handles[d],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(d);c.values=this.values()}this._trigger("stop",e,c)},_change:function(e,d){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[d],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(d);c.values=this.values()}this._trigger("change",e,c)}},value:function(c){if(arguments.length){this.options.value=this._trimValue(c);this._refreshValue();this._change(null,0)}return this._value()},values:function(e,h){if(arguments.length>1){this.options.values[e]=this._trimValue(h);this._refreshValue();this._change(null,e)}if(arguments.length){if(b.isArray(arguments[0])){var g=this.options.values,d=arguments[0];for(var f=0,c=g.length;f<c;f++){g[f]=this._trimValue(d[f]);this._change(null,f)}this._refreshValue()}else{if(this.options.values&&this.options.values.length){return this._values(e)}else{return this.value()}}}else{return this._values()}},_setOption:function(d,e){var c,f=0;if(jQuery.isArray(this.options.values)){f=this.options.values.length}b.Widget.prototype._setOption.apply(this,arguments);switch(d){case"disabled":if(e){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(c=0;c<f;c++){this._change(null,c)}this._animateOff=false;break}},_step:function(){var c=this.options.step;return c},_value:function(){var c=this.options.value;c=this._trimValue(c);return c},_values:function(d){if(arguments.length){var g=this.options.values[d];g=this._trimValue(g);return g}else{var f=this.options.values.slice();for(var e=0,c=f.length;e<c;e++){f[e]=this._trimValue(f[e])}return f}},_trimValue:function(c){if(c<this._valueMin()){c=this._valueMin()}if(c>this._valueMax()){c=this._valueMax()}return c},_valueMin:function(){var c=this.options.min;return c},_valueMax:function(){var c=this.options.max;return c},_refreshValue:function(){var g=this.options.range,e=this.options,m=this;var d=(!this._animateOff)?e.animate:false;if(this.options.values&&this.options.values.length){var j,i;this.handles.each(function(q,o){var p=(m.values(q)-m._valueMin())/(m._valueMax()-m._valueMin())*100;var n={};n[m.orientation=="horizontal"?"left":"bottom"]=p+"%";b(this).stop(1,1)[d?"animate":"css"](n,e.animate);if(m.options.range===true){if(m.orientation=="horizontal"){(q==0)&&m.range.stop(1,1)[d?"animate":"css"]({left:p+"%"},e.animate);(q==1)&&m.range[d?"animate":"css"]({width:(p-lastValPercent)+"%"},{queue:false,duration:e.animate})}else{(q==0)&&m.range.stop(1,1)[d?"animate":"css"]({bottom:(p)+"%"},e.animate);(q==1)&&m.range[d?"animate":"css"]({height:(p-lastValPercent)+"%"},{queue:false,duration:e.animate})}}lastValPercent=p})}else{var k=this.value(),h=this._valueMin(),l=this._valueMax(),f=l!=h?(k-h)/(l-h)*100:0;var c={};c[m.orientation=="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[d?"animate":"css"](c,e.animate);(g=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[d?"animate":"css"]({width:f+"%"},e.animate);(g=="max")&&(this.orientation=="horizontal")&&this.range[d?"animate":"css"]({width:(100-f)+"%"},{queue:false,duration:e.animate});(g=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[d?"animate":"css"]({height:f+"%"},e.animate);(g=="max")&&(this.orientation=="vertical")&&this.range[d?"animate":"css"]({height:(100-f)+"%"},{queue:false,duration:e.animate})}}});b.extend(b.ui.slider,{version:"1.8"})})(jQuery);; |
| | | */(function(b){var a=5;b.widget("ui.slider",b.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var c=this,d=this.options;this._keySliding=false;this._mouseSliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");if(d.disabled){this.element.addClass("ui-slider-disabled ui-disabled")}this.range=b([]);if(d.range){if(d.range===true){this.range=b("<div></div>");if(!d.values){d.values=[this._valueMin(),this._valueMin()]}if(d.values.length&&d.values.length!=2){d.values=[d.values[0],d.values[0]]}}else{this.range=b("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(d.range=="min"||d.range=="max"){this.range.addClass("ui-slider-range-"+d.range)}this.range.addClass("ui-widget-header")}if(b(".ui-slider-handle",this.element).length==0){b('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}if(d.values&&d.values.length){while(b(".ui-slider-handle",this.element).length<d.values.length){b('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=b(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(e){e.preventDefault()}).hover(function(){if(!d.disabled){b(this).addClass("ui-state-hover")}},function(){b(this).removeClass("ui-state-hover")}).focus(function(){if(!d.disabled){b(".ui-slider .ui-state-focus").removeClass("ui-state-focus");b(this).addClass("ui-state-focus")}else{b(this).blur()}}).blur(function(){b(this).removeClass("ui-state-focus")});this.handles.each(function(e){b(this).data("index.ui-slider-handle",e)});this.handles.keydown(function(j){var g=true;var f=b(this).data("index.ui-slider-handle");if(c.options.disabled){return}switch(j.keyCode){case b.ui.keyCode.HOME:case b.ui.keyCode.END:case b.ui.keyCode.PAGE_UP:case b.ui.keyCode.PAGE_DOWN:case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:g=false;if(!c._keySliding){c._keySliding=true;b(this).addClass("ui-state-active");c._start(j,f)}break}var h,e,i=c._step();if(c.options.values&&c.options.values.length){h=e=c.values(f)}else{h=e=c.value()}switch(j.keyCode){case b.ui.keyCode.HOME:e=c._valueMin();break;case b.ui.keyCode.END:e=c._valueMax();break;case b.ui.keyCode.PAGE_UP:e=h+((c._valueMax()-c._valueMin())/a);break;case b.ui.keyCode.PAGE_DOWN:e=h-((c._valueMax()-c._valueMin())/a);break;case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:if(h==c._valueMax()){return}e=h+i;break;case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:if(h==c._valueMin()){return}e=h-i;break}c._slide(j,f,e);return g}).keyup(function(f){var e=b(this).data("index.ui-slider-handle");if(c._keySliding){c._keySliding=false;c._stop(f,e);c._change(f,e);b(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();return this},_mouseCapture:function(e){var f=this.options;if(f.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var i={x:e.pageX,y:e.pageY};var k=this._normValueFromMouse(i);var d=this._valueMax()-this._valueMin()+1,g;var l=this,j;this.handles.each(function(m){var n=Math.abs(k-l.values(m));if(d>n){d=n;g=b(this);j=m}});if(f.range==true&&this.values(1)==f.min){g=b(this.handles[++j])}this._start(e,j);this._mouseSliding=true;l._handleIndex=j;g.addClass("ui-state-active").focus();var h=g.offset();var c=!b(e.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=c?{left:0,top:0}:{left:e.pageX-h.left-(g.width()/2),top:e.pageY-h.top-(g.height()/2)-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)};k=this._normValueFromMouse(i);this._slide(e,j,k);this._animateOff=true;return true},_mouseStart:function(c){return true},_mouseDrag:function(e){var c={x:e.pageX,y:e.pageY};var d=this._normValueFromMouse(c);this._slide(e,this._handleIndex,d);return false},_mouseStop:function(c){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(c,this._handleIndex);this._change(c,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var d,i;if("horizontal"==this.orientation){d=this.elementSize.width;i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{d=this.elementSize.height;i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var g=(i/d);if(g>1){g=1}if(g<0){g=0}if("vertical"==this.orientation){g=1-g}var f=this._valueMax()-this._valueMin(),j=g*f,c=j%this.options.step,h=this._valueMin()+j-c;if(c>(this.options.step/2)){h+=this.options.step}return parseFloat(h.toFixed(5))},_start:function(e,d){var c={handle:this.handles[d],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(d);c.values=this.values()}this._trigger("start",e,c)},_slide:function(g,f,e){var h=this.handles[f];if(this.options.values&&this.options.values.length){var c=this.values(f?0:1);if((this.options.values.length==2&&this.options.range===true)&&((f==0&&e>c)||(f==1&&e<c))){e=c}if(e!=this.values(f)){var d=this.values();d[f]=e;var i=this._trigger("slide",g,{handle:this.handles[f],value:e,values:d});var c=this.values(f?0:1);if(i!==false){this.values(f,e,true)}}}else{if(e!=this.value()){var i=this._trigger("slide",g,{handle:this.handles[f],value:e});if(i!==false){this.value(e)}}}},_stop:function(e,d){var c={handle:this.handles[d],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(d);c.values=this.values()}this._trigger("stop",e,c)},_change:function(e,d){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[d],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(d);c.values=this.values()}this._trigger("change",e,c)}},value:function(c){if(arguments.length){this.options.value=this._trimValue(c);this._refreshValue();this._change(null,0)}return this._value()},values:function(e,h){if(arguments.length>1){this.options.values[e]=this._trimValue(h);this._refreshValue();this._change(null,e)}if(arguments.length){if(b.isArray(arguments[0])){var g=this.options.values,d=arguments[0];for(var f=0,c=g.length;f<c;f++){g[f]=this._trimValue(d[f]);this._change(null,f)}this._refreshValue()}else{if(this.options.values&&this.options.values.length){return this._values(e)}else{return this.value()}}}else{return this._values()}},_setOption:function(d,e){var c,f=0;if(jQuery.isArray(this.options.values)){f=this.options.values.length}b.Widget.prototype._setOption.apply(this,arguments);switch(d){case"disabled":if(e){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(c=0;c<f;c++){this._change(null,c)}this._animateOff=false;break}},_step:function(){var c=this.options.step;return c},_value:function(){var c=this.options.value;c=this._trimValue(c);return c},_values:function(d){if(arguments.length){var g=this.options.values[d];g=this._trimValue(g);return g}else{var f=this.options.values.slice();for(var e=0,c=f.length;e<c;e++){f[e]=this._trimValue(f[e])}return f}},_trimValue:function(c){if(c<this._valueMin()){c=this._valueMin()}if(c>this._valueMax()){c=this._valueMax()}return c},_valueMin:function(){var c=this.options.min;return c},_valueMax:function(){var c=this.options.max;return c},_refreshValue:function(){var g=this.options.range,e=this.options,m=this;var d=(!this._animateOff)?e.animate:false;if(this.options.values&&this.options.values.length){var j,i;this.handles.each(function(q,o){var p=(m.values(q)-m._valueMin())/(m._valueMax()-m._valueMin())*100;var n={};n[m.orientation=="horizontal"?"left":"bottom"]=p+"%";b(this).stop(1,1)[d?"animate":"css"](n,e.animate);if(m.options.range===true){if(m.orientation=="horizontal"){(q==0)&&m.range.stop(1,1)[d?"animate":"css"]({left:p+"%"},e.animate);(q==1)&&m.range[d?"animate":"css"]({width:(p-lastValPercent)+"%"},{queue:false,duration:e.animate})}else{(q==0)&&m.range.stop(1,1)[d?"animate":"css"]({bottom:(p)+"%"},e.animate);(q==1)&&m.range[d?"animate":"css"]({height:(p-lastValPercent)+"%"},{queue:false,duration:e.animate})}}lastValPercent=p})}else{var k=this.value(),h=this._valueMin(),l=this._valueMax(),f=l!=h?(k-h)/(l-h)*100:0;var c={};c[m.orientation=="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[d?"animate":"css"](c,e.animate);(g=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[d?"animate":"css"]({width:f+"%"},e.animate);(g=="max")&&(this.orientation=="horizontal")&&this.range[d?"animate":"css"]({width:(100-f)+"%"},{queue:false,duration:e.animate});(g=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[d?"animate":"css"]({height:f+"%"},e.animate);(g=="max")&&(this.orientation=="vertical")&&this.range[d?"animate":"css"]({height:(100-f)+"%"},{queue:false,duration:e.animate})}}});b.extend(b.ui.slider,{version:"1.8"})})(jQuery);; |
| | |
| | | /* |
| | | * jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010 |
| | | * http://benalman.com/projects/jquery-bbq-plugin/ |
| | | * |
| | | * |
| | | * Copyright (c) 2010 "Cowboy" Ben Alman |
| | | * Dual licensed under the MIT and GPL licenses. |
| | | * http://benalman.com/about/license/ |
| | |
| | | /* |
| | | * jQuery hashchange event - v1.2 - 2/11/2010 |
| | | * http://benalman.com/projects/jquery-hashchange-plugin/ |
| | | * |
| | | * |
| | | * Copyright (c) 2010 "Cowboy" Ben Alman |
| | | * Dual licensed under the MIT and GPL licenses. |
| | | * http://benalman.com/about/license/ |
| | | */ |
| | | (function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this); |
| | | (function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this); |
| | |
| | | #About |
| | | **jQuery Hotkeys** is a plug-in that lets you easily add and remove handlers for keyboard events anywhere in your code supporting almost any key combination. |
| | | **jQuery Hotkeys** is a plug-in that lets you easily add and remove handlers for keyboard events anywhere in your code supporting almost any key combination. |
| | | |
| | | This plugin is based off of the plugin by Tzury Bar Yochay: [jQuery.hotkeys](http://github.com/tzuryby/hotkeys) |
| | | |
| | |
| | | |
| | | $(expression).bind(types, keys, handler); |
| | | $(expression).unbind(types, handler); |
| | | |
| | | |
| | | $(document).bind('keydown', 'ctrl+a', fn); |
| | | |
| | | |
| | | // e.g. replace '$' sign with 'EUR' |
| | | $('input.foo').bind('keyup', '$', function(){ |
| | | this.value = this.value.replace('$', 'EUR'); |
| | |
| | | |
| | | Others, (IE) either let you handle built-in short-cuts, but will add their functionality after your code has executed. Or (Opera/Safari) will *not* pass those events to the DOM at all. |
| | | |
| | | *So, if you bind `Ctrl-Q` or `Alt-F4` and your Safari/Opera window is closed don't be surprised.* |
| | | *So, if you bind `Ctrl-Q` or `Alt-F4` and your Safari/Opera window is closed don't be surprised.* |
| | |
| | | * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/ |
| | | */ |
| | | |
| | | (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<f;j++){if(g[e[j]]){return c.apply(this,arguments)}}}}b.each(["keydown","keyup","keypress"],function(){b.event.special[this]={add:a}})})(jQuery); |
| | | (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<f;j++){if(g[e[j]]){return c.apply(this,arguments)}}}}b.each(["keydown","keyup","keypress"],function(){b.event.special[this]={add:a}})})(jQuery); |
| | |
| | | * Thanks to: Seamus Leahy for adding deltaX and deltaY |
| | | * |
| | | * Version: 3.0.6 |
| | | * |
| | | * |
| | | * Requires: 1.2.2+ |
| | | */ |
| | | |
| | |
| | | this.onmousewheel = handler; |
| | | } |
| | | }, |
| | | |
| | | |
| | | teardown: function() { |
| | | if ( this.removeEventListener ) { |
| | | for ( var i=types.length; i; ) { |
| | |
| | | mousewheel: function(fn) { |
| | | return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); |
| | | }, |
| | | |
| | | |
| | | unmousewheel: function(fn) { |
| | | return this.unbind("mousewheel", fn); |
| | | } |
| | |
| | | var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0; |
| | | event = $.event.fix(orgEvent); |
| | | event.type = "mousewheel"; |
| | | |
| | | |
| | | // Old school scrollwheel delta |
| | | if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; } |
| | | if ( orgEvent.detail ) { delta = -orgEvent.detail/3; } |
| | | |
| | | |
| | | // New school multidimensional scroll (touchpads) deltas |
| | | deltaY = delta; |
| | | |
| | | |
| | | // Gecko |
| | | if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { |
| | | deltaY = 0; |
| | | deltaX = -1*delta; |
| | | } |
| | | |
| | | |
| | | // Webkit |
| | | if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; } |
| | | if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; } |
| | | |
| | | |
| | | // Add event and delta to the front of the arguments |
| | | args.unshift(event, delta, deltaX, deltaY); |
| | | |
| | | |
| | | return ($.event.dispatch || $.event.handle).apply(this, args); |
| | | } |
| | | |
| | | })(jQuery); |
| | | })(jQuery); |
| | |
| | | return builder.pathSegList; |
| | | } |
| | | } |
| | | }()); |
| | | }()); |
| | |
| | | var vendors = ['ms', 'moz', 'webkit', 'o']; |
| | | for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { |
| | | window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; |
| | | window.cancelAnimationFrame = |
| | | window.cancelAnimationFrame = |
| | | window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame']; |
| | | } |
| | | |
| | | |
| | | if (!window.requestAnimationFrame) |
| | | window.requestAnimationFrame = function(callback, element) { |
| | | var currTime = new Date().getTime(); |
| | | var timeToCall = Math.max(0, 16 - (currTime - lastTime)); |
| | | var id = window.setTimeout(function() { callback(currTime + timeToCall); }, |
| | | var id = window.setTimeout(function() { callback(currTime + timeToCall); }, |
| | | timeToCall); |
| | | lastTime = currTime + timeToCall; |
| | | return id; |
| | | }; |
| | | |
| | | |
| | | if (!window.cancelAnimationFrame) |
| | | window.cancelAnimationFrame = function(id) { |
| | | clearTimeout(id); |
| | |
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | * See the License for the specific language governing permissions and |
| | | * limitations under the License. |
| | | * |
| | | * |
| | | * @author Guido Marucci Blas - guido@zaubersoftware.com |
| | | * @description Adds a handler for a custom event 'taphold' that handles a |
| | | * tap and hold on touch interfaces. |
| | |
| | | startTapAndHoldDetector.call(this, event) |
| | | var element = $(this); |
| | | element.bind(TOUCHMOVE, onTouchMove); |
| | | element.bind(TOUCHEND, onTouchEnd); |
| | | element.bind(TOUCHEND, onTouchEnd); |
| | | } else { |
| | | stopTapAndHoldDetector.call(this); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | function onTouchMove(event) { |
| | |
| | | var e = event.originalEvent; |
| | | var x = (e.changedTouches) ? e.changedTouches[0].pageX: e.pageX; |
| | | var y = (e.changedTouches) ? e.changedTouches[0].pageY: e.pageY; |
| | | |
| | | |
| | | var tapAndHoldPoint = $(this).data("taphold.point"); |
| | | var euclideanDistance = calculateEuclideanDistance(tapAndHoldPoint.x, tapAndHoldPoint.y, x, y); |
| | | |
| | | |
| | | if (euclideanDistance > MAX_DISTANCE_ALLOWED_IN_TAP_AND_HOLD_EVENT) { |
| | | stopTapAndHoldDetector.call(this); |
| | | } |
| | |
| | | function clear() { |
| | | tapAndHoldTimer = null; |
| | | $(this).unbind(TOUCHMOVE, onTouchMove); |
| | | $(this).unbind(TOUCHEND, onTouchEnd); |
| | | $(this).unbind(TOUCHEND, onTouchEnd); |
| | | }; |
| | | |
| | | function startTapAndHoldDetector(event) { |
| | |
| | | |
| | | function stopTapAndHoldDetector() { |
| | | clearTimeout(tapAndHoldTimer); |
| | | clear.call(this); |
| | | clear.call(this); |
| | | }; |
| | | |
| | | $.event.special["taphold"] = { |
| | | setup: function() { |
| | | |
| | | |
| | | }, |
| | | |
| | | add: function(handleObj) { |
| | |
| | | }, |
| | | |
| | | teardown: function() { |
| | | |
| | | |
| | | } |
| | | }; |
| | | |
| | | })(jQuery); |
| | | })(jQuery); |
| | |
| | | function touchHandler(event) |
| | | { |
| | | |
| | | { |
| | | |
| | | var touches = event.changedTouches, |
| | | first = touches[0], |
| | | type = ""; |
| | | switch(event.type) |
| | | { |
| | | case "touchstart": type="mousedown"; break; |
| | | case "touchmove": type="mousemove"; break; |
| | | case "touchmove": type="mousemove"; break; |
| | | case "touchend": type="mouseup"; break; |
| | | default: return; |
| | | } |
| | | |
| | | //initMouseEvent(type, canBubble, cancelable, view, clickCount, |
| | | // screenX, screenY, clientX, clientY, ctrlKey, |
| | | //initMouseEvent(type, canBubble, cancelable, view, clickCount, |
| | | // screenX, screenY, clientX, clientY, ctrlKey, |
| | | // altKey, shiftKey, metaKey, button, relatedTarget); |
| | | |
| | | |
| | | var simulatedEvent = document.createEvent("MouseEvent"); |
| | | simulatedEvent.initMouseEvent(type, true, true, window, 1, |
| | | first.screenX, first.screenY, |
| | | first.clientX, first.clientY, false, |
| | | simulatedEvent.initMouseEvent(type, true, true, window, 1, |
| | | first.screenX, first.screenY, |
| | | first.clientX, first.clientY, false, |
| | | false, false, false, 0/*left*/, null); |
| | | if(touches.length < 2) { |
| | | first.target.dispatchEvent(simulatedEvent); |
| | |
| | | #stroke_style_label{font-size:30px;margin-top:33px;letter-spacing:-1px} |
| | | .stroke_tool .caret{top:60%} |
| | | #tool_align_relative{position:absolute;top:-5px;left:0;right:20px;display:block} |
| | | #tool_align_relative select{width:100%;display:block} |
| | | #tool_align_relative select{width:100%;display:block} |
| | |
| | | var supportsNativeSVGTransformLists_ = (function() { |
| | | var rect = document.createElementNS(svgns, 'rect'); |
| | | var rxform = rect.transform.baseVal; |
| | | |
| | | |
| | | var t1 = svg.createSVGTransform(); |
| | | rxform.appendItem(t1); |
| | | return rxform.getItem(0) == t1; |
| | |
| | | // 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 |
| | | // 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('<p>'+msg.replace(/\n/g,'</p><p>')+'</p>') |
| | | .toggleClass('prompt',(type=='prompt')); |
| | | btn_holder.empty(); |
| | | |
| | | |
| | | var ok = $('<input type="button" value="' + uiStrings.common.ok + '">').appendTo(btn_holder); |
| | | |
| | | |
| | | if(type != 'alert') { |
| | | $('<input type="button" value="' + uiStrings.common.cancel + '">') |
| | | .appendTo(btn_holder) |
| | | .on("click touchstart", function() { box.hide();callback(false)}); |
| | | } |
| | | |
| | | |
| | | if(type == 'prompt') { |
| | | var input = $('<input type="text">').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() { |
| | | |
| | | 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);}; |
| | | }()); |
| | | }()); |
| | |
| | | |
| | | reader.readAsDataURL(e.dataTransfer.files[0]); |
| | | }, false); |
| | | } |
| | | } |
| | |
| | | |
| | | // Called to ensure that drawings will or will not have randomized ids. |
| | | // The current_drawing will have its nonce set if it doesn't already. |
| | | // |
| | | // |
| | | // Params: |
| | | // enableRandomization - flag indicating if documents should have randomized ids |
| | | svgedit.draw.randomizeIds = function(enableRandomization, current_drawing) { |
| | |
| | | * @type {SVGSVGElement} |
| | | */ |
| | | this.svgElem_ = svgElem; |
| | | |
| | | |
| | | /** |
| | | * The latest object number used in this drawing. |
| | | * @type {number} |
| | | */ |
| | | this.obj_num = 0; |
| | | |
| | | |
| | | /** |
| | | * The prefix to prepend to each element id in the drawing. |
| | | * @type {String} |
| | | */ |
| | | this.idPrefix = opt_idPrefix || "svg_"; |
| | | |
| | | |
| | | /** |
| | | * An array of released element ids to immediately reuse. |
| | | * @type {Array.<number>} |
| | |
| | | var oldObjNum = this.obj_num; |
| | | var restoreOldObjNum = false; |
| | | |
| | | // If there are any released numbers in the release stack, |
| | | // If there are any released numbers in the release stack, |
| | | // use the last one instead of the next obj_num. |
| | | // We need to temporarily use obj_num as that is what getId() depends on. |
| | | if (this.releasedNums.length > 0) { |
| | |
| | | if (typeof num != typeof 1 || num <= 0 || this.releasedNums.indexOf(num) != -1) { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | // push the released number into the released queue |
| | | this.releasedNums.push(num); |
| | | |
| | |
| | | |
| | | // Function: svgedit.draw.Drawing.getNumLayers |
| | | // Returns the number of layers in the current drawing. |
| | | // |
| | | // |
| | | // Returns: |
| | | // The number of layers in the current drawing. |
| | | svgedit.draw.Drawing.prototype.getNumLayers = function() { |
| | |
| | | // |
| | | // Parameters: |
| | | // i - the zero-based index of the layer you are querying. |
| | | // |
| | | // |
| | | // Returns: |
| | | // The name of the ith layer |
| | | svgedit.draw.Drawing.prototype.getLayerName = function(i) { |
| | |
| | | }; |
| | | |
| | | // Function: getCurrentLayerName |
| | | // Returns the name of the currently selected layer. If an error occurs, an empty string |
| | | // Returns the name of the currently selected layer. If an error occurs, an empty string |
| | | // is returned. |
| | | // |
| | | // Returns: |
| | |
| | | |
| | | |
| | | // Function: svgedit.draw.Drawing.deleteCurrentLayer |
| | | // Deletes the current layer from the drawing and then clears the selection. This function |
| | | // Deletes the current layer from the drawing and then clears the selection. This function |
| | | // then calls the 'changed' handler. This is an undoable action. |
| | | // Returns: |
| | | // The SVGGElement of the layer removed or null. |
| | |
| | | if (child.tagName == "g") { |
| | | childgroups = true; |
| | | var name = $("title",child).text(); |
| | | |
| | | |
| | | // Hack for Opera 10.60 |
| | | if(!name && svgedit.browser.isOpera() && child.querySelectorAll) { |
| | | name = $(child.querySelectorAll('title')).text(); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // create a new layer and add all the orphans to it |
| | | var svgdoc = this.svgElem_.ownerDocument; |
| | | if (orphans.length > 0 || !childgroups) { |
| | |
| | | }; |
| | | |
| | | // Function: svgedit.draw.Drawing.createLayer |
| | | // Creates a new top-level layer in the drawing with the given name and |
| | | // Creates a new top-level layer in the drawing with the given name and |
| | | // sets the current layer to it. |
| | | // |
| | | // Parameters: |
| | |
| | | }; |
| | | |
| | | // Function: svgedit.draw.Drawing.setLayerVisibility |
| | | // Sets the visibility of the layer. If the layer name is not valid, this function return |
| | | // Sets the visibility of the layer. If the layer name is not valid, this function return |
| | | // false, otherwise it returns true. This is an undo-able action. |
| | | // |
| | | // Parameters: |
| | |
| | | } |
| | | } |
| | | if (!layer) return null; |
| | | |
| | | |
| | | var oldDisplay = layer.getAttribute("display"); |
| | | if (!oldDisplay) oldDisplay = "inline"; |
| | | layer.setAttribute("display", bVisible ? "inline" : "none"); |
| | |
| | | // Function: svgedit.draw.Drawing.getLayerOpacity |
| | | // Returns the opacity of the given layer. If the input name is not a layer, null is returned. |
| | | // |
| | | // Parameters: |
| | | // Parameters: |
| | | // layername - name of the layer on which to get the opacity |
| | | // |
| | | // Returns: |
| | |
| | | //initialize communication |
| | | this.frame = frame; |
| | | this.stack = []; //callback stack |
| | | |
| | | |
| | | var editapi = this; |
| | | |
| | | |
| | | window.addEventListener("message", function(e){ |
| | | if(e.data.substr(0,5) == "ERROR"){ |
| | | editapi.stack.splice(0,1)[0](e.data,"error") |
| | |
| | | } |
| | | }) |
| | | |
| | | Everything is done with the same API as the real svg-edit, |
| | | Everything is done with the same API as the real svg-edit, |
| | | and all documentation is unchanged. The only difference is |
| | | when handling returns, the callback notation is used instead. |
| | | when handling returns, the callback notation is used instead. |
| | | |
| | | var blah = new embedded_svg_edit(window.frames['svgedit']); |
| | | blah.clearSelection("woot","blah",1337,[1,2,3,4,5,"moo"],-42,{a: "tree",b:6, c: 9})(function(){console.log("GET DATA",arguments)}) |
| | |
| | | this.encode = embedded_svg_edit.encode; |
| | | //List of functions extracted with this: |
| | | //Run in firebug on http://svg-edit.googlecode.com/svn/trunk/docs/files/svgcanvas-js.html |
| | | |
| | | |
| | | //for(var i=0,q=[],f = document.querySelectorAll("div.CFunction h3.CTitle a");i<f.length;i++){q.push(f[i].name)};q |
| | | //var functions = ["clearSelection", "addToSelection", "removeFromSelection", "open", "save", "getSvgString", "setSvgString", |
| | | //"createLayer", "deleteCurrentLayer", "setCurrentLayer", "renameCurrentLayer", "setCurrentLayerPosition", "setLayerVisibility", |
| | | //"moveSelectedToLayer", "clear"]; |
| | | |
| | | |
| | | |
| | | |
| | | //Newer, well, it extracts things that aren't documented as well. All functions accessible through the normal thingy can now be accessed though the API |
| | | //var l=[];for(var i in svgCanvas){if(typeof svgCanvas[i] == "function"){l.push(i)}}; |
| | | //run in svgedit itself |
| | |
| | | "getStrokedBBox", "getVisibleElements", "cycleElement", "getUndoStackSize", "getRedoStackSize", "getNextUndoCommandText", |
| | | "getNextRedoCommandText", "undo", "redo", "cloneSelectedElements", "alignSelectedElements", "getZoom", "getVersion", |
| | | "setIconSize", "setLang", "setCustomHandlers"]; |
| | | |
| | | |
| | | //TODO: rewrite the following, it's pretty scary. |
| | | for(var i = 0; i < functions.length; i++){ |
| | | this[functions[i]] = (function(d){ |
| | |
| | | args.push(arguments[g]); |
| | | } |
| | | var cbid = t.send(d,args, function(){}) //the callback (currently it's nothing, but will be set later |
| | | |
| | | |
| | | return function(newcallback){ |
| | | t.callbacks[cbid] = newcallback; //set callback |
| | | } |
| | |
| | | //simple partial JSON encoder implementation |
| | | if(window.JSON && JSON.stringify) return JSON.stringify(obj); |
| | | var enc = arguments.callee; //for purposes of recursion |
| | | |
| | | |
| | | if(typeof obj == "boolean" || typeof obj == "number"){ |
| | | return obj+'' //should work... |
| | | }else if(typeof obj == "string"){ |
| | |
| | | if (handler) { |
| | | handler.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_UNAPPLY, this); |
| | | } |
| | | |
| | | |
| | | this.elem = this.oldParent.insertBefore(this.elem, this.oldNextSibling); |
| | | |
| | | if (handler) { |
| | |
| | | |
| | | // Function: svgedit.history.InsertElementCommand.apply |
| | | // Re-Inserts the new element |
| | | svgedit.history.InsertElementCommand.prototype.apply = function(handler) { |
| | | svgedit.history.InsertElementCommand.prototype.apply = function(handler) { |
| | | if (handler) { |
| | | handler.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_APPLY, this); |
| | | } |
| | | |
| | | this.elem = this.parent.insertBefore(this.elem, this.nextSibling); |
| | | this.elem = this.parent.insertBefore(this.elem, this.nextSibling); |
| | | |
| | | if (handler) { |
| | | handler.handleHistoryEvent(svgedit.history.HistoryEventTypes.AFTER_APPLY, this); |
| | |
| | | |
| | | // Function: RemoveElementCommand.apply |
| | | // Re-removes the new element |
| | | svgedit.history.RemoveElementCommand.prototype.apply = function(handler) { |
| | | svgedit.history.RemoveElementCommand.prototype.apply = function(handler) { |
| | | if (handler) { |
| | | handler.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_APPLY, this); |
| | | } |
| | |
| | | |
| | | // Function: RemoveElementCommand.unapply |
| | | // Re-adds the new element |
| | | svgedit.history.RemoveElementCommand.prototype.unapply = function(handler) { |
| | | svgedit.history.RemoveElementCommand.prototype.unapply = function(handler) { |
| | | if (handler) { |
| | | handler.handleHistoryEvent(svgedit.history.HistoryEventTypes.BEFORE_UNAPPLY, this); |
| | | } |
| | |
| | | |
| | | // Class: svgedit.history.ChangeElementCommand |
| | | // implements svgedit.history.HistoryCommand |
| | | // History command to make a change to an element. |
| | | // History command to make a change to an element. |
| | | // Usually an attribute change, but can also be textcontent. |
| | | // |
| | | // Parameters: |
| | |
| | | this.undoChangeStackPointer = -1; |
| | | this.undoableChangeStack = []; |
| | | }; |
| | | |
| | | |
| | | // Function: svgedit.history.UndoManager.resetUndoStack |
| | | // Resets the undo stack, effectively clearing the undo/redo history |
| | | svgedit.history.UndoManager.prototype.resetUndoStack = function() { |
| | |
| | | }; |
| | | |
| | | // Function: svgedit.history.UndoManager.getUndoStackSize |
| | | // Returns: |
| | | // Returns: |
| | | // Integer with the current size of the undo history stack |
| | | svgedit.history.UndoManager.prototype.getUndoStackSize = function() { |
| | | return this.undoStackPointer; |
| | | }; |
| | | |
| | | // Function: svgedit.history.UndoManager.getRedoStackSize |
| | | // Returns: |
| | | // Returns: |
| | | // Integer with the current size of the redo history stack |
| | | svgedit.history.UndoManager.prototype.getRedoStackSize = function() { |
| | | return this.undoStack.length - this.undoStackPointer; |
| | | }; |
| | | |
| | | // Function: svgedit.history.UndoManager.getNextUndoCommandText |
| | | // Returns: |
| | | // Returns: |
| | | // String associated with the next undo command |
| | | svgedit.history.UndoManager.prototype.getNextUndoCommandText = function() { |
| | | svgedit.history.UndoManager.prototype.getNextUndoCommandText = function() { |
| | | return this.undoStackPointer > 0 ? this.undoStack[this.undoStackPointer-1].getText() : ""; |
| | | }; |
| | | |
| | | // Function: svgedit.history.UndoManager.getNextRedoCommandText |
| | | // Returns: |
| | | // Returns: |
| | | // String associated with the next redo command |
| | | svgedit.history.UndoManager.prototype.getNextRedoCommandText = function() { |
| | | svgedit.history.UndoManager.prototype.getNextRedoCommandText = function() { |
| | | return this.undoStackPointer < this.undoStack.length ? this.undoStack[this.undoStackPointer].getText() : ""; |
| | | }; |
| | | |
| | |
| | | } |
| | | }; |
| | | |
| | | // Function: svgedit.history.UndoManager.redo |
| | | // Function: svgedit.history.UndoManager.redo |
| | | // Performs a redo step |
| | | svgedit.history.UndoManager.prototype.redo = function() { |
| | | if (this.undoStackPointer < this.undoStack.length && this.undoStack.length > 0) { |
| | |
| | | cmd.apply(this.handler_); |
| | | } |
| | | }; |
| | | |
| | | |
| | | // Function: svgedit.history.UndoManager.addCommandToHistory |
| | | // Adds a command object to the undo history stack |
| | | // |
| | | // Parameters: |
| | | // Parameters: |
| | | // cmd - The command object to add |
| | | svgedit.history.UndoManager.prototype.addCommandToHistory = function(cmd) { |
| | | // FIXME: we MUST compress consecutive text changes to the same element |
| | | // (right now each keystroke is saved as a separate command that includes the |
| | | // entire text contents of the text element) |
| | | // TODO: consider limiting the history that we store here (need to do some slicing) |
| | | |
| | | |
| | | // if our stack pointer is not at the end, then we have to remove |
| | | // all commands after the pointer and insert the new command |
| | | if (this.undoStackPointer < this.undoStack.length && this.undoStack.length > 0) { |
| | |
| | | |
| | | |
| | | // Function: svgedit.history.UndoManager.beginUndoableChange |
| | | // This function tells the canvas to remember the old values of the |
| | | // attrName attribute for each element sent in. The elements and values |
| | | // are stored on a stack, so the next call to finishUndoableChange() will |
| | | // This function tells the canvas to remember the old values of the |
| | | // attrName attribute for each element sent in. The elements and values |
| | | // are stored on a stack, so the next call to finishUndoableChange() will |
| | | // pop the elements and old values off the stack, gets the current values |
| | | // from the DOM and uses all of these to construct the undo-able command. |
| | | // |
| | | // Parameters: |
| | | // Parameters: |
| | | // attrName - The name of the attribute being changed |
| | | // elems - Array of DOM elements being changed |
| | | svgedit.history.UndoManager.prototype.beginUndoableChange = function(attrName, elems) { |
| | |
| | | // change since beginUndoableChange was called. The command can then |
| | | // be added to the command history |
| | | // |
| | | // Returns: |
| | | // Returns: |
| | | // Batch command object with resulting changes |
| | | svgedit.history.UndoManager.prototype.finishUndoableChange = function() { |
| | | var p = this.undoChangeStackPointer--; |
| | |
| | | }; |
| | | |
| | | |
| | | })(); |
| | | })(); |
| | |
| | | // Function: svgedit.math.transformPoint |
| | | // A (hopefully) quicker function to transform a point by a matrix |
| | | // (this function avoids any DOM calls and just does the math) |
| | | // |
| | | // |
| | | // Parameters: |
| | | // x - Float representing the x coordinate |
| | | // y - Float representing the y coordinate |
| | |
| | | |
| | | |
| | | // Function: svgedit.math.isIdentity |
| | | // Helper function to check if the matrix performs no actual transform |
| | | // Helper function to check if the matrix performs no actual transform |
| | | // (i.e. exists for identity purposes) |
| | | // |
| | | // Parameters: |
| | | // Parameters: |
| | | // m - The matrix object to check |
| | | // |
| | | // Returns: |
| | |
| | | // Function: svgedit.math.matrixMultiply |
| | | // This function tries to return a SVGMatrix that is the multiplication m1*m2. |
| | | // We also round to zero when it's near zero |
| | | // |
| | | // |
| | | // Parameters: |
| | | // >= 2 Matrix objects to multiply |
| | | // |
| | | // Returns: |
| | | // Returns: |
| | | // The matrix object resulting from the calculation |
| | | svgedit.math.matrixMultiply = function() { |
| | | var args = arguments, i = args.length, m = args[i-1]; |
| | | |
| | | |
| | | while(i-- > 1) { |
| | | var m1 = args[i-1]; |
| | | m = m1.multiply(m); |
| | |
| | | if (Math.abs(m.d) < NEAR_ZERO) m.d = 0; |
| | | if (Math.abs(m.e) < NEAR_ZERO) m.e = 0; |
| | | if (Math.abs(m.f) < NEAR_ZERO) m.f = 0; |
| | | |
| | | |
| | | return m; |
| | | }; |
| | | |
| | | // Function: svgedit.math.hasMatrixTransform |
| | | // See if the given transformlist includes a non-indentity matrix transform |
| | | // |
| | | // Parameters: |
| | | // Parameters: |
| | | // tlist - The transformlist to check |
| | | // |
| | | // Returns: |
| | | // Returns: |
| | | // Boolean on whether or not a matrix transform was found |
| | | svgedit.math.hasMatrixTransform = function(tlist) { |
| | | if(!tlist) return false; |
| | |
| | | // w - Float with the box width |
| | | // h - Float with the box height |
| | | // m - Matrix object to transform the box by |
| | | // |
| | | // |
| | | // Returns: |
| | | // An object with the following values: |
| | | // * tl - The top left coordinate (x,y object) |
| | |
| | | miny = Math.min(miny, botright.y); |
| | | maxy = Math.max(maxy, botright.y); |
| | | |
| | | return {tl:topleft, tr:topright, bl:botleft, br:botright, |
| | | return {tl:topleft, tr:topright, bl:botleft, br:botright, |
| | | aabox: {x:minx, y:miny, width:(maxx-minx), height:(maxy-miny)} }; |
| | | }; |
| | | |
| | |
| | | // (this is the equivalent of SVGTransformList.consolidate() but unlike |
| | | // that method, this one does not modify the actual SVGTransformList) |
| | | // This function is very liberal with its min,max arguments |
| | | // |
| | | // |
| | | // Parameters: |
| | | // tlist - The transformlist object |
| | | // min - Optional integer indicating start transform position |
| | |
| | | var m = svg.createSVGMatrix(); |
| | | for (var i = min; i <= max; ++i) { |
| | | // if our indices are out of range, just use a harmless identity matrix |
| | | var mtom = (i >= 0 && i < tlist.numberOfItems ? |
| | | var mtom = (i >= 0 && i < tlist.numberOfItems ? |
| | | tlist.getItem(i).matrix : |
| | | svg.createSVGMatrix()); |
| | | m = svgedit.math.matrixMultiply(m, mtom); |
| | |
| | | // |
| | | // Parameters: |
| | | // elem - The DOM element to check |
| | | // |
| | | // |
| | | // Returns: |
| | | // The matrix object associated with the element's transformlist |
| | | svgedit.math.getMatrix = function(elem) { |
| | |
| | | |
| | | |
| | | // Function: svgedit.math.snapToAngle |
| | | // Returns a 45 degree angle coordinate associated with the two given |
| | | // Returns a 45 degree angle coordinate associated with the two given |
| | | // coordinates |
| | | // |
| | | // |
| | | // Parameters: |
| | | // x1 - First coordinate's x value |
| | | // x2 - Second coordinate's x value |
| | | // y1 - First coordinate's y value |
| | | // y2 - Second coordinate's y value |
| | | // |
| | | // Returns: |
| | | // Returns: |
| | | // Object with the following values: |
| | | // x - The angle-snapped x value |
| | | // y - The angle-snapped y value |
| | |
| | | var angle = Math.atan2(dy,dx); |
| | | var dist = Math.sqrt(dx * dx + dy * dy); |
| | | var snapangle= Math.round(angle/snap)*snap; |
| | | var x = x1 + dist*Math.cos(snapangle); |
| | | var x = x1 + dist*Math.cos(snapangle); |
| | | var y = y1 + dist*Math.sin(snapangle); |
| | | //console.log(x1,y1,x2,y2,x,y,angle) |
| | | return {x:x, y:y, a:snapangle}; |
| | |
| | | // Boolean that's true if rectangles intersect |
| | | svgedit.math.rectsIntersect = function(r1, r2) { |
| | | if (!r1 || !r2) return false; |
| | | return r2.x < (r1.x+r1.width) && |
| | | return r2.x < (r1.x+r1.width) && |
| | | (r2.x+r2.width) > r1.x && |
| | | r2.y < (r1.y+r1.height) && |
| | | (r2.y+r2.height) > r1.y; |
| | | }; |
| | | |
| | | |
| | | })(); |
| | | })(); |
| | |
| | | document.addEventListener("touchmove", touchHandler, true); |
| | | document.addEventListener("touchend", touchHandler, true); |
| | | document.addEventListener("touchcancel", touchHandler, true); |
| | | |
| | | |
| | | if(!window.methodDraw) window.methodDraw = function($) { |
| | | var svgCanvas; |
| | | var Editor = {}; |
| | | var is_ready = false; |
| | | curConfig = { |
| | | canvas_expansion: 1, |
| | | dimensions: [580,400], |
| | | canvas_expansion: 1, |
| | | dimensions: [580,400], |
| | | initFill: {color: 'fff', opacity: 1}, |
| | | initStroke: {width: 1.5, color: '000', opacity: 1}, |
| | | initOpacity: 1, |
| | |
| | | "key_down":"Down", |
| | | "key_backspace":"Backspace", |
| | | "key_del":"Del" |
| | | |
| | | |
| | | }, |
| | | // This is needed if the locale is English, since the locale strings are not read in that instance. |
| | | layers: { |
| | |
| | | "retrieving": 'Retrieving "%s" ...' |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | var curPrefs = {}; //$.extend({}, defaultPrefs); |
| | | var customHandlers = {}; |
| | | Editor.curConfig = curConfig; |
| | | Editor.tool_scale = 1; |
| | | |
| | | |
| | | Editor.setConfig = function(opts) { |
| | | $.extend(true, curConfig, opts); |
| | | if(opts.extensions) { |
| | | curConfig.extensions = opts.extensions; |
| | | } |
| | | } |
| | | |
| | | |
| | | // 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 |
| | | // - 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) { |
| | |
| | | customHandlers = opts; |
| | | }); |
| | | } |
| | | |
| | | |
| | | Editor.randomizeIds = function() { |
| | | svgCanvas.randomizeIds(arguments) |
| | | } |
| | |
| | | $("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; |
| | |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | |
| | | // Load extensions |
| | | // Bit of a hack to run extensions in local Opera/IE9 |
| | | if(document.location.protocol === 'file:') { |
| | |
| | | 'zoom':'zoom.png', |
| | | 'delete':'delete.png', |
| | | 'spapelib':'shapelib.png', |
| | | 'node_delete':'node_delete.png', |
| | | 'node_delete':'node_delete.png', |
| | | 'align_left':'align-left.png', |
| | | 'align_center':'align-center.png', |
| | | 'align_right':'align-right.png', |
| | |
| | | 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'); |
| | |
| | | } |
| | | }); |
| | | 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, |
| | |
| | | $("#base_unit_container") |
| | | .on("mouseleave mouseenter", function(e){ |
| | | t = setTimeout(function(){$("#base_unit_container").fadeOut(500)}, 200) |
| | | if(event.type == "mouseover") clearTimeout(t) |
| | | if(event.type == "mouseover") clearTimeout(t) |
| | | }) |
| | | $("#base_unit") |
| | | .on("change", function(e) { |
| | |
| | | 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", |
| | | 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", |
| | | "#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), |
| | |
| | | default_img_url = curConfig.imgPath + "placeholder.svg", |
| | | workarea = $("#workarea"), |
| | | canv_menu = $("#cmenu_canvas"), |
| | | exportWindow = null, |
| | | exportWindow = null, |
| | | tool_scale = 1, |
| | | ui_context = 'toolbars', |
| | | orig_source = ''; |
| | | |
| | | |
| | | |
| | | // This puts the correct shortcuts in the menus |
| | | if (!isMac) { |
| | | $('.shortcut').each(function(){ |
| | | var text = $(this).text(); |
| | | $(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 |
| | | // 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('<p>'+msg.replace(/\n/g,'</p><p>')+'</p>') |
| | | .toggleClass('prompt',(type=='prompt')); |
| | | btn_holder.empty(); |
| | | |
| | | |
| | | var ok = $('<input type="button" value="' + uiStrings.common.ok + '">').appendTo(btn_holder); |
| | | |
| | | |
| | | if(type != 'alert') { |
| | | $('<input type="button" value="' + uiStrings.common.cancel + '">') |
| | | .appendTo(btn_holder) |
| | | .on("click touchstart", function() { box.hide();callback(false)}); |
| | | } |
| | | |
| | | |
| | | if(type == 'prompt') { |
| | | var input = $('<input type="text">').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() { |
| | | |
| | | 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'); |
| | | if(curr.length && curr[0].id !== 'tool_select') { |
| | |
| | | } |
| | | svgCanvas.setMode('select'); |
| | | }; |
| | | |
| | | |
| | | var setEyedropperMode = function() { |
| | | var curr = $('.tool_button_current'); |
| | | if(curr.length && curr[0].id !== 'tool_eyedropper') { |
| | |
| | | } |
| | | svgCanvas.setMode('eyedropper'); |
| | | } |
| | | |
| | | |
| | | var togglePathEditMode = function(editmode, elems) { |
| | | $('#tools_bottom_2,#tools_bottom_3').toggle(!editmode); |
| | | if(editmode) { |
| | |
| | | selector.reset(elems[0]); |
| | | selector.selectorRect.setAttribute('display', 'inline'); |
| | | } |
| | | |
| | | |
| | | setIcon('#tool_select', 'select'); |
| | | } |
| | | } |
| | | |
| | | |
| | | // used to make the flyouts stay on the screen longer the very first time |
| | | var flyoutspeed = 1250; |
| | | var textBeingEntered = false; |
| | |
| | | var docprops = false; |
| | | var preferences = false; |
| | | var cur_context = ''; |
| | | |
| | | |
| | | var saveHandler = function(window,svg) { |
| | | Editor.show_save_warning = false; |
| | | |
| | | // by default, we add the XML prolog back, systems integrating SVG-edit (wikis, CMSs) |
| | | |
| | | // by default, we add the XML prolog back, systems integrating SVG-edit (wikis, CMSs) |
| | | // can just provide their own custom save handler and might not want the XML prolog |
| | | svg = '<?xml version="1.0"?>\n' + svg; |
| | | |
| | | |
| | | // Opens the SVG in new window, with warning about Mozilla bug #308590 when applicable |
| | | |
| | | |
| | | var ua = navigator.userAgent; |
| | | |
| | | // Chrome 5 (and 6?) don't allow saving, show source instead ( http://code.google.com/p/chromium/issues/detail?id=46735 ) |
| | | // IE9 doesn't allow standalone Data URLs ( https://connect.microsoft.com/IE/feedback/details/542600/data-uri-images-fail-when-loaded-by-themselves ) |
| | | if(~ua.indexOf('MSIE')) { |
| | | showSourceEditor(0,true); |
| | | return; |
| | | return; |
| | | } |
| | | var win = window.open("data:image/svg+xml;base64," + Utils.encode64(svg)); |
| | | |
| | | |
| | | // Alert will only appear the first time saved OR the first time the bug is encountered |
| | | var done = $.pref('save_notice_done'); |
| | | if(done !== "all") { |
| | | |
| | | |
| | | var note = uiStrings.notification.saveFromBrowser.replace('%s', 'SVG'); |
| | | |
| | | |
| | | // Check if FF and has <defs/> |
| | | if(ua.indexOf('Gecko/') !== -1) { |
| | | if(svg.indexOf('<defs') !== -1) { |
| | |
| | | $.pref('save_notice_done', 'part'); |
| | | } |
| | | } else { |
| | | $.pref('save_notice_done', 'all'); |
| | | $.pref('save_notice_done', 'all'); |
| | | } |
| | | |
| | | |
| | | if(done !== 'part') { |
| | | win.alert(note); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | |
| | | var exportHandler = function(window, data) { |
| | | var issues = data.issues; |
| | | |
| | | |
| | | if(!$('#export_canvas').length) { |
| | | $('<canvas>', {id: 'export_canvas'}).hide().appendTo('body'); |
| | | } |
| | | var c = $('#export_canvas')[0]; |
| | | |
| | | |
| | | c.width = svgCanvas.contentW; |
| | | c.height = svgCanvas.contentH; |
| | | canvg(c, data.svg, {renderCallback: function() { |
| | |
| | | var done = $.pref('export_notice_done'); |
| | | if(done !== "all") { |
| | | var note = uiStrings.notification.saveFromBrowser.replace('%s', 'PNG'); |
| | | |
| | | |
| | | // Check if there's issues |
| | | if(issues.length) { |
| | | var pre = "\n \u2022 "; |
| | | note += ("\n\n" + uiStrings.notification.noteTheseIssues + pre + issues.join(pre)); |
| | | } |
| | | |
| | | } |
| | | |
| | | // Note that this will also prevent the notice even though new issues may appear later. |
| | | // May want to find a way to deal with that without annoying the user |
| | | $.pref('export_notice_done', 'all'); |
| | | $.pref('export_notice_done', 'all'); |
| | | exportWindow.alert(note); |
| | | } |
| | | }}); |
| | | }; |
| | | |
| | | |
| | | // called when we've selected a different element |
| | | var selectedChanged = function(window,elems) { |
| | | var selectedChanged = function(window,elems) { |
| | | var mode = svgCanvas.getMode(); |
| | | if(mode === "select") setSelectMode(); |
| | | if (mode === "pathedit") return updateContextPanel(); |
| | |
| | | multiselected: multiselected |
| | | }); |
| | | }; |
| | | |
| | | |
| | | // Call when part of element is in process of changing, generally |
| | | // on mousemove actions like rotate, move, etc. |
| | | var elementTransition = function(window,elems) { |
| | | var mode = svgCanvas.getMode(); |
| | | var elem = elems[0]; |
| | | |
| | | |
| | | if(!elem) return; |
| | | |
| | | |
| | | multiselected = (elems.length >= 2 && elems[1] != null) ? elems : null; |
| | | // Only updating fields for single elements for now |
| | | if(!multiselected) { |
| | |
| | | rotateCursor(ang); |
| | | $('#tool_reorient').toggleClass('disabled', ang == 0); |
| | | break; |
| | | |
| | | |
| | | // TODO: Update values that change on move/resize, etc |
| | | // case "select": |
| | | // case "resize": |
| | |
| | | elems: elems |
| | | }); |
| | | }; |
| | | |
| | | |
| | | // called when any element has changed |
| | | var elementChanged = function(window,elems) { |
| | | var mode = svgCanvas.getMode(); |
| | | if(mode === "select") { |
| | | setSelectMode(); |
| | | } |
| | | |
| | | |
| | | for (var i = 0; i < elems.length; ++i) { |
| | | var elem = elems[i]; |
| | | |
| | | |
| | | // if the element changed was the svg, then it could be a resolution change |
| | | if (elem && elem.tagName === "svg") { |
| | | //populateLayers(); |
| | | updateCanvas(); |
| | | } |
| | | } |
| | | // Update selectedElement if element is no longer part of the image. |
| | | // This occurs for the text elements in Firefox |
| | | else if(elem && selectedElement && selectedElement.parentNode == null) { |
| | |
| | | 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) |
| | | // also this updates the history buttons |
| | | |
| | | |
| | | // we tell it to skip focusing the text control if the |
| | | // text element was previously in focus |
| | | updateContextPanel(); |
| | | |
| | | |
| | | // In the event a gradient was flipped: |
| | | if(selectedElement && mode === "select") { |
| | | Editor.paintBox.fill.update(); |
| | | Editor.paintBox.stroke.update(); |
| | | } |
| | | |
| | | |
| | | svgCanvas.runExtensions("elementChanged", { |
| | | elems: elems |
| | | }); |
| | | }; |
| | | |
| | | |
| | | var zoomChanged = function(window, bbox, autoCenter) { |
| | | var scrbar = 15, |
| | | res = svgCanvas.getResolution(), |
| | |
| | | if(!z_info) return; |
| | | var zoomlevel = z_info.zoom, |
| | | bb = z_info.bbox; |
| | | |
| | | |
| | | if(zoomlevel < .001) { |
| | | changeZoom({value: .1}); |
| | | return; |
| | |
| | | } |
| | | } |
| | | animateZoom() |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //if(autoCenter) { |
| | | // updateCanvas(); |
| | | //} else { |
| | | // updateCanvas(false, {x: bb.x * zoomlevel + (bb.width * zoomlevel)/2, y: bb.y * zoomlevel + (bb.height * zoomlevel)/2}); |
| | | //} |
| | | |
| | | |
| | | if(svgCanvas.getMode() == 'zoom' && bb.width) { |
| | | // Go to select if a zoom box was drawn |
| | | setSelectMode(); |
| | | } |
| | | |
| | | |
| | | zoomDone(); |
| | | } |
| | | |
| | | |
| | | $('#cur_context_panel').delegate('a', 'click', function() { |
| | | var link = $(this); |
| | | if(link.attr('data-root')) { |
| | |
| | | svgCanvas.clearSelection(); |
| | | return false; |
| | | }); |
| | | |
| | | |
| | | var contextChanged = function(win, context) { |
| | | |
| | | |
| | | var link_str = ''; |
| | | if(context) { |
| | | var str = ''; |
| | | link_str = '<a href="#" data-root="y">' + svgCanvas.getCurrentDrawing().getCurrentLayerName() + '</a>'; |
| | | |
| | | |
| | | $(context).parentsUntil('#svgcontent > g').andSelf().each(function() { |
| | | if(this.id) { |
| | | str += ' > ' + this.id; |
| | |
| | | $('#cur_context_panel').toggle(!!context).html(link_str); |
| | | |
| | | } |
| | | |
| | | |
| | | // 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(); |
| | |
| | | .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; |
| | | |
| | |
| | | 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 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) { |
| | |
| | | // 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()}) |
| | |
| | | flyout_funcs[opt](); |
| | | } |
| | | }); |
| | | |
| | | |
| | | // $('#tools_rect').mouseleave(function(){$('#tools_rect').fadeOut();}); |
| | | }); |
| | | |
| | | |
| | | setFlyoutTitles(); |
| | | } |
| | | |
| | | |
| | | var makeFlyoutHolder = function(id, child) { |
| | | var div = $('<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'); |
| | |
| | | $(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); |
| | |
| | | }); |
| | | } |
| | | |
| | | var resize_timer; |
| | | |
| | | 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 = setTimeout(function() { |
| | | resize_done = true; |
| | | setIconSize(curPrefs.iconsize); |
| | | }, 50); |
| | | }, 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 = $('<div>', {id: tool.panel}).appendTo("#tools_top").hide(); |
| | | |
| | | |
| | | // TODO: Allow support for other types, or adding to existing tool |
| | | switch (tool.type) { |
| | | case 'tool_button': |
| | |
| | | html += "</select></label>"; |
| | | // 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': |
| | | case 'button-select': |
| | | var html = '<div id="' + tool.id + '" class="dropdown toolset" title="' + tool.title + '">' |
| | | + '<div id="cur_' + tool.id + '" class="icon_label"></div><button></button></div>'; |
| | | |
| | | |
| | | var list = $('<ul id="' + tool.id + '_opts"></ul>').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'), |
| | |
| | | break; |
| | | case 'input': |
| | | var html = '<label' + cont_id + '>' |
| | | + '<span id="' + tool.id + '_label">' |
| | | + '<span id="' + tool.id + '_label">' |
| | | + tool.label + ':</span>' |
| | | + '<input id="' + tool.id + '" title="' + tool.title |
| | | + '" size="' + (tool.size || "4") + '" value="' + (tool.defval || "") + '" type="text"/></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; |
| | |
| | | placement_obj['#' + id] = svgicon; |
| | | } |
| | | } |
| | | |
| | | |
| | | var cls, parent; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // Set button up according to its type |
| | | switch ( btn.type ) { |
| | | case 'mode_flyout': |
| | |
| | | $('<div>', {id: btn.panel}).appendTo("#tools_top"); |
| | | break; |
| | | } |
| | | |
| | | |
| | | var button = $((btn.list || btn.type == 'app_menu')?'<li/>':'<div/>') |
| | | .attr("id", id) |
| | | .attr("title", btn.title) |
| | |
| | | // 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')) { |
| | |
| | | var show_btn = ref_btn.clone() |
| | | .attr('id',tls_id + '_show') |
| | | .append($('<div>',{'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, |
| | |
| | | } 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'); |
| | |
| | | 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')) { |
| | |
| | | var show_btn = ref_btn.clone() |
| | | .attr('id',tls_id + '_show') |
| | | .append($('<div>',{'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, |
| | |
| | | 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); |
| | |
| | | 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) { |
| | |
| | | } |
| | | setupFlyouts(holders); |
| | | }); |
| | | |
| | | |
| | | $.each(btn_selects, function() { |
| | | addAltDropDown(this.elem, this.list, this.callback, {seticon: true}); |
| | | addAltDropDown(this.elem, this.list, this.callback, {seticon: true}); |
| | | }); |
| | | |
| | | |
| | | if (svgicons) |
| | | cb_ready = false; // Delay callback |
| | | |
| | |
| | | cb_ready = true; // Ready for callback |
| | | runCallback(); |
| | | } |
| | | |
| | | |
| | | }); |
| | | } |
| | | |
| | | |
| | | runCallback(); |
| | | }; |
| | | |
| | | |
| | | var getPaint = function(color, opac, type) { |
| | | // update the editor's fill paint |
| | | var opts = null; |
| | |
| | | } else { |
| | | refElem = $("#" + type + "_color defs *")[0]; |
| | | } |
| | | |
| | | |
| | | opts = { alpha: opac }; |
| | | opts[refElem.tagName] = refElem; |
| | | } |
| | | } |
| | | else if (color.indexOf("#") === 0) { |
| | | opts = { |
| | | alpha: opac, |
| | |
| | | }; |
| | | } |
| | | return new $.jGraduate.Paint(opts); |
| | | }; |
| | | |
| | | }; |
| | | |
| | | // set the canvas properties at init |
| | | var res = svgCanvas.getResolution(); |
| | | if(curConfig.baseUnit !== "px") { |
| | | res.w = svgedit.units.convertUnit(res.w) + curConfig.baseUnit; |
| | | res.h = svgedit.units.convertUnit(res.h) + curConfig.baseUnit; |
| | | } |
| | | |
| | | |
| | | var createBackground = function(fill) { |
| | | svgCanvas.createLayer("background") |
| | | cur_shape = svgCanvas.addSvgElementFromJson({ |
| | |
| | | svgCanvas.setCurrentLayer("Layer 1") |
| | | svgCanvas.setCurrentLayerPosition("1") |
| | | } |
| | | |
| | | |
| | | // create a new layer background if it doesn't exist |
| | | if (!document.getElementById('canvas_background')) createBackground(); |
| | | var fill = document.getElementById('canvas_background').getAttribute("fill"); |
| | | |
| | | |
| | | // updates the toolbar (colors, opacity, etc) based on the selected element |
| | | // This function also updates the opacity and id elements that are in the context panel |
| | | var updateToolbar = function() { |
| | |
| | | case 'a': |
| | | // Look for common styles |
| | | var gWidth = null; |
| | | |
| | | |
| | | var childs = selectedElement.getElementsByTagName('*'); |
| | | for(var i = 0, len = childs.length; i < len; i++) { |
| | | var swidth = childs[i].getAttribute("stroke-width"); |
| | |
| | | gWidth = null; |
| | | } |
| | | } |
| | | |
| | | |
| | | $('#stroke_width').val(gWidth === null ? "0" : gWidth); |
| | | updateContextPanel(); |
| | | break; |
| | |
| | | //removed because multiselect shouldnt set color |
| | | //Editor.paintBox.fill.update(false); |
| | | //Editor.paintBox.stroke.update(false); |
| | | |
| | | |
| | | $('#stroke_width').val(selectedElement.getAttribute("stroke-width") || 0); |
| | | var dash = selectedElement.getAttribute("stroke-dasharray") || "none" |
| | | $('option', '#stroke_style').removeAttr('selected'); |
| | |
| | | $.fn.dragInput.updateCursor($('#stroke_width')[0]) |
| | | $.fn.dragInput.updateCursor($('#blur')[0]) |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | // All elements including image and group have opacity |
| | | if(selectedElement != null) { |
| | | var opac_perc = ((selectedElement.getAttribute("opacity")||1.0)*100); |
| | |
| | | $.fn.dragInput.updateCursor($('#group_opacity')[0]) |
| | | } |
| | | }; |
| | | |
| | | |
| | | var setImageURL = Editor.setImageURL = function(url) { |
| | | if(!url) url = default_img_url; |
| | | |
| | | |
| | | svgCanvas.setImageURL(url); |
| | | $('#image_url').val(url); |
| | | } |
| | | |
| | | |
| | | var setInputWidth = function(elem) { |
| | | var w = Math.min(Math.max(12 + elem.value.length * 6, 50), 300); |
| | | $(elem).width(w); |
| | | } |
| | | |
| | | |
| | | // updates the context panel tools based on the selected element |
| | | var updateContextPanel = function(e) { |
| | | var elem = selectedElement; |
| | | // If element has just been deleted, consider it null |
| | | if(elem != null && !elem.parentNode) elem = null; |
| | | if (multiselected && multiselected[0] != null && !multiselected[0].parentNode) multiselected = false; |
| | | |
| | | |
| | | var currentLayerName = svgCanvas.getCurrentDrawing().getCurrentLayerName(); |
| | | var currentMode = svgCanvas.getMode(); |
| | | var unit = curConfig.baseUnit !== 'px' ? curConfig.baseUnit : null; |
| | | var is_node = currentMode == 'pathedit'; //elem ? (elem.id && elem.id.indexOf('pathpointgrip') == 0) : false; |
| | | |
| | | |
| | | if (is_node) { |
| | | $('.context_panel').hide(); |
| | | $('#path_node_panel').show(); |
| | |
| | | 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) { |
| | |
| | | seg_type.val(4).attr('disabled','disabled'); |
| | | } |
| | | } |
| | | $("#tools_top").removeClass("multiselected") |
| | | $("#tools_top").removeClass("multiselected") |
| | | $("#stroke_panel").hide(); |
| | | $("#canvas_panel").hide(); |
| | | return; |
| | | } |
| | | |
| | | |
| | | var menu_items = $('#cmenu_canvas li'); |
| | | $('.context_panel').hide(); |
| | | $('.menu_item', '#edit_menu').addClass('disabled'); |
| | | $('.menu_item', '#object_menu').addClass('disabled'); |
| | | |
| | | |
| | | |
| | | |
| | | //hack to show the proper multialign box |
| | | if (multiselected) { |
| | | multiselected = multiselected.filter(Boolean); |
| | |
| | | } |
| | | |
| | | if (!elem && !multiselected) { |
| | | $("#tools_top").removeClass("multiselected") |
| | | $("#tools_top").removeClass("multiselected") |
| | | $("#stroke_panel").hide(); |
| | | $("#canvas_panel").show(); |
| | | } |
| | | |
| | | |
| | | if (elem != null) { |
| | | $("#stroke_panel").show(); |
| | | var elname = elem.nodeName; |
| | | var angle = svgCanvas.getRotationAngle(elem); |
| | | $('#angle').val(Math.round(angle)); |
| | | |
| | | |
| | | var blurval = svgCanvas.getBlur(elem); |
| | | $('#blur').val(blurval); |
| | | if(!is_node && currentMode != 'pathedit') { |
| | |
| | | y = bb.y; |
| | | } |
| | | } |
| | | |
| | | |
| | | if(unit) { |
| | | x = svgedit.units.convertUnit(x); |
| | | y = svgedit.units.convertUnit(y); |
| | |
| | | $("#path_x").val(Math.round(x)) |
| | | $("#path_y").val(Math.round(y)) |
| | | } |
| | | |
| | | |
| | | // Elements in this array cannot be converted to a path |
| | | var no_path = ['image', 'text', 'path', 'g', 'use'].indexOf(elname) == -1; |
| | | if (no_path) $('.action_path_convert_selected').removeClass('disabled'); |
| | | if (elname === "path") $('.action_path_selected').removeClass('disabled'); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | var link_href = null; |
| | | if (el_name === 'a') { |
| | | link_href = svgCanvas.getHref(elem); |
| | | $('#g_panel').show(); |
| | | } |
| | | |
| | | |
| | | if(elem.parentNode.tagName === 'a') { |
| | | if(!$(elem).siblings().length) { |
| | | $('#a_panel').show(); |
| | | link_href = svgCanvas.getHref(elem.parentNode); |
| | | } |
| | | } |
| | | |
| | | |
| | | // Hide/show the make_link buttons |
| | | $('#tool_make_link, #tool_make_link').toggle(!link_href); |
| | | |
| | | |
| | | if(link_href) { |
| | | $('#link_url').val(link_href); |
| | | } |
| | | |
| | | |
| | | // update contextual tools here |
| | | var panels = { |
| | | g: [], |
| | |
| | | image: ['width','height', 'x', 'y'], |
| | | circle: ['cx','cy','r'], |
| | | ellipse: ['cx','cy','rx','ry'], |
| | | line: ['x1','y1','x2','y2'], |
| | | line: ['x1','y1','x2','y2'], |
| | | text: ['x', 'y'], |
| | | 'use': [], |
| | | path : [] |
| | | }; |
| | | |
| | | |
| | | var el_name = elem.tagName; |
| | | |
| | | |
| | | if($(elem).data('gsvg')) { |
| | | $('#g_panel').show(); |
| | | } |
| | | |
| | | |
| | | if (el_name == "path" || el_name == "polyline") { |
| | | $('#path_panel').show(); |
| | | } |
| | | |
| | | |
| | | if(panels[el_name]) { |
| | | var cur_panel = panels[el_name]; |
| | | $('#' + el_name + '_panel').show(); |
| | | |
| | | |
| | | // corner radius has to live in a different panel |
| | | // because otherwise it changes the position of the |
| | | // because otherwise it changes the position of the |
| | | // of the elements |
| | | if(el_name == "rect") $("#cornerRadiusLabel").show() |
| | | else $("#cornerRadiusLabel").hide() |
| | | |
| | | |
| | | $.each(cur_panel, function(i, item) { |
| | | var attrVal = elem.getAttribute(item); |
| | | if(curConfig.baseUnit !== 'px' && elem[item]) { |
| | | var bv = elem[item].baseVal.value; |
| | | attrVal = svgedit.units.convertUnit(bv); |
| | | } |
| | | |
| | | |
| | | //update the draginput cursors |
| | | var name_item = document.getElementById(el_name + '_' + item); |
| | | name_item.value = Math.round(attrVal) || 0; |
| | |
| | | $.fn.dragInput.updateCursor(name_item ); |
| | | } |
| | | }); |
| | | |
| | | |
| | | if(el_name == 'text') { |
| | | var font_family = elem.getAttribute("font-family"); |
| | | var select = document.getElementById("font_family_dropdown"); |
| | | select.selectedIndex = 3 |
| | | |
| | | $('#text_panel').css("display", "inline"); |
| | | |
| | | $('#text_panel').css("display", "inline"); |
| | | $('#tool_italic').toggleClass('active', svgCanvas.getItalic()) |
| | | $('#tool_bold').toggleClass('active', svgCanvas.getBold()) |
| | | $('#font_family').val(font_family); |
| | |
| | | menu_items[(el_name === 'g' ? 'en':'dis') + 'ableContextMenuItems']('#ungroup'); |
| | | menu_items[((el_name === 'g' || !multiselected) ? 'dis':'en') + 'ableContextMenuItems']('#group'); |
| | | } |
| | | |
| | | |
| | | if (multiselected) { |
| | | $('#multiselected_panel').show(); |
| | | $('.action_multi_selected').removeClass('disabled'); |
| | | menu_items |
| | | .enableContextMenuItems('#group') |
| | | .disableContextMenuItems('#ungroup'); |
| | | } |
| | | |
| | | } |
| | | |
| | | if (!elem) { |
| | | menu_items.disableContextMenuItems('#delete,#cut,#copy,#group,#ungroup,#move_front,#move_up,#move_down,#move_back'); |
| | | } |
| | | |
| | | |
| | | // update history buttons |
| | | if (undoMgr.getUndoStackSize() > 0) { |
| | | $('#tool_undo').removeClass( 'disabled'); |
| | |
| | | else { |
| | | $('#tool_redo').addClass( 'disabled'); |
| | | } |
| | | |
| | | |
| | | svgCanvas.addedNew = false; |
| | | |
| | | |
| | | if ( (elem && !is_node) || multiselected) { |
| | | // update the selected elements' layer |
| | | $('#selLayerNames').removeAttr('disabled').val(currentLayerName); |
| | | |
| | | |
| | | // Enable regular menu options |
| | | canv_menu.enableContextMenuItems('#delete,#cut,#copy,#move_front,#move_up,#move_down,#move_back'); |
| | | } |
| | | }; |
| | | |
| | | |
| | | $('#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); |
| | |
| | | svgCanvas.bind("contextset", contextChanged); |
| | | svgCanvas.bind("extension_added", extAdded); |
| | | svgCanvas.textActions.setInputElem($("#text")[0]); |
| | | |
| | | |
| | | var str = '<div class="palette_item transparent" data-rgb="none"></div>\ |
| | | <div class="palette_item black" data-rgb="#000000"></div>\ |
| | | <div class="palette_item white" data-rgb="#ffffff"></div>' |
| | |
| | | str += '<div class="palette_item" style="background-color: ' + item + ';" data-rgb="' + item + '"></div>'; |
| | | }); |
| | | $('#palette').append(str); |
| | | |
| | | |
| | | var changeFontSize = function(ctl) { |
| | | svgCanvas.setFontSize(ctl.value); |
| | | } |
| | | |
| | | |
| | | var changeStrokeWidth = function(ctl) { |
| | | var val = ctl.value; |
| | | if(val == 0 && selectedElement && ['line', 'polyline'].indexOf(selectedElement.nodeName) >= 0) { |
| | |
| | | } |
| | | svgCanvas.setStrokeWidth(val); |
| | | } |
| | | |
| | | |
| | | //cache |
| | | var $indicator = $('#tool_angle_indicator') |
| | | var $reorient = $('#tool_reorient') |
| | | |
| | | |
| | | rotateCursor = function(angle){ |
| | | var rotate_string = 'rotate('+ angle + 'deg)' |
| | | $indicator.css({ |
| | |
| | | 'transform': rotate_string |
| | | }); |
| | | } |
| | | |
| | | |
| | | var changeRotationAngle = function(ctl) { |
| | | var preventUndo = true; |
| | | svgCanvas.setRotationAngle(ctl.value, preventUndo); |
| | | rotateCursor(ctl.value) |
| | | $('#tool_reorient').toggleClass('disabled', ctl.value == 0); |
| | | } |
| | | |
| | | |
| | | var changeZoom = function(ctl) { |
| | | var zoomlevel = ctl.value / 100; |
| | | if(zoomlevel < .001) { |
| | |
| | | width: 0, |
| | | height: 0, |
| | | // center pt of scroll position |
| | | x: (w_area[0].scrollLeft + w_area.width()/2)/zoom, |
| | | x: (w_area[0].scrollLeft + w_area.width()/2)/zoom, |
| | | y: (w_area[0].scrollTop + w_area.height()/2)/zoom, |
| | | zoom: zoomlevel |
| | | }, true); |
| | | } |
| | | |
| | | |
| | | var changeBlur = function(ctl, completed) { |
| | | val = ctl.value; |
| | | $('#blur').val(val); |
| | |
| | | svgCanvas.setBlurNoUndo(val); |
| | | } |
| | | } |
| | | |
| | | |
| | | var operaRepaint = function() { |
| | | // Repaints canvas in Opera. Needed for stroke-dasharray change as well as fill change |
| | | if(!window.opera) return; |
| | | $('<p/>').hide().appendTo('body').remove(); |
| | | } |
| | | |
| | | |
| | | $('#stroke_style').change(function(){ |
| | | svgCanvas.setStrokeAttr('stroke-dasharray', $(this).val()); |
| | | $("#stroke_style_label").html(this.options[this.selectedIndex].text) |
| | | operaRepaint(); |
| | | }); |
| | | |
| | | |
| | | $('#seg_type').change(function() { |
| | | svgCanvas.setSegType($(this).val()); |
| | | $("#seg_type_label").html(this.options[this.selectedIndex].text) |
| | | }); |
| | | |
| | | |
| | | // Lose focus for select elements when changed (Allows keyboard shortcuts to work better) |
| | | $('select').change(function(){$(this).blur();}); |
| | | |
| | | |
| | | $('#font_family').change(function() { |
| | | svgCanvas.setFontFamily(this.value); |
| | | }); |
| | | |
| | | |
| | | $('#text').keyup(function(){ |
| | | svgCanvas.setTextContent(this.value); |
| | | }); |
| | | |
| | | |
| | | changeAttribute = function(el, completed) { |
| | | var attr = el.getAttribute("data-attr"); |
| | | var multiplier = el.getAttribute("data-multiplier") || 1; |
| | |
| | | //if (!noUndo) svgCanvas.changeSelectedAttribute(attr, val); |
| | | svgCanvas.changeSelectedAttributeNoUndo(attr, val); |
| | | }; |
| | | |
| | | |
| | | picking = false; |
| | | $(document).on("mouseup", function(){picking = false;}) |
| | | |
| | |
| | | var color = $(this).attr('data-rgb'); |
| | | var paint = null; |
| | | var noUndo = true; |
| | | if (evt.type == "mousedown") noUndo = false |
| | | if (evt.type == "mousedown") noUndo = false |
| | | // Webkit-based browsers returned 'initial' here for no stroke |
| | | if (color === 'transparent' || color === 'initial' || color === '#none') { |
| | | color = 'none'; |
| | |
| | | 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) { |
| | |
| | | } |
| | | } |
| | | }).bind('contextmenu', function(e) {e.preventDefault()}); |
| | | |
| | | |
| | | $("#toggle_stroke_tools").toggle(function() { |
| | | $(".stroke_tool").css('display','table-cell'); |
| | | $(this).addClass('expanded'); |
| | |
| | | $(this).removeClass('expanded'); |
| | | 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 |
| | |
| | | $(button).addClass('tool_button_current').removeClass('tool_button'); |
| | | return true; |
| | | }; |
| | | |
| | | |
| | | (function() { |
| | | var last_x = null, last_y = null, w_area = workarea[0], |
| | | var last_x = null, last_y = null, w_area = workarea[0], |
| | | panning = false, keypan = false; |
| | | |
| | | var move_pan = function(evt) { |
| | | |
| | | var move_pan = function(evt) { |
| | | if(panning === false) return; |
| | | |
| | | w_area.scrollLeft -= (evt.clientX - last_x); |
| | |
| | | if(evt.type === 'mouseup' || evt.type === 'touchend') panning = false; |
| | | return false; |
| | | } |
| | | |
| | | |
| | | var start_pan = function(evt) { |
| | | if(evt.button === 1 || keypan === true || (evt.originalEvent.touches && evt.originalEvent.touches.length >= 2)) { |
| | | panning = true; |
| | |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | $('#svgcanvas') |
| | | .on('mousemove mouseup touchend', move_pan) |
| | | .on("mousedown touchmove", start_pan) |
| | | |
| | | |
| | | $(window).mouseup(function() { |
| | | panning = false; |
| | | }); |
| | | |
| | | |
| | | $(document).bind('keydown', 'space', function(evt) { |
| | | evt.preventDefault(); |
| | | svgCanvas.spaceKey = keypan = true; |
| | | |
| | | |
| | | }).bind('keyup', 'space', function(evt) { |
| | | evt.preventDefault(); |
| | | svgCanvas.spaceKey = keypan = false; |
| | |
| | | } |
| | | }) |
| | | }()); |
| | | |
| | | |
| | | |
| | | |
| | | function setStrokeOpt(opt, changeElem) { |
| | | var id = opt.id; |
| | | var bits = id.split('_'); |
| | | var pre = bits[0]; |
| | | var val = bits[1]; |
| | | |
| | | |
| | | if(changeElem) { |
| | | svgCanvas.setStrokeAttr('stroke-' + pre, val); |
| | | } |
| | |
| | | setIcon('#cur_' + pre , id, 20); |
| | | $(opt).addClass('current').siblings().removeClass('current'); |
| | | } |
| | | |
| | | |
| | | //menu handling |
| | | var menus = $('.menu'); |
| | | var blinker = function(e) { |
| | |
| | | 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)}); |
| | | $("svg, body").on('mousedown touchstart', function(e){closer(e)}); |
| | | |
| | | |
| | | var accumulatedDelta = 0 |
| | | $('#workarea').on('mousewheel', function(e, delta, deltaX, deltaY){ |
| | | if (e.altKey || e.ctrlKey) { |
| | |
| | | $("#zoom").val(parseInt(zoom + deltaY*(e.altKey ? 10 : 5))).change() |
| | | } |
| | | }); |
| | | |
| | | |
| | | $('.menu_title') |
| | | .on('mousedown', function() { |
| | | $("#tools_shapelib").hide() |
| | |
| | | $(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'); |
| | |
| | | } |
| | | on_button = false; |
| | | }); |
| | | |
| | | |
| | | button.bind('mousedown',function() { |
| | | if (!button.hasClass('down')) { |
| | | button.addClass('down'); |
| | | |
| | | |
| | | if(!dropUp) { |
| | | var pos = $(elem).offset(); |
| | | // position slider |
| | |
| | | }); |
| | | } |
| | | list.show(); |
| | | |
| | | |
| | | on_button = true; |
| | | } else { |
| | | button.removeClass('down'); |
| | |
| | | on_button = false; |
| | | }); |
| | | } |
| | | |
| | | |
| | | // TODO: Combine this with addDropDown or find other way to optimize |
| | | var addAltDropDown = function(elem, list, callback, opts) { |
| | | var button = $(elem); |
| | |
| | | callback.apply(this, arguments); |
| | | |
| | | }); |
| | | |
| | | |
| | | $(window).mouseup(function(evt) { |
| | | if(!on_button) { |
| | | button.removeClass('down'); |
| | |
| | | } |
| | | on_button = false; |
| | | }); |
| | | |
| | | |
| | | var height = list.height(); |
| | | $(elem).bind('mousedown',function() { |
| | | var off = $(elem).offset(); |
| | |
| | | off.top += $(elem).height(); |
| | | } |
| | | $(list).offset(off); |
| | | |
| | | |
| | | if (!button.hasClass('down')) { |
| | | button.addClass('down'); |
| | | list.show(); |
| | |
| | | }).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 |
| | | $('#preview_font').html(fam_display).css("font-family", fam); |
| | | $('#font_family').val(fam).change(); |
| | | }); |
| | | |
| | | |
| | | $('div', '#position_opts').each(function(){ |
| | | this.addEventListener("mouseup", function(){ |
| | | var letter = this.id.replace('tool_pos','').charAt(0); |
| | | 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() { |
| | | var inp; |
| | | var unfocus = function() { |
| | | $(inp).blur(); |
| | | } |
| | | |
| | | |
| | | $('#svg_editor').find('button, select, input:not(#text)').focus(function() { |
| | | inp = this; |
| | | ui_context = 'toolbars'; |
| | |
| | | $('#text').focus(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | }()); |
| | | |
| | | var clickSelect = function() { |
| | |
| | | svgCanvas.setMode('select'); |
| | | } |
| | | }; |
| | | |
| | | |
| | | var clickFHPath = function() { |
| | | if (toolButtonClick('#tool_fhpath')) { |
| | | svgCanvas.setMode('fhpath'); |
| | | } |
| | | }; |
| | | |
| | | |
| | | var clickLine = function() { |
| | | if (toolButtonClick('#tool_line')) { |
| | | svgCanvas.setMode('line'); |
| | | } |
| | | }; |
| | | |
| | | |
| | | var clickSquare = function(){ |
| | | if (toolButtonClick('#tool_square')) { |
| | | svgCanvas.setMode('square'); |
| | | } |
| | | }; |
| | | |
| | | |
| | | var clickRect = function(){ |
| | | if (toolButtonClick('#tool_rect')) { |
| | | svgCanvas.setMode('rect'); |
| | | } |
| | | }; |
| | | |
| | | |
| | | 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')) { |
| | | svgCanvas.setMode('ellipse'); |
| | | } |
| | | }; |
| | | |
| | | |
| | | 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')) { |
| | | svgCanvas.setMode('text'); |
| | | } |
| | | }; |
| | | |
| | | |
| | | var clickPath = function(){ |
| | | if (toolButtonClick('#tool_path')) { |
| | | svgCanvas.setMode('path'); |
| | |
| | | path.deletePathNode(); |
| | | } |
| | | }; |
| | | |
| | | |
| | | var cutSelected = function() { |
| | | if (selectedElement != null || multiselected) { |
| | | flash($('#edit_menu')); |
| | | svgCanvas.cutSelectedElements(); |
| | | } |
| | | }; |
| | | |
| | | |
| | | var copySelected = function() { |
| | | if (selectedElement != null || multiselected) { |
| | | flash($('#edit_menu')); |
| | | svgCanvas.copySelectedElements(); |
| | | } |
| | | }; |
| | | |
| | | |
| | | var pasteSelected = function() { |
| | | flash($('#edit_menu')); |
| | | var zoom = svgCanvas.getZoom(); |
| | | var x = (workarea[0].scrollLeft + workarea.width()/2)/zoom - svgCanvas.contentW; |
| | | var zoom = svgCanvas.getZoom(); |
| | | var x = (workarea[0].scrollLeft + workarea.width()/2)/zoom - svgCanvas.contentW; |
| | | var y = (workarea[0].scrollTop + workarea.height()/2)/zoom - svgCanvas.contentH; |
| | | svgCanvas.pasteElements('point', x, y); |
| | | svgCanvas.pasteElements('point', x, y); |
| | | } |
| | | |
| | | |
| | | var moveToTopSelected = function() { |
| | | if (selectedElement != null) { |
| | | flash($('#object_menu')); |
| | | svgCanvas.moveToTopSelectedElement(); |
| | | } |
| | | }; |
| | | |
| | | |
| | | var moveToBottomSelected = function() { |
| | | if (selectedElement != null) { |
| | | flash($('#object_menu')); |
| | | svgCanvas.moveToBottomSelectedElement(); |
| | | } |
| | | }; |
| | | |
| | | |
| | | var moveUpSelected = function() { |
| | | if (selectedElement != null) { |
| | | flash($('#object_menu')); |
| | |
| | | svgCanvas.moveUpDownSelected("Down"); |
| | | } |
| | | }; |
| | | |
| | | |
| | | var moveUpDownSelected = function(dir) { |
| | | if (selectedElement != null) { |
| | | flash($('#object_menu')); |
| | |
| | | updateContextPanel(); |
| | | } |
| | | } |
| | | |
| | | |
| | | var reorientPath = function() { |
| | | if (selectedElement != null) { |
| | | path.reorient(); |
| | | } |
| | | } |
| | | |
| | | |
| | | var makeHyperlink = function() { |
| | | if (selectedElement != null || multiselected) { |
| | | $.prompt(uiStrings.notification.enterNewLinkURL, "http://", function(url) { |
| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | var moveSelected = function(dx,dy) { |
| | | if (selectedElement != null || multiselected) { |
| | | if(curConfig.gridSnapping) { |
| | |
| | | svgCanvas.moveSelectedElements(dx,dy); |
| | | } |
| | | }; |
| | | |
| | | |
| | | var linkControlPoints = function() { |
| | | // var linked = document.getElementById('tool_node_link').checked; |
| | | // path.linkControlPoints(linked); |
| | | } |
| | | |
| | | |
| | | var clonePathNode = function() { |
| | | if (path.getNodePoint()) { |
| | | path.clonePathNode(); |
| | | } |
| | | }; |
| | | |
| | | |
| | | var deletePathNode = function() { |
| | | if (path.getNodePoint()) { |
| | | path.deletePathNode(); |
| | | } |
| | | }; |
| | | |
| | | |
| | | var addSubPath = function() { |
| | | var button = $('#tool_add_subpath'); |
| | | var sp = !button.hasClass('push_button_pressed'); |
| | |
| | | } else { |
| | | button.removeClass('push_button_pressed').addClass('tool_button'); |
| | | } |
| | | |
| | | |
| | | path.addSubPath(sp); |
| | | |
| | | |
| | | }; |
| | | |
| | | |
| | | var opencloseSubPath = function() { |
| | | path.opencloseSubPath(); |
| | | } |
| | | |
| | | } |
| | | |
| | | var selectNext = function() { |
| | | svgCanvas.cycleElement(1); |
| | | }; |
| | | |
| | | |
| | | var selectPrev = function() { |
| | | svgCanvas.cycleElement(0); |
| | | }; |
| | | |
| | | |
| | | var rotateSelected = function(cw,step) { |
| | | if (selectedElement == null || multiselected) return; |
| | | if(!cw) step *= -1; |
| | |
| | | svgCanvas.setRotationAngle(new_angle); |
| | | updateContextPanel(); |
| | | }; |
| | | |
| | | |
| | | var clickClear = function(){ |
| | | var dims = curConfig.dimensions; |
| | | $.confirm(uiStrings.notification.QwantToClear, function(ok) { |
| | |
| | | svgCanvas.runExtensions('onNewDocument'); |
| | | }); |
| | | }; |
| | | |
| | | |
| | | var clickBold = function(){ |
| | | svgCanvas.setBold( !svgCanvas.getBold() ); |
| | | updateContextPanel(); |
| | | }; |
| | | |
| | | |
| | | var clickItalic = function(){ |
| | | svgCanvas.setItalic( !svgCanvas.getItalic() ); |
| | | updateContextPanel(); |
| | | }; |
| | | |
| | | |
| | | var clickExport = function() { |
| | | // Open placeholder window (prevents popup) |
| | | if(!customHandlers.pngsave) { |
| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | // by default, svgCanvas.open() is a no-op. |
| | | // it is up to an extension mechanism (opera widget, etc) |
| | | // it is up to an extension mechanism (opera widget, etc) |
| | | // to call setCustomHandlers() which will make it do something |
| | | var clickOpen = function(){ |
| | | svgCanvas.open(); |
| | | }; |
| | | var clickImport = function(){ |
| | | }; |
| | | |
| | | |
| | | var flash = function($menu){ |
| | | var menu_title = $menu.prev(); |
| | | menu_title.css({ |
| | |
| | | }); |
| | | setTimeout(function(){menu_title.removeAttr("style")}, 200); |
| | | } |
| | | |
| | | |
| | | var clickUndo = function(){ |
| | | if (undoMgr.getUndoStackSize() > 0) { |
| | | flash($('#edit_menu')); |
| | | undoMgr.undo(); |
| | | } |
| | | }; |
| | | |
| | | |
| | | var clickRedo = function(){ |
| | | if (undoMgr.getRedoStackSize() > 0) { |
| | | flash($('#edit_menu')); |
| | | undoMgr.redo(); |
| | | } |
| | | }; |
| | | |
| | | |
| | | var clickGroup = function(){ |
| | | // group |
| | | if (multiselected) { |
| | |
| | | svgCanvas.ungroupSelectedElement(); |
| | | } |
| | | }; |
| | | |
| | | |
| | | var clickClone = function(){ |
| | | flash($('#edit_menu')); |
| | | svgCanvas.cloneSelectedElements(20,20); |
| | | }; |
| | | |
| | | |
| | | var clickAlign = function() { |
| | | var letter = this.id.replace('tool_align','').charAt(0); |
| | | svgCanvas.alignSelectedElements(letter, $('#align_relative_to').val()); |
| | | }; |
| | | |
| | | |
| | | var clickSwitch = function() { |
| | | var stroke_rect = document.querySelector('#tool_stroke rect'); |
| | | $("#tool_stroke").toggleClass('active') |
| | |
| | | var fill = getPaint(fill_color, fill_opacity, "fill"); |
| | | Editor.paintBox.fill.setPaint(stroke, true); |
| | | Editor.paintBox.stroke.setPaint(fill, true); |
| | | |
| | | |
| | | }; |
| | | |
| | | |
| | | var zoomImage = function(multiplier) { |
| | | var res = svgCanvas.getResolution(); |
| | | multiplier = multiplier?res.zoom * multiplier:1; |
| | |
| | | zoomDone(); |
| | | updateCanvas(true); |
| | | }; |
| | | |
| | | |
| | | var zoomDone = function() { |
| | | // updateBgImage(); |
| | | updateWireFrame(); |
| | | //updateCanvas(); // necessary? |
| | | } |
| | | |
| | | |
| | | var clickWireframe = function() { |
| | | flash($('#view_menu')); |
| | | var wf = !$('#tool_wireframe').hasClass('push_button_pressed'); |
| | | if (wf) |
| | | if (wf) |
| | | $('#tool_wireframe').addClass('push_button_pressed'); |
| | | else |
| | | $('#tool_wireframe').removeClass('push_button_pressed'); |
| | | workarea.toggleClass('wireframe'); |
| | | |
| | | |
| | | if(supportsNonSS) return; |
| | | var wf_rules = $('#wireframe_rules'); |
| | | if(!wf_rules.length) { |
| | |
| | | } else { |
| | | wf_rules.empty(); |
| | | } |
| | | |
| | | |
| | | updateWireFrame(); |
| | | } |
| | | |
| | | |
| | | var clickSnapGrid = function() { |
| | | flash($('#view_menu')); |
| | | var sg = !$('#tool_snap').hasClass('push_button_pressed'); |
| | | if (sg) |
| | | if (sg) |
| | | $('#tool_snap').addClass('push_button_pressed'); |
| | | else |
| | | $('#tool_snap').removeClass('push_button_pressed'); |
| | | $('#tool_snap').removeClass('push_button_pressed'); |
| | | curConfig.gridSnapping = sg; |
| | | } |
| | | |
| | | |
| | | var minimizeModal = function() { |
| | | |
| | | |
| | | if (window.self != window.top) { //we're in an iframe |
| | | top.exit_fullscreen(); |
| | | } |
| | | } |
| | | |
| | | |
| | | var clickRulers = function() { |
| | | flash($('#view_menu')); |
| | | var rulers = !$('#tool_rulers').hasClass('push_button_pressed'); |
| | |
| | | } |
| | | $('#rulers').toggle(!!curConfig.showRulers) |
| | | } |
| | | |
| | | |
| | | var updateWireFrame = function() { |
| | | // Test support |
| | | if(supportsNonSS) return; |
| | | |
| | | |
| | | var rule = "#workarea.wireframe #svgcontent * { stroke-width: " + 1/svgCanvas.getZoom() + "px; }"; |
| | | $('#wireframe_rules').text(workarea.hasClass('wireframe') ? rule : ""); |
| | | } |
| | | |
| | | |
| | | var showSourceEditor = function(e, forSaving){ |
| | | if (editingsource) return; |
| | | flash($('#view_menu')); |
| | | editingsource = true; |
| | | |
| | | |
| | | $('#save_output_btns').toggle(!!forSaving); |
| | | $('#tool_source_back').toggle(!forSaving); |
| | | |
| | | |
| | | var str = orig_source = svgCanvas.getSvgString(); |
| | | $('#svg_source_textarea').val(str); |
| | | $('#svg_source_editor').fadeIn(); |
| | | $('#svg_source_textarea').focus().select(); |
| | | }; |
| | | |
| | | |
| | | var clickSave = function(){ |
| | | flash($('#file_menu')); |
| | | // In the future, more options can be provided here |
| | |
| | | } |
| | | svgCanvas.save(saveOpts); |
| | | }; |
| | | |
| | | |
| | | var saveSourceEditor = function(){ |
| | | if (!editingsource) return; |
| | | |
| | | |
| | | var saveChanges = function() { |
| | | svgCanvas.clearSelection(); |
| | | hideSourceEditor(); |
| | | zoomImage(); |
| | | prepPaints(); |
| | | } |
| | | |
| | | |
| | | if (!svgCanvas.setSvgString($('#svg_source_textarea').val())) { |
| | | $.confirm(uiStrings.notification.QerrorsRevertToSource, function(ok) { |
| | | if(!ok) return false; |
| | |
| | | } else { |
| | | saveChanges(); |
| | | } |
| | | setSelectMode(); |
| | | setSelectMode(); |
| | | }; |
| | | |
| | | |
| | | 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) { |
| | |
| | | |
| | | $(elem).find("img").replaceWith(icon); |
| | | } |
| | | |
| | | |
| | | var ua_prefix; |
| | | (ua_prefix = function() { |
| | | var regex = /^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/; |
| | |
| | | return prop.match(regex)[0]; |
| | | } |
| | | } |
| | | |
| | | |
| | | // Nothing found so far? |
| | | if('WebkitOpacity' in someScript.style) return 'Webkit'; |
| | | if('KhtmlOpacity' in someScript.style) return 'Khtml'; |
| | | |
| | | |
| | | return ''; |
| | | }()); |
| | | |
| | | |
| | | var scaleElements = function(elems, scale) { |
| | | var prefix = '-' + ua_prefix.toLowerCase() + '-'; |
| | | |
| | | |
| | | var sides = ['top', 'left', 'bottom', 'right']; |
| | | |
| | | |
| | | elems.each(function() { |
| | | // console.log('go', scale); |
| | | |
| | | // Handled in CSS |
| | | // this.style[ua_prefix + 'Transform'] = 'scale(' + scale + ')'; |
| | | |
| | | |
| | | var el = $(this); |
| | | |
| | | |
| | | var w = el.outerWidth() * (scale - 1); |
| | | var h = el.outerHeight() * (scale - 1); |
| | | var margins = {}; |
| | | |
| | | |
| | | for(var i = 0; i < 4; i++) { |
| | | var s = sides[i]; |
| | | |
| | | |
| | | var cur = el.data('orig_margin-' + s); |
| | | if(cur == null) { |
| | | cur = parseInt(el.css('margin-' + s)); |
| | |
| | | } else if(s === 'bottom') { |
| | | val += h; |
| | | } |
| | | |
| | | |
| | | el.css('margin-' + s, val); |
| | | // el.css('outline', '1px solid red'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | 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(); |
| | | |
| | | 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 = $('<style id="tool_size_rules"><\/style>').appendTo('head'); |
| | | } else { |
| | | rule_elem.empty(); |
| | | } |
| | | |
| | | |
| | | if(size != 'm') { |
| | | var style_str = ''; |
| | | $.each(cssResizeRules, function(selector, rules) { |
| | |
| | | ); |
| | | rule_elem.text(style_str); |
| | | } |
| | | |
| | | |
| | | setFlyoutPositions(); |
| | | } |
| | | |
| | | |
| | | var cancelOverlays = function() { |
| | | $('#dialog_box').hide(); |
| | | if (!editingsource && !docprops && !preferences) { |
| | |
| | | } |
| | | return; |
| | | }; |
| | | |
| | | |
| | | if (editingsource) { |
| | | if (orig_source !== $('#svg_source_textarea').val()) { |
| | | $.confirm(uiStrings.notification.QignoreSourceChanges, function(ok) { |
| | |
| | | } |
| | | resetScrollPos(); |
| | | }; |
| | | |
| | | |
| | | var hideSourceEditor = function(){ |
| | | $('#svg_source_editor').hide(); |
| | | editingsource = false; |
| | |
| | | }; |
| | | |
| | | var win_wh = {width:$(window).width(), height:$(window).height()}; |
| | | |
| | | |
| | | var resetScrollPos = $.noop, curScrollPos; |
| | | |
| | | |
| | | /* Fix for Issue 781: Drawing area jumps to top-left corner on window resize (IE9) |
| | | if(svgedit.browser.isIE()) { |
| | | (function() { |
| | | resetScrollPos = function() { |
| | | if(workarea[0].scrollLeft === 0 |
| | | if(workarea[0].scrollLeft === 0 |
| | | && workarea[0].scrollTop === 0) { |
| | | workarea[0].scrollLeft = curScrollPos.left; |
| | | workarea[0].scrollTop = curScrollPos.top; |
| | | } |
| | | } |
| | | |
| | | |
| | | curScrollPos = { |
| | | left: workarea[0].scrollLeft, |
| | | top: workarea[0].scrollTop |
| | | }; |
| | | |
| | | |
| | | $(window).resize(resetScrollPos); |
| | | methodDraw.ready(function() { |
| | | // TODO: Find better way to detect when to do this to minimize |
| | |
| | | resetScrollPos(); |
| | | }, 500); |
| | | }); |
| | | |
| | | |
| | | workarea.scroll(function() { |
| | | curScrollPos = { |
| | | left: workarea[0].scrollLeft, |
| | |
| | | }); |
| | | }()); |
| | | }*/ |
| | | |
| | | |
| | | $(window).resize(function(evt) { |
| | | updateCanvas(); |
| | | }); |
| | | |
| | | |
| | | (function() { |
| | | workarea.scroll(function() { |
| | | // TODO: jQuery's scrollLeft/Top() wouldn't require a null check |
| | |
| | | $('#ruler_x')[0].scrollLeft = workarea[0].scrollLeft; |
| | | } |
| | | if ($('#ruler_y').length != 0) { |
| | | $('#ruler_y')[0].scrollTop = workarea[0].scrollTop; |
| | | $('#ruler_y')[0].scrollTop = workarea[0].scrollTop; |
| | | } |
| | | }); |
| | | |
| | | }()); |
| | | |
| | | |
| | | $('#url_notice').click(function() { |
| | | $.alert(this.title); |
| | | }); |
| | | |
| | | |
| | | $('#change_image_url').click(promptImgURL); |
| | | |
| | | |
| | | function promptImgURL() { |
| | | var curhref = svgCanvas.getHref(selectedElement); |
| | | curhref = curhref.indexOf("data:") === 0?"":curhref; |
| | |
| | | if(url) setImageURL(url); |
| | | }); |
| | | } |
| | | |
| | | |
| | | // TODO: go back to the color boxes having white background-color and then setting |
| | | // background-image to none.png (otherwise partially transparent gradients look weird) |
| | | // background-image to none.png (otherwise partially transparent gradients look weird) |
| | | var colorPicker = function(elem) { |
| | | var picker = elem[0].id == 'stroke_color' ? 'stroke' : 'fill'; |
| | | var is_background = elem[0].id == "canvas_color" |
| | | if (is_background) picker = 'canvas' |
| | | // var opacity = (picker == 'stroke' ? $('#stroke_opacity') : $('#fill_opacity')); |
| | | var paint = Editor.paintBox[picker].paint; |
| | | |
| | | |
| | | var title = (picker == 'stroke' ? 'Pick a Stroke Paint and Opacity' : 'Pick a Fill Paint and Opacity'); |
| | | var was_none = false; |
| | | var pos = is_background ? {'right': 175, 'top': 50} : {'left': 50, 'bottom': 50} |
| | | |
| | | |
| | | $("#color_picker") |
| | | .draggable({cancel:'.jGraduate_tabs, .jGraduate_colPick, .jGraduate_gradPick, .jPicker', containment: 'window'}) |
| | | .removeAttr("style") |
| | | .css(pos) |
| | | .jGraduate( |
| | | { |
| | | { |
| | | paint: paint, |
| | | window: { pickerTitle: title }, |
| | | images: { clientPath: curConfig.jGraduatePath }, |
| | |
| | | }, |
| | | function(p) { |
| | | paint = new $.jGraduate.Paint(p); |
| | | |
| | | |
| | | Editor.paintBox[picker].setPaint(paint); |
| | | svgCanvas.setPaint(picker, paint); |
| | | |
| | | |
| | | $('#color_picker').hide(); |
| | | }, |
| | | function(p) { |
| | | $('#color_picker').hide(); |
| | | }); |
| | | }; |
| | | |
| | | |
| | | var PaintBox = function(container, type) { |
| | | var background = document.getElementById("canvas_background"); |
| | | var cur = {color: "fff", opacity: 1} |
| | |
| | | fill="#' + cur.color + '" opacity="' + cur.opacity + '"/>\ |
| | | <defs><linearGradient id="gradbox_"/></defs></svg>', 'text/xml'); |
| | | var docElem = svgdocbox.documentElement; |
| | | |
| | | |
| | | docElem = $(container)[0].appendChild(document.importNode(docElem, true)); |
| | | if (type === 'canvas') docElem.setAttribute('width',60.5); |
| | | else docElem.setAttribute('width',"100%"); |
| | | |
| | | |
| | | this.rect = docElem.firstChild; |
| | | this.defs = docElem.getElementsByTagName('defs')[0]; |
| | | this.grad = this.defs.firstChild; |
| | |
| | | } |
| | | else createBackground(fillAttr) |
| | | } |
| | | |
| | | |
| | | if(apply) { |
| | | svgCanvas.setColor(this.type, fillAttr, true); |
| | | svgCanvas.setPaintOpacity(this.type, opac, true); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | this.update = function(apply) { |
| | | if(!selectedElement) return; |
| | | var type = this.type; |
| | |
| | | case 'use': |
| | | case 'image': |
| | | case 'foreignObject': |
| | | // These elements don't have fill or stroke, so don't change |
| | | // These elements don't have fill or stroke, so don't change |
| | | // the current value |
| | | return; |
| | | case 'g': |
| | | case 'a': |
| | | var gPaint = null; |
| | | |
| | | |
| | | var childs = selectedElement.getElementsByTagName('*'); |
| | | for(var i = 0, len = childs.length; i < len; i++) { |
| | | var elem = childs[i]; |
| | |
| | | return; |
| | | } |
| | | var paintColor = gPaint; |
| | | |
| | | |
| | | var paintOpacity = 1; |
| | | break; |
| | | default: |
| | |
| | | if (isNaN(paintOpacity)) { |
| | | paintOpacity = 1.0; |
| | | } |
| | | |
| | | |
| | | var defColor = type === "fill" ? "black" : "none"; |
| | | var paintColor = selectedElement.getAttribute(type) || defColor; |
| | | } |
| | |
| | | svgCanvas.setPaintOpacity(type, paintOpacity, true); |
| | | } |
| | | |
| | | paintOpacity *= 100; |
| | | |
| | | paintOpacity *= 100; |
| | | |
| | | var paint = getPaint(paintColor, paintOpacity, type); |
| | | // update the rect inside #fill_color/#stroke_color |
| | | this.setPaint(paint); |
| | | } |
| | | |
| | | |
| | | this.prep = function() { |
| | | var ptype = this.paint.type; |
| | | |
| | | |
| | | switch ( ptype ) { |
| | | case 'linearGradient': |
| | | case 'radialGradient': |
| | |
| | | } |
| | | } |
| | | }; |
| | | |
| | | |
| | | Editor.paintBox.fill = new PaintBox('#fill_color', 'fill'); |
| | | Editor.paintBox.stroke = new PaintBox('#stroke_color', 'stroke'); |
| | | Editor.paintBox.canvas = new PaintBox('#canvas_color', 'canvas'); |
| | | |
| | | $('#stroke_width').val(curConfig.initStroke.width); |
| | | $('#group_opacity').val(curConfig.initOpacity * 100); |
| | | |
| | | |
| | | // Use this SVG elem to test vectorEffect support |
| | | var test_el = Editor.paintBox.fill.rect.cloneNode(false); |
| | | test_el.setAttribute('style','vector-effect:non-scaling-stroke'); |
| | |
| | | } |
| | | $(blur_test).remove(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // Test for embedImage support (use timeout to not interfere with page load) |
| | | setTimeout(function() { |
| | | svgCanvas.embedImage('images/placeholder.svg', function(datauri) { |
| | |
| | | } |
| | | }); |
| | | },1000); |
| | | |
| | | |
| | | $('#tool_fill').click(function(){ |
| | | if ($('#tool_fill').hasClass('active')) { |
| | | colorPicker($('#fill_color')); |
| | |
| | | $("#tool_stroke").removeClass('active'); |
| | | } |
| | | }); |
| | | |
| | | |
| | | $('#tool_stroke').on("click", function(){ |
| | | if ($('#tool_stroke').hasClass('active')) { |
| | | colorPicker($('#stroke_color')); |
| | |
| | | $("#tool_fill").removeClass('active'); |
| | | } |
| | | }); |
| | | |
| | | |
| | | $('#tool_canvas').on("click touchstart", function(){ |
| | | colorPicker($('#canvas_color')); |
| | | }); |
| | | |
| | | |
| | | $('#tool_stroke').on("touchstart", function(){ |
| | | $('#tool_stroke').addClass('active'); |
| | | $("#tool_fill").removeClass('active'); |
| | |
| | | $("#tool_stroke").removeClass('active'); |
| | | colorPicker($('#fill_color')); |
| | | }); |
| | | |
| | | |
| | | $('#zoom_select').on("change", function() { |
| | | var val = this.options[this.selectedIndex].text |
| | | val = val.split("%")[0] |
| | | $("#zoom").val(val).trigger("change") |
| | | }); |
| | | |
| | | $('.push_button').mousedown(function() { |
| | | |
| | | $('.push_button').mousedown(function() { |
| | | if (!$(this).hasClass('disabled')) { |
| | | $(this).addClass('push_button_pressed').removeClass('push_button'); |
| | | } |
| | |
| | | }).mouseup(function() { |
| | | $(this).removeClass('push_button_pressed').addClass('push_button'); |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | // function changeResolution(x,y) { |
| | | // var zoom = svgCanvas.getResolution().zoom; |
| | | // setResolution(x * zoom, y * zoom); |
| | | // } |
| | | |
| | | |
| | | var centerCanvas = function() { |
| | | // this centers the canvas vertically in the workarea (horizontal handled in CSS) |
| | | workarea.css('line-height', workarea.height() + 'px'); |
| | | }; |
| | | |
| | | |
| | | $(window).bind('load resize', centerCanvas); |
| | | |
| | | |
| | | function stepFontSize(elem, step) { |
| | | var orig_val = elem.value-0; |
| | | var sug_val = orig_val + step; |
| | | var increasing = sug_val >= orig_val; |
| | | if(step === 0) return orig_val; |
| | | |
| | | |
| | | if(orig_val >= 24) { |
| | | if(increasing) { |
| | | return Math.round(orig_val * 1.1); |
| | |
| | | } |
| | | } else if(orig_val <= 1) { |
| | | if(increasing) { |
| | | return orig_val * 2; |
| | | return orig_val * 2; |
| | | } else { |
| | | return orig_val / 2; |
| | | } |
| | |
| | | return sug_val; |
| | | } |
| | | } |
| | | |
| | | |
| | | function stepZoom(elem, step) { |
| | | var orig_val = elem.value-0; |
| | | if(orig_val === 0) return 100; |
| | | var sug_val = orig_val + step; |
| | | if(step === 0) return orig_val; |
| | | |
| | | |
| | | if(orig_val >= 100) { |
| | | return sug_val; |
| | | } else { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | var changeCanvasSize = function(ctl){ |
| | | var width = $("#canvas_width"); |
| | | var height = $("#canvas_height"); |
| | | var w = width.val(); |
| | | var h = height.val() |
| | | |
| | | |
| | | if(w != "fit" && !svgedit.units.isValidUnit('width', w)) { |
| | | $.alert(uiStrings.notification.invalidAttrValGiven); |
| | | width.parent().addClass('error'); |
| | |
| | | $.alert(uiStrings.notification.invalidAttrValGiven); |
| | | height.parent().addClass('error'); |
| | | return false; |
| | | } |
| | | } |
| | | height.parent().removeClass('error'); |
| | | if(!svgCanvas.setResolution(w, h)) { |
| | | $.alert(uiStrings.notification.noContentToFitTo); |
| | |
| | | } |
| | | updateCanvas(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | $('#resolution').change(function(){ |
| | | var w = $('#canvas_width')[0]; |
| | | var h = $('#canvas_height')[0]; |
| | |
| | | var res = svgCanvas.getResolution() |
| | | w.value = res.w |
| | | h.value = res.h |
| | | |
| | | |
| | | } else { |
| | | var dims = this.value.split('x'); |
| | | dims[0] = parseInt(dims[0]); |
| | | dims[0] = parseInt(dims[0]); |
| | | dims[1] = parseInt(dims[1]); |
| | | var diff_w = dims[0] - w.value; |
| | | var diff_h = dims[1] - h.value; |
| | |
| | | |
| | | } |
| | | }); |
| | | |
| | | |
| | | $('#zoom').change(function(){ |
| | | changeZoom(this) |
| | | }) |
| | | |
| | | |
| | | //Prevent browser from erroneously repopulating fields |
| | | $('input,select').attr("autocomplete","off"); |
| | | |
| | | |
| | | // Associate all button actions as well as non-button keyboard shortcuts |
| | | var Actions = function() { |
| | | // sel:'selector', fn:function, evt:'event', key:[key, preventDefault, NoDisableInInput] |
| | |
| | | {sel:'#tool_italic', fn: clickItalic, evt: 'mousedown', key: [modKey + 'I', true]}, |
| | | //{sel:'#sidepanel_handle', fn: toggleSidePanel, key: ['X']}, |
| | | {sel:'#copy_save_done', fn: cancelOverlays, evt: 'click'}, |
| | | |
| | | |
| | | // Shortcuts not associated with buttons |
| | | |
| | | |
| | | {key: 'ctrl+left', fn: function(){rotateSelected(0,1)}}, |
| | | {key: 'ctrl+right', fn: function(){rotateSelected(1,1)}}, |
| | | {key: 'ctrl+shift+left', fn: function(){rotateSelected(0,5)}}, |
| | | {key: 'ctrl+shift+left', fn: function(){rotateSelected(0,5)}}, |
| | | {key: 'ctrl+shift+right', fn: function(){rotateSelected(1,5)}}, |
| | | {key: 'shift+O', fn: selectPrev}, |
| | | {key: 'shift+P', fn: selectNext}, |
| | |
| | | {key: ['alt+shift+up', true], fn: function(){svgCanvas.cloneSelectedElements(0,-10)}}, |
| | | {key: ['alt+shift+down', true], fn: function(){svgCanvas.cloneSelectedElements(0,10)}}, |
| | | {key: ['alt+shift+left', true], fn: function(){svgCanvas.cloneSelectedElements(-10,0)}}, |
| | | {key: ['alt+shift+right', true], fn: function(){svgCanvas.cloneSelectedElements(10,0)}}, |
| | | {key: ['alt+shift+right', true], fn: function(){svgCanvas.cloneSelectedElements(10,0)}}, |
| | | {key: modKey + 'A', fn: function(){svgCanvas.selectAllInCurrentLayer();}}, |
| | | {key: 'I', fn: function(){setEyedropperMode()}}, |
| | | |
| | |
| | | {key: modKey + 'shift+z', fn: clickRedo}, |
| | | {key: 'esc', fn: minimizeModal} |
| | | ]; |
| | | |
| | | |
| | | // Tooltips not directly associated with a single function |
| | | var key_assocs = { |
| | | '4/Shift+4': '#tools_rect_show', |
| | | '5/Shift+5': '#tools_ellipse_show' |
| | | }; |
| | | |
| | | |
| | | return { |
| | | setAll: function() { |
| | | var flyouts = {}; |
| | | |
| | | $.each(tool_buttons, function(i, opts) { |
| | | |
| | | $.each(tool_buttons, function(i, opts) { |
| | | // Bind function to button |
| | | if(opts.sel) { |
| | | var btn = $(opts.sel); |
| | | if (btn.length == 0) return true; // Skip if markup does not exist |
| | | if(opts.evt) { |
| | | if (svgedit.browser.isTouch() && opts.evt === "click") opts.evt = "mousedown" |
| | | if (svgedit.browser.isTouch() && opts.evt === "click") opts.evt = "mousedown" |
| | | btn[opts.evt](opts.fn); |
| | | } |
| | | |
| | | |
| | | // Add to parent flyout menu, if able to be displayed |
| | | if(opts.parent && $(opts.parent + '_show').length != 0) { |
| | | var f_h = $(opts.parent); |
| | | if(!f_h.length) { |
| | | f_h = makeFlyoutHolder(opts.parent.substr(1)); |
| | | } |
| | | |
| | | |
| | | f_h.append(btn); |
| | | |
| | | |
| | | if(!$.isArray(flyouts[opts.parent])) { |
| | | flyouts[opts.parent] = []; |
| | | } |
| | | flyouts[opts.parent].push(opts); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // Bind function to shortcut key |
| | | if(opts.key) { |
| | | // Set shortcut based on options |
| | |
| | | var modifier_key = keyval.split("+")[0]; |
| | | if (modifier_key == "ctrl") keyval.replace("ctrl", "cmd") |
| | | } |
| | | |
| | | |
| | | $.each(keyval.split('/'), function(i, key) { |
| | | $(document).bind('keydown', key, function(e) { |
| | | fn(); |
| | |
| | | return false; |
| | | }); |
| | | }); |
| | | |
| | | |
| | | // Put shortcut in title |
| | | if(opts.sel && !opts.hidekey && btn.attr('title')) { |
| | | var new_title = btn.attr('title').split('[')[0] + ' (' + keyval + ')'; |
| | |
| | | } |
| | | } |
| | | }); |
| | | |
| | | |
| | | // Setup flyouts |
| | | setupFlyouts(flyouts); |
| | | |
| | | |
| | | $(window).bind('keydown', 'tab', function(e) { |
| | | if(ui_context === 'canvas') { |
| | | e.preventDefault(); |
| | |
| | | selectPrev(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | $('#tool_zoom').dblclick(dblclickZoom); |
| | | }, |
| | | setTitles: function() { |
| | | $.each(key_assocs, function(keyval, sel) { |
| | | var menu = ($(sel).parents('#main_menu').length); |
| | | |
| | | |
| | | $(sel).each(function() { |
| | | if(menu) { |
| | | var t = $(this).text().split(' [')[0]; |
| | | } else { |
| | | var t = this.title.split(' [')[0]; |
| | | var t = this.title.split(' [')[0]; |
| | | } |
| | | var key_str = ''; |
| | | // Shift+Up |
| | |
| | | } |
| | | }; |
| | | }(); |
| | | |
| | | |
| | | Actions.setAll(); |
| | | |
| | | |
| | | // Select given tool |
| | | Editor.ready(function() { |
| | | var tool, |
| | |
| | | tool = $("#tool_select"); |
| | | } |
| | | tool.click().mouseup(); |
| | | |
| | | |
| | | if(curConfig.wireframe) { |
| | | $('#tool_wireframe').click(); |
| | | } |
| | | |
| | | |
| | | if(curConfig.showlayers) { |
| | | toggleSidePanel(); |
| | | } |
| | | |
| | | |
| | | $('#rulers').toggle(!!curConfig.showRulers); |
| | | }); |
| | | |
| | | |
| | | $('#canvas_height').dragInput({ min: 10, max: null, step: 10, callback: changeCanvasSize, cursor: false, dragAdjust: .1 }); |
| | | $('#canvas_width') .dragInput({ min: 10, max: null, step: 10, callback: changeCanvasSize, cursor: false, dragAdjust: .1 }); |
| | | $('#rect_width') .dragInput({ min: 1, max: null, step: 1, callback: changeAttribute, cursor: false }); |
| | | |
| | | |
| | | $('#canvas_height').dragInput({ min: 10, max: null, step: 10, callback: changeCanvasSize, cursor: false, dragAdjust: .1 }); |
| | | $('#canvas_width') .dragInput({ min: 10, max: null, step: 10, callback: changeCanvasSize, cursor: false, dragAdjust: .1 }); |
| | | $('#rect_width') .dragInput({ min: 1, max: null, step: 1, callback: changeAttribute, cursor: false }); |
| | | $('#rect_height') .dragInput({ min: 1, max: null, step: 1, callback: changeAttribute, cursor: false }); |
| | | $('#ellipse_cx') .dragInput({ min: 1, max: null, step: 1, callback: changeAttribute, cursor: false }); |
| | | $('#ellipse_cy') .dragInput({ min: 1, max: null, step: 1, callback: changeAttribute, cursor: false }); |
| | |
| | | $('#font_size') .dragInput({ min: 1, max: 250, step: 1, callback: changeFontSize, cursor: true, stepfunc: stepFontSize, dragAdjust: .15 }); |
| | | $('#group_opacity').dragInput({ min: 0, max: 100, step: 5, callback: changeAttribute, cursor: true, start: 100 }); |
| | | $('#blur') .dragInput({ min: 0, max: 10, step: .1, callback: changeBlur, cursor: true, start: 0 }); |
| | | // Set default zoom |
| | | // Set default zoom |
| | | $('#zoom').val(svgCanvas.getZoom() * 100); |
| | | |
| | | |
| | | $("#workarea").contextMenu({ |
| | | menu: 'cmenu_canvas', |
| | | inSpeed: 0 |
| | |
| | | case 'group': |
| | | svgCanvas.groupSelectedElements(); |
| | | break; |
| | | case 'ungroup': |
| | | svgCanvas.ungroupSelectedElement(); |
| | | case 'ungroup': |
| | | svgCanvas.ungroupSelectedElement(); |
| | | break; |
| | | case 'move_front': |
| | | moveToTopSelected(); |
| | |
| | | } |
| | | break; |
| | | } |
| | | |
| | | |
| | | }); |
| | | |
| | | |
| | | $('.contextMenu li').mousedown(function(ev) { |
| | | ev.preventDefault(); |
| | | }) |
| | | |
| | | |
| | | $('#cmenu_canvas li').disableContextMenu(); |
| | | canv_menu.enableContextMenuItems('#delete,#cut,#copy'); |
| | | |
| | | window.onbeforeunload = function() { |
| | | // Suppress warning if page is empty |
| | | |
| | | window.onbeforeunload = function() { |
| | | // Suppress warning if page is empty |
| | | if(undoMgr.getUndoStackSize() === 0) { |
| | | Editor.show_save_warning = false; |
| | | } |
| | |
| | | // show_save_warning is set to "false" when the page is saved. |
| | | if(!curConfig.no_save_warning && Editor.show_save_warning) { |
| | | // Browser already asks question about closing the page |
| | | return uiStrings.notification.unsavedChanges; |
| | | return uiStrings.notification.unsavedChanges; |
| | | } |
| | | }; |
| | | |
| | | |
| | | Editor.openPrep = function(func) { |
| | | $('#main_menu').hide(); |
| | | if(undoMgr.getUndoStackSize() === 0) { |
| | |
| | | $.confirm(uiStrings.notification.QwantToOpen, func); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (window.FileReader) { |
| | | |
| | | |
| | | var import_image = function(e) { |
| | | e.stopPropagation(); |
| | | e.preventDefault(); |
| | |
| | | if (file) { |
| | | if(file.type.indexOf("image") != -1) { |
| | | //detected an image |
| | | |
| | | |
| | | //svg handing |
| | | if(file.type.indexOf("svg") != -1) { |
| | | var reader = new FileReader(); |
| | |
| | | }; |
| | | reader.readAsText(file); |
| | | } |
| | | |
| | | |
| | | //image handling |
| | | else { |
| | | var reader = new FileReader(); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | var workarea = $("#workarea") |
| | | |
| | | |
| | | function onDragEnter(e) { |
| | | e.stopPropagation(); |
| | | e.preventDefault(); |
| | |
| | | workarea[0].addEventListener('dragover', onDragOver, false); |
| | | workarea[0].addEventListener('dragleave', onDragLeave, false); |
| | | workarea[0].addEventListener('drop', import_image, false); |
| | | |
| | | |
| | | var open = $('<input type="file">').change(function() { |
| | | var f = this; |
| | | Editor.openPrep(function(ok) { |
| | |
| | | }); |
| | | }); |
| | | $("#tool_open").show().prepend(open); |
| | | |
| | | |
| | | var img_import = $('<input type="file">').change(import_image); |
| | | $("#tool_import").show().prepend(img_import); |
| | | } |
| | | |
| | | |
| | | |
| | | var updateCanvas = Editor.updateCanvas = function(center, new_ctr) { |
| | | var w = workarea.width(), h = workarea.height(); |
| | | var w_orig = w, h_orig = h; |
| | | var zoom = svgCanvas.getZoom(); |
| | | var w_area = workarea; |
| | | var cnvs = $("#svgcanvas"); |
| | | |
| | | |
| | | var old_ctr = { |
| | | x: w_area[0].scrollLeft + w_orig/2, |
| | | y: w_area[0].scrollTop + h_orig/2 |
| | | }; |
| | | |
| | | |
| | | var multi = curConfig.canvas_expansion; |
| | | w = Math.max(w_orig, svgCanvas.contentW * zoom * multi); |
| | | h = Math.max(h_orig, svgCanvas.contentH * zoom * multi); |
| | | |
| | | |
| | | if(w == w_orig && h == h_orig) { |
| | | workarea.css('overflow','hidden'); |
| | | } else { |
| | | workarea.css('overflow','scroll'); |
| | | } |
| | | |
| | | |
| | | var old_can_y = cnvs.height()/2; |
| | | var old_can_x = cnvs.width()/2; |
| | | cnvs.width(w).height(h); |
| | | var new_can_y = h/2; |
| | | var new_can_x = w/2; |
| | | var offset = svgCanvas.updateCanvas(w, h); |
| | | |
| | | |
| | | var ratio = new_can_x / old_can_x; |
| | | |
| | | |
| | | var scroll_x = w/2 - w_orig/2; |
| | | var scroll_y = h/2 - h_orig/2; |
| | | |
| | | |
| | | if(!new_ctr) { |
| | | |
| | | |
| | | var old_dist_x = old_ctr.x - old_can_x; |
| | | var new_x = new_can_x + old_dist_x * ratio; |
| | | |
| | | |
| | | var old_dist_y = old_ctr.y - old_can_y; |
| | | var new_y = new_can_y + old_dist_y * ratio; |
| | | |
| | | |
| | | new_ctr = { |
| | | x: new_x, |
| | | y: new_y |
| | | }; |
| | | |
| | | |
| | | } else { |
| | | new_ctr.x += offset.x, |
| | | new_ctr.y += offset.y; |
| | | } |
| | | |
| | | |
| | | //width.val(offset.x) |
| | | //height.val(offset.y) |
| | | |
| | | |
| | | if(center) { |
| | | // Go to top-left for larger documents |
| | | if(svgCanvas.contentW > w_area.width()) { |
| | |
| | | workarea.scroll(); |
| | | } |
| | | } |
| | | |
| | | |
| | | // Make [1,2,5] array |
| | | var r_intervals = []; |
| | | for(var i = .1; i < 1E5; i *= 10) { |
| | |
| | | r_intervals.push(2 * i); |
| | | r_intervals.push(5 * i); |
| | | } |
| | | |
| | | |
| | | function updateRulers(scanvas, zoom) { |
| | | var workarea = document.getElementById("workarea"); |
| | | var title_show = document.getElementById("title_show"); |
| | |
| | | var offset_y = 48; |
| | | if(!zoom) zoom = svgCanvas.getZoom(); |
| | | if(!scanvas) scanvas = $("#svgcanvas"); |
| | | |
| | | |
| | | var limit = 30000; |
| | | |
| | | |
| | | var c_elem = svgCanvas.getContentElem(); |
| | | |
| | | |
| | | var units = svgedit.units.getTypeMap(); |
| | | var unit = units[curConfig.baseUnit]; // 1 = 1px |
| | | |
| | | |
| | | for(var d = 0; d < 2; d++) { |
| | | var is_x = (d === 0); |
| | | var dim = is_x ? 'x' : 'y'; |
| | | var lentype = is_x?'width':'height'; |
| | | var content_d = c_elem.getAttribute(dim)-0; |
| | | |
| | | |
| | | var $hcanv_orig = $('#ruler_' + dim + ' canvas:first'); |
| | | |
| | | |
| | | // Bit of a hack to fully clear the canvas in Safari & IE9 |
| | | $hcanv = $hcanv_orig.clone(); |
| | | $hcanv_orig.replaceWith($hcanv); |
| | | |
| | | |
| | | var hcanv = $hcanv[0]; |
| | | |
| | | |
| | | // Set the canvas size to the width of the container |
| | | var ruler_len = scanvas[lentype]()*2; |
| | | var total_len = ruler_len; |
| | | hcanv.parentNode.style[lentype] = total_len + 'px'; |
| | | |
| | | |
| | | var canv_count = 1; |
| | | var ctx_num = 0; |
| | | var ctx_arr; |
| | | var ctx = hcanv.getContext("2d"); |
| | | |
| | | ctx.fillStyle = "rgb(200,0,0)"; |
| | | ctx.fillRect(0,0,hcanv.width,hcanv.height); |
| | | |
| | | |
| | | ctx.fillStyle = "rgb(200,0,0)"; |
| | | ctx.fillRect(0,0,hcanv.width,hcanv.height); |
| | | |
| | | // Remove any existing canvasses |
| | | $hcanv.siblings().remove(); |
| | | |
| | | |
| | | // Create multiple canvases when necessary (due to browser limits) |
| | | if(ruler_len >= limit) { |
| | | var num = parseInt(ruler_len / limit) + 1; |
| | |
| | | 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; |
| | | |
| | | |
| | | var u_multi = unit * zoom; |
| | | |
| | | |
| | | // Calculate the main number interval |
| | | var raw_m = 50 / u_multi; |
| | | var multi = 1; |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | |
| | | var big_int = multi * u_multi; |
| | | ctx.font = "normal 9px 'Lucida Grande', sans-serif"; |
| | | ctx.fillStyle = "#777"; |
| | |
| | | ctx.moveTo(15, cur_d); |
| | | ctx.lineTo(0, cur_d); |
| | | } |
| | | |
| | | |
| | | var num = (label_pos - content_d) / u_multi; |
| | | var label; |
| | | if(multi >= 1) { |
| | |
| | | var decs = (multi+'').split('.')[1].length; |
| | | label = num.toFixed(decs)-0; |
| | | } |
| | | |
| | | |
| | | // Do anything special for negative numbers? |
| | | // var is_neg = label < 0; |
| | | // real_d2 = Math.abs(real_d2); |
| | | |
| | | |
| | | // 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"; |
| | |
| | | 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; |
| | |
| | | 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.stroke(); |
| | | } |
| | | } |
| | | |
| | | |
| | | // $(function() { |
| | | updateCanvas(true); |
| | | // }); |
| | | |
| | | |
| | | // var revnums = "svg-editor.js ($Rev: 2083 $) "; |
| | | // revnums += svgCanvas.getVersion(); |
| | | // $('#copyright')[0].setAttribute("title", revnums); |
| | | |
| | | |
| | | // Callback handler for embedapi.js |
| | | try{ |
| | | var json_encode = function(obj){ |
| | |
| | | var cbid = parseInt(e.data.substr(0, e.data.indexOf(";"))); |
| | | try{ |
| | | e.source.postMessage("SVGe"+cbid+";"+json_encode(eval(e.data)), "*"); |
| | | }catch(err){ |
| | | }catch(err){ |
| | | e.source.postMessage("SVGe"+cbid+";error:"+err.message, "*"); |
| | | } |
| | | }, false) |
| | | }catch(err){ |
| | | window.embed_error = err; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // For Compatibility with older extensions |
| | | $(function() { |
| | | window.svgCanvas = svgCanvas; |
| | | svgCanvas.ready = methodDraw.ready; |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | Editor.setLang = function(lang, allStrings) { |
| | | $.pref('lang', lang); |
| | | $('#lang_select').val(lang); |
| | | if(allStrings) { |
| | | |
| | | |
| | | var notif = allStrings.notification; |
| | | |
| | | |
| | | svgCanvas.runExtensions("langChanged", lang); |
| | | |
| | | |
| | | // Update flyout tooltips |
| | | setFlyoutTitles(); |
| | | |
| | | |
| | | // Copy title for certain tool elements |
| | | var elems = { |
| | | '#stroke_color': '#tool_stroke .icon_label, #tool_stroke .color_block', |
| | |
| | | '#linejoin_miter': '#cur_linejoin', |
| | | '#linecap_butt': '#cur_linecap' |
| | | } |
| | | |
| | | |
| | | $.each(elems, function(source, dest) { |
| | | $(dest).attr('title', $(source)[0].title); |
| | | }); |
| | | |
| | | |
| | | // Copy alignment titles |
| | | $('#multiselected_panel div[id^=tool_align]').each(function() { |
| | | $('#tool_pos' + this.id.substr(10))[0].title = this.title; |
| | | }); |
| | | |
| | | |
| | | } |
| | | }; |
| | | }; |
| | | |
| | | |
| | | var callbacks = []; |
| | | |
| | | |
| | | function loadSvgString(str, callback) { |
| | | var success = svgCanvas.setSvgString(str) !== false; |
| | | callback = callback || $.noop; |
| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | Editor.ready = function(cb) { |
| | | if(!is_ready) { |
| | | callbacks.push(cb); |
| | |
| | | }); |
| | | is_ready = true; |
| | | }; |
| | | |
| | | |
| | | Editor.loadFromString = function(str) { |
| | | Editor.ready(function() { |
| | | loadSvgString(str); |
| | | }); |
| | | }; |
| | | |
| | | |
| | | Editor.loadFromURL = function(url, opts) { |
| | | if(!opts) opts = {}; |
| | | |
| | | var cache = opts.cache; |
| | | var cb = opts.callback; |
| | | |
| | | |
| | | Editor.ready(function() { |
| | | $.ajax({ |
| | | 'url': url, |
| | |
| | | }); |
| | | }); |
| | | }; |
| | | |
| | | |
| | | Editor.loadFromDataURI = function(str) { |
| | | Editor.ready(function() { |
| | | var pre = 'data:image/svg+xml;base64,'; |
| | |
| | | loadSvgString(svgedit.utilities.decode64(src)); |
| | | }); |
| | | }; |
| | | |
| | | |
| | | Editor.addExtension = function() { |
| | | var args = arguments; |
| | | |
| | | |
| | | // Note that we don't want this on Editor.ready since some extensions |
| | | // may want to run before then (like server_opensave). |
| | | $(function() { |
| | |
| | | |
| | | return Editor; |
| | | }(jQuery); |
| | | |
| | | |
| | | // Run init once DOM is loaded |
| | | $(methodDraw.init); |
| | | |
| | | |
| | | })(); |
| | | |
| | | })(); |
web/public/SVGOrigin/Method-Draw-master/method-draw/src/path.js
web/public/SVGOrigin/Method-Draw-master/method-draw/src/sanitize.js
web/public/SVGOrigin/Method-Draw-master/method-draw/src/select.js
web/public/SVGOrigin/Method-Draw-master/method-draw/src/svgcanvas.js
web/public/SVGOrigin/Method-Draw-master/method-draw/src/svgtransformlist.js
web/public/SVGOrigin/Method-Draw-master/method-draw/src/svgutils.js
web/public/SVGOrigin/Method-Draw-master/method-draw/src/units.js
web/public/SVGOrigin/Method-Draw-master/test/all_tests.html
web/public/SVGOrigin/Method-Draw-master/test/contextmenu_test.html
web/public/SVGOrigin/Method-Draw-master/test/draw_test.html
web/public/SVGOrigin/Method-Draw-master/test/history_test.html
web/public/SVGOrigin/Method-Draw-master/test/math_test.html
web/public/SVGOrigin/Method-Draw-master/test/path_test.html
web/public/SVGOrigin/Method-Draw-master/test/qunit/qunit.css
web/public/SVGOrigin/Method-Draw-master/test/qunit/qunit.js
web/public/SVGOrigin/Method-Draw-master/test/select_test.html
web/public/SVGOrigin/Method-Draw-master/test/svgtransformlist_test.html
web/public/SVGOrigin/Method-Draw-master/test/svgutils_test.html
web/public/SVGOrigin/Method-Draw-master/test/units_test.html
web/public/产品结构树导入模板.xlsx
web/public/评定数据导入模板.xlsx
web/src/views/modules/basicInfo/ProductModelTree.vue
web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue
web/src/views/modules/basicInfo/XhProductModel.vue
web/src/views/modules/taskReliability/PlanMake.vue
web/src/views/modules/taskReliability/Task.vue |