sS gazelleBot_suggestPostTypes(Cl postTypes, SS jsonData, bool alwaysShowText) { S f_type = cast jsonData.get("f_type"); ret !alwaysShowText && empty(postTypes) ? "" : "Suggested post types: " + joinWithCommaOr("-", safeMap(type -> { bool selected = eq(f_type, type); if (selected) ret span_title("Post type is already selected", b(htmlEncode2(type))); ret ahref_js([[ const selectize = $("select[name=f_type]").data('selectize'); console.log("selectize: " + selectize); selectize.setValue(]] + jsQuote(type) + ");", htmlEncode2(type), title := "Click to accept suggestion"), takeFirst(3, postTypes))); }