Barış Soner Uşaklı 4 years ago
parent 84d545775e
commit 1d6bcbebde

@ -139,5 +139,6 @@
"showAverageApprovalTime": true, "showAverageApprovalTime": true,
"autoApproveTime": 0, "autoApproveTime": 0,
"maxUserSessions": 10, "maxUserSessions": 10,
"useCompression": 0 "useCompression": 0,
"updateUrlWithPostIndex": 1
} }

@ -65,6 +65,7 @@
"restrict-chat": "Only allow chat messages from users I follow", "restrict-chat": "Only allow chat messages from users I follow",
"outgoing-new-tab": "Open outgoing links in new tab", "outgoing-new-tab": "Open outgoing links in new tab",
"topic-search": "Enable In-Topic Searching", "topic-search": "Enable In-Topic Searching",
"update-url-with-post-index": "Update url with post index while browsing topics",
"digest-freq": "Subscribe to Digest", "digest-freq": "Subscribe to Digest",
"digest-freq.off": "Off", "digest-freq.off": "Off",
"digest-freq.daily": "Daily", "digest-freq.daily": "Daily",

@ -133,7 +133,7 @@
"enable_topic_searching": "Enable In-Topic Searching", "enable_topic_searching": "Enable In-Topic Searching",
"topic_search_help": "If enabled, in-topic searching will override the browser's default page search behaviour and allow you to search through the entire topic, instead of what is only shown on screen", "topic_search_help": "If enabled, in-topic searching will override the browser's default page search behaviour and allow you to search through the entire topic, instead of what is only shown on screen",
"update_url_with_post_index": "Update url with post index while browsing topics",
"scroll_to_my_post": "After posting a reply, show the new post", "scroll_to_my_post": "After posting a reply, show the new post",
"follow_topics_you_reply_to": "Watch topics that you reply to", "follow_topics_you_reply_to": "Watch topics that you reply to",

@ -37,6 +37,9 @@ Settings:
topicSearchEnabled: topicSearchEnabled:
type: boolean type: boolean
description: Enable keyword searching within topics description: Enable keyword searching within topics
updateUrlWithPostIndex:
type: boolean
description: Update url with post index while browsing topics
categoryTopicSort: categoryTopicSort:
type: string type: string
description: Default sorting strategy of the topics in a category description: Default sorting strategy of the topics in a category

@ -388,6 +388,8 @@ get:
type: number type: number
scrollToMyPost: scrollToMyPost:
type: boolean type: boolean
updateUrlWithPostIndex:
type: boolean
allowMultipleBadges: allowMultipleBadges:
type: boolean type: boolean
privateUploads: privateUploads:

@ -227,7 +227,7 @@ define('forum/topic', [
updateUserBookmark(index); updateUserBookmark(index);
Topic.replaceURLTimeout = 0; Topic.replaceURLTimeout = 0;
if (history.replaceState) { if (ajaxify.data.updateUrlWithPostIndex && history.replaceState) {
var search = window.location.search || ''; var search = window.location.search || '';
if (!config.usePagination) { if (!config.usePagination) {
search = (search && !/^\?page=\d+$/.test(search) ? search : ''); search = (search && !/^\?page=\d+$/.test(search) ? search : '');

@ -81,6 +81,7 @@ topicsController.get = async function getTopic(req, res, callback) {
topicData.postEditDuration = meta.config.postEditDuration; topicData.postEditDuration = meta.config.postEditDuration;
topicData.postDeleteDuration = meta.config.postDeleteDuration; topicData.postDeleteDuration = meta.config.postDeleteDuration;
topicData.scrollToMyPost = settings.scrollToMyPost; topicData.scrollToMyPost = settings.scrollToMyPost;
topicData.updateUrlWithPostIndex = settings.updateUrlWithPostIndex;
topicData.allowMultipleBadges = meta.config.allowMultipleBadges === 1; topicData.allowMultipleBadges = meta.config.allowMultipleBadges === 1;
topicData.privateUploads = meta.config.privateUploads === 1; topicData.privateUploads = meta.config.privateUploads === 1;
topicData.rssFeedUrl = relative_path + '/topic/' + topicData.tid + '.rss'; topicData.rssFeedUrl = relative_path + '/topic/' + topicData.tid + '.rss';

@ -58,6 +58,7 @@ module.exports = function (User) {
settings.upvoteNotifFreq = getSetting(settings, 'upvoteNotifFreq', 'all'); settings.upvoteNotifFreq = getSetting(settings, 'upvoteNotifFreq', 'all');
settings.restrictChat = parseInt(getSetting(settings, 'restrictChat', 0), 10) === 1; settings.restrictChat = parseInt(getSetting(settings, 'restrictChat', 0), 10) === 1;
settings.topicSearchEnabled = parseInt(getSetting(settings, 'topicSearchEnabled', 0), 10) === 1; settings.topicSearchEnabled = parseInt(getSetting(settings, 'topicSearchEnabled', 0), 10) === 1;
settings.updateUrlWithPostIndex = parseInt(getSetting(settings, 'updateUrlWithPostIndex', 1), 10) === 1;
settings.bootswatchSkin = validator.escape(String(settings.bootswatchSkin || '')); settings.bootswatchSkin = validator.escape(String(settings.bootswatchSkin || ''));
settings.homePageRoute = validator.escape(String(settings.homePageRoute || '')).replace(///g, '/'); settings.homePageRoute = validator.escape(String(settings.homePageRoute || '')).replace(///g, '/');
settings.scrollToMyPost = parseInt(getSetting(settings, 'scrollToMyPost', 1), 10) === 1; settings.scrollToMyPost = parseInt(getSetting(settings, 'scrollToMyPost', 1), 10) === 1;
@ -116,6 +117,7 @@ module.exports = function (User) {
followTopicsOnReply: data.followTopicsOnReply, followTopicsOnReply: data.followTopicsOnReply,
restrictChat: data.restrictChat, restrictChat: data.restrictChat,
topicSearchEnabled: data.topicSearchEnabled, topicSearchEnabled: data.topicSearchEnabled,
updateUrlWithPostIndex: data.updateUrlWithPostIndex,
homePageRoute: ((data.homePageRoute === 'custom' ? data.homePageCustom : data.homePageRoute) || '').replace(/^\//, ''), homePageRoute: ((data.homePageRoute === 'custom' ? data.homePageCustom : data.homePageRoute) || '').replace(/^\//, ''),
scrollToMyPost: data.scrollToMyPost, scrollToMyPost: data.scrollToMyPost,
upvoteNotifFreq: data.upvoteNotifFreq, upvoteNotifFreq: data.upvoteNotifFreq,

@ -299,6 +299,13 @@
</label> </label>
</div> </div>
<div class="checkbox">
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
<input class="mdl-switch__input" type="checkbox" data-field="updateUrlWithPostIndex">
<span class="mdl-switch__label"><strong>[[admin/settings/user:update-url-with-post-index]]</strong></span>
</label>
</div>
<div class="form-group"> <div class="form-group">
<label>[[admin/settings/user:digest-freq]]</label> <label>[[admin/settings/user:digest-freq]]</label>
<select class="form-control" data-field="dailyDigestFreq"> <select class="form-control" data-field="dailyDigestFreq">

Loading…
Cancel
Save