about summary refs log tree commit diff
path: root/app/javascript/mastodon/utils
AgeCommit message (Collapse)Author
2020-10-13Change how CDN_HOST is passed down to make assets build reproducible (#14381)ThibG
* Change how CDN_HOST is passed down to make assets build reproducible * Change webpacker/webpack configuration to dynamically load publicPath based on meta header * Fix embedded layout missing the cdn-host meta header
2020-10-13Fix browser notification permission request logic (#13543)ThibG
* Add notification permission handling code * Request notification permission when enabling any notification setting * Add badge to notification settings when permissions insufficient * Disable alerts by default, requesting permission and enable them on onboarding
2020-07-06Replace shortNumberFormat with <ShortNumber> (#14061)Sasha Sorokin
This commit introduces new utility component - ShortNumber. It should work almost the same way as original shortNumberFormat function, though it also localizes units and accepts one more prop - renderer. Renderer is a function that takes rendered short formatted number and also ready-to-pluralize number to format display result accordingly. Ready-to-pluralize number allows to correctly select plural for compactly notated numbers, respecting thousands and other units. Issue #12451 accurately describes the issue with using raw numbers when replacing counter with short version. In short, it doesn't work with languages such as Russian, that require different plurals, according to the unit number was compacted to. All previous usages of shortNumberFormat were replaced with new function, and as it became unused, it was removed to avoid misleading.
2020-04-25Fix uninformative error message when uploading unsupported image files (#13540)ThibG
Attempting to upload image files that the browser is unable to load results in “Oops! An unexpected error occurred.” This commit changes the error handling so that an unprocessable image results in the file being sent anyway, which might cover a few corner cases, and provide a slightly better error message.
2020-04-18Fix uploaded image orientation in some browsers (#13493)ThibG
Some browsers (at least recent Chrome versions) automatically take image metadata into account when drawing images into a canvas. There seem to be no way to prevent that behavior, and the only way to detect it seems to compare with a known image. See: https://github.com/w3c/csswg-drafts/issues/4666 Solution adapted from: https://github.com/blueimp/JavaScript-Load-Image/commit/1e4df707821a0afcc11ea0720ee403b8759f3881
2020-03-21Migrate Rails ujs as required for Rails 6 Upgrade. (#13280)Shlee
* Update yarn.lock * Update package.json * Update public.js * Update admin.js * Update log_out.js * Update common.js
2019-12-29Fix shortNumberFormat to within 3 chars without units (#12706)Takeshi Umeda
2019-09-29Do not add margin light when opening modal on mobile (#11830)Yamagishi Kazutoshi
2019-08-26Add confirmation modal when logging out from the web app (#11671)ThibG
* [WiP] Add a confirmation modal before logging out from the web interface * Add confirmation to logout link in getting started footer * Please CodeClimate
2019-08-17Remove WebP support (#11589)Stanislas
2019-08-15Fix client-side resizing of image uploads (#11570)ThibG
Fixes #11567
2019-08-13Fix short number formatting for numbers above million in web UI (#11559)Eugen Rochko
2019-08-06Revert "Change links in webUI to rewrite misleading links (#11426)" (#11500)Eugen Rochko
This reverts commit b31b232edfcc7f04acf828bf6829ab716b290692.
2019-08-06Fix image uploads being perfectly white when canvas read access is blocked ↵ThibG
(#11499) Fixes #11496
2019-07-30Change links in webUI to rewrite misleading links (#11426)ThibG
* [WiP] Show host for “misleading” links * Disallow misleading targets which domain names are prefixes of link text * Move decodeIDNA to app/javascript/mastodon/utils * Add support for international domain names * Change link origin tag color to darker text color * Handle links to domains starting with www. as shortened by Mastodon * [WiP] Ignore links that cannot be misread as URLs, rewrite other links
2019-02-02Add WebP support (#9879)Acid Chicken (硫酸鶏)
* Add WebP support * Remove the changes to the tooltip refs: https://github.com/tootsuite/mastodon/pull/9879#pullrequestreview-199312528
2018-07-28Resize images by area instead of fixed dimensions (#8083)Eugen Rochko
To improve the way super tall or super ride images are treated, the numbers remain the same, 1280x1280 and 400x400, but if an image is less in one dimension than the other, the other can become larger Thanks to @WAHa_06x36@mastodon.social for the tip
2018-07-05Add comment, test to unescapeHTML (#7949)Maciek Baron
2018-06-06Preserve newlines in delete & redraft and desktop notifications (#7750)Eugen Rochko
Fix #7748
2018-06-04Display numbers in account header using shortNumberFormat for consistency ↵Eugen Rochko
(#7723)
2018-05-16Fix images resized in browser getting cropped (#7514)Eugen Rochko
Fix #7487
2018-05-09Correct rotate of image using EXIF (#7422)Yamagishi Kazutoshi
2018-05-07Use plaintext value for field value tooltips in web UI (#7388)Eugen Rochko
Fix #7383
2018-04-23Refactor resizeImage method (#7236)Yamagishi Kazutoshi
- Use URL.createObjectURL (replace from FileReader) - Use HTMLCanvasElement.prototype.toBlob (replace from HTMLCanvasElement.prototype.toDataURL) - Use Promise (replace callback interface)