Sha256: 56949b4d1e841582f19a3417592ceeb08ef8b7dc2fb2f0acac471baa01b175ad

Contents?: true

Size: 1.61 KB

Versions: 2

Compression:

Stored size: 1.61 KB

Contents

<% # 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
%>

<% 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}") %>

<script type="text/javascript">
  <%= render :partial => "sketchily/embed",
             :formats => :js,
             :locals => {:id => id,
                         :value => value,
                         :hide_menu => hide_menu,
                         :show_hyperlink_tool => show_hyperlink_tool,
                         :hide_image_tool => hide_image_tool,
                         :url => url} %>
</script>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sketchily-1.4.1 app/views/sketchily/_embed.html.erb~
sketchily-1.4.0 app/views/sketchily/_embed.html.erb~