ep_comments_page 0.1.97 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,334 +1,298 @@
1
1
  'use strict';
2
2
 
3
- describe('ep_comments_page - Comment icons', function () {
4
- // create a new pad with comment before each test run
5
- beforeEach(async function () {
6
- await new Promise((resolve) => helper.newPad(resolve));
7
- // make sure Etherpad has enough space to display comment icons
8
- enlargeScreen();
9
- // force sidebar comments to be shown
10
- chooseToShowComments(true);
11
- await createComment();
12
- this.timeout(60000);
13
- });
3
+ let freshPad = true;
14
4
 
15
- after(async function () {
16
- // undo frame resize that was done on before()
17
- $('#iframe-container iframe').css('max-width', '');
18
- });
5
+ before(async function () {
6
+ await helper.aNewPad();
7
+ // #commentIcons will only be inserted if icons are enabled
8
+ if (!helper.padChrome$.window.clientVars.displayCommentAsIcon) this.skip();
9
+ });
19
10
 
20
- it('adds a comment icon on the same height of commented text', async function () {
21
- // we only run test if icons are enabled
22
- await finishTestIfIconsAreNotEnabled(async () => {
23
- const inner$ = helper.padInner$;
24
- const outer$ = helper.padOuter$;
25
- const commentId = await getCommentId();
26
- const $commentIcon = outer$(`#commentIcons #icon-${commentId}`);
27
-
28
- // check icon exists
29
- expect($commentIcon.length).to.be(1);
30
-
31
- // check height is the same
32
- const $commentedText = inner$(`.${commentId}`);
33
- // all icons are +5px down to adjust position
34
- const expectedTop = $commentedText.offset().top + 5;
35
- expect($commentIcon.offset().top).to.be(expectedTop);
36
- });
37
- });
38
- // TODO: Needs fixing
39
- xit('does not show comment icon when commented text is removed', async function () {
40
- // we only run test if icons are enabled
41
- await finishTestIfIconsAreNotEnabled(async () => {
42
- const inner$ = helper.padInner$;
43
- const outer$ = helper.padOuter$;
44
- // remove commented text
45
- const $commentedLine = inner$('div .comment').parent();
46
- $commentedLine.sendkeys('{selectall}'); // select all
47
- $commentedLine.sendkeys('{del}'); // clear the first line
48
- // wait until comment deletion is done
49
- await helper.waitForPromise(() => {
50
- // check icon is not visible
51
- const $commentIcons = outer$('#commentIcons .comment-icon:visible');
52
- return $commentIcons.length === 0;
53
- });
54
- });
55
- });
56
- // TODO: Needs fixing
57
- xit('does not show comment icon when comment is deleted', async function () {
58
- // we only run test if icons are enabled
59
- await finishTestIfIconsAreNotEnabled(async () => {
60
- const outer$ = helper.padOuter$;
61
-
62
- await deleteComment();
63
- // check icon is not visible
64
- const $commentIcons = outer$('#commentIcons .comment-icon:visible');
65
- expect($commentIcons.length).to.be(0);
66
- });
11
+ // create a new pad with comment before each test run
12
+ beforeEach(async function () {
13
+ this.timeout(60000);
14
+ if (!freshPad) await helper.aNewPad();
15
+ freshPad = false;
16
+ // make sure Etherpad has enough space to display comment icons
17
+ enlargeScreen();
18
+ // force sidebar comments to be shown
19
+ chooseToShowComments(true);
20
+ await createComment();
21
+ });
22
+
23
+ after(async function () {
24
+ // undo frame resize that was done on before()
25
+ $('#iframe-container iframe').css('max-width', '');
26
+ });
27
+
28
+ it('adds a comment icon on the same height of commented text', async function () {
29
+ const inner$ = helper.padInner$;
30
+ const outer$ = helper.padOuter$;
31
+ const commentId = await getCommentId();
32
+ const $commentIcon = outer$(`#commentIcons #icon-${commentId}`);
33
+
34
+ // check icon exists
35
+ expect($commentIcon.length).to.be(1);
36
+
37
+ // check height is the same
38
+ const $commentedText = inner$(`.${commentId}`);
39
+ // all icons are +5px down to adjust position
40
+ const expectedTop = $commentedText.offset().top + 5;
41
+ expect($commentIcon.offset().top).to.be(expectedTop);
42
+ });
43
+ // TODO: Needs fixing
44
+ xit('does not show comment icon when commented text is removed', async function () {
45
+ const inner$ = helper.padInner$;
46
+ const outer$ = helper.padOuter$;
47
+ // remove commented text
48
+ const $commentedLine = inner$('div .comment').parent();
49
+ $commentedLine.sendkeys('{selectall}'); // select all
50
+ $commentedLine.sendkeys('{del}'); // clear the first line
51
+ // wait until comment deletion is done
52
+ await helper.waitForPromise(() => {
53
+ // check icon is not visible
54
+ const $commentIcons = outer$('#commentIcons .comment-icon:visible');
55
+ return $commentIcons.length === 0;
67
56
  });
57
+ });
58
+ // TODO: Needs fixing
59
+ xit('does not show comment icon when comment is deleted', async function () {
60
+ const outer$ = helper.padOuter$;
61
+
62
+ await deleteComment();
63
+ // check icon is not visible
64
+ const $commentIcons = outer$('#commentIcons .comment-icon:visible');
65
+ expect($commentIcons.length).to.be(0);
66
+ });
68
67
 
69
- it('updates comment icon height when commented text is moved to another line', async function () {
70
- // we only run test if icons are enabled
71
- // don't run this test in safari. borrowed from
72
- // https://stackoverflow.com/questions/7944460/detect-safari-browser
73
- const ua = navigator.userAgent.toLowerCase();
74
- if (ua.indexOf('safari') !== -1) {
75
- if (ua.indexOf('chrome') > -1) {
76
- // Chrome
77
- } else {
78
- return this.skip();
79
- }
68
+ it('updates comment icon height when commented text is moved to another line', async function () {
69
+ // don't run this test in safari. borrowed from
70
+ // https://stackoverflow.com/questions/7944460/detect-safari-browser
71
+ const ua = navigator.userAgent.toLowerCase();
72
+ if (ua.indexOf('safari') !== -1) {
73
+ if (ua.indexOf('chrome') > -1) {
74
+ // Chrome
75
+ } else {
76
+ return this.skip();
80
77
  }
78
+ }
81
79
 
82
- await finishTestIfIconsAreNotEnabled(async () => {
83
- const inner$ = helper.padInner$;
84
- const outer$ = helper.padOuter$;
85
- const commentId = await getCommentId();
86
-
87
- // adds some new lines on the beginning of the text
88
- const $firstTextElement = inner$('div').first();
89
- $firstTextElement.sendkeys('{leftarrow}{enter}{enter}');
90
-
91
- // wait until the new lines are split into separated .ace-line's
92
- await helper.waitForPromise(() => inner$('div').length > 2);
93
-
94
- // wait until comment is visible again
95
- await helper.waitForPromise(() => {
96
- const $commentIcons = outer$('#commentIcons .comment-icon:visible');
97
- return $commentIcons.length !== 0;
98
- });
99
-
100
- // check height is the same
101
- const $commentIcon = outer$(`#commentIcons #icon-${commentId}`);
102
- const $commentedText = inner$(`.${commentId}`);
103
- // all icons are +5px down to adjust position
104
- const expectedTop = $commentedText.offset().top + 5;
105
- expect($commentIcon.offset().top).to.be(expectedTop);
106
- });
107
- });
80
+ const inner$ = helper.padInner$;
81
+ const outer$ = helper.padOuter$;
82
+ const commentId = await getCommentId();
108
83
 
109
- it('shows comment when user clicks on comment icon', async function () {
110
- // we only run test if icons are enabled
111
- await finishTestIfIconsAreNotEnabled(async () => {
112
- const outer$ = helper.padOuter$;
113
- const commentId = await getCommentId();
84
+ // adds some new lines on the beginning of the text
85
+ const $firstTextElement = inner$('div').first();
86
+ $firstTextElement.sendkeys('{leftarrow}{enter}{enter}');
114
87
 
115
- // click on the icon
116
- const $commentIcon = outer$(`#commentIcons #icon-${commentId}`).first();
117
- $commentIcon.click();
88
+ // wait until the new lines are split into separated .ace-line's
89
+ await helper.waitForPromise(() => inner$('div').length > 2);
118
90
 
119
- // check sidebar comment is visible
120
- const $openedSidebarComments = outer$('#comments .sidebar-comment:visible');
121
- expect($openedSidebarComments.length).to.be(1);
122
- });
91
+ // wait until comment is visible again
92
+ await helper.waitForPromise(() => {
93
+ const $commentIcons = outer$('#commentIcons .comment-icon:visible');
94
+ return $commentIcons.length !== 0;
123
95
  });
124
96
 
125
- it('hides comment when user clicks on comment icon twice', async function () {
126
- // don't run this test in safari. borrowed from
127
- // https://stackoverflow.com/questions/7944460/detect-safari-browser
128
- const ua = navigator.userAgent.toLowerCase();
129
- if (ua.indexOf('safari') !== -1) {
130
- if (ua.indexOf('chrome') > -1) {
131
- // Chrome
132
- } else {
133
- return this.skip();
134
- }
97
+ // check height is the same
98
+ const $commentIcon = outer$(`#commentIcons #icon-${commentId}`);
99
+ const $commentedText = inner$(`.${commentId}`);
100
+ // all icons are +5px down to adjust position
101
+ const expectedTop = $commentedText.offset().top + 5;
102
+ expect($commentIcon.offset().top).to.be(expectedTop);
103
+ });
104
+
105
+ it('shows comment when user clicks on comment icon', async function () {
106
+ const outer$ = helper.padOuter$;
107
+ const commentId = await getCommentId();
108
+
109
+ // click on the icon
110
+ const $commentIcon = outer$(`#commentIcons #icon-${commentId}`).first();
111
+ $commentIcon.click();
112
+
113
+ // check sidebar comment is visible
114
+ const $openedSidebarComments = outer$('#comments .sidebar-comment:visible');
115
+ expect($openedSidebarComments.length).to.be(1);
116
+ });
117
+
118
+ it('hides comment when user clicks on comment icon twice', async function () {
119
+ // don't run this test in safari. borrowed from
120
+ // https://stackoverflow.com/questions/7944460/detect-safari-browser
121
+ const ua = navigator.userAgent.toLowerCase();
122
+ if (ua.indexOf('safari') !== -1) {
123
+ if (ua.indexOf('chrome') > -1) {
124
+ // Chrome
125
+ } else {
126
+ return this.skip();
135
127
  }
128
+ }
136
129
 
137
- // we only run test if icons are enabled
138
- await finishTestIfIconsAreNotEnabled(async () => {
139
- const outer$ = helper.padOuter$;
140
- const commentId = await getCommentId();
130
+ const outer$ = helper.padOuter$;
131
+ const commentId = await getCommentId();
141
132
 
142
- // click on the icon to open, then click again to close
143
- const $commentIcon = outer$(`#commentIcons #icon-${commentId}`).first();
144
- $commentIcon.click();
145
- $commentIcon.click();
133
+ // click on the icon to open, then click again to close
134
+ const $commentIcon = outer$(`#commentIcons #icon-${commentId}`).first();
135
+ $commentIcon.click();
136
+ $commentIcon.click();
146
137
 
147
- // check sidebar comment is not visible
148
- const $openedSidebarComments = outer$('#comments .sidebar-comment:visible');
149
- expect($openedSidebarComments.length).to.be(0);
150
- });
151
- });
138
+ // check sidebar comment is not visible
139
+ const $openedSidebarComments = outer$('#comments .sidebar-comment:visible');
140
+ expect($openedSidebarComments.length).to.be(0);
141
+ });
152
142
 
153
- it('hides comment when user clicks outside of comment box', async function () {
154
- // don't run this test in safari. borrowed from
155
- // https://stackoverflow.com/questions/7944460/detect-safari-browser
156
- const ua = navigator.userAgent.toLowerCase();
157
- if (ua.indexOf('safari') !== -1) {
158
- if (ua.indexOf('chrome') > -1) {
159
- // Chrome
160
- } else {
161
- return this.skip();
162
- }
143
+ it('hides comment when user clicks outside of comment box', async function () {
144
+ // don't run this test in safari. borrowed from
145
+ // https://stackoverflow.com/questions/7944460/detect-safari-browser
146
+ const ua = navigator.userAgent.toLowerCase();
147
+ if (ua.indexOf('safari') !== -1) {
148
+ if (ua.indexOf('chrome') > -1) {
149
+ // Chrome
150
+ } else {
151
+ return this.skip();
163
152
  }
153
+ }
164
154
 
165
- // we only run test if icons are enabled
166
- await finishTestIfIconsAreNotEnabled(async () => {
167
- const outer$ = helper.padOuter$;
168
- const commentId = await getCommentId();
155
+ const outer$ = helper.padOuter$;
156
+ const commentId = await getCommentId();
169
157
 
170
- // click on the icon to open
171
- const $commentIcon = outer$(`#commentIcons #icon-${commentId}`).first();
172
- $commentIcon.click();
158
+ // click on the icon to open
159
+ const $commentIcon = outer$(`#commentIcons #icon-${commentId}`).first();
160
+ $commentIcon.click();
173
161
 
174
- // click outside the comment to hide it
175
- outer$('#outerdocbody').click();
162
+ // click outside the comment to hide it
163
+ outer$('#outerdocbody').click();
176
164
 
177
- // check sidebar comment is not visible
178
- const $openedSidebarComments = outer$('#comments .sidebar-comment:visible');
179
- expect($openedSidebarComments.length).to.be(0);
180
- });
181
- });
165
+ // check sidebar comment is not visible
166
+ const $openedSidebarComments = outer$('#comments .sidebar-comment:visible');
167
+ expect($openedSidebarComments.length).to.be(0);
168
+ });
182
169
 
183
- it('hides 1st, shows 2nd comment when user clicks on one then another icon', async function () {
184
- // don't run this test in safari. borrowed from
185
- // https://stackoverflow.com/questions/7944460/detect-safari-browser
186
- const ua = navigator.userAgent.toLowerCase();
187
- if (ua.indexOf('safari') !== -1) {
188
- if (ua.indexOf('chrome') > -1) {
189
- // Chrome
190
- } else {
191
- return this.skip();
192
- }
170
+ it('hides 1st, shows 2nd comment when user clicks on one then another icon', async function () {
171
+ // don't run this test in safari. borrowed from
172
+ // https://stackoverflow.com/questions/7944460/detect-safari-browser
173
+ const ua = navigator.userAgent.toLowerCase();
174
+ if (ua.indexOf('safari') !== -1) {
175
+ if (ua.indexOf('chrome') > -1) {
176
+ // Chrome
177
+ } else {
178
+ return this.skip();
193
179
  }
180
+ }
194
181
 
195
- // we only run test if icons are enabled
196
- await finishTestIfIconsAreNotEnabled(async () => {
197
- const inner$ = helper.padInner$;
198
- const outer$ = helper.padOuter$;
199
-
200
- // add a second line...
201
- const $lastTextElement = inner$('div').last();
202
- $lastTextElement.sendkeys('Second line{enter}');
203
-
204
- // wait until the new line is split into a separated .ace-line
205
- await helper.waitForPromise(() => inner$('div').length > 2);
206
-
207
- // ... then add a comment to second line
208
- const $secondLine = inner$('div').eq(1);
209
- $secondLine.sendkeys('{selectall}');
210
- await addComment('Second Comment');
211
-
212
- // click on the icon of first comment...
213
- const $firstCommentIcon = outer$(`#commentIcons #icon-${await getCommentId(0)}`).first();
214
- $firstCommentIcon.click();
215
- // ... then click on the icon of last comment
216
- const $secondCommentIcon = outer$(`#commentIcons #icon-${await getCommentId(1)}`).first();
217
- $secondCommentIcon.click();
218
-
219
- // check modal is visible
220
- const $commentText = outer$('#comments .sidebar-comment:visible .comment-text').text();
221
- expect($commentText).to.be('Second Comment');
222
- });
223
- });
182
+ const inner$ = helper.padInner$;
183
+ const outer$ = helper.padOuter$;
184
+
185
+ // add a second line...
186
+ const $lastTextElement = inner$('div').last();
187
+ $lastTextElement.sendkeys('Second line{enter}');
188
+
189
+ // wait until the new line is split into a separated .ace-line
190
+ await helper.waitForPromise(() => inner$('div').length > 2);
224
191
 
225
- /* ********** Helper functions ********** */
226
-
227
- const createComment = async () => {
228
- const inner$ = helper.padInner$;
229
-
230
- // get the first text element out of the inner iframe
231
- const $firstTextElement = inner$('div').first();
232
-
233
- // simulate key presses to delete content
234
- $firstTextElement.sendkeys('{selectall}'); // select all
235
- $firstTextElement.sendkeys('{del}'); // clear the first line
236
- $firstTextElement.sendkeys('This content will receive a comment{enter}'); // insert text
237
- // wait until the two lines are split into two .ace-line's
238
- await helper.waitForPromise(() => inner$('div').length > 1);
239
-
240
- // add comment to last line of the text
241
- const $lastTextElement = inner$('div').first();
242
- $lastTextElement.sendkeys('{selectall}'); // need to select content to add comment to
243
-
244
- await addComment('My comment');
245
- };
246
-
247
- // Assumes text is already selected, then add comment to the selected text
248
- const addComment = async (commentText) => {
249
- const inner$ = helper.padInner$;
250
- const chrome$ = helper.padChrome$;
251
-
252
- // get original number of comments, so can check if a new comment was created
253
- const numberOfComments = inner$('.comment:visible').length;
254
-
255
- // get the comment button and click it
256
- const $commentButton = chrome$('.addComment');
257
- $commentButton.click();
258
-
259
- // fill the comment form and submit it
260
- const $commentField = chrome$('textarea.comment-content');
261
- $commentField.val(commentText);
262
- // we don't need comment suggestion to be filled for these tests, but here's how to do it:
263
- // var $hasSuggestion = outer$(".suggestion-checkbox");
264
- // $hasSuggestion.click();
265
- // var $suggestionField = outer$("textarea.to-value");
266
- // $suggestionField.val("Change to this suggestion");
267
- const $submittButton = chrome$('.comment-buttons input[type=submit]');
268
- $submittButton.click();
269
-
270
- // wait until comment is created and comment id is set
271
- let running = false;
272
- let success = false;
273
- await helper.waitForPromise(() => {
274
- if (success) return true;
275
- if (!running) {
276
- running = true;
277
- getCommentId(numberOfComments).then((id) => {
278
- running = false;
279
- success = id != null;
280
- });
281
- }
282
- return success;
283
- });
284
- };
285
-
286
- const deleteComment = async () => {
287
- const chrome$ = helper.padChrome$;
288
- const outer$ = helper.padOuter$;
289
-
290
- // click on the delete button
291
- const $deleteButton = outer$('.comment-delete');
292
- $deleteButton.click();
293
-
294
- await helper.waitForPromise(() => chrome$('.sidebar-comment').is(':visible') === false);
295
- };
296
-
297
-
298
- const getCommentId = async (numberOfComments) => {
299
- const nthComment = numberOfComments || 0;
300
- const p = helper.waitFor(() => helper.padInner$);
301
- p.fail(() => {}); // Prevent p from throwing an uncatchable exception on error.
302
- await p;
303
- const inner$ = helper.padInner$;
304
- const comment = inner$('.comment').eq(nthComment);
305
- const cls = comment.attr('class');
306
- const classCommentId = /(?:^| )(c-[A-Za-z0-9]*)/.exec(cls);
307
- const commentId = (classCommentId) ? classCommentId[1] : null;
308
- return commentId;
309
- };
310
-
311
- const finishTestIfIconsAreNotEnabled = async (theTest) => {
312
- // #commentIcons will only be inserted if icons are enabled
313
- if (helper.padOuter$('#commentIcons').length !== 0) await theTest();
314
- };
315
-
316
- const chooseToShowComments = (shouldShowComments) => {
317
- const chrome$ = helper.padChrome$;
318
-
319
- // click on the settings button to make settings visible
320
- const $settingsButton = chrome$('.buttonicon-settings');
321
- $settingsButton.click();
322
-
323
- // check "Show Comments"
324
- const $showComments = chrome$('#options-comments');
325
- if ($showComments.is(':checked') !== shouldShowComments) $showComments.click();
326
-
327
- // hide settings again
328
- $settingsButton.click();
329
- };
330
-
331
- const enlargeScreen = () => {
332
- $('#iframe-container iframe').css('max-width', '1000px');
333
- };
192
+ // ... then add a comment to second line
193
+ const $secondLine = inner$('div').eq(1);
194
+ $secondLine.sendkeys('{selectall}');
195
+ await addComment('Second Comment');
196
+
197
+ // click on the icon of first comment...
198
+ const $firstCommentIcon = outer$(`#commentIcons #icon-${await getCommentId(0)}`).first();
199
+ $firstCommentIcon.click();
200
+ // ... then click on the icon of last comment
201
+ const $secondCommentIcon = outer$(`#commentIcons #icon-${await getCommentId(1)}`).first();
202
+ $secondCommentIcon.click();
203
+
204
+ // check modal is visible
205
+ const $commentText = outer$('#comments .sidebar-comment:visible .comment-text').text();
206
+ expect($commentText).to.be('Second Comment');
334
207
  });
208
+
209
+ /* ********** Helper functions ********** */
210
+
211
+ const createComment = async () => {
212
+ const inner$ = helper.padInner$;
213
+
214
+ // get the first text element out of the inner iframe
215
+ const $firstTextElement = inner$('div').first();
216
+
217
+ // simulate key presses to delete content
218
+ $firstTextElement.sendkeys('{selectall}'); // select all
219
+ $firstTextElement.sendkeys('{del}'); // clear the first line
220
+ $firstTextElement.sendkeys('This content will receive a comment{enter}'); // insert text
221
+ // wait until the two lines are split into two .ace-line's
222
+ await helper.waitForPromise(() => inner$('div').length > 1);
223
+
224
+ // add comment to last line of the text
225
+ const $lastTextElement = inner$('div').first();
226
+ $lastTextElement.sendkeys('{selectall}'); // need to select content to add comment to
227
+
228
+ await addComment('My comment');
229
+ };
230
+
231
+ // Assumes text is already selected, then add comment to the selected text
232
+ const addComment = async (commentText) => {
233
+ const inner$ = helper.padInner$;
234
+ const chrome$ = helper.padChrome$;
235
+
236
+ // get original number of comments, so can check if a new comment was created
237
+ const numberOfComments = inner$('.comment:visible').length;
238
+
239
+ // get the comment button and click it
240
+ const $commentButton = chrome$('.addComment');
241
+ $commentButton.click();
242
+
243
+ // fill the comment form and submit it
244
+ const $commentField = chrome$('textarea.comment-content');
245
+ $commentField.val(commentText);
246
+ // we don't need comment suggestion to be filled for these tests, but here's how to do it:
247
+ // var $hasSuggestion = outer$(".suggestion-checkbox");
248
+ // $hasSuggestion.click();
249
+ // var $suggestionField = outer$("textarea.to-value");
250
+ // $suggestionField.val("Change to this suggestion");
251
+ const $submittButton = chrome$('.comment-buttons input[type=submit]');
252
+ $submittButton.click();
253
+
254
+ // wait until comment is created and comment id is set
255
+ await helper.waitForPromise(async () => await getCommentId(numberOfComments) != null);
256
+ };
257
+
258
+ const deleteComment = async () => {
259
+ const chrome$ = helper.padChrome$;
260
+ const outer$ = helper.padOuter$;
261
+
262
+ // click on the delete button
263
+ const $deleteButton = outer$('.comment-delete');
264
+ $deleteButton.click();
265
+
266
+ await helper.waitForPromise(() => chrome$('.sidebar-comment').is(':visible') === false);
267
+ };
268
+
269
+
270
+ const getCommentId = async (numberOfComments) => {
271
+ const nthComment = numberOfComments || 0;
272
+ await helper.waitForPromise(() => helper.padInner$);
273
+ const inner$ = helper.padInner$;
274
+ const comment = inner$('.comment').eq(nthComment);
275
+ const cls = comment.attr('class');
276
+ const classCommentId = /(?:^| )(c-[A-Za-z0-9]*)/.exec(cls);
277
+ const commentId = (classCommentId) ? classCommentId[1] : null;
278
+ return commentId;
279
+ };
280
+
281
+ const chooseToShowComments = (shouldShowComments) => {
282
+ const chrome$ = helper.padChrome$;
283
+
284
+ // click on the settings button to make settings visible
285
+ const $settingsButton = chrome$('.buttonicon-settings');
286
+ $settingsButton.click();
287
+
288
+ // check "Show Comments"
289
+ const $showComments = chrome$('#options-comments');
290
+ if ($showComments.is(':checked') !== shouldShowComments) $showComments.click();
291
+
292
+ // hide settings again
293
+ $settingsButton.click();
294
+ };
295
+
296
+ const enlargeScreen = () => {
297
+ $('#iframe-container iframe').css('max-width', '1000px');
298
+ };