Sha256: 6f14ade30b370f60227cd0ffe448a00b04b75f5737f39c96275f0ffff0d48f86
Contents?: true
Size: 1.06 KB
Versions: 3
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
3 entries across 3 versions & 1 rubygems