diff --git a/src/General/Get.coffee b/src/General/Get.coffee index eb1966a62..698ae0c19 100755 --- a/src/General/Get.coffee +++ b/src/General/Get.coffee @@ -66,6 +66,8 @@ Get = quotelinks.filter (quotelink) -> {boardID, postID} = Get.postDataFromLink quotelink boardID is post.board.ID and postID is post.ID + scriptData: -> + $('script:not([src])', d.head)?.textContent or '' postClone: (boardID, threadID, postID, root, context) -> if post = g.posts["#{boardID}.#{postID}"] Get.insert post, root, context diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 47ce0da75..20e28aba2 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -193,7 +193,7 @@ Main = Main.handleErrors errors if errors if g.VIEW is 'thread' - scriptData = $('script:not([src])', d.head)?.textContent or '' + scriptData = Get.scriptData() threads[0].postLimit = /\bbumplimit *= *1\b/.test scriptData threads[0].fileLimit = /\bimagelimit *= *1\b/.test scriptData threads[0].ipCount = if m = scriptData.match /\bunique_ips *= *(\d+)\b/ then +m[1] diff --git a/src/Posting/QR.cooldown.coffee b/src/Posting/QR.cooldown.coffee index be4104e00..3a92d701f 100644 --- a/src/Posting/QR.cooldown.coffee +++ b/src/Posting/QR.cooldown.coffee @@ -5,8 +5,7 @@ QR.cooldown = return unless Conf['Cooldown'] # Read cooldown times - scriptData = $('script:not([src])', d.head)?.textContent or '' - QR.cooldown.delays = if m = scriptData.match /\bcooldowns *= *({[^}]+})/ + QR.cooldown.delays = if m = Get.scriptData().match /\bcooldowns *= *({[^}]+})/ JSON.parse m[1] else {thread: 0, reply: 0, image: 0, reply_intra: 0, image_intra: 0}