From 5c52a3059d3bd80cb665c168db095905cba361cf Mon Sep 17 00:00:00 2001 From: ephellon Date: Wed, 4 Dec 2019 18:06:57 -0700 Subject: [PATCH 1/3] Fixed options page, theme, and saving errors. Updated UI/UX --- change.log | 343 ----------------------------------------- moz.xpi | Bin 1801131 -> 1803194 bytes moz.zip | Bin 1801131 -> 1803194 bytes moz/manifest.json | 2 +- moz/options.css | 5 + moz/options.html | 89 ++++++----- moz/options.js | 152 ++++++++++++++---- moz/plex.js | 2 +- moz/utils.js | 161 +++++++++++++++++-- src.crx | Bin 867670 -> 869809 bytes src.zip | Bin 866978 -> 869112 bytes src/cloud/plex.js | 2 +- src/manifest.json | 2 +- src/options/index.css | 5 + src/options/index.html | 93 ++++++----- src/options/index.js | 185 ++++++++++++++++++---- src/utils.js | 160 +++++++++++++++++-- 17 files changed, 695 insertions(+), 506 deletions(-) delete mode 100644 change.log diff --git a/change.log b/change.log deleted file mode 100644 index 696ab4f..0000000 --- a/change.log +++ /dev/null @@ -1,343 +0,0 @@ -# NOTES - -- **Bolded items** are deemed the most significant, such as added sites and new features - -# TODO - -- [x] Use the "download" API to save files (i.e. Flenix's "Save As" option for non-Flenix domains) - - v3.0.1.0 -- [x] Use Radarr and/or Sonarr's searching feature (if installed)? - - see [Radarr's Lookup API](https://github.com/Radarr/Radarr/wiki/API:Movie-Lookup) - - see [Sonarr's Lookup API](https://github.com/Sonarr/Sonarr/wiki/Series-Lookup) - - Caveats / Conflicts with Trakt's "to do"s - - **All [branding requirements](https://trakt.tv/branding) must be followed.** - - **Trakt data cannot be used in apps or websites that promote copyright infringement or piracy.** - - **Use only [documented API methods](https://trakt.docs.apiary.io/) and please don't scrape the website for information.**? -- [ ] Create the "Auto Manage" feature - - use the user's manager settings for file renaming (vs. sending a secondary prompt) - - no documented API for such an action... -- Close issues: - - [x] #13 - - [x] #14 - - [x] #21 - - [x] #25 - - [x] #53 - - [x] #57 -- Revisit issues: - - [x] #17 - - [x] #16 - - [x] #24 - -# CHANGELOG (Oldest to Newest) - -### v0.1 / [SpaceK33z@9e81a0c](https://github.com/SpaceK33z/web-to-plex/commit/9e81a0cf17e165a0850cfcdfdfa0d4b674dbfb6b) - -- Removed CouchPotato settings as they were unused (later redacted: v0.2.2.0) -- **Added Flenix as a supported site** (later redacted: v4.0.0.0) - -### v0.2 / [SpaceK33z@f3564c8](https://github.com/SpaceK33z/web-to-plex/commit/f3564c87241265a7913c043d0aa0e11cbff7c2c3) - -- ~~Fixed Flenix downloading bug~~ -- ~~Updated button style (Flenix only)~~ -- Began versioning at 0.2 - -### v0.2.0.1 / [SpaceK33z@f3b9b52](https://github.com/SpaceK33z/web-to-plex/commit/f3b9b52408d360e24263df1a5a22c86d6197f585) - -- **Added the "Download File" dialog (later change to "Save File")** - -### v0.2.1.2 / [SpaceK33z@b4c8d89](https://github.com/SpaceK33z/web-to-plex/commit/b4c8d89e6c8fd123ff68be262ab1e2503af4ae09) - -- ~~Added multiple button locations to Flenix (later redacted: v3.0.0.0)~~ -- **Added Web to Plex logos** -- Restructured file layout - -### v0.2.1.3 / [SpaceK33z@aa3a731](https://github.com/SpaceK33z/web-to-plex/commit/aa3a731f2ad46d5850d1574e0143f40546da7892) - -- Created a Plex-like UI/UX and updated button styles - - **includes the pop-up feature** - -### v0.2.2.0 / [SpaceK33z@f176042](https://github.com/SpaceK33z/web-to-plex/commit/f1760423aebc3ed7fee15ec0f50d96eee3be41f8) - -- Fixed an adding error for Radarr and Sonarr -- Updated UI/UX - - **Adapted the "Plex Token Login" feature** -- Restructured code layout (camel-cased variable names, and made more readable) - -## v0.3.0.0 / [SpaceK33z@25bffc8](https://github.com/SpaceK33z/web-to-plex/commit/25bffc874cfab84d95216cda48d1e97eaa360776) - -- **Added TV Maze as a supported site** -- Fixed Sonarr adding error -- Updated site scripts - -## v0.3.0.1 / [SpaceK33z@3196f6d](https://github.com/SpaceK33z/web-to-plex/commit/3196f6dbe3a3413b1fe8a9f10a2abe563853c99d) - -- Updated UX: allowed site scripts to access image files (as action buttons) -- **Added API support for finding movie/series IDs (The Movie DB, and The TV DB)** - -## v0.3.3.0 / [SpaceK33z@dba19e0](https://github.com/SpaceK33z/web-to-plex/commit/dba19e0b27c3815c66a7f18a7b323ea39c367c64) - -- **Added The TV Database as a supported site, as well as: The Movie Database and VRV** - -## v0.3.3.1 / [SpaceK33z@62dbb8e](https://github.com/SpaceK33z/web-to-plex/commit/62dbb8eab84dc0765c3f2448bfc3eb1ecbe2b63f) - -- Fixed an adding error - -## v0.4.0.0 / [SpaceK33z@dce5467](https://github.com/SpaceK33z/web-to-plex/commit/dce5467cd396c3086a1116af4feb24053880c8fd) - -- **Added Plex login support (username / password), see commit [SpaceK33z@db01d1a](https://github.com/SpaceK33z/web-to-plex/commit/db01d1a83d32e4d73f2ea671f634e6cc5b4c0fe7)** - -## v0.5.0.0 / [SpaceK33z@ed1033f](https://github.com/SpaceK33z/web-to-plex/commit/ed1033f330782328f2884b00923f166b74808c37) - -- **Added Hulu as a supported site, as well as: Google Play Store** - -## v0.5.0.2 / [SpaceK33z@7bf7555](https://github.com/SpaceK33z/web-to-plex/commit/7bf755504a4ead8d832e88ce4272f1b896374333) - -- **Included the "Storage Path" feature, see commit [SpaceK33z@27506b9](https://github.com/SpaceK33z/web-to-plex/commit/27506b9a4c12496bd7aad6ee09deb8a5b9418cac)** - -## v0.5.1.0 / [SpaceK33z@e860992](https://github.com/SpaceK33z/web-to-plex/commit/e8609920e3b2005d8979a0df16b8a309a9221a32) - -- **Removed Firefox support** -- ~~Added multiple Flenix domains~~ - -## v1.0.0.0 / [SpaceK33z@b05ebfa](https://github.com/SpaceK33z/web-to-plex/commit/b05ebfa7230810cb30ca39f72613b2ef7409e4f0) - -- Restructured file layout - -## v1.0.1.0 / [SpaceK33z@cc557ca](https://github.com/SpaceK33z/web-to-plex/commit/cc557ca0ab76788a0fe5286d43ade43de0de5209) - -- **Added iTunes as a supported site, as well as: Fandango, and Metacritic** - -## v1.0.2.0 / [SpaceK33z@250dbbe](https://github.com/SpaceK33z/web-to-plex/commit/250dbbe02be7cd3d60ad37538bb7e63acf78bbbf) - -- **Added Amazon as a supported site, as well as: Verizon, and Vudu** - ----- - -## v1.1.0.0 / [SpaceK33z@a321795](https://github.com/SpaceK33z/web-to-plex/commit/a321795c6fdf6917542d56f2a45301cd326191c6) - -- **Added The Movie DB as a search source for Plex, Radarr, and Sonarr** - -## v1.1.1.0 / [SpaceK33z@93a79bd](https://github.com/SpaceK33z/web-to-plex/commit/93a79bdb04b0ad43c37538cc25042d9bbfefd642) - -- Utilized the scoring feature for The TV DB - -## v1.1.0.2 / [SpaceK33z@9879cf8](https://github.com/SpaceK33z/web-to-plex/commit/9879cf8c75a5688985b86be5d37460ab456f0dca) - -- Added the icon script to the pop-up feature (descriptions on-hover) -- **Added more sites as API lookups (later revised: v1.2.1.5)** - -## v1.1.2.0 / [SpaceK33z@b3ee310](https://github.com/SpaceK33z/web-to-plex/commit/b3ee310b589a7c04cbdf3c548932a17d0fc1647a) - -- Added CORS for API lookup sites (Apache) -- Fixed adding errors for Sonarr and Radarr - -## v1.2.0.0 / [SpaceK33z@fcac789](https://github.com/SpaceK33z/web-to-plex/commit/fcac789cf1eba7a4dde8288b7c0e7d55ed9ccc1b) - -- Added badge support to the icon -- **Added the context menu feature (searches)** -- Fixed styling errors -- Fixed bugs for Flenix, Vudu, and Verizon - -## v1.2.1.0 / [SpaceK33z@afdeb40](https://github.com/SpaceK33z/web-to-plex/commit/afdeb4052ae277bc0d1d4e1f0b5bc26fb0fc3473) - -- **Added CouchPotato as a supported site, as well as: Rotten Tomatoes** - -## v1.2.1.1 / [SpaceK33z@6fafb8c](https://github.com/SpaceK33z/web-to-plex/commit/6fafb8c9f2a4301926cf082537a4d26e8d549330) - -- Fixed minor CouchPotato and Letterboxd bugs (no IMDb ID) - -## v1.2.1.2 / [SpaceK33z@c7cac01](https://github.com/SpaceK33z/web-to-plex/commit/c7cac01aa3cd0fc25967181c1788b8b3f5d3d463) - -- **Added the "re-search" feature for alternative lookups** - - if the search failed the first time, use a different site to search again -- **Added button location images** - -## v1.2.1.3 / [SpaceK33z@4cf196f](https://github.com/SpaceK33z/web-to-plex/commit/4cf196feeac297c341bca075023b64b09c71a676) - -- Fixed an adding error - -## v1.2.1.4 / [SpaceK33z@f705e7a](https://github.com/SpaceK33z/web-to-plex/commit/f705e7af667229c1eb7b29608ad6adbb28994aa4) - -- Updated Amazon to match site changes - -## v1.2.1.5 / [SpaceK33z@e4ae523](https://github.com/SpaceK33z/web-to-plex/commit/e4ae523b888b3ce35cc969a4ff62769b2599f42e) - -- **Replaced the Apache API with the Open Movie DB** - -## v1.2.1.7 / [SpaceK33z@53c8d5b](https://github.com/SpaceK33z/web-to-plex/commit/53c8d5b917f040621202e84c3ad2132c22db3e2e) - -- **Added the "extra API keys" feature** -- **Added ShowRSS as a supported site** -- **Added the "Save Media Info" feature (to speed up repetitive searches; later revised: v1.3.0.0)** - -## v1.3.0.0 / [SpaceK33z@2aa9695](https://github.com/SpaceK33z/web-to-plex/commit/2aa9695c06decf1b783408f33f5db46cc4bd5b3b) - -- Began using `sessionStorage` before `localStorage` when saving media info -- Made changes to how the plugin finds movies - -## v2.0.0.0 / [SpaceK33z@b28951d](https://github.com/SpaceK33z/web-to-plex/commit/b28951d45f17efc609f2fda5a281193e2c17b613) - -- **Updated code to be scope dependent** -- **Made other changes to make the plugin P.R. ready, see issue [#53](https://github.com/SpaceK33z/web-to-plex/issues/53)** -- **Added the "Plex URL" feature** - ----- - -## v2.0.1.0 / [SpaceK33z@817a7f3](https://github.com/SpaceK33z/web-to-plex/commit/817a7f38680a045f8c688fd357b241b3f811d36c) - -- **Removed manager requirement (Options | Managers)** - - unintentional feature; would force the user to have at least one valid manager -- Hid debugging information - - see issue [#21](https://github.com/SpaceK33z/web-to-plex/issues/21) - -## v3.0.0.0 / [SpaceK33z@934d4c5](https://github.com/SpaceK33z/web-to-plex/commit/934d4c542df495a551769b1188b6cd049f785d18) - -- Made numerous changes as a BETA for v4 (explained below) - -- Created `/change.log` - - used in order to keep up with version changes more easily -- **Removed strict equality for item searches: `/utils.js`** - - equality tests for the IDs (IMDb, TVDb, & TMDb) were strict and unpredictable (Number vs. String) and was therefore "dumbed" down to reduce errors -- Fixed The TV DB error: no air date when series' air date is the current month and year (e.g. Aug 2018 for "Insatiable") - - the `o.first_airdate` property was undefined and would cause a Type error when the airdate was the current month and year -- Changed the color of the version number on the Option's page (for better readability) - - was grey and blended in; changed to white -- **Changed "Save As..." to ignore unidentified movies (e.g. no ID, but still able to save the file)** - - movies saved via direct links (i.e. Flenix) would fail without an ID--the user probably doesn't care and just wants the movie -- Removed extra Flenix buttons (got too complicated); but left the skeleton for extra buttons for future usage - - the last button was ugly and discolored; plus Flenix added more buttons, so I just left the top button -- Changed Trakt's button location -- **Added support for Watcher 3 (Movie NZB Manager)** - - see issue [#24](https://github.com/SpaceK33z/web-to-plex/issues/24) -- **Added support for Trakt's "Watch Now" links** - - see issue [#25](https://github.com/SpaceK33z/web-to-plex/issues/25) - -## v3.0.1.0 / [SpaceK33z@62bc193](https://github.com/SpaceK33z/web-to-plex/commit/62bc193b7f24095024aeb6ec473fccfa7753e849) - -- **Added the download API** - - uses the download API to save files (i.e. Flenix's "Save As" option for non-Flenix domains) -- Restructured the context menu -- **Added the `sendUpdate(String type[, Object options])` method to `/utils.js`** -- Fixed Trakt's button error - -## v3.0.2.0 / [SpaceK33z@44a84c5](https://github.com/SpaceK33z/web-to-plex/commit/44a84c575c6ec8f8a0b83c95fd7c81cc41c9a35e) - -- **Added "Best guess" searching feature (context menu)** - - **Avoided bug: `/background.js` error: `changeStatus` was incorrectly implemented** - - specifically, `id.replace` was a TypeError (`Number..replace` is undefined) -- Fixed Trakt's `getTVDbID` method (was returning a URL instead of a number) -- Fixed VRV's title finding error (the site was updated) -- Added "used managers" to the pop-up feature, i.e. if you have Watcher defined in the options, a link will show up in the pop-up -- Added "instrusive ads" icon to the pop-up -- Fixed Amazon, again... website upgrade -- Fixed Hulu -- who got a much needed website upgrade as well -- Added *transparent* icon images -- **Fixed API lookup feature (TV Shows / TV Maze)** -- Fixed iTunes (Movies) -- who also got a website update -- Changed `/utils.js` and `/background.js` to find items more accurately - - stopped trusting the obtained years (i.e. Trakt's episode air-date shouldn't count as the series' air-date) - - enclosed the `chrome.runtime.onMessage.addListener` method in a `try / catch` for better debugging -- Removed variable ghosting - - variables, most notably `options.watcherURL` would persist after being removed -- Updated the manifest's description - -## v3.1.0.0 / [SpaceK33z@11a23e7](https://github.com/SpaceK33z/web-to-plex/commit/11a23e7f565981bbbcedc7037c840fbcbfeed2f6) - -- **Added Netflix support** -- Made changes to the `String..toCaps` method -- Made searches better via `/utils.js` - - replaced some non-latin characters (i.e. the curly apostrophe) with an acceptable counter-part (a "normal" apostrophe) - -## v3.1.1.0 / [SpaceK33z@1c182f0](https://github.com/SpaceK33z/web-to-plex/commit/1c182f0f37ad357d3c9160f7bfc86a006914a4a9) - -- **Added the "Use Loose" (RegExp) option (enabled by default)** - - this allows the plugin to use a RegExp of the title to find possible matches -- Removed some unimportant code (debugging) -- Fixed file naming for the "Save As..." feature -- Fixed searching error in `/utils.js` - - the strict matching for searches was incorrectly implemented - -## v3.1.1.1 / [SpaceK33z@a0161c2](https://github.com/SpaceK33z/web-to-plex/commit/a0161c220ff4ce5d82456f2eca74f0cdc265839e) - -- Fixed `String..toCaps` in `/utils.js` -- Added `/people` to Trakt's "Watch Now" link feature - - v3.0.0.0 - -## v4.0.0.0 / [SpaceK33z@4aaea32](https://github.com/SpaceK33z/web-to-plex/commit/4aaea32034a6a753db6152fbabad76060e7f1420) - -- **Complete overhaul of button UI/UX** - - Instead of individual buttons and locations, there is a single location (bottom left) - - ~~The button can be right-clicked (contextmenu) for more options~~ - - Created an options icon instead -- Added new icons to reflect above-mentioned changes -- Fixed `String..toCaps` in `/utils.js` -- **Removed Flenix** - - ~~Fixed Flenix's `isMoviePageReady():boolean`~~ -- Fixed [#57](https://github.com/SpaceK33z/web-to-plex/issues/57) - - changed IMDb to use the found year instead of the "release year", e.g. "Del Playa (2017 - USA)" v. "Del Playa (2015)" (same movie, different year) -- Made minor bug changes to `/utils.js` - - if a title wasn't passed to `findPlexMedia` the script would continue and fail -- Removed `/adblockplus.txt` -- Fixed a bug in `/manifest.json` - - The entry for 'VRV' was missing the `/sites/common.css` link -- Suppressed minor errors in `/utils.js` - - When a movie/show isn't found (given a blank page), then fire a silent error event -- Fixed the searching algorithm in `/utils.js` -- **Added the Plugin feature** (due to [#37](https://github.com/SpaceK33z/web-to-plex/issues/37)) - - added support for [Toloka](https://toloka.to/) ("merged" [#37](https://github.com/SpaceK33z/web-to-plex/issues/37)) - - added support for [Shana Project](http://www.shanaproject.com/) - - added support for [My Anime List](https://myanimelist.com/) -- Changed the `showNotification` function into the `Notification` class -- **Updated the download feature** -- **Added the list downloading feature** - - IMDb - - Letterboxd -- Made errors more descriptive - - `/utils.js` - - `/background.js` -- **Added managers as searchable sources** - - Added Radarr - - Added Sonarr -- Added `furnish` to `/utils.js` - - use as `document.furnish(element:string, ?attributes:object, ...children:Element)` - - returns an `Element` with the declared attributes, and children - - e.g. `div = document.furnish('div#id.class[attr]', { onclick: () => {} }, document.furnish('a[href]'))` -- Added `queryBy` to `/utils.js` - - use as `document.queryBy(selectors:string)` - - returns an `Array` that is in the same order as the selectors - - e.g. `document = html { head, body { script } }` -```javascript - document.queryBy('body, script, head'); // => [,