{:uriI"file://app/assets/javascripts/application.js?type=application/javascript&pipeline=debug&id=5523b495cb8f48a35ded61e0477cbe557fa9e5024a373daa9039e01493dc49a8: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"(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) { alert(data[0].result); }; ;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=226777457fab5449be1ca34f67bf7f94b281181e943010fbc1538c57f4e81750;TI"file://app/assets/javascripts/application.js?type=application/javascript&pipeline=self&id=63e9dac4e3c55b2bc3c43cb0c550e8aeb6431c5ffdb63edf1c055cc53f9656be;T: charsetI" utf-8;F: digest"%m(S1*j螏w0~;k£G: lengthi:dependencies_digest"%8,jM1`ԍ45ZT&4-:idI"E5523b495cb8f48a35ded61e0477cbe557fa9e5024a373daa9039e01493dc49a8;F: mtimel+WW