diff --git a/jquery.typeahead.js b/jquery.typeahead.js
index 5071447..6e99a28 100644
--- a/jquery.typeahead.js
+++ b/jquery.typeahead.js
@@ -2,7 +2,7 @@
* jQuery Typeahead
*
* @author Tom Bertrand
- * @version 1.7.3 (2014-11-24)
+ * @version 1.7.5 (2014-11-30)
*
* @copyright
* Copyright (C) 2014 RunningCoder.
@@ -159,7 +159,7 @@
options.debug && window.Debug.log({
'node': node.selector,
'function': 'extendOptions()',
- 'arguments': "{options.source}",
+ 'arguments': "{options.source: " + JSON.stringify(options[option]) + "}",
'message': 'ERROR - source.group.url or source.group.data is Required'
});
}
@@ -190,7 +190,7 @@
// {/debug}
// {debug}
- if (!options[option][group].url && !options[option][group].data) {
+ if (!options[option][group].url && !options[option][group].data && !(options[option][group] instanceof Array)) {
options.debug && window.Debug.log({
'node': node.selector,
'function': 'extendOptions()',
@@ -961,7 +961,7 @@
if (!options.source[group].data && !options.source[group].url) {
- if (typeof options.source[group] === "string") {
+ if (typeof options.source[group] === "string" || options.source[group] instanceof Array) {
options.source[group] = {
url: options.source[group]
};
@@ -1063,10 +1063,15 @@
ajaxTimestamp: timestamp
}, ajaxObj)).done( function(data) {
+ // Only process the data from the latest generate
if (this.ajaxTimestamp !== timestamp) {
return false;
}
+ if (typeof this.process === "function") {
+ data = this.process(data);
+ }
+
_request.set(url, data);
_request.processQueue(url);
diff --git a/jquery.typeahead.min.js b/jquery.typeahead.min.js
index 6f82e6c..48ced68 100644
--- a/jquery.typeahead.min.js
+++ b/jquery.typeahead.min.js
@@ -2,7 +2,7 @@
* jQuery Typeahead
*
* @author Tom Bertrand
- * @version 1.7.3 (2014-11-24)
+ * @version 1.7.5 (2014-11-30)
*
* @copyright
* Copyright (C) 2014 RunningCoder.
@@ -13,4 +13,4 @@
* @license
* Licensed under the MIT license.
*/
-(function(e,t,n,r){e.Typeahead={source:{}};if(typeof Object.preventExtensions!=="function"){Object.preventExtensions=function(e){return e}}var i={input:null,minLength:2,maxItem:8,dynamic:false,delay:300,order:null,offset:false,hint:false,accent:false,highlight:true,list:false,group:false,groupMaxItem:false,filter:false,backdrop:false,cache:false,ttl:36e5,compression:false,selector:{container:"typeahead-container",group:"typeahead-group",result:"typeahead-result",list:"typeahead-list",display:"typeahead-display",query:"typeahead-query",filter:"typeahead-filter",filterButton:"typeahead-filter-button",filterValue:"typeahead-filter-value",dropdown:"typeahead-dropdown",button:"typeahead-button",backdrop:"typeahead-backdrop",hint:"typeahead-hint"},display:"display",template:null,source:null,callback:{onInit:null,onResult:null,onMouseEnter:null,onMouseLeave:null,onClick:null,onSubmit:null},debug:false};var s={dynamic:[true,false],order:["asc","desc"],offset:[true,false],accent:[true,false],highlight:[true,false],cache:[true,false],compression:[true,false],debug:[true,false]};var o=".typeahead.input";var u={from:"ãàáäâẽèéëêìíïîõòóöôùúüûñç",to:"aaaaaeeeeeiiiiooooouuuunc"};var a=function(r,a){function S(){for(var t in a){if(!a.hasOwnProperty(t)){continue}if(t==="source"){for(var r in a[t]){if(!a[t].hasOwnProperty(r)){continue}if(!(a[t][r]instanceof Object)||r==="data"){r="group";a[t]={group:a[t]}}}}else if(s[t]&&n.inArray(a[t],s[t])===-1){delete a[t]}}if(a.dynamic){a.cache=false;a.compression=false}if(a.cache){a.cache=function(){var t=typeof e.localStorage!=="undefined";if(t){try{localStorage.setItem("typeahead","typeahead");localStorage.removeItem("typeahead")}catch(n){t=false}}return t}()}a=n.extend(true,Object.preventExtensions(n.extend(true,{},i)),a)}function x(){I(a.callback.onInit,[r]);v=r.parents("."+a.selector.container);var e=["focus"+o,"input"+o,"propertychange"+o,"keydown"+o,"dynamic"+o];n("html").on("click"+o,function(e){k()});v.on("click"+o,function(e){e.stopPropagation();if(a.filter){v.find("."+a.selector.dropdown.replace(" ",".")).hide()}});r.parents("form").on("submit",function(e){if(I(a.callback.onSubmit,[r,this,e])){return false}});r.on(e.join(" "),function(e){switch(e.type){case"keydown":if(e.keyCode&&~[9,13,27,38,39,40].indexOf(e.keyCode)){C(e)}break;case"focus":if(l===null){if(!a.dynamic){L()}}break;case"input":case"propertychange":if(!l){if(a.dynamic){f=n(this).val().trim();F(function(){if(f.length>=a.minLength&&f!==""){L()}},a.delay)}return};case"dynamic":default:f=n(this).val().trim();k();if(f.length>=a.minLength&&f!==""){T();N()}if(e.type==="dynamic"&&a.dynamic){l=false;w=0}break}})}function T(){if(f===""){return false}if(d&&!a.source[d]){d=false}var e,t=f,n=0,i=/\d/.test(a.groupMaxItem)&&a.groupMaxItem,s;if(a.accent){t=B(f)}for(var o in h){if(!h.hasOwnProperty(o)||d&&o!==d){continue}if(i){s=0}for(var u in h[o]){if(!h[o].hasOwnProperty(u)){continue}if((p.length>=a.maxItem||i&&s>=i)&&!a.callback.onResult){break}if(a.source[o]&&a.source[o].display){h[o][u].display=h[o][u][a.source[o].display]}else{h[o][u].display=h[o][u][a.display]}e=h[o][u].display.toString();if(!e){continue}if(a.accent){e=B(e)}if(e.toLowerCase().indexOf(t.toLowerCase())!==-1&&(!a.offset||e.toLowerCase().indexOf(t.toLowerCase())===0)){if(a.source[o].ignore&&~a.source[o].ignore.indexOf(e)){continue}n++;if(a.callback.onResult&&(p.length>=a.maxItem||i&&s>=i)){continue}h[o][u].group=o;p.push(h[o][u]);if(i){s++}}}}if(a.order){p.sort(H("display",a.order==="asc",function(e){return e.toString().toUpperCase()}))}if(a.group){var l=[];for(var o in h){for(var c in p){if(p[c].group===o){l.push(p[c])}}}p=l}I(a.callback.onResult,[r,f,p,n]);return true}function N(){if(f===""||p.length===0){return false}var e=n("
",{"class":a.selector.result,html:n("
",{"class":a.selector.list,html:function(){for(var e in p){if(!p.hasOwnProperty(e)){continue}(function(e,t){if(typeof e.display!=="string"){e.display+=""}var i,s,o,u,l,c,h,p,d,v,m;if(a.group){i=e.group;if(typeof a.group!=="boolean"&&e[a.group]){i=e[a.group]}}if(a.list){s=e.group;if(typeof a.list!=="boolean"&&e[a.list]){s=e[a.list]}}if(a.group&&!n(t).find('li[data-search-group="'+i+'"]')[0]){n(t).append(n("",{"class":a.selector.group,html:n("",{html:i}),"data-search-group":i}))}l=e.display.toLowerCase();h=f.toLowerCase();if(a.accent){l=B(l);h=B(h)}p=l.indexOf(h);d=e.display.substr(p,h.length);if(a.highlight){d=""+d+""}l=j(e.display,p,h.length,d);o=n("",{html:n("",{href:"javascript:;","data-group":i,html:function(){m=e.group&&a.source[e.group].template||a.template;if(m){c=a.source[e.group]&&a.source[e.group].display||a.display;u=m.replace(/\{\{([a-z0-9_\-]+)\}\}/gi,function(t,n,r){if(n===c){return l}return e[n]||"null"})}else{u=''+l+""+(s?""+s+"":"")}n(this).append(u)},click:({result:e},function(t){t.preventDefault();f=e.display;r.val(f).focus();k();I(a.callback.onClick,[r,this,e,t])}),mouseenter:function(t){n(this).parent().siblings("li.active").removeClass("active");n(this).parent().addClass("active");I(a.callback.onMouseEnter,[r,this,e,t])},mouseleave:function(t){n(this).parent().removeClass("active");I(a.callback.onMouseLeave,[r,this,e,t])}})});if(a.group){v=n(t).find('a[data-group="'+i+'"]:last').closest("li");if(!v[0]){v=n(t).find('li[data-search-group="'+i+'"]')}n(o).insertAfter(v)}else{n(t).append(o)}})(p[e],this)}}})});v.addClass("result").append(e);if(a.backdrop){if(m.container){m.container.show()}else{m.css=n.extend({opacity:.6,filter:"alpha(opacity=60)",position:"fixed",top:0,right:0,bottom:0,left:0,"z-index":1040,"background-color":"#000"},a.backdrop);m.container=n("",{"class":a.selector.backdrop,css:m.css,click:function(){k()}}).insertAfter(v)}v.addClass("backdrop").css({"z-index":m.css["z-index"]+1,position:"relative"})}if(a.hint){if(!g.container){g.css=n.extend({"border-color":"transparent",position:"absolute","z-index":1,"-webkit-text-fill-color":"silver",color:"silver","background-color":"transparent","user-select":"none","box-shadow":"none"},a.hint);g.container=r.clone(true).attr({"class":a.selector.hint,readonly:true,tabindex:-1}).removeAttr("id placeholder name").css(g.css).insertBefore(r);r.css({position:"relative","z-index":2,"background-color":"transparent"}).parent().css({position:"relative"})}var t,i=typeof a.group==="string"&&p[0][a.group]||p[0].group;for(var s in p){if(!p.hasOwnProperty(s)){continue}if(p[s].group!==i){if(!t){i=p[s].group}else{break}}if(p[s].display.toLowerCase().indexOf(f.toLowerCase())===0){t=p[s].display;break}}if(t){g.container.val(f+t.substring(f.length)).show()}}return true}function C(e){if(p.length===0&&e.keyCode!==13){return false}var t=v.find("."+a.selector.result).find("li:not([data-search-group])"),i=t.siblings(".active");if(e.keyCode===13){if(t.filter(".active")[0]){e.preventDefault();e.stopPropagation();t.filter(".active").find("a").click()}k()}else{e.preventDefault();if(t.length>1){i.removeClass("active")}if(e.keyCode===40){if(i[0]){i.next().addClass("active")}else{n(t[0]).toggleClass("active")}}else if(e.keyCode===38){if(i[0]){i.prev().addClass("active")}else{n(t[p.length-1]).toggleClass("active")}}else if(e.keyCode===39){if(a.hint&&!i[0]){r.val(g.container.val())}if(i[0]){i.find("a").click()}else{t.filter(".active").find("a").click()}f=r.val();k();return true}if(a.group){var s=t.siblings(".active");if(s.attr("data-search-group")){s.removeClass("active");if(e.keyCode===40){s.next().addClass("active")}else if(e.keyCode===38){s.prev().addClass("active")}}}}if(a.hint){if(t.filter(".active")[0]){g.container.hide()}else{g.container.show()}}r.val(t.filter(".active").find("."+a.selector.display).text()||f);return true}function k(){p=[];if(a.filter){v.removeClass("filter").find("."+a.selector.dropdown.replace(" ",".")).hide()}if(a.hint){v.removeClass("hint");if(g.container){g.container.val("")}}if(a.backdrop||f===""){v.removeClass("backdrop").removeAttr("style");if(m.container){m.container.hide()}}v.removeClass("result").find("."+a.selector.result).remove();I(a.callback.onResult,[r,"",[],0])}function L(){l=false;y=(new Date).getTime();if(E===0){for(var t in a.source){if(a.source.hasOwnProperty(t)){++E}}}var i;for(var s in a.source){if(!a.source.hasOwnProperty(s)){continue}if(!a.dynamic&&h[s]&&h[s].length!==0){P();continue}if(a.cache){h[s]=localStorage.getItem(r.selector+":"+s);if(h[s]){if(a.compression){h[s]=U(h[s])}i=JSON.parse(h[s]);if(i&&i.data&&i.ttl&&i.ttl>(new Date).getTime()){h[s]=i.data;P();continue}}}if(!a.source[s].data&&!a.source[s].url){if(typeof a.source[s]==="string"){a.source[s]={url:a.source[s]}}else{}}h[s]=[];if(a.source[s].data&&a.source[s].data instanceof Array){for(var o in a.source[s].data){if(!a.source[s].data.hasOwnProperty(o)){continue}if(a.source[s].data[o]instanceof Object){break}var u={};u[a.display]=a.source[s].data[o];a.source[s].data[o]=u}h[s]=h[s].concat(a.source[s].data);if(!a.source[s].url){_(s);P();continue}}if(a.source[s].url){var c=a.source[s].url instanceof Array&&a.source[s].url[0]||a.source[s].url,p=a.source[s].url instanceof Array&&a.source[s].url[1]||null,d={};if(typeof c==="object"){d=n.extend(true,{},c);c=JSON.stringify(c)}var v=D.get(c);if(/https?:\/\//.test(c)&&!~c.indexOf(e.location.host)&&!!~c.indexOf("{callback}")){q.fetch(c.replace("{callback}",encodeURIComponent(b)),function(e){})}else{if(typeof v==="undefined"){D.set(c,[])}else if(v instanceof Array&&v.length===0){D.queue(c,s,p);continue}else{M(v,s,p);P();continue}if(d&&d.data){for(var m in d.data){if(d.data[m]==="{{query}}"){d.data[m]=f;break}}}n.ajax(n.extend({async:true,url:c,dataType:"json",ajaxGroup:s,ajaxPath:p,ajaxTimestamp:y},d)).done(function(e){if(this.ajaxTimestamp!==y){return false}D.set(c,e);D.processQueue(c);M(e,this.ajaxGroup,this.ajaxPath)}).fail(function(){}).complete(function(){if(this.ajaxTimestamp===y){P()}})}}}}function A(){function e(e){d=e;v.find("."+a.selector.filterValue).text(d||a.filter);v.find("."+a.selector.dropdown.replace(" ",".")).hide();k();T();N();r.focus()}if(!a.filter){return false}n("",{"class":a.selector.filter,html:function(){n(this).append(n("",{type:"button","class":a.selector.filterButton,html:""+a.filter+" ",click:function(e){e.stopPropagation();var t=v.find("."+a.selector.dropdown.replace(" ","."));if(!t.is(":visible")){v.addClass("filter");t.show()}else{v.removeClass("filter");t.hide()}}}));n(this).append(n("
",{"class":a.selector.dropdown,html:function(){for(var t in a.source){if(!a.source.hasOwnProperty(t)){continue}(function(t,r){var i=n("",{html:n("",{href:"javascript:;",html:t,click:({i:t},function(n){n.preventDefault();e(t)})})});n(r).append(i)})(t,this)}n(this).append(n("",{"class":"divider"}));n(this).append(n("",{html:n("",{href:"javascript:;",html:a.filter,click:function(t){t.preventDefault();e()}})}))}}))}}).insertAfter(v.find("."+a.selector.query))}function O(e){if(!e||!e.group){return false}var t=e.group||"group",n=a.source[t].url instanceof Array?a.source[t].url[1]:null;M(e,t,n);P()}function P(){w++;if(w===E){l=true;c=[];if(a.dynamic){r.trigger("dynamic.typeahead.input")}}}var f="",l=null,c=[],h=[],p=[],d,v,m={},g={},y=null,b="window.Typeahead.source['"+r.selector+"'].populate",w=0,E=0;var M=function(e,t,n){var r=true;if(n){var i=n.split("."),s=0;while(sn)-(n>e))}};var B=function(e){if(!e||typeof e!=="string"){return false}e=e.toLowerCase();for(var t=0,n=u.from.length;t1?t[s]:s.charCodeAt(0));t[s+i]=o;o++;s=i}}r.push(s.length>1?t[s]:s.charCodeAt(0));for(var u=0;u1){return}}else if(typeof t[0]==="undefined"||t.length>1){return}return e.Typeahead.source[t.selector]=new a(t,r)}};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(e){var t=this.length>>>0;var n=Number(arguments[1])||0;n=n<0?Math.ceil(n):Math.floor(n);if(n<0)n+=t;for(;n=a.minLength&&f!==""){L()}},a.delay)}return};case"dynamic":default:f=n(this).val().trim();k();if(f.length>=a.minLength&&f!==""){T();N()}if(e.type==="dynamic"&&a.dynamic){l=false;w=0}break}})}function T(){if(f===""){return false}if(d&&!a.source[d]){d=false}var e,t=f,n=0,i=/\d/.test(a.groupMaxItem)&&a.groupMaxItem,s;if(a.accent){t=B(f)}for(var o in h){if(!h.hasOwnProperty(o)||d&&o!==d){continue}if(i){s=0}for(var u in h[o]){if(!h[o].hasOwnProperty(u)){continue}if((p.length>=a.maxItem||i&&s>=i)&&!a.callback.onResult){break}if(a.source[o]&&a.source[o].display){h[o][u].display=h[o][u][a.source[o].display]}else{h[o][u].display=h[o][u][a.display]}e=h[o][u].display.toString();if(!e){continue}if(a.accent){e=B(e)}if(e.toLowerCase().indexOf(t.toLowerCase())!==-1&&(!a.offset||e.toLowerCase().indexOf(t.toLowerCase())===0)){if(a.source[o].ignore&&~a.source[o].ignore.indexOf(e)){continue}n++;if(a.callback.onResult&&(p.length>=a.maxItem||i&&s>=i)){continue}h[o][u].group=o;p.push(h[o][u]);if(i){s++}}}}if(a.order){p.sort(H("display",a.order==="asc",function(e){return e.toString().toUpperCase()}))}if(a.group){var l=[];for(var o in h){for(var c in p){if(p[c].group===o){l.push(p[c])}}}p=l}I(a.callback.onResult,[r,f,p,n]);return true}function N(){if(f===""||p.length===0){return false}var e=n("",{"class":a.selector.result,html:n("
",{"class":a.selector.list,html:function(){for(var e in p){if(!p.hasOwnProperty(e)){continue}(function(e,t){if(typeof e.display!=="string"){e.display+=""}var i,s,o,u,l,c,h,p,d,v,m;if(a.group){i=e.group;if(typeof a.group!=="boolean"&&e[a.group]){i=e[a.group]}}if(a.list){s=e.group;if(typeof a.list!=="boolean"&&e[a.list]){s=e[a.list]}}if(a.group&&!n(t).find('li[data-search-group="'+i+'"]')[0]){n(t).append(n("",{"class":a.selector.group,html:n("",{html:i}),"data-search-group":i}))}l=e.display.toLowerCase();h=f.toLowerCase();if(a.accent){l=B(l);h=B(h)}p=l.indexOf(h);d=e.display.substr(p,h.length);if(a.highlight){d=""+d+""}l=j(e.display,p,h.length,d);o=n("",{html:n("",{href:"javascript:;","data-group":i,html:function(){m=e.group&&a.source[e.group].template||a.template;if(m){c=a.source[e.group]&&a.source[e.group].display||a.display;u=m.replace(/\{\{([a-z0-9_\-]+)\}\}/gi,function(t,n,r){if(n===c){return l}return e[n]||"null"})}else{u=''+l+""+(s?""+s+"":"")}n(this).append(u)},click:({result:e},function(t){t.preventDefault();f=e.display;r.val(f).focus();k();I(a.callback.onClick,[r,this,e,t])}),mouseenter:function(t){n(this).parent().siblings("li.active").removeClass("active");n(this).parent().addClass("active");I(a.callback.onMouseEnter,[r,this,e,t])},mouseleave:function(t){n(this).parent().removeClass("active");I(a.callback.onMouseLeave,[r,this,e,t])}})});if(a.group){v=n(t).find('a[data-group="'+i+'"]:last').closest("li");if(!v[0]){v=n(t).find('li[data-search-group="'+i+'"]')}n(o).insertAfter(v)}else{n(t).append(o)}})(p[e],this)}}})});v.addClass("result").append(e);if(a.backdrop){if(m.container){m.container.show()}else{m.css=n.extend({opacity:.6,filter:"alpha(opacity=60)",position:"fixed",top:0,right:0,bottom:0,left:0,"z-index":1040,"background-color":"#000"},a.backdrop);m.container=n("",{"class":a.selector.backdrop,css:m.css,click:function(){k()}}).insertAfter(v)}v.addClass("backdrop").css({"z-index":m.css["z-index"]+1,position:"relative"})}if(a.hint){if(!g.container){g.css=n.extend({"border-color":"transparent",position:"absolute","z-index":1,"-webkit-text-fill-color":"silver",color:"silver","background-color":"transparent","user-select":"none","box-shadow":"none"},a.hint);g.container=r.clone(true).attr({"class":a.selector.hint,readonly:true,tabindex:-1}).removeAttr("id placeholder name").css(g.css).insertBefore(r);r.css({position:"relative","z-index":2,"background-color":"transparent"}).parent().css({position:"relative"})}var t,i=typeof a.group==="string"&&p[0][a.group]||p[0].group;for(var s in p){if(!p.hasOwnProperty(s)){continue}if(p[s].group!==i){if(!t){i=p[s].group}else{break}}if(p[s].display.toLowerCase().indexOf(f.toLowerCase())===0){t=p[s].display;break}}if(t){g.container.val(f+t.substring(f.length)).show()}}return true}function C(e){if(p.length===0&&e.keyCode!==13){return false}var t=v.find("."+a.selector.result).find("li:not([data-search-group])"),i=t.siblings(".active");if(e.keyCode===13){if(t.filter(".active")[0]){e.preventDefault();e.stopPropagation();t.filter(".active").find("a").click()}k()}else{e.preventDefault();if(t.length>1){i.removeClass("active")}if(e.keyCode===40){if(i[0]){i.next().addClass("active")}else{n(t[0]).toggleClass("active")}}else if(e.keyCode===38){if(i[0]){i.prev().addClass("active")}else{n(t[p.length-1]).toggleClass("active")}}else if(e.keyCode===39){if(a.hint&&!i[0]){r.val(g.container.val())}if(i[0]){i.find("a").click()}else{t.filter(".active").find("a").click()}f=r.val();k();return true}if(a.group){var s=t.siblings(".active");if(s.attr("data-search-group")){s.removeClass("active");if(e.keyCode===40){s.next().addClass("active")}else if(e.keyCode===38){s.prev().addClass("active")}}}}if(a.hint){if(t.filter(".active")[0]){g.container.hide()}else{g.container.show()}}r.val(t.filter(".active").find("."+a.selector.display).text()||f);return true}function k(){p=[];if(a.filter){v.removeClass("filter").find("."+a.selector.dropdown.replace(" ",".")).hide()}if(a.hint){v.removeClass("hint");if(g.container){g.container.val("")}}if(a.backdrop||f===""){v.removeClass("backdrop").removeAttr("style");if(m.container){m.container.hide()}}v.removeClass("result").find("."+a.selector.result).remove();I(a.callback.onResult,[r,"",[],0])}function L(){l=false;y=(new Date).getTime();if(E===0){for(var t in a.source){if(a.source.hasOwnProperty(t)){++E}}}var i;for(var s in a.source){if(!a.source.hasOwnProperty(s)){continue}if(!a.dynamic&&h[s]&&h[s].length!==0){P();continue}if(a.cache){h[s]=localStorage.getItem(r.selector+":"+s);if(h[s]){if(a.compression){h[s]=U(h[s])}i=JSON.parse(h[s]);if(i&&i.data&&i.ttl&&i.ttl>(new Date).getTime()){h[s]=i.data;P();continue}}}if(!a.source[s].data&&!a.source[s].url){if(typeof a.source[s]==="string"||a.source[s]instanceof Array){a.source[s]={url:a.source[s]}}else{}}h[s]=[];if(a.source[s].data&&a.source[s].data instanceof Array){for(var o in a.source[s].data){if(!a.source[s].data.hasOwnProperty(o)){continue}if(a.source[s].data[o]instanceof Object){break}var u={};u[a.display]=a.source[s].data[o];a.source[s].data[o]=u}h[s]=h[s].concat(a.source[s].data);if(!a.source[s].url){_(s);P();continue}}if(a.source[s].url){var c=a.source[s].url instanceof Array&&a.source[s].url[0]||a.source[s].url,p=a.source[s].url instanceof Array&&a.source[s].url[1]||null,d={};if(typeof c==="object"){d=n.extend(true,{},c);c=JSON.stringify(c)}var v=D.get(c);if(/https?:\/\//.test(c)&&!~c.indexOf(e.location.host)&&!!~c.indexOf("{callback}")){q.fetch(c.replace("{callback}",encodeURIComponent(b)),function(e){})}else{if(typeof v==="undefined"){D.set(c,[])}else if(v instanceof Array&&v.length===0){D.queue(c,s,p);continue}else{M(v,s,p);P();continue}if(d&&d.data){for(var m in d.data){if(d.data[m]==="{{query}}"){d.data[m]=f;break}}}n.ajax(n.extend({async:true,url:c,dataType:"json",ajaxGroup:s,ajaxPath:p,ajaxTimestamp:y},d)).done(function(e){if(this.ajaxTimestamp!==y){return false}if(typeof this.process==="function"){e=this.process(e)}D.set(c,e);D.processQueue(c);M(e,this.ajaxGroup,this.ajaxPath)}).fail(function(){}).complete(function(){if(this.ajaxTimestamp===y){P()}})}}}}function A(){function e(e){d=e;v.find("."+a.selector.filterValue).text(d||a.filter);v.find("."+a.selector.dropdown.replace(" ",".")).hide();k();T();N();r.focus()}if(!a.filter){return false}n("",{"class":a.selector.filter,html:function(){n(this).append(n("",{type:"button","class":a.selector.filterButton,html:""+a.filter+" ",click:function(e){e.stopPropagation();var t=v.find("."+a.selector.dropdown.replace(" ","."));if(!t.is(":visible")){v.addClass("filter");t.show()}else{v.removeClass("filter");t.hide()}}}));n(this).append(n("