{:uriI"file://app/assets/javascripts/application.js?type=application/javascript&id=9cb177f13bbd4e8e9e85e008641ffabb3cac0ae196ef40e3493e494df7acdd07:ET:load_pathI"app/assets/javascripts;T: filenameI"*app/assets/javascripts/application.js;T: nameI"application;T:logical_pathI"application.js;T:content_typeI"application/javascript;T: sourceI"(function(window){ 'use strict'; function defineLibrary(){ var JobNotifier = {}; JobNotifier.init = function() { var body = document.querySelector('body'); JobNotifier.jobIdentifier = body.dataset.identifier; setInterval(JobNotifier.poll, 5000); }; JobNotifier.poll = function() { var oReq = new XMLHttpRequest(); oReq.onload = JobNotifier.reqListener; oReq.onerror = JobNotifier.onError; oReq.open('get', '/job_notifier/jobs.json?identifier=' + JobNotifier.jobIdentifier, true); oReq.send(); }; JobNotifier.reqListener = function() { var data = JSON.parse(this.responseText); if(data.length > 0) { JobNotifier.onNotify(data); } }; JobNotifier.onNotify = function(data) { console.info('Override this method with your own logic. Data: ', data); }; JobNotifier.onError = function(err) { console.error('Error', err); }; return JobNotifier; } if(typeof(JobNotifier) === 'undefined'){ window.JobNotifier = defineLibrary(); } else{ console.log('JobNotifier already defined.'); } })(window); document.addEventListener('DOMContentLoaded', JobNotifier.init); JobNotifier.onNotify = function(data) { console.info('On notify', data); }; ;T: metadata{ :dependencieso:Set: @hash{I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"Lprocessors:type=application/javascript&file_type=application/javascript;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=226777457fab5449be1ca34f67bf7f94b281181e943010fbc1538c57f4e81750;TI"file://app/assets/javascripts/application.js?type=application/javascript&pipeline=self&id=9067ea4996fbc04c91f2cb7ed38e478a53773cc0127e72b6358e093ec80ddcc9;T: charsetI" utf-8;F: digest"%!'!\ }7o?3: lengthi:dependencies_digest"%>-^r#뽛/%Ef+ l'H!o2-:idI"E9cb177f13bbd4e8e9e85e008641ffabb3cac0ae196ef40e3493e494df7acdd07;F: mtimel+W