FEATURE: Reimplement SiteSetting.max_oneboxes_per_post. (#6668)

Previously, the site setting was only effective on the client side of
things. Once the site setting was been reached, all oneboxes are not
rendered. This commit changes it such that the site setting is respected
both on the client and server side. The first N oneboxes are rendered and
once the limit has been reached, subsequent oneboxes will not be
rendered.
This commit is contained in:
Guo Xiang Tan
2018-11-27 16:00:31 +08:00
committed by GitHub
parent 74b300110f
commit a1e77aa2ed
11 changed files with 291 additions and 67 deletions

View File

@ -13,6 +13,7 @@ import { flushMap } from "discourse/models/store";
import { clearRewrites } from "discourse/lib/url";
import { initSearchData } from "discourse/widgets/search-menu";
import { resetDecorators } from "discourse/widgets/widget";
import { resetCache as resetOneboxCache } from "pretty-text/oneboxer";
import { resetCustomPostMessageCallbacks } from "discourse/controllers/topic";
export function currentUser() {
@ -122,6 +123,7 @@ export function acceptance(name, options) {
clearRewrites();
initSearchData();
resetDecorators();
resetOneboxCache();
resetCustomPostMessageCallbacks();
Discourse.reset();
}