Skip to content

Instantly share code, notes, and snippets.

@jakemcgraw
Created October 6, 2010 16:10
Show Gist options
  • Save jakemcgraw/613586 to your computer and use it in GitHub Desktop.
Save jakemcgraw/613586 to your computer and use it in GitHub Desktop.
//...
$("a.edit").live("click", function(){
$(this).prev(".cmrl").msgeditor({showPreview:true, buttons:{
Accept: function(hash) {
// Update preview, show
$(hash.textarea).next(".preview").html(hash.preview).show();
// Update CMRL, close editor
$(hash.textarea).val("<![CDATA["+hash.cmrl+"]]>").msgeditor("close");
},
Cancel: function(hash) {
// Show preview
$(hash.textarea).next(".preview").show();
// Close editor
$(hash.textarea).msgeditor("close");
}
}});
$(this).prev(".preview").hide();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment