Skip to content

Instantly share code, notes, and snippets.

@nclsjstnn
Created May 6, 2013 03:26
Show Gist options
  • Save nclsjstnn/5523211 to your computer and use it in GitHub Desktop.
Save nclsjstnn/5523211 to your computer and use it in GitHub Desktop.
Insert a new button to a form created with the gem "bootstrap-wysihtml5-rails" and manipulate it with bootbox.js https://github.com/jhollingworth/bootstrap-wysihtml5 http://bootboxjs.com
<script type="text/javascript">
$('#post_content').each(function(i, elem) {
$(elem).wysihtml5();
$(".wysihtml5-toolbar").append('<li id="target"><a class="btn" title="Insert gallery" tabindex="-1" href="javascript:;" unselectable="on"><i class="icon-th-large"></i></a></li>');
$("#target").click(function() {
bootbox.alert("Hello world!");
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment