mirror of
https://github.com/SEPPDROID/JellyCAT.git
synced 2025-10-26 18:04:09 +00:00
authentication and some experimenting
This commit is contained in:
52
app/js/search.js
Normal file
52
app/js/search.js
Normal file
@@ -0,0 +1,52 @@
|
||||
// /\_/|
|
||||
// { ' ' } JellyCAT
|
||||
// \____\
|
||||
|
||||
function checkLogin() {
|
||||
if (atv.localStorage['jellyfin_loggedin'] === '1') {
|
||||
renderSearchScreen();
|
||||
} else {
|
||||
console.log("No authenticated user.");
|
||||
renderLoginRequestScreen();
|
||||
}
|
||||
}
|
||||
|
||||
function renderSearchScreen() {
|
||||
xmlstr = '<?xml version="1.0" encoding="UTF-8"?>' +
|
||||
'<atv>' +
|
||||
' <head>' +
|
||||
' <script src="http://jcathost.dns/js/jcm.js"/>' +
|
||||
' <script src="http://jcathost.dns/js/searchfuncs.js"/>' +
|
||||
' </head>' +
|
||||
' <body>' +
|
||||
' <search id="com.jellycat.search">' +
|
||||
' <header>' +
|
||||
' <simpleHeader accessibilityLabel="Search">' +
|
||||
' <title>Search</title>' +
|
||||
' </simpleHeader>' +
|
||||
' </header>' +
|
||||
' <baseURL></baseURL>' +
|
||||
' </search>' +
|
||||
' </body>' +
|
||||
'</atv>';
|
||||
xmlDoc = atv.parseXML(xmlstr);
|
||||
atv.loadAndSwapXML(xmlDoc);
|
||||
}
|
||||
|
||||
function renderLoginRequestScreen() {
|
||||
xmlstr = '<?xml version="1.0" encoding="UTF-8"?>' +
|
||||
'<atv>' +
|
||||
' <head>' +
|
||||
' <script src="http://jcathost.dns/js/jcm.js"/>' +
|
||||
' <script src="http://jcathost.dns/js/search.js"/>' +
|
||||
' </head>' +
|
||||
' <body>' +
|
||||
' <dialog id="com.jellycat.pleaselogin-dialog">' +
|
||||
' <title>Not Connected</title>' +
|
||||
' <description>Please go to the settings tab and add a Jellyfin Server.</description>' +
|
||||
' </dialog>' +
|
||||
' </body>' +
|
||||
'</atv>';
|
||||
xmlDoc = atv.parseXML(xmlstr);
|
||||
atv.loadAndSwapXML(xmlDoc);
|
||||
}
|
||||
Reference in New Issue
Block a user