diff --git a/.gitignore b/.gitignore index e01f87c..ed646d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules/* .DS_Store -deploy.sh \ No newline at end of file +deploy.sh +fuji.sh \ No newline at end of file diff --git a/dist/all.css b/dist/all.css old mode 100644 new mode 100755 index 0fe9a8e..e110724 --- a/dist/all.css +++ b/dist/all.css @@ -152,6 +152,7 @@ table#svg_editor .jPicker { } #svg_editor .jPicker .Button input { width: 100px; + cursor: pointer; } #svg_editor .jPicker td.Radio { @@ -162,6 +163,7 @@ table#svg_editor .jPicker { #svg_editor .jPicker td.Radio input { margin: 0 5px 0 0; padding: 0; + cursor: pointer; } #svg_editor .jPicker td.Text { font-size: 12px!important; @@ -182,7 +184,6 @@ table#svg_editor .jPicker { } #svg_editor .jPicker td.Text input { background-color: #fff; - border: 1px inset #aaa; height: 15px; margin: 0 0 0 5px; text-align: left; @@ -1892,6 +1893,7 @@ div#font-selector .font-item:hover { #color_picker input[type=text], #color_picker input[type=number] { width: 30px; background: #fff; + border: solid rgba(0,0,0,0.3) 1px; } .dropdown_set input[type=text], .dropdown_set input[type=number] { diff --git a/dist/all.js b/dist/all.js index d1f1d4d..939e3f3 100644 --- a/dist/all.js +++ b/dist/all.js @@ -960,12 +960,6 @@ $.jGraduate.Paint({hex: "#rrggbb", linearGradient: o}) -> throws an exception? (function() { var ns = { svg: 'http://www.w3.org/2000/svg', xlink: 'http://www.w3.org/1999/xlink' }; -if(!window.console) { - window.console = new function() { - this.log = function(str) {}; - this.dir = function(str) {}; - }; -} $.jGraduate = { Paint: @@ -1442,40 +1436,49 @@ jQuery.fn.jGraduate = 'stroke-width': 1.5 }, stopGroup); - $(path).mousedown(function(e) { + var $path = $(path); + + $path + .data('stop', stop) + .data('bg', pathbg) + .on("click", function(e) { + if (wasDragged) return wasDragged = false; // just dragged stop + $('div.jGraduate_LightBox').show(); + var colorhandle = this; + var stopOpacity = +stop.getAttribute('stop-opacity') || 1; + var stopColor = stop.getAttribute('stop-color') || 1; + var thisAlpha = (parseFloat(stopOpacity)*255).toString(16); + while (thisAlpha.length < 2) { thisAlpha = "0" + thisAlpha; } + color = stopColor.substr(1) + thisAlpha; + $('#'+id+'_jGraduate_stopPicker').css({'left': 100, 'bottom': 15}).jPicker({ + window: { title: "Pick the start color and opacity for the gradient" }, + images: { clientPath: $settings.images.clientPath }, + color: { active: color, alphaSupport: true } + }, function(color, arg2){ + stopColor = color.val('hex') ? ('#'+color.val('hex')) : "none"; + stopOpacity = color.val('a') !== null ? color.val('a')/256 : 1; + colorhandle.setAttribute('fill', stopColor); + colorhandle.setAttribute('fill-opacity', stopOpacity); + stop.setAttribute('stop-color', stopColor); + stop.setAttribute('stop-opacity', stopOpacity); + $('div.jGraduate_LightBox').hide(); + $('#'+id+'_jGraduate_stopPicker').hide(); + }, null, function() { + $('div.jGraduate_LightBox').hide(); + $('#'+id+'_jGraduate_stopPicker').hide(); + }); + }); + + $path.mousedown(function(e) { selectStop(this); drag = cur_stop; + wasDragged = false; $win.mousemove(dragColor).mouseup(remDrags); stop_offset = stopMakerDiv.offset(); e.preventDefault(); return false; - }).data('stop', stop).data('bg', pathbg).dblclick(function() { - $('div.jGraduate_LightBox').show(); - var colorhandle = this; - var stopOpacity = +stop.getAttribute('stop-opacity') || 1; - var stopColor = stop.getAttribute('stop-color') || 1; - var thisAlpha = (parseFloat(stopOpacity)*255).toString(16); - while (thisAlpha.length < 2) { thisAlpha = "0" + thisAlpha; } - color = stopColor.substr(1) + thisAlpha; - $('#'+id+'_jGraduate_stopPicker').css({'left': 100, 'bottom': 15}).jPicker({ - window: { title: "Pick the start color and opacity for the gradient" }, - images: { clientPath: $settings.images.clientPath }, - color: { active: color, alphaSupport: true } - }, function(color, arg2){ - stopColor = color.val('hex') ? ('#'+color.val('hex')) : "none"; - stopOpacity = color.val('a') !== null ? color.val('a')/256 : 1; - colorhandle.setAttribute('fill', stopColor); - colorhandle.setAttribute('fill-opacity', stopOpacity); - stop.setAttribute('stop-color', stopColor); - stop.setAttribute('stop-opacity', stopOpacity); - $('div.jGraduate_LightBox').hide(); - $('#'+id+'_jGraduate_stopPicker').hide(); - }, null, function() { - $('div.jGraduate_LightBox').hide(); - $('#'+id+'_jGraduate_stopPicker').hide(); - }); }); - + $(curGradient).find('stop').each(function() { var cur_s = $(this); if(+this.getAttribute('offset') > n) { @@ -1505,6 +1508,8 @@ jQuery.fn.jGraduate = var stops, stopGroup; + + var wasDragged = false; var stopMakerDiv = $('#' + id + '_jGraduate_StopSlider'); @@ -1531,7 +1536,10 @@ jQuery.fn.jGraduate = var stop_offset; - function remDrags() { + function remDrags(e) { + if (!wasDragged) { + $(e.target).trigger("click"); // safari and windows fix, others no harm done + } $win.unbind('mousemove', dragColor); if(delStop.getAttribute('display') !== 'none') { remStop(); @@ -1557,7 +1565,7 @@ jQuery.fn.jGraduate = } function dragColor(evt) { - + wasDragged = true; var x = evt.pageX - stop_offset.left; var y = evt.pageY - stop_offset.top; x = x < 10 ? 10 : x > MAX + 10 ? MAX + 10: x; @@ -1970,6 +1978,7 @@ jQuery.fn.jGraduate = }); var dragSlider = function(evt) { + wasDragged = true; setSlider(evt); evt.preventDefault(); }; @@ -20840,7 +20849,7 @@ var svgedit = svgedit || {}; var all = color.active.val('all'); if (win.alphaPrecision < 0) win.alphaPrecision = 0; else if (win.alphaPrecision > 2) win.alphaPrecision = 2; - var controlHtml='
' + (win.title || localization.text.title) + ' | ' + localization.text.newColor + ' ' + localization.text.currentColor + ' | |||
º | ||||
% | ||||
% | ||||
' + (win.alphaSupport ? '' : ' ') + ' | ' + (win.alphaSupport ? ' %' : ' ') + ' | |||
' + (win.alphaSupport ? ' | ' : ' ') + '
' + (win.title || localization.text.title) + ' | ' + localization.text.newColor + ' ' + localization.text.currentColor + ' | |||
º | ||||
% | ||||
% | ||||
' + (win.alphaSupport ? '' : ' ') + ' | ' + (win.alphaSupport ? ' %' : ' ') + ' | |||
' + (win.alphaSupport ? ' | ' : ' ') + '