From 3005c349cadec58419d518bff2838f0fb5d72f28 Mon Sep 17 00:00:00 2001 From: Mark Chapman Date: Sat, 20 Jan 2018 19:54:57 +0000 Subject: [PATCH 1/5] chore(deps) forms-angular has removed $data as of 390ad16 --- .../b-enhanced-schema-justnameandpostcode.js | 8 ++++---- app/scripts/controllers/b-enhanced-schema.js | 6 +++--- app/scripts/controllers/d-array-example.js | 10 +++++----- app/scripts/controllers/h_deep_nesting.js | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/scripts/controllers/b-enhanced-schema-justnameandpostcode.js b/app/scripts/controllers/b-enhanced-schema-justnameandpostcode.js index 0e23192..bb43861 100644 --- a/app/scripts/controllers/b-enhanced-schema-justnameandpostcode.js +++ b/app/scripts/controllers/b-enhanced-schema-justnameandpostcode.js @@ -1,10 +1,10 @@ 'use strict'; -websiteApp.controller('BEnhancedSchemaJustnameandpostcodeCtrl', ['$scope', '$data', function ($scope, $data) { +websiteApp.controller('BEnhancedSchemaJustnameandpostcodeCtrl', ['$scope', function ($scope) { - $scope.record = $data.record; + $scope.record = $scope.sharedData.record; - $data.modelNameDisplay = 'Another override'; - $data.dropDownDisplay = 'Custom 2nd Level'; + $scope.sharedData.modelNameDisplay = 'Another override'; + $scope.sharedData.dropDownDisplay = 'Custom 2nd Level'; $scope.contextMenu = [ diff --git a/app/scripts/controllers/b-enhanced-schema.js b/app/scripts/controllers/b-enhanced-schema.js index 340dda8..a84ebfe 100644 --- a/app/scripts/controllers/b-enhanced-schema.js +++ b/app/scripts/controllers/b-enhanced-schema.js @@ -1,10 +1,10 @@ 'use strict'; -websiteApp.controller('BEnhancedSchemaCtrl', ['$scope', '$data', '$timeout', function ($scope, $data) { +websiteApp.controller('BEnhancedSchemaCtrl', ['$scope', function ($scope) { - $scope.record = $data.record; + $scope.record = $scope.sharedData.record; - $data.dropDownDisplay = 'Custom Dropdown'; + $scope.sharedData.dropDownDisplay = 'Custom Dropdown'; $scope.doAlert = function (message, showId) { var alertMessage = message; diff --git a/app/scripts/controllers/d-array-example.js b/app/scripts/controllers/d-array-example.js index 5e0c5f5..14ed261 100644 --- a/app/scripts/controllers/d-array-example.js +++ b/app/scripts/controllers/d-array-example.js @@ -1,9 +1,9 @@ 'use strict'; -websiteApp.controller('DArrayExampleCtrl', ['$scope', '$data', function ($scope, $data) { +websiteApp.controller('DArrayExampleCtrl', ['$scope', function ($scope) { - $scope.disableFunctions = $data.disableFunctions; - $scope.dataEventFunctions = $data.dataEventFunctions; - $scope.record = $data.record; + $scope.disableFunctions = $scope.sharedData.disableFunctions; + $scope.dataEventFunctions = $scope.sharedData.dataEventFunctions; + $scope.record = $scope.sharedData.record; $scope.disableFunctions.isDeleteDisabled = function (record, oldRecord) { // Do not allow records that have previously been "accepted" to be deleted @@ -14,4 +14,4 @@ websiteApp.controller('DArrayExampleCtrl', ['$scope', '$data', function ($scope, alert('Here is an example onAfterCreate event. ' + JSON.stringify(data)); }; -}]); \ No newline at end of file +}]); diff --git a/app/scripts/controllers/h_deep_nesting.js b/app/scripts/controllers/h_deep_nesting.js index 78b73b3..4ac0cb2 100644 --- a/app/scripts/controllers/h_deep_nesting.js +++ b/app/scripts/controllers/h_deep_nesting.js @@ -1,7 +1,7 @@ 'use strict'; -websiteApp.controller('HDeepNestingCtrl', ['$data', function ($data) { +websiteApp.controller('HDeepNestingCtrl', ['$scope', function ($scope) { - $data.modelNameDisplay = 'Nesting (work in early progress - buggy)'; + $scope.sharedData.modelNameDisplay = 'Nesting (work in early progress - buggy)'; }]); From f56f4a91368767e7e3ce2f474b1d65d30c382e32 Mon Sep 17 00:00:00 2001 From: Mark Chapman Date: Sun, 18 Feb 2018 23:05:37 +0000 Subject: [PATCH 2/5] doc(forms) Document changes to client customisation --- app/partials/forms.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/partials/forms.html b/app/partials/forms.html index 1b83ad5..9fe315f 100644 --- a/app/partials/forms.html +++ b/app/partials/forms.html @@ -325,8 +325,12 @@
Client side data events
  • onAfterDelete function(old)
  • In all onBefore... cases passing an error back will stop the event completing. There is a trivial example of - how a data event hook might be used in this controller, which shows - how such event handlers are set up.

    + how a data event hook might be used in this controller, which shows + how such event handlers are set up. In the case of the onBeforeCreate or onBeforeUpdate events the update/create + can be handled within the function by passing back the special err of '_update_handled_'. In these cases it will + usually be helpful to call baseScope.prepareForSave(cb: (error: string, dataToSave?: any) => void): void + to convert the client-side model into the format that needs to be written back to MongoDb. +

    You can also call onRecordChange function(data, old) which is useful for updating calculated fields etc.

    From 5be090fba0c3211d9c87e37cc651b8c05edb1206 Mon Sep 17 00:00:00 2001 From: Mark Chapman Date: Wed, 14 Mar 2018 01:08:34 +0000 Subject: [PATCH 3/5] refactor(gen) Promote examples to its own menu --- app/partials/examples.html | 4 ++-- app/partials/navbar.html | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/partials/examples.html b/app/partials/examples.html index 9a975b5..827ba30 100644 --- a/app/partials/examples.html +++ b/app/partials/examples.html @@ -5,8 +5,8 @@

    Example Forms

    -

    Below there are several examples of forms and customisations, some of which are linked to from other parts of the documentation.

    -

    There a number of keyboard short cuts that can be used in the forms. Hit ? to find out more.

    +

    Below there are several examples of forms and customisations, some of which are linked to from other parts of the documentation. In each case you can view the schema, create a new document or list the collection (and drill down to existing documents). Together they should give a good idea of some of the basic things you can do with forms-angular.

    +

    There are a number of keyboard short cuts that can be used in the forms. Hit ? to find out more.

    diff --git a/app/partials/navbar.html b/app/partials/navbar.html index 2749712..72f2c30 100644 --- a/app/partials/navbar.html +++ b/app/partials/navbar.html @@ -23,6 +23,7 @@
  • Schemas
  • Forms
  • Plugins
  • +
  • Examples
  • More
  • {{model.resourceName | titleCase}}
    diff --git a/dist/partials/forms.html b/dist/partials/forms.html index 960fe4f..3422d09 100644 --- a/dist/partials/forms.html +++ b/dist/partials/forms.html @@ -325,8 +325,12 @@
    Client side data events
  • onAfterDelete function(old)
  • In all onBefore... cases passing an error back will stop the event completing. There is a trivial example of - how a data event hook might be used in this controller, which shows - how such event handlers are set up.

    + how a data event hook might be used in this controller, which shows + how such event handlers are set up. In the case of the onBeforeCreate or onBeforeUpdate events the update/create + can be handled within the function by passing back the special err of '_update_handled_'. In these cases it will + usually be helpful to call baseScope.prepareForSave(cb: (error: string, dataToSave?: any) => void): void + to convert the client-side model into the format that needs to be written back to MongoDb. +

    You can also call onRecordChange function(data, old) which is useful for updating calculated fields etc.

    diff --git a/dist/partials/navbar.html b/dist/partials/navbar.html index 3f18d18..56d3fb4 100644 --- a/dist/partials/navbar.html +++ b/dist/partials/navbar.html @@ -23,6 +23,7 @@
  • Schemas
  • Forms
  • Plugins
  • +
  • Examples
  • More
  • {{model.resourceName | titleCase}}
    ","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};je.optgroup=je.option,je.tbody=je.tfoot=je.colgroup=je.caption=je.thead,je.th=je.td;var ze=/<|&#?\w+;/;!function(){var e=K.createDocumentFragment().appendChild(K.createElement("div")),t=K.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),ae.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",ae.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var qe=K.documentElement,Be=/^key/,Ve=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ue=/^([^.]*)(?:\.(.+)|)/;se.event={global:{},add:function(e,t,n,i,r){var o,a,s,l,u,c,d,p,h,f,g,m=Ee.get(e);if(m)for(n.handler&&(n=(o=n).handler,r=o.selector),r&&se.find.matchesSelector(qe,r),n.guid||(n.guid=se.guid++),(l=m.events)||(l=m.events={}),(a=m.handle)||(a=m.handle=function(t){return void 0!==se&&se.event.triggered!==t.type?se.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(Ce)||[""]).length;u--;)h=g=(s=Ue.exec(t[u])||[])[1],f=(s[2]||"").split(".").sort(),h&&(d=se.event.special[h]||{},h=(r?d.delegateType:d.bindType)||h,d=se.event.special[h]||{},c=se.extend({type:h,origType:g,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&se.expr.match.needsContext.test(r),namespace:f.join(".")},o),(p=l[h])||((p=l[h]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,i,f,a)||e.addEventListener&&e.addEventListener(h,a)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),r?p.splice(p.delegateCount++,0,c):p.push(c),se.event.global[h]=!0)},remove:function(e,t,n,i,r){var o,a,s,l,u,c,d,p,h,f,g,m=Ee.hasData(e)&&Ee.get(e);if(m&&(l=m.events)){for(u=(t=(t||"").match(Ce)||[""]).length;u--;)if(s=Ue.exec(t[u])||[],h=g=s[1],f=(s[2]||"").split(".").sort(),h){for(d=se.event.special[h]||{},p=l[h=(i?d.delegateType:d.bindType)||h]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!r&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,d.remove&&d.remove.call(e,c));a&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,f,m.handle)||se.removeEvent(e,h,m.handle),delete l[h])}else for(h in l)se.event.remove(e,h+t[u],n,i,!0);se.isEmptyObject(l)&&Ee.remove(e,"handle events")}},dispatch:function(e){var t,n,i,r,o,a,s=se.event.fix(e),l=new Array(arguments.length),u=(Ee.get(this,"events")||{})[s.type]||[],c=se.event.special[s.type]||{};for(l[0]=s,t=1;t=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(o=[],a={},n=0;n-1:se.find(r,this,null,[u]).length),a[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return u=this,l\x20\t\r\n\f]*)[^>]*)\/>/gi,We=/\s*$/g;se.extend({htmlPrefilter:function(e){return e.replace(Ge,"<$1>")},clone:function(e,t,n){var i,r,o,a,s=e.cloneNode(!0),l=se.contains(e.ownerDocument,e);if(!(ae.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||se.isXMLDoc(e)))for(a=m(s),i=0,r=(o=m(e)).length;i0&&v(a,!l&&m(e,"script")),s},cleanData:function(e){for(var t,n,i,r=se.event.special,o=0;void 0!==(n=e[o]);o++)if(Se(n)){if(t=n[Ee.expando]){if(t.events)for(i in t.events)r[i]?se.event.remove(n,i):se.removeEvent(n,i,t.handle);n[Ee.expando]=void 0}n[Te.expando]&&(n[Te.expando]=void 0)}}}),se.fn.extend({detach:function(e){return A(this,e,!0)},remove:function(e){return A(this,e)},text:function(e){return ke(this,function(e){return void 0===e?se.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return T(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){$(this,e).appendChild(e)}})},prepend:function(){return T(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=$(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return T(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return T(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(se.cleanData(m(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return se.clone(this,e,t)})},html:function(e){return ke(this,function(e){var t=this[0]||{},n=0,i=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!We.test(e)&&!je[(Le.exec(e)||["",""])[1].toLowerCase()]){e=se.htmlPrefilter(e);try{for(;n1)}}),se.Tween=F,(F.prototype={constructor:F,init:function(e,t,n,i,r,o){this.elem=e,this.prop=n,this.easing=r||se.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=o||(se.cssNumber[n]?"":"px")},cur:function(){var e=F.propHooks[this.prop];return e&&e.get?e.get(this):F.propHooks._default.get(this)},run:function(e){var t,n=F.propHooks[this.prop];return this.options.duration?this.pos=t=se.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):F.propHooks._default.set(this),this}}).init.prototype=F.prototype,(F.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=se.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){se.fx.step[e.prop]?se.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[se.cssProps[e.prop]]&&!se.cssHooks[e.prop]?e.elem[e.prop]=e.now:se.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=F.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},se.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},se.fx=F.prototype.init,se.fx.step={};var at,st,lt=/^(?:toggle|show|hide)$/,ut=/queueHooks$/;se.Animation=se.extend(z,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return h(n.elem,e,Ie.exec(t),n),n}]},tweener:function(e,t){se.isFunction(e)?(t=e,e=["*"]):e=e.match(Ce);for(var n,i=0,r=e.length;i1)},removeAttr:function(e){return this.each(function(){se.removeAttr(this,e)})}}),se.extend({attr:function(e,t,n){var i,r,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?se.prop(e,t,n):(1===o&&se.isXMLDoc(e)||(r=se.attrHooks[t.toLowerCase()]||(se.expr.match.bool.test(t)?ct:void 0)),void 0!==n?null===n?void se.removeAttr(e,t):r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):r&&"get"in r&&null!==(i=r.get(e,t))?i:null==(i=se.find.attr(e,t))?void 0:i)},attrHooks:{type:{set:function(e,t){if(!ae.radioValue&&"radio"===t&&r(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,i=0,r=t&&t.match(Ce);if(r&&1===e.nodeType)for(;n=r[i++];)e.removeAttribute(n)}}),ct={set:function(e,t,n){return!1===t?se.removeAttr(e,n):e.setAttribute(n,n),n}},se.each(se.expr.match.bool.source.match(/\w+/g),function(e,t){var n=dt[t]||se.find.attr;dt[t]=function(e,t,i){var r,o,a=t.toLowerCase();return i||(o=dt[a],dt[a]=r,r=null!=n(e,t,i)?a:null,dt[a]=o),r}});var pt=/^(?:input|select|textarea|button)$/i,ht=/^(?:a|area)$/i;se.fn.extend({prop:function(e,t){return ke(this,se.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[se.propFix[e]||e]})}}),se.extend({prop:function(e,t,n){var i,r,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&se.isXMLDoc(e)||(t=se.propFix[t]||t,r=se.propHooks[t]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:e[t]=n:r&&"get"in r&&null!==(i=r.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=se.find.attr(e,"tabindex");return t?parseInt(t,10):pt.test(e.nodeName)||ht.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),ae.optSelected||(se.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),se.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){se.propFix[this.toLowerCase()]=this}),se.fn.extend({addClass:function(e){var t,n,i,r,o,a,s,l=0;if(se.isFunction(e))return this.each(function(t){se(this).addClass(e.call(this,t,B(this)))});if("string"==typeof e&&e)for(t=e.match(Ce)||[];n=this[l++];)if(r=B(n),i=1===n.nodeType&&" "+q(r)+" "){for(a=0;o=t[a++];)i.indexOf(" "+o+" ")<0&&(i+=o+" ");r!==(s=q(i))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,i,r,o,a,s,l=0;if(se.isFunction(e))return this.each(function(t){se(this).removeClass(e.call(this,t,B(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(Ce)||[];n=this[l++];)if(r=B(n),i=1===n.nodeType&&" "+q(r)+" "){for(a=0;o=t[a++];)for(;i.indexOf(" "+o+" ")>-1;)i=i.replace(" "+o+" "," ");r!==(s=q(i))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):se.isFunction(e)?this.each(function(n){se(this).toggleClass(e.call(this,n,B(this),t),t)}):this.each(function(){var t,i,r,o;if("string"===n)for(i=0,r=se(this),o=e.match(Ce)||[];t=o[i++];)r.hasClass(t)?r.removeClass(t):r.addClass(t);else void 0!==e&&"boolean"!==n||((t=B(this))&&Ee.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Ee.get(this,"__className__")||""))})},hasClass:function(e){var t,n,i=0;for(t=" "+e+" ";n=this[i++];)if(1===n.nodeType&&(" "+q(B(n))+" ").indexOf(t)>-1)return!0;return!1}});var ft=/\r/g;se.fn.extend({val:function(e){var t,n,i,r=this[0];{if(arguments.length)return i=se.isFunction(e),this.each(function(n){var r;1===this.nodeType&&(null==(r=i?e.call(this,n,se(this).val()):e)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=se.map(r,function(e){return null==e?"":e+""})),(t=se.valHooks[this.type]||se.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,r,"value")||(this.value=r))});if(r)return(t=se.valHooks[r.type]||se.valHooks[r.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(ft,""):null==n?"":n}}}),se.extend({valHooks:{option:{get:function(e){var t=se.find.attr(e,"value");return null!=t?t:q(se.text(e))}},select:{get:function(e){var t,n,i,o=e.options,a=e.selectedIndex,s="select-one"===e.type,l=s?null:[],u=s?a+1:o.length;for(i=a<0?u:s?a:0;i-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),se.each(["radio","checkbox"],function(){se.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=se.inArray(se(e).val(),t)>-1}},ae.checkOn||(se.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var gt=/^(?:focusinfocus|focusoutblur)$/;se.extend(se.event,{trigger:function(t,n,i,r){var o,a,s,l,u,c,d,p=[i||K],h=ie.call(t,"type")?t.type:t,f=ie.call(t,"namespace")?t.namespace.split("."):[];if(a=s=i=i||K,3!==i.nodeType&&8!==i.nodeType&&!gt.test(h+se.event.triggered)&&(h.indexOf(".")>-1&&(h=(f=h.split(".")).shift(),f.sort()),u=h.indexOf(":")<0&&"on"+h,t=t[se.expando]?t:new se.Event(h,"object"==typeof t&&t),t.isTrigger=r?2:3,t.namespace=f.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:se.makeArray(n,[t]),d=se.event.special[h]||{},r||!d.trigger||!1!==d.trigger.apply(i,n))){if(!r&&!d.noBubble&&!se.isWindow(i)){for(l=d.delegateType||h,gt.test(l+h)||(a=a.parentNode);a;a=a.parentNode)p.push(a),s=a;s===(i.ownerDocument||K)&&p.push(s.defaultView||s.parentWindow||e)}for(o=0;(a=p[o++])&&!t.isPropagationStopped();)t.type=o>1?l:d.bindType||h,(c=(Ee.get(a,"events")||{})[t.type]&&Ee.get(a,"handle"))&&c.apply(a,n),(c=u&&a[u])&&c.apply&&Se(a)&&(t.result=c.apply(a,n),!1===t.result&&t.preventDefault());return t.type=h,r||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),n)||!Se(i)||u&&se.isFunction(i[h])&&!se.isWindow(i)&&((s=i[u])&&(i[u]=null),se.event.triggered=h,i[h](),se.event.triggered=void 0,s&&(i[u]=s)),t.result}},simulate:function(e,t,n){var i=se.extend(new se.Event,n,{type:e,isSimulated:!0});se.event.trigger(i,null,t)}}),se.fn.extend({trigger:function(e,t){return this.each(function(){se.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return se.event.trigger(e,t,n,!0)}}),se.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){se.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),se.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),ae.focusin="onfocusin"in e,ae.focusin||se.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){se.event.simulate(t,e.target,se.event.fix(e))};se.event.special[t]={setup:function(){var i=this.ownerDocument||this,r=Ee.access(i,t);r||i.addEventListener(e,n,!0),Ee.access(i,t,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this,r=Ee.access(i,t)-1;r?Ee.access(i,t,r):(i.removeEventListener(e,n,!0),Ee.remove(i,t))}}});var mt=e.location,vt=se.now(),bt=/\?/;se.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||se.error("Invalid XML: "+t),n};var yt=/\[\]$/,wt=/\r?\n/g,xt=/^(?:submit|button|image|reset|file)$/i,Ct=/^(?:input|select|textarea|keygen)/i;se.param=function(e,t){var n,i=[],r=function(e,t){var n=se.isFunction(t)?t():t;i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!se.isPlainObject(e))se.each(e,function(){r(this.name,this.value)});else for(n in e)V(n,e[n],t,r);return i.join("&")},se.fn.extend({serialize:function(){return se.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=se.prop(this,"elements");return e?se.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!se(this).is(":disabled")&&Ct.test(this.nodeName)&&!xt.test(e)&&(this.checked||!Ne.test(e))}).map(function(e,t){var n=se(this).val();return null==n?null:Array.isArray(n)?se.map(n,function(e){return{name:t.name,value:e.replace(wt,"\r\n")}}):{name:t.name,value:n.replace(wt,"\r\n")}}).get()}});var $t=/%20/g,_t=/#.*$/,kt=/([?&])_=[^&]*/,St=/^(.*?):[ \t]*([^\r\n]*)$/gm,Et=/^(?:GET|HEAD)$/,Tt=/^\/\//,At={},Dt={},Pt="*/".concat("*"),It=K.createElement("a");It.href=mt.href,se.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:mt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(mt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Pt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":se.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?W(W(e,se.ajaxSettings),t):W(se.ajaxSettings,e)},ajaxPrefilter:U(At),ajaxTransport:U(Dt),ajax:function(t,n){function i(t,n,i,s){var u,p,h,w,x,C=n;c||(c=!0,l&&e.clearTimeout(l),r=void 0,a=s||"",$.readyState=t>0?4:0,u=t>=200&&t<300||304===t,i&&(w=function(e,t,n){for(var i,r,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(r in s)if(s[r]&&s[r].test(i)){l.unshift(r);break}if(l[0]in n)o=l[0];else{for(r in n){if(!l[0]||e.converters[r+" "+l[0]]){o=r;break}a||(a=r)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}(f,$,i)),w=function(e,t,n,i){var r,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(r in u)if((s=r.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[r]:!0!==u[r]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(f,w,$,u),u?(f.ifModified&&((x=$.getResponseHeader("Last-Modified"))&&(se.lastModified[o]=x),(x=$.getResponseHeader("etag"))&&(se.etag[o]=x)),204===t||"HEAD"===f.type?C="nocontent":304===t?C="notmodified":(C=w.state,p=w.data,u=!(h=w.error))):(h=C,!t&&C||(C="error",t<0&&(t=0))),$.status=t,$.statusText=(n||C)+"",u?v.resolveWith(g,[p,C,$]):v.rejectWith(g,[$,C,h]),$.statusCode(y),y=void 0,d&&m.trigger(u?"ajaxSuccess":"ajaxError",[$,f,u?p:h]),b.fireWith(g,[$,C]),d&&(m.trigger("ajaxComplete",[$,f]),--se.active||se.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var r,o,a,s,l,u,c,d,p,h,f=se.ajaxSetup({},n),g=f.context||f,m=f.context&&(g.nodeType||g.jquery)?se(g):se.event,v=se.Deferred(),b=se.Callbacks("once memory"),y=f.statusCode||{},w={},x={},C="canceled",$={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s)for(s={};t=St.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=x[e.toLowerCase()]=x[e.toLowerCase()]||e,w[e]=t),this},overrideMimeType:function(e){return null==c&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)$.always(e[$.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||C;return r&&r.abort(t),i(0,t),this}};if(v.promise($),f.url=((t||f.url||mt.href)+"").replace(Tt,mt.protocol+"//"),f.type=n.method||n.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(Ce)||[""],null==f.crossDomain){u=K.createElement("a");try{u.href=f.url,u.href=u.href,f.crossDomain=It.protocol+"//"+It.host!=u.protocol+"//"+u.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=se.param(f.data,f.traditional)),G(At,f,n,$),c)return $;(d=se.event&&f.global)&&0==se.active++&&se.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Et.test(f.type),o=f.url.replace(_t,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace($t,"+")):(h=f.url.slice(o.length),f.data&&(o+=(bt.test(o)?"&":"?")+f.data,delete f.data),!1===f.cache&&(o=o.replace(kt,"$1"),h=(bt.test(o)?"&":"?")+"_="+vt+++h),f.url=o+h),f.ifModified&&(se.lastModified[o]&&$.setRequestHeader("If-Modified-Since",se.lastModified[o]),se.etag[o]&&$.setRequestHeader("If-None-Match",se.etag[o])),(f.data&&f.hasContent&&!1!==f.contentType||n.contentType)&&$.setRequestHeader("Content-Type",f.contentType),$.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Pt+"; q=0.01":""):f.accepts["*"]);for(p in f.headers)$.setRequestHeader(p,f.headers[p]);if(f.beforeSend&&(!1===f.beforeSend.call(g,$,f)||c))return $.abort();if(C="abort",b.add(f.complete),$.done(f.success),$.fail(f.error),r=G(Dt,f,n,$)){if($.readyState=1,d&&m.trigger("ajaxSend",[$,f]),c)return $;f.async&&f.timeout>0&&(l=e.setTimeout(function(){$.abort("timeout")},f.timeout));try{c=!1,r.send(w,i)}catch(e){if(c)throw e;i(-1,e)}}else i(-1,"No Transport");return $},getJSON:function(e,t,n){return se.get(e,t,n,"json")},getScript:function(e,t){return se.get(e,void 0,t,"script")}}),se.each(["get","post"],function(e,t){se[t]=function(e,n,i,r){return se.isFunction(n)&&(r=r||i,i=n,n=void 0),se.ajax(se.extend({url:e,type:t,dataType:r,data:n,success:i},se.isPlainObject(e)&&e))}}),se._evalUrl=function(e){return se.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},se.fn.extend({wrapAll:function(e){var t;return this[0]&&(se.isFunction(e)&&(e=e.call(this[0])),t=se(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return se.isFunction(e)?this.each(function(t){se(this).wrapInner(e.call(this,t))}):this.each(function(){var t=se(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=se.isFunction(e);return this.each(function(n){se(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){se(this).replaceWith(this.childNodes)}),this}}),se.expr.pseudos.hidden=function(e){return!se.expr.pseudos.visible(e)},se.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},se.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Mt={0:200,1223:204},Ot=se.ajaxSettings.xhr();ae.cors=!!Ot&&"withCredentials"in Ot,ae.ajax=Ot=!!Ot,se.ajaxTransport(function(t){var n,i;if(ae.cors||Ot&&!t.crossDomain)return{send:function(r,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(a in r)s.setRequestHeader(a,r[a]);n=function(e){return function(){n&&(n=i=s.onload=s.onerror=s.onabort=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Mt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),i=s.onerror=n("error"),void 0!==s.onabort?s.onabort=i:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&i()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),se.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),se.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return se.globalEval(e),e}}}),se.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),se.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,r){t=se("