From fe369858b76f547848739b1e002c4e0025a28a39 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 25 Sep 2015 15:17:46 +0100 Subject: [PATCH] Unused variables & redundant stuff --- src/MatrixTools.js | 2 -- src/Modal.js | 1 - src/controllers/molecules/ChangeAvatar.js | 2 -- src/controllers/molecules/ChangePassword.js | 2 -- src/controllers/molecules/MemberInfo.js | 6 ------ src/controllers/organisms/ErrorDialog.js | 1 - src/controllers/organisms/MemberList.js | 1 - src/controllers/organisms/Notifier.js | 1 - src/controllers/organisms/QuestionDialog.js | 1 - src/controllers/organisms/RoomView.js | 3 --- src/controllers/organisms/UserSettings.js | 2 -- src/controllers/pages/MatrixChat.js | 5 ----- src/controllers/templates/Login.js | 3 --- src/controllers/templates/Register.js | 7 ------- src/linkify-matrix.js | 5 ----- 15 files changed, 42 deletions(-) diff --git a/src/MatrixTools.js b/src/MatrixTools.js index 343459b6c2..5c6dca8b33 100644 --- a/src/MatrixTools.js +++ b/src/MatrixTools.js @@ -14,8 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -var MatrixClientPeg = require('./MatrixClientPeg'); - module.exports = { /** * Given a room object, return the canonical alias for it diff --git a/src/Modal.js b/src/Modal.js index ba7660bf9d..f34ef65d59 100644 --- a/src/Modal.js +++ b/src/Modal.js @@ -18,7 +18,6 @@ limitations under the License. 'use strict'; var React = require('react'); -var q = require('q'); module.exports = { DialogContainerId: "mx_Dialog_Container", diff --git a/src/controllers/molecules/ChangeAvatar.js b/src/controllers/molecules/ChangeAvatar.js index b7eb3ec699..0df93b02fd 100644 --- a/src/controllers/molecules/ChangeAvatar.js +++ b/src/controllers/molecules/ChangeAvatar.js @@ -17,8 +17,6 @@ limitations under the License. var React = require('react'); var MatrixClientPeg = require("../../MatrixClientPeg"); -var dis = require("../../dispatcher"); - module.exports = { propTypes: { onFinished: React.PropTypes.func, diff --git a/src/controllers/molecules/ChangePassword.js b/src/controllers/molecules/ChangePassword.js index 5cc73c5def..637e133a79 100644 --- a/src/controllers/molecules/ChangePassword.js +++ b/src/controllers/molecules/ChangePassword.js @@ -19,8 +19,6 @@ limitations under the License. var React = require('react'); var MatrixClientPeg = require("../../MatrixClientPeg"); -var dis = require("../../dispatcher"); - module.exports = { propTypes: { onFinished: React.PropTypes.func, diff --git a/src/controllers/molecules/MemberInfo.js b/src/controllers/molecules/MemberInfo.js index 0fcbb22f87..24e4afe5fd 100644 --- a/src/controllers/molecules/MemberInfo.js +++ b/src/controllers/molecules/MemberInfo.js @@ -34,11 +34,8 @@ var Loader = require("react-loader"); module.exports = { componentDidMount: function() { - var self = this; - // work out the current state if (this.props.member) { - var usr = MatrixClientPeg.get().getUser(this.props.member.userId) || {}; var memberState = this._calculateOpsPermissions(); this.setState(memberState); } @@ -48,7 +45,6 @@ module.exports = { var ErrorDialog = sdk.getComponent("organisms.ErrorDialog"); var roomId = this.props.member.roomId; var target = this.props.member.userId; - var self = this; MatrixClientPeg.get().kick(roomId, target).done(function() { // NO-OP; rely on the m.room.member event coming down else we could // get out of sync if we force setState here! @@ -66,7 +62,6 @@ module.exports = { var ErrorDialog = sdk.getComponent("organisms.ErrorDialog"); var roomId = this.props.member.roomId; var target = this.props.member.userId; - var self = this; MatrixClientPeg.get().ban(roomId, target).done(function() { // NO-OP; rely on the m.room.member event coming down else we could // get out of sync if we force setState here! @@ -84,7 +79,6 @@ module.exports = { var ErrorDialog = sdk.getComponent("organisms.ErrorDialog"); var roomId = this.props.member.roomId; var target = this.props.member.userId; - var self = this; var room = MatrixClientPeg.get().getRoom(roomId); if (!room) { this.props.onFinished(); diff --git a/src/controllers/organisms/ErrorDialog.js b/src/controllers/organisms/ErrorDialog.js index 32914bb156..6b7c35b3f2 100644 --- a/src/controllers/organisms/ErrorDialog.js +++ b/src/controllers/organisms/ErrorDialog.js @@ -26,7 +26,6 @@ module.exports = { }, getDefaultProps: function() { - var self = this; return { title: "Error", description: "An error has occurred.", diff --git a/src/controllers/organisms/MemberList.js b/src/controllers/organisms/MemberList.js index 6944282546..7d453d73a1 100644 --- a/src/controllers/organisms/MemberList.js +++ b/src/controllers/organisms/MemberList.js @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -var React = require("react"); var MatrixClientPeg = require("../../MatrixClientPeg"); var Modal = require("../../Modal"); var sdk = require('../../index'); diff --git a/src/controllers/organisms/Notifier.js b/src/controllers/organisms/Notifier.js index 0c03222641..8fb62abe40 100644 --- a/src/controllers/organisms/Notifier.js +++ b/src/controllers/organisms/Notifier.js @@ -52,7 +52,6 @@ module.exports = { setEnabled: function(enable, callback) { if(enable) { if (!this.havePermission()) { - var self = this; global.Notification.requestPermission(function() { if (callback) { callback(); diff --git a/src/controllers/organisms/QuestionDialog.js b/src/controllers/organisms/QuestionDialog.js index 8819ba2a01..30891b839d 100644 --- a/src/controllers/organisms/QuestionDialog.js +++ b/src/controllers/organisms/QuestionDialog.js @@ -26,7 +26,6 @@ module.exports = { }, getDefaultProps: function() { - var self = this; return { title: "", description: "", diff --git a/src/controllers/organisms/RoomView.js b/src/controllers/organisms/RoomView.js index 6e8d1909c8..ea84746bab 100644 --- a/src/controllers/organisms/RoomView.js +++ b/src/controllers/organisms/RoomView.js @@ -346,9 +346,6 @@ module.exports = { { continuation = true; } - - var ts0 = this.state.room.timeline[i - 1].getTs(); - var ts1 = this.state.room.timeline[i].getTs(); } if (!TileType) continue; ret.unshift( diff --git a/src/controllers/organisms/UserSettings.js b/src/controllers/organisms/UserSettings.js index f8f811ae10..60d643c22b 100644 --- a/src/controllers/organisms/UserSettings.js +++ b/src/controllers/organisms/UserSettings.js @@ -15,9 +15,7 @@ limitations under the License. */ var MatrixClientPeg = require("../../MatrixClientPeg"); -var React = require("react"); var q = require('q'); -var dis = require("../../dispatcher"); var version = require('../../../package.json').version; module.exports = { diff --git a/src/controllers/pages/MatrixChat.js b/src/controllers/pages/MatrixChat.js index d4c75170d6..2ce8d930e1 100644 --- a/src/controllers/pages/MatrixChat.js +++ b/src/controllers/pages/MatrixChat.js @@ -14,11 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -'use strict'; - -// should be atomised -var Loader = require("react-loader"); - var MatrixClientPeg = require("../../MatrixClientPeg"); var RoomListSorter = require("../../RoomListSorter"); var Presence = require("../../Presence"); diff --git a/src/controllers/templates/Login.js b/src/controllers/templates/Login.js index 4bb73aa813..c14ed28c4a 100644 --- a/src/controllers/templates/Login.js +++ b/src/controllers/templates/Login.js @@ -16,10 +16,7 @@ limitations under the License. 'use strict'; -var React = require('react'); - var MatrixClientPeg = require("../../MatrixClientPeg"); -var Matrix = require("matrix-js-sdk"); var dis = require("../../dispatcher"); module.exports = { diff --git a/src/controllers/templates/Register.js b/src/controllers/templates/Register.js index 34b09554f0..294329e42e 100644 --- a/src/controllers/templates/Register.js +++ b/src/controllers/templates/Register.js @@ -14,12 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -'use strict'; - -var React = require('react'); - var MatrixClientPeg = require("../../MatrixClientPeg"); -var Matrix = require("matrix-js-sdk"); var dis = require("../../dispatcher"); module.exports = { @@ -194,9 +189,7 @@ module.exports = { hs_url: this.getHsUrl(), is_url: this.getIsUrl() }); - var cli = MatrixClientPeg.get(); this.setState({busy: true}); - var self = this; this.tryRegister(); }, diff --git a/src/linkify-matrix.js b/src/linkify-matrix.js index 273fe123a9..e92a3efc91 100644 --- a/src/linkify-matrix.js +++ b/src/linkify-matrix.js @@ -14,14 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -'use strict'; - -var extend = require('./extend'); - function matrixLinkify(linkify) { // Text tokens var TT = linkify.scanner.TOKENS; - var TextToken = TT.Base; // Multi tokens var MT = linkify.parser.TOKENS; var MultiToken = MT.Base;