{:uriI"file:///Users/leandro/src/job_notifier/app/assets/javascripts/job_notifier/notifier.js?type=application/javascript&pipeline=self&id=226777457fab5449be1ca34f67bf7f94b281181e943010fbc1538c57f4e81750: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"(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); ;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"%9s.WhUTNWW9}: lengthi:dependencies_digest"%KP|:ۜV}78Jq:idI"E226777457fab5449be1ca34f67bf7f94b281181e943010fbc1538c57f4e81750;F: mtimel+9W