PageSourceSearch

https://ureba.jp/wp-content/plugins/wp-jobsearch/modules/custom-fields/js/custom-field-functions-ver=5.5.14.js

js ureba.jp collected 2026-10-05 02:19:30 UTC 13,720 bytes, 352 lines download raw bytes

1
2var ajaxCustomFieldRequestText;
3var ajaxCustomFieldRequestHeading;
4var ajaxCustomFieldRequestNumber;
5var ajaxCustomFieldRequestEmail;
6var ajaxCustomFieldRequestDate;
7var ajaxCustomFieldRequestRange;
8var ajaxCustomFieldRequestSalary;
9var ajaxCustomFieldRequestTextarea;
10var ajaxCustomFieldRequestDropdown;
11var ajaxCustomFieldSaveRequest;
12jQuery(document).on('click', '.jobsearch-custom-field-add-field', function () {
13    "use strict";
14    global_custom_field_counter++;
15    var ajax_url = jobsearch_customfield_common_vars.ajax_url,
16            $this = jQuery(this),
17            randid = $this.data('randid'),
18            form_element = jQuery('#jobsearch-custom-field-form-' + randid),
19            fieldtype = $this.data('fieldtype'),
20            fieldlabel = $this.data('fieldlabel'),
21            field_container = jQuery('#foo' + randid),
22            all_fields_count = form_element.find('input[name="custom-fields-all-names-count"]'),
23            all_fields_string = form_element.find('input[name="custom-fields-all-names"]'),
24            empty_container = field_container.find('.custom-field-empty-msg');
25    //alert('#jobsearch-custom-field-form-' + randid);
26    var action = '';
27    var old_text = fieldlabel;
28    $this.html('<i class="dashicons dashicons-update fa-spin"></i>');
29    action = 'jobsearch_custom_field_html';
30    var dataString = 'action=' + action + '&fieldtype=' + fieldtype + '&global_custom_field_counter=' + global_custom_field_counter;
31
32    if (fieldtype == 'heading') {
33        if (typeof (ajaxCustomFieldRequestHeading) != 'undefined') {
34            ajaxCustomFieldRequestHeading.abort();
35        }
36        ajaxCustomFieldRequestHeading = jQuery.ajax({
37            type: "POST",
38            url: ajax_url,
39            data: dataString,
40            dataType: "json",
41            success: function (response) {
42                if (response != 'error') {
43                    $this.html(old_text);
44                    empty_container.hide();
45                    field_container.append(response.html);
46                    var all_fields_count_val = all_fields_count.val();
47                    all_fields_count_val++;
48                    all_fields_count.val(all_fields_count_val);
49                } else {
50                    $this.html(' There is an error.');
51                }
52            }
53        });
54
55    } else if (fieldtype == 'text') {
56        if (typeof (ajaxCustomFieldRequestText) != 'undefined') {
57            ajaxCustomFieldRequestText.abort();
58        }
59        ajaxCustomFieldRequestText = jQuery.ajax({
60            type: "POST",
61            url: ajax_url,
62            data: dataString,
63            dataType: "json",
64            success: function (response) {
65                if (response != 'error') {
66                    $this.html(old_text);
67                    empty_container.hide();
68                    field_container.append(response.html);
69                    var all_fields_count_val = all_fields_count.val();
70                    all_fields_count_val++;
71                    all_fields_count.val(all_fields_count_val);
72                } else {
73                    $this.html(' There is an error.');
74                }
75            }
76        });
77
78    } else if (fieldtype == 'number') {
79        if (typeof (ajaxCustomFieldRequestNumber) != 'undefined') {
80            ajaxCustomFieldRequestNumber.abort();
81        }
82        ajaxCustomFieldRequestNumber = jQuery.ajax({
83            type: "POST",
84            url: ajax_url,
85            data: dataString,
86            dataType: "json",
87            success: function (response) {
88                if (response != 'error') {
89                    $this.html(old_text);
90                    empty_container.hide();
91                    field_container.append(response.html);
92                    var all_fields_count_val = all_fields_count.val();
93                    all_fields_count_val++;
94                    all_fields_count.val(all_fields_count_val);
95                } else {
96                    $this.html(' There is an error.');
97                }
98            }
99        });
100
101    } else if (fieldtype == 'date') {
102        if (typeof (ajaxCustomFieldRequestDate) != 'undefined') {
103            ajaxCustomFieldRequestDate.abort();
104        }
105        ajaxCustomFieldRequestDate = jQuery.ajax({
106            type: "POST",
107            url: ajax_url,
108            data: dataString,
109            dataType: "json",
110            success: function (response) {
111                if (response != 'error') {
112                    $this.html(old_text);
113                    empty_container.hide();
114                    field_container.append(response.html);
115                    var all_fields_count_val = all_fields_count.val();
116                    all_fields_count_val++;
117                    all_fields_count.val(all_fields_count_val);
118                } else {
119                    $this.html(' There is an error.');
120                }
121            }
122        });
123
124    } else if (fieldtype == 'range') {
125        if (typeof (ajaxCustomFieldRequestRange) != 'undefined') {
126            ajaxCustomFieldRequestRange.abort();
127        }
128        ajaxCustomFieldRequestRange = jQuery.ajax({
129            type: "POST",
130            url: ajax_url,
131            data: dataString,
132            dataType: "json",
133            success: function (response) {
134                if (response != 'error') {
135                    $this.html(old_text);
136                    empty_container.hide();
137                    field_container.append(response.html);
138                    var all_fields_count_val = all_fields_count.val();
139                    all_fields_count_val++;
140                    all_fields_count.val(all_fields_count_val);
141                } else {
142                    $this.html(' There is an error.');
143                }
144            }
145        });
146
147    } else if (fieldtype == 'salary') {
148        if (typeof (ajaxCustomFieldRequestSalary) != 'undefined') {
149            ajaxCustomFieldRequestSalary.abort();
150        }
151        ajaxCustomFieldRequestSalary = jQuery.ajax({
152            type: "POST",
153            url: ajax_url,
154            data: dataString,
155            dataType: "json",
156            success: function (response) {
157                if (response != 'error') {
158                    $this.html(old_text);
159                    empty_container.hide();
160                    field_container.append(response.html);
161                    var all_fields_count_val = all_fields_count.val();
162                    all_fields_count_val++;
163                    all_fields_count.val(all_fields_count_val);
164                } else {
165                    $this.html(' There is an error.');
166                }
167            }
168        });
169
170    } else if (fieldtype == 'email') {
171        if (typeof (ajaxCustomFieldRequestEmail) != 'undefined') {
172            ajaxCustomFieldRequestEmail.abort();
173        }
174        ajaxCustomFieldRequestEmail = jQuery.ajax({
175            type: "POST",
176            url: ajax_url,
177            data: dataString,
178            dataType: "json",
179            success: function (response) {
180                if (response != 'error') {
181                    $this.html(old_text);
182                    empty_container.hide();
183                    field_container.append(response.html);
184                    var all_fields_count_val = all_fields_count.val();
185                    all_fields_count_val++;
186                    all_fields_count.val(all_fields_count_val);
187                } else {
188                    $this.html(' There is an error.');
189                }
190            }
191        });
192
193    } else if (fieldtype == 'dropdown') {
194        if (typeof (ajaxCustomFieldRequestDropdown) != 'undefined') {
195            ajaxCustomFieldRequestDropdown.abort();
196        }
197        ajaxCustomFieldRequestDropdown = jQuery.ajax({
198            type: "POST",
199            url: ajax_url,
200            data: dataString,
201            dataType: "json",
202            success: function (response) {
203                if (response != 'error') {
204                    $this.html(old_text);
205                    empty_container.hide();
206                    field_container.append(response.html);
207                    var all_fields_count_val = all_fields_count.val();
208                    all_fields_count_val++;
209                    all_fields_count.val(all_fields_count_val);
210                } else {
211                    $this.html(' There is an error.');
212                }
213            }
214        });
215
216    } else if (fieldtype == 'textarea') {
217        if (typeof (ajaxCustomFieldRequestTextarea) != 'undefined') {
218            ajaxCustomFieldRequestTextarea.abort();
219        }
220        ajaxCustomFieldRequestTextarea = jQuery.ajax({
221            type: "POST",
222            url: ajax_url,
223            data: dataString,
224            dataType: "json",
225            success: function (response) {
226                if (response != 'error') {
227                    $this.html(old_text);
228                    empty_container.hide();
229                    field_container.append(response.html);
230                    var all_fields_count_val = all_fields_count.val();
231                    all_fields_count_val++;
232                    all_fields_count.val(all_fields_count_val);
233                } else {
234                    $this.html(' There is an error.');
235                }
236            }
237        });
238
239    }
240
241
242
243
244
245
246    return false;
247});
248
249jQuery(document).on('click', '.custom-fields-remove', function () {
250    "use strict";
251    var $this = jQuery(this),
252            randid = $this.data('randid'),
253            randid = $this.data('randid');
254    var parent_ul = jQuery('.custom-field-class-' + randid).parents('ul');
255    jQuery('.custom-field-class-' + randid).slideUp("normal").promise().done(function () {
256        jQuery(this).remove();
257        // show empty msg if all lis removed
258        if (parent_ul.children().length <= 1) {
259            parent_ul.find('.custom-field-empty-msg').show('slow');
260        }
261    });
262});
263
264jQuery(document).on('click', '.custom-fields-submit', function () {
265    "use strict";
266    var ajax_url = jobsearch_customfield_common_vars.ajax_url,
267            $this = jQuery(this),
268            randid = $this.data('randid'),
269            entitytype = $this.data('entitytype'),
270            btntext = $this.data('btntext'),
271            submited_form = jQuery('#jobsearch-custom-field-form-' + randid);
272    $this.html('<i class="dashicons dashicons-update fa-spin"></i>');
273    jQuery('.custom-field-msg-' + randid).html('')
274    var dataString = 'action=jobsearch_custom_fields_save&entitytype=' + entitytype + '&' + submited_form.serialize();
275    if (typeof (ajaxCustomFieldSaveRequest) !== 'undefined') {
276        ajaxCustomFieldSaveRequest.abort();
277    }
278    ajaxCustomFieldSaveRequest = jQuery.ajax({
279        type: "POST",
280        url: ajax_url,
281        data: dataString,
282        dataType: "json",
283        success: function (response) {
284            $this.html(btntext);
285            if (response != 'error') {
286                jQuery('.custom-field-msg-' + randid).html(response.msg);
287            } else {
288                jQuery('.custom-field-msg-' + randid).html('There is an error.');
289            }
290            jQuery('.custom-field-msg-' + randid).show();
291        }
292    });
293    return false;
294});
295
296jQuery(document).on("click", ".option-field-add-btn", function (e) {
297    "use strict";
298    e.preventDefault();
299    var _this = jQuery(this),
300            b = _this.closest('div.field-options-list');
301    b.clone().insertAfter(b);
302});
303jQuery(document).on("click", ".option-field-remove", function (e) {
304    "use strict";
305    e.preventDefault();
306    var _this = jQuery(this);
307    _this.parents('div.field-options-list').remove();
308});
309
310jQuery(document).on("change", ".check-name-availability", function (e) {
311    "use strict";
312
313    var ajax_url = jobsearch_customfield_common_vars.ajax_url,
314            _this = jQuery(this),
315            parentForm = _this.closest('form'),
316            this_string = _this.val(),
317            custom_all_fileds = parentForm.find('input[name="custom-fields-all-names"]'),
318            custom_all_fileds_val = custom_all_fileds.val(),
319            custom_all_fileds_count = parentForm.find('input[name="custom-fields-all-names-count"]'),
320            custom_all_fileds_count_val = custom_all_fileds_count.val(),
321            msg_container = _this.nextAll('.available-msg:first');
322    msg_container.html('<i class="dashicons dashicons-update fa-spin"></i>');
323    var dataString = 'action=jobsearch_custom_fields_avalibility&custom_all_fileds=' + custom_all_fileds_val + '&this_string=' + this_string;
324    jQuery.ajax({
325        type: "POST",
326        url: ajax_url,
327        data: dataString,
328        dataType: "json",
329        success: function (response) {
330//            $this.html(btntext);
331            if (response.type != 'error') {
332
333                // var elements = jQuery("#select_<?php echo $doctors_field_key_form; ?> option:selected").length;
334                // var input = jQuery("#<?php echo $doctors_field_key_form; ?>"); 
335                //jQuery.each(jQuery("#select_<?php echo $doctors_field_key_form; ?> option:selected"), function (index, element) {
336                custom_all_fileds.val(custom_all_fileds.val() + "," + this_string);
337                custom_all_fileds_count_val++;
338                custom_all_fileds_count.val(custom_all_fileds_count_val);
339//                                            if (index < elements - 1) {
340//                                                //remove last comma                    
341//                                            }
342                //});
343                msg_container.html(response.message);
344            } else {
345                msg_container.html(response.message);
346
347            }
348        }
349    });
350    //alert(custom_all_fileds.val());
351
vendor: 4 bytes, line 352
352});

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.