From 0c8a7bf29d21bbc24c53003c92e2deb8635fe79c Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Fri, 10 May 2013 22:49:59 -0700 Subject: [PATCH] Fix settings importing. --- builds/appchan-x.js | 86 +------------------------------------ builds/appchan-x.user.js | 86 +------------------------------------ builds/crx/script.js | 86 +------------------------------------ src/General/Settings.coffee | 75 -------------------------------- 4 files changed, 3 insertions(+), 330 deletions(-) diff --git a/builds/appchan-x.js b/builds/appchan-x.js index 33e73724d..e5689c7a6 100644 --- a/builds/appchan-x.js +++ b/builds/appchan-x.js @@ -13558,93 +13558,9 @@ return reader.readAsText(file); }, loadSettings: function(data) { - var key, val, version, _ref; + var version; version = data.version.split('.'); - if (version[0] === '2') { - data = Settings.convertSettings(data, { - 'Disable 4chan\'s extension': '', - 'Catalog Links': '', - 'Reply Navigation': '', - 'Show Stubs': 'Stubs', - 'Image Auto-Gif': 'Auto-GIF', - 'Expand From Current': '', - 'Unread Tab Icon': 'Unread Favicon', - 'Post in Title': 'Thread Excerpt', - 'Auto Hide QR': '', - 'Open Reply in New Tab': '', - 'Remember QR size': '', - 'Quote Inline': 'Quote Inlining', - 'Quote Preview': 'Quote Previewing', - 'Indicate OP quote': 'Mark OP Quotes', - 'Indicate Cross-thread Quotes': 'Mark Cross-thread Quotes', - 'Reply Hiding': 'Reply Hiding Buttons', - 'Thread Hiding': 'Thread Hiding Buttons', - 'uniqueid': 'uniqueID', - 'mod': 'capcode', - 'country': 'flag', - 'md5': 'MD5', - 'openEmptyQR': 'Open empty QR', - 'openQR': 'Open QR', - 'openOptions': 'Open settings', - 'close': 'Close', - 'spoiler': 'Spoiler tags', - 'code': 'Code tags', - 'submit': 'Submit QR', - 'watch': 'Watch', - 'update': 'Update', - 'unreadCountTo0': '', - 'expandAllImages': 'Expand images', - 'expandImage': 'Expand image', - 'zero': 'Front page', - 'nextPage': 'Next page', - 'previousPage': 'Previous page', - 'nextThread': 'Next thread', - 'previousThread': 'Previous thread', - 'expandThread': 'Expand thread', - 'openThreadTab': 'Open thread', - 'openThread': 'Open thread tab', - 'nextReply': 'Next reply', - 'previousReply': 'Previous reply', - 'hide': 'Hide', - 'Scrolling': 'Auto Scroll', - 'Verbose': '' - }); - data.Conf.sauces = data.Conf.sauces.replace(/\$\d/g, function(c) { - switch (c) { - case '$1': - return '%TURL'; - case '$2': - return '%URL'; - case '$3': - return '%MD5'; - case '$4': - return '%board'; - default: - return c; - } - }); - _ref = Config.hotkeys; - for (key in _ref) { - val = _ref[key]; - if (!(key in data.Conf)) { - continue; - } - data.Conf[key] = data.Conf[key].replace(/ctrl|alt|meta/g, function(s) { - return "" + (s[0].toUpperCase()) + s.slice(1); - }).replace(/(^|.+\+)[A-Z]$/g, function(s) { - return "Shift+" + s.slice(0, -1) + (s.slice(-1).toLowerCase()); - }); - } - data.Conf.WatchedThreads = data.WatchedThreads; - } else if (version[0] === '3') { - data = Settings.convertSettings(data, { - 'Reply Hiding': 'Reply Hiding Buttons', - 'Thread Hiding': 'Thread Hiding Buttons', - 'Bottom header': 'Bottom Header', - 'Unread Tab Icon': 'Unread Favicon' - }); - } return $.set(data.Conf); }, convertSettings: function(data, map) { diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 7c2681fae..a491e913e 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -13565,93 +13565,9 @@ return reader.readAsText(file); }, loadSettings: function(data) { - var key, val, version, _ref; + var version; version = data.version.split('.'); - if (version[0] === '2') { - data = Settings.convertSettings(data, { - 'Disable 4chan\'s extension': '', - 'Catalog Links': '', - 'Reply Navigation': '', - 'Show Stubs': 'Stubs', - 'Image Auto-Gif': 'Auto-GIF', - 'Expand From Current': '', - 'Unread Tab Icon': 'Unread Favicon', - 'Post in Title': 'Thread Excerpt', - 'Auto Hide QR': '', - 'Open Reply in New Tab': '', - 'Remember QR size': '', - 'Quote Inline': 'Quote Inlining', - 'Quote Preview': 'Quote Previewing', - 'Indicate OP quote': 'Mark OP Quotes', - 'Indicate Cross-thread Quotes': 'Mark Cross-thread Quotes', - 'Reply Hiding': 'Reply Hiding Buttons', - 'Thread Hiding': 'Thread Hiding Buttons', - 'uniqueid': 'uniqueID', - 'mod': 'capcode', - 'country': 'flag', - 'md5': 'MD5', - 'openEmptyQR': 'Open empty QR', - 'openQR': 'Open QR', - 'openOptions': 'Open settings', - 'close': 'Close', - 'spoiler': 'Spoiler tags', - 'code': 'Code tags', - 'submit': 'Submit QR', - 'watch': 'Watch', - 'update': 'Update', - 'unreadCountTo0': '', - 'expandAllImages': 'Expand images', - 'expandImage': 'Expand image', - 'zero': 'Front page', - 'nextPage': 'Next page', - 'previousPage': 'Previous page', - 'nextThread': 'Next thread', - 'previousThread': 'Previous thread', - 'expandThread': 'Expand thread', - 'openThreadTab': 'Open thread', - 'openThread': 'Open thread tab', - 'nextReply': 'Next reply', - 'previousReply': 'Previous reply', - 'hide': 'Hide', - 'Scrolling': 'Auto Scroll', - 'Verbose': '' - }); - data.Conf.sauces = data.Conf.sauces.replace(/\$\d/g, function(c) { - switch (c) { - case '$1': - return '%TURL'; - case '$2': - return '%URL'; - case '$3': - return '%MD5'; - case '$4': - return '%board'; - default: - return c; - } - }); - _ref = Config.hotkeys; - for (key in _ref) { - val = _ref[key]; - if (!(key in data.Conf)) { - continue; - } - data.Conf[key] = data.Conf[key].replace(/ctrl|alt|meta/g, function(s) { - return "" + (s[0].toUpperCase()) + s.slice(1); - }).replace(/(^|.+\+)[A-Z]$/g, function(s) { - return "Shift+" + s.slice(0, -1) + (s.slice(-1).toLowerCase()); - }); - } - data.Conf.WatchedThreads = data.WatchedThreads; - } else if (version[0] === '3') { - data = Settings.convertSettings(data, { - 'Reply Hiding': 'Reply Hiding Buttons', - 'Thread Hiding': 'Thread Hiding Buttons', - 'Bottom header': 'Bottom Header', - 'Unread Tab Icon': 'Unread Favicon' - }); - } return $.set(data.Conf); }, convertSettings: function(data, map) { diff --git a/builds/crx/script.js b/builds/crx/script.js index b5da720a5..4a2cf484f 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -13549,93 +13549,9 @@ return reader.readAsText(file); }, loadSettings: function(data) { - var key, val, version, _ref; + var version; version = data.version.split('.'); - if (version[0] === '2') { - data = Settings.convertSettings(data, { - 'Disable 4chan\'s extension': '', - 'Catalog Links': '', - 'Reply Navigation': '', - 'Show Stubs': 'Stubs', - 'Image Auto-Gif': 'Auto-GIF', - 'Expand From Current': '', - 'Unread Tab Icon': 'Unread Favicon', - 'Post in Title': 'Thread Excerpt', - 'Auto Hide QR': '', - 'Open Reply in New Tab': '', - 'Remember QR size': '', - 'Quote Inline': 'Quote Inlining', - 'Quote Preview': 'Quote Previewing', - 'Indicate OP quote': 'Mark OP Quotes', - 'Indicate Cross-thread Quotes': 'Mark Cross-thread Quotes', - 'Reply Hiding': 'Reply Hiding Buttons', - 'Thread Hiding': 'Thread Hiding Buttons', - 'uniqueid': 'uniqueID', - 'mod': 'capcode', - 'country': 'flag', - 'md5': 'MD5', - 'openEmptyQR': 'Open empty QR', - 'openQR': 'Open QR', - 'openOptions': 'Open settings', - 'close': 'Close', - 'spoiler': 'Spoiler tags', - 'code': 'Code tags', - 'submit': 'Submit QR', - 'watch': 'Watch', - 'update': 'Update', - 'unreadCountTo0': '', - 'expandAllImages': 'Expand images', - 'expandImage': 'Expand image', - 'zero': 'Front page', - 'nextPage': 'Next page', - 'previousPage': 'Previous page', - 'nextThread': 'Next thread', - 'previousThread': 'Previous thread', - 'expandThread': 'Expand thread', - 'openThreadTab': 'Open thread', - 'openThread': 'Open thread tab', - 'nextReply': 'Next reply', - 'previousReply': 'Previous reply', - 'hide': 'Hide', - 'Scrolling': 'Auto Scroll', - 'Verbose': '' - }); - data.Conf.sauces = data.Conf.sauces.replace(/\$\d/g, function(c) { - switch (c) { - case '$1': - return '%TURL'; - case '$2': - return '%URL'; - case '$3': - return '%MD5'; - case '$4': - return '%board'; - default: - return c; - } - }); - _ref = Config.hotkeys; - for (key in _ref) { - val = _ref[key]; - if (!(key in data.Conf)) { - continue; - } - data.Conf[key] = data.Conf[key].replace(/ctrl|alt|meta/g, function(s) { - return "" + (s[0].toUpperCase()) + s.slice(1); - }).replace(/(^|.+\+)[A-Z]$/g, function(s) { - return "Shift+" + s.slice(0, -1) + (s.slice(-1).toLowerCase()); - }); - } - data.Conf.WatchedThreads = data.WatchedThreads; - } else if (version[0] === '3') { - data = Settings.convertSettings(data, { - 'Reply Hiding': 'Reply Hiding Buttons', - 'Thread Hiding': 'Thread Hiding Buttons', - 'Bottom header': 'Bottom Header', - 'Unread Tab Icon': 'Unread Favicon' - }); - } return $.set(data.Conf); }, convertSettings: function(data, map) { diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index 194fd411f..08839b2a0 100644 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -217,81 +217,6 @@ Settings = loadSettings: (data) -> version = data.version.split '.' - if version[0] is '2' - data = Settings.convertSettings data, - # General confs - 'Disable 4chan\'s extension': '' - 'Catalog Links': '' - 'Reply Navigation': '' - 'Show Stubs': 'Stubs' - 'Image Auto-Gif': 'Auto-GIF' - 'Expand From Current': '' - 'Unread Tab Icon': 'Unread Favicon' - 'Post in Title': 'Thread Excerpt' - 'Auto Hide QR': '' - 'Open Reply in New Tab': '' - 'Remember QR size': '' - 'Quote Inline': 'Quote Inlining' - 'Quote Preview': 'Quote Previewing' - 'Indicate OP quote': 'Mark OP Quotes' - 'Indicate Cross-thread Quotes': 'Mark Cross-thread Quotes' - 'Reply Hiding': 'Reply Hiding Buttons' - 'Thread Hiding': 'Thread Hiding Buttons' - # filter - 'uniqueid': 'uniqueID' - 'mod': 'capcode' - 'country': 'flag' - 'md5': 'MD5' - # keybinds - 'openEmptyQR': 'Open empty QR' - 'openQR': 'Open QR' - 'openOptions': 'Open settings' - 'close': 'Close' - 'spoiler': 'Spoiler tags' - 'code': 'Code tags' - 'submit': 'Submit QR' - 'watch': 'Watch' - 'update': 'Update' - 'unreadCountTo0': '' - 'expandAllImages': 'Expand images' - 'expandImage': 'Expand image' - 'zero': 'Front page' - 'nextPage': 'Next page' - 'previousPage': 'Previous page' - 'nextThread': 'Next thread' - 'previousThread': 'Previous thread' - 'expandThread': 'Expand thread' - 'openThreadTab': 'Open thread' - 'openThread': 'Open thread tab' - 'nextReply': 'Next reply' - 'previousReply': 'Previous reply' - 'hide': 'Hide' - # updater - 'Scrolling': 'Auto Scroll' - 'Verbose': '' - data.Conf.sauces = data.Conf.sauces.replace /\$\d/g, (c) -> - switch c - when '$1' - '%TURL' - when '$2' - '%URL' - when '$3' - '%MD5' - when '$4' - '%board' - else - c - for key, val of Config.hotkeys - continue unless key of data.Conf - data.Conf[key] = data.Conf[key].replace(/ctrl|alt|meta/g, (s) -> "#{s[0].toUpperCase()}#{s[1..]}").replace /(^|.+\+)[A-Z]$/g, (s) -> - "Shift+#{s[0...-1]}#{s[-1..].toLowerCase()}" - data.Conf.WatchedThreads = data.WatchedThreads - else if version[0] is '3' - data = Settings.convertSettings data, - 'Reply Hiding': 'Reply Hiding Buttons' - 'Thread Hiding': 'Thread Hiding Buttons' - 'Bottom header': 'Bottom Header' - 'Unread Tab Icon': 'Unread Favicon' $.set data.Conf convertSettings: (data, map) ->