PageSourceSearch

https://rushcommunications.com/wp-content/plugins/cred-frontend-ed…/toolset-forms/js/main.js?ver=0.1.1

js rushcommunications.com collected 2026-10-02 08:01:27 UTC 23,815 bytes, 604 lines download raw bytes

1var toolsetForms = toolsetForms || {};
2
3
4var wptCallbacks = {};
5wptCallbacks.validationInit = jQuery.Callbacks('unique');
6wptCallbacks.addRepetitive = jQuery.Callbacks('unique');
7wptCallbacks.removeRepetitive = jQuery.Callbacks('unique');
8wptCallbacks.conditionalCheck = jQuery.Callbacks('unique');
9wptCallbacks.reset = jQuery.Callbacks('unique');
10
11jQuery(document).ready(function () {
12    if (typeof wptValidation !== 'undefined') {
13        wptCallbacks.validationInit.add(function () {
14            wptValidation.init();
15        });
16    }
17    if (typeof wptCond !== 'undefined') {
18        wptCond.init();
19    } else {
20        wptCallbacks.validationInit.fire();
21    }
22    /**
23     * check taxonmies on submitted forms
24     */
25    jQuery('.cred-taxonomy', jQuery('form.is_submitted')).each(function () {
26        parent = jQuery(this);
27        setTimeout(function () {
28            jQuery('input.wpt-taxonomy-add-new', parent).click();
29        }, 50);
30    });
31});
32
33
34var wptFilters = {};
35function add_filter(name, callback, priority, args_num) {
36    var args = _.defaults(arguments, ['', '', 10, 2]);
37    if (typeof wptFilters[name] === 'undefined')
38        wptFilters[name] = {};
39    if (typeof wptFilters[name][args[2]] === 'undefined')
40        wptFilters[name][args[2]] = [];
41    wptFilters[name][args[2]].push([callback, args[3]]);
42}
43function apply_filters(name, val) {
44    if (typeof wptFilters[name] === 'undefined')
45        return val;
46    var args = _.rest(_.toArray(arguments));
47    _.each(wptFilters[name], function (funcs, priority) {
48        _.each(funcs, function ($callback) {
49            var _args = args.slice(0, $callback[1]);
50            args[0] = $callback[0].apply(null, _args);
51        });
52    });
53    return args[0];
54}
55function add_action(name, callback, priority, args_num) {
56    add_filter.apply(null, arguments);
57}
58function do_action(name) {
59    if (typeof wptFilters[name] === 'undefined')
60        return false;
61    var args = _.rest(_.toArray(arguments));
62    _.each(wptFilters[name], function (funcs, priority) {
63        _.each(funcs, function ($callback) {
64            var _args = args.slice(0, $callback[1]);
65            $callback[0].apply(null, _args);
66        });
67    });
68    return true;
69}
70
71/**
72 * flat taxonomies functions
73 */
74function showHideMostPopularButton(taxonomy, form)
75{
76    var $button = jQuery('[name="sh_' + taxonomy + '"]', form);
77    var $taxonomy_box = jQuery('.shmpt-' + taxonomy, form);
78    var $tag_list = $taxonomy_box.find('.js-wpt-taxonomy-popular-add');
79
80    if (!$button.hasClass('js-wpt-taxonomy-popular-show-hide'))
81        return true;
82
83    if ($tag_list.length > 0)
84    {
85        $button.show();
86        return true;
87    } else {
88        $button.hide();
89        return false;
90    }
91}
92
93jQuery(document).off('click', '.js-wpt-taxonomy-popular-show-hide', null);
94jQuery(document).off('click', '.js-wpt-taxonomy-popular-add', null);
95jQuery(document).off('click', '.js-wpt-taxonomy-add-new', null);
96jQuery(document).off('keypress', '.js-wpt-new-taxonomy-title', null);
97
98jQuery(document).on('click', '.js-wpt-taxonomy-popular-show-hide', function () {
99    showHideMostPopularTaxonomy(this);
100});
101
102function showHideMostPopularTaxonomy(el)
103{
104    var taxonomy = jQuery(el).data('taxonomy');
105    var form = jQuery(el).closest('form');
106    jQuery('.shmpt-' + taxonomy, form).toggle();
107    var curr = jQuery(el).val();
108    if (curr == jQuery(el).data('show-popular-text')) {
109        jQuery(el).val(jQuery(el).data('hide-popular-text'), form).addClass('btn-cancel');
110    } else {
111        jQuery(el).val(jQuery(el).data('show-popular-text'), form).removeClass('btn-cancel');
112    }
113}
114
115jQuery(document).on('click', '.js-wpt-taxonomy-popular-add', function () {
116    var thiz = jQuery(this);
117    var taxonomy = thiz.data('taxonomy');
118    var slug = thiz.data('slug');
119    var _name = thiz.data('name');
120    setTaxonomyFromPopular(_name, taxonomy, this);
121    return false;
122});
123
124function setTaxonomyFromPopular(slug, taxonomy, el)
125{
126    var form = jQuery(el).closest('form');
127    var tmp_tax = String(slug);
128    if (typeof tmp_tax === "undefined" || tmp_tax.trim() == '')
129        return;
130    var tax = jQuery('input[name=' + taxonomy + ']', form).val();
131    var arr = String(tax).split(',');
132    if (jQuery.inArray(tmp_tax, arr) !== -1)
133        return;
134    var toadd = (tax == '') ? tmp_tax : tax + ',' + tmp_tax;
135    jQuery('input[name=' + taxonomy + ']', form).val(toadd);
136    updateTaxonomies(taxonomy, form);
137}
138
139function addTaxonomy(slug, taxonomy, el)
140{
141    var form = jQuery(el).closest('form');
142    var curr = jQuery('input[name=tmp_' + taxonomy + ']', form).val().trim();
143    if ('' == curr) {
144        jQuery('input[name=tmp_' + taxonomy + ']', form).val(slug);
145        setTaxonomy(taxonomy, el);
146    } else {
147        if (curr.indexOf(slug) == -1) {
148            jQuery('input[name=tmp_' + taxonomy + ']', form).val(curr + ',' + slug);
149            setTaxonomy(taxonomy, el);
150        }
151    }
152    jQuery('input[name=tmp_' + taxonomy + ']', form).val('');
153}
154
155jQuery(document).on('click', '.js-wpt-taxonomy-add-new', function () {
156    var thiz = jQuery(this),
157            taxonomy = thiz.data('taxonomy');
158    setTaxonomy(taxonomy, this);
159});
160
161jQuery(document).on('keypress', '.js-wpt-new-taxonomy-title', function (e) {
162    if (13 === e.keyCode) {
163        e.preventDefault();
164        var thiz = jQuery(this),
165                taxonomy = thiz.data('taxonomy'),
166                taxtype = thiz.data('taxtype');
167        if (taxtype == 'hierarchical') {
168            toolsetForms.cred_tax.add_taxonomy(taxonomy, this);
169        } else {
170            setTaxonomy(taxonomy, this);
171        }
172    }
173});
174
175function setTaxonomy(taxonomy, el)
176{
177    var form = jQuery(el).closest('form');
178    var tmp_tax = jQuery('input[name=tmp_' + taxonomy + ']', form).val();
179	var rex = /<\/?(a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdi|bdo|bgsound|big|blink|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|data|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hgroup|hr|html|i|iframe|img|input|ins|isindex|kbd|keygen|label|legend|li|link|listing|main|map|mark|marquee|menu|menuitem|meta|meter|nav|nobr|noframes|noscript|object|ol|optgroup|option|output|p|param|plaintext|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|small|source|spacer|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video|wbr|xmp)\b[^<>]*>/ig;
180    tmp_tax = _.escape(tmp_tax.replace(rex, "")).trim();
181    if (tmp_tax.trim() == '')
182        return;
183    var tax = jQuery('input[name=' + taxonomy + ']', form).val();
184    var arr = tax.split(',');
185    if (jQuery.inArray(tmp_tax, arr) !== -1)
186        return;
187    var toadd = (tax == '') ? tmp_tax : tax + ',' + tmp_tax;
188    jQuery('input[name=' + taxonomy + ']', form).val(toadd);
189    jQuery('input[name=tmp_' + taxonomy + ']', form).val('');
190    updateTaxonomies(taxonomy, form);
191}
192
193function updateTaxonomies(taxonomy, form)
194{
195    var taxonomies = jQuery('input[name=' + taxonomy + ']', form).val();
196    jQuery('div.tagchecklist-' + taxonomy, form).html('');
197    if (!taxonomies || (taxonomies && taxonomies.trim() == ''))
198        return;
199    var toshow = taxonomies.split(',');
200    var str = '';
201    for (var i = 0; i < toshow.length; i++) {
202        var sh = toshow[i].trim();
203        str += '<span><a href="#" class=\'ntdelbutton\' data-wpcf-i=\'' + i + '\' id=\'post_tag-check-num-' + i + '\'>X</a>&nbsp;' + sh + '</span>';
204    }
205    jQuery('div.tagchecklist-' + taxonomy, form).html(str);
206    jQuery('div.tagchecklist-' + taxonomy + ' a', form).bind('click', function () {
207        jQuery('input[name=' + taxonomy + ']', form).val('');
208        del = jQuery(this).data('wpcf-i');
209        var values = '';
210        for (i = 0; i < toshow.length; i++) {
211            if (del == i) {
212                continue;
213            }
214            if (values) {
215                values += ',';
216            }
217            values += toshow[i];
218        }
219        jQuery('input[name=' + taxonomy + ']', form).val(values);
220        updateTaxonomies(taxonomy, form);
221
222        return false;
223    });
224
225}
226
227function initTaxonomies(values, taxonomy, url, fieldId)
228{
229    form = jQuery('#' + fieldId.replace(/_field_\d+$/, '')).closest('form');
230    jQuery('div.tagchecklist-' + taxonomy).html(values);
231
232    jQuery('input[name=' + taxonomy + ']').val(values);
233    updateTaxonomies(taxonomy, form);
234    
235    jQuery('input[name=tmp_' + taxonomy + ']').suggest(
236        wptoolset_taxonomy_settings.ajaxurl + '?action=wpt_suggest_taxonomy_term&taxonomy=' + taxonomy,
237        {
238            resultsClass: 'wpt-suggest-taxonomy-term',
239            selectClass: 'wpt-suggest-taxonomy-term-select'
240        }        
241    );
242    //https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/195723133/comments#308689055
243    if (jQuery('input[name=tmp_' + taxonomy + ']').val() != "")
244        jQuery("input[name='new_tax_button_" + taxonomy + "']").trigger("click");
245}
246
247toolsetForms.CRED_taxonomy = function () {
248
249    var self = this;
250
251    self.init = function () {
252        self._new_taxonomy = new Array();
253        jQuery(document).ready(self._document_ready);
254    }
255
256    self._document_ready = function () {
257        self._initialize_taxonomy_buttons();
258        self._initialize_hierachical();
259    }
260
261    self._initialize_hierachical = function () {
262        self._fill_parent_drop_down()
263    }
264
265    self._fill_parent_drop_down = function () {
266        jQuery('select.js-taxonomy-parent').each(function () {
267            var select = jQuery(this);
268
269            // remove all the options
270            jQuery(this).find('option').each(function () {
271                if (jQuery(this).val() != '-1') {
272                    jQuery(this).remove();
273                }
274            })
275
276            var taxonomy = jQuery(this).data('taxonomy');
277
278            // Copy all the checkbox values if it's checkbox mode
279            jQuery('input[name="' + taxonomy + '\[\]"]').each(function () {
280                var id = jQuery(this).attr('id');
281                var label = jQuery(this).next('label');
282                var level = jQuery(this).closest('ul').data('level');
283                var prefix = '';
284                if (level) {
285                    prefix = "\xA0\xA0" + Array(level).join("\xA0\xA0");
286                }
287                select.append('<option value="' + jQuery(this).val() + '">' + prefix + label.text() + '</option>');
288            })
289
290            // Copy all the select option values if it's select mode
291            jQuery('select[name="' + taxonomy + '\[\]"]').find('option').each(function () {
292                var id = jQuery(this).val();
293                var text = jQuery(this).text();
294                select.append('<option value="' + id + '">
294' + text + '</option>');
295            })
296
297
298        });
299
300    }
301
302    self._initialize_taxonomy_buttons = function () {
303        // replace the taxonomy button placeholders with the actual buttons.
304        jQuery('.js-taxonomy-button-placeholder').each(function () {
305            var placeholder = jQuery(this);
306            //https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/195150507/comments
307            var label = jQuery(this).attr('data-label');
308            //###########################################################################################
309            var taxonomy = jQuery(this).data('taxonomy');
310            var form = jQuery(this).closest('form');
311            var buttons = jQuery('[name="sh_' + taxonomy + '"],[name="btn_' + taxonomy + '"]', form);
312            var selectors = [];
313
314            if (buttons.length) {
315
316                buttons.each(function () {
317                    var button = jQuery(this, form);
318
319                    //https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/195150507/comments
320                    if (label)
321                        button.val(label);
322                    //##########################################################################################
323
324                    placeholder.replaceWith(button);
325
326                    if (button.hasClass('js-wpt-taxonomy-popular-show-hide')) {
327                        if (showHideMostPopularButton(taxonomy, form)) {
328                            button.show();
329                        }
330                    } else {
331                        button.show();
332                    }
333
334                    // move anything else that should be moved with the button
335                    //Responsible of the issue https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/188673095/comments
336                    //changed selector
337                    //var selector = button.data('after-selector');
338                    selectors.push(button.data('after-selector'))
339                    if (typeof selector !== 'undefined' && selector.length) {
340                        var position = button;
341                        jQuery('.' + selectors[0]).detach();
342                        jQuery('.' + selectors[0]).insertAfter(button);
343                        position = jQuery('.' + selectors[0]);
344                        selectors.pop();
345                    }
346                })
347            }
348        });
349    }
350
351//cred-286
352//    self.add_new_show_hide = function (taxonomy, button) {
353//        var form = jQuery(button).closest('form');
354//        jQuery('.js-wpt-hierarchical-taxonomy-add-new-' + taxonomy, form).toggle();
355//        self.hide_parent_button_if_no_terms(taxonomy, button);
356//    }
357    self.add_new_show_hide = function (taxonomy, button) {
358        var form = jQuery(button).closest('form');
359        var add_wrap = jQuery(".js-wpt-hierarchical-taxonomy-add-new-" + taxonomy);
360        if (add_wrap.is(":visible")) {
361            add_wrap.hide();
362        } else {
363            add_wrap.show();
364        }
365        self.hide_parent_button_if_no_terms(taxonomy, button);
366    }
367
368    jQuery('.js-wpt-hierarchical-taxonomy-add-new').on('click', function () {
369        var thiz = jQuery(this),
370                taxonomy = thiz.data('taxonomy');
371        self.add_taxonomy(taxonomy, this);
372    });
373    
374    jQuery('.js-wpt-hierarchical-taxonomy-add-new-show-hide').on('click', function () {
375        if (jQuery(this).val() == jQuery(this).data('close')) {
376            jQuery(this).val(jQuery(this).data('open')).removeClass('btn-cancel');
377        } else {
378            jQuery(this).val(jQuery(this).data('close')).addClass('btn-cancel');
379        }
380        var thiz = jQuery(this), taxonomy = thiz.data('taxonomy');
381        self.add_new_show_hide(taxonomy, this);
382    });    
383    
384    /*
385     jQuery(document).on('keypress', '.js-wpt-new-taxonomy-title', function(e) {
386     if( 13 === e.keyCode ) {
387     e.preventDefault();
388     var thiz = jQuery(this),
389     taxonomy = thiz.data( 'taxonomy' );
390     self.add_taxonomy( taxonomy, this );
391     }
392     });
393     */
394
395    self.terms_exist = function (taxonomy, button)
396    {
397        var form = jQuery(button).closest('form');
398        var build_what = jQuery(button).data('build_what'), parent = jQuery('[name="new_tax_select_' + taxonomy + '"]', form).val();
399        if (build_what === 'checkboxes') {
400            var first_checkbox = jQuery('input[name="' + taxonomy + '\[\]"][data-parent="' + parent + '"]:first', form);
401            return first_checkbox.length > 0;
402        } else {
403            var first_option = jQuery('select[name="' + taxonomy + '\[\]"]', form).find('option[data-parent="' + parent + '"]:first');
404            return first_option.length > 0;
405        }
406
407        return false;
408    };
409
410    self._add_new_flag = [];
411    self.hide_parent_button_if_no_terms = function (taxonomy, button)
412    {
413        var form = jQuery(button).closest('form');
414        var form_id = form.attr('id');
415        if ('undefined' == typeof self._add_new_flag[form_id]) {
416            self._add_new_flag[form_id] = '';
417        }
418        self._add_new_flag[form_id] = !self._add_new_flag[form_id];
419        if (self._add_new_flag[form_id] === false) {
420            jQuery('[name="new_tax_select_' + taxonomy + '"]', form).hide();
421        } else {
422            jQuery('[name="new_tax_select_' + taxonomy + '"]', form).show();
423        }
424    };
425
426    self.add_taxonomy = function (taxonomy, button)
427    {
428        var form = jQuery(button).closest('form');
429        var new_taxonomy = jQuery('[name="new_tax_text_' + taxonomy + '"]', form).val();
430        var build_what = jQuery(button).data('build_what');
431        new_taxonomy = new_taxonomy.trim();
432
433        if (new_taxonomy == '') {
434            return;
435        }
436
437        // make sure we don't already have a taxonomy with the same name.
438        var exists = false;
439        jQuery('input[name="' + taxonomy + '\[\]"]').each(function () {
440            var id = jQuery(this).attr('id');
441            var label = jQuery('label[for="' + id + '"]', form);
442
443            if (new_taxonomy == label.text()) {
444                exists = true
445                self._flash_it(label);
446            }
447        });
448
449        jQuery('select[name="' + taxonomy + '\[\]"]', form).find('option').each(function () {
450            if (new_taxonomy == jQuery(this).text()) {
451                exists = true;
452                self._flash_it(jQuery(this));
453            }
454        });
455
456        if (exists) {
457            jQuery('[name="new_tax_text_' + taxonomy + '"]', form).val('');
458            return;
459        }
460
461        var parent = jQuery('[name="new_tax_select_' + taxonomy + '"]', form).val(),
462                add_position = null,
463                add_before = true,
464                div_fields_wrap = jQuery('div[data-item_name="taxonomyhierarchical-' + taxonomy + '"]', form),
465                level = 0;
466
467        if (build_what === 'checkboxes') {
468            //Fix add new leaf
469            //https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/188589136/comments
470            jQuery('div[data-item_name="taxonomyhierarchical-' + taxonomy + '"] li input[type=checkbox]', form).each(function () {
471                if (this.value == parent || this.value == new_taxonomy) {
472                    div_fields_wrap = jQuery(this).parent();
473                }
474            });
475            //#########################################################################################
476
477            var new_checkbox = '<li><input data-parent="' + parent + '" class="wpt-form-checkbox form-checkbox checkbox" type="checkbox" name="' + taxonomy + '[]" checked="checked" value="' + new_taxonomy + '"></input><label>' + new_taxonomy + '</label></li>';
478            // find the first checkbox sharing parent
479            var first_checkbox = jQuery('input[name="' + taxonomy + '\[\]"][data-parent="' + parent + '"]:first', form);
480            if (first_checkbox.length == 0) {
481                // there are no existing brothers
482                // so we need to compose the ul wrapper and append to the parent li
483                //add_position = jQuery('input[name="' + taxonomy + '\[\]"][value="' + parent + '"]').closest('li');
484                level = jQuery('input[name="' + taxonomy + '\[\]"][value="' + parent + '"]', form).closest('ul').data('level');
485                level++;
486                new_checkbox = '<ul class="wpt-form-set-children" data-level="' + level + '">' + new_checkbox + '</ul>';
487                //first_checkbox = ;
488                //add_before = false;
489                //add_position = jQuery('input[name="' + taxonomy + '\[\]"][value="' + parent + '"]').closest('li');
490                jQuery(new_checkbox).appendTo(div_fields_wrap);
491            } else {
492                // there are brothers
493                // so we need to insert before all of them
494                add_position = first_checkbox.closest('li');
495                jQuery(new_checkbox).insertBefore(add_position);
496            }
497            jQuery('[name="new_tax_select_' + taxonomy + '"]', form).show();
498        } else if (build_what === 'select') {
499            // Select control
500
501            jQuery('select[name="' + taxonomy + '\[\]"]').show();
502
503            var indent = '';
504            var first_option = jQuery('select[name="' + taxonomy + '\[\]"]').find('option[data-parent="' + parent + '"]:first', form);
505            if (first_option.length == 0) {
506                // there a no children of this parent
507                first_option = jQuery('select[name="' + taxonomy + '\[\]"]').find('option[value="' + parent + '"]:first', form);
508                add_before = false;
509                var label = first_option.text();
510                for (var i = 0; i < label.length; i++) {
511                    if (label[i] == '\xA0') {
512                        indent += '\xA0';
513                    } else {
514                        break;
515                    }
516                }
517                indent += '\xA0';
518                indent += '\xA0';
519                add_position = jQuery('select[name="' + taxonomy + '\[\]"]', form);
520            } else {
521                add_position = first_option;
522                var label = first_option.text();
523                for (var i = 0; i < label.length; i++) {
524                    if (label[i] == '\xA0') {
525                        indent += '\xA0';
526                    } else {
527                        break;
528                    }
529                }
530            }
531
532            if (add_position) {
533                var new_option = '<option value="' + new_taxonomy + '" selected>' + indent + new_taxonomy + '</option>';
534                if (add_before) {
535                    jQuery(new_option).insertBefore(add_position);
536                } else {
537                    jQuery(new_option).appendTo(add_position);
538                }
539            }
540            jQuery('[name="new_tax_select_' + taxonomy + '"]', form).show()
541        }
542
543        self._update_hierachy(taxonomy, new_taxonomy, form);
544
545        jQuery('[name="new_tax_text_' + taxonomy + '"]', form).val('');
546
547        self._fill_parent_drop_down();
548
549    }
550
551    self._update_hierachy = function (taxonomy, new_taxonomy, form) {
552        var new_taxonomy_input = jQuery('input[name="' + taxonomy + '_hierarchy"]', form);
553        if (!new_taxonomy_input.length) {
554            // add a hidden field for the hierarchy
555            jQuery('<input name="' + taxonomy + '_hierarchy" style="display:none" type="hidden">').insertAfter(jQuery('[name="new_tax_text_' + taxonomy + '"]', form));
556            new_taxonomy_input = jQuery('input[name="' + taxonomy + '_hierarchy"]', form);
557        }
558
559        var parent = jQuery('[name="new_tax_select_' + taxonomy + '"]', form).val();
560        self._new_taxonomy.push(parent + ',' + new_taxonomy);
561
562        var value = '';
563        for (var i = 0; i < self._new_taxonomy.length; i++) {
564            value += '{' + self._new_taxonomy[i] + '}';
565        }
566        new_taxonomy_input.val(value);
567
568    }
569
570    self._flash_it = function (element) {
571        element.fadeOut(300).fadeIn(300).fadeOut(300).fadeIn(300);
572    }
573
574    self.init();
575
576}
577
578toolsetForms.cred_tax = new toolsetForms.CRED_taxonomy();
579
580//Fix https://icanlocalize.basecamphq.com/projects/7393061-toolset/todo_items/188725294/comments
581//removed return key press
582jQuery(function () {
583    var keyStop = {
584        8: ":not(input:text, textarea,  input:file, input:password)", // stop backspace = back
585        13: "input:text, input:password", // stop enter = submit
586
587        end: null
588    };
589    jQuery(document).bind("keydown", function (event) {
590        var thiz_selector = keyStop[event.which],
591                thiz_target = jQuery(event.target);
592
593        if (
594                thiz_target.closest("form.cred-form").length
595                && thiz_selector !== undefined
596                && thiz_target.is(thiz_selector)
597                ) {
598            event.preventDefault(); //stop event
599        }
600
601        return true;
602    });
603});
604

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.