<% # Clients of this partial must supply the following variables: # id # value # # Additionally, they may override the following variables: width ||= "750px" height ||= "650px" bkgd_color ||= "FFF" bkgd_url ||= "" canvas_width ||= 640 canvas_height ||= 480 canvas_expansion ||= 3 hide_rulers ||= false hide_menu ||= false hide_image_tool ||= false show_hyperlink_tool ||= false show_layers ||= false url ||= nil extensions ||= nil %> <% iframe_src = URI.parse("/assets/svg-editor.html") query_hash = {:dimensions => [canvas_width, canvas_height].join(','), :bkgd_color => bkgd_color, :bkgd_url => bkgd_url, :canvas_expansion => canvas_expansion, :showRulers => !hide_rulers, :showlayers => show_layers} query_hash[:url] = url if url query_hash[:source] = nil unless url query_hash[:extensions] = extensions if extensions iframe_src.query = query_hash.map{|k,v| "#{k}=#{v}"}.join('&') %> <%= javascript_include_tag "sketchily_embed" %> <%= content_tag(:iframe, "svg-edit", :src => iframe_src.to_s.html_safe, :width => width, :height => height, :id => "svgedit_#{id}", :style => "visibility: hidden") %>