2023-01-27 23:11:10 +00:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% block title_row %}{% endblock %}
|
|
|
|
{% block title_ruler %}{% endblock %}
|
|
|
|
|
|
|
|
{% block media %}
|
2023-02-04 13:14:50 +00:00
|
|
|
<style>
|
|
|
|
@media(min-width: 800px) {
|
|
|
|
#content {
|
|
|
|
width: 98%;
|
|
|
|
margin-left: 0;
|
2023-01-27 23:11:10 +00:00
|
|
|
}
|
2023-02-04 13:14:50 +00:00
|
|
|
|
|
|
|
.middle-right-content {
|
|
|
|
margin-left: 13%;
|
|
|
|
display: inline-flex;
|
2023-01-27 23:11:10 +00:00
|
|
|
}
|
2023-02-04 13:14:50 +00:00
|
|
|
}
|
2023-01-27 23:11:10 +00:00
|
|
|
|
2023-02-04 13:14:50 +00:00
|
|
|
@media(max-width: 799px) {
|
|
|
|
#content {
|
|
|
|
width: 100%;
|
|
|
|
margin-left: 0;
|
2023-01-27 23:11:10 +00:00
|
|
|
}
|
|
|
|
|
2023-02-04 13:14:50 +00:00
|
|
|
.middle-right-content {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
{% endblock %}
|
2023-01-27 23:11:10 +00:00
|
|
|
|
2023-02-04 13:14:50 +00:00
|
|
|
{% block js_media %}
|
|
|
|
<script type="text/javascript">
|
|
|
|
function activateBlogBoxOnClick() {
|
2023-02-05 13:13:12 +00:00
|
|
|
$('.show-more').on('click', function () {
|
|
|
|
var $description = $(this).parent().children('.blog-description');
|
2023-02-04 13:14:50 +00:00
|
|
|
var max_height = $description.css('max-height');
|
|
|
|
if (max_height !== 'fit-content') {
|
|
|
|
$description.css('max-height', 'fit-content');
|
2023-02-05 13:13:12 +00:00
|
|
|
$(this).parent().css('cursor', 'auto');
|
|
|
|
$(this).parent().removeClass('pre-expand-blog');
|
|
|
|
console.log($(this).parent());
|
|
|
|
$(this).hide();
|
2023-01-27 23:11:10 +00:00
|
|
|
}
|
2023-02-04 13:14:50 +00:00
|
|
|
})
|
|
|
|
$('.blog-box').each(function () {
|
|
|
|
if ($(this).prop('scrollHeight') > $(this).height()) {
|
|
|
|
$(this).addClass('pre-expand-blog');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function navigateTo($elem, update_sidebar = false) {
|
|
|
|
var url = $elem.attr('data-href') || $elem.attr('href');
|
2023-01-27 23:11:10 +00:00
|
|
|
|
2023-02-04 13:14:50 +00:00
|
|
|
if (url === '#') return;
|
|
|
|
if (update_sidebar) {
|
|
|
|
$('.left-sidebar-item').removeClass('active');
|
|
|
|
$elem.addClass('active');
|
2023-01-27 23:11:10 +00:00
|
|
|
}
|
2023-02-04 13:14:50 +00:00
|
|
|
$('.middle-right-content').html(loading_page);
|
|
|
|
$.get(url, function (data) {
|
|
|
|
var reload_content = $(data).find('.middle-right-content');
|
2023-01-27 23:11:10 +00:00
|
|
|
|
2023-02-04 13:14:50 +00:00
|
|
|
if (reload_content.length) {
|
|
|
|
window.history.pushState("", "", url);
|
|
|
|
$('.middle-right-content').html(reload_content.first().html());
|
|
|
|
$(document).prop('title', $(data).filter('title').text());
|
|
|
|
MathJax.typeset($('.middle-right-content')[0]);
|
|
|
|
onWindowReady();
|
|
|
|
activateBlogBoxOnClick();
|
|
|
|
$('.xdsoft_datetimepicker').hide();
|
|
|
|
registerNavigation();
|
2023-01-27 23:11:10 +00:00
|
|
|
}
|
2023-02-04 13:14:50 +00:00
|
|
|
else {
|
|
|
|
window.location.href = url;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function registerNavigation() {
|
|
|
|
const links = ['.pagination a', '.tabs li a', '.problem-feed-option a'];
|
|
|
|
for (link of links) {
|
|
|
|
$(link).on('click', function (e) {
|
|
|
|
e.preventDefault();
|
|
|
|
navigateTo($(this));
|
|
|
|
})
|
2023-01-27 23:11:10 +00:00
|
|
|
}
|
2023-02-04 13:14:50 +00:00
|
|
|
}
|
2023-01-27 23:11:10 +00:00
|
|
|
|
2023-02-04 13:14:50 +00:00
|
|
|
$(function () {
|
|
|
|
window.addEventListener('popstate', (e) => {
|
|
|
|
window.location.href = e.currentTarget.location.href;
|
|
|
|
});
|
|
|
|
activateBlogBoxOnClick();
|
2023-01-27 23:11:10 +00:00
|
|
|
|
2023-02-04 13:14:50 +00:00
|
|
|
$('.left-sidebar-item').on('click', function () {
|
|
|
|
navigateTo($(this), true);
|
2023-01-27 23:11:10 +00:00
|
|
|
});
|
2023-02-04 13:14:50 +00:00
|
|
|
registerNavigation();
|
|
|
|
});
|
|
|
|
</script>
|
2023-01-27 23:11:10 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% macro make_tab_item(name, fa, url, text) %}
|
2023-02-04 13:14:50 +00:00
|
|
|
<div class="left-sidebar-item {% if page_type == name %}active{% endif %}" data-href="{{ url }}" id="{{ name }}-tab">
|
|
|
|
<span class="sidebar-icon"><i class="{{ fa }}"></i></span>
|
|
|
|
<span>{{ text }}</span>
|
|
|
|
</div>
|
2023-01-27 23:11:10 +00:00
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
{% block body %}
|
2023-02-04 13:14:50 +00:00
|
|
|
{% block before_posts %}{% endblock %}
|
|
|
|
<div id="three-col-container">
|
|
|
|
{% block left_sidebar %}{% endblock %}
|
|
|
|
<div class="middle-right-content">
|
|
|
|
{% block three_col_media %}{% endblock %}
|
|
|
|
{% block three_col_js %}{% endblock %}
|
|
|
|
<div class="middle-content">
|
|
|
|
{% block middle_title %}{% endblock %}
|
|
|
|
{% block middle_content %}{% endblock %}
|
2023-01-27 23:11:10 +00:00
|
|
|
</div>
|
2023-02-04 13:14:50 +00:00
|
|
|
{% block right_sidebar %}{% endblock %}
|
2023-01-27 23:11:10 +00:00
|
|
|
</div>
|
2023-02-04 13:14:50 +00:00
|
|
|
</div>
|
|
|
|
{% block after_posts %}{% endblock %}
|
2023-01-27 23:11:10 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block bodyend %}
|
2023-02-04 13:14:50 +00:00
|
|
|
{{ super() }}
|
|
|
|
{% if REQUIRE_JAX %}
|
|
|
|
{% include "mathjax-load.html" %}
|
|
|
|
{% endif %}
|
|
|
|
{% include "comments/math.html" %}
|
|
|
|
{% endblock %}
|