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

Version Path
smock-0.1.268 guide.js
smock-0.1.267 guide.js
smock-0.1.266 guide.js
smock-0.1.265 guide.js
smock-0.1.264 guide.js
smock-0.1.263 guide.js
smock-0.1.262 guide.js
smock-0.1.261 guide.js
smock-0.1.260 guide.js
smock-0.1.259 guide.js
smock-0.1.258 guide.js
smock-0.1.256 guide.js
smock-0.1.255 guide.js
smock-0.1.254 guide.js
smock-0.1.253 guide.js
smock-0.1.252 guide.js
smock-0.1.251 guide.js
smock-0.1.250 guide.js
smock-0.1.249 guide.js
smock-0.1.247 guide.js