NDOJ/templates/common-content.html

81 lines
2.3 KiB
HTML
Raw Normal View History

2020-01-21 06:35:58 +00:00
{% extends "base.html" %}
{% block media %}
2023-01-27 23:11:10 +00:00
{% block content_media %}{% endblock %}
2020-01-21 06:35:58 +00:00
{% endblock %}
{% block js_media %}
2023-01-27 23:11:10 +00:00
{% compress js %}
<script type="text/javascript">
$(function () {
var info_float = $('.info-float');
if (info_float.length) {
var container = $('#content-right');
if (window.bad_browser) {
container.css('float', 'right');
} else if (!featureTest('position', 'sticky')) {
fix_div(info_float, 55);
$(window).resize(function () {
info_float.width(container.width());
});
info_float.width(container.width());
}
}
2020-01-21 06:35:58 +00:00
2023-01-29 05:56:52 +00:00
// TODO: remove this
2023-01-27 23:11:10 +00:00
var copyButton;
$('pre code').each(function () {
$(this).parent().before($('<div>', {'class': 'copy-clipboard'})
.append(copyButton = $('<span>', {
'class': 'btn-clipboard',
'data-clipboard-text': $(this).text(),
'title': 'Click to copy'
}).text('Copy')));
2020-01-21 06:35:58 +00:00
2023-01-27 23:11:10 +00:00
$(copyButton.get(0)).mouseleave(function () {
$(this).attr('class', 'btn-clipboard');
$(this).removeAttr('aria-label');
});
2020-01-21 06:35:58 +00:00
2023-01-27 23:11:10 +00:00
var curClipboard = new Clipboard(copyButton.get(0));
2020-01-21 06:35:58 +00:00
2023-01-27 23:11:10 +00:00
curClipboard.on('success', function (e) {
e.clearSelection();
showTooltip(e.trigger, 'Copied!');
});
2020-01-21 06:35:58 +00:00
2023-01-27 23:11:10 +00:00
curClipboard.on('error', function (e) {
showTooltip(e.trigger, fallbackMessage(e.action));
});
2020-01-21 06:35:58 +00:00
2023-01-27 23:11:10 +00:00
});
});
</script>
{% endcompress %}
{% block content_js_media %}{% endblock %}
2020-01-21 06:35:58 +00:00
{% endblock %}
{% block body %}
2023-01-27 23:11:10 +00:00
<div id="common-content">
<div id="content-right">
<div class="info-float">{% block info_float %}{% endblock %}</div>
</div>
<div id="content-left" class="split-common-content">
<div class="content-description screen">
{% block description %}{% endblock %}
{% block description_end %}
<hr>
{% endblock %}
</div>
{% block post_description_end %}{% endblock %}
{% block comments %}{% endblock %}
2020-01-21 06:35:58 +00:00
</div>
2023-01-27 23:11:10 +00:00
</div>
2020-01-21 06:35:58 +00:00
{% endblock %}
{% block bodyend %}
2023-01-27 23:11:10 +00:00
{% if REQUIRE_JAX %}
{% include "mathjax-load.html" %}
{% endif %}
2020-01-21 06:35:58 +00:00
{% endblock %}