<% # Clients of this partial must supply the following variables: # id # value # # Additionally, they may override the following variables: width ||= "750px" height ||= "650px" bkgd_color ||= "FFFFFF" bkgd_url ||= "" canvas_width ||= 640 canvas_height ||= 480 canvas_expansion ||= 3 hide_rulers ||= false hide_menu ||= false hide_image_tool ||= false hide_hyperlink_tool ||= false show_layers ||= false url ||= 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 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}") %>