From db55a3040ff13cdbfa25c47268fb24749ca21069 Mon Sep 17 00:00:00 2001 From: 8chan Date: Mon, 6 Oct 2014 18:36:19 -0700 Subject: [PATCH] Make inline.js work in mod panel --- inc/instance-config.php | 1 + js/inline.js | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/inc/instance-config.php b/inc/instance-config.php index cd9ff574..a1b04d0a 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -128,6 +128,7 @@ $config['additional_javascript'][] = 'js/id_highlighter.js'; $config['additional_javascript'][] = 'js/id_colors.js'; $config['additional_javascript'][] = 'js/threadscroll.js'; + $config['additional_javascript'][] = 'js/inline.js'; $config['font_awesome_css'] = '/netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css'; diff --git a/js/inline.js b/js/inline.js index 1ce0edc3..a267b4cd 100644 --- a/js/inline.js +++ b/js/inline.js @@ -1,4 +1,4 @@ -;(function() { +onready(function() { var App = { cache: {}, get: function(url, cb) { @@ -60,7 +60,9 @@ targetOP = srcOP } else { node = $(this) - targetOP = this.pathname.match(/(\d+).html/)[1] + + var to_search = inMod ? this.search : this.pathname; + targetOP = to_search.match(/(\d+).html/)[1] } var link = { @@ -136,4 +138,4 @@ $('.body a:not([rel]), .mentioned a') .attr('onclick', null)// XXX disable highlightReply .click(inline) -})() +})