1var jobsearch_selectize_fields = ''; 2var jobsearch_cfselectize_fields = ''; 3jQuery(document).on('click', '.email-jobs-top', function () { 4 jQuery(".job-alert-container-top .validation").slideUp(); 5 jQuery(".job-alert-container-top").slideToggle(); 6 jQuery(".job-alert-container-top").parent('.jobsearch-search-filter-wrap').toggleClass('jobsearch-add-padding'); 7 return false; 8}); 9 10jQuery(document).on('click', '.btn-close-job-alert-box', function () { 11 jQuery(".job-alert-container-top").slideToggle(); 12 return false; 13}); 14 15jQuery(document).on('click', '.jobalert-submit', function (ev) { 16 ev.preventDefault(); 17 var _this = jQuery(this); 18 if (_this.hasClass('jobalert-save-withlogin')) { 19 jobsearch_modal_popup_open('JobSearchModalLogin'); 20 jQuery('.reg-tologin-btn').trigger('click'); 21 return false; 22 } 23 var pop_html_con = jQuery('#popup_alert_filtrscon'); 24 var sh_globrnd_id = pop_html_con.find('.jobsearch-job-shatts').attr('data-id'); 25 var job_shatts_str = pop_html_con.find('.jobsearch-job-shatts').html(); 26 27 var jobalert_name_error = jobsearch_jobalerts_vars.name_field_error; 28 var jobalert_email_error = jobsearch_jobalerts_vars.email_field_error; 29 30 var validate_msg_con = jQuery(".job-alert-container-top .validation"); 31 validate_msg_con.slideUp(); 32 33 var frequency = jQuery('input[name="alert-frequency"]:checked').val(); 34 if (typeof frequency == "undefined") { 35 frequency = "never"; 36 } 37 38 var email = _this.parents('.job-alert-box').find(".email-input-top").val(); 39 40 var name = _this.parents('.job-alert-box').find(".name-input-top").val(); 41 var re = RegExp(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,20}$/i); 42 if (!re.test(email)) { 43 validate_msg_con.find('label').html(jobalert_email_error); 44 validate_msg_con.addClass("error").slideDown(); 45 return false; 46 } else if (name == '') { 47 validate_msg_con.find('label').html(jobalert_name_error); 48 validate_msg_con.addClass("error").slideDown(); 49 return false; 50 } 51 52 var popup_main = jQuery('#JobSearchModalJobAlertsSelect'); 53 54 popup_main.find('.model-heading h2').html(name); 55 popup_main.find('input[name=alerts_name]').val(name); 56 popup_main.find('input[name=alerts_email]').val(email); 57 58 var main_filtrs_form = _this.parents('form')[0]; 59 var _send_data = new FormData(main_filtrs_form); 60 _send_data.append('alert_frequency', frequency); 61 _send_data.append('sh_globrnd_id', sh_globrnd_id); 62 _send_data.append('job_shatts_str', job_shatts_str); 63 _send_data.append('action', 'jobsearch_alrtmodal_popup_openhtml'); 64 65 _this.attr('disabled', true); 66 _this.html('<i class="fa fa-refresh fa-spin"></i>'); 67 var request = jQuery.ajax({ 68 type: "POST", 69 url: jobsearch_jobalerts_vars.ajax_url, 70 processData: false, 71 contentType: false, 72 data: _send_data, 73 dataType: "json", 74 }); 75 request.done(function (response) { 76 if (typeof response.pop_html && response.pop_html != '') { 77 pop_html_con.html(response.pop_html); 78 } 79 jobsearch_modal_popup_open('JobSearchModalJobAlertsSelect'); 80 _this.html(jobsearch_jobalerts_vars.submit_txt); 81 _this.removeAttr('disabled'); 82 jobsearch_selectize_fields = jQuery('.jobsearch-profile-select.to-fancyselect-con').find('select').selectize({ 83 render: { 84 option: function (data, escape) { 85 if (typeof data.depend !== undefined) { 86 return "<div data-depend='" + data.depend + "' data-optid='" + data.optid + "'>" + data.text + "</div>" 87 } 88 } 89 }, 90 plugins: ['remove_button'], 91 allowEmptyOption: true 92 }); 93 jobsearch_cfselectize_fields = jQuery('.jobsearch-profile-select.to-cffancyselect-con').find('select').selectize({ 94 plugins: ['remove_button'], 95 allowEmptyOption: true 96 }); 97 });
98 request.fail(function (jqXHR, textStatus) { 99 _this.html(jobsearch_jobalerts_vars.submit_txt); 100 _this.removeAttr('disabled'); 101 }); 102 103 return false; 104}); 105 106jQuery(document).on("click", '.jobsearch-alrtslectize-remove', function () { 107 var _this = jQuery(this); 108 var this_id = jQuery(this).attr('data-selid'); 109 var selectize = jobsearch_selectize_fields[this_id].selectize; 110 selectize.clear(); 111 _this.hide(); 112}); 113 114jQuery(document).on("click", '.jobsearch-alrtslectizecf-remove', function () { 115 var _this = jQuery(this); 116 var this_id = jQuery(this).attr('data-selid'); 117 var selectize = jobsearch_cfselectize_fields[this_id].selectize; 118 selectize.clear(); 119 _this.hide(); 120}); 121 122jQuery(document).on("change", '.to-fancyselect-con select', function () { 123 var _this = jQuery(this); 124 var this_remove_btn = _this.parents('.to-fancyselect-con').find('.jobsearch-alrtslectize-remove'); 125 if (this_remove_btn.length > 0) { 126 if (_this.val() == '') { 127 this_remove_btn.hide(); 128 } else { 129 this_remove_btn.removeAttr('style'); 130 } 131 } 132}); 133 134jQuery(document).on("change", '.to-cffancyselect-con select', function () { 135 var _this = jQuery(this); 136 var this_remove_btn = _this.parents('.to-cffancyselect-con').find('.jobsearch-alrtslectizecf-remove'); 137 if (this_remove_btn.length > 0) { 138 if (_this.val() == '') { 139 this_remove_btn.hide(); 140 } else { 141 this_remove_btn.removeAttr('style'); 142 } 143 } 144}); 145 146jQuery(document).on('click', '.jobsearch-savejobalrts-sbtn,.jobsearch-updjobalrts-sbtn', function () { 147 var _this = jQuery(this); 148 var pop_html_con = jQuery('#popup_alert_filtrscon'); 149 var job_shatts_str = pop_html_con.find('.jobsearch-job-shatts').html(); 150 var pop_msg_con = _this.parent('.alret-submitbtn-con').find('.falrets-msg'); 151 var main_filtrs_form = _this.parents('form')[0]; 152 var _send_data = new FormData(main_filtrs_form); 153 154 _send_data.append('window_location', window.location.toString()); 155 _send_data.append('search_query', jQuery(".jobs_query").text()); 156 _send_data.append('job_shatts_str', job_shatts_str); 157 158 _this.attr('disabled', true); 159 _this.html('<i class="fa fa-refresh fa-spin"></i>'); 160 161 var request = jQuery.ajax({ 162 type: "POST", 163 url: jobsearch_jobalerts_vars.ajax_url, 164 processData: false, 165 contentType: false, 166 data: _send_data, 167 dataType: "json", 168 }); 169 request.done(function (response) { 170 var msg_before = '<div class="alert alert-success"><i class="fa fa-check"></i> '; 171 var msg_after = '</div>'; 172 if (response.success == false) { 173 var msg_before = '<div class="alert alert-danger"><i class="fa fa-times"></i> '; 174 var msg_after = '</div>'; 175 } 176 if (typeof response.message && response.message != '') { 177 pop_msg_con.html(msg_before + response.message + msg_after); 178 if (response.success == true) { 179 var closing_alrt_popup = setInterval(function () { 180 jQuery('.jobsearch-modal').removeClass('fade-in').addClass('fade'); 181 jQuery('body').removeClass('jobsearch-modal-active'); 182 clearInterval(closing_alrt_popup); 183 }, 1000); 184 } 185 } 186 _this.html(jobsearch_jobalerts_vars.save_alert_txt); 187 _this.removeAttr('disabled'); 188 window.location.reload(); 189 }); 190 request.fail(function (jqXHR, textStatus) { 191 _this.html(jobsearch_jobalerts_vars.save_alert_txt); 192 _this.removeAttr('disabled'); 193 }); 194 return false; 195}); 196 197jQuery(document).on('change', '#popup_alert_filtrsform input.chagn-keywords-field, #popup_alert_filtrsform select', function () { 198 var _this = jQuery(this); 199 var pop_html_con = jQuery('#modpop-criteria-tags'); 200 var lodear_con = pop_html_con.find('.tags-loder'); 201 202 var main_filtrs_form = _this.parents('form')[0]; 203 var _send_data = new FormData(main_filtrs_form); 204 205 _send_data.delete('action'); 206 _send_data.append('jobsearch_alert_tagsup', '1'); 207 _send_data.append('action', 'jobsearch_jobsearch_alert_tags_update'); 208 209 210 pop_html_con.append('<span class="tags-loder"><i class="fa fa-refresh fa-spin"></i></span>'); 211 212 var request = jQuery.ajax({ 213 type: "POST", 214 url: jobsearch_jobalerts_vars.ajax_url, 215 processData: false, 216 contentType: false, 217 data: _send_data, 218 dataType: "json", 219 });
220 request.done(function (response) { 221 if (typeof response.html && response.html != '') { 222 pop_html_con.html(response.html); 223 return false; 224 } 225 pop_html_con.find('.tags-loder').remove(); 226 }); 227 request.fail(function (jqXHR, textStatus) { 228 pop_html_con.find('.tags-loder').remove(); 229 }); 230 return false; 231}); 232 233jQuery(document).on('click', '.jobsearch-del-user-job-alert', function () { 234 var _this = jQuery(this); 235 var this_id = _this.attr('data-id'); 236 if (this_id > 0) { 237 var conf = confirm('Are you sure!'); 238 if (conf) { 239 _this.find('i').attr('class', 'fa fa-refresh fa-spin'); 240 var request = jQuery.ajax({ 241 url: jobsearch_jobalerts_vars.ajax_url, 242 method: "POST", 243 data: { 244 'alert_id': this_id, 245 'action': 'jobsearch_user_job_alert_delete', 246 }, 247 dataType: "json" 248 }); 249 250 request.done(function (response) { 251 _this.parents('tr').fadeOut(); 252 }); 253 254 request.fail(function (jqXHR, textStatus) { 255 _this.parents('tr').fadeOut(); 256 }); 257 } 258 } 259});
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.