Fix settings importing.
This commit is contained in:
parent
efb0ee27bf
commit
0c8a7bf29d
@ -13558,93 +13558,9 @@
|
|||||||
return reader.readAsText(file);
|
return reader.readAsText(file);
|
||||||
},
|
},
|
||||||
loadSettings: function(data) {
|
loadSettings: function(data) {
|
||||||
var key, val, version, _ref;
|
var version;
|
||||||
|
|
||||||
version = data.version.split('.');
|
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);
|
return $.set(data.Conf);
|
||||||
},
|
},
|
||||||
convertSettings: function(data, map) {
|
convertSettings: function(data, map) {
|
||||||
|
|||||||
@ -13565,93 +13565,9 @@
|
|||||||
return reader.readAsText(file);
|
return reader.readAsText(file);
|
||||||
},
|
},
|
||||||
loadSettings: function(data) {
|
loadSettings: function(data) {
|
||||||
var key, val, version, _ref;
|
var version;
|
||||||
|
|
||||||
version = data.version.split('.');
|
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);
|
return $.set(data.Conf);
|
||||||
},
|
},
|
||||||
convertSettings: function(data, map) {
|
convertSettings: function(data, map) {
|
||||||
|
|||||||
@ -13549,93 +13549,9 @@
|
|||||||
return reader.readAsText(file);
|
return reader.readAsText(file);
|
||||||
},
|
},
|
||||||
loadSettings: function(data) {
|
loadSettings: function(data) {
|
||||||
var key, val, version, _ref;
|
var version;
|
||||||
|
|
||||||
version = data.version.split('.');
|
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);
|
return $.set(data.Conf);
|
||||||
},
|
},
|
||||||
convertSettings: function(data, map) {
|
convertSettings: function(data, map) {
|
||||||
|
|||||||
@ -217,81 +217,6 @@ Settings =
|
|||||||
|
|
||||||
loadSettings: (data) ->
|
loadSettings: (data) ->
|
||||||
version = data.version.split '.'
|
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
|
$.set data.Conf
|
||||||
|
|
||||||
convertSettings: (data, map) ->
|
convertSettings: (data, map) ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user