PageSourceSearch

https://muaythaiontario.org/wp-content/plugins/gravity-forms-advan…/assets/js/isInListOperator.js?ver=6.3.11

js muaythaiontario.org collected 2026-10-04 05:23:25 UTC 3,173 bytes, 112 lines download raw bytes

1try {
2  gform.addFilter("gform_conditional_logic_operators", function(
3    operators,
4    objectType,
5    fieldId
6  ) {
7    operators.inList = "inList";
8    operators.notInList = "notInList";
9    gf_vars["inList"] = "in csv";
10    gf_vars["notInList"] = "not in csv";
11
12    return operators;
13  });
14
15  gform.addFilter("gform_is_value_match", function(isMatch, formId, rule) {
16    if (!rule || (rule.operator != "inList" && rule.operator != "notInList")) {
17      return isMatch;
18    }
19
20    var fieldValues = advLog_get_field_values(formId, rule.fieldId);
21
22    var ruleValues = rule.value
23      .split(",")
24      .map(function(value) {
25        return value.trim();
26      })
27      .filter(function(entry) {
28        return entry;
29      });
30
31    for (var i = 0; i < fieldValues.length; i++) {
32      var theFieldVal = fieldValues[i];
33      if (rule.operator == "inList") {
34        if (ruleValues.includes(theFieldVal)) {
35          return true;
36        }
37      } else if (rule.operator == "notInList") {
38        if (ruleValues.includes(theFieldVal)) {
39          return false;
40        }
41      }
42    }
43
44    return rule.operator == "inList" ? false : true;
45  });
46
47  function advLog_get_field_values(formId, rawFieldId) {
48    var $ = jQuery,
49      fieldId = gformExtractFieldId(rawFieldId),
50      inputIndex = gformExtractInputIndex(fieldId),
51      isInputSpecific = inputIndex !== false,
52      $inputs,
53      formattedValues = new Array(),
54      values = new Array();
55
56    if (isInputSpecific) {
57      $inputs = $("#input_{0}_{1}_{2}".format(formId, fieldId, inputIndex));
58    } else {
59      $inputs = $(
60        'input[id="input_{0}_{1}"], input[id^="input_{0}_{1}_"], input[id^="choice_{0}_{1}_"], select#input_{0}_{1}, textarea#input_{0}_{1}'.format(
61          formId,
62          fieldId
63        )
64      );
65    }
66
67    isCheckable = $.inArray($inputs.attr("type"), ["checkbox", "radio"]) !== -1;
68
69    if (isCheckable) {
70      $inputs.each(function() {
71        var $input = jQuery(this);
72        var theFieldValue = gf_get_value($input.val());
73
74        // force an empty value for unchecked items
75        if (!$input.is(":checked")) {
76          theFieldValue = "";
77          values.push("");
78        }
79        // if the 'other' choice is selected, get the value from the 'other' text input
80        else if (fieldValue == "gf_other_choice") {
81          theFieldValue = $(
82            "#input_{0}_{1}_other".format(formId, fieldId)
83          ).val();
84        }
85        values.push(theFieldValue);
86      });
87      //handle multiple values
88    } else {
89      // handle single values
90      var val = gf_get_value($inputs.eq(0).val());
91      values = val instanceof Array ? val : [val];
92    }
93
94    for (var i = 0; i < values.length; i++) {
95      var hasLabel = values[i] ? values[i].indexOf("|") >= 0 : true,
96        fieldValue = gf_get_value(values[i]);
97
98      var fieldNumberFormat = gf_get_field_number_format(
99        rawFieldId,
100        formId,
101        "value"
102      );
103      if (fieldNumberFormat && !hasLabel) {
104        fieldValue = gf_format_number(fieldValue, fieldNumberFormat);
105      }
106
107      formattedValues.push(fieldValue);
108    }
109
110    return formattedValues;
111  }
112} catch (e) {}

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.