embeddable pastes - the js part

This commit is contained in:
Claude 2012-05-01 18:50:06 +02:00
parent ef7724b32f
commit d86ce778a2

View File

@ -4,6 +4,7 @@ ST.init = function() {
ST.change();
ST.show();
ST.expand();
ST.show_embed();
};
ST.change = function() {
@ -21,6 +22,18 @@ ST.show = function() {
});
};
ST.show_embed = function() {
$embed_field = $('#embed_field');
$embed_field.hide();
$embed_field.after('<a id="show_code" href="#">Show code</a>');
$('#show_code').live('click',
function() {
$(this).hide();
$embed_field.show().select();
return false;
});
};
ST.expand = function() {
$('.expand').click(function() {
if ($('.paste').hasClass('full')) {