From d6b6d6b15aa417eb2d42b7789f5b56eeb6ec0d9b Mon Sep 17 00:00:00 2001 From: Jagdish Kunwar Date: Thu, 16 Feb 2023 10:51:53 -0500 Subject: [PATCH 1/3] code formatting --- .../assets/js/collections/my-form-snippets.js | 106 +++++++++--------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/collections/my-form-snippets.js b/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/collections/my-form-snippets.js index 5cfead074..ee7d6fced 100644 --- a/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/collections/my-form-snippets.js +++ b/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/collections/my-form-snippets.js @@ -1,53 +1,53 @@ define([ - "jquery" , "underscore" , "backbone", "helper/pubsub" - , "models/snippet" - , "collections/snippets" - , "views/my-form-snippet" - , "text!data/n2attributeboolean.json" - , "text!data/n2.json" , "text!data/n2attributes.json" -], function( - $, _, Backbone,PubSub + "jquery", "underscore", "backbone", "helper/pubsub" + , "models/snippet" + , "collections/snippets" + , "views/my-form-snippet" + , "text!data/n2attributeboolean.json" + , "text!data/n2.json", "text!data/n2attributes.json" +], function ( + $, _, Backbone, PubSub , SnippetModel , SnippetsCollection - , MyFormSnippetView - , n2AttrBoolean - ,n2mandatoryJSON , attributesJSON - -){ + , MyFormSnippetView + , n2AttrBoolean + , n2mandatoryJSON, attributesJSON + +) { return SnippetsCollection.extend({ model: SnippetModel - , initialize: function() { + , initialize: function () { this.counter = {}; this.on("add", this.giveUniqueIdandN2boolean); } - , giveUniqueIdandN2boolean: function(snippet){ - if(!snippet.get("fresh")) { + , giveUniqueIdandN2boolean: function (snippet) { + if (!snippet.get("fresh")) { return; } snippet.set("fresh", false); var snippetType = snippet.attributes.fields.type.value; - if(typeof this.counter[snippetType] === "undefined") { + if (typeof this.counter[snippetType] === "undefined") { this.counter[snippetType] = 0; } else { this.counter[snippetType] += 1; } snippet.setField("n2id", "nunaliit-" + snippetType + "-" + this.counter[snippetType]); - if(typeof snippet.get("fields")["id2"] !== "undefined") { + if (typeof snippet.get("fields")["id2"] !== "undefined") { snippet.setField("id2", snippetType + "2-" + this.counter[snippetType]); } - snippet.mergeField(new Backbone.Model(JSON.parse(n2AttrBoolean)[0])) + snippet.mergeField(new Backbone.Model(JSON.parse(n2AttrBoolean)[0])) } - , giveUniqueId: function(snippet){ - if(!snippet.get("fresh")) { + , giveUniqueId: function (snippet) { + if (!snippet.get("fresh")) { return; } snippet.set("fresh", false); var snippetType = snippet.attributes.fields.type.value; - if(typeof this.counter[snippetType] === "undefined") { + if (typeof this.counter[snippetType] === "undefined") { this.counter[snippetType] = 0; } else { this.counter[snippetType] += 1; @@ -55,31 +55,31 @@ define([ snippet.setField("n2id", "nunaliit-" + snippetType + "-" + this.counter[snippetType]); - if(typeof snippet.get("fields")["id2"] !== "undefined") { + if (typeof snippet.get("fields")["id2"] !== "undefined") { snippet.setField("id2", snippetType + "2-" + this.counter[snippetType]); } } - , containsFileType: function(){ - return !(typeof this.find(function(snippet){ + , containsFileType: function () { + return !(typeof this.find(function (snippet) { return snippet.attributes.title === "File Button" }) === "undefined"); } - , readRapeSnippets: function(modelJSON){ + , readRapeSnippets: function (modelJSON) { - this.reset(); + this.reset(); var rapeSnippets = modelJSON; var infoSnippetJson = JSON.parse(n2mandatoryJSON); var attrSnippetJson = JSON.parse(attributesJSON); - var attrBoolSnippetInstance = JSON.parse(n2AttrBoolean) [0] + var attrBoolSnippetInstance = JSON.parse(n2AttrBoolean)[0] var that = this; //adding info-snippet - _.each( infoSnippetJson, function(infoSnippetInstance){ + _.each(infoSnippetJson, function (infoSnippetInstance) { var infoSnippet = new SnippetModel(infoSnippetInstance) - infoSnippet.set("fresh", false); - infoSnippet.set("fromDb", true); - _.each(_.keys(rapeSnippets), function(fieldname){ - if(fieldname !== "attributes"){ - fieldnameDecorated = fieldname === "id"? "n2id" : fieldname; + infoSnippet.set("fresh", false); + infoSnippet.set("fromDb", true); + _.each(_.keys(rapeSnippets), function (fieldname) { + if (fieldname !== "attributes") { + fieldnameDecorated = fieldname === "id" ? "n2id" : fieldname; infoSnippet.setFieldFromJson(fieldnameDecorated, rapeSnippets[fieldname]) } }) @@ -88,29 +88,29 @@ define([ }); //adding attributes-Snippets var attrs = rapeSnippets["attributes"]; - _.each( attrs, function(attr){ - var candidateSnippetModel = _.find(attrSnippetJson, function(n2attr) { + _.each(attrs, function (attr) { + var candidateSnippetModel = _.find(attrSnippetJson, function (n2attr) { return n2attr["fields"]["type"]["value"] === attr["type"] }) - if(typeof candidateSnippetModel !== "undefined"){ + if (typeof candidateSnippetModel !== "undefined") { - var newCandidateSnippetModel =JSON.parse(JSON.stringify(candidateSnippetModel)) + var newCandidateSnippetModel = JSON.parse(JSON.stringify(candidateSnippetModel)) var candidateSnippetInstance = new SnippetModel(newCandidateSnippetModel); candidateSnippetInstance.set("fresh", false); candidateSnippetInstance.set("fromDb", true); var newAttrBoolSnippetInstance = JSON.parse(JSON.stringify(attrBoolSnippetInstance)) candidateSnippetInstance.mergeField(new Backbone.Model(newAttrBoolSnippetInstance)); - _.each(_.keys(attr), function(fieldname){ - if(typeof candidateSnippetInstance.get("fields")[fieldname] !== "undefined" || - fieldname === "id" - ){ - fieldnameDecorated = fieldname === "id"? "n2id" : fieldname; - candidateSnippetInstance.setFieldFromJson( fieldnameDecorated, attr[fieldname]); + _.each(_.keys(attr), function (fieldname) { + if (typeof candidateSnippetInstance.get("fields")[fieldname] !== "undefined" || + fieldname === "id" + ) { + fieldnameDecorated = fieldname === "id" ? "n2id" : fieldname; + candidateSnippetInstance.setFieldFromJson(fieldnameDecorated, attr[fieldname]); } }) - }else{ - alert("CAUSION: the type: " + attr["type"] +" is not a valid type.\n" + - " The cause can be either a deprecated type or an error in the database."); + } else { + alert("CAUSION: the type: " + attr["type"] + " is not a valid type.\n" + + " The cause can be either a deprecated type or an error in the database."); } that.push(candidateSnippetInstance); PubSub.trigger("rapeSnippetsDecre"); @@ -122,15 +122,15 @@ define([ } - , renderAll: function(){ + , renderAll: function () { - return this.map(function(snippet){ - return new MyFormSnippetView({model: snippet}).render(true); + return this.map(function (snippet) { + return new MyFormSnippetView({ model: snippet }).render(true); }) } - , renderAllClean: function(){ - return this.map(function(snippet){ - return new MyFormSnippetView({model: snippet}).render(false); + , renderAllClean: function () { + return this.map(function (snippet) { + return new MyFormSnippetView({ model: snippet }).render(false); }); } }); From dd7f23745c7c71e9db8019b7659f1bc5a0c8d9f7 Mon Sep 17 00:00:00 2001 From: Jagdish Kunwar Date: Fri, 17 Feb 2023 10:46:28 -0500 Subject: [PATCH 2/3] format code --- .../schema_editor/assets/js/models/snippet.js | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/models/snippet.js b/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/models/snippet.js index ca40c7346..ae13558c2 100644 --- a/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/models/snippet.js +++ b/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/models/snippet.js @@ -1,15 +1,15 @@ define([ - 'jquery', 'underscore', 'backbone' -], function($, _, Backbone) { + 'jquery', 'underscore', 'backbone' +], function ($, _, Backbone) { return Backbone.Model.extend({ - initialize: function() { + initialize: function () { this.set("fresh", true); this.set("fromDb", false); } - , getValues: function(){ - return _.reduce(this.get("fields"), function(o, v, k){ + , getValues: function () { + return _.reduce(this.get("fields"), function (o, v, k) { if (v["type"] == "select") { - o[k] = _.find(v["value"], function(o){return o.selected})["value"]; + o[k] = _.find(v["value"], function (o) { return o.selected })["value"]; } else { o[k] = v["value"]; } @@ -17,23 +17,23 @@ define([ }, {}); } - , idFriendlyTitle: function(){ - return this.get("title").replace(/\W/g,'').toLowerCase(); + , idFriendlyTitle: function () { + return this.get("title").replace(/\W/g, '').toLowerCase(); } - , setField: function(name, value) { + , setField: function (name, value) { var fields = this.get("fields") fields[name]["value"] = value; this.set("fields", fields); } - , setFieldFromJson: function(name, value){ + , setFieldFromJson: function (name, value) { var fields = this.get("fields") - if(typeof fields[name] === "undefined") { + if (typeof fields[name] === "undefined") { console.log("CAUTION: one of the field is missing in ", name) return; } var type = fields[name]["type"] - switch(type) { + switch (type) { case "string": fields[name]["value"] = value this.set("fields", fields); @@ -43,11 +43,11 @@ define([ this.set("fields", fields); break; case "input": - if(fields[name]["hide"] !== "undefined" && fields[name]["hide"]) { + if (fields[name]["hide"] !== "undefined" && fields[name]["hide"]) { } else { - fields[name]["value"] = value - this.set("fields", fields); + fields[name]["value"] = value + this.set("fields", fields); } break; case "textarea": @@ -55,21 +55,23 @@ define([ this.set("fields", fields); break; case "textarea-split": - var checkboxvalarr = _.map(value, function(t){return $.trim(t["label"])}) + var checkboxvalarr = _.map(value, function (t) { return $.trim(t["label"]) }) fields[name]["value"] = checkboxvalarr this.set("fields", fields); break; case "select": - var valmatch = _.find(fields[name]["value"], function(v){ + var valmatch = _.find(fields[name]["value"], function (v) { return value.startsWith(v["value"]) }); - var valarr = _.map(fields[name]["value"], function(v){ - return {value: v["value"], label: v["label"], selected: value.startsWith(v["value"]) - ,needExtra : v["needExtra"] } + var valarr = _.map(fields[name]["value"], function (v) { + return { + value: v["value"], label: v["label"], selected: value.startsWith(v["value"]) + , needExtra: v["needExtra"] + } }); - if(typeof valmatch["needExtra"] !=="undefined" && valmatch["needExtra"]) { - fields["customField"]["value"] = value.substring(value.indexOf("(")+2, value.lastIndexOf(")")-1) + if (typeof valmatch["needExtra"] !== "undefined" && valmatch["needExtra"]) { + fields["customField"]["value"] = value.substring(value.indexOf("(") + 2, value.lastIndexOf(")") - 1) } fields[name]["value"] = valarr; this.set("fields", fields); @@ -78,12 +80,12 @@ define([ } - , mergeField: function(snippet){ - var fields = this.get("fields") - var thatFields = snippet.get("fields") - this.set("fields", _.extend(fields, thatFields)) + , mergeField: function (snippet) { + var fields = this.get("fields") + var thatFields = snippet.get("fields") + this.set("fields", _.extend(fields, thatFields)) - } + } }); }); From 1af8c6bb25211d71de729c18bf354a926416d67e Mon Sep 17 00:00:00 2001 From: Jagdish Kunwar Date: Fri, 17 Feb 2023 12:36:07 -0500 Subject: [PATCH 3/3] load existing schemas with tag attributes with schema builder tool --- .../assets/js/data/n2attributes.json | 20 +++++++++++++++++++ .../assets/js/data/n2attributes.yaml | 17 +++++++++++++++- .../schema_editor/assets/js/main-built.js | 8 ++++---- .../schema_editor/assets/js/models/snippet.js | 4 ++++ 4 files changed, 44 insertions(+), 5 deletions(-) diff --git a/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/data/n2attributes.json b/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/data/n2attributes.json index 977efd1d4..025028c2b 100644 --- a/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/data/n2attributes.json +++ b/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/data/n2attributes.json @@ -461,5 +461,25 @@ "value": "Label" } } + }, + { + "title": "n2 attribute tag", + "fields": { + "type": { + "label": "type", + "type": "string", + "value": "tag" + }, + "n2id": { + "label": "Id", + "type": "input", + "value": null + }, + "label": { + "label": "label", + "type": "input", + "value": "Label" + } + } } ] \ No newline at end of file diff --git a/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/data/n2attributes.yaml b/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/data/n2attributes.yaml index 37608a5a9..3042b4104 100644 --- a/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/data/n2attributes.yaml +++ b/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/data/n2attributes.yaml @@ -341,7 +341,22 @@ n2id: label : Id type : input - value : + value : + label: + label : label + type : input + value : Label +- + title: n2 attribute tag + fields: + type: + label : type + type : string + value : tag + n2id: + label : Id + type : input + value : label: label : label type : input diff --git a/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/main-built.js b/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/main-built.js index 85d053b1e..46c16da0d 100644 --- a/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/main-built.js +++ b/nunaliit2-couch-application/src/main/atlas_couchapp/_attachments/tools/schema_editor/assets/js/main-built.js @@ -31,7 +31,7 @@ !function(){var e,t,n;!function(i){function r(e,t){return w.call(e,t)}function o(e,t){var n,i,r,o,a,s,l,u,c,p,d,f,h=t&&t.split("/"),m=b.map,g=m&&m["*"]||{};if(e){for(e=e.split("/"),a=e.length-1,b.nodeIdCompat&&C.test(e[a])&&(e[a]=e[a].replace(C,"")),"."===e[0].charAt(0)&&h&&(f=h.slice(0,h.length-1),e=f.concat(e)),c=0;c0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}if((h||g)&&m){for(n=e.split("/"),c=n.length;c>0;c-=1){if(i=n.slice(0,c).join("/"),h)for(p=h.length;p>0;p-=1)if((r=m[h.slice(0,p).join("/")])&&(r=r[i])){o=r,s=c;break}if(o)break;!l&&g&&g[i]&&(l=g[i],u=c)}!o&&l&&(o=l,s=u),o&&(n.splice(0,s,o),e=n.join("/"))}return e}function a(e,t){return function(){var n=k.call(arguments,0);return"string"!=typeof n[0]&&1===n.length&&n.push(null),h.apply(i,n.concat([e,t]))}}function s(e){return function(t){return o(t,e)}}function l(e){return function(t){v[e]=t}}function u(e){if(r(y,e)){var t=y[e];delete y[e],x[e]=!0,f.apply(i,t)}if(!r(v,e)&&!r(x,e))throw new Error("No "+e);return v[e]}function c(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function p(e){return e?c(e):[]}function d(e){return function(){return b&&b.config&&b.config[e]||{}}}var f,h,m,g,v={},y={},b={},x={},w=Object.prototype.hasOwnProperty,k=[].slice,C=/\.js$/;m=function(e,t){var n,i=c(e),r=i[0],a=t[1];return e=i[1],r&&(r=o(r,a),n=u(r)),r?e=n&&n.normalize?n.normalize(e,s(a)):o(e,a):(e=o(e,a),i=c(e),r=i[0],e=i[1],r&&(n=u(r))),{f:r?r+"!"+e:e,n:e,pr:r,p:n}},g={require:function(e){return a(e)},exports:function(e){var t=v[e];return void 0!==t?t:v[e]={}},module:function(e){return{id:e,uri:"",exports:v[e],config:d(e)}}},f=function(e,t,n,o){var s,c,d,f,h,b,w,k=[],C=typeof n;if(o=o||e,b=p(o),"undefined"===C||"function"===C){for(t=!t.length&&n.length?["require","exports","module"]:t,h=0;h0&&t-1 in e)))}function r(e){var t=ke[e]={};return le.each(e.match(ce)||[],function(e,n){t[n]=!0}),t}function o(e,n,i,r){if(le.acceptData(e)){var o,a,s=le.expando,l="string"==typeof n,u=e.nodeType,c=u?le.cache:e,p=u?e[s]:e[s]&&s;if(p&&c[p]&&(r||c[p].data)||!l||i!==t)return p||(u?e[s]=p=Z.pop()||le.guid++:p=s),c[p]||(c[p]={},u||(c[p].toJSON=le.noop)),("object"==typeof n||"function"==typeof n)&&(r?c[p]=le.extend(c[p],n):c[p].data=le.extend(c[p].data,n)),o=c[p],r||(o.data||(o.data={}),o=o.data),i!==t&&(o[le.camelCase(n)]=i),l?null==(a=o[n])&&(a=o[le.camelCase(n)]):a=o,a}}function a(e,t,n){if(le.acceptData(e)){var i,r,o,a=e.nodeType,s=a?le.cache:e,u=a?e[le.expando]:le.expando;if(s[u]){if(t&&(i=n?s[u]:s[u].data)){le.isArray(t)?t=t.concat(le.map(t,le.camelCase)):t in i?t=[t]:(t=le.camelCase(t),t=t in i?[t]:t.split(" "));for(r=0,o=t.length;o>r;r++)delete i[t[r]];if(!(n?l:le.isEmptyObject)(i))return}(n||(delete s[u].data,l(s[u])))&&(a?le.cleanData([e],!0):le.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}function s(e,n,i){if(i===t&&1===e.nodeType){var r="data-"+n.replace(Te,"-$1").toLowerCase();if("string"==typeof(i=e.getAttribute(r))){try{i="true"===i||"false"!==i&&("null"===i?null:+i+""===i?+i:Ce.test(i)?le.parseJSON(i):i)}catch(e){}le.data(e,n,i)}else i=t}return i}function l(e){var t;for(t in e)if(("data"!==t||!le.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function u(){return!0}function c(){return!1}function p(e,t){do{e=e[t]}while(e&&1!==e.nodeType);return e}function d(e,t,n){if(t=t||0,le.isFunction(t))return le.grep(e,function(e,i){return!!t.call(e,i,e)===n});if(t.nodeType)return le.grep(e,function(e){return e===t===n});if("string"==typeof t){var i=le.grep(e,function(e){return 1===e.nodeType});if(Be.test(t))return le.filter(t,i,!n);t=le.filter(t,i)}return le.grep(e,function(e){return le.inArray(e,t)>=0===n})}function f(e){var t=Xe.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function h(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function m(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function g(e){var t=it.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function v(e,t){for(var n,i=0;null!=(n=e[i]);i++)le._data(n,"globalEval",!t||le._data(t[i],"globalEval"))}function y(e,t){if(1===t.nodeType&&le.hasData(e)){var n,i,r,o=le._data(e),a=le._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(i=0,r=s[n].length;r>i;i++)le.event.add(t,n,s[n][i])}a.data&&(a.data=le.extend({},a.data))}}function b(e,t){var n,i,r;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!le.support.noCloneEvent&&t[le.expando]){i=le._data(t);for(r in i.events)le.removeEvent(t,r,i.handle);t.removeAttribute(le.expando)}"script"===n&&t.text!==e.text?(m(t).text=e.text,g(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),le.support.html5Clone&&e.innerHTML&&!le.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&et.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function x(e,n){var i,r,o=0,a=e.getElementsByTagName!==t?e.getElementsByTagName(n||"*"):e.querySelectorAll!==t?e.querySelectorAll(n||"*"):t;if(!a)for(a=[],i=e.childNodes||e;null!=(r=i[o]);o++)!n||le.nodeName(r,n)?a.push(r):le.merge(a,x(r,n));return n===t||n&&le.nodeName(e,n)?le.merge([e],a):a}function w(e){et.test(e.type)&&(e.defaultChecked=e.checked)}function k(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),i=t,r=Ct.length;r--;)if((t=Ct[r]+n)in e)return t;return i}function C(e,t){return e=t||e,"none"===le.css(e,"display")||!le.contains(e.ownerDocument,e)}function T(e,t){for(var n,i=[],r=0,o=e.length;o>r;r++)n=e[r],n.style&&(i[r]=le._data(n,"olddisplay"),t?(i[r]||"none"!==n.style.display||(n.style.display=""),""===n.style.display&&C(n)&&(i[r]=le._data(n,"olddisplay",j(n.nodeName)))):i[r]||C(n)||le._data(n,"olddisplay",le.css(n,"display")));for(r=0;o>r;r++)n=e[r],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?i[r]||"":"none"));return e}function E(e,t,n){var i=gt.exec(t);return i?Math.max(0,i[1]-(n||0))+(i[2]||"px"):t}function S(e,t,n,i,r){for(var o=n===(i?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=le.css(e,n+kt[o],!0,r)),i?("content"===n&&(a-=le.css(e,"padding"+kt[o],!0,r)),"margin"!==n&&(a-=le.css(e,"border"+kt[o]+"Width",!0,r))):(a+=le.css(e,"padding"+kt[o],!0,r),"padding"!==n&&(a+=le.css(e,"border"+kt[o]+"Width",!0,r)));return a}function N(e,t,n){var i=!0,r="width"===t?e.offsetWidth:e.offsetHeight,o=ut(e),a=le.support.boxSizing&&"border-box"===le.css(e,"boxSizing",!1,o);if(0>=r||null==r){if(r=lt(e,t,o),(0>r||null==r)&&(r=e.style[t]),vt.test(r))return r;i=a&&(le.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+S(e,t,n||(a?"border":"content"),i,o)+"px"}function j(e){var t=V,n=bt[e];return n||(n=$(e,t),"none"!==n&&n||(ct=(ct||le("