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:
@@ -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
|
||||
|--------------------------------
|
||||
|
Reference in New Issue
Block a user