From b204eaca303dfc7ffbde8aacd807102722da644c Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 8 Dec 2016 22:57:23 +0100 Subject: [PATCH 1/4] If we are on vDev then we assume that it is always newer than the latest online release, i.e. version comparion should return 1 --- js/pihole/footer.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/pihole/footer.js b/js/pihole/footer.js index 974dcc50..f8bd0de4 100644 --- a/js/pihole/footer.js +++ b/js/pihole/footer.js @@ -47,6 +47,14 @@ function versionCompare(left, right) { if (typeof left + typeof right != 'stringstring') return false; + // If we are on vDev then we assume that it is always + // newer than the latest online release, i.e. version + // comparion should return 1 + if(left == "vDev") + { + return 1; + } + var aa = left.split("v"), bb = right.split("v"); From eeb8811738c31ed60006df79fa19dc4c6db24137 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 8 Dec 2016 23:01:25 +0100 Subject: [PATCH 2/4] Remove some obsolete checks if on development version --- js/pihole/footer.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/js/pihole/footer.js b/js/pihole/footer.js index f8bd0de4..95f1148d 100644 --- a/js/pihole/footer.js +++ b/js/pihole/footer.js @@ -75,16 +75,14 @@ function versionCompare(left, right) { // Update check $.getJSON("https://api.github.com/repos/pi-hole/pi-hole/releases/latest", function(json) { - // Skip if on dev - if(piholeVersion !== "vDev" && versionCompare(piholeVersion, json.tag_name.slice(1)) < 0) { + if(versionCompare(piholeVersion, json.tag_name.slice(1)) < 0) { // Alert user $("#piholeVersion").html($("#piholeVersion").text() + '(Update available!)'); $("#alPiholeUpdate").show(); } }); $.getJSON("https://api.github.com/repos/pi-hole/AdminLTE/releases/latest", function(json) { - // Skip if on dev - if(webVersion !== "vDev" && versionCompare(webVersion, json.tag_name.slice(1)) < 0) { + if(versionCompare(webVersion, json.tag_name.slice(1)) < 0) { // Alert user $("#webVersion").html($("#webVersion").text() + '(Update available!)'); $("#alWebUpdate").show(); @@ -95,7 +93,7 @@ $.getJSON("https://api.github.com/repos/pi-hole/AdminLTE/releases/latest", funct * Make sure that Pi-hole is updated to at least v2.7, since that is needed to use the sudo * features of the interface. Skip if on dev */ -if(piholeVersion !== "vDev" && versionCompare(piholeVersion, "v2.7") < 0) +if(versionCompare(piholeVersion, "v2.7") < 0) alert("Pi-hole needs to be updated to at least v2.7 before you can use features such as whitelisting/blacklisting from this web interface!") // Session timer From e9a7c2f5f7e5ca7609f0ca9eb0727b6f199919e2 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Thu, 8 Dec 2016 17:20:39 -0500 Subject: [PATCH 3/4] Assume version is vDev if not on master branch This removes the need for a vDev tag, which was less reliable because it needed to be the most recent tag in the dev branch and was really just an sign that the repo was on a branch besides master. --- footer.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/footer.php b/footer.php index 2d3d6d61..309738ff 100644 --- a/footer.php +++ b/footer.php @@ -5,8 +5,20 @@