
<span id="cbp_images_form">
  <%= link_to_function(l(:cbp_txt_add_image), 'cbImagePaste.showPasteDialog(this); return false;', :class => 'file_selector') %>
  <span id="cbp_image_fields"></span>
</span>

<!-- input field span inspired by redmine/app/views/attachments/_form.html.erb -->
<span id="cbp_image_field" style="display:none">
  <span id="cbp_attach_thumbnail_box">
    <img id="cbp_attach_thumbnail"/>
  </span>
  <%= hidden_field_tag 'attachments[nnnnn][data]', '', :id => 'cbp_image_data' %>
  <%= text_field_tag 'attachments[nnnnn][name]', '', :id => nil, :class => 'name', :maxlength => 50 %>
  <%= link_to('', '#', :title => (l(:cbp_txt_copy_link)), :id => 'cbp_link_btn', :class => 'icon icon-link attachments__button--copy_link') %>
  <% if EasySetting.value('attachment_description') %>
    <%= text_field_tag 'attachments[nnnnn][description]', '', :id => nil, :class => 'description', :maxlength => 255, :placeholder => l(:label_optional_description) %>
  <% end %>
  <%= link_to_function('', 'cbImagePaste.removeImageField(this)', :title => l(:button_delete), :class => 'icon icon-delete attachments__button--remove') %>
</span>

<!-- clipboard paste dialog -->
<div id="cbp_paste_dlg" title="<%= l(:cbp_txt_add_image) %>" style="display:none">
  <script type="text/javascript">
    // translated labels go here (inside namespace)
    (function(cbImagePaste, $, undefined) {
      cbImagePaste.cbp_txt_crop_box        = "<%= escape_javascript(l(:cbp_txt_crop_box         )).html_safe %>";
      cbImagePaste.cbp_txt_print           = "<%= escape_javascript(l(:cbp_txt_print            )).html_safe %>";
      cbImagePaste.cbp_txt_select          = "<%= escape_javascript(l(:cbp_txt_select           )).html_safe %>";
      cbImagePaste.cbp_txt_deselect        = "<%= escape_javascript(l(:cbp_txt_deselect         )).html_safe %>";
      cbImagePaste.cbp_txt_empty_cb        = "<%= escape_javascript(l(:cbp_txt_empty_cb         )).html_safe %>";
      cbImagePaste.cbp_txt_no_image_cb     = "<%= escape_javascript(l(:cbp_txt_no_image_cb      )).html_safe %>";
      cbImagePaste.cbp_txt_no_image_pst    = "<%= escape_javascript(l(:cbp_txt_no_image_pst     )).html_safe %>";
      cbImagePaste.cbp_txt_too_many_files  = "<%= escape_javascript(l(:cbp_txt_too_many_files,  :max_attachments => $clipboard_image_paste_config['max_attachments']   )).html_safe %>";
      cbImagePaste.cbp_txt_wrong_browser   = "<%= escape_javascript(l(:cbp_txt_wrong_browser,   :min_firefox_ver => $clipboard_image_paste_config['min_firefox_ver'], :min_chrome_ver => $clipboard_image_paste_config['min_chrome_ver_hf'], :min_ie_ver => $clipboard_image_paste_config['min_ie_ver'])).html_safe %>";
      cbImagePaste.cbp_txt_btn_ok          = "<%= escape_javascript(l(:cbp_txt_btn_ok           )).html_safe %>";
      cbImagePaste.cbp_txt_btn_cancel      = "<%= escape_javascript(l(:cbp_txt_btn_cancel       )).html_safe %>";
      cbImagePaste.cbp_txt_too_big_image   = "<%= escape_javascript(l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes))).html_safe %>";
      cbImagePaste.cbp_max_attach_size     = <%= Setting.attachment_max_size.to_i.kilobytes %>;
      cbImagePaste.cbp_max_attachments     = <%= $clipboard_image_paste_config['max_attachments'] %>;
      cbImagePaste.cbp_min_chrome_ver      = <%= $clipboard_image_paste_config['min_chrome_ver'] %>;
      cbImagePaste.cbp_min_firefox_ver     = <%= $clipboard_image_paste_config['min_firefox_ver'] %>;
      cbImagePaste.cbp_min_ie_ver          = <%= $clipboard_image_paste_config['min_ie_ver'] %>;
      cbImagePaste.cbp_act_update_id       = "<%= "%03d" % (Time.now.usec / 1000) %>";
    }(window.cbImagePaste = window.cbImagePaste || {}, $));
  </script>

  <div id="cbp_header_box">
    <!-- canvas id="cbp_thumbnail" width="60" height="60"></canvas -->
    <div id="cbp_instructions">&nbsp;</div>
  </div>
  <div id="cbp_panel_box">
    <!-- place for pasted image editor -->
  </div>
</div>

<!-- dialog to copy image link for wiki -->
<div id="cbp_link_dlg" title="<%= l(:cbp_txt_copy_link) %>" style="display:none">
  <input type="text" id="cbp_image_link" readonly />
  <%
    if $clipboard_image_paste_has_jquery
  %>
  <p/>
  <input type="text" id="cbp_thumbnail_link" readonly />
  <%
    end
  %>
</div>
