2010-05-02 23:33:17 +00:00
|
|
|
$(document).ready(function() {
|
2010-07-22 22:10:40 +00:00
|
|
|
|
|
|
|
// automatic slug from snippet name
|
|
|
|
$('#snippet_name').keypress(function() {
|
|
|
|
var input = $(this);
|
|
|
|
var slug = $('#snippet_slug');
|
|
|
|
|
|
|
|
if (!slug.hasClass('filled')) {
|
|
|
|
setTimeout(function() {
|
|
|
|
slug.val(makeSlug(input.val()));
|
|
|
|
}, 50);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#snippet_slug').keypress(function() { $(this).addClass('filled'); });
|
|
|
|
|
|
|
|
$('a#image-picker-link').imagepicker({
|
|
|
|
insertFn: function(link) {
|
|
|
|
return "{{ theme_images." + link.attr('data-slug') + " }}";
|
|
|
|
}
|
|
|
|
});
|
2010-07-23 20:20:09 +00:00
|
|
|
});
|