mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-19 01:31:34 +00:00
Updated render.js
Version string for random renders will now use globals.v4 (new variable) instead of globals.v1, since globals.v1 changes a lot more often. Hence to allow this to happen, data-version attribute will now be added to <script> tag of render.js in home.njk.
This commit is contained in:
parent
a71b06df2b
commit
907ba3960a
@ -60,10 +60,9 @@ page.doRenderSwal = function () {
|
||||
|
||||
page.getRenderVersion = function () {
|
||||
const renderScript = document.getElementById('renderScript')
|
||||
if (!renderScript) return ''
|
||||
const match = renderScript.src.match(/\?v=\w*$/)
|
||||
if (!match) return ''
|
||||
return match[0]
|
||||
if (renderScript && renderScript.dataset.version)
|
||||
return `?v=${renderScript.dataset.version}`
|
||||
return ''
|
||||
}
|
||||
|
||||
page.doRender = function () {
|
||||
|
@ -14,10 +14,12 @@
|
||||
v1: CSS and JS files (lolisafe).
|
||||
v2: Images and config files (manifest.json, browserconfig.xml, etc).
|
||||
v3: CSS and JS files (libs such as bulma, lazyload, etc).
|
||||
v4: Renders in /public/render/* directories (to be used by render.js).
|
||||
#}
|
||||
{% set v1 = "kz2IMxLx9c" %}
|
||||
{% set v1 = "dLp5zKKIkN" %}
|
||||
{% set v2 = "hiboQUzAzp" %}
|
||||
{% set v3 = "hiboQUzAzp" %}
|
||||
{% set v4 = "dLp5zKKIkN" %}
|
||||
|
||||
{#
|
||||
These will be the links in the homepage and the No-JS uploader.
|
||||
|
@ -23,8 +23,8 @@
|
||||
<script src="libs/lazyload/lazyload.min.js?v={{ globals.v3 }}"></script>
|
||||
<script src="js/home.js?v={{ globals.v1 }}"></script>
|
||||
<script src="js/sharex.js?v={{ globals.v1 }}"></script>
|
||||
<!-- We assign an ID for this so that the script can find out its own version string -->
|
||||
<script id="renderScript" src="js/render.js?v={{ globals.v1 }}"></script>
|
||||
<!-- We assign an ID for this so that the script can find out version string for render images -->
|
||||
<script id="renderScript" data-version="{{ globals.v4 }}" src="js/render.js?v={{ globals.v1 }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
Loading…
Reference in New Issue
Block a user