From b0e1cc49a5f270c6430762a71595450b8eeef56a Mon Sep 17 00:00:00 2001
From: Daniel Gasienica <daniel@signal.org>
Date: Sun, 15 Apr 2018 00:53:11 -0400
Subject: [PATCH] Remove legacy Backbone lightbox

---
 js/views/attachment_view.js | 41 -------------------------------------
 test/index.html             |  9 --------
 2 files changed, 50 deletions(-)

diff --git a/js/views/attachment_view.js b/js/views/attachment_view.js
index 3ca8569d3..94f94800b 100644
--- a/js/views/attachment_view.js
+++ b/js/views/attachment_view.js
@@ -12,9 +12,6 @@
 (function () {
   'use strict';
 
-  const ESCAPE_KEY_CODE = 27;
-  const { Signal } = window;
-
   const FileView = Whisper.View.extend({
     tagName: 'div',
     className: 'fileView',
@@ -261,42 +258,4 @@
       this.trigger('update');
     },
   });
-
-  Whisper.LightboxView = Whisper.View.extend({
-    templateName: 'lightbox',
-    className: 'modal lightbox',
-    initialize() {
-      this.window = window;
-      this.$document = $(this.window.document);
-      this.listener = this.onkeyup.bind(this);
-      this.$document.on('keyup', this.listener);
-    },
-    events: {
-      'click .save': 'save',
-      'click .close': 'remove',
-      click: 'onclick',
-    },
-    save() {
-      this.model.saveFile();
-    },
-    onclick(e) {
-      const $el = this.$(e.target);
-      if (!$el.hasClass('image') && !$el.closest('.controls').length) {
-        e.preventDefault();
-        this.remove();
-        return false;
-      }
-
-      return true;
-    },
-    onkeyup(e) {
-      if (e.keyCode === ESCAPE_KEY_CODE) {
-        this.remove();
-        this.$document.off('keyup', this.listener);
-      }
-    },
-    render_attributes() {
-      return { url: this.model.objectUrl };
-    },
-  });
 }());
diff --git a/test/index.html b/test/index.html
index 82ef7fabc..2389de05a 100644
--- a/test/index.html
+++ b/test/index.html
@@ -169,15 +169,6 @@
       <span class='time'>0:00</span>
       <button class='close'><span class='icon'></span></button>
   </script>
-  <script type='text/x-tmpl-mustache' id='lightbox'>
-    <div class='content'>
-      <div class='controls'>
-        <a class='x close' alt='Close image.' href='#'></a>
-        <a class='save' alt='Save as...' href='#'></a>
-      </div>
-      <img class='image' src='{{ url }}' />
-    </div>
-  </script>
   <script type='text/x-tmpl-mustache' id='confirmation-dialog'>
     <div class="content">
       <div class='message'>{{ message }}</div>