Sha256: 9c2f754ac575f3b42220d794d960164a3da0445a601f7eea099de05dfecfb42b

Contents?: true

Size: 1.06 KB

Versions: 9

Compression:

Stored size: 1.06 KB

Contents

<%= init_tiny_mce %>
<script language="javascript" type="text/javascript">
<% if include_save_page -%>
function save_page() {
	tinyMCE.triggerSave(true,true);
	var form = jQuery('#<%= form_id %>');
	jQuery('#errorExplanation').fadeOut();
	jQuery.post(form.attr('action') + '.json', form.serialize(),
	  function(data){
			var json = eval('(' + data + ')');
			if(json.success){
				undirty();
				if(json.type == 'create'){
				  jQuery('#<%= form_id %>').attr('action', json.update_path);
				  jQuery('#<%= form_id %>').append('<input id="hidden_put" type="hidden" value="put" name="_method"/>');
				  jQuery('#preview').attr('href', json.preview_path);
				  jQuery('#preview').show();
				}
			} else {
			  show_message(json.message);
			}
	  });
	return false;
}
function undirty(){
	var ed = tinyMCE.get('<%=mce_id%>');
	ed.isNotDirty = 1;
}
<% end -%>

function show_message(message){
  <% if GlobalConfig.growl_enabled -%>
	  jQuery.jGrowl.info(message);
	<% else -%>
	  jQuery('#<%=message_container_id%>').show();
	  jQuery('#<%=message_id%>').fadeIn();
	<% end -%>
}
</script>

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
muck-contents-0.2.26 app/views/tiny_mce/_tiny_mce_scripts.erb
muck-contents-0.2.25 app/views/tiny_mce/_tiny_mce_scripts.erb
muck-contents-0.2.24 app/views/tiny_mce/_tiny_mce_scripts.erb
muck-contents-0.2.23 app/views/tiny_mce/_tiny_mce_scripts.erb
muck-contents-0.2.22 app/views/tiny_mce/_tiny_mce_scripts.erb
muck-contents-0.2.21 app/views/tiny_mce/_tiny_mce_scripts.erb
muck-contents-0.2.20 app/views/tiny_mce/_tiny_mce_scripts.erb
muck-contents-0.2.18 app/views/tiny_mce/_tiny_mce_scripts.erb
muck-contents-0.2.17 app/views/tiny_mce/_tiny_mce_scripts.html.erb