summaryrefslogtreecommitdiff
path: root/templates/main.js
diff options
context:
space:
mode:
authorAppleman1234 <applemansigloo@gmail.com>2022-09-25 13:22:40 +1000
committerAppleman1234 <applemansigloo@gmail.com>2022-09-25 13:22:40 +1000
commit92561d7f36508b7e0271926e417adf0e2e53916b (patch)
treea8588b4f70af276c5acf58836e33b1f6ff5c61e8 /templates/main.js
parent6f1083e4b51fc9c4c594f6c72cf3d84ef4d0298b (diff)
Initial attempt a switch to composer and PHP-8.1 compatibility
Diffstat (limited to 'templates/main.js')
-rwxr-xr-xtemplates/main.js54
1 files changed, 27 insertions, 27 deletions
diff --git a/templates/main.js b/templates/main.js
index af665987..b4511d8b 100755
--- a/templates/main.js
+++ b/templates/main.js
@@ -1,4 +1,4 @@
-{% raw %}
+{% verbatim %}
/* gettext-compatible _ function, example of usage:
*
@@ -109,16 +109,16 @@ function alert(a, do_confirm, confirm_ok_action, confirm_cancel_action) {
var saved = {};
-var selectedstyle = '{% endraw %}{{ config.default_stylesheet.0|addslashes }}{% raw %}';
+var selectedstyle = '{% endverbatim %}{{ config.default_stylesheet.0|addslashes }}{% verbatim %}';
var styles = {
- {% endraw %}
- {% for stylesheet in stylesheets %}{% raw %}'{% endraw %}{{ stylesheet.name|addslashes }}{% raw %}' : '{% endraw %}{{ stylesheet.uri|addslashes }}{% raw %}',
- {% endraw %}{% endfor %}{% raw %}
+ {% endverbatim %}
+ {% for stylesheet in stylesheets %}{% verbatim %}'{% endverbatim %}{{ stylesheet.name|addslashes }}{% verbatim %}' : '{% endverbatim %}{{ stylesheet.uri|addslashes }}{% verbatim %}',
+ {% endverbatim %}{% endfor %}{% verbatim %}
};
var codestyles = {
- {% endraw %}
- {% for stylesheet in code_stylesheets %}{% raw %}'{% endraw %}{{ stylesheet.name|addslashes }}{% raw %}' : '{% endraw %}{{ stylesheet.uri|addslashes }}{% raw %}',
- {% endraw %}{% endfor %}{% raw %}
+ {% endverbatim %}
+ {% for stylesheet in code_stylesheets %}{% verbatim %}'{% endverbatim %}{{ stylesheet.name|addslashes }}{% verbatim %}' : '{% endverbatim %}{{ stylesheet.uri|addslashes }}{% verbatim %}',
+ {% endverbatim %}{% endfor %}{% verbatim %}
};
if (typeof board_name === 'undefined') {
@@ -126,16 +126,16 @@ if (typeof board_name === 'undefined') {
}
function changeStyle(styleName, link) {
- {% endraw %}
- {% if config.stylesheets_board %}{% raw %}
+ {% endverbatim %}
+ {% if config.stylesheets_board %}{% verbatim %}
if (board_name) {
stylesheet_choices[board_name] = styleName;
localStorage.board_stylesheets = JSON.stringify(stylesheet_choices);
}
- {% endraw %}{% else %}
+ {% endverbatim %}{% else %}
localStorage.stylesheet = styleName;
{% endif %}
- {% raw %}
+ {% verbatim %}
// Main stylesheet
if (!document.getElementById('stylesheet')) {
@@ -178,9 +178,9 @@ function changeStyle(styleName, link) {
}
-{% endraw %}
+{% endverbatim %}
{% if config.stylesheets_board %}
- {% raw %}
+ {% verbatim %}
if (!localStorage.board_stylesheets) {
localStorage.board_stylesheets = '{}';
@@ -195,9 +195,9 @@ function changeStyle(styleName, link) {
}
}
}
- {% endraw%}
+ {% endverbatim%}
{% else %}
- {% raw %}
+ {% verbatim %}
if (localStorage.stylesheet) {
for (var styleName in styles) {
if (styleName == localStorage.stylesheet) {
@@ -206,9 +206,9 @@ function changeStyle(styleName, link) {
}
}
}
- {% endraw %}
+ {% endverbatim %}
{% endif %}
-{% raw %}
+{% verbatim %}
function init_stylechooser() {
var newElement = document.createElement('div');
@@ -261,7 +261,7 @@ function highlightReply(id) {
function generatePassword() {
var pass = '';
- var chars = '{% endraw %}{{ config.genpassword_chars }}{% raw %}';
+ var chars = '{% endverbatim %}{{ config.genpassword_chars }}{% verbatim %}';
for (var i = 0; i < 8; i++) {
var rnd = Math.floor(Math.random() * chars.length);
pass += chars.substring(rnd, rnd + 1);
@@ -341,15 +341,15 @@ function rememberStuff() {
if (sessionStorage.body) {
var saved = JSON.parse(sessionStorage.body);
- if (get_cookie('{% endraw %}{{ config.cookies.js }}{% raw %}')) {
+ if (get_cookie('{% endverbatim %}{{ config.cookies.js }}{% verbatim %}')) {
// Remove successful posts
- var successful = JSON.parse(get_cookie('{% endraw %}{{ config.cookies.js }}{% raw %}'));
+ var successful = JSON.parse(get_cookie('{% endverbatim %}{{ config.cookies.js }}{% verbatim %}'));
for (var url in successful) {
saved[url] = null;
}
sessionStorage.body = JSON.stringify(saved);
- document.cookie = '{% endraw %}{{ config.cookies.js }}{% raw %}={};expires=0;path=/;';
+ document.cookie = '{% endverbatim %}{{ config.cookies.js }}{% verbatim %}={};expires=0;path=/;';
}
if (saved[document.location]) {
document.forms.post.body.value = saved[document.location];
@@ -377,13 +377,13 @@ var script_settings = function(script_name) {
function init() {
init_stylechooser();
- {% endraw %}
+ {% endverbatim %}
{% if config.allow_delete %}
if (document.forms.postcontrols) {
document.forms.postcontrols.password.value = localStorage.password;
}
{% endif %}
- {% raw %}
+ {% verbatim %}
if (window.location.hash.indexOf('q') != 1 && window.location.hash.substring(1))
highlightReply(window.location.hash.substring(1));
@@ -404,16 +404,16 @@ function ready() {
}
}
-{% endraw %}
+{% endverbatim %}
var post_date = "{{ config.post_date }}";
var max_images = {{ config.max_images }};
onready(init);
-{% if config.google_analytics %}{% raw %}
+{% if config.google_analytics %}{% verbatim %}
-var _gaq = _gaq || [];_gaq.push(['_setAccount', '{% endraw %}{{ config.google_analytics }}{% raw %}']);{% endraw %}{% if config.google_analytics_domain %}{% raw %}_gaq.push(['_setDomainName', '{% endraw %}{{ config.google_analytics_domain }}{% raw %}']){% endraw %}{% endif %}{% if not config.google_analytics_domain %}{% raw %}_gaq.push(['_setDomainName', 'none']){% endraw %}{% endif %}{% raw %};_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();{% endraw %}{% endif %}
+var _gaq = _gaq || [];_gaq.push(['_setAccount', '{% endverbatim %}{{ config.google_analytics }}{% verbatim %}']);{% endverbatim %}{% if config.google_analytics_domain %}{% verbatim %}_gaq.push(['_setDomainName', '{% endverbatim %}{{ config.google_analytics_domain }}{% verbatim %}']){% endverbatim %}{% endif %}{% if not config.google_analytics_domain %}{% verbatim %}_gaq.push(['_setDomainName', 'none']){% endverbatim %}{% endif %}{% verbatim %};_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();{% endverbatim %}{% endif %}
{% if config.statcounter_project and config.statcounter_security %}
var sc = document.createElement('script');