diff options
author | Ciaran Gallagher <[email protected]> | 2020-03-26 19:26:05 +0000 |
---|---|---|
committer | Ciaran Gallagher <[email protected]> | 2020-03-26 19:26:05 +0000 |
commit | e2e1ef3c9dddb93127c44080660c7e43fec83ea5 (patch) | |
tree | f9a6895458525d9d9086a7406b33e335b71a0027 | |
parent | 1685564b360a5f32888a2c6f195cd953e3f76159 (diff) | |
download | pasta-e2e1ef3c9dddb93127c44080660c7e43fec83ea5.tar.gz pasta-e2e1ef3c9dddb93127c44080660c7e43fec83ea5.zip |
added some nice to haves
-rw-r--r-- | index.html | 5 | ||||
-rw-r--r-- | js/main.js | 17 |
2 files changed, 17 insertions, 5 deletions
@@ -185,13 +185,14 @@ <strong>Warning:</strong> You have loaded this page over <strong>http</strong>, which means that this may not be secure, especially if you are using public or untrusted networks. <br>If you can only access your Plex server via http, then please continue with caution. <br>However, if you can access your Plex server via <strong>https</strong>, then I recommend reloading this site over https by <strong><a href="https://www.pastatool.com">clicking here</a></strong>. + <br><a href="javascript:void(0)" onclick="hideAlertForever()">Never show this warning again</a> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="form-group"> <label for="plexUrl">Plex URL</label> - <input type="email" class="form-control" id="plexUrl" + <input type="text" class="form-control" id="plexUrl" placeholder="e.g. http://192.168.0.1:32400" autocomplete="on"> <small class="form-text text-muted">This must be a local server, or a server publicly addressable.</small> @@ -231,7 +232,7 @@ <div class="row mt-4"> <div class="col"> <h3>Plex Libraries</h3> - <small>Choose <strong>only</strong> TV Shows. This will not work for Movies.</small> + <small>Choose <strong>only</strong> episodic content (TV Shows, Anime, etc). This does not work for Movies.</small> <div class="table-responsive"> <table id="libraryTable" class="table table-hover mt-3"> <thead> @@ -12,7 +12,12 @@ $(document).ready(() => { // Check if the page was loaded locally or over http and warn them about the value of https if ((location.protocol == "http:") || (location.protocol == "file:")) { - $("#insecureWarning").show(); + if (localStorage.showHttpAlert == 'false') { + + } + else { + $("#insecureWarning").show(); + } } // Validation values to enable the Connect to Plex Button @@ -79,8 +84,14 @@ function forgetDetails() { }); } +function hideAlertForever() { + $("#insecureWarning").hide(); + localStorage.showHttpAlert = 'false'; +} + function connectToPlex() { - plexUrl = $("#plexUrl").val().trim(); + plexUrl = $("#plexUrl").val().trim().replace(/\/+$/, ''); + console.log(plexUrl); plexToken = $("#plexToken").val().trim(); if (plexUrl.toLowerCase().indexOf("http") < 0) { @@ -117,7 +128,7 @@ function connectToPlex() { console.log("Trying to use http over a https site"); $("#authWarningText").html(`<div class="alert alert-warning alert-dismissible fade show mt-3" role="alert"> <strong>Warning:</strong> Error - You are trying to access a http server via the site in https. Please access your server via https, or load this site \ - over https by <a href="http://www.pastatool.com">clicking here</a>. + over http by <a href="http://www.pastatool.com">clicking here</a>. <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> |