From 03a8435a94fee6c68214ab8c6510cbd5890b2103 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Thu, 1 Aug 2013 22:10:51 +0200 Subject: [PATCH] Fix duplicate data property in object literal not allowed in strict mode. --- src/Archive/Redirect.coffee | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index 8cf6954bb..edc4e621c 100644 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -1,8 +1,9 @@ Redirect = archives: `<%= JSON.stringify(grunt.file.readJSON('json/archives.json')) %>` - thread: {} - post: {} - file: {} + data: + thread: {} + post: {} + file: {} init: -> for boardID, data of Conf['selectedArchives'] @@ -13,15 +14,15 @@ Redirect = archive.files else archive.boards - Redirect[type][boardID] = archive if boardID in arr + Redirect.data[type][boardID] = archive if boardID in arr for archive in Conf['archives'] for boardID in archive.boards - unless boardID of Redirect.thread - Redirect.thread[boardID] = archive - unless boardID of Redirect.post or archive.software isnt 'foolfuuka' - Redirect.post[boardID] = archive - unless boardID of Redirect.file or boardID not in archive.files - Redirect.file[boardID] = archive + unless boardID of Redirect.data.thread + Redirect.data.thread[boardID] = archive + unless boardID of Redirect.data.post or archive.software isnt 'foolfuuka' + Redirect.data.post[boardID] = archive + unless boardID of Redirect.data.file or boardID not in archive.files + Redirect.data.file[boardID] = archive Redirect.update() @@ -40,7 +41,7 @@ Redirect = cb? now to: (dest, data) -> - archive = (if dest is 'search' then Redirect.thread else Redirect[dest])[data.boardID] + archive = (if dest is 'search' then Redirect.data.thread else Redirect.data[dest])[data.boardID] return '' unless archive Redirect[dest] archive, data