Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

// works on selected text
var selection = window.getSelection().toString();
if (selection) {
selection = selection.match(/[^\r\n]+/g)
.map(function(a) { return "* " + a; }).
join("\n");
prompt("Here's your markdown:", selection);
}
(function($){
$.widget("ui.mywidget", {
options: {
autoOpen: true
},
_create: function(){
// by default, consider this thing closed.