()
| 7 | export default class Imgur extends Media { |
| 8 | |
| 9 | _loadMedia() { |
| 10 | try { |
| 11 | var self = this; |
| 12 | |
| 13 | if (this.data.url.match("<blockquote class=['\"]imgur-embed-pub['\"]")) { |
| 14 | var found = this.data.url.match(/(imgur\.com)\/(\w+)/); |
| 15 | this.media_id = found[2]; |
| 16 | this.data.url = "http://imgur.com/gallery/" + this.media_id; |
| 17 | } else if (this.data.url) { |
| 18 | this.media_id = this.data.url.split('/').slice(-1)[0]; |
| 19 | } |
| 20 | |
| 21 | loadJS([ |
| 22 | 'https://s.imgur.com/min/embed.js' |
| 23 | ], |
| 24 | function() { |
| 25 | self.createMedia(); |
| 26 | } |
| 27 | ); |
| 28 | |
| 29 | } catch (e) { |
| 30 | this.loadErrorDisplay(this._("imgur_invalidurl_err")); |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | createMedia() { |
| 35 | var self = this; |
nothing calls this directly
no test coverage detected