mirror of
https://github.com/konpa/devicon.git
synced 2025-08-01 04:10:22 +02:00
Feature/website cache busting (#813)
* Feature: Cache busting website data (JavaScript and SVG files) by adding '?version' to these filenames * Updated script.js to use CDN versioning style * Cache busting script.js as well, to load cache busting changes * Website cache busting fix * Cache busting script.js using Date.now() Co-authored-by: Thomas Bui <43018778+Thomas-Boi@users.noreply.github.com>
This commit is contained in:
@@ -24,11 +24,11 @@ devicon.controller('IconListCtrl', function($scope, $http, $compile) {
|
|||||||
console.log('Unable to determine latest release version, fallback to master.')
|
console.log('Unable to determine latest release version, fallback to master.')
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var versionStr = '@' + $scope.latestReleaseTagging;
|
||||||
var baseUrl = `https://cdn.jsdelivr.net/gh/${gitHubPath}/`
|
var baseUrl = `https://cdn.jsdelivr.net/gh/${gitHubPath}${versionStr}/`
|
||||||
|
|
||||||
// Get devicon.json
|
// Get devicon.json
|
||||||
$http.get(baseUrl + '/devicon.json').success(function(data) {
|
$http.get(baseUrl + 'devicon.json').success(function(data) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
| Re-format devicon.json
|
| Re-format devicon.json
|
||||||
@@ -126,7 +126,7 @@ devicon.controller('IconListCtrl', function($scope, $http, $compile) {
|
|||||||
*/
|
*/
|
||||||
$scope.selectSvg = function(svgVersion, index) {
|
$scope.selectSvg = function(svgVersion, index) {
|
||||||
|
|
||||||
$http.get(baseUrl + '/icons/' + $scope.selectedIcon.name + '/' + $scope.selectedIcon.name + '-' + svgVersion + '.svg').success(function(data){
|
$http.get(baseUrl + 'icons/' + $scope.selectedIcon.name + '/' + $scope.selectedIcon.name + '-' + svgVersion + '.svg').success(function(data){
|
||||||
|
|
||||||
var svgElement = angular.element(data);
|
var svgElement = angular.element(data);
|
||||||
var innerSvgElement = null;
|
var innerSvgElement = null;
|
||||||
|
@@ -135,7 +135,10 @@
|
|||||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js"></script>
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular-sanitize.min.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular-sanitize.min.js"></script>
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular-animate.min.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular-animate.min.js"></script>
|
||||||
<script src="assets/js/script.js"></script>
|
|
||||||
|
<script>
|
||||||
|
document.write("<script src='assets/js/script.js?" + Date.now() + "'><\/script>");
|
||||||
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
(function(i, s, o, g, r, a, m) {
|
(function(i, s, o, g, r, a, m) {
|
||||||
|
Reference in New Issue
Block a user