Skip to content

Instantly share code, notes, and snippets.

@aaronrussell
Created March 22, 2010 17:22
Show Gist options
  • Save aaronrussell/340295 to your computer and use it in GitHub Desktop.
Save aaronrussell/340295 to your computer and use it in GitHub Desktop.
$('#insert_photo').submit(function()
{
var CKEDITOR = window.parent.CKEDITOR;
var url = $('input:checked[name="img[size]"]').val();
var class = $('input:checked[name="img[align]"]').val();
var alt = $('#photo_alt').val();
var img = '<img src="'+url+'" class="'+class+'" alt="'+alt+'" />';
CKEDITOR.instances.article_body.insertHtml(img);
window.parent.$.modal.close();
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment