Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Get rid of include_cookies. Don't know why we're tracking that.

  • Loading branch information...
commit 7520bc30d89447b45a42d492b2a0e65c90b8aba0 1 parent f40ef32
Robert Fischer authored

Showing 1 changed file with 4 additions and 8 deletions. Show diff stats Hide diff stats

  1. +4 8 jquery.periodicalupdater.js
12 jquery.periodicalupdater.js
@@ -16,9 +16,6 @@
16 16 */
17 17
18 18 (function ($) {
19   - var included_cookies = false; // Has the cookies script loaded? (i.e. it's safe to call $.cookie)
20   - if($.cookie) included_cookies = true;
21   -
22 19 // The free version
23 20 $.PeriodicalUpdater = function(url, options, callback){
24 21 if(!options) options = {};
@@ -67,7 +64,7 @@
67 64 }
68 65 timerInterval = interval;
69 66 pu_log('resetting timer to ' + timerInterval + '.', 2);
70   - if(settings.cookie && included_cookies) {
  67 + if(settings.cookie && $.cookie) {
71 68 $.cookie(settings.cookie.name, timerInterval, settings.cookie);
72 69 }
73 70 timer = setTimeout(getdata, timerInterval);
@@ -104,9 +101,8 @@
104 101 settings.cookie.name = url;
105 102 }
106 103
107   - if(!included_cookies) {
  104 + if(!$.cookie) {
108 105 $.getScript("https://raw.github.com/carhartl/jquery-cookie/master/jquery.cookie.js", function() {
109   - included_cookies = true;
110 106 pu_log("Loaded the cookies handler script", 2);
111 107 if($.cookie(settings.cookie.name)) {
112 108 pu_log("Not runatonce and have cookie value", 2);
@@ -188,7 +184,7 @@
188 184 stop: function () {
189 185 pu_log("Calling stop");
190 186 maxCalls = -1;
191   - if(settings.cookie && included_cookies) {
  187 + if(settings.cookie && $.cookie) {
192 188 $.cookie(settings.cookie.name, null, settings.cookie);
193 189 }
194 190 return;
@@ -248,7 +244,7 @@
248 244 if (settings.runatonce) {
249 245 pu_log("Executing a call immediately", 1);
250 246 getdata(true);
251   - } else if(included_cookies && $.cookie(settings.cookie.name)) {
  247 + } else if($.cookie && $.cookie(settings.cookie.name)) {
252 248 // Do nothing (already handled above)
253 249 } else {
254 250 pu_log("Enqueing a the call for after " + timerInterval, 1);

0 comments on commit 7520bc3

Please sign in to comment.
Something went wrong with that request. Please try again.