diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 151e90a..87543ec 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -95,12 +95,6 @@ Editor.tool_scale = 1; Editor.setConfig = function(opts) { - $.each(opts, function(key, val) { - // Only allow prefs defined in defaultPrefs - if(key in defaultPrefs) { - $.pref(key, val); - } - }); $.extend(true, curConfig, opts); if(opts.extensions) { curConfig.extensions = opts.extensions; diff --git a/editor/svgedit.compiled.js b/editor/svgedit.compiled.js index 64291d5..7804722 100644 --- a/editor/svgedit.compiled.js +++ b/editor/svgedit.compiled.js @@ -377,9 +377,9 @@ preventClickDefault:qb,recalculateAllSelectedDimensions:Ha,recalculateDimensions initFill:{color:"fff",opacity:1},initStroke:{width:1.5,color:"000",opacity:1},initOpacity:1,imgPath:"images/",extPath:"extensions/",jGraduatePath:"jgraduate/images/",extensions:[],initTool:"select",wireframe:false,colorPickerCSS:false,gridSnapping:false,gridColor:"#000",baseUnit:"px",snappingStep:10,showRulers:svgedit.browser.isTouch()?false:true,show_outside_canvas:false,no_save_warning:true,initFont:"Helvetica, Arial, sans-serif"};uiStrings=c.uiStrings={common:{ok:"OK",cancel:"Cancel",key_up:"Up", key_down:"Down",key_backspace:"Backspace",key_del:"Del"},layers:{layer:"Layer"},notification:{invalidAttrValGiven:"Invalid value given",noContentToFitTo:"No content to fit to",dupeLayerName:"There is already a layer named that!",enterUniqueLayerName:"Please enter a unique layer name",enterNewLayerName:"Please enter the new layer name",layerHasThatName:"Layer already has that name",QmoveElemsToLayer:'Move selected elements to layer "%s"?',QwantToClear:"Do you want to clear the drawing?\nThis will also erase your undo history!", QwantToOpen:"Do you want to open a new file?\nThis will also erase your undo history!",QerrorsRevertToSource:"There were parsing errors in your SVG source.\nRevert back to original SVG source?",QignoreSourceChanges:"Ignore changes made to SVG source?",featNotSupported:"Feature not supported",enterNewImgURL:"Enter the new image URL",defsFailOnSave:"NOTE: Due to a bug in your browser, this image may appear wrong (missing gradients or elements). It will however appear correct once actually saved.",loadingImage:"Loading image, please wait...", -saveFromBrowser:'Select "Save As..." in your browser to save this image as a %s file.',noteTheseIssues:"Also note the following issues: ",unsavedChanges:"There are unsaved changes.",enterNewLinkURL:"Enter the new hyperlink URL",errorLoadingSVG:"Error: Unable to load SVG data",URLloadFail:"Unable to load from URL",retrieving:'Retrieving "%s" ...'}};var s={},b={};c.curConfig=curConfig;c.tool_scale=1;c.setConfig=function(d){a.each(d,function(k,q){k in defaultPrefs&&a.pref(k,q)});a.extend(true,curConfig, -d);if(d.extensions)curConfig.extensions=d.extensions};c.setCustomHandlers=function(d){c.ready(function(){if(d.open){a('#tool_open > input[type="file"]').remove();a("#tool_open").show();g.open=d.open}if(d.save){c.show_save_warning=false;g.bind("saved",d.save)}d.pngsave&&g.bind("exported",d.pngsave);b=d})};c.randomizeIds=function(){g.randomizeIds(arguments)};c.init=function(){function d(n,w){var C=n.id,K=C.split("_"),R=K[0];K=K[1];w&&g.setStrokeAttr("stroke-"+R,K);rb();db("#cur_"+R,C,20);a(n).addClass("current").siblings().removeClass("current")} -function k(n,w){var C=document.getElementById("ruler_x_cursor"),K=document.getElementById("ruler_y_cursor"),R=document.getElementById("workarea");document.getElementById("title_show");svgedit.browser.isTouch()&&a("#workarea").unbind("mousemove.rulers").bind("mousemove.rulers",function(Tb){Tb.stopPropagation();C.style.left=Tb.pageX-66+R.scrollLeft+"px";K.style.top=Tb.pageY-48+R.scrollTop+"px"});w||(w=g.getZoom());n||(n=a("#svgcanvas"));for(var Q=g.getContentElem(),V=svgedit.units.getTypeMap()[curConfig.baseUnit], +saveFromBrowser:'Select "Save As..." in your browser to save this image as a %s file.',noteTheseIssues:"Also note the following issues: ",unsavedChanges:"There are unsaved changes.",enterNewLinkURL:"Enter the new hyperlink URL",errorLoadingSVG:"Error: Unable to load SVG data",URLloadFail:"Unable to load from URL",retrieving:'Retrieving "%s" ...'}};var s={},b={};c.curConfig=curConfig;c.tool_scale=1;c.setConfig=function(d){a.extend(true,curConfig,d);if(d.extensions)curConfig.extensions=d.extensions}; +c.setCustomHandlers=function(d){c.ready(function(){if(d.open){a('#tool_open > input[type="file"]').remove();a("#tool_open").show();g.open=d.open}if(d.save){c.show_save_warning=false;g.bind("saved",d.save)}d.pngsave&&g.bind("exported",d.pngsave);b=d})};c.randomizeIds=function(){g.randomizeIds(arguments)};c.init=function(){function d(n,w){var C=n.id,K=C.split("_"),R=K[0];K=K[1];w&&g.setStrokeAttr("stroke-"+R,K);rb();db("#cur_"+R,C,20);a(n).addClass("current").siblings().removeClass("current")}function k(n, +w){var C=document.getElementById("ruler_x_cursor"),K=document.getElementById("ruler_y_cursor"),R=document.getElementById("workarea");document.getElementById("title_show");svgedit.browser.isTouch()&&a("#workarea").unbind("mousemove.rulers").bind("mousemove.rulers",function(Tb){Tb.stopPropagation();C.style.left=Tb.pageX-66+R.scrollLeft+"px";K.style.top=Tb.pageY-48+R.scrollTop+"px"});w||(w=g.getZoom());n||(n=a("#svgcanvas"));for(var Q=g.getContentElem(),V=svgedit.units.getTypeMap()[curConfig.baseUnit], aa=0;aa<2;aa++){var fa=aa===0,pa=fa?"x":"y",sa=fa?"width":"height",Za=Q.getAttribute(pa)-0;pa=a("#ruler_"+pa+" canvas:first");$hcanv=pa.clone();pa.replaceWith($hcanv);var Aa=$hcanv[0];var ha=pa=n[sa]()*2;Aa.parentNode.style[sa]=ha+"px";var eb=0,Ra,va=Aa.getContext("2d");va.fillStyle="rgb(200,0,0)";va.fillRect(0,0,Aa.width,Aa.height);$hcanv.siblings().remove();if(pa>=3E4){var Na=parseInt(pa/3E4)+1;Ra=Array(Na);Ra[0]=va;for(var ya=1;ya=1)ya=Math.round(Na);else{ya=(Aa+"").split(".")[1].length;ya=Na.toFixed(ya)-0}if(ya!==0&&ya!==1E3&&ya%1E3===0)ya= ya/1E3+"K";if(fa){va.fillText(ya,cb+2,8);va.fillStyle="#777"}else{Na=(ya+"").split("");for(ya=0;yapa){eb++;va.stroke();if(eb>=Ra.length){ya=10;cb=ha;continue}va=Ra[eb];cb-=3E4;yb=Math.round(cb+Na*ya)+0.5}var Hb=ya%2?12:10;if(fa){va.moveTo(yb,15);va.lineTo(yb,Hb)}else{va.moveTo(15,yb);va.lineTo(Hb,yb)}}}va.strokeStyle="#666";va.stroke()}}(function(){var n=window.opener; diff --git a/method-draw/svg-editor.js b/method-draw/svg-editor.js index 151e90a..87543ec 100644 --- a/method-draw/svg-editor.js +++ b/method-draw/svg-editor.js @@ -95,12 +95,6 @@ Editor.tool_scale = 1; Editor.setConfig = function(opts) { - $.each(opts, function(key, val) { - // Only allow prefs defined in defaultPrefs - if(key in defaultPrefs) { - $.pref(key, val); - } - }); $.extend(true, curConfig, opts); if(opts.extensions) { curConfig.extensions = opts.extensions; diff --git a/method-draw/svgedit.compiled.js b/method-draw/svgedit.compiled.js index 64291d5..7804722 100644 --- a/method-draw/svgedit.compiled.js +++ b/method-draw/svgedit.compiled.js @@ -377,9 +377,9 @@ preventClickDefault:qb,recalculateAllSelectedDimensions:Ha,recalculateDimensions initFill:{color:"fff",opacity:1},initStroke:{width:1.5,color:"000",opacity:1},initOpacity:1,imgPath:"images/",extPath:"extensions/",jGraduatePath:"jgraduate/images/",extensions:[],initTool:"select",wireframe:false,colorPickerCSS:false,gridSnapping:false,gridColor:"#000",baseUnit:"px",snappingStep:10,showRulers:svgedit.browser.isTouch()?false:true,show_outside_canvas:false,no_save_warning:true,initFont:"Helvetica, Arial, sans-serif"};uiStrings=c.uiStrings={common:{ok:"OK",cancel:"Cancel",key_up:"Up", key_down:"Down",key_backspace:"Backspace",key_del:"Del"},layers:{layer:"Layer"},notification:{invalidAttrValGiven:"Invalid value given",noContentToFitTo:"No content to fit to",dupeLayerName:"There is already a layer named that!",enterUniqueLayerName:"Please enter a unique layer name",enterNewLayerName:"Please enter the new layer name",layerHasThatName:"Layer already has that name",QmoveElemsToLayer:'Move selected elements to layer "%s"?',QwantToClear:"Do you want to clear the drawing?\nThis will also erase your undo history!", QwantToOpen:"Do you want to open a new file?\nThis will also erase your undo history!",QerrorsRevertToSource:"There were parsing errors in your SVG source.\nRevert back to original SVG source?",QignoreSourceChanges:"Ignore changes made to SVG source?",featNotSupported:"Feature not supported",enterNewImgURL:"Enter the new image URL",defsFailOnSave:"NOTE: Due to a bug in your browser, this image may appear wrong (missing gradients or elements). It will however appear correct once actually saved.",loadingImage:"Loading image, please wait...", -saveFromBrowser:'Select "Save As..." in your browser to save this image as a %s file.',noteTheseIssues:"Also note the following issues: ",unsavedChanges:"There are unsaved changes.",enterNewLinkURL:"Enter the new hyperlink URL",errorLoadingSVG:"Error: Unable to load SVG data",URLloadFail:"Unable to load from URL",retrieving:'Retrieving "%s" ...'}};var s={},b={};c.curConfig=curConfig;c.tool_scale=1;c.setConfig=function(d){a.each(d,function(k,q){k in defaultPrefs&&a.pref(k,q)});a.extend(true,curConfig, -d);if(d.extensions)curConfig.extensions=d.extensions};c.setCustomHandlers=function(d){c.ready(function(){if(d.open){a('#tool_open > input[type="file"]').remove();a("#tool_open").show();g.open=d.open}if(d.save){c.show_save_warning=false;g.bind("saved",d.save)}d.pngsave&&g.bind("exported",d.pngsave);b=d})};c.randomizeIds=function(){g.randomizeIds(arguments)};c.init=function(){function d(n,w){var C=n.id,K=C.split("_"),R=K[0];K=K[1];w&&g.setStrokeAttr("stroke-"+R,K);rb();db("#cur_"+R,C,20);a(n).addClass("current").siblings().removeClass("current")} -function k(n,w){var C=document.getElementById("ruler_x_cursor"),K=document.getElementById("ruler_y_cursor"),R=document.getElementById("workarea");document.getElementById("title_show");svgedit.browser.isTouch()&&a("#workarea").unbind("mousemove.rulers").bind("mousemove.rulers",function(Tb){Tb.stopPropagation();C.style.left=Tb.pageX-66+R.scrollLeft+"px";K.style.top=Tb.pageY-48+R.scrollTop+"px"});w||(w=g.getZoom());n||(n=a("#svgcanvas"));for(var Q=g.getContentElem(),V=svgedit.units.getTypeMap()[curConfig.baseUnit], +saveFromBrowser:'Select "Save As..." in your browser to save this image as a %s file.',noteTheseIssues:"Also note the following issues: ",unsavedChanges:"There are unsaved changes.",enterNewLinkURL:"Enter the new hyperlink URL",errorLoadingSVG:"Error: Unable to load SVG data",URLloadFail:"Unable to load from URL",retrieving:'Retrieving "%s" ...'}};var s={},b={};c.curConfig=curConfig;c.tool_scale=1;c.setConfig=function(d){a.extend(true,curConfig,d);if(d.extensions)curConfig.extensions=d.extensions}; +c.setCustomHandlers=function(d){c.ready(function(){if(d.open){a('#tool_open > input[type="file"]').remove();a("#tool_open").show();g.open=d.open}if(d.save){c.show_save_warning=false;g.bind("saved",d.save)}d.pngsave&&g.bind("exported",d.pngsave);b=d})};c.randomizeIds=function(){g.randomizeIds(arguments)};c.init=function(){function d(n,w){var C=n.id,K=C.split("_"),R=K[0];K=K[1];w&&g.setStrokeAttr("stroke-"+R,K);rb();db("#cur_"+R,C,20);a(n).addClass("current").siblings().removeClass("current")}function k(n, +w){var C=document.getElementById("ruler_x_cursor"),K=document.getElementById("ruler_y_cursor"),R=document.getElementById("workarea");document.getElementById("title_show");svgedit.browser.isTouch()&&a("#workarea").unbind("mousemove.rulers").bind("mousemove.rulers",function(Tb){Tb.stopPropagation();C.style.left=Tb.pageX-66+R.scrollLeft+"px";K.style.top=Tb.pageY-48+R.scrollTop+"px"});w||(w=g.getZoom());n||(n=a("#svgcanvas"));for(var Q=g.getContentElem(),V=svgedit.units.getTypeMap()[curConfig.baseUnit], aa=0;aa<2;aa++){var fa=aa===0,pa=fa?"x":"y",sa=fa?"width":"height",Za=Q.getAttribute(pa)-0;pa=a("#ruler_"+pa+" canvas:first");$hcanv=pa.clone();pa.replaceWith($hcanv);var Aa=$hcanv[0];var ha=pa=n[sa]()*2;Aa.parentNode.style[sa]=ha+"px";var eb=0,Ra,va=Aa.getContext("2d");va.fillStyle="rgb(200,0,0)";va.fillRect(0,0,Aa.width,Aa.height);$hcanv.siblings().remove();if(pa>=3E4){var Na=parseInt(pa/3E4)+1;Ra=Array(Na);Ra[0]=va;for(var ya=1;ya=1)ya=Math.round(Na);else{ya=(Aa+"").split(".")[1].length;ya=Na.toFixed(ya)-0}if(ya!==0&&ya!==1E3&&ya%1E3===0)ya= ya/1E3+"K";if(fa){va.fillText(ya,cb+2,8);va.fillStyle="#777"}else{Na=(ya+"").split("");for(ya=0;yapa){eb++;va.stroke();if(eb>=Ra.length){ya=10;cb=ha;continue}va=Ra[eb];cb-=3E4;yb=Math.round(cb+Na*ya)+0.5}var Hb=ya%2?12:10;if(fa){va.moveTo(yb,15);va.lineTo(yb,Hb)}else{va.moveTo(15,yb);va.lineTo(Hb,yb)}}}va.strokeStyle="#666";va.stroke()}}(function(){var n=window.opener;