Sha256: 943bcf089b0b2eef0b85fa9bd5ca0ac775075c42005fff7f304e679e5af87097
Contents?: true
Size: 828 Bytes
Versions: 161
Compression:
Stored size: 828 Bytes
Contents
function loadContent(name) { if (name != undefined) { $('#content').load('examples/' + name + '.html', function() { addExamples(); }); } } function setupActions() { $('.actions').click(function (e) { loadContent(e.target.rel); }); } function addExamples() { var elements = $('.example'); for (var i = 0; i < elements.length; i++) { var element = elements[i]; var elementText = $('<span/>').text($(element).html()); var identText = elementText.text().match(/^\s*/im)[0]; var escapedHtml = elementText.html().replace(new RegExp(identText, 'g'), '\n').trim(); var codeTemplate = $('<code class="html">').append(escapedHtml); var template = $('<pre am-grid-col="l:12:12">').append(codeTemplate); $(element).append(template); hljs.highlightBlock(codeTemplate[0]); } }
Version data entries
161 entries across 161 versions & 1 rubygems