`;
+ var html = `
`;
if (n[2]) html += n[2];
html += `${n[0]}
`;
return html;
diff --git a/app/assets/javascripts/discourse/controllers/move-to-topic.js.es6 b/app/assets/javascripts/discourse/controllers/move-to-topic.js.es6
index 609ae2cf2db..f80b659baaf 100644
--- a/app/assets/javascripts/discourse/controllers/move-to-topic.js.es6
+++ b/app/assets/javascripts/discourse/controllers/move-to-topic.js.es6
@@ -107,7 +107,7 @@ export default Controller.extend(ModalFunctionality, {
@discourseComputed("canSplitTopic")
canSplitToPM(canSplitTopic) {
- return canSplitTopic && (this.currentUser && this.currentUser.admin);
+ return canSplitTopic && this.currentUser && this.currentUser.admin;
},
actions: {
diff --git a/app/assets/javascripts/discourse/controllers/topic-bulk-actions.js.es6 b/app/assets/javascripts/discourse/controllers/topic-bulk-actions.js.es6
index 5382f8cc3f6..723e7fee54a 100644
--- a/app/assets/javascripts/discourse/controllers/topic-bulk-actions.js.es6
+++ b/app/assets/javascripts/discourse/controllers/topic-bulk-actions.js.es6
@@ -81,7 +81,10 @@ export default Controller.extend(ModalFunctionality, {
const topics = this.get("model.topics");
// const relistButtonIndex = _buttons.findIndex(b => b.action === 'relistTopics');
- this.set("buttons", _buttons.filter(b => b.buttonVisible(topics)));
+ this.set(
+ "buttons",
+ _buttons.filter(b => b.buttonVisible(topics))
+ );
this.set("modal.modalClass", "topic-bulk-actions-modal small");
this.send("changeBulkTemplate", "modal/bulk-actions-buttons");
},
diff --git a/app/assets/javascripts/discourse/controllers/user-invited-show.js.es6 b/app/assets/javascripts/discourse/controllers/user-invited-show.js.es6
index eabab5a7495..1fd6ec0bdfa 100644
--- a/app/assets/javascripts/discourse/controllers/user-invited-show.js.es6
+++ b/app/assets/javascripts/discourse/controllers/user-invited-show.js.es6
@@ -28,9 +28,11 @@ export default Controller.extend({
@observes("searchTerm")
_searchTermChanged: discourseDebounce(function() {
- Invite.findInvitedBy(this.user, this.filter, this.searchTerm).then(
- invites => this.set("model", invites)
- );
+ Invite.findInvitedBy(
+ this.user,
+ this.filter,
+ this.searchTerm
+ ).then(invites => this.set("model", invites));
}, 250),
inviteRedeemed: equal("filter", "redeemed"),
diff --git a/app/assets/javascripts/discourse/lib/push-notifications.js.es6 b/app/assets/javascripts/discourse/lib/push-notifications.js.es6
index 1b73a291179..3d9e7baf3da 100644
--- a/app/assets/javascripts/discourse/lib/push-notifications.js.es6
+++ b/app/assets/javascripts/discourse/lib/push-notifications.js.es6
@@ -49,10 +49,10 @@ export function isPushNotificationsSupported(mobileView) {
if (
!(
"serviceWorker" in navigator &&
- (ServiceWorkerRegistration &&
+ ServiceWorkerRegistration &&
typeof Notification !== "undefined" &&
"showNotification" in ServiceWorkerRegistration.prototype &&
- "PushManager" in window)
+ "PushManager" in window
)
) {
return false;
diff --git a/app/assets/javascripts/discourse/lib/transform-post.js.es6 b/app/assets/javascripts/discourse/lib/transform-post.js.es6
index e6583cf8f61..a3ff0060314 100644
--- a/app/assets/javascripts/discourse/lib/transform-post.js.es6
+++ b/app/assets/javascripts/discourse/lib/transform-post.js.es6
@@ -239,7 +239,7 @@ export default function transformPost(
postAtts.showFlagDelete =
!postAtts.canDelete &&
postAtts.yours &&
- (currentUser && !currentUser.staff);
+ currentUser && !currentUser.staff;
} else {
postAtts.canRecover = postAtts.isDeleted && postAtts.canRecover;
postAtts.canDelete =
diff --git a/app/assets/javascripts/discourse/models/composer.js.es6 b/app/assets/javascripts/discourse/models/composer.js.es6
index 3f081f81d96..89041903c91 100644
--- a/app/assets/javascripts/discourse/models/composer.js.es6
+++ b/app/assets/javascripts/discourse/models/composer.js.es6
@@ -652,10 +652,7 @@ const Composer = RestModel.extend({
const replyBlank = isEmpty(this.reply);
const composer = this;
- if (
- !replyBlank &&
- ((opts.reply || isEdit(opts.action)) && this.replyDirty)
- ) {
+ if (!replyBlank && (opts.reply || isEdit(opts.action)) && this.replyDirty) {
return;
}
diff --git a/app/assets/javascripts/discourse/models/invite.js.es6 b/app/assets/javascripts/discourse/models/invite.js.es6
index 4cbbdb86385..7eb142c0abb 100644
--- a/app/assets/javascripts/discourse/models/invite.js.es6
+++ b/app/assets/javascripts/discourse/models/invite.js.es6
@@ -53,9 +53,9 @@ Invite.reopenClass({
findInvitedCount(user) {
if (!user) Promise.resolve();
- return ajax(userPath(`${user.username_lower}/invited_count.json`)).then(
- result => EmberObject.create(result.counts)
- );
+ return ajax(
+ userPath(`${user.username_lower}/invited_count.json`)
+ ).then(result => EmberObject.create(result.counts));
},
reinviteAll() {
diff --git a/app/assets/javascripts/discourse/routes/preferences-account.js.es6 b/app/assets/javascripts/discourse/routes/preferences-account.js.es6
index 6ea1e95b95b..f55a568997e 100644
--- a/app/assets/javascripts/discourse/routes/preferences-account.js.es6
+++ b/app/assets/javascripts/discourse/routes/preferences-account.js.es6
@@ -8,7 +8,10 @@ export default RestrictedUserRoute.extend({
const user = this.modelFor("user");
if (this.siteSettings.enable_badges) {
return UserBadge.findByUsername(user.get("username")).then(userBadges => {
- user.set("badges", userBadges.map(ub => ub.badge));
+ user.set(
+ "badges",
+ userBadges.map(ub => ub.badge)
+ );
return user;
});
} else {
diff --git a/app/assets/javascripts/discourse/widgets/menu-panel.js.es6 b/app/assets/javascripts/discourse/widgets/menu-panel.js.es6
index 69ccea76269..cc8218e8b68 100644
--- a/app/assets/javascripts/discourse/widgets/menu-panel.js.es6
+++ b/app/assets/javascripts/discourse/widgets/menu-panel.js.es6
@@ -19,7 +19,10 @@ createWidget("menu-links", {
const result = [];
result.push(
- h("ul.menu-links.columned", links.map(l => h("li", liOpts, l)))
+ h(
+ "ul.menu-links.columned",
+ links.map(l => h("li", liOpts, l))
+ )
);
result.push(h("div.clearfix"));
diff --git a/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6 b/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6
index 040f92db965..82c38677a98 100644
--- a/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6
+++ b/app/assets/javascripts/discourse/widgets/topic-timeline.js.es6
@@ -211,7 +211,7 @@ createWidget("timeline-scrollarea", {
position.lastRead > 3 &&
Math.abs(position.lastRead - position.current) > 3 &&
Math.abs(position.lastRead - position.total) > 1 &&
- (position.lastRead && position.lastRead !== position.total);
+ position.lastRead && position.lastRead !== position.total;
if (hasBackPosition) {
const lastReadTop = Math.round(
diff --git a/app/assets/javascripts/discourse/widgets/user-menu.js.es6 b/app/assets/javascripts/discourse/widgets/user-menu.js.es6
index 488ea63c020..56947977fed 100644
--- a/app/assets/javascripts/discourse/widgets/user-menu.js.es6
+++ b/app/assets/javascripts/discourse/widgets/user-menu.js.es6
@@ -115,7 +115,10 @@ createWidget("user-menu-links", {
return h("ul.menu-links-row", [
links.map(l => h("li.user", this.linkHtml(l))),
- h("li.glyphs", glyphs.map(l => this.glyphHtml(l)))
+ h(
+ "li.glyphs",
+ glyphs.map(l => this.glyphHtml(l))
+ )
]);
},
diff --git a/app/assets/javascripts/pretty-text/engines/discourse-markdown/bbcode-inline.js.es6 b/app/assets/javascripts/pretty-text/engines/discourse-markdown/bbcode-inline.js.es6
index 4e23b196c15..98788ae063d 100644
--- a/app/assets/javascripts/pretty-text/engines/discourse-markdown/bbcode-inline.js.es6
+++ b/app/assets/javascripts/pretty-text/engines/discourse-markdown/bbcode-inline.js.es6
@@ -185,7 +185,10 @@ export function setup(helper) {
if (simpleUrlRegex.test(url)) {
startToken.type = "link_open";
startToken.tag = "a";
- startToken.attrs = [["href", url], ["data-bbcode", "true"]];
+ startToken.attrs = [
+ ["href", url],
+ ["data-bbcode", "true"]
+ ];
startToken.content = "";
startToken.nesting = 1;
@@ -214,7 +217,10 @@ export function setup(helper) {
let email = tagInfo.attrs["_default"] || content;
token = state.push("link_open", "a", 1);
- token.attrs = [["href", "mailto:" + email], ["data-bbcode", "true"]];
+ token.attrs = [
+ ["href", "mailto:" + email],
+ ["data-bbcode", "true"]
+ ];
token = state.push("text", "", 0);
token.content = content;
@@ -228,7 +234,10 @@ export function setup(helper) {
tag: "img",
replace: function(state, tagInfo, content) {
let token = state.push("image", "img", 0);
- token.attrs = [["src", content], ["alt", ""]];
+ token.attrs = [
+ ["src", content],
+ ["alt", ""]
+ ];
token.children = [];
return true;
}
diff --git a/app/assets/javascripts/pretty-text/engines/discourse-markdown/category-hashtag.js.es6 b/app/assets/javascripts/pretty-text/engines/discourse-markdown/category-hashtag.js.es6
index dbe68836060..e9e34ab27e3 100644
--- a/app/assets/javascripts/pretty-text/engines/discourse-markdown/category-hashtag.js.es6
+++ b/app/assets/javascripts/pretty-text/engines/discourse-markdown/category-hashtag.js.es6
@@ -8,7 +8,10 @@ function addHashtag(buffer, matches, state) {
if (result) {
token = new state.Token("link_open", "a", 1);
- token.attrs = [["class", "hashtag"], ["href", result[0]]];
+ token.attrs = [
+ ["class", "hashtag"],
+ ["href", result[0]]
+ ];
token.block = false;
buffer.push(token);
diff --git a/app/assets/javascripts/select-kit/components/category-selector.js.es6 b/app/assets/javascripts/select-kit/components/category-selector.js.es6
index f000f007827..11ed11bacd5 100644
--- a/app/assets/javascripts/select-kit/components/category-selector.js.es6
+++ b/app/assets/javascripts/select-kit/components/category-selector.js.es6
@@ -34,7 +34,10 @@ export default MultiSelectComponent.extend({
},
mutateValues(values) {
- this.set("categories", values.map(v => Category.findById(v)));
+ this.set(
+ "categories",
+ values.map(v => Category.findById(v))
+ );
},
filterComputedContent(computedContent, computedValues, filter) {
diff --git a/app/assets/javascripts/select-kit/components/composer-actions.js.es6 b/app/assets/javascripts/select-kit/components/composer-actions.js.es6
index e36b27f15e6..bb4a578e34f 100644
--- a/app/assets/javascripts/select-kit/components/composer-actions.js.es6
+++ b/app/assets/javascripts/select-kit/components/composer-actions.js.es6
@@ -132,7 +132,7 @@ export default DropdownSelectBoxComponent.extend({
(action !== REPLY && _topicSnapshot) ||
(action === REPLY &&
_topicSnapshot &&
- (options.userAvatar && options.userLink && options.topicLink))
+ options.userAvatar && options.userLink && options.topicLink)
) {
items.push({
name: I18n.t("composer.composer_actions.reply_to_topic.label"),
diff --git a/app/assets/javascripts/select-kit/components/tag-chooser.js.es6 b/app/assets/javascripts/select-kit/components/tag-chooser.js.es6
index b0de97cd21c..0d49d97176b 100644
--- a/app/assets/javascripts/select-kit/components/tag-chooser.js.es6
+++ b/app/assets/javascripts/select-kit/components/tag-chooser.js.es6
@@ -54,7 +54,10 @@ export default MultiSelectComponent.extend(TagsMixin, {
},
mutateValues(values) {
- this.set("tags", values.filter(v => v));
+ this.set(
+ "tags",
+ values.filter(v => v)
+ );
},
@discourseComputed("tags")
diff --git a/app/assets/javascripts/select-kit/components/tag-group-chooser.js.es6 b/app/assets/javascripts/select-kit/components/tag-group-chooser.js.es6
index 71d2343b349..2843ee1e0c3 100644
--- a/app/assets/javascripts/select-kit/components/tag-group-chooser.js.es6
+++ b/app/assets/javascripts/select-kit/components/tag-group-chooser.js.es6
@@ -27,7 +27,10 @@ export default MultiSelectComponent.extend(TagsMixin, {
},
mutateValues(values) {
- this.set("tagGroups", values.filter(v => v));
+ this.set(
+ "tagGroups",
+ values.filter(v => v)
+ );
},
@discourseComputed("tagGroups")
diff --git a/app/assets/javascripts/select-kit/mixins/dom-helpers.js.es6 b/app/assets/javascripts/select-kit/mixins/dom-helpers.js.es6
index 8de81dc5954..42c79a1f445 100644
--- a/app/assets/javascripts/select-kit/mixins/dom-helpers.js.es6
+++ b/app/assets/javascripts/select-kit/mixins/dom-helpers.js.es6
@@ -187,7 +187,7 @@ export default Mixin.create({
const offsetBottom = this.element.getBoundingClientRect().bottom;
const windowWidth = $(window).width();
- if (this.fullWidthOnMobile && (this.site && this.site.isMobileDevice)) {
+ if (this.fullWidthOnMobile && this.site && this.site.isMobileDevice) {
const margin = 10;
const relativeLeft =
$(this.element).offset().left - $(window).scrollLeft();
diff --git a/test/javascripts/acceptance/group-requests-test.js.es6 b/test/javascripts/acceptance/group-requests-test.js.es6
index 132ba3f0f2a..3e9c189dc70 100644
--- a/test/javascripts/acceptance/group-requests-test.js.es6
+++ b/test/javascripts/acceptance/group-requests-test.js.es6
@@ -126,5 +126,8 @@ QUnit.test("Group Requests", async assert => {
.trim(),
"denied"
);
- assert.deepEqual(requests, [["19", "true"], ["20", undefined]]);
+ assert.deepEqual(requests, [
+ ["19", "true"],
+ ["20", undefined]
+ ]);
});
diff --git a/test/javascripts/components/combo-box-test.js.es6 b/test/javascripts/components/combo-box-test.js.es6
index 94987dbb910..f943e2b05db 100644
--- a/test/javascripts/components/combo-box-test.js.es6
+++ b/test/javascripts/components/combo-box-test.js.es6
@@ -11,7 +11,10 @@ moduleForComponent("combo-box", {
componentTest("default", {
template: "{{combo-box content=items}}",
beforeEach() {
- this.set("items", [{ id: 1, name: "hello" }, { id: 2, name: "world" }]);
+ this.set("items", [
+ { id: 1, name: "hello" },
+ { id: 2, name: "world" }
+ ]);
},
async test(assert) {
@@ -43,7 +46,10 @@ componentTest("with valueAttribute", {
componentTest("with nameProperty", {
template: '{{combo-box content=items nameProperty="text"}}',
beforeEach() {
- this.set("items", [{ id: 0, text: "hello" }, { id: 1, text: "world" }]);
+ this.set("items", [
+ { id: 0, text: "hello" },
+ { id: 1, text: "world" }
+ ]);
},
async test(assert) {
diff --git a/test/javascripts/components/multi-select-test.js.es6 b/test/javascripts/components/multi-select-test.js.es6
index 62c1c09e5e7..a012e78ce36 100644
--- a/test/javascripts/components/multi-select-test.js.es6
+++ b/test/javascripts/components/multi-select-test.js.es6
@@ -14,7 +14,10 @@ componentTest("with objects and values", {
template: "{{multi-select content=items values=values}}",
beforeEach() {
- this.set("items", [{ id: 1, name: "hello" }, { id: 2, name: "world" }]);
+ this.set("items", [
+ { id: 1, name: "hello" },
+ { id: 2, name: "world" }
+ ]);
this.set("values", [1, 2]);
},
diff --git a/test/javascripts/components/single-select-test.js.es6 b/test/javascripts/components/single-select-test.js.es6
index 22fab0a4f9e..24a472621f8 100644
--- a/test/javascripts/components/single-select-test.js.es6
+++ b/test/javascripts/components/single-select-test.js.es6
@@ -33,7 +33,10 @@ componentTest("accepts a value by reference", {
beforeEach() {
this.set("value", 1);
- this.set("content", [{ id: 1, name: "robin" }, { id: 2, name: "regis" }]);
+ this.set("content", [
+ { id: 1, name: "robin" },
+ { id: 2, name: "regis" }
+ ]);
},
async test(assert) {
@@ -148,7 +151,10 @@ componentTest("dynamic headerText", {
template: "{{single-select value=1 content=content}}",
beforeEach() {
- this.set("content", [{ id: 1, name: "robin" }, { id: 2, name: "regis" }]);
+ this.set("content", [
+ { id: 1, name: "robin" },
+ { id: 2, name: "regis" }
+ ]);
},
async test(assert) {
@@ -246,7 +252,10 @@ componentTest("supports keyboard events", {
template: "{{single-select content=content filterable=true}}",
beforeEach() {
- this.set("content", [{ id: 1, name: "robin" }, { id: 2, name: "regis" }]);
+ this.set("content", [
+ { id: 1, name: "robin" },
+ { id: 2, name: "regis" }
+ ]);
},
skip: true,
diff --git a/test/javascripts/controllers/topic-test.js.es6 b/test/javascripts/controllers/topic-test.js.es6
index e48105a67c3..4ae05626666 100644
--- a/test/javascripts/controllers/topic-test.js.es6
+++ b/test/javascripts/controllers/topic-test.js.es6
@@ -324,7 +324,10 @@ QUnit.test("canChangeOwner", function(assert) {
this.registry.injection("controller", "currentUser", "current-user:main");
const postStream = {
- posts: [{ id: 1, username: "gary" }, { id: 2, username: "lili" }],
+ posts: [
+ { id: 1, username: "gary" },
+ { id: 2, username: "lili" }
+ ],
stream: [1, 2]
};
diff --git a/test/javascripts/models/post-stream-test.js.es6 b/test/javascripts/models/post-stream-test.js.es6
index fb90fdb8b41..40b5f87af59 100644
--- a/test/javascripts/models/post-stream-test.js.es6
+++ b/test/javascripts/models/post-stream-test.js.es6
@@ -141,7 +141,11 @@ QUnit.test("closestPostNumberFor", assert => {
QUnit.test("closestDaysAgoFor", assert => {
const postStream = buildStream(1231);
- postStream.set("timelineLookup", [[1, 10], [3, 8], [5, 1]]);
+ postStream.set("timelineLookup", [
+ [1, 10],
+ [3, 8],
+ [5, 1]
+ ]);
assert.equal(postStream.closestDaysAgoFor(1), 10);
assert.equal(postStream.closestDaysAgoFor(2), 10);