diff --git a/README.md b/README.md
index dd847dcc..a77afc8b 100644
--- a/README.md
+++ b/README.md
@@ -32,6 +32,7 @@ Login with user `demo` and password `demo`
- [Js Utilities](#js-utilities)
- [List Filters](#list-filters)
- [Changelist Includes](#changelist-includes)
+- [Changelist Row Attributes](#changelist-row-attributes)
- [Form Tabs](#form-tabs)
- [Form Includes](#form-includes)
- [Collapsable stacked inlines entries](#collapsable-stackedinline)
@@ -67,10 +68,11 @@ The following packages are required to manage the Google Analytics index:
- google-api-python-client
- requests
-At the moment __baton__ defines only 4 custom templates:
+At the moment __baton__ defines only 5 custom templates:
- `admin/base_site.html`, needed to inject the JS application (which includes css and images, compiled with [webpack](https://webpack.github.io/));
- `admin/change_form.html`, needed to inject the `baton_form_includes` stuff. In any case, the template extends the default one and just adds some stuff at the end of the content block, so it's still full compatible with the django one;
+- `admin/change_list.html`, needed to inject the `baton_cl_includes` and `baton_cl_rows_attributes` stuff. In any case, the template extends the default one and just adds some stuff at the end of the content block, so it's still full compatible with the django one;
- `admin/delete_confirmation.html`, needed to wrap contents;
- `admin/delete_selected_confirmation.html`, same as above.
@@ -438,6 +440,8 @@ class MyModelAdmin(admin.ModelAdmin):
## Changelist Includes
+> In order for this feature to work, the user browser must support html template tags.
+
Baton lets you include templates directly inside the change list page, in any position you desire. It's as simple as specifying the template path and the position of the template:
```python
@@ -465,6 +469,58 @@ You can specify the following positions:
And, of course, you can access the all the changelist view context variables inside your template.
+## Changelist Row Attributes
+
+> In order for this feature to work, the user browser must support html template tags.
+
+With Baton you can add every kind of html attribute (including css classes) to any element in the changelist table (cell, rows, ...)
+
+![Baton changelist row attributes](docs/images/baton-cl-row-attributes.png)
+
+It's a bit tricky, let's see how:
+
+1. Add a `baton_cl_rows_attributes` function to your `ModelAdmin` class, which takes `request` as a parameter.
+2. Return a json dictionary where the keys are used to match an element and the values specifies the attributes and other rules to select the element.
+
+Better to see an example:
+
+``` javascript
+class NewsModelAdmin(admin.ModelAdmin):
+ # ...
+
+ def get_category(self, instance):
+ return mark_safe('%s' % (instance.id, str(instance.category)))
+ get_category.short_description = 'category'
+
+ def baton_cl_rows_attributes(self, request):
+ data = {}
+ for news in News.objects.filter(category__id=2):
+ data[news.id] = {
+ 'class': 'table-info',
+ }
+ data[news.id] = {
+ 'class': 'table-success',
+ 'data-lol': 'lol',
+ 'title': 'A fantasctic tooltip!',
+ 'selector': '.span-category-id-%d' % 1,
+ 'getParent': 'td',
+ }
+ return json.dumps(data)
+```
+
+In such case we're returning a dictionary with possibly many keys (each key is an id of a news instance).
+
+The first kind of dictionary elements will add a `table-info` class to the `tr` (rows) containing the news respecting the rule `category__id=2`
+
+The second kind of element instead uses some more options to customize the element selection: you can specify a css selector, and you can specify if Baton should then take one of its parents, and in such case you can give a parent selector also.
+In the example provided Baton will add the class `table-success`, `data-attribute` and the `title` attribute to the cell which contains the element `.span-category-id-1`.
+
+So these are the rules:
+
+- the default `selector` is `#result_list tr input[name=_selected_action][value=' + key + ']`, meaning that it can work only if the model is editable (you have the checkox inputs for selecting a row), and selects the row of the instance identified by `key`. If you use a custom selector the dictionary `key` is unuseful.
+- the default `getParent` is `tr`. You can change it at you will, or set it to `False`, in such case the element to which apply the given attributes will be the one specified by `selector`.
+- Every other key different from `selector` and `getParent` will be considered an attribute and added to the element.
+
## Form tabs
How much I loved django-suit form tabs? Too much. So, this was a feature I couldn't live without.
@@ -533,6 +589,8 @@ Other features:
## [Form Includes](#form-includes)
+> In order for this feature to work, the user browser must support html template tags.
+
Baton lets you include templates directly inside the change form page, in any position you desire. It's as simple as specifying the template path, the field name used as anchor and the position of the template:
```python
diff --git a/baton/static/baton/app/dist/baton.min.js b/baton/static/baton/app/dist/baton.min.js
index 09709e32..a98e14b0 100644
--- a/baton/static/baton/app/dist/baton.min.js
+++ b/baton/static/baton/app/dist/baton.min.js
@@ -22,7 +22,7 @@
*
* Date: 2020-03-14
*/
-function(e){var t,n,o,r,a,i,p,c,l,s,m,u,d,g,f,h,b,w,y,x="sizzle"+1*new Date,k=e.document,v=0,_=0,j=ce(),E=ce(),C=ce(),T=ce(),D=function(e,t){return e===t&&(m=!0),0},z={}.hasOwnProperty,S=[],N=S.pop,A=S.push,q=S.push,O=S.slice,L=function(e,t){for(var n=0,o=e.length;n+~]|"+M+")"+M+"*"),$=new RegExp(M+"|>"),Q=new RegExp(B),X=new RegExp("^"+F+"$"),V={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+B),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+I+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,K=/^(?:input|select|textarea|button)$/i,G=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},oe=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,re=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ae=function(){u()},ie=xe((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{q.apply(S=O.call(k.childNodes),k.childNodes),S[k.childNodes.length].nodeType}catch(e){q={apply:S.length?function(e,t){A.apply(e,O.call(t))}:function(e,t){for(var n=e.length,o=0;e[n++]=t[o++];);e.length=n-1}}}function pe(e,t,o,r){var a,p,l,s,m,g,b,w=t&&t.ownerDocument,k=t?t.nodeType:9;if(o=o||[],"string"!=typeof e||!e||1!==k&&9!==k&&11!==k)return o;if(!r&&(u(t),t=t||d,f)){if(11!==k&&(m=Z.exec(e)))if(a=m[1]){if(9===k){if(!(l=t.getElementById(a)))return o;if(l.id===a)return o.push(l),o}else if(w&&(l=w.getElementById(a))&&y(t,l)&&l.id===a)return o.push(l),o}else{if(m[2])return q.apply(o,t.getElementsByTagName(e)),o;if((a=m[3])&&n.getElementsByClassName&&t.getElementsByClassName)return q.apply(o,t.getElementsByClassName(a)),o}if(n.qsa&&!T[e+" "]&&(!h||!h.test(e))&&(1!==k||"object"!==t.nodeName.toLowerCase())){if(b=e,w=t,1===k&&($.test(e)||W.test(e))){for((w=ee.test(e)&&be(t.parentNode)||t)===t&&n.scope||((s=t.getAttribute("id"))?s=s.replace(oe,re):t.setAttribute("id",s=x)),p=(g=i(e)).length;p--;)g[p]=(s?"#"+s:":scope")+" "+ye(g[p]);b=g.join(",")}try{return q.apply(o,w.querySelectorAll(b)),o}catch(t){T(e,!0)}finally{s===x&&t.removeAttribute("id")}}}return c(e.replace(R,"$1"),t,o,r)}function ce(){var e=[];return function t(n,r){return e.push(n+" ")>o.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function le(e){return e[x]=!0,e}function se(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function me(e,t){for(var n=e.split("|"),r=n.length;r--;)o.attrHandle[n[r]]=t}function ue(e,t){var n=t&&e,o=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(o)return o;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function de(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function ge(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function fe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return le((function(t){return t=+t,le((function(n,o){for(var r,a=e([],n.length,t),i=a.length;i--;)n[r=a[i]]&&(n[r]=!(o[r]=n[r]))}))}))}function be(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=pe.support={},a=pe.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},u=pe.setDocument=function(e){var t,r,i=e?e.ownerDocument||e:k;return i!=d&&9===i.nodeType&&i.documentElement?(g=(d=i).documentElement,f=!a(d),k!=d&&(r=d.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",ae,!1):r.attachEvent&&r.attachEvent("onunload",ae)),n.scope=se((function(e){return g.appendChild(e).appendChild(d.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.attributes=se((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=se((function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=J.test(d.getElementsByClassName),n.getById=se((function(e){return g.appendChild(e).id=x,!d.getElementsByName||!d.getElementsByName(x).length})),n.getById?(o.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},o.find.ID=function(e,t){if(void 0!==t.getElementById&&f){var n=t.getElementById(e);return n?[n]:[]}}):(o.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},o.find.ID=function(e,t){if(void 0!==t.getElementById&&f){var n,o,r,a=t.getElementById(e);if(a){if((n=a.getAttributeNode("id"))&&n.value===e)return[a];for(r=t.getElementsByName(e),o=0;a=r[o++];)if((n=a.getAttributeNode("id"))&&n.value===e)return[a]}return[]}}),o.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,o=[],r=0,a=t.getElementsByTagName(e);if("*"===e){for(;n=a[r++];)1===n.nodeType&&o.push(n);return o}return a},o.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&f)return t.getElementsByClassName(e)},b=[],h=[],(n.qsa=J.test(d.querySelectorAll))&&(se((function(e){var t;g.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&h.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||h.push("\\["+M+"*(?:value|"+I+")"),e.querySelectorAll("[id~="+x+"-]").length||h.push("~="),(t=d.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||h.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||h.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||h.push(".#.+[+~]"),e.querySelectorAll("\\\f"),h.push("[\\r\\n\\f]")})),se((function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&h.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&h.push(":enabled",":disabled"),g.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")}))),(n.matchesSelector=J.test(w=g.matches||g.webkitMatchesSelector||g.mozMatchesSelector||g.oMatchesSelector||g.msMatchesSelector))&&se((function(e){n.disconnectedMatch=w.call(e,"*"),w.call(e,"[s!='']:x"),b.push("!=",B)})),h=h.length&&new RegExp(h.join("|")),b=b.length&&new RegExp(b.join("|")),t=J.test(g.compareDocumentPosition),y=t||J.test(g.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,o=t&&t.parentNode;return e===o||!(!o||1!==o.nodeType||!(n.contains?n.contains(o):e.compareDocumentPosition&&16&e.compareDocumentPosition(o)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return m=!0,0;var o=!e.compareDocumentPosition-!t.compareDocumentPosition;return o||(1&(o=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===o?e==d||e.ownerDocument==k&&y(k,e)?-1:t==d||t.ownerDocument==k&&y(k,t)?1:s?L(s,e)-L(s,t):0:4&o?-1:1)}:function(e,t){if(e===t)return m=!0,0;var n,o=0,r=e.parentNode,a=t.parentNode,i=[e],p=[t];if(!r||!a)return e==d?-1:t==d?1:r?-1:a?1:s?L(s,e)-L(s,t):0;if(r===a)return ue(e,t);for(n=e;n=n.parentNode;)i.unshift(n);for(n=t;n=n.parentNode;)p.unshift(n);for(;i[o]===p[o];)o++;return o?ue(i[o],p[o]):i[o]==k?-1:p[o]==k?1:0},d):d},pe.matches=function(e,t){return pe(e,null,null,t)},pe.matchesSelector=function(e,t){if(u(e),n.matchesSelector&&f&&!T[t+" "]&&(!b||!b.test(t))&&(!h||!h.test(t)))try{var o=w.call(e,t);if(o||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return o}catch(e){T(t,!0)}return pe(t,d,null,[e]).length>0},pe.contains=function(e,t){return(e.ownerDocument||e)!=d&&u(e),y(e,t)},pe.attr=function(e,t){(e.ownerDocument||e)!=d&&u(e);var r=o.attrHandle[t.toLowerCase()],a=r&&z.call(o.attrHandle,t.toLowerCase())?r(e,t,!f):void 0;return void 0!==a?a:n.attributes||!f?e.getAttribute(t):(a=e.getAttributeNode(t))&&a.specified?a.value:null},pe.escape=function(e){return(e+"").replace(oe,re)},pe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},pe.uniqueSort=function(e){var t,o=[],r=0,a=0;if(m=!n.detectDuplicates,s=!n.sortStable&&e.slice(0),e.sort(D),m){for(;t=e[a++];)t===e[a]&&(r=o.push(a));for(;r--;)e.splice(o[r],1)}return s=null,e},r=pe.getText=function(e){var t,n="",o=0,a=e.nodeType;if(a){if(1===a||9===a||11===a){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=r(e)}else if(3===a||4===a)return e.nodeValue}else for(;t=e[o++];)n+=r(t);return n},(o=pe.selectors={cacheLength:50,createPseudo:le,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||pe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&pe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&Q.test(n)&&(t=i(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=j[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&j(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(o){var r=pe.attr(o,e);return null==r?"!="===t:!t||(r+="","="===t?r===n:"!="===t?r!==n:"^="===t?n&&0===r.indexOf(n):"*="===t?n&&r.indexOf(n)>-1:"$="===t?n&&r.slice(-n.length)===n:"~="===t?(" "+r.replace(H," ")+" ").indexOf(n)>-1:"|="===t&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,o,r){var a="nth"!==e.slice(0,3),i="last"!==e.slice(-4),p="of-type"===t;return 1===o&&0===r?function(e){return!!e.parentNode}:function(t,n,c){var l,s,m,u,d,g,f=a!==i?"nextSibling":"previousSibling",h=t.parentNode,b=p&&t.nodeName.toLowerCase(),w=!c&&!p,y=!1;if(h){if(a){for(;f;){for(u=t;u=u[f];)if(p?u.nodeName.toLowerCase()===b:1===u.nodeType)return!1;g=f="only"===e&&!g&&"nextSibling"}return!0}if(g=[i?h.firstChild:h.lastChild],i&&w){for(y=(d=(l=(s=(m=(u=h)[x]||(u[x]={}))[u.uniqueID]||(m[u.uniqueID]={}))[e]||[])[0]===v&&l[1])&&l[2],u=d&&h.childNodes[d];u=++d&&u&&u[f]||(y=d=0)||g.pop();)if(1===u.nodeType&&++y&&u===t){s[e]=[v,d,y];break}}else if(w&&(y=d=(l=(s=(m=(u=t)[x]||(u[x]={}))[u.uniqueID]||(m[u.uniqueID]={}))[e]||[])[0]===v&&l[1]),!1===y)for(;(u=++d&&u&&u[f]||(y=d=0)||g.pop())&&((p?u.nodeName.toLowerCase()!==b:1!==u.nodeType)||!++y||(w&&((s=(m=u[x]||(u[x]={}))[u.uniqueID]||(m[u.uniqueID]={}))[e]=[v,y]),u!==t)););return(y-=r)===o||y%o==0&&y/o>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||pe.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?le((function(e,n){for(var o,a=r(e,t),i=a.length;i--;)e[o=L(e,a[i])]=!(n[o]=a[i])})):function(e){return r(e,0,n)}):r}},pseudos:{not:le((function(e){var t=[],n=[],o=p(e.replace(R,"$1"));return o[x]?le((function(e,t,n,r){for(var a,i=o(e,null,r,[]),p=e.length;p--;)(a=i[p])&&(e[p]=!(t[p]=a))})):function(e,r,a){return t[0]=e,o(t,null,a,n),t[0]=null,!n.pop()}})),has:le((function(e){return function(t){return pe(e,t).length>0}})),contains:le((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||r(t)).indexOf(e)>-1}})),lang:le((function(e){return X.test(e||"")||pe.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=f?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===g},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:fe(!1),disabled:fe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return G.test(e.nodeName)},input:function(e){return K.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he((function(){return[0]})),last:he((function(e,t){return[t-1]})),eq:he((function(e,t,n){return[n<0?n+t:n]})),even:he((function(e,t){for(var n=0;nt?t:n;--o>=0;)e.push(o);return e})),gt:he((function(e,t,n){for(var o=n<0?n+t:n;++o1?function(t,n,o){for(var r=e.length;r--;)if(!e[r](t,n,o))return!1;return!0}:e[0]}function ve(e,t,n,o,r){for(var a,i=[],p=0,c=e.length,l=null!=t;p-1&&(a[l]=!(i[l]=m))}}else b=ve(b===i?b.splice(g,b.length):b),r?r(null,i,b,c):q.apply(i,b)}))}function je(e){for(var t,n,r,a=e.length,i=o.relative[e[0].type],p=i||o.relative[" "],c=i?1:0,s=xe((function(e){return e===t}),p,!0),m=xe((function(e){return L(t,e)>-1}),p,!0),u=[function(e,n,o){var r=!i&&(o||n!==l)||((t=n).nodeType?s(e,n,o):m(e,n,o));return t=null,r}];c1&&ke(u),c>1&&ye(e.slice(0,c-1).concat({value:" "===e[c-2].type?"*":""})).replace(R,"$1"),n,c0,r=e.length>0,a=function(a,i,p,c,s){var m,g,h,b=0,w="0",y=a&&[],x=[],k=l,_=a||r&&o.find.TAG("*",s),j=v+=null==k?1:Math.random()||.1,E=_.length;for(s&&(l=i==d||i||s);w!==E&&null!=(m=_[w]);w++){if(r&&m){for(g=0,i||m.ownerDocument==d||(u(m),p=!f);h=e[g++];)if(h(m,i||d,p)){c.push(m);break}s&&(v=j)}n&&((m=!h&&m)&&b--,a&&y.push(m))}if(b+=w,n&&w!==b){for(g=0;h=t[g++];)h(y,x,i,p);if(a){if(b>0)for(;w--;)y[w]||x[w]||(x[w]=N.call(c));x=ve(x)}q.apply(c,x),s&&!a&&x.length>0&&b+t.length>1&&pe.uniqueSort(c)}return s&&(v=j,l=k),y};return n?le(a):a}(a,r))).selector=e}return p},c=pe.select=function(e,t,n,r){var a,c,l,s,m,u="function"==typeof e&&e,d=!r&&i(e=u.selector||e);if(n=n||[],1===d.length){if((c=d[0]=d[0].slice(0)).length>2&&"ID"===(l=c[0]).type&&9===t.nodeType&&f&&o.relative[c[1].type]){if(!(t=(o.find.ID(l.matches[0].replace(te,ne),t)||[])[0]))return n;u&&(t=t.parentNode),e=e.slice(c.shift().value.length)}for(a=V.needsContext.test(e)?0:c.length;a--&&(l=c[a],!o.relative[s=l.type]);)if((m=o.find[s])&&(r=m(l.matches[0].replace(te,ne),ee.test(c[0].type)&&be(t.parentNode)||t))){if(c.splice(a,1),!(e=r.length&&ye(c)))return q.apply(n,r),n;break}}return(u||p(e,d))(r,t,!f,n,!t||ee.test(e)&&be(t.parentNode)||t),n},n.sortStable=x.split("").sort(D).join("")===x,n.detectDuplicates=!!m,u(),n.sortDetached=se((function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))})),se((function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")}))||me("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&se((function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||me("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),se((function(e){return null==e.getAttribute("disabled")}))||me(I,(function(e,t,n){var o;if(!n)return!0===e[t]?t.toLowerCase():(o=e.getAttributeNode(t))&&o.specified?o.value:null})),pe}(n);_.find=E,_.expr=E.selectors,_.expr[":"]=_.expr.pseudos,_.uniqueSort=_.unique=E.uniqueSort,_.text=E.getText,_.isXMLDoc=E.isXML,_.contains=E.contains,_.escapeSelector=E.escape;var C=function(e,t,n){for(var o=[],r=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(r&&_(e).is(n))break;o.push(e)}return o},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},D=_.expr.match.needsContext;function z(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var S=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function N(e,t,n){return b(t)?_.grep(e,(function(e,o){return!!t.call(e,o,e)!==n})):t.nodeType?_.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?_.grep(e,(function(e){return s.call(t,e)>-1!==n})):_.filter(t,e,n)}_.filter=function(e,t,n){var o=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===o.nodeType?_.find.matchesSelector(o,e)?[o]:[]:_.find.matches(e,_.grep(t,(function(e){return 1===e.nodeType})))},_.fn.extend({find:function(e){var t,n,o=this.length,r=this;if("string"!=typeof e)return this.pushStack(_(e).filter((function(){for(t=0;t1?_.uniqueSort(n):n},filter:function(e){return this.pushStack(N(this,e||[],!1))},not:function(e){return this.pushStack(N(this,e||[],!0))},is:function(e){return!!N(this,"string"==typeof e&&D.test(e)?_(e):e||[],!1).length}});var A,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(_.fn.init=function(e,t,n){var o,r;if(!e)return this;if(n=n||A,"string"==typeof e){if(!(o="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:q.exec(e))||!o[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(o[1]){if(t=t instanceof _?t[0]:t,_.merge(this,_.parseHTML(o[1],t&&t.nodeType?t.ownerDocument||t:y,!0)),S.test(o[1])&&_.isPlainObject(t))for(o in t)b(this[o])?this[o](t[o]):this.attr(o,t[o]);return this}return(r=y.getElementById(o[2]))&&(this[0]=r,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):b(e)?void 0!==n.ready?n.ready(e):e(_):_.makeArray(e,this)}).prototype=_.fn,A=_(y);var O=/^(?:parents|prev(?:Until|All))/,L={children:!0,contents:!0,next:!0,prev:!0};function I(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}_.fn.extend({has:function(e){var t=_(e,this),n=t.length;return this.filter((function(){for(var e=0;e-1:1===n.nodeType&&_.find.matchesSelector(n,e))){a.push(n);break}return this.pushStack(a.length>1?_.uniqueSort(a):a)},index:function(e){return e?"string"==typeof e?s.call(_(e),this[0]):s.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(_.uniqueSort(_.merge(this.get(),_(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),_.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return C(e,"parentNode")},parentsUntil:function(e,t,n){return C(e,"parentNode",n)},next:function(e){return I(e,"nextSibling")},prev:function(e){return I(e,"previousSibling")},nextAll:function(e){return C(e,"nextSibling")},prevAll:function(e){return C(e,"previousSibling")},nextUntil:function(e,t,n){return C(e,"nextSibling",n)},prevUntil:function(e,t,n){return C(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&i(e.contentDocument)?e.contentDocument:(z(e,"template")&&(e=e.content||e),_.merge([],e.childNodes))}},(function(e,t){_.fn[e]=function(n,o){var r=_.map(this,t,n);return"Until"!==e.slice(-5)&&(o=n),o&&"string"==typeof o&&(r=_.filter(o,r)),this.length>1&&(L[e]||_.uniqueSort(r),O.test(e)&&r.reverse()),this.pushStack(r)}}));var M=/[^\x20\t\r\n\f]+/g;function F(e){return e}function P(e){throw e}function B(e,t,n,o){var r;try{e&&b(r=e.promise)?r.call(e).done(t).fail(n):e&&b(r=e.then)?r.call(e,t,n):t.apply(void 0,[e].slice(o))}catch(e){n.apply(void 0,[e])}}_.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return _.each(e.match(M)||[],(function(e,n){t[n]=!0})),t}(e):_.extend({},e);var t,n,o,r,a=[],i=[],p=-1,c=function(){for(r=r||e.once,o=t=!0;i.length;p=-1)for(n=i.shift();++p-1;)a.splice(n,1),n<=p&&p--})),this},has:function(e){return e?_.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return r=i=[],a=n="",this},disabled:function(){return!a},lock:function(){return r=i=[],n||t||(a=n=""),this},locked:function(){return!!r},fireWith:function(e,n){return r||(n=[e,(n=n||[]).slice?n.slice():n],i.push(n),t||c()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!o}};return l},_.extend({Deferred:function(e){var t=[["notify","progress",_.Callbacks("memory"),_.Callbacks("memory"),2],["resolve","done",_.Callbacks("once memory"),_.Callbacks("once memory"),0,"resolved"],["reject","fail",_.Callbacks("once memory"),_.Callbacks("once memory"),1,"rejected"]],o="pending",r={state:function(){return o},always:function(){return a.done(arguments).fail(arguments),this},catch:function(e){return r.then(null,e)},pipe:function(){var e=arguments;return _.Deferred((function(n){_.each(t,(function(t,o){var r=b(e[o[4]])&&e[o[4]];a[o[1]]((function(){var e=r&&r.apply(this,arguments);e&&b(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this,r?[e]:arguments)}))})),e=null})).promise()},then:function(e,o,r){var a=0;function i(e,t,o,r){return function(){var p=this,c=arguments,l=function(){var n,l;if(!(e=a&&(o!==P&&(p=void 0,c=[n]),t.rejectWith(p,c))}};e?s():(_.Deferred.getStackHook&&(s.stackTrace=_.Deferred.getStackHook()),n.setTimeout(s))}}return _.Deferred((function(n){t[0][3].add(i(0,n,b(r)?r:F,n.notifyWith)),t[1][3].add(i(0,n,b(e)?e:F)),t[2][3].add(i(0,n,b(o)?o:P))})).promise()},promise:function(e){return null!=e?_.extend(e,r):r}},a={};return _.each(t,(function(e,n){var i=n[2],p=n[5];r[n[1]]=i.add,p&&i.add((function(){o=p}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),i.add(n[3].fire),a[n[0]]=function(){return a[n[0]+"With"](this===a?void 0:this,arguments),this},a[n[0]+"With"]=i.fireWith})),r.promise(a),e&&e.call(a,a),a},when:function(e){var t=arguments.length,n=t,o=Array(n),r=p.call(arguments),a=_.Deferred(),i=function(e){return function(n){o[e]=this,r[e]=arguments.length>1?p.call(arguments):n,--t||a.resolveWith(o,r)}};if(t<=1&&(B(e,a.done(i(n)).resolve,a.reject,!t),"pending"===a.state()||b(r[n]&&r[n].then)))return a.then();for(;n--;)B(r[n],i(n),a.reject);return a.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;_.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&H.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},_.readyException=function(e){n.setTimeout((function(){throw e}))};var R=_.Deferred();function U(){y.removeEventListener("DOMContentLoaded",U),n.removeEventListener("load",U),_.ready()}_.fn.ready=function(e){return R.then(e).catch((function(e){_.readyException(e)})),this},_.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--_.readyWait:_.isReady)||(_.isReady=!0,!0!==e&&--_.readyWait>0||R.resolveWith(y,[_]))}}),_.ready.then=R.then,"complete"===y.readyState||"loading"!==y.readyState&&!y.documentElement.doScroll?n.setTimeout(_.ready):(y.addEventListener("DOMContentLoaded",U),n.addEventListener("load",U));var W=function(e,t,n,o,r,a,i){var p=0,c=e.length,l=null==n;if("object"===v(n))for(p in r=!0,n)W(e,t,p,n[p],!0,a,i);else if(void 0!==o&&(r=!0,b(o)||(i=!0),l&&(i?(t.call(e,o),t=null):(l=t,t=function(e,t,n){return l.call(_(e),n)})),t))for(;p1,null,!0)},removeData:function(e){return this.each((function(){J.remove(this,e)}))}}),_.extend({queue:function(e,t,n){var o;if(e)return t=(t||"fx")+"queue",o=G.get(e,t),n&&(!o||Array.isArray(n)?o=G.access(e,t,_.makeArray(n)):o.push(n)),o||[]},dequeue:function(e,t){t=t||"fx";var n=_.queue(e,t),o=n.length,r=n.shift(),a=_._queueHooks(e,t);"inprogress"===r&&(r=n.shift(),o--),r&&("fx"===t&&n.unshift("inprogress"),delete a.stop,r.call(e,(function(){_.dequeue(e,t)}),a)),!o&&a&&a.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return G.get(e,n)||G.access(e,n,{empty:_.Callbacks("once memory").add((function(){G.remove(e,[t+"queue",n])}))})}}),_.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,be=/^$|^module$|\/(?:java|ecma)script/i;de=y.createDocumentFragment().appendChild(y.createElement("div")),(ge=y.createElement("input")).setAttribute("type","radio"),ge.setAttribute("checked","checked"),ge.setAttribute("name","t"),de.appendChild(ge),h.checkClone=de.cloneNode(!0).cloneNode(!0).lastChild.checked,de.innerHTML="",h.noCloneChecked=!!de.cloneNode(!0).lastChild.defaultValue,de.innerHTML="",h.option=!!de.lastChild;var we={thead:[1,"