{:uriI"file://app/assets/javascripts/application.js?type=application/javascript&pipeline=debug&id=09206fcccb6947f7749a6c0ffae209f3b3483a76da5c4ad11eacb42f874ec68e:ET:load_pathI"app/assets/javascripts;T: filenameI"*app/assets/javascripts/application.js;T: nameI"application;T:logical_pathI"application.debug.js;T:content_typeI"application/javascript;T: sourceI"var JobNotifier = {}; window.JobNotifier = 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); console.log(JobNotifier); JobNofifier.onNotify = function(mensaje) { console.log('bla', mensaje); }; ;T: metadata{ :dependencieso:Set: @hash{I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"[processors:type=application/javascript&file_type=application/javascript&pipeline=debug;TTI"8file-digest://app/assets/javascripts/application.js;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;TTI")file-digest://app/assets/javascripts;TTI"1file-digest://app/assets/images/job_notifier;TTI":file-digest://app/assets/images/job_notifier/notifier;TTI"6file-digest://app/assets/javascripts/job_notifier;TTI"?file-digest://app/assets/javascripts/job_notifier/notifier;TTI"6file-digest://app/assets/stylesheets/job_notifier;TTI"?file-digest://app/assets/stylesheets/job_notifier/notifier;TTI"Qfile-digest:///Users/leandro/src/job_notifier/app/assets/images/job_notifier;TTI"Zfile-digest:///Users/leandro/src/job_notifier/app/assets/images/job_notifier/notifier;TTI"Vfile-digest:///Users/leandro/src/job_notifier/app/assets/javascripts/job_notifier;TTI"_file-digest:///Users/leandro/src/job_notifier/app/assets/javascripts/job_notifier/notifier;TT: linkso;;{: included[I"file:///Users/leandro/src/job_notifier/app/assets/javascripts/job_notifier/notifier.js?type=application/javascript&pipeline=self&id=a03a56f938b696be36f9a08dfdedbd4d50367fe137fcc552d6fb5f027db06c1d;TI"file://app/assets/javascripts/application.js?type=application/javascript&pipeline=self&id=6b387803441ca09d5b98e3676123a8d1b9d5826fd43da65d2aead7872e182438;T: charsetI" utf-8;F: digest"%W7ghm4$:Yy$V8~: lengthi:dependencies_digest"%>7񥽧}(v/}>v@:idI"E09206fcccb6947f7749a6c0ffae209f3b3483a76da5c4ad11eacb42f874ec68e;F: mtimel+"2W