1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-23 23:20:57 +01:00

{% (end)?raw %}{% (end)?verbatim %}

```
rg '\{%\s*raw' -l | xargs -I{} sed -i -e 's/{%\(\s*\)raw/{%\1verbatim/g; s/endraw\(\s*\)%}/endverbatim\1%}/g' {}
```

Close vichan-devel/vichan#452.
This commit is contained in:
Fredrick Brennan 2021-11-03 22:45:01 -04:00
parent 4fd93f490f
commit f1b43e5fb2
7 changed files with 41 additions and 41 deletions

View File

@ -42,8 +42,8 @@
<br><a href="https://engine.vichan.net/">vichan</a> Copyright &copy; 2012-2018 vichan-devel</p> <br><a href="https://engine.vichan.net/">vichan</a> Copyright &copy; 2012-2018 vichan-devel</p>
{% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %} {% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %}
</footer> </footer>
<script type="text/javascript">{% raw %} <script type="text/javascript">{% verbatim %}
ready(); ready();
{% endraw %}</script> {% endverbatim %}</script>
</body> </body>
</html> </html>

View File

@ -18,7 +18,7 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if config.recaptcha %}<script src="//www.google.com/recaptcha/api.js"></script> {% if config.recaptcha %}<script src="//www.google.com/recaptcha/api.js"></script>
<style type="text/css">{% raw %} <style type="text/css">{% verbatim %}
#recaptcha_area { #recaptcha_area {
float: none !important; float: none !important;
padding: 0 !important; padding: 0 !important;
@ -46,4 +46,4 @@
.recaptchatable, #recaptcha_area tr, #recaptcha_area td, #recaptcha_area th { .recaptchatable, #recaptcha_area tr, #recaptcha_area td, #recaptcha_area th {
padding: 0 !important; padding: 0 !important;
} }
{% endraw %}</style>{% endif %} {% endverbatim %}</style>{% endif %}

View File

@ -96,9 +96,9 @@
{% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %} {% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %}
</footer> </footer>
<script type="text/javascript">{% raw %} <script type="text/javascript">{% verbatim %}
ready(); ready();
{% endraw %}</script> {% endverbatim %}</script>
</body> </body>
</html> </html>

View File

@ -1,4 +1,4 @@
{% raw %} {% verbatim %}
/* gettext-compatible _ function, example of usage: /* gettext-compatible _ function, example of usage:
* *
@ -109,11 +109,11 @@ function alert(a, do_confirm, confirm_ok_action, confirm_cancel_action) {
var saved = {}; var saved = {};
var selectedstyle = '{% endraw %}{{ config.default_stylesheet.0|addslashes }}{% raw %}'; var selectedstyle = '{% endverbatim %}{{ config.default_stylesheet.0|addslashes }}{% verbatim %}';
var styles = { var styles = {
{% endraw %} {% endverbatim %}
{% for stylesheet in stylesheets %}{% raw %}'{% endraw %}{{ stylesheet.name|addslashes }}{% raw %}' : '{% endraw %}{{ stylesheet.uri|addslashes }}{% raw %}', {% for stylesheet in stylesheets %}{% verbatim %}'{% endverbatim %}{{ stylesheet.name|addslashes }}{% verbatim %}' : '{% endverbatim %}{{ stylesheet.uri|addslashes }}{% verbatim %}',
{% endraw %}{% endfor %}{% raw %} {% endverbatim %}{% endfor %}{% verbatim %}
}; };
if (typeof board_name === 'undefined') { if (typeof board_name === 'undefined') {
@ -121,16 +121,16 @@ if (typeof board_name === 'undefined') {
} }
function changeStyle(styleName, link) { function changeStyle(styleName, link) {
{% endraw %} {% endverbatim %}
{% if config.stylesheets_board %}{% raw %} {% if config.stylesheets_board %}{% verbatim %}
if (board_name) { if (board_name) {
stylesheet_choices[board_name] = styleName; stylesheet_choices[board_name] = styleName;
localStorage.board_stylesheets = JSON.stringify(stylesheet_choices); localStorage.board_stylesheets = JSON.stringify(stylesheet_choices);
} }
{% endraw %}{% else %} {% endverbatim %}{% else %}
localStorage.stylesheet = styleName; localStorage.stylesheet = styleName;
{% endif %} {% endif %}
{% raw %} {% verbatim %}
if (!document.getElementById('stylesheet')) { if (!document.getElementById('stylesheet')) {
var s = document.createElement('link'); var s = document.createElement('link');
@ -160,9 +160,9 @@ function changeStyle(styleName, link) {
} }
{% endraw %} {% endverbatim %}
{% if config.stylesheets_board %} {% if config.stylesheets_board %}
{% raw %} {% verbatim %}
if (!localStorage.board_stylesheets) { if (!localStorage.board_stylesheets) {
localStorage.board_stylesheets = '{}'; localStorage.board_stylesheets = '{}';
@ -177,9 +177,9 @@ function changeStyle(styleName, link) {
} }
} }
} }
{% endraw%} {% endverbatim%}
{% else %} {% else %}
{% raw %} {% verbatim %}
if (localStorage.stylesheet) { if (localStorage.stylesheet) {
for (var styleName in styles) { for (var styleName in styles) {
if (styleName == localStorage.stylesheet) { if (styleName == localStorage.stylesheet) {
@ -188,9 +188,9 @@ function changeStyle(styleName, link) {
} }
} }
} }
{% endraw %} {% endverbatim %}
{% endif %} {% endif %}
{% raw %} {% verbatim %}
function init_stylechooser() { function init_stylechooser() {
var newElement = document.createElement('div'); var newElement = document.createElement('div');
@ -243,7 +243,7 @@ function highlightReply(id) {
function generatePassword() { function generatePassword() {
var pass = ''; var pass = '';
var chars = '{% endraw %}{{ config.genpassword_chars }}{% raw %}'; var chars = '{% endverbatim %}{{ config.genpassword_chars }}{% verbatim %}';
for (var i = 0; i < 8; i++) { for (var i = 0; i < 8; i++) {
var rnd = Math.floor(Math.random() * chars.length); var rnd = Math.floor(Math.random() * chars.length);
pass += chars.substring(rnd, rnd + 1); pass += chars.substring(rnd, rnd + 1);
@ -323,15 +323,15 @@ function rememberStuff() {
if (sessionStorage.body) { if (sessionStorage.body) {
var saved = JSON.parse(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 // 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) { for (var url in successful) {
saved[url] = null; saved[url] = null;
} }
sessionStorage.body = JSON.stringify(saved); 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]) { if (saved[document.location]) {
document.forms.post.body.value = saved[document.location]; document.forms.post.body.value = saved[document.location];
@ -359,13 +359,13 @@ var script_settings = function(script_name) {
function init() { function init() {
init_stylechooser(); init_stylechooser();
{% endraw %} {% endverbatim %}
{% if config.allow_delete %} {% if config.allow_delete %}
if (document.forms.postcontrols) { if (document.forms.postcontrols) {
document.forms.postcontrols.password.value = localStorage.password; document.forms.postcontrols.password.value = localStorage.password;
} }
{% endif %} {% endif %}
{% raw %} {% verbatim %}
if (window.location.hash.indexOf('q') != 1 && window.location.hash.substring(1)) if (window.location.hash.indexOf('q') != 1 && window.location.hash.substring(1))
highlightReply(window.location.hash.substring(1)); highlightReply(window.location.hash.substring(1));
@ -386,16 +386,16 @@ function ready() {
} }
} }
{% endraw %} {% endverbatim %}
var post_date = "{{ config.post_date }}"; var post_date = "{{ config.post_date }}";
var max_images = {{ config.max_images }}; var max_images = {{ config.max_images }};
onready(init); 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 %} {% if config.statcounter_project and config.statcounter_security %}
var sc = document.createElement('script'); var sc = document.createElement('script');

View File

@ -191,6 +191,6 @@
<input type="hidden" name="hash" value="{{ antibot.hash() }}"> <input type="hidden" name="hash" value="{{ antibot.hash() }}">
</form> </form>
<script type="text/javascript">{% raw %} <script type="text/javascript">{% verbatim %}
rememberStuff(); rememberStuff();
{% endraw %}</script> {% endverbatim %}</script>

View File

@ -78,17 +78,17 @@
<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-2018 vichan-devel</p> <br><a href="https://engine.vichan.net/">vichan</a> Copyright &copy; 2012-2018 vichan-devel</p>
</footer> </footer>
<script type="text/javascript">{% raw %} <script type="text/javascript">{% verbatim %}
var styles = { var styles = {
{% endraw %} {% endverbatim %}
{% for name, uri in config.stylesheets %}{% raw %}'{% endraw %}{{ name|addslashes }}{% raw %}' : '{% endraw %}/stylesheets/{{ uri|addslashes }}{% raw %}', {% for name, uri in config.stylesheets %}{% verbatim %}'{% endverbatim %}{{ name|addslashes }}{% verbatim %}' : '{% endverbatim %}/stylesheets/{{ uri|addslashes }}{% verbatim %}',
{% endraw %}{% endfor %}{% raw %} {% endverbatim %}{% endfor %}{% verbatim %}
}; onready(init); }; onready(init);
{% endraw %}</script> {% endverbatim %}</script>
<script type="text/javascript">{% raw %} <script type="text/javascript">{% verbatim %}
ready(); ready();
{% endraw %}</script> {% endverbatim %}</script>
</body> </body>
</html> </html>
{% endfilter %} {% endfilter %}

View File

@ -89,8 +89,8 @@
<br><a href="https://engine.vichan.net/">vichan</a> Copyright &copy; 2012-2018 vichan-devel</p> <br><a href="https://engine.vichan.net/">vichan</a> Copyright &copy; 2012-2018 vichan-devel</p>
{% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %} {% for footer in config.footer %}<p class="unimportant" style="text-align:center;">{{ footer }}</p>{% endfor %}
</footer> </footer>
<script type="text/javascript">{% raw %} <script type="text/javascript">{% verbatim %}
ready(); ready();
{% endraw %}</script> {% endverbatim %}</script>
</body> </body>
</html> </html>