engine/public/javascripts/admin/snippets.js

16 lines
391 B
JavaScript
Raw Normal View History

$(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-05-12 00:16:39 +00:00
slug.val(input.val().replace(/\s/g, '_').toLowerCase());
}, 50);
}
});
$('#snippet_slug').keypress(function() { $(this).addClass('filled'); });
});