1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-25 16:00:22 +01:00

Make it so you can have different stylesheets per board

This commit is contained in:
8chan Admin 2013-10-25 01:42:45 +00:00
parent 6f0dc29d03
commit ef83cb2dea
4 changed files with 18 additions and 10 deletions

View File

@ -1413,16 +1413,8 @@ function buildIndex() {
function buildJavascript() { function buildJavascript() {
global $config; global $config;
$stylesheets = array();
foreach ($config['stylesheets'] as $name => $uri) {
$stylesheets[] = array(
'name' => addslashes($name),
'uri' => addslashes((!empty($uri) ? $config['uri_stylesheets'] : '') . $uri));
}
$script = Element('main.js', array( $script = Element('main.js', array(
'config' => $config, 'config' => $config,
'stylesheets' => $stylesheets
)); ));
// Check if we have translation for the javascripts; if yes, we add it to additional javascripts // Check if we have translation for the javascripts; if yes, we add it to additional javascripts

View File

@ -59,6 +59,14 @@
<p class="unimportant" style="margin-top:20px;text-align:center;">Powered by <a href="http://tinyboard.org/">Tinyboard</a> {{ config.version }} | <a href="http://tinyboard.org/">Tinyboard</a> Copyright &copy; 2010-2013 Tinyboard Development Group</p> <p class="unimportant" style="margin-top:20px;text-align:center;">Powered by <a href="http://tinyboard.org/">Tinyboard</a> {{ config.version }} | <a href="http://tinyboard.org/">Tinyboard</a> Copyright &copy; 2010-2013 Tinyboard Development Group</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 %}
var styles = {
{% endraw %}
{% for name, uri in config.stylesheets %}{% raw %}'{% endraw %}{{ name|addslashes }}{% raw %}' : '{% endraw %}/stylesheets/{{ uri|addslashes }}{% raw %}',
{% endraw %}{% endfor %}{% raw %}
};
{% endraw %}</script>
<script type="text/javascript">{% raw %} <script type="text/javascript">{% raw %}
ready(); ready();
{% endraw %}</script> {% endraw %}</script>

View File

@ -26,11 +26,11 @@ var saved = {};
var selectedstyle = '{% endraw %}{{ config.default_stylesheet.0|addslashes }}{% raw %}'; var selectedstyle = '{% endraw %}{{ config.default_stylesheet.0|addslashes }}{% raw %}';
var styles = { /*var styles = {
{% endraw %} {% endraw %}
{% for stylesheet in stylesheets %}{% raw %}'{% endraw %}{{ stylesheet.name|addslashes }}{% raw %}' : '{% endraw %}{{ stylesheet.uri|addslashes }}{% raw %}', {% for stylesheet in stylesheets %}{% raw %}'{% endraw %}{{ stylesheet.name|addslashes }}{% raw %}' : '{% endraw %}{{ stylesheet.uri|addslashes }}{% raw %}',
{% endraw %}{% endfor %}{% raw %} {% endraw %}{% endfor %}{% raw %}
}; };*/
var board_name = false; var board_name = false;
function changeStyle(styleName, link) { function changeStyle(styleName, link) {

View File

@ -42,6 +42,14 @@
<p class="unimportant" style="margin-top:20px;text-align:center;">Powered by <a href="http://tinyboard.org/">Tinyboard</a> {{ config.version }} | <a href="http://tinyboard.org/">Tinyboard</a> Copyright &copy; 2010-2013 Tinyboard Development Group</p> <p class="unimportant" style="margin-top:20px;text-align:center;">Powered by <a href="http://tinyboard.org/">Tinyboard</a> {{ config.version }} | <a href="http://tinyboard.org/">Tinyboard</a> Copyright &copy; 2010-2013 Tinyboard Development Group</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 %}
var styles = {
{% endraw %}
{% for name, uri in config.stylesheets %}{% raw %}'{% endraw %}{{ name|addslashes }}{% raw %}' : '{% endraw %}/stylesheets/{{ uri|addslashes }}{% raw %}',
{% endraw %}{% endfor %}{% raw %}
};
{% endraw %}</script>
<script type="text/javascript">{% raw %} <script type="text/javascript">{% raw %}
ready(); ready();
{% endraw %}</script> {% endraw %}</script>