Browse Source

Added current version number and fix GH links to versions

causefx 8 years ago
parent
commit
4e57b38c75
4 changed files with 11 additions and 29 deletions
  1. 2 2
      api/functions.php
  2. 1 0
      api/index.php
  3. 7 5
      js/functions.js
  4. 1 22
      js/version.json

+ 2 - 2
api/functions.php

@@ -1,7 +1,7 @@
 <?php
 // ===================================
 // Organizr Version
-$GLOBALS['installedVersion'] = '2.0.0-alpha';
+$GLOBALS['installedVersion'] = '2.0.0-alpha-100';
 // ===================================
 //Set GLOBALS from config file
 $GLOBALS['userConfigPath'] = __DIR__.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php';
@@ -1207,7 +1207,7 @@ function validateToken($token,$global=false){
                 "groupID"=>$userInfo['groupID'],
                 "email"=>$userInfo['email'],
                 "image"=>$userInfo['image'],
-                "loggedin"=>true
+                "loggedin"=>true,
             );
         }
     }else{

+ 1 - 0
api/index.php

@@ -406,6 +406,7 @@ switch ($function) {
                 $status['categories'] = loadTabs()['categories'];
                 $status['tabs'] = loadTabs()['tabs'];
                 $result['data'] = $status;
+				$result['branch'] = $GLOBALS['branch'];
                 break;
             default:
                 $result['status'] = 'error';

+ 7 - 5
js/functions.js

@@ -1050,8 +1050,9 @@ function loadCategoryEditor(){
 	});
 }
 function updateCheck(){
-	organizrAPI('get','js/version.json').success(function(data) {
-		for (var a in reverseObject(data)){
+	githubVersions().success(function(data) {
+		var json = JSON.parse(data);
+		for (var a in reverseObject(json)){
 			var latest = a;
 			break;
 		}
@@ -1061,7 +1062,7 @@ function updateCheck(){
 		}else{
 			console.log('Update Function: '+latest+' is the newest version');
 		}
-		$('#githubVersions').html(buildVersion(reverseObject(data)));
+		$('#githubVersions').html(buildVersion(reverseObject(json)));
 	}).fail(function(xhr) {
 		console.error("Organizr Function: Github Connection Failed");
 	});
@@ -1102,7 +1103,7 @@ function organizrAPI(type,path,data=null){
 }
 function githubVersions() {
 	return $.ajax({
-		url: "js/version.json",
+		url: "https://raw.githubusercontent.com/causefx/Organizr/"+activeInfo.branch+"/js/version.json",
 	});
 }
 function organizrConnect(path){
@@ -1308,7 +1309,8 @@ function launch(){
 			osVersion:bowser.osversion,
 			serverOS:json.data.status.os,
 			phpVersion:json.data.status.php,
-			token:json.data.user.token
+			token:json.data.user.token,
+			branch:json.branch
 		};
 		console.log("%cOrganizr","background: #000; color: #66D9EF; font-size: 24px; font-family: Monospace; padding : 5px 234px 5px 10px; border-radius: 5px 5px 0 0;");
 		console.log("%cVersion: "+currentVersion,"background: #AD80FD; color: #333333; font-size: 12px; font-family: Monospace; padding : 2px 207.5px 5px 10px;");

+ 1 - 22
js/version.json

@@ -1,30 +1,9 @@
 {
-    "2.0.0-alpha": {
+    "2.0.0-alpha.100": {
         "date":"20171201",
         "title": "Relase Title1",
         "new": "awesome things|that thing",
         "fixed": "this|that",
         "notes": ""
-    },
-	"2.0.0-beta": {
-        "date":"20171205",
-        "title": "Relase Title2",
-        "new": "",
-        "fixed": "how|you|doing",
-        "notes": "somehere"
-    },
-	"2.0.0-rc1": {
-        "date":"20171208",
-        "title": "Relase Title3",
-        "new": "nzbget|sonarr",
-        "fixed": "php bug",
-        "notes": ""
-    },
-	"2.0.0-rc2": {
-        "date":"20171215",
-        "title": "Almost Ready for Prime Time",
-        "new": "All new Settings Page|Another Cool ass area|that other thing",
-        "fixed": "bug over here|bug over there|oh yeah and another bug there",
-        "notes": "i sure hope all of this works|if it doesnt i will be mad!"
     }
 }