Skip to content

Commit

Permalink
Merge branch 'beta-branch'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ephellon committed Feb 2, 2020
2 parents 5a0b6a3 + 09d4a7a commit 5bdab23
Show file tree
Hide file tree
Showing 268 changed files with 16,684 additions and 1,005 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.editorconfig
.eslintrc
pkg*.zip
*-beta.zip
*.example
*.lock
build/
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,14 @@ The sites used as search engines (IMDb, TMDb, and TVDb) will automatically creat
<a href="https://chrome.google.com/webstore/detail/web-to-plex/cbpdknicmfolbdpakjihphblioajkcfl"><img alt="Get it for Chrome" src="badge.crx.png" /></a>
<a href="https://addons.mozilla.org/en-US/firefox/addon/web-2-plex/"><img alt="Get it for Firefox" src="badge.moz.png" /></a>
<a href="https://microsoftedge.microsoft.com/addons/detail/njkjmenckbpknhnepepbiikcjeboooon"><img alt="Get it for Edge" src="badge.win.png" /></a>
<a href="https://addons.opera.com/extensions/details/web-to-plex/"><img alt="Get it for Opera" src="badge.opa.png" /></a>

### Install the source code (ZIP)

<a href="src.zip"><img alt="Get it for Chrome" src="badge.src.crx.png" /></a>
<a href="moz.zip"><img alt="Get it for Firefox" src="badge.src.moz.png" /></a>
<a href="win.zip"><img alt="Get it for Edge" src="badge.src.win.png" /></a>
<a href="opa.zip"><img alt="Get it for Opera" src="badge.src.opa.png" /></a>

## Requirements

Expand Down
Binary file modified badge.crx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified badge.moz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added badge.opa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified badge.src.crx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified badge.src.moz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added badge.src.opa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified badge.src.win.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified badge.win.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified moz.xpi
Binary file not shown.
Binary file modified moz.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion moz/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ async function UpdateConfiguration(force_update = false) {
let configuration = load('configuration');

if(force_update || configuration === null || configuration === undefined)
BACKGROUND_CONFIGURATION = await parseConfiguration();
BACKGROUND_CONFIGURATION = configuration = await parseConfiguration();
else
BACKGROUND_CONFIGURATION = configuration;

Expand Down
25 changes: 25 additions & 0 deletions moz/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@

.web-to-plex-prompt-body {
background: #282828;
border: 0 !important;
border-radius: 3px !important;
box-shadow: 0 5px 15px #0008 !important;
display: block !important;

Expand Down Expand Up @@ -278,6 +280,25 @@
margin-top: 5px !important;
}

.web-to-plex-permission:after {
background: #0000;
border-radius: 3px;
border: 0;
color: #cc7b19;
content: "\29eb";
display: inline-block;
font-size: 150%;
padding: 0;
text-align: center;

margin: 0;
position: absolute;
right: 3%;

height: 2em;
width: 2em;
}

.web-to-plex-prompt-footer {
text-align: right !important;
border-bottom-left-radius: 3px !important;
Expand Down Expand Up @@ -505,6 +526,10 @@
margin-top: 0 !important;
}

.web-to-plex-button.hide.closed li:not(:first-child) {
display: none !important;
}

*:not(#plexit-bookmarklet-frame) + .web-to-plex-button.closed .list-item {
float: left !important;
opacity: 0;
Expand Down
48 changes: 27 additions & 21 deletions moz/compare.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
/** GitHub@alexey-bass
* Simply compares two string version values.
/** function compareVer({String|Number} L, {String|Number} R) => {Integer|Boolean};
* Simply compares two version values.
*
* Example:
* Examples:
* compareVer('1.1', '1.2') => -1
* compareVer('1.1', '1.1') => 0
* compareVer('1.2', '1.1') => 1
* compareVer('2.23.3', '2.22.3') => 1
* compareVer('1.2', '1.1') => +1
* compareVer('2.23.3', '2.22.3') => +1
*
* Returns:
* -1 = left is LOWER = right is GREATER
* 0 = they are equal
* 1 = left is GREATER = right is LOWER
* And FALSE if one of input versions are not valid
* -1 => L < R: L is LOWER <-> R is HIGHER
* 0 => L = R: L and R are EQUAL
* +1 => L > R: L is HIGHER <-> R is LOWER
* false => one of the versions is invalid
*
* @function
* @param {String} left Version #1
* @param {String} right Version #2
* @param {String|Number} L Version #1
* @param {String|Number} R Version #2
* @return {Integer|Boolean}
* @author Alexey Bass (albass)
* @since 2011-07-14
* @author Alexey Bass (GitHub@alexey-bass)
* @since 2011-07-14
*/
function compareVer(left, right) {
if(typeof left + typeof right != 'stringstring')
function compareVer(L, R) {
if(!/^(string|number)(string|number)$/i.test(typeof L + typeof R))
return false;

for(let a = left.split('.'), b = right.split('.'), i = 0, l = Math.max(a.length, b.length); i < l; i++) {
if((a[i] && !b[i] && parseInt(a[i]) > 0) || (parseInt(a[i]) > parseInt(b[i])))
L += '';
R += '';

let pI = Number.parseInt || parseInt || (string => +string.replace(/^\s*(-?\d+)[^]*$/, '$1')),
mx = Math.max || ((...numbers) => numbers.sort((a, b) => +a < +b? +1: -1)[0]);

for(let a = L.split('.'), b = R.split('.'), i = 0, l = mx(a.length, b.length), p = pI; i < l; i++) {
if((a[i] && !b[i] && p(a[i]) > 0) || (p(a[i]) > p(b[i])))
return +1
/* left is higher */;
else if((b[i] && !a[i] && parseInt(b[i]) > 0) || (parseInt(a[i]) < parseInt(b[i])))
/* L > R */;
else if((b[i] && !a[i] && p(b[i]) > 0) || (p(a[i]) < p(b[i])))
return -1
/* right is higher */;
/* L < R */;
}

return 0
/* equal */;
/* L = R */;
}
Binary file added moz/foxsearchlight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added moz/go.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added moz/kitsu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions moz/manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "Web to Plex",
"description": "Adds a button on various movie & TV show sites to open the item in Plex, or send to your designated NZB manager for download.",
"homepage_url": "https://github.com/SpaceK33z/web-to-plex/",
"homepage_url": "https://webtoplex.github.io/",

"manifest_version": 2,
"version": "4.1.1.9",
"version": "4.1.1.11",
"browser_specific_settings": {
"gecko": {
"id": "[email protected]",
Expand Down Expand Up @@ -103,8 +103,8 @@
"matches": ["*://itunes.apple.com/*"],
"js": ["utils.js", "itunes$.js"]
},{
"matches": ["*://*.metacritic.com/*"],
"js": ["utils.js", "metacritic$.js"]
"matches": ["*://*.shanaproject.com/*"],
"js": ["utils.js", "shanaproject$.js"]
},{
"matches": ["*://*.fandango.com/*"],
"js": ["utils.js", "fandango$.js"]
Expand Down Expand Up @@ -154,7 +154,7 @@
"matches": ["*://*.tubitv.com/*"],
"js": ["utils.js", "tubi$.js"]
},{
"matches": ["*://ephellon.github.io/web.to.plex/?*", "*://ephellon.github.io/web.to.plex/index.html?*", "*://ephellon.github.io/web.to.plex/login.html?*"],
"matches": ["*://webtoplex.github.io/web/*", "*://ephellon.github.io/web.to.plex/*"],
"js": ["utils.js", "webtoplex$.js"]
},{
"matches": ["*://app.plex.tv/desktop/*"],
Expand Down
2 changes: 0 additions & 2 deletions moz/metacritic$.js

This file was deleted.

8 changes: 5 additions & 3 deletions moz/metacritic.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ let script = {

case 'list':
/* Not yet implemented */
return -1;
break;

default:
Expand All @@ -52,9 +53,10 @@ let script = {

if(!top.WaitingOnAbsoluteReady) {
top.addEventListener('load', event => {
top.AbsoluteReady = true;

$('.web-to-plex-button a.list-action').first.onclick = event => event;
/* Fix event override? */
setInterval(() => {
top.AbsoluteReady = $('.web-to-plex-button').first.classList.contains('show');
}, 1000);
});

top.WaitingOnAbsoluteReady = true;
Expand Down
Binary file added moz/myshows.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 11 additions & 5 deletions moz/options.css
Original file line number Diff line number Diff line change
Expand Up @@ -692,20 +692,26 @@ code[new], [code][new], [type^="code"i][new] {

/* Release is higher than GitHub */
#version[status="high"] {
border-color: #6cc644 !important;
color: #6cc644 !important;
/* Blue */
border-color: #197bcc !important;
color: #197bcc !important;
}

/* Release is same as GitHub */
#version[status="same"] {
border-color: #197bcc !important;
color: #197bcc !important;
/* Green */
border-color: #6cc644 !important;
color: #6cc644 !important;
}

/* Release is lower than GitHub */
#version[status="low"] {
/* Orange/Red (#f3582c) */
border-color: #f66a0a !important;
color: #f3582c !important;
color: #f66a0a !important;
/* Grey */
/* border-color: #949494 !important;
color: #949494 !important; */
}

/* notifications */
Expand Down
46 changes: 22 additions & 24 deletions moz/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ <h3>Login <em>(saved)</em></h3>
</section>
<hr><br>
<section>
<button class="test" target="_blank" href="https://ephellon.github.io/web.to.plex/?movie=492">try out ombi</button>
<button class="test" target="_blank" href="https://webtoplex.github.io/web/?movie=492">try out ombi</button>
</section>
</details>

Expand Down Expand Up @@ -220,7 +220,7 @@ <h3>Login <em>(saved)</em></h3>
</section>
<hr><br>
<section>
<button class="test" target="_blank" href="https://ephellon.github.io/web.to.plex/?movie=492">try out watcher</button>
<button class="test" target="_blank" href="https://webtoplex.github.io/web/?movie=492">try out watcher</button>
</section>
</details>

Expand Down Expand Up @@ -286,7 +286,7 @@ <h3>Login <em>(saved)</em></h3>
</section>
<hr><br>
<section>
<button class="test" target="_blank" href="https://ephellon.github.io/web.to.plex/?movie=492">try out radarr</button>
<button class="test" target="_blank" href="https://webtoplex.github.io/web/?movie=492">try out radarr</button>
</section>
</details>

Expand Down Expand Up @@ -348,7 +348,7 @@ <h3>Login <em>(saved)</em></h3>
</section>
<hr><br>
<section>
<button class="test" target="_blank" href="https://ephellon.github.io/web.to.plex/?movie=492">try out couchpotato</button>
<button class="test" target="_blank" href="https://webtoplex.github.io/web/?movie=492">try out couchpotato</button>
</section>
</details>

Expand Down Expand Up @@ -420,7 +420,7 @@ <h3>Login <em>(saved)</em></h3>
</section>
<hr><br>
<section>
<button class="test" target="_blank" href="https://ephellon.github.io/web.to.plex/?tv=86831">try out medusa</button>
<button class="test" target="_blank" href="https://webtoplex.github.io/web/?tv=86831">try out medusa</button>
</section>
</details>

Expand Down Expand Up @@ -486,7 +486,7 @@ <h3>Login <em>(saved)</em></h3>
</section>
<hr><br>
<section>
<button class="test" target="_blank" href="https://ephellon.github.io/web.to.plex/?tv=86831">try out sonarr</button>
<button class="test" target="_blank" href="https://webtoplex.github.io/web/?tv=86831">try out sonarr</button>
</section>
</details>

Expand Down Expand Up @@ -560,7 +560,7 @@ <h3>Login <em>(saved)</em></h3>
</section>
<hr><br>
<section>
<button class="test" target="_blank" href="https://ephellon.github.io/web.to.plex/?tv=86831">try out Sick Beard</button>
<button class="test" target="_blank" href="https://webtoplex.github.io/web/?tv=86831">try out Sick Beard</button>
</section>
</details>
</article>
Expand All @@ -573,19 +573,17 @@ <h3>Login <em>(saved)</em></h3>
<summary>Theme Settings</summary>

<h2>The Button</h2>
<!--
<section>
What shape should the button be?
<br>
<span class="checkbox" prompt-size="large" prompt-yes="&#9723;" prompt-no="&#9675;">
<!-- When true (checked), will be accessed in CSS (/sites/theme.css) as ".button-shape-box { ... }" --/>
<!-- When true (checked), will be accessed in CSS (/sites/theme.css) as ".button-shape-box { ... }" -->
<input data-option="theme:button-shape" theme="true:box" type="checkbox"/>
<label for="theme:button-shape"></label>
</span>
</section>
-->
<section>
Which direction should the button open (<span orange>&#9711;</span> only)?
Which direction should the button open (&#9711; only)?
<br>
<span class="checkbox" prompt-size="large" prompt-yes="&#8672;" prompt-no="&#8674;">
<!-- When true (checked), will be accessed in CSS (/sites/theme.css) as ".button-location-right { ... }" -->
Expand Down Expand Up @@ -700,8 +698,8 @@ <h3>
<div>
When the user presses the Grab button, the extension should:
<ul>
<li>Grab <em>ALL</em>: Find items not on Plex, and grab them</li>
<li><em>ASK</em> user: Find items not on Plex, and grab what the user approves</li>
<li>Grab <em>ALL</em> &mdash; Find items not on Plex, and grab them</li>
<li><em>ASK</em> user &mdash; Find items not on Plex, and grab what the user approves</li>
</ul>
</div>
<h3>Maximum Auto Grabs</h3>
Expand Down Expand Up @@ -805,7 +803,7 @@ <h3>
Allows the extension to use your manager(s) to find media.<br>
Currently supports: Medusa, Ombi, Radarr, and Sonarr.
</div>
</section>
</section>
<hr>
<section>
<h3>
Expand All @@ -816,8 +814,8 @@ <h3>
</span>
</h3>
<ul>
<li><em>MIN</em>: when a page is loaded, the extension will keep a small number of IDs on hand to speed up the process of finding media</li>
<li><em>ALL</em>: when a page is loaded, the extension will ask for every single ID from your Manager(s)</li>
<li><em>MIN</em> &mdash; when a page is loaded, the extension will keep a small number of IDs on hand to speed up the process of finding media</li>
<li><em>ALL</em> &mdash; when a page is loaded, the extension will ask for every single ID from your Manager(s)</li>
</ul>
</section>
</details>
Expand Down Expand Up @@ -853,19 +851,19 @@ <h3 x-mode>Data Compression</h3>
<label for="use-lzw"></label>
</div>
<div>
<em>WARNING</em>: may cause data loss.<br>
<em>WARNING</em> &mdash; may cause data loss.<br>
Enabling this option will compress your cached search data using the <a href="https://wikipedia.org/wiki/Burrows%E2%80%93Wheeler_transform" target="_blank">BWT (transform)</a> and <a href="https://wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Welch" target="_blank">LZW Compression Algorithm</a>.
</div>
</section>
<hr>
<section>
<h3>Configuration Data (Copy/Paste)</h3>
<input id="json_data" type="text" code placeholder="Enter your configuration data"/>
<div>
Use this for testing purposes only, as it may contain saved usernames and/or passwords.
<br>
You cannot use this feature with <strong>Data Compression</strong> enabled.
</div>
<div>
Use this for testing purposes only, as it may contain saved usernames and/or passwords.
<br>
You cannot use this feature with <strong>Data Compression</strong> enabled.
</div>
<br>
<button type="button" id="json_set">Generate Data</button>
<button type="button" id="json_get">Restore Data</button>
Expand Down Expand Up @@ -893,7 +891,7 @@ <h3>
</span>
</h3>
<div>
<em>WARNING</em>: may cause data loss.<br>
<em>WARNING</em> &mdash; may cause data loss.<br>
Enables developer (debugging) mode, showing advance errors and logging to the console when possible.
</div>
</section>
Expand All @@ -907,7 +905,7 @@ <h3>
<h2>External Links</h2>
<section>
<label>Web to Plex Links</label>
<ul>
<ul>
<li>Browse the <a href="https://github.com/SpaceK33z/web-to-plex/wiki" target="_blank">Web to Plex Wiki</a> for help setting up</li>
<li><a href="https://github.com/SpaceK33z/web-to-plex/issues" target="_blank">Browse issues</a> if you're having trouble</li>
</ul>
Expand Down
Loading

0 comments on commit 5bdab23

Please sign in to comment.