Develop and Download Open Source Software

Browse Subversion Repository

Diff of /SvgEditor.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 29 by isao-hara, Thu Jul 22 08:53:05 2010 UTC revision 30 by isao-hara, Thu Jul 22 13:46:34 2010 UTC
# Line 887  function mkColorPalette(){ Line 887  function mkColorPalette(){
887    if(palette.innerHTML) return;    if(palette.innerHTML) return;
888    
889    palette.innerHTML="";    palette.innerHTML="";
890    palette.addEventListener("touchstart", onTouchStartColor, false);  
891      if(!navigator.userAgent.match("iPad")){
892        palette.addEventListener("touchstart", onTouchStartColor, false);
893      }
894    
895  //  palette.innerHTML="<select id=\"color_sel\"><option value=\"fill\">Fill</option><option value=\"stroke\">Color</option></select>";  //  palette.innerHTML="<select id=\"color_sel\"><option value=\"fill\">Fill</option><option value=\"stroke\">Color</option></select>";
896    for(var i=0; i<colors.length ;i++){    for(var i=0; i<colors.length ;i++){
# Line 2256  function onMouseDown(e){ Line 2259  function onMouseDown(e){
2259      return false;      return false;
2260    }else if(isChildById(e.target, 'color-palette') && e.target.tagName == 'DIV'){    }else if(isChildById(e.target, 'color-palette') && e.target.tagName == 'DIV'){
2261      var ele = e.target;      var ele = e.target;
2262        var palette = document.getElementById('color-palette');
2263      var color = ele.getAttribute("color-val");      var color = ele.getAttribute("color-val");
2264      var color_sel = document.getElementById('color_sel');      var color_sel = palette.getAttribute("targetType");
2265      var fill_input = document.getElementById('svg_fill');      var fill_input = document.getElementById('svg_fill');
2266      var color_input = document.getElementById('svg_color');      var color_input = document.getElementById('svg_color');
2267      if(color) {      if(color) {
2268        for(var i=0;i < selectedItems.length; i++){        for(var i=0;i < selectedItems.length; i++){
2269          try{          selectedItems[i].setAttribute(color_sel, color);
2270            selectedItems[i].setAttribute(color_sel.value, color);          if(color_sel == 'fill'){
2271            if(color_sel.value == 'fill'){ fill_input.value=color; }            fill_input.value=color;
2272            else{ color_input.value=color; }             document.getElementById('toolFill').style.backgroundColor=color;
2273          }catch(err){}          }else{
2274              color_input.value=color;
2275               document.getElementById('toolStroke').style.backgroundColor=color;
2276            }
2277        }        }
2278        palette.style.display='none';
2279      }      }
2280      return false;      return false;
2281    }    }

Legend:
Removed from v.29  
changed lines
  Added in v.30

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26