Commit 2aff9760 authored by Donald Cook's avatar Donald Cook

Clarified some frontend code comments

parent 751d82f7
...@@ -31,7 +31,6 @@ export default class BlobFileDropzone { ...@@ -31,7 +31,6 @@ export default class BlobFileDropzone {
autoProcessQueue: false, autoProcessQueue: false,
url: form.attr('action'), url: form.attr('action'),
// Rails uses a hidden input field for PUT // Rails uses a hidden input field for PUT
// http://stackoverflow.com/questions/21056482/how-to-set-method-put-in-form-tag-in-rails
method, method,
clickable: true, clickable: true,
uploadMultiple: false, uploadMultiple: false,
......
...@@ -117,7 +117,6 @@ export const handleLocationHash = () => { ...@@ -117,7 +117,6 @@ export const handleLocationHash = () => {
}; };
// Check if element scrolled into viewport from above or below // Check if element scrolled into viewport from above or below
// Courtesy http://stackoverflow.com/a/7557433/414749
export const isInViewport = (el, offset = {}) => { export const isInViewport = (el, offset = {}) => {
const rect = el.getBoundingClientRect(); const rect = el.getBoundingClientRect();
const { top, left } = offset; const { top, left } = offset;
...@@ -560,8 +559,6 @@ export const addSelectOnFocusBehaviour = (selector = '.js-select-on-focus') => { ...@@ -560,8 +559,6 @@ export const addSelectOnFocusBehaviour = (selector = '.js-select-on-focus') => {
* Method to round of values with decimal places * Method to round of values with decimal places
* with provided precision. * with provided precision.
* *
* Taken from https://stackoverflow.com/a/7343013/414749
*
* Eg; roundOffFloat(3.141592, 3) = 3.142 * Eg; roundOffFloat(3.141592, 3) = 3.142
* *
* Refer to spec/frontend/lib/utils/common_utils_spec.js for * Refer to spec/frontend/lib/utils/common_utils_spec.js for
......
...@@ -125,8 +125,7 @@ export default { ...@@ -125,8 +125,7 @@ export default {
// This method is defined here instead of in `methods` // This method is defined here instead of in `methods`
// because we need to access the .cancel() method // because we need to access the .cancel() method
// lodash attaches to the function, which is // lodash attaches to the function, which is
// made inaccessible by Vue. More info: // made inaccessible by Vue.
// https://stackoverflow.com/a/52988020/1063392
this.debouncedSearch = debounce(function search() { this.debouncedSearch = debounce(function search() {
this.search(this.searchQuery); this.search(this.searchQuery);
}, SEARCH_DEBOUNCE_MS); }, SEARCH_DEBOUNCE_MS);
......
...@@ -149,8 +149,7 @@ export default { ...@@ -149,8 +149,7 @@ export default {
// This method is defined here instead of in `methods` // This method is defined here instead of in `methods`
// because we need to access the .cancel() method // because we need to access the .cancel() method
// lodash attaches to the function, which is // lodash attaches to the function, which is
// made inaccessible by Vue. More info: // made inaccessible by Vue.
// https://stackoverflow.com/a/52988020/1063392
this.debouncedSearch = debounce(function search() { this.debouncedSearch = debounce(function search() {
this.search(); this.search();
}, SEARCH_DEBOUNCE_MS); }, SEARCH_DEBOUNCE_MS);
......
...@@ -4,7 +4,7 @@ export * from './api/user_api'; ...@@ -4,7 +4,7 @@ export * from './api/user_api';
export * from './api/markdown_api'; export * from './api/markdown_api';
// Note: It's not possible to spy on methods imported from this file in // Note: It's not possible to spy on methods imported from this file in
// Jest tests. See https://stackoverflow.com/a/53307822/1063392. // Jest tests.
// As a workaround, in Jest tests, import the methods from the file // As a workaround, in Jest tests, import the methods from the file
// in which they are defined: // in which they are defined:
// //
......
...@@ -19,7 +19,6 @@ const IGNORE_ERRORS = [ ...@@ -19,7 +19,6 @@ const IGNORE_ERRORS = [
'fb_xd_fragment', 'fb_xd_fragment',
// ISP "optimizing" proxy - `Cache-Control: no-transform` seems to // ISP "optimizing" proxy - `Cache-Control: no-transform` seems to
// reduce this. (thanks @acdha) // reduce this. (thanks @acdha)
// See http://stackoverflow.com/questions/4113268
'bmi_SafeAddOnload', 'bmi_SafeAddOnload',
'EBCallBackMessageReceived', 'EBCallBackMessageReceived',
// See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx // See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx
......
...@@ -18,7 +18,7 @@ Regexp notes: ...@@ -18,7 +18,7 @@ Regexp notes:
const identifierInstanceRegex = /((?:\[.+?\]){1}(?:\[\]|\[.+?\])?(?!:))/g; const identifierInstanceRegex = /((?:\[.+?\]){1}(?:\[\]|\[.+?\])?(?!:))/g;
const isIdentifierInstance = (literal) => { const isIdentifierInstance = (literal) => {
// Reset lastIndex as global flag in regexp are stateful (https://stackoverflow.com/a/11477448) // Reset lastIndex as global flag in regexp are stateful
identifierInstanceRegex.lastIndex = 0; identifierInstanceRegex.lastIndex = 0;
return identifierInstanceRegex.test(literal); return identifierInstanceRegex.test(literal);
}; };
......
...@@ -505,7 +505,7 @@ $line-removed-dark: #fac5cd !default; ...@@ -505,7 +505,7 @@ $line-removed-dark: #fac5cd !default;
* would hide other layers (selected text, matching brackets). * would hide other layers (selected text, matching brackets).
* *
* When the transparent colors get layered on white background, they create their * When the transparent colors get layered on white background, they create their
* full opacity counterparts (computed with https://stackoverflow.com/a/12228643/606571): * full opacity counterparts:
* *
* - white + $line-added-transparent = $line-added * - white + $line-added-transparent = $line-added
* - white + $line-added-transparent + $line-added-dark-transparent = $line-added-dark * - white + $line-added-transparent + $line-added-dark-transparent = $line-added-dark
......
@import 'framework/variables'; @import 'framework/variables';
// Do not use 3-letter hex codes, bgcolor vs css background-color is problematic in emails // Do not use 3-letter hex codes, bgcolor vs css background-color is problematic in emails
// See https://stackoverflow.com/questions/28551981/why-are-3-digit-hex-color-code-values-interpreted-differently-in-internet-explor
// //
// stylelint-disable color-hex-length // stylelint-disable color-hex-length
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
position: -webkit-sticky; position: -webkit-sticky;
position: sticky; position: sticky;
// Unitless zero values are not allowed in calculations https://stackoverflow.com/a/55391061 // Unitless zero values are not allowed in calculations
// stylelint-disable-next-line length-zero-no-unit // stylelint-disable-next-line length-zero-no-unit
top: calc(#{$top-pos} + var(--system-header-height, 0px) + var(--performance-bar-height, 0px)); top: calc(#{$top-pos} + var(--system-header-height, 0px) + var(--performance-bar-height, 0px));
// stylelint-disable-next-line length-zero-no-unit // stylelint-disable-next-line length-zero-no-unit
......
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
* Manage the instance of a custom `window.localStorage` * Manage the instance of a custom `window.localStorage`
* *
* This only encapsulates the setup / teardown logic so that it can easily be * This only encapsulates the setup / teardown logic so that it can easily be
* reused with different implementations (i.e. a spy or a [fake][1]) * reused with different implementations (i.e. a spy or a fake)
*
* [1]: https://stackoverflow.com/a/41434763/1708147
* *
* @param {() => any} fn Function that returns the object to use for localStorage * @param {() => any} fn Function that returns the object to use for localStorage
*/ */
......
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
* Manage the instance of a custom `window.location` * Manage the instance of a custom `window.location`
* *
* This only encapsulates the setup / teardown logic so that it can easily be * This only encapsulates the setup / teardown logic so that it can easily be
* reused with different implementations (i.e. a spy or a [fake][1]) * reused with different implementations (i.e. a spy or a fake)
*
* [1]: https://stackoverflow.com/a/41434763/1708147
* *
* @param {() => any} fn Function that returns the object to use for window.location * @param {() => any} fn Function that returns the object to use for window.location
*/ */
......
...@@ -70,8 +70,7 @@ describe('Shortcuts', () => { ...@@ -70,8 +70,7 @@ describe('Shortcuts', () => {
const mdShortcuts = $(this).data('md-shortcuts'); const mdShortcuts = $(this).data('md-shortcuts');
// jQuery.map() automatically unwraps arrays, so we // jQuery.map() automatically unwraps arrays, so we
// have to double wrap the array to counteract this: // have to double wrap the array to counteract this
// https://stackoverflow.com/a/4875669/1063392
return mdShortcuts ? [mdShortcuts] : undefined; return mdShortcuts ? [mdShortcuts] : undefined;
}) })
.get(); .get();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment