1(function (global) { 2 3 4 var $ = jQuery; 5 6 7 var ClJobengine = global.ClJobengine = { 8 /** 9 global events agreggator 10 events: apply:completed,apply:with-profile,apply:howto-displayed,apply:external-clicked 11 */ 12 vent: _.extend({}, Backbone.Events), 13 Views: {} 14 }; 15 16 ClJobengine.Views.BlockUI = Backbone.View.extend({ 17 defaults: { 18 image: cl_jobengine_globals.imgURL + '/loading.gif', 19 opacity: '0.5', 20 background_position: 'center center', 21 background_color: '#ffffff' 22 }, 23 24 isLoading: false, 25 26 initialize: function (options) { 27 //var defaults = _.clone(this.defaults); 28 options = _.extend(_.clone(this.defaults), options); 29 30 var loadingImg = options.image; 31 this.overlay = jQuery('<div class="loading-blur loading"><div class="loading-overlay"></div><div class="loading-img"></div></div>'); 32 this.overlay.find('.loading-img').css({ 33 'background-image': 'url(' + options.image + ')', 34 'background-position': options.background_position 35 }); 36 37 this.overlay.find('.loading-overlay').css({ 38 'opacity': options.opacity, 39 'filter': 'alpha(opacity=' + options.opacity * 100 + ')', 40 'background-color': options.background_color 41 }); 42 this.$el.html(this.overlay); 43 44 this.isLoading = false; 45 }, 46 47 render: function () { 48 this.$el.html(this.overlay); 49 return this; 50 }, 51 52 block: function (element) { 53 var $ele = $(element); 54 // if ( $ele.css('position') !== 'absolute' || $ele.css('position') !== 'relative'){ 55 // $ele.css('position', 'relative'); 56 // } 57 this.overlay.css({ 58 'position': 'absolute', 59 'top': $ele.offset().top, 60 'left': $ele.offset().left, 61 'width': $ele.outerWidth(), 62 'height': $ele.outerHeight() 63 }); 64 65 this.isLoading = true; 66 67 this.render().$el.show().appendTo($('body')); 68 }, 69 70 unblock: function () { 71 this.$el.remove(); 72 this.isLoading = false; 73 }, 74 75 finish: function () { 76 this.$el.fadeOut(500, function () { 77 $(this).remove(); 78 }); 79 this.isLoading = false; 80 } 81 }); 82 83 ClJobengine.vent.on('plugins:placeholder-shim:refresh', function () { 84 jQuery('input, textarea').placeholder(); 85 }) 86 87 88 // })(); 89 // }); 90 91})(window); 92 93 94///piwik analytics - custom events 95(function () { 96 var piwik = { 97 queueCallback: function (cb) { 98 if (cb) { 99 if (window.Piwik) { 100 _paq.push([cb]); 101 } else { 102 cb(); 103 } 104 } 105 }, 106 107 trackApply: function (job, label, cb) { 108 //console.log('trackApply', job.cl_id); 109 _paq.push(['setCustomVariable', 1, 'employer_id', job.employer_id, 'page']); 110 _paq.push(['setCustomVariable', 2, 'job_id', job.cl_id, 'page']); 111 112 _paq.push(['trackEvent', 'Apply', label]); //Application received 113 }, 114 115 trackApplyWithProfile: function (job, cb) { 116 piwik.trackApply(job, 'WithProfile', cb); 117 piwik.trackApply(job, 'Completed', cb); 118 if(window._paq){ 119 window._paq.push(["trackGoal", 16]); 120 console.log('PIWIK_GOAL Apply with profile'); 121 } 122 }, 123 124 trackApplyWithEmail: function (job, cb) { 125 piwik.trackApply(job, 'WithProfileByEmail', cb); 126 piwik.trackApply(job, 'Completed', cb); 127 }, 128 129 trackHowtoDisplayed: function (job, cb) { 130 piwik.trackApply(job, 'HowToDisplayed', cb); 131 piwik.trackApply(job, 'Completed', cb); 132 }, 133 134 trackApplyWithInstruction: function (job, cb) { 135 piwik.trackApply(job, 'ApplyWithInstruction', cb); 136 piwik.trackApply(job, 'Completed', cb); 137 }, 138
139 trackApplyWithCustomInstruction: function (job, cb) { 140 piwik.trackApply(job, 'ApplyWithJobDescInstruction', cb); 141 piwik.trackApply(job, 'Completed', cb); 142 }, 143 144 trackApplyExternalClick: function (job, cb) { 145 piwik.trackApply(job, 'External', cb); 146 piwik.trackApply(job, 'Completed', cb); 147 } 148 149 } 150 151 // ClJobengine.vent.on('apply:completed', piwik.trackApply); 152 ClJobengine.vent.on('apply:with-profile', piwik.trackApplyWithProfile); 153 ClJobengine.vent.on('apply:with-email', piwik.trackApplyWithEmail); 154 //ClJobengine.vent.on('apply:howto-displayed', piwik.trackHowtoDisplayed); 155 ClJobengine.vent.on('apply:external-clicked', piwik.trackApplyExternalClick); 156 ClJobengine.vent.on('apply:with-instruction', piwik.trackApplyWithInstruction); 157 ClJobengine.vent.on('apply:with-custom-instruction', piwik.trackApplyWithCustomInstruction); 158 159})(); 160 161var AgileCRMTracker = { 162 registerVisitor: function(user){ 163 _agile.set_email(user.email); 164 //console.log('agile-crm: set email: %s', user.email); 165 this.verifyContact(user); 166 }, 167 168 /** make sure that contact is created */ 169 verifyContact: function(user){ 170 var self = this; 171 172 _agile.get_contact(user.email, { 173 error: function(data){ 174 if(data.error.indexOf('Contact not found')!=-1){ 175 self.createContact(user); 176 } 177 } 178 }); 179 }, 180 createContact: function(user){ 181 var contact = { 182 email: user.email, 183 first_name: user.first_name, 184 last_name: user.last_name, 185 tags: 'Job Seeker', 186 custom_id: user.user_id 187 } 188 _agile.create_contact(contact, { 189 error: function(data){ 190 console.error(data) 191 } 192 }); 193 } 194}; 195 196window.trackAgileVisitor = function(user){ 197 if(window._agile == undefined){ 198 console.log('AgileCRM not installed'); 199 return; 200 } 201 AgileCRMTracker.registerVisitor(user) 202};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.