|
| 1 | +/* global trackEvent */ |
1 | 2 | /* eslint-disable no-extra-semi */ |
2 | 3 | ;(function (alertsService) { |
3 | 4 |
|
|
107 | 108 | } |
108 | 109 | } |
109 | 110 |
|
110 | | - function resetSplitting(dontRecreate) { |
| 111 | + function resetSplitting() { |
111 | 112 | if (codeSplitInstance) { |
112 | 113 | codeSplitInstance.destroy(); |
113 | 114 | } |
|
170 | 171 | function updateExternalLibUi() { |
171 | 172 | // Calculate no. of external libs |
172 | 173 | var noOfExternalLibs = 0; |
173 | | - noOfExternalLibs += externalJsTextarea.value.split('\n').filter(lib => !!lib).length; |
174 | | - noOfExternalLibs += externalCssTextarea.value.split('\n').filter(lib => !!lib).length; |
| 174 | + noOfExternalLibs += externalJsTextarea.value.split('\n').filter((lib) => !!lib).length; |
| 175 | + noOfExternalLibs += externalCssTextarea.value.split('\n').filter((lib) => !!lib).length; |
175 | 176 | if (noOfExternalLibs) { |
176 | 177 | $('#js-external-lib-count').textContent = noOfExternalLibs; |
177 | 178 | $('#js-external-lib-count').style.display = 'inline'; |
|
223 | 224 | var sizes; |
224 | 225 | try { |
225 | 226 | sizes = [ |
226 | | - +htmlCode.style[dimensionProperty].match(/([\d\.]+)%/)[1], |
227 | | - +cssCode.style[dimensionProperty].match(/([\d\.]+)%/)[1], |
228 | | - +jsCode.style[dimensionProperty].match(/([\d\.]+)%/)[1] |
| 227 | + +htmlCode.style[dimensionProperty].match(/([\d.]+)%/)[1], |
| 228 | + +cssCode.style[dimensionProperty].match(/([\d.]+)%/)[1], |
| 229 | + +jsCode.style[dimensionProperty].match(/([\d.]+)%/)[1] |
229 | 230 | ]; |
230 | | - } catch(e) { |
| 231 | + } catch (e) { |
231 | 232 | sizes = [ 33.33, 33.33, 33.33 ] |
232 | 233 | } finally { |
233 | 234 |
|
|
279 | 280 | } |
280 | 281 |
|
281 | 282 | savedItems = savedItems || []; |
282 | | - for (var i = 0; i < itemIds.length; i++) { |
283 | | - (function (index) { |
284 | | - chrome.storage.local.get(itemIds[index], function (itemResult) { |
285 | | - savedItems[itemIds[index]] = itemResult[itemIds[index]]; |
286 | | - items.push(itemResult[itemIds[index]]); |
287 | | - // Check if we have all items now. |
288 | | - if (itemIds.length === items.length) { |
289 | | - populateItemsInSavedPane(items); |
290 | | - } |
291 | | - }); |
292 | | - })(i); |
| 283 | + for (let i = 0; i < itemIds.length; i++) { |
| 284 | + |
| 285 | + /* eslint-disable no-loop-func */ |
| 286 | + chrome.storage.local.get(itemIds[i], function (itemResult) { |
| 287 | + savedItems[itemIds[i]] = itemResult[itemIds[i]]; |
| 288 | + items.push(itemResult[itemIds[i]]); |
| 289 | + // Check if we have all items now. |
| 290 | + if (itemIds.length === items.length) { |
| 291 | + populateItemsInSavedPane(items); |
| 292 | + } |
| 293 | + }); |
| 294 | + |
| 295 | + /* eslint-enable no-loop-func */ |
293 | 296 | } |
294 | 297 | }); |
295 | 298 | } |
|
526 | 529 | } |
527 | 530 |
|
528 | 531 | function getCompleteHtml(html, css, js) { |
529 | | - var externalJs = externalJsTextarea.value.split('\n').reduce(function (html, url) { |
530 | | - return html + (url ? '\n<script src="' + url + '"></script>' : ''); |
| 532 | + var externalJs = externalJsTextarea.value.split('\n').reduce(function (scripts, url) { |
| 533 | + return scripts + (url ? '\n<script src="' + url + '"></script>' : ''); |
531 | 534 | }, ''); |
532 | | - var externalCss = externalCssTextarea.value.split('\n').reduce(function (html, url) { |
533 | | - return html + (url ? '\n<link rel="stylesheet" href="' + url + '"></link>' : ''); |
| 535 | + var externalCss = externalCssTextarea.value.split('\n').reduce(function (links, url) { |
| 536 | + return links + (url ? '\n<link rel="stylesheet" href="' + url + '"></link>' : ''); |
534 | 537 | }, ''); |
535 | 538 | var contents = '<html>\n<head>\n' |
536 | 539 | + externalCss + '\n' |
|
0 commit comments