Sha256: 3a34aa4e5145eebca0a105ffdeae8643fbff5e6118f6b2c0cae91e86967b6b34

Contents?: true

Size: 1.9 KB

Versions: 7

Compression:

Stored size: 1.9 KB

Contents

{:uriI"file:///Users/leandro/src/job_notifier/app/assets/javascripts/job_notifier/notifier.js?type=application/javascript&pipeline=self&id=b880edd676b75eef3dc3df5631b554fc61e481d8873d37687e3bed91536f14ff:ET:load_pathI";/Users/leandro/src/job_notifier/app/assets/javascripts;T:
filenameI"T/Users/leandro/src/job_notifier/app/assets/javascripts/job_notifier/notifier.js;T:	nameI"job_notifier/notifier;T:logical_pathI""job_notifier/notifier.self.js;T:content_typeI"application/javascript;T:sourceI"Owindow.JobNotifier = window.JobNotifier || {};

(function(o){
  o.init = function() {
    var body = document.querySelector("body");
    o.jobIdentifier = body.dataset.identifier;

    setInterval(o.poll, 5000);
  };

  o.poll = function() {
    var oReq = new XMLHttpRequest();
    oReq.onload = o.reqListener;
    oReq.onerror = o.onError;
    oReq.open('get', '/job_notifier/jobs.json?identifier=' + o.jobIdentifier, true);
    oReq.send();
  };

  o.reqListener = function() {
    var data = JSON.parse(this.responseText);
    o.onNotify(data);
  };

  o.onNotify = function(data) {
    console.info('Override this method with your own logic. Data: ', data);
  };

  o.onError = function(err) {
    console.error('Error', err);
  };
})(JobNotifier);

console.log(JobNotifier);

document.addEventListener("DOMContentLoaded", JobNotifier.init);
;T:
metadata{:dependencieso:Set:
@hash{
I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"bfile-digest:///Users/leandro/src/job_notifier/app/assets/javascripts/job_notifier/notifier.js;TT:
requiredo;;{:stubbedo;;{:
linkso;;{:charsetI"
utf-8;F:digest"%EFcXu#+n,7,:lengthiO:dependencies_digest"%8-A6RZimWR8'BRZ:idI"Eb880edd676b75eef3dc3df5631b554fc61e481d8873d37687e3bed91536f14ff;F:
mtimel+0W

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
job_notifier-1.4.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/SfXtk8EqOZSFPrq6unouFgejYCnXhnpPLxSN7z03W64.cache
job_notifier-1.1.1 spec/dummy/tmp/cache/assets/sprockets/v3.0/SfXtk8EqOZSFPrq6unouFgejYCnXhnpPLxSN7z03W64.cache
job_notifier-1.1.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/SfXtk8EqOZSFPrq6unouFgejYCnXhnpPLxSN7z03W64.cache
job_notifier-1.0.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/SfXtk8EqOZSFPrq6unouFgejYCnXhnpPLxSN7z03W64.cache
job_notifier-0.2.1 spec/dummy/tmp/cache/assets/sprockets/v3.0/SfXtk8EqOZSFPrq6unouFgejYCnXhnpPLxSN7z03W64.cache
job_notifier-0.2.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/SfXtk8EqOZSFPrq6unouFgejYCnXhnpPLxSN7z03W64.cache
job_notifier-0.1.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/SfXtk8EqOZSFPrq6unouFgejYCnXhnpPLxSN7z03W64.cache