Add option to limit the height of inline images

Fixed: twpowertools:39
Co-authored-by: Barry Hunter
Change-Id: Iabed778be68f4a5211916c648ebcce3a0e305b12
diff --git a/src/static/_locales/en/messages.json b/src/static/_locales/en/messages.json
index 02b0bea..1fe26e9 100644
--- a/src/static/_locales/en/messages.json
+++ b/src/static/_locales/en/messages.json
@@ -111,6 +111,10 @@
     "message": "Show a notification in the Community Console when a thread list has new updates.",
     "description": "Feature checkbox in the options page"
   },
+  "options_imagemaxheight": {
+    "message": "Prevent inline images in messages from being taller than the current window.",
+    "description": "Feature checkbox in the options page"
+  },
   "options_profileindicator_moreinfo": {
     "message": "+info about the 2 previous options",
     "description": "Link to learn more about the profile indicator feature"
diff --git a/src/static/css/image_max_height.css b/src/static/css/image_max_height.css
new file mode 100644
index 0000000..2e9b48b
--- /dev/null
+++ b/src/static/css/image_max_height.css
@@ -0,0 +1,5 @@
+ec-question .body img,
+    ec-message .body img {
+  /* "Max height = full height - 2 * height of the header" */
+  max-height: calc(100vh - 2*64px);
+}