/home/techb158/exp.abdallabala.com/ui/lib
NameSizeModeActions
ace/-0755rm
c3/-0755rm
chart/-0755rm
contacts/-0755rm
css/-0755rm
dashboard/-0755rm
dp/-0755rm
dropzone/-0755rm
dt/-0755rm
fc/-0755rm
fonts/-0755rm
footable/-0755rm
ibilling/-0755rm
icons/-0755rm
imgcrop/-0755rm
imgs/-0755rm
invoices/-0755rm
js/-0755rm
jslib/-0755rm
moment/-0755rm
multi-select/-0755rm
orders/-0755rm
popover/-0755rm
prism/-0755rm
redactor/-0755rm
s2/-0755rm
select/-0755rm
settings/-0755rm
sn/-0755rm
spectrum/-0755rm
terminal/-0755rm
tinymce/-0755rm
toggle/-0755rm
transactions/-0755rm
validator/-0755rm
.DS_Store102440644editdlrm
add-contact.js61050644editdlrm
app.js144100644editdlrm
blockui.js199120644editdlrm
clipboard.min.js101120644editdlrm
deposit.js64630644editdlrm
edit-invoice-v2.js172420644editdlrm
edit_invoice_v2n.js112360644editdlrm
expense.js38250644editdlrm
ibilling.js6250440644editdlrm
index.html1120644editdlrm
invoice.js157390644editdlrm
invoice_add_v2.js113600644editdlrm
jquery.steps.min.js136340644editdlrm
locale.js4010644editdlrm
login.js14610644editdlrm
modal.css46960644editdlrm
modal.js266340644editdlrm
numeric.js636160644editdlrm
profile.js145530644editdlrm
progress.js61670644editdlrm
quicksearch.js54620644editdlrm
quote-edit.js104330644editdlrm
quotes.js95370644editdlrm
require.js155240644editdlrm
tr-manage.js26150644editdlrm
transfer.js17020644editdlrm
tr_filter.js36070644editdlrm
typeahead.bundle.min.js397490644editdlrm
Edit: /home/techb158/exp.abdallabala.com/ui/lib/quicksearch.js (5462B)
(function($, window, document, undefined) { $.fn.quicksearch = function (target, opt) { var timeout, cache, rowcache, jq_results, val = '', e = this, options = $.extend({ delay: 100, selector: null, stripeRows: null, loader: null, noResults: '', matchedResultsCount: 0, bind: 'keyup', onBefore: function () { return; }, onAfter: function () { return; }, show: function () { this.style.display = ""; }, hide: function () { this.style.display = "none"; }, prepareQuery: function (val) { return val.toLowerCase().split(' '); }, testQuery: function (query, txt, _row) { for (var i = 0; i < query.length; i += 1) { if (txt.indexOf(query[i]) === -1) { return false; } } return true; } }, opt); this.go = function () { var i = 0, numMatchedRows = 0, noresults = true, query = options.prepareQuery(val), val_empty = (val.replace(' ', '').length === 0); for (var i = 0, len = rowcache.length; i < len; i++) { if (val_empty || options.testQuery(query, cache[i], rowcache[i])) { options.show.apply(rowcache[i]); noresults = false; numMatchedRows++; } else { options.hide.apply(rowcache[i]); } } if (noresults) { this.results(false); } else { this.results(true); this.stripe(); } this.matchedResultsCount = numMatchedRows; this.loader(false); options.onAfter(); return this; }; /* * External API so that users can perform search programatically. * */ this.search = function (submittedVal) { val = submittedVal; e.trigger(); }; /* * External API to get the number of matched results as seen in * https://github.com/ruiz107/quicksearch/commit/f78dc440b42d95ce9caed1d087174dd4359982d6 * */ this.currentMatchedResults = function() { return this.matchedResultsCount; }; this.stripe = function () { if (typeof options.stripeRows === "object" && options.stripeRows !== null) { var joined = options.stripeRows.join(' '); var stripeRows_length = options.stripeRows.length; jq_results.not(':hidden').each(function (i) { $(this).removeClass(joined).addClass(options.stripeRows[i % stripeRows_length]); }); } return this; }; this.strip_html = function (input) { var output = input.replace(new RegExp('<[^<]+\>', 'g'), ""); output = $.trim(output.toLowerCase()); return output; }; this.results = function (bool) { if (typeof options.noResults === "string" && options.noResults !== "") { if (bool) { $(options.noResults).hide(); } else { $(options.noResults).show(); } } return this; }; this.loader = function (bool) { if (typeof options.loader === "string" && options.loader !== "") { (bool) ? $(options.loader).show() : $(options.loader).hide(); } return this; }; this.cache = function () { jq_results = $(target); if (typeof options.noResults === "string" && options.noResults !== "") { jq_results = jq_results.not(options.noResults); } var t = (typeof options.selector === "string") ? jq_results.find(options.selector) : $(target).not(options.noResults); cache = t.map(function () { return e.strip_html(this.innerHTML); }); rowcache = jq_results.map(function () { return this; }); /* * Modified fix for sync-ing "val". * Original fix https://github.com/michaellwest/quicksearch/commit/4ace4008d079298a01f97f885ba8fa956a9703d1 * */ val = val || this.val() || ""; return this.go(); }; this.trigger = function () { this.loader(true); options.onBefore(); window.clearTimeout(timeout); timeout = window.setTimeout(function () { e.go(); }, options.delay); return this; }; this.cache(); this.results(true); this.stripe(); this.loader(false); return this.each(function () { /* * Changed from .bind to .on. * */ $(this).on(options.bind, function () { val = $(this).val(); e.trigger(); }); }); }; }(jQuery, this, document));