discourse/app/assets/javascripts
David Taylor 03818e642a
FEATURE: Include optimized thumbnails for topics (#9215)
This introduces new APIs for obtaining optimized thumbnails for topics. There are a few building blocks required for this:

- Introduces new `image_upload_id` columns on the `posts` and `topics` table. This replaces the old `image_url` column, which means that thumbnails are now restricted to uploads. Hotlinked thumbnails are no longer possible. In normal use (with pull_hotlinked_images enabled), this has no noticeable impact

- A migration attempts to match existing urls to upload records. If a match cannot be found then the posts will be queued for rebake

- Optimized thumbnails are generated during post_process_cooked. If thumbnails are missing when serializing a topic list, then a sidekiq job is queued

- Topic lists and topics now include a `thumbnails` key, which includes all the available images:
   ```
   "thumbnails": [
   {
     "max_width": null,
     "max_height": null,
     "url": "//example.com/original-image.png",
     "width": 1380,
     "height": 1840
   },
   {
     "max_width": 1024,
     "max_height": 1024,
     "url": "//example.com/optimized-image.png",
     "width": 768,
     "height": 1024
   }
   ]
  ```

- Themes can request additional thumbnail sizes by using a modifier in their `about.json` file:
   ```
    "modifiers": {
      "topic_thumbnail_sizes": [
        [200, 200],
        [800, 800]
      ],
      ...
  ```
  Remember that these are generated asynchronously, so your theme should include logic to fallback to other available thumbnails if your requested size has not yet been generated

- Two new raw plugin outlets are introduced, to improve the customisability of the topic list. `topic-list-before-columns` and `topic-list-before-link`
2020-05-05 09:07:50 +01:00
..
admin UX: change the user merge button's label and icon. 2020-05-04 18:44:30 +05:30
confirm-new-email Last ES6 files in our app/assets/javascripts 2020-03-25 12:30:20 -04:00
discourse/app FEATURE: Include optimized thumbnails for topics (#9215) 2020-05-05 09:07:50 +01:00
discourse-common DEV: Support for import Handlebars from 'handlebars'; (#9600) 2020-04-30 16:41:02 -04:00
docs
ember-addons DEV: Remove ember-addons (#9559) 2020-04-28 10:14:49 -04:00
locales Run prettier on a couple of files 2020-03-12 14:07:38 -04:00
pretty-text DEV: Support for import Handlebars from 'handlebars'; (#9600) 2020-04-30 16:41:02 -04:00
select-kit REFACTOR: minor tweaks to user's notifications-filter (#9623) 2020-05-04 09:09:13 +02:00
wizard FIX: template-lint uses strict rel-noopener rule which requires noreferrer (#9449) 2020-04-16 22:38:10 +02:00
activate-account.js Last ES6 files in our app/assets/javascripts 2020-03-25 12:30:20 -04:00
admin.js.erb
app-boot.js DEV: Rename deprecated to the more appropriate app-boot 2020-05-01 15:19:19 -04:00
application.js DEV: Rename deprecated to the more appropriate app-boot 2020-05-01 15:19:19 -04:00
auto-redirect.js Last ES6 files in our app/assets/javascripts 2020-03-25 12:30:20 -04:00
browser-detect.js Improve support for old browsers (#9515) 2020-04-29 21:40:21 +03:00
discourse-loader.js DEV: Move discourse.js to app/app.js (#9545) 2020-04-27 13:28:10 -04:00
discourse-objects.js
embed-application.js Last ES6 files in our app/assets/javascripts 2020-03-25 12:30:20 -04:00
ember_include.js.erb
ember_jquery.js
ember-shim.js DEV: Deprecate ember module imports (#9011) 2020-02-21 15:56:49 +01:00
env.js
google-tag-manager.js Last ES6 files in our app/assets/javascripts 2020-03-25 12:30:20 -04:00
google-universal-analytics.js Last ES6 files in our app/assets/javascripts 2020-03-25 12:30:20 -04:00
handlebars-shim.js DEV: Remove global Handlebars 2020-05-01 14:12:09 -04:00
main_include_admin.js DEV: Remove ember-addons (#9559) 2020-04-28 10:14:49 -04:00
markdown-it-bundle.js REFACTOR: Attach resize controls to images from the markdown pipeline (#8314) 2019-11-12 17:32:37 -03:00
onpopstate-handler.js More JS files 2020-03-24 16:18:56 -04:00
polyfills.js FEATURE: More improvements to crawler and old browsers view 2020-04-30 12:07:51 +03:00
preload-application-data.js Rename more es6 files to js 2020-03-24 16:32:56 -04:00
preload-store.js Rename more es6 files to js 2020-03-24 16:32:56 -04:00
pretty-text-bundle.js DEV: Remove pretty_text import hack & still work server-side (#8266) 2019-10-31 11:54:46 -05:00
print-page.js
service-worker.js.erb FIX: Bypass serviceworker cache for auth routes 2020-03-31 14:24:02 -03:00
set-prototype-polyfill.js
template_include.js DEV: Support for import Handlebars from 'handlebars'; (#9600) 2020-04-30 16:41:02 -04:00
vendor.js FIX: remove word boundary regex (\b) for search result highlights. (#9338) 2020-04-15 11:11:00 +05:30
wizard-application.js DEV: Make discourse-common an Ember addon. (#9578) 2020-04-29 12:18:21 -04:00
wizard-start.js Rename more es6 files to js 2020-03-24 16:32:56 -04:00
wizard-vendor.js FIX: ensure s2 is working with wizard (#8886) 2020-02-07 10:00:39 +01:00