Cleaning up code

This commit is contained in:
Jason House
2019-07-21 09:46:44 -04:00
parent 723748b387
commit faa156282a
3 changed files with 24 additions and 20 deletions
-6
View File
@@ -10,13 +10,7 @@ function onStart() {
obj = {};
}
/*if (!obj) {
obj = {
'movie_db_api_key': $('#movie_db_api_key').val()
};
} else {*/
obj.movie_db_api_key = $('#movie_db_api_key').val();
/*}*/
document.cookie = JSON.stringify(obj);
location.replace("plex_configuration.html");
+21 -11
View File
@@ -8,13 +8,30 @@ function onStart() {
});
$('#search').click(function () {
$('#warningModal').modal('open');
let obj = JSON.parse(document.cookie);
if (!obj.dialogDontShowAgain) {
$('#warningModal').modal('open');
} else {
if (validateInput()) {
updatedSelectedLibraries();
location.replace("plex_movie_list.html");
}
}
});
$('#agree').click(function () {
if (validateInput()) {
let obj = JSON.parse(document.cookie);
obj.dialogDontShowAgain = $('#dialogDontShowAgain').is(':checked');
document.cookie = JSON.stringify(obj);
updatedSelectedLibraries();
location.replace("plex_movie_list.html");
}
});
setPreloaderVisibility(true);
//populateCookieValues();
getLibraries();
M.AutoInit();
@@ -22,14 +39,7 @@ function onStart() {
document.addEventListener('DOMContentLoaded', function () {
var elems = document.querySelectorAll('.modal');
var instances = M.Modal.init(elems, {
onCloseEnd: function () {
/* if (validateInput()) {
location.replace("plex_movie_list.html");
updatedSelectedLibraries();
} */
}
});
var instances = M.Modal.init(elems);
});
}
@@ -67,7 +67,7 @@
<a class="waves-effect waves-light btn white teal-text" id="back">Back</a>
</div>
<div class="col s1">
<a class="waves-effect waves-light btn" id="search" onclick="searchForMovies()">Search</a>
<a class="waves-effect waves-light btn" id="search">Search</a>
</div>
</div>
@@ -85,7 +85,7 @@
</p>
<p>
<label>
<input type="checkbox" class="filled-in"/>
<input id="dialogDontShowAgain" type="checkbox" class="filled-in"/>
<span>Don't show this dialog again</span>
</label>
</p>
@@ -94,7 +94,7 @@
</div>
<div class="modal-footer">
<a href="#!" class="modal-close waves-effect waves-green btn-flat">Cancel</a>
<a href="#!" class="modal-close waves-effect waves-green btn-flat teal-text">Agree</a>
<a id="agree" href="#!" class="modal-close waves-effect waves-green btn-flat teal-text">Agree</a>
</div>
</div>