From 84cf869181cc9cfbffb20f71a360a0bd943baace Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 21 Feb 2012 02:32:41 +0100 Subject: [PATCH] Fix #240. --- 4chan_x.user.js | 2 +- changelog | 1 + script.coffee | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 714a8cef6..2047a403e 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1705,7 +1705,7 @@ }); ta.style.cssText = $.get('qr.size', ''); } - mimeTypes = $('.rules').textContent.match(/: (.+) /)[1].toLowerCase().replace(/\w+/g, function(type) { + mimeTypes = $('.rules').firstChild.textContent.match(/: (.+) /)[1].toLowerCase().replace(/\w+/g, function(type) { switch (type) { case 'jpg': return 'image/jpeg'; diff --git a/changelog b/changelog index 496914583..d4736eca0 100644 --- a/changelog +++ b/changelog @@ -1,6 +1,7 @@ master - Mayhem Fix posting on Safari. + Fix rare case where the QR would not accept images. 2.26.4 - Mayhem diff --git a/script.coffee b/script.coffee index 42bcd1161..e2f0b7d1e 100644 --- a/script.coffee +++ b/script.coffee @@ -1325,7 +1325,7 @@ qr = ta.style.cssText = $.get 'qr.size', '' # Allow only this board's supported files. - mimeTypes = $('.rules').textContent.match(/: (.+) /)[1].toLowerCase().replace /\w+/g, (type) -> + mimeTypes = $('.rules').firstChild.textContent.match(/: (.+) /)[1].toLowerCase().replace /\w+/g, (type) -> switch type when 'jpg' 'image/jpeg'