Created
January 29, 2012 08:49
-
-
Save niwaringo/1697922 to your computer and use it in GitHub Desktop.
gitsEmbedWriteCapture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
$('.gists').each(function() { | |
var $this = $(this); | |
var scriptSrc = '<scr'+'ipt src="' + $this.text() + '" type="text/javascript"></scr'+'ipt>'; | |
var isLine = ($this.data('gistline') !== undefined)? true: false; | |
$this.writeCapture().html(scriptSrc, function() { | |
if(isLine === false) return false; | |
$this.each(function() { | |
$(this).find('.line').each(function(i, e) { | |
$(this).prepend($('<div/>').attr('unselectable','on').addClass('gist-line-no').text(++i)); | |
}); | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment