| 13 | protected authError = false; |
| 14 | |
| 15 | constructor(public url: string) { |
| 16 | let oldUrl = window.location.href.split('/').slice(0, 5).join('/'); |
| 17 | utils.changeDetect( |
| 18 | () => { |
| 19 | this.same = false; |
| 20 | if (this.page !== null && this.page.page === 'detail') { |
| 21 | const tempUrl = window.location.href.split('/').slice(0, 5).join('/'); |
| 22 | if (tempUrl === oldUrl) { |
| 23 | this.same = true; |
| 24 | } |
| 25 | oldUrl = tempUrl; |
| 26 | } |
| 27 | |
| 28 | this.url = window.location.href; |
| 29 | this.init(); |
| 30 | }, |
| 31 | () => { |
| 32 | if (this.page !== null && this.page.page === 'bookmarks' && $('.library-content').length) { |
| 33 | return $('.library-content').first().height(); |
| 34 | } |
| 35 | |
| 36 | return window.location.href; |
| 37 | }, |
| 38 | ); |
| 39 | |
| 40 | $(document).ready(() => { |
| 41 | utils.waitUntilTrue( |
| 42 | function () { |
| 43 | return $('.global-container').length; |
| 44 | }, |
| 45 | () => { |
| 46 | this.init(); |
| 47 | }, |
| 48 | ); |
| 49 | }); |
| 50 | |
| 51 | api.storage.addStyle( |
| 52 | require('!to-string-loader!css-loader!less-loader!./style.less').toString(), |
| 53 | ); |
| 54 | } |
| 55 | |
| 56 | async init() { |
| 57 | await waitForPageToBeVisible(); |