opacity mouse scroll now works

master
Mark MacKay 2012-07-25 11:27:20 -05:00
parent 3117b7e31a
commit 67bd9735d8
4 changed files with 10 additions and 10 deletions

View File

@ -10,7 +10,7 @@ $.fn.dragInput = function(cfg){
this.dragCfg = { this.dragCfg = {
min: cfg && !isNaN(parseFloat(cfg.min)) ? Number(cfg.min) : null, // Fixes bug with min:0 min: cfg && !isNaN(parseFloat(cfg.min)) ? Number(cfg.min) : null, // Fixes bug with min:0
max: cfg && !isNaN(parseFloat(cfg.max)) ? Number(cfg.max) : null, max: cfg && !isNaN(parseFloat(cfg.max)) ? Number(cfg.max) : null,
step: cfg && cfg.step ? Number(cfg.step) : 1, step: cfg && Number(cfg.step) ? cfg.step : 1,
stepfunc: cfg && cfg.stepfunc ? cfg.stepfunc : false, stepfunc: cfg && cfg.stepfunc ? cfg.stepfunc : false,
page: cfg && cfg.page ? Number(cfg.page) : 10, page: cfg && cfg.page ? Number(cfg.page) : 10,
reset: cfg && cfg.reset ? cfg.reset : this.value, reset: cfg && cfg.reset ? cfg.reset : this.value,
@ -149,9 +149,9 @@ $.fn.dragInput = function(cfg){
.bind("mousewheel", function(e, delta, deltaX, deltaY){ .bind("mousewheel", function(e, delta, deltaX, deltaY){
if (deltaY > 0) if (deltaY > 0)
this.adjustValue(this.dragCfg.step, true); this.adjustValue(this.dragCfg.step);
else if (deltaY < 0) else if (deltaY < 0)
this.adjustValue(-this.dragCfg.step, true); this.adjustValue(-this.dragCfg.step);
e.preventDefault(); e.preventDefault();
}) })

View File

@ -497,12 +497,12 @@ R/2;S[0].scrollTop=w.y-Q/2}if(curConfig.showRulers){k(aa,V);S.scroll()}},D=[],E=
'"';else if(n.length){for(var C=0;C<n.length;C++)n[C]=w(n[C]);return"["+n.join(",")+"]"}else{C=[];for(var K in n)C.push(w(K)+":"+w(n[K]));return"{"+C.join(",")+"}"}};window.addEventListener("message",function(n){var w=parseInt(n.data.substr(0,n.data.indexOf(";")));try{n.source.postMessage("SVGe"+w+";"+L(eval(n.data)),"*")}catch(C){n.source.postMessage("SVGe"+w+";error:"+C.message,"*")}},false)}catch(N){window.embed_error=N}a(function(){window.svgCanvas=g;g.ready=svgEditor.ready});c.setLang=function(n, '"';else if(n.length){for(var C=0;C<n.length;C++)n[C]=w(n[C]);return"["+n.join(",")+"]"}else{C=[];for(var K in n)C.push(w(K)+":"+w(n[K]));return"{"+C.join(",")+"}"}};window.addEventListener("message",function(n){var w=parseInt(n.data.substr(0,n.data.indexOf(";")));try{n.source.postMessage("SVGe"+w+";"+L(eval(n.data)),"*")}catch(C){n.source.postMessage("SVGe"+w+";error:"+C.message,"*")}},false)}catch(N){window.embed_error=N}a(function(){window.svgCanvas=g;g.ready=svgEditor.ready});c.setLang=function(n,
w){a.pref("lang",n);a("#lang_select").val(n);if(w){g.runExtensions("langChanged",n);Ca();a.each({"#stroke_color":"#tool_stroke .icon_label, #tool_stroke .color_block","#fill_color":"#tool_fill label, #tool_fill .color_block","#linejoin_miter":"#cur_linejoin","#linecap_butt":"#cur_linecap"},function(C,K){a(K).attr("title",a(C)[0].title)});a("#multiselected_panel div[id^=tool_align]").each(function(){a("#tool_pos"+this.id.substr(10))[0].title=this.title})}}};var f=[];c.ready=function(d){m?d():f.push(d)}; w){a.pref("lang",n);a("#lang_select").val(n);if(w){g.runExtensions("langChanged",n);Ca();a.each({"#stroke_color":"#tool_stroke .icon_label, #tool_stroke .color_block","#fill_color":"#tool_fill label, #tool_fill .color_block","#linejoin_miter":"#cur_linejoin","#linecap_butt":"#cur_linecap"},function(C,K){a(K).attr("title",a(C)[0].title)});a("#multiselected_panel div[id^=tool_align]").each(function(){a("#tool_pos"+this.id.substr(10))[0].title=this.title})}}};var f=[];c.ready=function(d){m?d():f.push(d)};
c.runCallbacks=function(){a.each(f,function(){this()});m=true};c.loadFromString=function(d){c.ready(function(){p(d)})};c.loadFromURL=function(d,k){k||(k={});var q=k.cache,B=k.callback;c.ready(function(){a.ajax({url:d,dataType:"text",cache:!!q,success:function(o){p(o,B)},error:function(o,J,U){o.status!=404&&o.responseText?p(o.responseText,B):a.alert(uiStrings.notification.URLloadFail+": \n"+U+"",B)}})})};c.loadFromDataURI=function(d){c.ready(function(){var k=d.substring(26);p(svgedit.utilities.decode64(k))})}; c.runCallbacks=function(){a.each(f,function(){this()});m=true};c.loadFromString=function(d){c.ready(function(){p(d)})};c.loadFromURL=function(d,k){k||(k={});var q=k.cache,B=k.callback;c.ready(function(){a.ajax({url:d,dataType:"text",cache:!!q,success:function(o){p(o,B)},error:function(o,J,U){o.status!=404&&o.responseText?p(o.responseText,B):a.alert(uiStrings.notification.URLloadFail+": \n"+U+"",B)}})})};c.loadFromDataURI=function(d){c.ready(function(){var k=d.substring(26);p(svgedit.utilities.decode64(k))})};
c.addExtension=function(){var d=arguments;a(function(){g&&g.addExtension.apply(this,d)})};return c}(jQuery);$(svgEditor.init)})();$.fn.dragInput=function(a){return this.each(function(){this.repeating=false;this.dragCfg={min:a&&!isNaN(parseFloat(a.min))?Number(a.min):null,max:a&&!isNaN(parseFloat(a.max))?Number(a.max):null,step:a&&a.step?Number(a.step):1,stepfunc:a&&a.stepfunc?a.stepfunc:false,page:a&&a.page?Number(a.page):10,reset:a&&a.reset?a.reset:this.value,delay:a&&a.delay?Number(a.delay):500,interval:a&&a.interval?Number(a.interval):100,height:70,cursor:a&&a.cursor?Boolean(a.cursor):false,start:a&&a.start?Number(a.start): c.addExtension=function(){var d=arguments;a(function(){g&&g.addExtension.apply(this,d)})};return c}(jQuery);$(svgEditor.init)})();$.fn.dragInput=function(a){return this.each(function(){this.repeating=false;this.dragCfg={min:a&&!isNaN(parseFloat(a.min))?Number(a.min):null,max:a&&!isNaN(parseFloat(a.max))?Number(a.max):null,step:a&&Number(a.step)?a.step:1,stepfunc:a&&a.stepfunc?a.stepfunc:false,page:a&&a.page?Number(a.page):10,reset:a&&a.reset?a.reset:this.value,delay:a&&a.delay?Number(a.delay):500,interval:a&&a.interval?Number(a.interval):100,height:70,cursor:a&&a.cursor?Boolean(a.cursor):false,start:a&&a.start?Number(a.start):
0,_btn_width:20,_direction:null,_delay:null,_repeat:null,callback:a&&a.callback?a.callback:null};this.dragCfg.smallStep=a&&a.smallStep?a.smallStep:this.dragCfg.step/2;var p=$(this).parent(),g=$(this),c=this.dragCfg.height,m=this.dragCfg.min,s=this.dragCfg.max,b=this.dragCfg.step,f=s-m>0?(s-m)/b:200,d=f/c*b,k=0,q=this.getAttribute("data-attr"),B=svgEditor.canvas,o=B.getSelectedElems(),J=svgedit.browser.isTouch(),U=f&&this.dragCfg.cursor?$("<div class='draginput_cursor' />").appendTo(p):false;g.attr("readonly", 0,_btn_width:20,_direction:null,_delay:null,_repeat:null,callback:a&&a.callback?a.callback:null};this.dragCfg.smallStep=a&&a.smallStep?a.smallStep:this.dragCfg.step/2;var p=$(this).parent(),g=$(this),c=this.dragCfg.height,m=this.dragCfg.min,s=this.dragCfg.max,b=this.dragCfg.step,f=s-m>0?(s-m)/b:200,d=f/c*b,k=0,q=this.getAttribute("data-attr"),B=svgEditor.canvas,o=B.getSelectedElems(),J=svgedit.browser.isTouch(),U=f&&this.dragCfg.cursor?$("<div class='draginput_cursor' />").appendTo(p):false;g.attr("readonly",
"readonly");U&&!isNaN(this.dragCfg.start)&&U.css("top",this.dragCfg.start*-1/d+c);this.adjustValue=function(M,I){var S;S=isNaN(this.value)?this.dragCfg.reset:$.isFunction(this.dragCfg.stepfunc)?this.dragCfg.stepfunc(this,M):Number((Number(this.value)+Number(M)).toFixed(5));if(s!==null)S=Math.min(S,s);if(m!==null)S=Math.max(S,m);U&&this.updateCursor(S);this.value=S;p.attr("data-value",S);$.isFunction(this.dragCfg.callback)&&this.dragCfg.callback(this,I)};p.toggleClass("draginput",p.is("label"));this.move= "readonly");U&&!isNaN(this.dragCfg.start)&&U.css("top",this.dragCfg.start*-1/d+c);this.adjustValue=function(M,I){var S;S=isNaN(this.value)?this.dragCfg.reset:$.isFunction(this.dragCfg.stepfunc)?this.dragCfg.stepfunc(this,M):Number((Number(this.value)+Number(M)).toFixed(5));if(s!==null)S=Math.min(S,s);if(m!==null)S=Math.max(S,m);U&&this.updateCursor(S);this.value=S;p.attr("data-value",S);$.isFunction(this.dragCfg.callback)&&this.dragCfg.callback(this,I)};p.toggleClass("draginput",p.is("label"));this.move=
function(M,I,S){if(J)M=M.originalEvent.touches[0];if(k===0)k=I;I=(M.pageY-k)*-1;k=M.pageY;S=I*d;this.adjustValue(S.toFixed(b<1?1:0))};this.stop=function(){$("body").removeClass("dragging");p.removeClass("active");$(window).unbind("mousemove.draginput touchmove.draginput mouseup.draginput touchend.draginput");k=0;if(o[0]){var M=B.undoMgr.finishUndoableChange();M.isEmpty()||B.undoMgr.addCommandToHistory(M)}this.adjustValue(0)};this.updateCursor=function(){var M=parseFloat(this.value)*-1/d+c;U.css("top", function(M,I,S){if(J)M=M.originalEvent.touches[0];if(k===0)k=I;I=(M.pageY-k)*-1;k=M.pageY;S=I*d;this.adjustValue(S.toFixed(b<1?1:0))};this.stop=function(){$("body").removeClass("dragging");p.removeClass("active");$(window).unbind("mousemove.draginput touchmove.draginput mouseup.draginput touchend.draginput");k=0;if(o[0]){var M=B.undoMgr.finishUndoableChange();M.isEmpty()||B.undoMgr.addCommandToHistory(M)}this.adjustValue(0)};this.updateCursor=function(){var M=parseFloat(this.value)*-1/d+c;U.css("top",
M)};this.start=function(M){if(J)M=M.originalEvent.touches[0];var I=M.pageY,S=this.value,Y=this;B.undoMgr.beginUndoableChange(q,o);$("body").addClass("dragging");p.addClass("active");$(window).bind("mousemove.draginput touchmove.draginput",function(P){Y.move(P,I,parseFloat(S))});$(window).bind("mouseup.draginput touchend.draginput",function(){Y.stop()})};$(this).attr("readonly","readonly").attr("data-scale",d).attr("data-domain",c).attr("data-cursor",U!=false).bind("mousedown touchstart",function(M){this.blur(); M)};this.start=function(M){if(J)M=M.originalEvent.touches[0];var I=M.pageY,S=this.value,Y=this;B.undoMgr.beginUndoableChange(q,o);$("body").addClass("dragging");p.addClass("active");$(window).bind("mousemove.draginput touchmove.draginput",function(P){Y.move(P,I,parseFloat(S))});$(window).bind("mouseup.draginput touchend.draginput",function(){Y.stop()})};$(this).attr("readonly","readonly").attr("data-scale",d).attr("data-domain",c).attr("data-cursor",U!=false).bind("mousedown touchstart",function(M){this.blur();
this.start(M)}).bind("dblclick taphold",function(){this.removeAttribute("readonly","readonly");this.focus();this.select()}).keydown(function(M){switch(M.keyCode){case 13:this.adjustValue(0);this.blur()}}).focus(function(){this.getAttribute("readonly")==="readonly"&&this.blur()}).blur(function(){this.setAttribute("readonly","readonly")}).bind("mousewheel",function(M,I,S,Y){if(Y>0)this.adjustValue(this.dragCfg.step,true);else Y<0&&this.adjustValue(-this.dragCfg.step,true);M.preventDefault()})})}; this.start(M)}).bind("dblclick taphold",function(){this.removeAttribute("readonly","readonly");this.focus();this.select()}).keydown(function(M){switch(M.keyCode){case 13:this.adjustValue(0);this.blur()}}).focus(function(){this.getAttribute("readonly")==="readonly"&&this.blur()}).blur(function(){this.setAttribute("readonly","readonly")}).bind("mousewheel",function(M,I,S,Y){if(Y>0)this.adjustValue(this.dragCfg.step);else Y<0&&this.adjustValue(-this.dragCfg.step);M.preventDefault()})})};
$.fn.dragInput.updateCursor=function(a){var p=parseFloat(a.value),g=parseFloat(a.getAttribute("data-scale")),c=parseFloat(a.getAttribute("data-domain"));p=p*-1/g+c+"px";a=a.parentNode.lastChild;if(a.className=="draginput_cursor")a.style.top=p};svgedit=svgedit||{}; $.fn.dragInput.updateCursor=function(a){var p=parseFloat(a.value),g=parseFloat(a.getAttribute("data-scale")),c=parseFloat(a.getAttribute("data-domain"));p=p*-1/g+c+"px";a=a.parentNode.lastChild;if(a.className=="draginput_cursor")a.style.top=p};svgedit=svgedit||{};
(function(){var a=this;if(!svgedit.contextmenu)svgedit.contextmenu={};a.contextMenuExtensions={};svgEditor.ready(function(){for(menuItem in contextMenuExtensions){var p=contextMenuExtensions[menuItem];Object.keys(a.contextMenuExtensions).length==0&&$("#cmenu_canvas").append("<li class='separator'>");var g=p.shortcut||"";$("#cmenu_canvas").append("<li class='disabled'><a href='#"+p.id+"'>"+p.label+"<span class='shortcut'>"+g+"</span></a></li>")}});svgedit.contextmenu.resetCustomMenus=function(){a.contextMenuExtensions= (function(){var a=this;if(!svgedit.contextmenu)svgedit.contextmenu={};a.contextMenuExtensions={};svgEditor.ready(function(){for(menuItem in contextMenuExtensions){var p=contextMenuExtensions[menuItem];Object.keys(a.contextMenuExtensions).length==0&&$("#cmenu_canvas").append("<li class='separator'>");var g=p.shortcut||"";$("#cmenu_canvas").append("<li class='disabled'><a href='#"+p.id+"'>"+p.label+"<span class='shortcut'>"+g+"</span></a></li>")}});svgedit.contextmenu.resetCustomMenus=function(){a.contextMenuExtensions=
{}};svgedit.contextmenu.add=function(p){if(p&&p.id&&p.label&&p.action&&typeof p.action=="function")if(p.id in a.contextMenuExtensions)console.error('Cannot add extension "'+p.id+'", an extension by that name already exists"');else{console.log("Registed contextmenu item: {id:"+p.id+", label:"+p.label+"}");a.contextMenuExtensions[p.id]=p}else console.error("Menu items must be defined and have at least properties: id, label, action, where action must be a function")};svgedit.contextmenu.hasCustomHandler= {}};svgedit.contextmenu.add=function(p){if(p&&p.id&&p.label&&p.action&&typeof p.action=="function")if(p.id in a.contextMenuExtensions)console.error('Cannot add extension "'+p.id+'", an extension by that name already exists"');else{console.log("Registed contextmenu item: {id:"+p.id+", label:"+p.label+"}");a.contextMenuExtensions[p.id]=p}else console.error("Menu items must be defined and have at least properties: id, label, action, where action must be a function")};svgedit.contextmenu.hasCustomHandler=

View File

@ -10,7 +10,7 @@ $.fn.dragInput = function(cfg){
this.dragCfg = { this.dragCfg = {
min: cfg && !isNaN(parseFloat(cfg.min)) ? Number(cfg.min) : null, // Fixes bug with min:0 min: cfg && !isNaN(parseFloat(cfg.min)) ? Number(cfg.min) : null, // Fixes bug with min:0
max: cfg && !isNaN(parseFloat(cfg.max)) ? Number(cfg.max) : null, max: cfg && !isNaN(parseFloat(cfg.max)) ? Number(cfg.max) : null,
step: cfg && cfg.step ? Number(cfg.step) : 1, step: cfg && Number(cfg.step) ? cfg.step : 1,
stepfunc: cfg && cfg.stepfunc ? cfg.stepfunc : false, stepfunc: cfg && cfg.stepfunc ? cfg.stepfunc : false,
page: cfg && cfg.page ? Number(cfg.page) : 10, page: cfg && cfg.page ? Number(cfg.page) : 10,
reset: cfg && cfg.reset ? cfg.reset : this.value, reset: cfg && cfg.reset ? cfg.reset : this.value,
@ -149,9 +149,9 @@ $.fn.dragInput = function(cfg){
.bind("mousewheel", function(e, delta, deltaX, deltaY){ .bind("mousewheel", function(e, delta, deltaX, deltaY){
if (deltaY > 0) if (deltaY > 0)
this.adjustValue(this.dragCfg.step, true); this.adjustValue(this.dragCfg.step);
else if (deltaY < 0) else if (deltaY < 0)
this.adjustValue(-this.dragCfg.step, true); this.adjustValue(-this.dragCfg.step);
e.preventDefault(); e.preventDefault();
}) })

View File

@ -497,12 +497,12 @@ R/2;S[0].scrollTop=w.y-Q/2}if(curConfig.showRulers){k(aa,V);S.scroll()}},D=[],E=
'"';else if(n.length){for(var C=0;C<n.length;C++)n[C]=w(n[C]);return"["+n.join(",")+"]"}else{C=[];for(var K in n)C.push(w(K)+":"+w(n[K]));return"{"+C.join(",")+"}"}};window.addEventListener("message",function(n){var w=parseInt(n.data.substr(0,n.data.indexOf(";")));try{n.source.postMessage("SVGe"+w+";"+L(eval(n.data)),"*")}catch(C){n.source.postMessage("SVGe"+w+";error:"+C.message,"*")}},false)}catch(N){window.embed_error=N}a(function(){window.svgCanvas=g;g.ready=svgEditor.ready});c.setLang=function(n, '"';else if(n.length){for(var C=0;C<n.length;C++)n[C]=w(n[C]);return"["+n.join(",")+"]"}else{C=[];for(var K in n)C.push(w(K)+":"+w(n[K]));return"{"+C.join(",")+"}"}};window.addEventListener("message",function(n){var w=parseInt(n.data.substr(0,n.data.indexOf(";")));try{n.source.postMessage("SVGe"+w+";"+L(eval(n.data)),"*")}catch(C){n.source.postMessage("SVGe"+w+";error:"+C.message,"*")}},false)}catch(N){window.embed_error=N}a(function(){window.svgCanvas=g;g.ready=svgEditor.ready});c.setLang=function(n,
w){a.pref("lang",n);a("#lang_select").val(n);if(w){g.runExtensions("langChanged",n);Ca();a.each({"#stroke_color":"#tool_stroke .icon_label, #tool_stroke .color_block","#fill_color":"#tool_fill label, #tool_fill .color_block","#linejoin_miter":"#cur_linejoin","#linecap_butt":"#cur_linecap"},function(C,K){a(K).attr("title",a(C)[0].title)});a("#multiselected_panel div[id^=tool_align]").each(function(){a("#tool_pos"+this.id.substr(10))[0].title=this.title})}}};var f=[];c.ready=function(d){m?d():f.push(d)}; w){a.pref("lang",n);a("#lang_select").val(n);if(w){g.runExtensions("langChanged",n);Ca();a.each({"#stroke_color":"#tool_stroke .icon_label, #tool_stroke .color_block","#fill_color":"#tool_fill label, #tool_fill .color_block","#linejoin_miter":"#cur_linejoin","#linecap_butt":"#cur_linecap"},function(C,K){a(K).attr("title",a(C)[0].title)});a("#multiselected_panel div[id^=tool_align]").each(function(){a("#tool_pos"+this.id.substr(10))[0].title=this.title})}}};var f=[];c.ready=function(d){m?d():f.push(d)};
c.runCallbacks=function(){a.each(f,function(){this()});m=true};c.loadFromString=function(d){c.ready(function(){p(d)})};c.loadFromURL=function(d,k){k||(k={});var q=k.cache,B=k.callback;c.ready(function(){a.ajax({url:d,dataType:"text",cache:!!q,success:function(o){p(o,B)},error:function(o,J,U){o.status!=404&&o.responseText?p(o.responseText,B):a.alert(uiStrings.notification.URLloadFail+": \n"+U+"",B)}})})};c.loadFromDataURI=function(d){c.ready(function(){var k=d.substring(26);p(svgedit.utilities.decode64(k))})}; c.runCallbacks=function(){a.each(f,function(){this()});m=true};c.loadFromString=function(d){c.ready(function(){p(d)})};c.loadFromURL=function(d,k){k||(k={});var q=k.cache,B=k.callback;c.ready(function(){a.ajax({url:d,dataType:"text",cache:!!q,success:function(o){p(o,B)},error:function(o,J,U){o.status!=404&&o.responseText?p(o.responseText,B):a.alert(uiStrings.notification.URLloadFail+": \n"+U+"",B)}})})};c.loadFromDataURI=function(d){c.ready(function(){var k=d.substring(26);p(svgedit.utilities.decode64(k))})};
c.addExtension=function(){var d=arguments;a(function(){g&&g.addExtension.apply(this,d)})};return c}(jQuery);$(svgEditor.init)})();$.fn.dragInput=function(a){return this.each(function(){this.repeating=false;this.dragCfg={min:a&&!isNaN(parseFloat(a.min))?Number(a.min):null,max:a&&!isNaN(parseFloat(a.max))?Number(a.max):null,step:a&&a.step?Number(a.step):1,stepfunc:a&&a.stepfunc?a.stepfunc:false,page:a&&a.page?Number(a.page):10,reset:a&&a.reset?a.reset:this.value,delay:a&&a.delay?Number(a.delay):500,interval:a&&a.interval?Number(a.interval):100,height:70,cursor:a&&a.cursor?Boolean(a.cursor):false,start:a&&a.start?Number(a.start): c.addExtension=function(){var d=arguments;a(function(){g&&g.addExtension.apply(this,d)})};return c}(jQuery);$(svgEditor.init)})();$.fn.dragInput=function(a){return this.each(function(){this.repeating=false;this.dragCfg={min:a&&!isNaN(parseFloat(a.min))?Number(a.min):null,max:a&&!isNaN(parseFloat(a.max))?Number(a.max):null,step:a&&Number(a.step)?a.step:1,stepfunc:a&&a.stepfunc?a.stepfunc:false,page:a&&a.page?Number(a.page):10,reset:a&&a.reset?a.reset:this.value,delay:a&&a.delay?Number(a.delay):500,interval:a&&a.interval?Number(a.interval):100,height:70,cursor:a&&a.cursor?Boolean(a.cursor):false,start:a&&a.start?Number(a.start):
0,_btn_width:20,_direction:null,_delay:null,_repeat:null,callback:a&&a.callback?a.callback:null};this.dragCfg.smallStep=a&&a.smallStep?a.smallStep:this.dragCfg.step/2;var p=$(this).parent(),g=$(this),c=this.dragCfg.height,m=this.dragCfg.min,s=this.dragCfg.max,b=this.dragCfg.step,f=s-m>0?(s-m)/b:200,d=f/c*b,k=0,q=this.getAttribute("data-attr"),B=svgEditor.canvas,o=B.getSelectedElems(),J=svgedit.browser.isTouch(),U=f&&this.dragCfg.cursor?$("<div class='draginput_cursor' />").appendTo(p):false;g.attr("readonly", 0,_btn_width:20,_direction:null,_delay:null,_repeat:null,callback:a&&a.callback?a.callback:null};this.dragCfg.smallStep=a&&a.smallStep?a.smallStep:this.dragCfg.step/2;var p=$(this).parent(),g=$(this),c=this.dragCfg.height,m=this.dragCfg.min,s=this.dragCfg.max,b=this.dragCfg.step,f=s-m>0?(s-m)/b:200,d=f/c*b,k=0,q=this.getAttribute("data-attr"),B=svgEditor.canvas,o=B.getSelectedElems(),J=svgedit.browser.isTouch(),U=f&&this.dragCfg.cursor?$("<div class='draginput_cursor' />").appendTo(p):false;g.attr("readonly",
"readonly");U&&!isNaN(this.dragCfg.start)&&U.css("top",this.dragCfg.start*-1/d+c);this.adjustValue=function(M,I){var S;S=isNaN(this.value)?this.dragCfg.reset:$.isFunction(this.dragCfg.stepfunc)?this.dragCfg.stepfunc(this,M):Number((Number(this.value)+Number(M)).toFixed(5));if(s!==null)S=Math.min(S,s);if(m!==null)S=Math.max(S,m);U&&this.updateCursor(S);this.value=S;p.attr("data-value",S);$.isFunction(this.dragCfg.callback)&&this.dragCfg.callback(this,I)};p.toggleClass("draginput",p.is("label"));this.move= "readonly");U&&!isNaN(this.dragCfg.start)&&U.css("top",this.dragCfg.start*-1/d+c);this.adjustValue=function(M,I){var S;S=isNaN(this.value)?this.dragCfg.reset:$.isFunction(this.dragCfg.stepfunc)?this.dragCfg.stepfunc(this,M):Number((Number(this.value)+Number(M)).toFixed(5));if(s!==null)S=Math.min(S,s);if(m!==null)S=Math.max(S,m);U&&this.updateCursor(S);this.value=S;p.attr("data-value",S);$.isFunction(this.dragCfg.callback)&&this.dragCfg.callback(this,I)};p.toggleClass("draginput",p.is("label"));this.move=
function(M,I,S){if(J)M=M.originalEvent.touches[0];if(k===0)k=I;I=(M.pageY-k)*-1;k=M.pageY;S=I*d;this.adjustValue(S.toFixed(b<1?1:0))};this.stop=function(){$("body").removeClass("dragging");p.removeClass("active");$(window).unbind("mousemove.draginput touchmove.draginput mouseup.draginput touchend.draginput");k=0;if(o[0]){var M=B.undoMgr.finishUndoableChange();M.isEmpty()||B.undoMgr.addCommandToHistory(M)}this.adjustValue(0)};this.updateCursor=function(){var M=parseFloat(this.value)*-1/d+c;U.css("top", function(M,I,S){if(J)M=M.originalEvent.touches[0];if(k===0)k=I;I=(M.pageY-k)*-1;k=M.pageY;S=I*d;this.adjustValue(S.toFixed(b<1?1:0))};this.stop=function(){$("body").removeClass("dragging");p.removeClass("active");$(window).unbind("mousemove.draginput touchmove.draginput mouseup.draginput touchend.draginput");k=0;if(o[0]){var M=B.undoMgr.finishUndoableChange();M.isEmpty()||B.undoMgr.addCommandToHistory(M)}this.adjustValue(0)};this.updateCursor=function(){var M=parseFloat(this.value)*-1/d+c;U.css("top",
M)};this.start=function(M){if(J)M=M.originalEvent.touches[0];var I=M.pageY,S=this.value,Y=this;B.undoMgr.beginUndoableChange(q,o);$("body").addClass("dragging");p.addClass("active");$(window).bind("mousemove.draginput touchmove.draginput",function(P){Y.move(P,I,parseFloat(S))});$(window).bind("mouseup.draginput touchend.draginput",function(){Y.stop()})};$(this).attr("readonly","readonly").attr("data-scale",d).attr("data-domain",c).attr("data-cursor",U!=false).bind("mousedown touchstart",function(M){this.blur(); M)};this.start=function(M){if(J)M=M.originalEvent.touches[0];var I=M.pageY,S=this.value,Y=this;B.undoMgr.beginUndoableChange(q,o);$("body").addClass("dragging");p.addClass("active");$(window).bind("mousemove.draginput touchmove.draginput",function(P){Y.move(P,I,parseFloat(S))});$(window).bind("mouseup.draginput touchend.draginput",function(){Y.stop()})};$(this).attr("readonly","readonly").attr("data-scale",d).attr("data-domain",c).attr("data-cursor",U!=false).bind("mousedown touchstart",function(M){this.blur();
this.start(M)}).bind("dblclick taphold",function(){this.removeAttribute("readonly","readonly");this.focus();this.select()}).keydown(function(M){switch(M.keyCode){case 13:this.adjustValue(0);this.blur()}}).focus(function(){this.getAttribute("readonly")==="readonly"&&this.blur()}).blur(function(){this.setAttribute("readonly","readonly")}).bind("mousewheel",function(M,I,S,Y){if(Y>0)this.adjustValue(this.dragCfg.step,true);else Y<0&&this.adjustValue(-this.dragCfg.step,true);M.preventDefault()})})}; this.start(M)}).bind("dblclick taphold",function(){this.removeAttribute("readonly","readonly");this.focus();this.select()}).keydown(function(M){switch(M.keyCode){case 13:this.adjustValue(0);this.blur()}}).focus(function(){this.getAttribute("readonly")==="readonly"&&this.blur()}).blur(function(){this.setAttribute("readonly","readonly")}).bind("mousewheel",function(M,I,S,Y){if(Y>0)this.adjustValue(this.dragCfg.step);else Y<0&&this.adjustValue(-this.dragCfg.step);M.preventDefault()})})};
$.fn.dragInput.updateCursor=function(a){var p=parseFloat(a.value),g=parseFloat(a.getAttribute("data-scale")),c=parseFloat(a.getAttribute("data-domain"));p=p*-1/g+c+"px";a=a.parentNode.lastChild;if(a.className=="draginput_cursor")a.style.top=p};svgedit=svgedit||{}; $.fn.dragInput.updateCursor=function(a){var p=parseFloat(a.value),g=parseFloat(a.getAttribute("data-scale")),c=parseFloat(a.getAttribute("data-domain"));p=p*-1/g+c+"px";a=a.parentNode.lastChild;if(a.className=="draginput_cursor")a.style.top=p};svgedit=svgedit||{};
(function(){var a=this;if(!svgedit.contextmenu)svgedit.contextmenu={};a.contextMenuExtensions={};svgEditor.ready(function(){for(menuItem in contextMenuExtensions){var p=contextMenuExtensions[menuItem];Object.keys(a.contextMenuExtensions).length==0&&$("#cmenu_canvas").append("<li class='separator'>");var g=p.shortcut||"";$("#cmenu_canvas").append("<li class='disabled'><a href='#"+p.id+"'>"+p.label+"<span class='shortcut'>"+g+"</span></a></li>")}});svgedit.contextmenu.resetCustomMenus=function(){a.contextMenuExtensions= (function(){var a=this;if(!svgedit.contextmenu)svgedit.contextmenu={};a.contextMenuExtensions={};svgEditor.ready(function(){for(menuItem in contextMenuExtensions){var p=contextMenuExtensions[menuItem];Object.keys(a.contextMenuExtensions).length==0&&$("#cmenu_canvas").append("<li class='separator'>");var g=p.shortcut||"";$("#cmenu_canvas").append("<li class='disabled'><a href='#"+p.id+"'>"+p.label+"<span class='shortcut'>"+g+"</span></a></li>")}});svgedit.contextmenu.resetCustomMenus=function(){a.contextMenuExtensions=
{}};svgedit.contextmenu.add=function(p){if(p&&p.id&&p.label&&p.action&&typeof p.action=="function")if(p.id in a.contextMenuExtensions)console.error('Cannot add extension "'+p.id+'", an extension by that name already exists"');else{console.log("Registed contextmenu item: {id:"+p.id+", label:"+p.label+"}");a.contextMenuExtensions[p.id]=p}else console.error("Menu items must be defined and have at least properties: id, label, action, where action must be a function")};svgedit.contextmenu.hasCustomHandler= {}};svgedit.contextmenu.add=function(p){if(p&&p.id&&p.label&&p.action&&typeof p.action=="function")if(p.id in a.contextMenuExtensions)console.error('Cannot add extension "'+p.id+'", an extension by that name already exists"');else{console.log("Registed contextmenu item: {id:"+p.id+", label:"+p.label+"}");a.contextMenuExtensions[p.id]=p}else console.error("Menu items must be defined and have at least properties: id, label, action, where action must be a function")};svgedit.contextmenu.hasCustomHandler=