app/views/tiny_mce/files.erb in muck-contents-0.2.27 vs app/views/tiny_mce/files.erb in muck-contents-3.0.0
- old
+ new
@@ -1,9 +1,9 @@
<div id="file-upload">
<fieldset>
<legend>Upload New File</legend>
- <%= tiny_mce_upload_form(@parent) %>
+ <%= tiny_mce_upload_form(@parent, true, 'mce_uploader') %>
</fieldset>
</div>
<br />
<form name="insert_file" id="insert_file" onsubmit="insertAction();return false;" action="#">
@@ -80,22 +80,24 @@
<% content_for :head do -%>
<%= javascript_include_tag 'tiny_mce/plugins/muckfile/js/functions.js' -%>
<% end -%>
<script language="javascript" type="text/javascript">
-jQuery(document).ready(function()
-{
+
+tinyMCEPopup.onInit.add(function(ed) {
jQuery.getJSON('<%=@load_files_path%>', function(json){
if (json.length <= 0){
jQuery("#upload-list-message").html('<%= t('muck.contents.no_files') %>');
} else {
jQuery('#upload-list-message').html('');
for(i=0;i<json.length;i++){
add_file(json[i], 'append');
}
}
});
+ jQuery('#mce_uploader_upload').uploadify(mce_uploader_options);
});
+
function upload_completed_callback(data){
jQuery('#upload-list-message').html('');
var json = eval('(' + data + ')');
add_file(json, 'prepend');
}
\ No newline at end of file