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.209 guide.js
smock-0.1.208 guide.js
smock-0.1.207 guide.js
smock-0.1.206 guide.js
smock-0.1.205 guide.js
smock-0.1.204 guide.js
smock-0.1.203 guide.js
smock-0.1.202 guide.js
smock-0.1.201 guide.js
smock-0.1.200 guide.js
smock-0.1.199 guide.js
smock-0.1.198 guide.js
smock-0.1.197 guide.js
smock-0.1.196 guide.js
smock-0.1.195 guide.js
smock-0.1.194 guide.js
smock-0.1.193 guide.js
smock-0.1.192 guide.js
smock-0.1.191 guide.js
smock-0.1.190 guide.js