Sha256: eb8ffa26f959d387ab047f166cb299ae55e01601224d753f87e04e3e469a34c2

Contents?: true

Size: 1.68 KB

Versions: 12

Compression:

Stored size: 1.68 KB

Contents

// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require select2
//= require hubstats/bootstrap
//= require_tree .


$(document).ready( function() {
  setTimespan()
});

function setTimespan() {
  var index = readCookie("hubstats_index") || 2;
  var timer = document.getElementById("time-select");

  timer.selectedIndex = index;

  timer.onchange = function() {

    createCookie("hubstats_index",this.selectedIndex,1);
    window.location.reload();
  };
};

function createCookie(name,value,days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
};

function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
};

function eraseCookie(name) {
    createCookie(name,"",-1);
};

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
hubstats-0.3.13 app/assets/javascripts/hubstats/application.js
hubstats-0.3.12 app/assets/javascripts/hubstats/application.js
hubstats-0.3.11 app/assets/javascripts/hubstats/application.js
hubstats-0.3.10 app/assets/javascripts/hubstats/application.js
hubstats-0.3.9 app/assets/javascripts/hubstats/application.js
hubstats-0.3.8 app/assets/javascripts/hubstats/application.js
hubstats-0.3.7 app/assets/javascripts/hubstats/application.js
hubstats-0.3.6 app/assets/javascripts/hubstats/application.js
hubstats-0.3.5 app/assets/javascripts/hubstats/application.js
hubstats-0.3.4 app/assets/javascripts/hubstats/application.js
hubstats-0.3.3 app/assets/javascripts/hubstats/application.js
hubstats-0.3.2 app/assets/javascripts/hubstats/application.js