Sha256: 0fdd10bcced9a2c0939e8fc54eab563355bef8d1c359822b639760123fa2e221

Contents?: true

Size: 1.08 KB

Versions: 8

Compression:

Stored size: 1.08 KB

Contents

<% content_for :head do  -%>
  <%= include_tiny_mce_if_needed %>
<% end -%>

<script language="javascript" type="text/javascript">
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 show_message(message){
  <% if GlobalConfig.growl_enabled -%>
	  jQuery.jGrowl.info(message);
	<% else -%>
	  jQuery('#<%=message_container_id%>').show();
	  jQuery('#<%=message_id%>').fadeIn();
	<% end -%>
}
function undirty(){
	var ed = tinyMCE.get('<%=mce_id%>');
	ed.isNotDirty = 1;
}
</script>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
muck-contents-0.2.13 app/views/tiny_mce/_tiny_mce_scripts.html.erb
muck-contents-0.2.12 app/views/tiny_mce/_tiny_mce_scripts.html.erb
muck-contents-0.2.11 app/views/tiny_mce/_tiny_mce_scripts.html.erb
muck-contents-0.2.10 app/views/tiny_mce/_tiny_mce_scripts.html.erb
muck-contents-0.2.9 app/views/tiny_mce/_tiny_mce_scripts.html.erb
muck-contents-0.2.8 app/views/tiny_mce/_tiny_mce_scripts.html.erb
muck-contents-0.2.7 app/views/tiny_mce/_tiny_mce_scripts.html.erb
muck-contents-0.2.6 app/views/tiny_mce/_tiny_mce_scripts.html.erb