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/index.php b/index.php index 5031df82..12fec902 100644 --- a/index.php +++ b/index.php @@ -1,7 +1,11 @@ fetchAll(PDO::FETCH_ASSOC); +if ($query) { + $newsplus = $query->fetchAll(PDO::FETCH_ASSOC); +} else { + $newsplus = false; +} $index = Element("8chan/index.html", array("config" => $config, "newsplus" => $newsplus)); file_write('index.html', $index); diff --git a/js/options/user-js.js b/js/options/user-js.js index 4d792979..cc48d852 100644 --- a/js/options/user-js.js +++ b/js/options/user-js.js @@ -13,8 +13,10 @@ var tab = Options.add_tab("user-js", "code", _("User JS")); +$("

"+_("Do not paste code here unless you absolutely trust the source or have read it yourself!")+"

"+_("Untrusted code pasted here could do malicious things such as spam the site under your IP.")+"").appendTo(tab.content); + var textarea = $("").css({ - "height" : "85%", + "height" : "74%", "width" : "100%", "font-size" : "9pt", "font-family": "monospace", @@ -47,8 +49,7 @@ var apply_js = function() { var update_textarea = function() { if (!localStorage.user_js) { - textarea.text("/* "+_("Enter here your own Javascript code...")+" */\n" + - "/* "+_("Have a backup of your storage somewhere, as messing here\nmay render you this website unusable.")+" */\n" + + textarea.text("/* "+_("Enter your own Javascript code here...")+" */\n" + "/* "+_("You can include JS files from remote servers, for example:")+" */\n" + '/* load_js("http://example.com/script.js"); */'); } diff --git a/js/quick-reply.js b/js/quick-reply.js index 70eba7c0..1ed2e505 100644 --- a/js/quick-reply.js +++ b/js/quick-reply.js @@ -28,16 +28,6 @@ dummy_reply.remove(); $('').appendTo($('head')); }; @@ -128,7 +48,7 @@ do_css(); - var $postForm = $('form[name="post"]').clone(); + var $postForm = $('#post-form-outer').clone(); $postForm.clone(); @@ -243,34 +163,6 @@ $(this).remove(); } - // Remove oekaki if existent - if ($(this).is('#oekaki')) { - $(this).remove(); - } - - // Remove upload selection - if ($td.is('#upload_selection')) { - $(this).remove(); - } - - // Remove mod controls, because it looks shit. - /*if ($td.find('input[type="checkbox"]').length) { - var tr = this; - $td.find('input[type="checkbox"]').each(function() { - if ($(this).attr('name') == 'spoiler') { - $td.find('label').remove(); - $(this).attr('id', 'q-spoiler-image'); - $postForm.find('input[type="file"]').parent() - .removeAttr('colspan') - .after($('').append(this, ' ', $('