From 9109af9de2895d7e7c9d66054c630ca95c3af7a2 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 12 Sep 2017 15:25:16 +0200 Subject: [PATCH] added tzdetect js files --- static/js/tzdetect.js | 1245 +++++++++++++++++++++++++++++++++++++ static/js/tzdetect.min.js | 950 ++++++++++++++++++++++++++++ 2 files changed, 2195 insertions(+) create mode 100644 static/js/tzdetect.js create mode 100644 static/js/tzdetect.min.js diff --git a/static/js/tzdetect.js b/static/js/tzdetect.js new file mode 100644 index 00000000..1d7b4c1e --- /dev/null +++ b/static/js/tzdetect.js @@ -0,0 +1,1245 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + django-tz-detect/tzdetect.js at develop · adamcharnock/django-tz-detect + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content +
+ + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+
+
+ + + + + + +
+
+ +
    +
  • +
    + +
    + + + +
    +
    +
    + + Notifications +
    + + + +
    +
    +
    +
    +
  • + +
  • + +
    +
    + + +
    +
    + + +
    + +
  • + +
  • + + + Fork + + + + + +
  • +
+ +

+ + /django-tz-detect + +

+ +
+ +
+ +
+
+ + + Permalink + + + + + + + +
+ + + 3a89797 + + Sep 1, 2013 + + + +
+ + +
+ + +
+ + +
+
+
+ +
+ Raw + Blame + History +
+ + + + + +
+ +
+ +
+ +
+ 72 lines (61 sloc) + + 2.58 KB +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
(function(){
+
areCookiesEnabled = function() {
// Credit for this function goes to: http://stackoverflow.com/a/18114024/764723
var cookieEnabled = navigator.cookieEnabled;
var cookieEnabledSupported;
+
// When cookieEnabled flag is present and false then cookies are disabled.
if (cookieEnabled === false) {
return false;
}
+
// If cookieEnabled is null or undefined then assume the browser
// doesn't support this flag
if (cookieEnabled !== false && !cookieEnabled) {
cookieEnabledSupported = false;
} else {
cookieEnabledSupported = true;
}
+
+
// try to set a test cookie if we can't see any cookies and we're using
// either a browser that doesn't support navigator.cookieEnabled
// or IE (which always returns true for navigator.cookieEnabled)
if (!document.cookie && (!cookieEnabledSupported || /*@cc_on!@*/false)) {
document.cookie = "testcookie=1";
+
if (!document.cookie) {
return false;
} else {
document.cookie = "testcookie=; expires=" + new Date(0).toUTCString();
}
}
+
return true;
};
+
var createXMLHttp = function() {
var xmlHttp = null;
// Use XMLHttpRequest where available
if (typeof(XMLHttpRequest) !== undefined) {
xmlHttp = new XMLHttpRequest();
return xmlHttp;
// IE
} else if (window.ActiveXObject) {
var ieXMLHttpVersions = ['MSXML2.XMLHttp.5.0', 'MSXML2.XMLHttp.4.0', 'MSXML2.XMLHttp.3.0', 'MSXML2.XMLHttp', 'Microsoft.XMLHttp'];
for (var i = 0; i < ieXMLHttpVersions.length; i++) {
try {
xmlHttp = new ActiveXObject(ieXMLHttpVersions[i]);
return xmlHttp;
} catch (e) {}
}
}
};
+
if(!areCookiesEnabled()) {
// If cookies are disabled then storing the timezone in the user's
// session is a hopeless task and will trigger a request for each
// page load. Therefore, we shouldn't bother.
return;
}
+
var xmlHttp = createXMLHttp();
if(xmlHttp) {
xmlHttp.open('post', window.tz_set_endpoint, true);
xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xmlHttp.setRequestHeader('X-CSRFToken', window.csrf_token);
xmlHttp.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xmlHttp.send("offset=" + (new Date()).getTimezoneOffset());
}
+
}());
+ + + +
+ +
+ + + + +
+ +
+ +
+
+ +
+ + + + + + +
+ + + You can't perform that action at this time. +
+ + + + + + + + + + +
+ + You signed in with another tab or window. Reload to refresh your session. + You signed out in another tab or window. Reload to refresh your session. +
+ + + + + + diff --git a/static/js/tzdetect.min.js b/static/js/tzdetect.min.js new file mode 100644 index 00000000..d41baf0d --- /dev/null +++ b/static/js/tzdetect.min.js @@ -0,0 +1,950 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + django-tz-detect/tzdetect.min.js at develop · adamcharnock/django-tz-detect + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content +
+ + + + + + + + + + + + + +
+ +
+ +
+
+ + + +
+
+
+ + + + + + +
+
+ +
    +
  • +
    + +
    + + + +
    +
    +
    + + Notifications +
    + + + +
    +
    +
    +
    +
  • + +
  • + +
    +
    + + +
    +
    + + +
    + +
  • + +
  • + + + Fork + + + + + +
  • +
+ +

+ + /django-tz-detect + +

+ +
+ +
+ +
+
+ + + Permalink + + + + + + + +
+ + + 634d77b + + Aug 30, 2013 + + + +
+ + +
+ + +
+ + +
+
+
+ +
+ Raw + Blame + History +
+ + + + + +
+ +
+ +
+ +
+ 1 lines (1 sloc) + + 968 Bytes +
+
+ + + +
+ + + + + +
(function(){areCookiesEnabled=function(){var e=navigator.cookieEnabled;if(e===false){return false}if(e!==false&&!e){cookieEnabledSupported=false}else{cookieEnabledSupported=true}if(!document.cookie&&(!cookieEnabledSupported||false)){document.cookie="testcookie=1";if(!document.cookie){return false}else{document.cookie="testcookie=; expires="+(new Date(0)).toUTCString()}}return true};var e=function(){var e=null;if(typeof XMLHttpRequest!==undefined){e=new XMLHttpRequest;return e}else if(window.ActiveXObject){var t=["MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0","MSXML2.XMLHttp","Microsoft.XMLHttp"];for(var n=0;n<t.length;n++){try{e=new ActiveXObject(t[n]);return e}catch(r){}}}};if(!areCookiesEnabled()){return}var t=e();if(t){t.open("post",window.tz_set_endpoint,true);t.setRequestHeader("Content-type","application/x-www-form-urlencoded");t.setRequestHeader("X-CSRFToken",window.csrf_token);t.send("offset="+(new Date).getTimezoneOffset())}})();
+ + + +
+ +
+ + + + +
+ +
+ +
+
+ +
+ + + + + + +
+ + + You can't perform that action at this time. +
+ + + + + + + + + + +
+ + You signed in with another tab or window. Reload to refresh your session. + You signed out in another tab or window. Reload to refresh your session. +
+ + + + + +