2010-05-02 23:33:17 +00:00
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
|
|
// automatic slug from snippet name
|
|
|
|
$('#snippet_name').keypress(function() {
|
|
|
|
var input = $(this);
|
|
|
|
var slug = $('#snippet_slug');
|
|
|
|
|
|
|
|
if (!slug.hasClass('filled')) {
|
|
|
|
setTimeout(function() {
|
2010-06-10 13:30:22 +00:00
|
|
|
slug.val(makeSlug(input.val()));
|
2010-05-02 23:33:17 +00:00
|
|
|
}, 50);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#snippet_slug').keypress(function() { $(this).addClass('filled'); });
|
|
|
|
});
|