From baa08431ad143924a9b0a0a554897921837db64e Mon Sep 17 00:00:00 2001 From: _Lighty_ Date: Wed, 4 Mar 2020 17:23:35 +0100 Subject: [PATCH] BIV v1.1.1 fix videos breaking --- .../BetterImageViewer/BetterImageViewer.plugin.js | 13 +++++++++++-- Plugins/BetterImageViewer/CHANGELOG.md | 3 ++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Plugins/BetterImageViewer/BetterImageViewer.plugin.js b/Plugins/BetterImageViewer/BetterImageViewer.plugin.js index 9b87ef7..2123602 100644 --- a/Plugins/BetterImageViewer/BetterImageViewer.plugin.js +++ b/Plugins/BetterImageViewer/BetterImageViewer.plugin.js @@ -37,7 +37,7 @@ var BetterImageViewer = (() => { twitter_username: '' } ], - version: '1.1.0', + version: '1.1.1', description: 'Adds ability to go between images in the current channel with arrow keys, or on screen buttons, and has click to zoom. Also provides info about the image, who posted it and when.', github: 'https://github.com/1Lighty', github_raw: 'https://raw.githubusercontent.com/1Lighty/BetterDiscordPlugins/master/Plugins/BetterImageViewer/BetterImageViewer.plugin.js' @@ -47,6 +47,11 @@ var BetterImageViewer = (() => { title: 'IMAGE ZOOM IS HERE!', type: 'added', items: ['*SOME* people kept asking, so here you go.\nAdded image zoom, simply activate by click and holding on the image.', 'Use scroll wheel to zoom in and out, hold shift while scrolling to change lens size.', "If you prefer using a different plugin to handle zooming for you, that's fine too, there is a toggle to disable it in settings.", 'The click and hold can of course be easily changed in the settings to your prefered method of zooming.\n![zoommode](https://i.imgur.com/A8HjQb9.png)', 'There are other options too, for those that may want it!\n![moreoptions](https://i.imgur.com/JGNe7Re.png)'] + }, + { + title: 'post v1.1.0 update', + type: 'fixed', + items: ['Fixed breaking videos, lmao'] } ], defaultConfig: [ @@ -1618,7 +1623,7 @@ var BetterImageViewer = (() => { else if (!animated) _this.unobserveVisibility(); }); Patcher.after(LazyImage.prototype, 'render', (_this, _, ret) => { - if (!this.settings.zoom.enabled || _this.props.onZoom || _this.state.readyState !== 'READY' || !ret) return; + if (!this.settings.zoom.enabled || _this.props.onZoom || _this.state.readyState !== 'READY' || _this.props.__BIV_isVideo || !ret) return; if (_this.props.animated && ret.props.children) { /* dirty */ try { @@ -1632,6 +1637,10 @@ var BetterImageViewer = (() => { ret.props.__BIV_animated = _this.props.animated; ret.props.hiddenSettings = this.hiddenSettings; }); + Patcher.after(WebpackModules.getByDisplayName('LazyVideo').prototype, 'render', (_, __, ret) => { + if (!ret) return; + ret.props.__BIV_isVideo = true; + }); } /* PATCHES */ diff --git a/Plugins/BetterImageViewer/CHANGELOG.md b/Plugins/BetterImageViewer/CHANGELOG.md index a223778..cc88ace 100644 --- a/Plugins/BetterImageViewer/CHANGELOG.md +++ b/Plugins/BetterImageViewer/CHANGELOG.md @@ -1,5 +1,5 @@ # [BetterImageViewer](https://1lighty.github.io/BetterDiscordStuff/?plugin=BetterImageViewer "BetterImageViewer") Changelog -### 1.1.0 +### 1.1.0 & 1.1.1 - *SOME* people kept asking, so here you go. - Added image zoom, simply activate by click and holding on the image. - Use scroll wheel to zoom in and out, hold shift while scrolling to change lens size. @@ -8,6 +8,7 @@ ![zoommode](https://i.imgur.com/A8HjQb9.png) - There are other options too, for those that may want it! ![moreoptions](https://i.imgur.com/JGNe7Re.png)' +- Fixed breaking videos, lmao ### 1.0.4 - Fixed plugin refusing to work in PTB and canary