diff --git a/app.go b/app.go
index 6fa4714..431d221 100644
--- a/app.go
+++ b/app.go
@@ -105,15 +105,20 @@ func displayCinfo() {
fmt.Println("| |")
fmt.Println("| *** DNS *** |")
fmt.Println("| |")
- fmt.Println("| hijack_ip = ", config.HijackIP, " |")
- fmt.Println("| hijack_app = ", config.HijackApp, " |")
- fmt.Println("| hijack_img = ", config.HijackImg, " |")
- fmt.Println("| forward_ip = ", config.ForwardIP, " |") // any big ip address and my design tabs too far :( haha
+ fmt.Println("| hijack_ip = ", config.HijackIP, " |")
+ fmt.Println("| hijack_app = ", config.HijackApp, " |")
+ fmt.Println("| hijack_img = ", config.HijackImg, " |")
+ fmt.Println("| forward_ip = ", config.ForwardIP, " |") // any big ip address and my design tabs too far :( haha
+ fmt.Println("| forward_port = ", config.ForwardPort, " |")
fmt.Println("| |")
fmt.Println("| *** WEB *** |")
fmt.Println("| |")
- fmt.Println("| https_port = ", config.HttpsPort, " |")
- fmt.Println("| https_port = ", config.HttpPort, " |")
+ fmt.Println("| https_port = ", config.HttpsPort, " |")
+ fmt.Println("| https_port = ", config.HttpPort, " |")
+ fmt.Println("| |")
+ fmt.Println("| *** CERTGEN *** |")
+ fmt.Println("| |")
+ fmt.Println("| common_name = ", config.CertName, " |")
fmt.Println("| |")
fmt.Println("=========================================")
fmt.Println("| go to brain.seppjm.com/# |")
diff --git a/app/js/about.js b/app/js/about.js
deleted file mode 100644
index 5b8218d..0000000
--- a/app/js/about.js
+++ /dev/null
@@ -1,81 +0,0 @@
-// /\_/|
-// { ' ' } JellyCAT
-// \____\
-
-//----------------------------DOMView--------------------------------------------
-
-var JCATAboutXML = '\n' +
- '\n' +
- ' \n' +
- ' \n' +
- ' \n' +
- ' \n' +
- ' JellyCAT About\n' +
- ' \n' +
- ' \n' +
- ' \n' +
- ' Close\n' +
- ' \n' +
- ' \n' +
- ' \n' +
- ' \n' +
- '';
-
-
-JCATAboutXML = JCATAboutXML
- .replace(/\$atvcsettings\.hello/g, atv.jcathost.HelloMessage)
- .replace(/\$atvcsettings\.system/g, atv.jcathost.System)
- .replace(/\$atvcsettings\.version/g, atv.jcathost.Version)
- .replace(/\$atvcsettings\.sighost/g, atv.jcathost.SigHost)
- .replace(/\$atvcsettings\.hostip/g, atv.jcathost.HostIP);
-
-
-function generateJCATAboutXML() {
- var doc = atv.parseXML( JCATAboutXML );
-
- console.log( "Creating the view --> " );
- DomViewManager.createView( "JcatAboutView" );
-
- console.log( "Loading the view --> " );
- DomViewManager.loadView( "JcatAboutView", doc );
-
- console.log( "View is loaded" );
-}
\ No newline at end of file
diff --git a/app/js/jcathostinfo.js b/app/js/jcathostinfo.js
index 71d3511..5727b58 100644
--- a/app/js/jcathostinfo.js
+++ b/app/js/jcathostinfo.js
@@ -7,6 +7,7 @@
var JCATHOSTInfoXML = '\n' +
'\n' +
' \n' +
+ ' \n' +
' \n' +
' \n' +
' \n' +
@@ -42,7 +43,7 @@ var JCATHOSTInfoXML = '\n' +
'$atvcsettings.hostip\n' +
']]>\n' +
' \n' +
- ' \n' +
+ ' \n' +
' About\n' +
' \n' +
' \n' +
@@ -71,4 +72,6 @@ function generateJCATHOSTInfoXML() {
DomViewManager.loadView( "JcathostInfoView", doc );
console.log( "View is loaded" );
-}
\ No newline at end of file
+}
+
+// I will keep this DomView generator for reference, however I like my new way of templating better
\ No newline at end of file
diff --git a/app/js/jcm.js b/app/js/jcm.js
index 6ac2ef2..1bbeb7a 100644
--- a/app/js/jcm.js
+++ b/app/js/jcm.js
@@ -946,5 +946,65 @@ var DomViewManager = ( function() {
// ------ End DOM View Manager --------
+// ***************************************************
+// Extra's
+// PlexConnect ATV UTILS
+// https://github.com/iBaa/PlexConnect/blob/master/assets/js/utils.js
+// Some
+
+// atv.Document extensions
+if( atv.Document ) {
+ atv.Document.prototype.getElementById = function(id) {
+ var elements = this.evaluateXPath("//*[@id='" + id + "']", this);
+ if ( elements && elements.length > 0 ) {
+ return elements[0];
+ }
+ return undefined;
+ }
+}
+
+
+// atv.Element extensions
+if( atv.Element ) {
+ atv.Element.prototype.getElementsByTagName = function(tagName) {
+ return this.ownerDocument.evaluateXPath("descendant::" + tagName, this);
+ }
+
+ atv.Element.prototype.getElementByTagName = function(tagName) {
+ var elements = this.getElementsByTagName(tagName);
+ if ( elements && elements.length > 0 ) {
+ return elements[0];
+ }
+ return undefined;
+ }
+}
+
+
+// string extension: format()
+// see http://stackoverflow.com/a/4673436
+if (!String.prototype.format) {
+ String.prototype.format = function() {
+ var args = arguments;
+ return this.replace(/{(\d+)}/g, function(match, number) {
+ return typeof args[number] != 'undefined' ? args[number] : match;
+ });
+ };
+}
+
+// Always love a good hack haha!
+/*
+ * xml updater Major Hack :)
+ */
+function updateContextXML()
+{
+ xmlstr = ' \
+ \
+ ';
+ xmlDoc = atv.parseXML(xmlstr);
+ atv.loadXML(xmlDoc);
+}
+
+
+
console.log('Reached EOF!');
diff --git a/app/js/jellyfin-setup.js b/app/js/jellyfin-setup.js
index 5713802..c50175d 100644
--- a/app/js/jellyfin-setup.js
+++ b/app/js/jellyfin-setup.js
@@ -27,9 +27,10 @@ function setServerAddress() {
function(value) {
// Save server address to localStorage
atv.localStorage['jellyfin_server_address'] = value;
+ fetchDataAndRender();
},
function() {
-
+ fetchDataAndRender();
},
atv.localStorage['jellyfin_server_address'] || ""
);
@@ -44,9 +45,10 @@ function setUsername() {
function(value) {
// Save username to localStorage
atv.localStorage['jellyfin_username'] = value;
+ fetchDataAndRender();
},
function() {
-
+ fetchDataAndRender();
},
atv.localStorage['jellyfin_username'] || ""
);
@@ -61,10 +63,30 @@ function setPassword() {
function(value) {
// Save password to localStorage
atv.localStorage['jellyfin_password'] = value;
+ fetchDataAndRender();
},
function() {
-
+ fetchDataAndRender();
},
atv.localStorage['jellyfin_password'] || ""
+
);
}
+
+// Let's try finding and changing the values
+
+function fetchDataAndRender() {
+ var xhttp = new XMLHttpRequest();
+ xhttp.onreadystatechange = function() {
+ if (this.readyState == 4 && this.status == 200) {
+ var xmlstr = xhttp.responseText;
+ var serverAddress = atv.localStorage['jellyfin_server_address'];
+ var username = atv.localStorage['jellyfin_username'];
+ var modifiedXml = xmlstr.replace(/\$server_address/g, serverAddress).replace(/\$username/g, username);
+ var xmlDoc = atv.parseXML(modifiedXml);
+ atv.loadAndSwapXML(xmlDoc);
+ }
+ };
+ xhttp.open("GET", 'https://' + atv.jcathost.SigHost + '/xml/server-settings.xml', true);
+ xhttp.send();
+}
diff --git a/app/js/settingloader.js b/app/js/settingloader.js
new file mode 100644
index 0000000..d6d96c4
--- /dev/null
+++ b/app/js/settingloader.js
@@ -0,0 +1,42 @@
+// /\_/|
+// { ' ' } JellyCAT
+// \____\
+
+function loadServerSettings(){
+ var xhttp = new XMLHttpRequest();
+ xhttp.onreadystatechange = function() {
+ if (this.readyState == 4 && this.status == 200) {
+ var xmlstr = xhttp.responseText;
+ var serverAddress = atv.localStorage['jellyfin_server_address'];
+ var username = atv.localStorage['jellyfin_username'];
+ var modifiedXml = xmlstr.replace(/\$server_address/g, serverAddress).replace(/\$username/g, username);
+ var xmlDoc = atv.parseXML(modifiedXml);
+ atv.loadXML(xmlDoc);
+ }
+ };
+ xhttp.open("GET", 'https://' + atv.jcathost.SigHost + '/xml/server-settings.xml', true);
+ xhttp.send();
+}
+
+function loadAbout(){
+ var xhttp = new XMLHttpRequest();
+ xhttp.onreadystatechange = function() {
+ if (this.readyState == 4 && this.status == 200) {
+ var xmlstr = xhttp.responseText;
+ var serverAddress = atv.localStorage['jellyfin_server_address'];
+ var username = atv.localStorage['jellyfin_username'];
+ var modifiedXml = xmlstr
+ .replace(/\$server_address/g, serverAddress)
+ .replace(/\$username/g, username)
+ .replace(/\$atvcsettings\.hello/g, atv.jcathost.HelloMessage)
+ .replace(/\$atvcsettings\.system/g, atv.jcathost.System)
+ .replace(/\$atvcsettings\.version/g, atv.jcathost.Version)
+ .replace(/\$atvcsettings\.sighost/g, atv.jcathost.SigHost)
+ .replace(/\$atvcsettings\.hostip/g, atv.jcathost.HostIP);
+ var xmlDoc = atv.parseXML(modifiedXml);
+ atv.loadXML(xmlDoc);
+ }
+ };
+ xhttp.open("GET", 'https://' + atv.jcathost.SigHost + '/xml/about.xml', true);
+ xhttp.send();
+}
\ No newline at end of file
diff --git a/app/xml/about.xml b/app/xml/about.xml
new file mode 100644
index 0000000..d42547e
--- /dev/null
+++ b/app/xml/about.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+ JellyCAT About
+
+
+
+ Close
+
+
+
+
+
diff --git a/app/xml/dvt/devtools.xml b/app/xml/dvt/devtools.xml
index 49bc973..4721b91 100644
--- a/app/xml/dvt/devtools.xml
+++ b/app/xml/dvt/devtools.xml
@@ -3,7 +3,6 @@
-
@@ -16,7 +15,7 @@
These options are intended for testing your development environment only. It is crucial to refrain from utilizing these test functions on server hosts that are not under your management, as doing so may inadvertently expose sensitive data to the server's administrator.