Skip to content

Commit

Permalink
Switched from freegeoip to telize
Browse files Browse the repository at this point in the history
  • Loading branch information
ToX82 committed Sep 12, 2015
1 parent 2eb5b70 commit 3aaef3c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cookiebar-grey.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions cookiebar-latest.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin URL: http://cookie-bar.eu/
@author: Emanuele "ToX" Toscano
@description: Cookie Bar is a free & simple solution to the EU cookie law.
@version: 1.5.3
@version: 1.5.4
*/

/*
Expand Down Expand Up @@ -85,7 +85,7 @@ function setupCookieBar() {
*/
var checkEurope = new XMLHttpRequest();

checkEurope.open('GET', 'https://freegeoip.net/json/', true);
checkEurope.open('GET', 'http://www.telize.com/geoip', true);
checkEurope.onreadystatechange = function() {
if (checkEurope.readyState === 4 && checkEurope.status === 200) {
clearTimeout(xmlHttpTimeout);
Expand Down Expand Up @@ -118,10 +118,10 @@ function setupCookieBar() {
* @param null
* @return null
*/
var xmlHttpTimeout = setTimeout(ajaxTimeout, 1000);
var xmlHttpTimeout = setTimeout(ajaxTimeout, 1500);
function ajaxTimeout() {
checkEurope.abort();
console.log('cookieBAR - Timeout for freegeoip');
console.log('cookieBAR - Timeout for ip geolocalion');

if (document.cookie.length > 0 || window.localStorage.length > 0) {
var accepted = getCookie();
Expand All @@ -147,7 +147,7 @@ function setupCookieBar() {
var path = scriptPath.replace(/[^\/]*$/, '');
var stylesheet = document.createElement('link');
stylesheet.setAttribute('rel', 'stylesheet');
stylesheet.setAttribute('href', path + 'cookiebar' + theme + '.min.css');
stylesheet.setAttribute('href', path + 'cookiebar' + theme + '.css');
document.head.appendChild(stylesheet);

// Load the correct language messages file and set some variables
Expand Down
2 changes: 1 addition & 1 deletion cookiebar-latest.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3aaef3c

Please sign in to comment.