Updated Twitch moderation template to use JSON formatting for lastLogTimestamp, shoutboxCurrentUser, and _streamStartedAt variables, enhancing data handling and security in JavaScript context.
This commit is contained in:
@@ -899,7 +899,7 @@ var lastLogTimestamp = '';
|
|||||||
if (id) knownLogIds.add(id);
|
if (id) knownLogIds.add(id);
|
||||||
});
|
});
|
||||||
{% if logs and logs|length > 0 %}
|
{% if logs and logs|length > 0 %}
|
||||||
lastLogTimestamp = '{{ logs[0].created_at.isoformat() }}';
|
lastLogTimestamp = {{ logs[0].created_at.isoformat() | tojson }};
|
||||||
{% endif %}
|
{% endif %}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1028,7 +1028,7 @@ document.addEventListener('keydown', function(e) {
|
|||||||
// =============================
|
// =============================
|
||||||
// Shoutbox modérateurs (IRC)
|
// Shoutbox modérateurs (IRC)
|
||||||
// =============================
|
// =============================
|
||||||
var shoutboxCurrentUser = '{{ current_user.username }}';
|
var shoutboxCurrentUser = {{ current_user.username | tojson }};
|
||||||
var shoutboxKnownIds = new Set();
|
var shoutboxKnownIds = new Set();
|
||||||
var shoutboxLastTimestamp = '';
|
var shoutboxLastTimestamp = '';
|
||||||
var shoutboxAutoScroll = true;
|
var shoutboxAutoScroll = true;
|
||||||
@@ -1334,7 +1334,7 @@ document.addEventListener('keydown', function(e) {
|
|||||||
// =============================
|
// =============================
|
||||||
// Polling infos stream dynamique
|
// Polling infos stream dynamique
|
||||||
// =============================
|
// =============================
|
||||||
var _streamStartedAt = {{ "'" ~ started_at ~ "'" if started_at else 'null' }};
|
var _streamStartedAt = {{ started_at | tojson }};
|
||||||
var _uptimeInterval = null;
|
var _uptimeInterval = null;
|
||||||
|
|
||||||
function updateUptime() {
|
function updateUptime() {
|
||||||
|
|||||||
Reference in New Issue
Block a user