diff --git a/background.html b/background.html index 7b3c8aa7f..4616c5a28 100644 --- a/background.html +++ b/background.html @@ -160,7 +160,6 @@ - diff --git a/background_test.html b/background_test.html index 9c0abd860..0bd8f73fa 100644 --- a/background_test.html +++ b/background_test.html @@ -165,7 +165,6 @@ - diff --git a/js/views/list_view.js b/js/views/list_view.js deleted file mode 100644 index deb55bbb3..000000000 --- a/js/views/list_view.js +++ /dev/null @@ -1,42 +0,0 @@ -/* global Backbone, Whisper, _ */ - -// eslint-disable-next-line func-names -(function() { - 'use strict'; - - window.Whisper = window.Whisper || {}; - - /* - * Generic list view that watches a given collection, wraps its members in - * a given child view and adds the child view elements to its own element. - */ - Whisper.ListView = Backbone.View.extend({ - tagName: 'ul', - itemView: Backbone.View, - initialize(options) { - this.options = options || {}; - this.listenTo(this.collection, 'add', this.addOne); - this.listenTo(this.collection, 'reset', this.addAll); - }, - - addOne(model) { - if (this.itemView) { - const options = _.extend({}, this.options.toInclude, { model }); - // eslint-disable-next-line new-cap - const view = new this.itemView(options); - this.$el.append(view.render().el); - this.$el.trigger('add'); - } - }, - - addAll() { - this.$el.html(''); - this.collection.each(this.addOne, this); - }, - - render() { - this.addAll(); - return this; - }, - }); -})(); diff --git a/test/index.html b/test/index.html index 29c6972f7..518f4ddf6 100644 --- a/test/index.html +++ b/test/index.html @@ -202,7 +202,6 @@ - @@ -229,7 +228,6 @@ - diff --git a/test/views/list_view_test.js b/test/views/list_view_test.js deleted file mode 100644 index 139b95abf..000000000 --- a/test/views/list_view_test.js +++ /dev/null @@ -1,23 +0,0 @@ -/* global Backbone, Whisper */ - -describe('ListView', () => { - let collection; - - beforeEach(() => { - collection = new Backbone.Collection(); - }); - - it('should add children to the list element as they are added to the collection', () => { - const view = new Whisper.ListView({ collection }); - collection.add('hello'); - assert.equal(view.$el.children().length, 1); - collection.add('world'); - assert.equal(view.$el.children().length, 2); - }); - - it('should add all the children to the list element on reset', () => { - const view = new Whisper.ListView({ collection }); - collection.reset(['goodbye', 'world']); - assert.equal(view.$el.children().length, 2); - }); -}); diff --git a/ts/util/lint/exceptions.json b/ts/util/lint/exceptions.json index def57ebc2..757063adc 100644 --- a/ts/util/lint/exceptions.json +++ b/ts/util/lint/exceptions.json @@ -444,24 +444,6 @@ "updated": "2018-09-19T21:59:32.770Z", "reasonDetail": "Protected from arbitrary input" }, - { - "rule": "jQuery-$(", - "path": "js/views/group_member_list_view.js", - "line": " this.$('.container').append(this.member_list_view.el);", - "lineNumber": 27, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T21:59:32.770Z", - "reasonDetail": "Protected from arbitrary input" - }, - { - "rule": "jQuery-append(", - "path": "js/views/group_member_list_view.js", - "line": " this.$('.container').append(this.member_list_view.el);", - "lineNumber": 27, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM nodes" - }, { "rule": "jQuery-html(", "path": "js/views/identicon_svg_view.js", @@ -640,24 +622,6 @@ "updated": "2018-09-19T21:59:32.770Z", "reasonDetail": "Protected from arbitrary input" }, - { - "rule": "jQuery-append(", - "path": "js/views/list_view.js", - "line": " this.$el.append(view.render().el);", - "lineNumber": 27, - "reasonCategory": "usageTrusted", - "updated": "2018-09-19T18:13:29.628Z", - "reasonDetail": "Interacting with already-existing DOM nodes" - }, - { - "rule": "jQuery-html(", - "path": "js/views/list_view.js", - "line": " this.$el.html('');", - "lineNumber": 33, - "reasonCategory": "usageTrusted", - "updated": "2018-09-15T00:38:04.183Z", - "reasonDetail": "Hard-coded value" - }, { "rule": "jQuery-$(", "path": "js/views/phone-input-view.js",