mirror of https://gitlab.com/brutaldon/brutaldon
Take out the PJAX again.
It seems initially to work with notifications, but ultimately it just doesn't quite.
This commit is contained in:
parent
faace0fa07
commit
4676c49482
|
@ -152,22 +152,3 @@ function characterCount()
|
|||
return $("#id_status").val().length + $("#id_spoiler_text").val().length;
|
||||
}
|
||||
|
||||
function savePlace()
|
||||
{
|
||||
sessionStorage.setItem("lastScrollPos", window.scrollY);
|
||||
return true;
|
||||
}
|
||||
|
||||
function restorePlace(ev)
|
||||
{
|
||||
var lastScrollPos = sessionStorage.getItem('lastScrollPos');
|
||||
Intercooler.ready(function (elt)
|
||||
{
|
||||
if (elt[0].id == 'main')
|
||||
{
|
||||
window.scrollTo(0, lastScrollPos);
|
||||
}
|
||||
$('#page-load-indicator').hide();
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -59,15 +59,7 @@
|
|||
<nav class="navbar is-fixed-top is-primary" role="navigation"
|
||||
aria-label="main navigation" id="main-nav-bar">
|
||||
<div class="navbar-brand">
|
||||
<a class="navbar-item" href="{% url "home" %}"
|
||||
ic-get-from="{% url "home" %}"
|
||||
ic-target="#main"
|
||||
ic-scroll-to-target="true"
|
||||
ic-push-url="true"
|
||||
ic-on-beforeSend="savePlace"
|
||||
ic-on-success="afterPage('{{ own_acct.username }}', 'Home');"
|
||||
ic-select-from-response="#main"
|
||||
ic-indicator="#page-load-indicator">
|
||||
<a class="navbar-item" href="{% url "home" %}">
|
||||
{% if own_acct %}
|
||||
<img src="{{ own_acct.avatar_static }}"
|
||||
class="image is-32x32 avatar"
|
||||
|
@ -83,36 +75,16 @@
|
|||
<div class="navbar-menu is-active" id="navMenu">
|
||||
<!-- navbar start, navbar end -->
|
||||
<div class="navbar-start">
|
||||
<a href="{% url "home" %}" class="navbar-item"
|
||||
ic-get-from="{% url "home" %}"
|
||||
ic-target="#main"
|
||||
ic-scroll-to-target="true"
|
||||
ic-push-url="true"
|
||||
ic-on-beforeSend="savePlace"
|
||||
ic-on-success="afterPage('{{ own_acct.username }}', 'Home');"
|
||||
ic-select-from-response="#main"
|
||||
ic-indicator="#page-load-indicator">
|
||||
<a href="{% url "home" %}" class="navbar-item">
|
||||
<span class="fa fa-home"></span>
|
||||
<span> Home</span>
|
||||
</a>
|
||||
<a class="navbar-item" href="{% url "note" %}"
|
||||
ic-get-from="{% url "note" %}"
|
||||
ic-target="#main"
|
||||
ic-scroll-to-target="true"
|
||||
ic-select-from-response="#main"
|
||||
ic-push-url="true"
|
||||
ic-on-beforeSend="savePlace"
|
||||
ic-indicator="#page-load-indicator"
|
||||
ic-on-success="afterPage('{{ own_acct.username }}', 'Notifications');">
|
||||
<a class="navbar-item" href="{% url "note" %}">
|
||||
<span class="fa fa-bell-o"></span>
|
||||
{% if preferences.notifications and not preferences.theme.is_brutalist %}
|
||||
<span ic-src="{% url 'notes_count' %}"
|
||||
ic-poll="{{ preferences.poll_frequency }}s"
|
||||
ic-target="this"
|
||||
ic-push-url="false"
|
||||
ic-on-beforeSend="false"
|
||||
ic-on-success="false"
|
||||
ic-indicator="false"
|
||||
ic-select-from-response="#notes-count">
|
||||
<span
|
||||
{% if notifications and notifications != '0' %}
|
||||
|
@ -125,10 +97,6 @@
|
|||
<span ic-src="{% url 'notes_count' %}"
|
||||
ic-poll="{{ preferences.poll_frequency }}s"
|
||||
ic-target="this"
|
||||
ic-on-beforeSend="false"
|
||||
ic-on-success="false"
|
||||
ic-push-url="false"
|
||||
ic-indicator="false"
|
||||
ic-select-from-response="#notes-count">
|
||||
<span > Notifications ({{ notifications }})</span>
|
||||
</span>
|
||||
|
@ -136,27 +104,11 @@
|
|||
<span > Notifications</span>
|
||||
{% endif %}
|
||||
</a>
|
||||
<a class="navbar-item" href="{% url "local" %}"
|
||||
ic-get-from="{% url "local" %}"
|
||||
ic-target="#main"
|
||||
ic-scroll-to-target="true"
|
||||
ic-select-from-response="#main"
|
||||
ic-push-url="true"
|
||||
ic-on-beforeSend="savePlace"
|
||||
ic-indicator="#page-load-indicator"
|
||||
ic-on-success="afterPage('{{ own_acct.username }}', 'Local timeline');">
|
||||
<a class="navbar-item" href="{% url "local" %}">
|
||||
<span class="fa fa-community"></span>
|
||||
<span > Local</span>
|
||||
</a>
|
||||
<a class="navbar-item" href="{% url "fed" %}"
|
||||
ic-get-from="{% url "fed" %}"
|
||||
ic-target="#main"
|
||||
ic-scroll-to-target="true"
|
||||
ic-select-from-response="#main"
|
||||
ic-push-url="true"
|
||||
ic-on-beforeSend="savePlace"
|
||||
ic-indicator="#page-load-indicator"
|
||||
ic-on-success="afterPage('{{ own_acct.username }}', 'Federated timeline');">
|
||||
<a class="navbar-item" href="{% url "fed" %}">
|
||||
<span class="fa fa-globe"></span>
|
||||
<span > Federated</span>
|
||||
</a>
|
||||
|
@ -167,35 +119,17 @@
|
|||
<span class="fa fa-edit"> </span>
|
||||
<span > New Toot</span>
|
||||
</a>
|
||||
<a class="navbar-item" href="{% url "search" %}"
|
||||
ic-get-from="{% url "search" %}"
|
||||
ic-target="#main"
|
||||
ic-scroll-to-target="true"
|
||||
ic-select-from-response="#main"
|
||||
ic-push-url="true"
|
||||
ic-on-beforeSend="savePlace"
|
||||
ic-indicator="#page-load-indicator"
|
||||
ic-on-success="afterPage('{{ own_acct.username }}', 'Search');">
|
||||
<a class="navbar-item" href="{% url "search" %}">
|
||||
<span class="fa fa-search"> </span>
|
||||
<span > Search</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-end" >
|
||||
<a class="navbar-item" href="{% url "settings" %}"
|
||||
ic-get-from="{% url "settings" %}"
|
||||
ic-target="#main"
|
||||
ic-scroll-to-target="true"
|
||||
ic-select-from-response="#main"
|
||||
ic-push-url="true"
|
||||
ic-on-beforeSend="savePlace"
|
||||
ic-indicator="#page-load-indicator"
|
||||
ic-on-success="afterPage('{{ own_acct.username }}', 'Settings');">
|
||||
<a class="navbar-item" href="{% url "settings" %}">
|
||||
<span class="fa fa-gear"></span>
|
||||
<span > Settings</span>
|
||||
</a>
|
||||
<a class="navbar-item" href="{% url "logout" %}"
|
||||
ic-get-from="{% url "logout" %}"
|
||||
ic-confirm="Are you sure you want to log out?">
|
||||
<a class="navbar-item" href="{% url "logout" %}">
|
||||
<span class="fa fa-power-off"></span>
|
||||
<span > Log out</span>
|
||||
</a>
|
||||
|
@ -206,7 +140,7 @@
|
|||
</nav>
|
||||
{% endblock %}
|
||||
|
||||
<section id="main" class="section" ic-history-elt="true">
|
||||
<section id="main" class="section">
|
||||
<div class="container">
|
||||
{% block content %}
|
||||
<h1 class="title">
|
||||
|
@ -248,8 +182,6 @@
|
|||
<script type="application/javascript">
|
||||
$(document).ready(function () {
|
||||
menuPrepare();
|
||||
$(document).on('handle.onpopstate.ic',
|
||||
restorePlace);
|
||||
});
|
||||
|
||||
{% if preferences.lightbox %}
|
||||
|
|
|
@ -172,15 +172,7 @@
|
|||
{% endif %}
|
||||
{{ toot.visibility }}
|
||||
|
||||
<a class="level-item" href="{% url "thread" toot.id %}"
|
||||
ic-get-from="{% url "thread" toot.id %}"
|
||||
ic-target="#main"
|
||||
ic-select-from-response="#main"
|
||||
ic-push-url="true"
|
||||
ic-scroll-to-target="true"
|
||||
ic-on-beforeSend="savePlace"
|
||||
ic-on-success="afterPage('{{ own_acct.username }}', 'thread');"
|
||||
ic-indicator="#page-load-indicator">
|
||||
<a class="level-item" href="{% url "thread" toot.id %}">
|
||||
thread
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -402,7 +402,6 @@ def settings(request):
|
|||
account.preferences.notifications = form.cleaned_data['notifications']
|
||||
account.preferences.click_to_load = form.cleaned_data['click_to_load']
|
||||
account.preferences.lightbox = form.cleaned_data['lightbox']
|
||||
account.preferences.poll_frequency = form.cleaned_data['poll_frequency']
|
||||
request.session['timezone'] = account.preferences.timezone
|
||||
account.preferences.save()
|
||||
account.save()
|
||||
|
|
Loading…
Reference in New Issue