1
0
mirror of https://github.com/konpa/devicon.git synced 2025-08-08 07:36:28 +02:00

fetch latest release via github api and use it for showing the header and CDN links

This commit is contained in:
amacado
2020-12-28 20:11:12 +01:00
parent 843c073f17
commit 3f38ec5296
2 changed files with 17 additions and 3 deletions

View File

@@ -8,6 +8,21 @@ var devicon = angular.module('devicon', ['ngSanitize', 'ngAnimate']);
devicon.controller('IconListCtrl', function($scope, $http, $compile) {
// Determination of the latest release tagging
// which is used for showing in the header of the page
// as well as for CDN links
var gitHubPath = 'devicons/devicon';
var url = 'https://api.github.com/repos/' + gitHubPath + '/tags';
$scope.latestReleaseTagging = 'master';
$http.get(url).success(function (data) {
if(data.length > 0) {
$scope.latestReleaseTagging = data[0].name;
}
}).error(function () {
console.log('Unable to determine latest release version, fallback to master.')
});
var baseUrl = window.location.origin + '/dist';
// Get devicon.json
@@ -69,7 +84,6 @@ devicon.controller('IconListCtrl', function($scope, $http, $compile) {
/*------ End of "Re-format devicon.json" ------*/
});
/*
| Change selected icon
|--------------------------------