diff --git a/client/js/controllers/posts_controller.js b/client/js/controllers/posts_controller.js index bf61fc2..4dbdae2 100644 --- a/client/js/controllers/posts_controller.js +++ b/client/js/controllers/posts_controller.js @@ -51,7 +51,8 @@ class PostsController { requestPage: pageController.createHistoryCacheProxy( ctx, page => { - const text = this._decorateSearchQuery(ctx.searchQuery.text); + const text + = this._decorateSearchQuery(ctx.searchQuery.text); return api.get( `/posts/?query=${text}&page=${page}&pageSize=40` + '&fields=id,type,tags,score,favoriteCount,' + @@ -69,8 +70,8 @@ class PostsController { topNavController.activate('posts'); Promise.all([ api.get('/post/' + id), - api.get(`/post/${id}/around?fields=id&query=` - + this._decorateSearchQuery('')), + api.get(`/post/${id}/around?fields=id&query=` + + this._decorateSearchQuery('')), ]).then(responses => { const [postResponse, aroundResponse] = responses; this._postView.render({ diff --git a/client/js/controllers/tags_controller.js b/client/js/controllers/tags_controller.js index 4083828..a5fa50d 100644 --- a/client/js/controllers/tags_controller.js +++ b/client/js/controllers/tags_controller.js @@ -212,8 +212,9 @@ class TagsController { page => { const text = ctx.searchQuery.text; return api.get( - `/tags/?query=${text}&page=${page}&pageSize=50&fields=` + - `names,suggestions,implications,lastEditTime,usages`); + `/tags/?query=${text}&page=${page}&pageSize=50` + + '&fields=names,suggestions,implications,' + + 'lastEditTime,usages'); }), headerRenderer: this._tagsHeaderView, pageRenderer: this._tagsPageView, diff --git a/client/js/controls/comment_form_control.js b/client/js/controls/comment_form_control.js index 94e6fdc..930d13e 100644 --- a/client/js/controls/comment_form_control.js +++ b/client/js/controls/comment_form_control.js @@ -62,8 +62,8 @@ class CommentFormControl { this._hostNode.querySelector('.tabs-wrapper').style.minHeight = null; misc.disableExitConfirmation(); views.clearMessages(this._hostNode); - this._hostNode.querySelector('.edit.tab textarea').value - = this._comment.text; + this._hostNode.querySelector('.edit.tab textarea').value = + this._comment.text; } get _textareaNode() { @@ -85,8 +85,8 @@ class CommentFormControl { _evtPreviewClick(e) { e.preventDefault(); - this._contentNode.innerHTML - = misc.formatMarkdown(this._textareaNode.value); + this._contentNode.innerHTML = + misc.formatMarkdown(this._textareaNode.value); this._freezeTabHeights(); this._selectTab('preview'); } @@ -124,8 +124,8 @@ class CommentFormControl { } _growTextArea() { - this._textareaNode.style.height - = Math.max( + this._textareaNode.style.height = + Math.max( this._settings.minHeight || 0, this._textareaNode.scrollHeight) + 'px'; } diff --git a/client/js/controls/file_dropper_control.js b/client/js/controls/file_dropper_control.js index c5b5360..46bee77 100644 --- a/client/js/controls/file_dropper_control.js +++ b/client/js/controls/file_dropper_control.js @@ -38,7 +38,7 @@ class FileDropperControl { files.map(file => file.name).join(', '); } this._options.resolve(files); - }; + } _evtFileChange(e) { this._resolve(e.target.files); diff --git a/client/js/controls/post_notes_overlay_control.js b/client/js/controls/post_notes_overlay_control.js index b09bb3d..2826236 100644 --- a/client/js/controls/post_notes_overlay_control.js +++ b/client/js/controls/post_notes_overlay_control.js @@ -15,8 +15,8 @@ class PostNotesOverlayControl { const bodyRect = document.body.getBoundingClientRect(); const svgRect = this._svgNode.getBoundingClientRect(); const polygonRect = e.target.getBBox(); - this._textNode.querySelector('.wrapper').innerHTML - = misc.formatMarkdown(e.target.getAttribute('data-text')); + this._textNode.querySelector('.wrapper').innerHTML = + misc.formatMarkdown(e.target.getAttribute('data-text')); const x = ( -bodyRect.left + svgRect.left + svgRect.width * polygonRect.x); const y = ( @@ -30,9 +30,9 @@ class PostNotesOverlayControl { _evtMouseLeave(e) { const newElement = e.relatedTarget; if (newElement === this._svgNode || - (!this._svgNode.contains(newElement) - && !this._textNode.contains(newElement) - && newElement !== this._textNode)) { + (!this._svgNode.contains(newElement) && + !this._textNode.contains(newElement) && + newElement !== this._textNode)) { this._textNode.style.display = 'none'; } } diff --git a/client/js/controls/post_readonly_sidebar_control.js b/client/js/controls/post_readonly_sidebar_control.js index 4ae8f64..a51925c 100644 --- a/client/js/controls/post_readonly_sidebar_control.js +++ b/client/js/controls/post_readonly_sidebar_control.js @@ -42,12 +42,12 @@ class PostReadonlySidebarControl { })); const upvoteButton = sourceNode.querySelector('.upvote'); - const downvoteButton = sourceNode.querySelector('.downvote') - const addFavButton = sourceNode.querySelector('.add-favorite') + const downvoteButton = sourceNode.querySelector('.downvote'); + const addFavButton = sourceNode.querySelector('.add-favorite'); const remFavButton = sourceNode.querySelector('.remove-favorite'); - const fitBothButton = sourceNode.querySelector('.fit-both') + const fitBothButton = sourceNode.querySelector('.fit-both'); const fitOriginalButton = sourceNode.querySelector('.fit-original'); - const fitWidthButton = sourceNode.querySelector('.fit-width') + const fitWidthButton = sourceNode.querySelector('.fit-width'); const fitHeightButton = sourceNode.querySelector('.fit-height'); if (upvoteButton) { @@ -105,7 +105,7 @@ class PostReadonlySidebarControl { promise().then(() => { this.install(); }); - } + }; } _syncFitButton() { @@ -153,7 +153,7 @@ class PostReadonlySidebarControl { return new Promise((resolve, reject) => { requestPromise() .then( - response => { return api.get('/post/' + this._post.id) }, + response => { return api.get('/post/' + this._post.id); }, response => { return Promise.reject(response); }) .then( response => { diff --git a/client/js/util/misc.js b/client/js/util/misc.js index a952145..1557d36 100644 --- a/client/js/util/misc.js +++ b/client/js/util/misc.js @@ -183,7 +183,7 @@ function unindent(callSite, ...args) { if (size < 0) { size = m1.replace(/\t/g, ' ').length; } - return "\n" + m1.slice(Math.min(m1.length, size)); + return '\n' + m1.slice(Math.min(m1.length, size)); }); } if (typeof callSite === 'string') { diff --git a/client/js/util/polyfill.js b/client/js/util/polyfill.js index 51252c2..0bf68a8 100644 --- a/client/js/util/polyfill.js +++ b/client/js/util/polyfill.js @@ -14,7 +14,7 @@ NodeList.prototype.querySelector = function(...args) { } } return null; -} +}; // non standard Node.prototype.prependChild = function(child) { diff --git a/client/js/views/post_view.js b/client/js/views/post_view.js index 1fe2f36..ce57c61 100644 --- a/client/js/views/post_view.js +++ b/client/js/views/post_view.js @@ -5,12 +5,12 @@ const router = require('../router.js'); const views = require('../util/views.js'); const keyboard = require('../util/keyboard.js'); const PostContentControl = require('../controls/post_content_control.js'); -const PostNotesOverlayControl - = require('../controls/post_notes_overlay_control.js'); -const PostReadonlySidebarControl - = require('../controls/post_readonly_sidebar_control.js'); -const PostEditSidebarControl - = require('../controls/post_edit_sidebar_control.js'); +const PostNotesOverlayControl = + require('../controls/post_notes_overlay_control.js'); +const PostReadonlySidebarControl = + require('../controls/post_readonly_sidebar_control.js'); +const PostEditSidebarControl = + require('../controls/post_edit_sidebar_control.js'); const CommentListControl = require('../controls/comment_list_control.js'); const CommentFormControl = require('../controls/comment_form_control.js'); @@ -33,20 +33,20 @@ class PostView { const postViewNode = document.body.querySelector('.content-wrapper'); const margin = ( - postViewNode.getBoundingClientRect().top - - topNavNode.getBoundingClientRect().height); + postViewNode.getBoundingClientRect().top - + topNavNode.getBoundingClientRect().height); this._postContentControl = new PostContentControl( postContainerNode, ctx.post, () => { return [ - window.innerWidth - - postContainerNode.getBoundingClientRect().left - - margin, - window.innerHeight - - topNavNode.getBoundingClientRect().height - - margin * 2, + window.innerWidth - + postContainerNode.getBoundingClientRect().left - + margin, + window.innerHeight - + topNavNode.getBoundingClientRect().height - + margin * 2, ]; }); diff --git a/client/js/views/posts_header_view.js b/client/js/views/posts_header_view.js index 79537e4..349e339 100644 --- a/client/js/views/posts_header_view.js +++ b/client/js/views/posts_header_view.js @@ -31,8 +31,8 @@ class PostsHeaderView { }); keyboard.bind('p', () => { - const firstPostNode - = document.body.querySelector('.post-list li:first-child a'); + const firstPostNode = + document.body.querySelector('.post-list li:first-child a'); if (firstPostNode) { firstPostNode.focus(); } @@ -53,8 +53,8 @@ class PostsHeaderView { e.target.classList.toggle('disabled'); const safety = e.target.getAttribute('data-safety'); let browsingSettings = settings.getSettings(); - browsingSettings.listPosts[safety] - = !browsingSettings.listPosts[safety]; + browsingSettings.listPosts[safety] = + !browsingSettings.listPosts[safety]; settings.saveSettings(browsingSettings, true); router.show(url.replace(/{page}/, 1)); }