Merge pull request 'Bust more js and all CSS with resource_version' (#180) from cache-busters into config

Reviewed-on: https://git.leftypol.org/leftypol/leftypol/pulls/180
This commit is contained in:
Zankaria 2024-08-22 12:40:43 +00:00
commit c3e4d51d30
11 changed files with 46 additions and 46 deletions

View file

@ -1,14 +1,14 @@
<link rel="stylesheet" media="screen" href="{{ config.url_stylesheet }}"> <link rel="stylesheet" media="screen" href="{{ config.url_stylesheet }}?v={{ config.resource_version }}">
{% if config.url_favicon %}<link rel="shortcut icon" href="{{ config.url_favicon }}">{% endif %} {% if config.url_favicon %}<link rel="shortcut icon" href="{{ config.url_favicon }}">{% endif %}
{% if config.url_appletouchicon %}<link rel=apple-touch-icon" href="{{ config.url_appletouchicon }}">{% endif %} {% if config.url_appletouchicon %}<link rel=apple-touch-icon" href="{{ config.url_appletouchicon }}">{% endif %}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes"> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes">
{% if config.meta_keywords %}<meta name="keywords" content="{{ config.meta_keywords }}">{% endif %} {% if config.meta_keywords %}<meta name="keywords" content="{{ config.meta_keywords }}">{% endif %}
{% if config.default_stylesheet.1 != '' %}<link rel="stylesheet" type="text/css" id="stylesheet" href="{{ config.uri_stylesheets }}{{ config.default_stylesheet.1 }}">{% endif %} {% if config.default_stylesheet.1 != '' %}<link rel="stylesheet" type="text/css" id="stylesheet" href="{{ config.uri_stylesheets }}{{ config.default_stylesheet.1 }}?v={{ config.resource_version }}">{% endif %}
{% if config.default_code_stylesheet.1 != '' %}<link rel="stylesheet" type="text/css" id="code_stylesheet" href="{{ config.uri_stylesheets }}{{ config.default_code_stylesheet.1 }}">{% endif %} {% if config.default_code_stylesheet.1 != '' %}<link rel="stylesheet" type="text/css" id="code_stylesheet" href="{{ config.uri_stylesheets }}{{ config.default_code_stylesheet.1 }}?v={{ config.resource_version }}">{% endif %}
{% if config.font_awesome %}<link rel="stylesheet" href="{{ config.root }}{{ config.font_awesome_css }}">{% endif %} {% if config.font_awesome %}<link rel="stylesheet" href="{{ config.root }}{{ config.font_awesome_css }}">{% endif %}
{% if config.country_flags_condensed %}<link rel="stylesheet" href="{{ config.root }}{{ config.country_flags_condensed_css }}">{% endif %} {% if config.country_flags_condensed %}<link rel="stylesheet" href="{{ config.root }}{{ config.country_flags_condensed_css }}">{% endif %}
{% if config.sc_editor %} <link rel="stylesheet" href="{{ config.uri_stylesheets }}sceditor/themes/{{ config.sc_editor_theme }}.css" media="all" /> {% endif %} {% if config.sc_editor %} <link rel="stylesheet" href="{{ config.uri_stylesheets }}sceditor/themes/{{ config.sc_editor_theme }}.css?v={{ config.resource_version }}" media="all" /> {% endif %}
<script type="text/javascript"> <script type="text/javascript">
var configRoot="{{ config.root }}"; var configRoot="{{ config.root }}";
var inMod = {% if mod %}true{% else %}false{% endif %}; var inMod = {% if mod %}true{% else %}false{% endif %};
@ -18,10 +18,10 @@
<script type="text/javascript" src="{{ config.url_javascript }}?v={{ config.resource_version }}"></script> <script type="text/javascript" src="{{ config.url_javascript }}?v={{ config.resource_version }}"></script>
{% if not config.additional_javascript_compile %} {% if not config.additional_javascript_compile %}
{% if not config.deferred_javascript %} {% if not config.deferred_javascript %}
{% for javascript in config.additional_javascript|merge(config.additional_javascript_defer) %}<script type="text/javascript" src="{{ config.additional_javascript_url }}{{ javascript }}"></script>{% endfor %} {% for javascript in config.additional_javascript|merge(config.additional_javascript_defer) %}<script type="text/javascript" src="{{ config.additional_javascript_url }}{{ javascript }}?v={{ config.resource_version }}"></script>{% endfor %}
{% else %} {% else %}
{% for javascript in config.additional_javascript %}<script type="text/javascript" src="{{ config.additional_javascript_url }}{{ javascript }}"></script>{% endfor %} {% for javascript in config.additional_javascript %}<script type="text/javascript" src="{{ config.additional_javascript_url }}{{ javascript }}?v={{ config.resource_version }}"></script>{% endfor %}
{% for javascript in config.additional_javascript_defer %}<script defer type="text/javascript" src="{{ config.additional_javascript_url }}{{ javascript }}"></script>{% endfor %} {% for javascript in config.additional_javascript_defer %}<script defer type="text/javascript" src="{{ config.additional_javascript_url }}{{ javascript }}?v={{ config.resource_version }}"></script>{% endfor %}
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if mod %} {% if mod %}

View file

@ -1,12 +1,12 @@
<script src='main.js?v={{ config.resource_version }}'></script> <script src='main.js?v={{ config.resource_version }}'></script>
<script src='js/jquery.min.js'></script> <script src='js/jquery.min.js?v={{ config.resource_version }}'></script>
<script src='js/style-select.js'></script> <script src='js/style-select.js?v={{ config.resource_version }}'></script>
<script src='js/mobile-style.js'></script> <script src='js/mobile-style.js?v={{ config.resource_version }}'></script>
<script src='js/strftime.min.js'></script> <script src='js/strftime.min.js?v={{ config.resource_version }}'></script>
<script src='js/longtable/longtable.js'></script> <script src='js/longtable/longtable.js?v={{ config.resource_version }}'></script>
<script src='js/mod/ban-list.js'></script> <script src='js/mod/ban-list.js?v={{ config.resource_version }}'></script>
<link rel='stylesheet' href='stylesheets/longtable/longtable.css'> <link rel='stylesheet' href='stylesheets/longtable/longtable.css?v={{ config.resource_version }}'>
<link rel='stylesheet' href='stylesheets/mod/ban-list.css'> <link rel='stylesheet' href='stylesheets/mod/ban-list.css?v={{ config.resource_version }}'>
<form action="?/bans" method="post" class="banform"> <form action="?/bans" method="post" class="banform">
{% if token %} {% if token %}
@ -33,7 +33,7 @@
</table> </table>
</form> </form>
{% if token_json %} {% if token_json %}
<script>$(function(){ banlist_init("{{ token_json }}", {{ boards }}); });</script> <script>$(function(){ banlist_init("{{ token_json }}", {{ boards }}); });</script>

View file

@ -1 +1 @@
<link rel="stylesheet" media="screen" href="{{ config.uri_stylesheets }}mod/mod.css" /> <link rel="stylesheet" media="screen" href="{{ config.uri_stylesheets }}mod/mod.css?v={{ config.resource_version }}" />

View file

@ -1,4 +1,4 @@
<script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/jquery.min.js?v={{ config.resource_version }}"></script>
<div style="text-align:center"> <div style="text-align:center">
<p class="unimportant"> <p class="unimportant">
{% if board %} {% if board %}
@ -27,7 +27,7 @@
<table> <table>
<tr><th>{% trans %}URL{% endtrans %}</th><th>{% trans %}Title{% endtrans %}</th></tr> <tr><th>{% trans %}URL{% endtrans %}</th><th>{% trans %}Title{% endtrans %}</th></tr>
<tr><td><input type="text" name="page"></td><td><input type="text" name="title"></td> <tr><td><input type="text" name="page"></td><td><input type="text" name="title"></td>
</table> </table>
<input type="submit" value="{% trans %}Create{% endtrans %}"> <input type="submit" value="{% trans %}Create{% endtrans %}">
</form> </form>

View file

@ -1,5 +1,5 @@
<script src="{{ config.additional_javascript_url }}js/mod/recent_posts.js"></script> <script src="{{ config.additional_javascript_url }}js/mod/recent_posts.js?v={{ config.resource_version }}"></script>
<script src="{{ config.additional_javascript_url }}js/mod/recent-posts-auto-reload.js"></script> <script src="{{ config.additional_javascript_url }}js/mod/recent-posts-auto-reload.js?v={{ config.resource_version }}"></script>
{% if not posts %} {% if not posts %}
<p style="text-align:center" class="unimportant">({% trans 'There are no active posts.' %})</p> <p style="text-align:center" class="unimportant">({% trans 'There are no active posts.' %})</p>
{% else %} {% else %}

View file

@ -2,7 +2,7 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<link rel="stylesheet" media="screen" href="/stylesheets/style.css"> <link rel="stylesheet" media="screen" href="/stylesheets/style.css?v={{ config.resource_version }}">
<meta charset="utf-8"> <meta charset="utf-8">
{% if config.meta_keywords %}<meta name="keywords" content="{{ config.meta_keywords }}">{% endif %} {% if config.meta_keywords %}<meta name="keywords" content="{{ config.meta_keywords }}">{% endif %}
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes"> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes">
@ -40,12 +40,12 @@
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</div> </div>
<hr/> <hr/>
<footer> <footer>
<p class="unimportant" style="margin-top:20px;text-align:center;">- Tinyboard + <p class="unimportant" style="margin-top:20px;text-align:center;">- Tinyboard +
<a href="https://engine.vichan.net/">vichan</a> {{ config.version }} - <a href="https://engine.vichan.net/">vichan</a> {{ config.version }} -
<br>Tinyboard Copyright &copy; 2010-2014 Tinyboard Development Group <br>Tinyboard Copyright &copy; 2010-2014 Tinyboard Development Group
<br><a href="https://engine.vichan.net/">vichan</a> Copyright &copy; 2012-2016 vichan-devel</p> <br><a href="https://engine.vichan.net/">vichan</a> Copyright &copy; 2012-2016 vichan-devel</p>
</footer> </footer>
<div class="pages"></div> <div class="pages"></div>

View file

@ -11,8 +11,8 @@
</script> </script>
<title>{{ settings.title }}</title> <title>{{ settings.title }}</title>
{% include 'header.html' %} {% include 'header.html' %}
<script src='/js/moment.min.js'></script> <script src='/js/moment.min.js?v={{ config.resource_version }}'></script>
<script src='/js/fullcalendar.min.js'></script> <script src='/js/fullcalendar.min.js?v={{ config.resource_version }}'></script>
</head> </head>
<body class="8chan vichan {% if mod %}is-moderator{% else %}is-not-moderator{% endif %}" data-stylesheet="{% if config.default_stylesheet.1 != '' %}{{ config.default_stylesheet.1 }}{% else %}default{% endif %}"> <body class="8chan vichan {% if mod %}is-moderator{% else %}is-not-moderator{% endif %}" data-stylesheet="{% if config.default_stylesheet.1 != '' %}{{ config.default_stylesheet.1 }}{% else %}default{% endif %}">
<div class="bar top"> <div class="bar top">
@ -25,11 +25,11 @@
<div class="ban"> <div class="ban">
<div id='calendar'></div> <div id='calendar'></div>
</div> </div>
<hr/> <hr/>
<footer> <footer>
<p class="unimportant" style="margin-top:20px;text-align:center;">- <a href="https://github.com/savetheinternet/Tinyboard">Tinyboard</a> + <p class="unimportant" style="margin-top:20px;text-align:center;">- <a href="https://github.com/savetheinternet/Tinyboard">Tinyboard</a> +
<a href='https://github.com/vichan-devel/vichan'>vichan</a> + <a href='https://github.com/vichan-devel/vichan'>vichan</a> +
<a href='https://github.com/lainchan/lainchan'>lainchan</a> {{ config.version }} - <a href='https://github.com/lainchan/lainchan'>lainchan</a> {{ config.version }} -
<br><a href="https://github.com/savetheinternet/Tinyboard">Tinyboard</a> Copyright &copy; 2010-2014 Tinyboard Development Group <br><a href="https://github.com/savetheinternet/Tinyboard">Tinyboard</a> Copyright &copy; 2010-2014 Tinyboard Development Group
<br><a href="https://github.com/vichan-devel/vichan">vichan</a> Copyright &copy; 2012-2016 vichan-devel <br><a href="https://github.com/vichan-devel/vichan">vichan</a> Copyright &copy; 2012-2016 vichan-devel
@ -56,7 +56,7 @@
event.allDay = false; event.allDay = false;
} }
element.find('.fc-title').append("<br/>" + event.description); element.find('.fc-title').append("<br/>" + event.description);
element.css('background-color',event.color); element.css('background-color',event.color);
}, },
selectable: true, selectable: true,
selectHelper: true, selectHelper: true,
@ -102,7 +102,7 @@
url: url, url: url,
color:color, color:color,
}, },
true true
); );
} }
calendar.fullCalendar('unselect'); calendar.fullCalendar('unselect');
@ -138,7 +138,7 @@
}); });
}, },
eventClick: function(event) { eventClick: function(event) {
var decision = confirm("Do you really want to do that?"); var decision = confirm("Do you really want to do that?");
if (decision) { if (decision) {
$.ajax({ $.ajax({
type: "POST", type: "POST",

View file

@ -19,8 +19,8 @@
<h1>{{ settings.title }}</h1> <h1>{{ settings.title }}</h1>
<img src="{{ config.logo }}" alt="logo" class="home-logo"> <img src="{{ config.logo }}" alt="logo" class="home-logo">
<div class="subtitle">{{ settings.subtitle }}</div> <div class="subtitle">{{ settings.subtitle }}</div>
<link rel="stylesheet" media="screen" href="{{ config.url_stylesheet }}"> <link rel="stylesheet" media="screen" href="{{ config.url_stylesheet }}?v={{ config.resource_version }}">
<link rel="stylesheet" media="screen" href="/stylesheets/dark_red.css"> <link rel="stylesheet" media="screen" href="/stylesheets/dark_red.css?v={{ config.resource_version }}">
<p class="home-description" >{{ description }}</p> <p class="home-description" >{{ description }}</p>
</header> </header>
</div> </div>

View file

@ -2,7 +2,7 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<link rel="stylesheet" media="screen" href="/stylesheets/style.css"> <link rel="stylesheet" media="screen" href="/stylesheets/style.css?v={{ config.resource_version }}">
<meta charset="utf-8"> <meta charset="utf-8">
<title>{{ settings.title }}</title> <title>{{ settings.title }}</title>
{% if config.meta_keywords %}<meta name="keywords" content="{{ config.meta_keywords }}">{% endif %} {% if config.meta_keywords %}<meta name="keywords" content="{{ config.meta_keywords }}">{% endif %}

View file

@ -53,7 +53,7 @@
{ {
error('thread_limit must be an integer above 1.', true); error('thread_limit must be an integer above 1.', true);
} }
if (!is_array($overboard['exclude'])) if (!is_array($overboard['exclude']))
{ {
error('Exclude list must be array of strings.', true); error('Exclude list must be array of strings.', true);
} }
@ -62,7 +62,7 @@
error('Exclude list must be array of strings.', true); error('Exclude list must be array of strings.', true);
} }
} }
} }
return $settings; return $settings;
@ -199,7 +199,7 @@
} }
$html .= '<script>var ukko_overflow = ' . json_encode($overflow) . '</script>'; $html .= '<script>var ukko_overflow = ' . json_encode($overflow) . '</script>';
$html .= '<script type="text/javascript" src="/'.$overboard['uri'].'/overboard.js"></script>'; $html .= '<script type="text/javascript" src="/'.$overboard['uri'].'/overboard.js?=' . $config['resource_version'] . '"></script>';
return Element('index.html', array( return Element('index.html', array(
'config' => $config, 'config' => $config,

View file

@ -5,12 +5,12 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>{{ settings.title }}</title> <title>{{ settings.title }}</title>
<link rel="stylesheet" media="screen" href="{{ config.root}}stylesheets/style.css"/> <link rel="stylesheet" media="screen" href="{{ config.root}}stylesheets/style.css?v={{ config.resource_version }}"/>
<link rel="stylesheet" media="screen" href="{{ config.root}}stylesheets/recent.css"/> <link rel="stylesheet" media="screen" href="{{ config.root}}stylesheets/recent.css?v={{ config.resource_version }}"/>
<link rel="stylesheet" media="screen" href="https://lainchan.org/stylesheets/font-awesome/css/font-awesome.min.css"/> <link rel="stylesheet" media="screen" href="https://lainchan.org/stylesheets/font-awesome/css/font-awesome.min.css?v={{ config.resource_version }}"/>
{% if config.url_favicon %}<link rel="shortcut icon" href="{{ config.url_favicon }}" />{% endif %} {% if config.url_favicon %}<link rel="shortcut icon" href="{{ config.url_favicon }}" />{% endif %}
{% if config.font_awesome %}<link rel="stylesheet" href="{{ config.root }}{{ config.font_awesome_css }}">{% endif %} {% if config.font_awesome %}<link rel="stylesheet" href="{{ config.root }}{{ config.font_awesome_css }}?v={{ config.resource_version }}">{% endif %}
{% include 'header.html' %} {% include 'header.html' %}
</head> </head>
<body> <body>
@ -31,10 +31,10 @@
<br> <br>
<div class="ban" id="global2"> <h2>CYBERPUNK IS DUCK</h2> Pour out the Soykaf, lurk, and read the <a href="https://lainchan.org/rules">rules</a> before posting! </div> <div class="ban" id="global2"> <h2>CYBERPUNK IS DUCK</h2> Pour out the Soykaf, lurk, and read the <a href="https://lainchan.org/rules">rules</a> before posting! </div>
<center> <img alt="mascot" class="lain_banner" src="static/duck.png"></center> <center> <img alt="mascot" class="lain_banner" src="static/duck.png"></center>
<br> <br>
<div class="ban" id="global3"> <div class="ban" id="global3">
<h2>Latest News</h2> <h2>Latest News</h2>
{% if not recent_news %} {% if not recent_news %}
<p style="text-align:center" class="unimportant">(No news to show.)</p> <p style="text-align:center" class="unimportant">(No news to show.)</p>
@ -70,7 +70,7 @@
<ul> <ul>
{% for post in recent_posts %} {% for post in recent_posts %}
<li> <li>
<strong>{{ post.board_name }}</strong>: <strong>{{ post.board_name }}</strong>:
<a href="{{ post.link }}"> <a href="{{ post.link }}">
{{ post.snippet }} {{ post.snippet }}
</a> </a>