From 440b0d5f82cc3107558f3980b97db5d29377ec33 Mon Sep 17 00:00:00 2001 From: Fredrick Brennan Date: Wed, 11 Mar 2015 17:58:07 +0800 Subject: [PATCH] Make oekaki a $config option, make locales load from inc/locale, one main.js file now possible again! --- inc/8chan-mod-pages.php | 19 +++---------------- inc/config.php | 3 +++ inc/functions.php | 6 ------ inc/instance-config.php | 13 +++++++++++-- templates/header.html | 3 +++ 5 files changed, 20 insertions(+), 24 deletions(-) diff --git a/inc/8chan-mod-pages.php b/inc/8chan-mod-pages.php index 03aea763..5f6958af 100644 --- a/inc/8chan-mod-pages.php +++ b/inc/8chan-mod-pages.php @@ -462,21 +462,8 @@ FLAGS; $force_subject_op = isset($_POST['force_subject_op']) ? 'true' : 'false'; $tor_posting = isset($_POST['tor_posting']) ? 'true' : 'false'; $new_thread_capt = isset($_POST['new_thread_capt']) ? 'true' : 'false'; + $oekaki = isset($_POST['oekaki']) ? 'true' : 'false'; - - -$oekaki_js = << $config, )); - // Check if we have translation for the javascripts; if yes, we add it to additional javascripts - list($pure_locale) = explode(".", $config['locale']); - if (file_exists ($jsloc = "inc/locale/$pure_locale/LC_MESSAGES/javascript.js")) { - $script = file_get_contents($jsloc) . "\n\n" . $script; - } - if ($config['additional_javascript_compile']) { foreach (array_unique($config['additional_javascript']) as $file) { $script .= file_get_contents($file); diff --git a/inc/instance-config.php b/inc/instance-config.php index ad46a030..fd7fc962 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -47,8 +47,6 @@ $config['spam']['hidden_inputs_max_pass'] = 128; $config['ayah_enabled'] = true; - // Load database credentials - require "secrets.php"; // Image shit $config['thumb_method'] = 'convert'; @@ -144,6 +142,15 @@ $config['additional_javascript'][] = 'js/image-hover.js'; $config['additional_javascript'][] = 'js/auto-scroll.js'; $config['additional_javascript'][] = 'js/twemoji/twemoji.js'; + // Oekaki (now depends on config.oekaki so can be in all scripts) + $config['additional_javascript'][] = 'js/jquery-ui.custom.min.js'; + $config['additional_javascript'][] = 'js/wPaint/lib/wColorPicker.min.js'; + $config['additional_javascript'][] = 'js/wPaint/wPaint.min.js'; + $config['additional_javascript'][] = 'js/wPaint/plugins/main/wPaint.menu.main.min.js'; + $config['additional_javascript'][] = 'js/wPaint/plugins/text/wPaint.menu.text.min.js'; + $config['additional_javascript'][] = 'js/wPaint/plugins/shapes/wPaint.menu.main.shapes.min.js'; + $config['additional_javascript'][] = 'js/wPaint/plugins/file/wPaint.menu.main.file.min.js'; + $config['additional_javascript'][] = 'js/wpaint.js'; //$config['font_awesome_css'] = '/netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css'; @@ -208,3 +215,5 @@ $config['spam']['unicode'] = false; // 8chan specific mod pages require '8chan-mod-pages.php'; +// Load database credentials +require "secrets.php"; diff --git a/templates/header.html b/templates/header.html index 05ff089b..dc6310e7 100644 --- a/templates/header.html +++ b/templates/header.html @@ -13,6 +13,9 @@ var inMod = {% if mod %}true{% else %}false{% endif %}; var modRoot="{{ config.root }}"+(inMod ? "mod.php?/" : ""); + {% if config.locale != "en" %} + + {% endif %} {% if not nojavascript %} {% if not config.additional_javascript_compile %}