From 144e1bbf40f27ecba4a0cd69aab92d2835dda18c Mon Sep 17 00:00:00 2001 From: Yao Wei Date: Mon, 27 Aug 2018 23:12:24 +0800 Subject: [PATCH 1/2] fix: change script loading url --- assets/script.js | 12 ++++++++---- assets/script.min.js | 31 +------------------------------ 2 files changed, 9 insertions(+), 34 deletions(-) diff --git a/assets/script.js b/assets/script.js index ef97276..c7a09c9 100644 --- a/assets/script.js +++ b/assets/script.js @@ -31,7 +31,7 @@ jQuery(function ($) { if ($('#nav.empty').length) { // Fetch site nav from remove JSON api $.getJSON( - 'http://coscup.org/2011/api/menu/?callback=?', + '/2011/api/menu.json', function (data) { var $nav = $('#nav').removeClass('empty'); $nav.html(data[lang].replace(/href="(\/[^\/])/g, 'href="http://coscup.org$1')); @@ -192,7 +192,7 @@ jQuery(function ($) { if ($('#sidebar > .sponsors.empty').length) { // Fetch sponsors from remove JSON api $.getJSON( - 'http://coscup.org/2011/api/sponsors/?callback=?', + '/2011/api/sponsors.json', function (data) { var $sponsors = $('#sidebar > .sponsors').removeClass('empty'); var titles = ( @@ -410,6 +410,7 @@ jQuery(function ($) { } } + /* if ($('#sidebar2 > .socialbuzz').length) { var plurks, twits; $.getJSON( @@ -427,7 +428,9 @@ jQuery(function ($) { } ); } + */ + /* if ($('#ipv6block').length) { if (window.location.hostname === 'ipv6.coscup.org') { if (window._gaq) _gaq.push(['_trackEvent', 'IPv6 2011', 'connected']); @@ -438,7 +441,7 @@ jQuery(function ($) { } else { $.getJSON( // See http://ipv6-test.com/api/ - 'http://v6.ipv6-test.com/api/myip.php?json&callback=?', + 'https://v6.ipv6-test.com/api/myip.php?json&callback=?', function (data) { if (window._gaq) _gaq.push(['_trackEvent', 'IPv6 2011', 'ready but not connected']); $('#ipv6block').addClass('show').append( @@ -449,6 +452,7 @@ jQuery(function ($) { ); } } + */ if ($('#countdown-time').length) { ctTimer = setInterval( @@ -975,7 +979,7 @@ jQuery(function ($) { !/((blog|sponsor|register)\.)?coscup\.org\.?/.test(window.location.domain) ) { $.getJSON( - 'http://coscup.org/2011/api/program/?callback=?', + '/2011/api/program.json', function (data) { programs = data; insertProgramInfo(); diff --git a/assets/script.min.js b/assets/script.min.js index a6e549d..85d4c9f 100644 --- a/assets/script.min.js +++ b/assets/script.min.js @@ -1,30 +1 @@ -jQuery(function(a){function k(){return!a("#title:visible").length}function q(){var b=[];a("#mobileSponsorLogo").remove();a.each({diamond:10,gold:5,silver:2,bronze:1},function(d,g){a("#sidebar > .sponsors ."+d+" a").each(function(){for(var a=g;a--;)b.push(this)})});b.length!==0&&a("#nav").after(a('