Sha256: a2a5f70dc5fba7489f05055b7101084d0d06ba34eea08be5ea772620aed1d0bb

Contents?: true

Size: 1.54 KB

Versions: 2

Compression:

Stored size: 1.54 KB

Contents

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head>
    <title>RMce Uploadr</title>
    <script type="text/javascript" charset="utf-8" src="/javascripts/tiny_mce/tiny_mce_popup.js"></script>
    <script type="text/javascript" charset="utf-8" src="/javascripts/rmce_uploadr/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/javascripts/rmce_uploadr.js"></script>
  </head>
  <div id="upload_form">
    <form action="/rmce_uploadr/images" method="post" enctype="multipart/form-data">
      <input type="file" name="image[data]"/>
      <input type="submit" value="Upload"/>
    </form>
  </div>
  <%= yield %>
  
  <script type="text/javascript" charset="utf-8">
    $(function(){
      $("[data-src-original]").click(function(){
        var editor = tinyMCEPopup.editor;

        // Fixes crash in Safari
        if (tinymce.isWebKit) { editor.getWin().focus(); }
        
        var imgParams = {
          src: $(this).attr('data-src-original')
        };
        
        var original = editor.selection.getNode();
        if (original && original.nodeName == 'IMG') {
    			editor.dom.setAttribs(original, imgParams);
    		} else {
    			editor.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1});
    			editor.dom.setAttribs('__mce_tmp', imgParams);
    			editor.dom.setAttrib('__mce_tmp', 'id', '');
    			editor.undoManager.add();
    		}
    			
        tinyMCEPopup.close();
      });
    });
  </script>
</html>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rmce_uploadr-0.0.2 lib/rmce_uploadr/views/layout.erb
rmce_uploadr-0.0.1 lib/rmce_uploadr/views/layout.erb