Файл: documentation/assets/documentation.js
Строк: 26
<?php
/* global $, hljs */
$(document).ready(function () {
'use strict';
$('.exposed').each(function (i, el) {
var $el = $(el);
$('<pre>').insertAfter($el).append($('<code>').text($el.text()));
});
$('pre code').each(function (i, el) {
hljs.highlightBlock(el);
});
$('a.full-source').on('click', function (ev) {
ev.preventDefault();
$.ajax({
type: 'GET',
url: $(ev.currentTarget).attr('href'),
dataType: 'text',
}).then(function (exampleHtml) {
$('.full-source-modal').fadeIn('fast').empty().append(
$('<pre>').append($('<code>').addClass('html').text(exampleHtml)));
hljs.highlightBlock($('.full-source-modal').find('pre code')[0]);
});
});
$('.full-source-modal').on('click', function (ev) {
$(ev.target).closest('pre').length || $('.full-source-modal').fadeOut('fast');
});
});
?>