<% # Clients of this partial must supply the following variables: # id # value # # Additionally, they may override the following variables: width ||= "750px" height ||= "650px" 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(','), :canvas_expansion => canvas_expansion, :showRulers => !hide_rulers, :showlayers => show_layers} if url query_hash[:url] = url else query_hash[:source] = nil end 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}") %>