lib/rmce_uploadr/views/layout.erb in rmce_uploadr-0.0.2 vs lib/rmce_uploadr/views/layout.erb in rmce_uploadr-0.0.3

- old
+ new

@@ -1,44 +1,55 @@ <!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> + <style type="text/css" media="screen"> + #upload_form, #main_area { + margin-bottom: 1em; + } + .image { + float: left; + background-color: white; + border: 1px solid #ccc; + padding: 5px; + margin: 10px; + cursor: pointer; + } + .image:hover, .image:focus { + background-color: #eee; + } + img.srcimage { + padding: 0; + margin: 0 0 .2 0; + border: 1px solid #aaa; + } + .quiet { color: #ccc; } + .small { font-size: 11px; } + .clearfix { + clear: both; + overflow: hidden; + height: 0; + } + </style> </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 %> + <body> + <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> - <script type="text/javascript" charset="utf-8"> - $(function(){ - $("[data-src-original]").click(function(){ - var editor = tinyMCEPopup.editor; + <div id="main_area"> + <%= yield %> + </div> - // 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> + <script type="text/javascript" charset="utf-8"> + var uploadrCdnHost = "<%= settings.cdn_host %>"; + </script> + + <script type="text/javascript" src="/javascripts/tiny_mce/tiny_mce_popup.js"></script> + <script type="text/javascript" src="/javascripts/rmce_uploadr/jquery-1.4.2.min.js"></script> + <script type="text/javascript" src="/javascripts/rmce_uploadr.js"></script> + </body> </html>