{:uriI"file://app/assets/javascripts/application.js?type=application/javascript&id=f4f405e7dcfbf5c7365627610d89276e721e84815f7c085887f633a297e4ee17: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"j(function(window){ 'use strict'; function defineLibrary(){ var JobNotifier = {}; JobNotifier.init = function() { var body = document.querySelector('body'); JobNotifier.jobIdentifier = body.dataset.identifier; JobNotifier.rootUrl = body.dataset.rootUrl; setInterval(JobNotifier.poll, 5000); }; JobNotifier.poll = function() { var oReq = new XMLHttpRequest(); oReq.onload = JobNotifier.reqListener; oReq.onerror = JobNotifier.onError; var url = JobNotifier.rootUrl + 'job_notifier/jobs.json?identifier=' + JobNotifier.jobIdentifier; oReq.open('get', url, 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=bf83277485d9e7aa951e70dd8ec79259d7ac58ddb7a6cef1f555e66c3121e338;TI"file://app/assets/javascripts/application.js?type=application/javascript&pipeline=self&id=cddefc3231407151c6908f052410cb13d63c04f02f79d33d0e501cbde093a62c;T: charsetI" utf-8;F: digest"%Aq]g B y'^Bv9r{<u: lengthij:dependencies_digest"% /7n#;d#@nUdaZ 5N:idI"Ef4f405e7dcfbf5c7365627610d89276e721e84815f7c085887f633a297e4ee17;F: mtimel+%CW