v1.18.x
psychobunny 11 years ago
parent 7280567d21
commit 10716c37d3

@ -65,5 +65,8 @@
"topics_per_page": "Topics per Page",
"posts_per_page": "Posts per Page",
"notification_sounds" : "Play a sound when you receive a notification."
"notification_sounds" : "Play a sound when you receive a notification.",
"browsing": "Browsing Settings",
"open_links_in_new_tab": "Open outgoing links in new tab?"
}

@ -261,6 +261,9 @@ var ajaxify = ajaxify || {};
if (config.useOutgoingLinksPage) {
ajaxify.go('outgoing?url=' + encodeURIComponent(this.href));
e.preventDefault();
} else if (config.openOutgoingLinksInNewTab) {
window.open(this.href, '_blank');
e.preventDefault();
}
}
}

@ -62,6 +62,7 @@ apiController.getConfig = function(req, res, next) {
config.postsPerPage = settings.postsPerPage;
config.notificationSounds = settings.notificationSounds;
config.defaultLang = settings.language || config.defaultLang;
config.openOutgoingLinksInNewTab = settings.openOutgoingLinksInNewTab;
if (res.locals.isAPI) {
res.json(200, config);

@ -25,6 +25,7 @@ module.exports = function(User) {
settings = data.settings;
settings.showemail = settings.showemail ? parseInt(settings.showemail, 10) !== 0 : false;
settings.openOutgoingLinksInNewTab = settings.openOutgoingLinksInNewTab ? parseInt(settings.openOutgoingLinksInNewTab, 10) !== 0 : false;
settings.dailyDigestFreq = settings.dailyDigestFreq || 'daily';
settings.usePagination = settings.usePagination ? parseInt(settings.usePagination, 10) === 1 : parseInt(meta.config.usePagination, 10) === 1;
settings.topicsPerPage = settings.topicsPerPage ? parseInt(settings.topicsPerPage, 10) : parseInt(meta.config.topicsPerPage, 10) || 20;
@ -72,6 +73,7 @@ module.exports = function(User) {
plugins.fireHook('action:user.saveSettings', {uid: uid, settings: data});
db.setObject('user:' + uid + ':settings', {
showemail: data.showemail,
openOutgoingLinksInNewTab: data.openOutgoingLinksInNewTab,
dailyDigestFreq: data.dailyDigestFreq || 'daily',
usePagination: data.usePagination,
topicsPerPage: data.topicsPerPage,

Loading…
Cancel
Save