diff --git a/Gruntfile.js b/Gruntfile.js index 854bc5e..3f755d8 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -245,6 +245,9 @@ module.exports = function (grunt) { commit: { cmd: './commit.sh', args: ['<%= grunt.option("msg") %>'] + }, + upload: { + cmd: './upload.sh' } }, remapIstanbul: { @@ -345,6 +348,11 @@ module.exports = function (grunt) { 'run:deploy' ]); + grunt.registerTask('upload', [ + 'dist', + 'run:upload' + ]); + /** * The index.html template includes the stylesheet and javascript sources * based on dynamic names calculated in this Gruntfile. This task assembles diff --git a/README.md b/README.md index 99ee9a4..f2d058f 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Checkout [JsonForms](http://github.eclipsesource.com/jsonforms) for further info [![Build Status](https://travis-ci.org/eclipsesource/JsonFormsEditor.svg?branch=master)](https://travis-ci.org/eclipsesource/JsonFormsEditor)[![Coverage Status](https://coveralls.io/repos/github/pancho111203/JsonFormsEditor/badge.svg?branch=master)](https://coveralls.io/github/pancho111203/JsonFormsEditor?branch=master) ## Demo -Watch JSONForms Editor in action on the [demo page](https://jsonformseditor.herokuapp.com/). +Watch JSONForms Editor in action on the [demo page](https://jsonforms-editor.herokuapp.com/). ## Working with TypeScript #### Definitely Typed diff --git a/app/assets/internal_lib/angular-ui-tree/angular-ui-tree.min.js b/app/assets/internal_lib/angular-ui-tree/angular-ui-tree.min.js index 3d4d0f4..bc0ee46 100644 --- a/app/assets/internal_lib/angular-ui-tree/angular-ui-tree.min.js +++ b/app/assets/internal_lib/angular-ui-tree/angular-ui-tree.min.js @@ -3,4 +3,4 @@ * (c) 2010-2016. https://github.com/angular-ui-tree/angular-ui-tree * License: MIT */ -!function(){"use strict";angular.module("ui.tree",[]).constant("treeConfig",{treeClass:"angular-ui-tree",emptyTreeClass:"angular-ui-tree-empty",hiddenClass:"angular-ui-tree-hidden",nodesClass:"angular-ui-tree-nodes",nodeClass:"angular-ui-tree-node",handleClass:"angular-ui-tree-handle",placeholderClass:"angular-ui-tree-placeholder",placeHoldersWrapperClass:"angular-ui-tree-placeholders-wrapper",dragClass:"angular-ui-tree-drag",dragWrapperClass:"angular-ui-tree-drag-wrapper",selectedClass:"angular-ui-tree-node-selected",dragThreshold:3,levelThreshold:30,defaultCollapsed:!1})}(),function(){"use strict";angular.module("ui.tree").controller("TreeHandleController",["$scope","$element",function(e,t){this.scope=e,e.$element=t,e.$nodeScope=null,e.$type="uiTreeHandle"}])}(),function(){"use strict";angular.module("ui.tree").controller("TreeNodeController",["$scope","$element",function(e,t){function n(e){var t,o,l,r=0,a=e.childNodes();if(!a||0===a.length)return 0;for(l=a.length-1;l>=0;l--)t=a[l],o=1+n(t),r=Math.max(r,o);return r}this.scope=e,e.$element=t,e.$modelValue=null,e.$parentNodeScope=null,e.$childNodesScope=null,e.$parentNodesScope=null,e.$treeScope=null,e.$handleScope=null,e.$type="uiTreeNode",e.$$allowNodeDrop=!1,e.collapsed=!1,e.selected=!1,e.$dragInfo=null,t.$scope=e,e.init=function(n){var o=n[0];e.$treeScope=n[1]?n[1].scope:null,e.$parentNodeScope=o.scope.$nodeScope,e.$modelValue=o.scope.$modelValue[e.$index],e.$parentNodesScope=o.scope,o.scope.initSubNode(e),t.on("$destroy",function(){o.scope.destroySubNode(e)})},e.index=function(){return e.$parentNodesScope.$modelValue.indexOf(e.$modelValue)},e.dragEnabled=function(){return!(e.$treeScope&&!e.$treeScope.dragEnabled)},e.isSibling=function(t){return e.$parentNodesScope==t.$parentNodesScope},e.isChild=function(t){var n=e.childNodes();return n&&n.indexOf(t)>-1},e.prev=function(){var t=e.index();return t>0?e.siblings()[t-1]:null},e.siblings=function(){return e.$parentNodesScope.childNodes()},e.childNodesCount=function(){return e.childNodes()?e.childNodes().length:0},e.hasChild=function(){return e.childNodesCount()>0},e.childNodes=function(){return e.$childNodesScope&&e.$childNodesScope.$modelValue?e.$childNodesScope.childNodes():null},e.accept=function(t,n){return e.$childNodesScope&&e.$childNodesScope.$modelValue&&e.$childNodesScope.accept(t,n)},e.remove=function(){return e.$parentNodesScope.removeNode(e)},e.toggle=function(){e.collapsed=!e.collapsed},e.collapse=function(){e.collapsed=!0},e.expand=function(){e.collapsed=!1},e.depth=function(){var t=e.$parentNodeScope;return t?t.depth()+1:1},e.maxSubDepth=function(){return e.$childNodesScope?n(e.$childNodesScope):0},e.toggleSelected=function(){e.selected?e.deselect():e.select()},e.deselect=function(){e.selected&&e.$treeScope.$callbacks.deselect(e)&&(e.selected=!1,e.$treeScope.selecteds.splice(e.$treeScope.selecteds.indexOf(e.$element),1))},e.deselectTransaction=function(){e.selected&&e.$treeScope.$toDeselect.push(e)},e.select=function(){!e.selected&&e.$treeScope.$callbacks.select(e)&&(e.selected=!0,e.$treeScope.selecteds.push(e.$element))}}])}(),function(){"use strict";angular.module("ui.tree").controller("TreeNodesController",["$scope","$element",function(e,t){this.scope=e,e.$element=t,e.$modelValue=null,e.$nodeScope=null,e.$treeScope=null,e.$type="uiTreeNodes",e.$nodesMap={},e.nodropEnabled=!1,e.maxDepth=0,e.cloneEnabled=!1,e.initSubNode=function(t){return t.$modelValue?void(e.$nodesMap[t.$modelValue.$$hashKey]=t):null},e.destroySubNode=function(t){return t.$modelValue?void(e.$nodesMap[t.$modelValue.$$hashKey]=null):null},e.accept=function(t,n){return e.$treeScope.$callbacks.accept(t,e,n)},e.beforeDrag=function(t){return e.$treeScope.$callbacks.beforeDrag(t)},e.isParent=function(t){return t.$parentNodesScope==e},e.hasChild=function(){return e.$modelValue.length>0},e.safeApply=function(e){var t=this.$root.$$phase;"$apply"==t||"$digest"==t?e&&"function"==typeof e&&e():this.$apply(e)},e.removeNode=function(t){var n=e.$modelValue.indexOf(t.$modelValue);return n>-1?(e.safeApply(function(){e.$modelValue.splice(n,1)[0]}),e.$treeScope.$callbacks.removed(t)):null},e.insertNode=function(t,n){e.safeApply(function(){e.$modelValue.splice(t,0,n)})},e.childNodes=function(){var t,n=[];if(e.$modelValue)for(t=0;t0?e.depth()+t.maxSubDepth()+1>n:!1}}])}(),function(){"use strict";angular.module("ui.tree").controller("TreeController",["$scope","$element",function(e,t){this.scope=e,e.$element=t,e.$nodesScope=null,e.$type="uiTree",e.$emptyElm=null,e.$callbacks=null,e.dragEnabled=!0,e.emptyPlaceholderEnabled=!0,e.maxDepth=0,e.dragDelay=0,e.cloneEnabled=!1,e.nodropEnabled=!1,e.selecteds=[],e.$multiSelectKey=void 0,e.$multiSelect=!1,e.$toDeselect=[],e.isEmpty=function(){return e.$nodesScope&&e.$nodesScope.$modelValue&&0===e.$nodesScope.$modelValue.length},e.place=function(t){e.$nodesScope.$element.append(t),e.$emptyElm.remove()},this.resetEmptyElement=function(){e.$nodesScope.$modelValue&&0!==e.$nodesScope.$modelValue.length||!e.emptyPlaceholderEnabled?e.$emptyElm.remove():t.append(e.$emptyElm)},e.applyDeselectTransaction=function(){angular.forEach(e.$toDeselect,function(e){e.deselect()}),e.$toDeselect=[]},e.resetEmptyElement=this.resetEmptyElement}])}(),function(){"use strict";angular.module("ui.tree").directive("uiTree",["treeConfig","$window",function(e,t){return{restrict:"A",scope:!0,controller:"TreeController",link:function(n,o,l,r){var a,c,s,d={accept:null,beforeDrag:null},i={};angular.extend(i,e),i.treeClass&&o.addClass(i.treeClass),"table"===o.prop("tagName").toLowerCase()?(n.$emptyElm=angular.element(t.document.createElement("tr")),c=o.find("tr"),s=c.length>0?angular.element(c).children().length:1e6,a=angular.element(t.document.createElement("td")).attr("colspan",s),n.$emptyElm.append(a)):n.$emptyElm=angular.element(t.document.createElement("div")),i.emptyTreeClass&&n.$emptyElm.addClass(i.emptyTreeClass),n.$watch("$nodesScope.$modelValue.length",function(e){angular.isNumber(e)&&r.resetEmptyElement()},!0),n.$watch(l.dragEnabled,function(e){"boolean"==typeof e&&(n.dragEnabled=e)}),n.$watch(l.emptyPlaceholderEnabled,function(e){"boolean"==typeof e&&(n.emptyPlaceholderEnabled=e,r.resetEmptyElement())}),n.$watch(l.nodropEnabled,function(e){"boolean"==typeof e&&(n.nodropEnabled=e)}),n.$watch(l.cloneEnabled,function(e){"boolean"==typeof e&&(n.cloneEnabled=e)}),n.$watch(l.maxDepth,function(e){"number"==typeof e&&(n.maxDepth=e)}),n.$watch(l.dragDelay,function(e){"number"==typeof e&&(n.dragDelay=e)}),d.accept=function(e,t){return!(t.nodropEnabled||t.$treeScope.nodropEnabled||t.outOfDepth(e))},d.beforeDrag=function(){return!0},d.removed=function(){},d.dropped=function(){},d.dragStart=function(){},d.dragMove=function(){},d.dragStop=function(){},d.startSelect=function(){},d.select=function(){return!0},d.deselect=function(){return!0},d.endSelect=function(){},d.beforeDrop=function(){},n.$watch(l.uiTree,function(e){angular.forEach(e,function(e,t){d[t]&&"function"==typeof e&&(d[t]=e)}),n.$callbacks=d},!0),n.$watch(l.select,function(e){e=e?e:l.select,angular.isNumber(e)&&(n.$multiSelectKey=e)});var u=function(e){e.keyCode===n.$multiSelectKey&&(n.$multiSelect||n.$apply(function(){n.$multiSelect=!0,n.$callbacks.startSelect()}))},p=function(e){e.keyCode===n.$multiSelectKey&&n.$multiSelect&&n.$apply(function(){n.$multiSelect=!1,n.$callbacks.endSelect()})};angular.element(t.document).bind("keyup",p),angular.element(t.document).bind("keydown",u)}}}])}(),function(){"use strict";angular.module("ui.tree").directive("uiTreeHandle",["treeConfig",function(e){return{require:"^uiTreeNode",restrict:"A",scope:!0,controller:"TreeHandleController",link:function(t,n,o,l){var r={};angular.extend(r,e),r.handleClass&&n.addClass(r.handleClass),t!=l.scope&&(t.$nodeScope=l.scope,l.scope.$handleScope=t)}}}])}(),function(){"use strict";angular.module("ui.tree").directive("uiTreeNode",["treeConfig","UiTreeHelper","$window","$document","$timeout","$q","$rootElement","$filter",function(e,t,n,o,l,r,a,c){return{require:["^uiTreeNodes","^uiTree"],restrict:"A",controller:"TreeNodeController",link:function(s,d,i,u){var p,f,$,m,g,h,S,b,y,v,N,E,C,T,x,w,D,A,I,X,Y,V,H,k={},O="ontouchstart"in window,M=null,W=document.body,P=document.documentElement;if(angular.extend(k,e),k.nodeClass&&d.addClass(k.nodeClass),s.init(u),!s||!s.$treeScope)return void console.log("FATAL ERROR: scope of element or tree not defined");s.collapsed=!!t.getNodeAttribute(s,"collapsed")||e.defaultCollapsed,s.sourceOnly=s.nodropEnabled||s.$treeScope.nodropEnabled,s.$watch(i.collapsed,function(e){"boolean"==typeof e&&(s.collapsed=e)}),s.$watch("collapsed",function(e){t.setNodeAttribute(s,"collapsed",e),i.$set("collapsed",e)}),s.$on("angular-ui-tree:collapse-all",function(){s.collapsed=!0}),s.$on("angular-ui-tree:expand-all",function(){s.collapsed=!1}),s.selected=!!t.getNodeAttribute(s,"selected"),s.$watch(i[e.selectedClass],function(e){s.selected=angular.isDefined(e)}),s.$watch("selected",function(n){t.setNodeAttribute(s,"selected",n),i.$set(e.selectedClass,n)});var K=function(e){e.preventDefault(),e.stopPropagation(),L(s)||(q(),s.$apply(s.toggleSelected))},L=function(e,t){e=angular.isUndefined(e)?s:e,t=angular.isUndefined(t)?0:t;var n=!1;return null!==e&&(!n&&angular.isDefined(e.$parent)&&(n=L(e.$parent,t+1)),!n&&t>0&&(n=angular.isDefined(e.selected)?e.selected:!1)),n},q=function(){B(s),s.$treeScope.applyDeselectTransaction()},B=function(e){e=angular.isUndefined(e)?s:e,e.hasChild()&&angular.forEach(e.childNodes(),function(e){e&&(e.deselectTransaction(),B(e))})};y=function(l){if((O||2!==l.button&&3!==l.which)&&!(l.uiTreeDragging||l.originalEvent&&l.originalEvent.uiTreeDragging)){var r,i,u,y,v,N,E,C,T,x=angular.element(l.target);if(r=t.treeNodeHandlerContainerOfElement(x),r&&(x=angular.element(r)),i=d.clone(),C=t.elementIsTreeNode(x),T=t.elementIsTreeNodeHandle(x),(C||T)&&!(C&&t.elementContainsTreeNodeHandler(x)||(u=x.prop("tagName").toLowerCase(),"input"==u||"textarea"==u||"button"==u||"select"==u))){for(H=angular.element(l.target);H&&H[0]&&H[0]!==d;){if(t.nodrag(H))return;H=H.parent()}if(s.beforeDrag(s)){if(l.uiTreeDragging=!0,l.originalEvent&&(l.originalEvent.uiTreeDragging=!0),l.preventDefault(),v=t.eventObj(l),p=!0,y=d.prop("tagName"),"tr"===y.toLowerCase()?($=angular.element(n.document.createElement(y)),N=angular.element(n.document.createElement("td")).addClass(k.placeholderClass).attr("colspan",d[0].children.length),$.append(N)):$=angular.element(n.document.createElement(y)).addClass(k.placeholderClass),m=angular.element(n.document.createElement(y)),k.hiddenClass,f=t.positionStarted(v,d),g=angular.element(n.document.createElement(s.$parentNodesScope.$element.prop("tagName"))).addClass(s.$parentNodesScope.$element.attr("class")).addClass(k.dragClass),s.selected||k.hiddenClass&&(angular.forEach(s.$treeScope.selecteds,function(e){var t=e.$scope;t.deselectTransaction()}),s.$treeScope.applyDeselectTransaction(),s.$treeScope.selecteds=[]),angular.isDefined(s.$treeScope.selecteds)&&s.$treeScope.selecteds.length>1&&(s.$treeScope.selecteds=c("orderBy")(s.$treeScope.selecteds,function(e){return t.offset(angular.element(e)).top},!1)),angular.isDefined(s.$treeScope.selecteds)&&s.$treeScope.selecteds.length>0){$=angular.element(n.document.createElement("div")).addClass(e.placeHoldersWrapperClass),m=angular.element(n.document.createElement("div")),g=angular.element(n.document.createElement("div")).addClass(e.dragWrapperClass),f=t.positionStarted(v,s.$treeScope.selecteds[0]);var w=angular.element(s.$treeScope.selecteds[0]),D=angular.copy(t.offset(w));angular.forEach(s.$treeScope.selecteds,function(e){var l=angular.element(e),r=e.$scope;r.$dragInfo=t.dragInfo(r);var a,c=t.height(l),d=t.width(l),i=l.prop("tagName");if("tr"===i.toLowerCase()){a=angular.element(n.document.createElement(i));var u=angular.element(n.document.createElement("td")).addClass(k.placeholderClass);a.append(u)}else a=angular.element(n.document.createElement(i)).addClass(k.placeholderClass);a.css("height",c+"px"),$.append(a);var p=angular.element(n.document.createElement(i));k.hiddenClass&&p.addClass(k.hiddenClass),m.append(p);var f=angular.element(n.document.createElement(r.$parentNodesScope.$element.prop("tagName"))).addClass(r.$parentNodesScope.$element.attr("class"));f.css("width",d+"px");var h=l.clone();f.append(h),!r.$treeScope.cloneEnabled&&s.sourceOnly&&l.addClass(k.hiddenClass),g.append(f);var S=(s.$element[0].querySelector(".angular-ui-tree-handle")||s.$element[0]).currentStyle;S&&(document.body.setAttribute("ui-tree-cursor",o.find("body").css("cursor")||""),o.find("body").css({cursor:S.cursor+"!important"}))}),g.css("z-index",9999).addClass(k.dragClass),w.parent()[0].insertBefore($[0],w[0]),w.parent()[0].insertBefore(m[0],w[0]),o.find("body").append(g),g.css({left:D.left+"px",top:D.top+"px"}),h={placeholder:$,dragging:g},A(),s.sourceOnly&&$.css("display","none"),angular.forEach(s.$treeScope.selecteds,function(e){var t=e.$scope;t.$apply(function(){s.$callbacks.dragStart(t.$dragInfo.eventArgs(h,f))})})}else $.css("height",t.height(d)+"px"),g.css("width",t.width(d)+"px"),g.css("z-index",9999),s.$dragInfo=t.dragInfo(s),s.$treeScope.selecteds=[s.$element],E=(d[0].querySelector(".angular-ui-tree-handle")||d[0]).currentStyle,E&&(document.body.setAttribute("ui-tree-cursor",o.find("body").css("cursor")||""),o.find("body").css({cursor:E.cursor+"!important"})),s.sourceOnly&&$.css("display","none"),d.after($),d.after(m),g.append(s.$dragInfo.isClone()&&s.sourceOnly?i:d),a.append(g),g.css({left:v.pageX-f.offsetX+"px",top:v.pageY-f.offsetY+"px"}),h={placeholder:$,dragging:g},A(),angular.forEach(s.$treeScope.selecteds,function(e){s.$apply(function(){s.$treeScope.$callbacks.dragStart(e.$scope.$dragInfo.eventArgs(h,f))})});S=Math.max(W.scrollHeight,W.offsetHeight,P.clientHeight,P.scrollHeight,P.offsetHeight),b=Math.max(W.scrollWidth,W.offsetWidth,P.clientWidth,P.scrollWidth,P.offsetWidth)}}}},v=function(e){var o,l,r,a,c,d,i,u,m,y,v,N,E,C,T,x,w,D=t.eventObj(e);if(g){if(e.preventDefault(),n.getSelection?n.getSelection().removeAllRanges():n.document.selection&&n.document.selection.empty(),r=D.pageX-f.offsetX,a=D.pageY-f.offsetY,0>r&&(r=0),0>a&&(a=0),a+10>S&&(a=S-10),r+10>b&&(r=b-10),g.css({left:r+"px",top:a+"px"}),c=window.pageYOffset||n.document.documentElement.scrollTop,d=c+(window.innerHeight||n.document.clientHeight||n.document.clientHeight),dd&&(T=Math.min(S-d,10),window.scrollBy(0,T)),c>D.pageY&&window.scrollBy(0,-10),t.positionMoved(e,f,p),p)return void(p=!1);if(u=t.offset(g).left-t.offset($).left>=k.threshold,m=D.pageX-(n.pageXOffset||n.document.body.scrollLeft||n.document.documentElement.scrollLeft)-(n.document.documentElement.clientLeft||0),y=D.pageY-(n.pageYOffset||n.document.body.scrollTop||n.document.documentElement.scrollTop)-(n.document.documentElement.clientTop||0),angular.isFunction(g.hide)?g.hide():(v=g[0].style.display,g[0].style.display="none"),n.document.elementFromPoint(m,y),E=angular.element(n.document.elementFromPoint(m,y)),V=t.treeNodeHandlerContainerOfElement(E),V&&(E=angular.element(V)),angular.isFunction(g.show)?g.show():g[0].style.display=v,Y=!(t.elementIsTreeNodeHandle(E)||t.elementIsTreeNode(E)||t.elementIsTreeNodes(E)||t.elementIsTree(E)||t.elementIsPlaceholder(E)||t.elementIsPlaceholderWrapper(E)),Y&&($.remove(),M&&(M.resetEmptyElement(),M=null)),f.dirAx&&f.distAxX>=k.levelThreshold&&(f.distAxX=0,f.distX>0&&(o=s.$treeScope.selecteds[0].$scope.$dragInfo.prev(),o&&!o.collapsed&&o.accept(s,o.childNodesCount())&&(o.$childNodesScope.$element.append($),angular.forEach(s.$treeScope.selecteds,function(e,t){e.$scope.$dragInfo.moveTo(o.$childNodesScope,o.childNodes(),o.childNodesCount()+t)}))),f.distX<0&&(l=s.$treeScope.selecteds[0].$scope.$dragInfo.next(),l||(i=s.$treeScope.selecteds[0].$scope.$dragInfo.parentNode(),i&&i.$parentNodesScope.accept(s,i.index()+1)&&(i.$element.after($),angular.forEach(s.$treeScope.selecteds,function(e,t){e.$scope.$dragInfo.moveTo(i.$parentNodeScope,i.siblings(),i.index()+1+t)}))))),!f.dirAx){if(t.elementIsTree(E)?N=E.controller("uiTree").scope:t.elementIsTreeNodeHandle(E)?N=E.controller("uiTreeHandle").scope:t.elementIsTreeNode(E)?N=E.controller("uiTreeNode").scope:t.elementIsTreeNodes(E)?N=E.controller("uiTreeNodes").scope:t.elementIsPlaceholder(E)?N=E.controller("uiTreeNodes").scope:t.elementIsPlaceholderWrapper(E)?N=E.controller("uiTreeNodes").scope:E.controller("uiTreeNode")&&(N=E.controller("uiTreeNode").scope),C=!1,!N)return;if(!N.$treeScope||N.$parent.nodropEnabled||N.$treeScope.nodropEnabled||$.css("display",""),"uiTree"==N.$type&&N.dragEnabled&&(C=N.isEmpty()),"uiTreeHandle"==N.$type&&(N=N.$nodeScope),"uiTreeNode"!=N.$type&&!C)return;M&&$.parent()[0]!=M.$element[0]&&(M.resetEmptyElement(),M=null),C?(M=N,N.$nodesScope.accept(s,0)&&(N.place($),angular.forEach(s.$treeScope.selecteds,function(e,t){e.$scope.$dragInfo.moveTo(N.$nodesScope,N.$nodesScope.childNodes(),t)}))):N.dragEnabled()&&(E=N.$element,x=t.offset(E),w=N.horizontal?D.pageX-1&&(this.siblings.splice(o,1),this.source.index()0?this.siblings[this.index-1]:null},next:function(){return this.index0&&(o=e.originalEvent.touches[0].pageX,l=e.originalEvent.touches[0].pageY),n.offsetX=o-this.offset(t).left,n.offsetY=l-this.offset(t).top,n.startX=n.lastX=o,n.startY=n.lastY=l,n.nowX=n.nowY=n.distX=n.distY=n.dirAx=0,n.dirX=n.dirY=n.lastDirX=n.lastDirY=n.distAxX=n.distAxY=0,n},positionMoved:function(e,t,n){var o,l=e.pageX,r=e.pageY;return e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches.length>0&&(l=e.originalEvent.touches[0].pageX,r=e.originalEvent.touches[0].pageY),t.lastX=t.nowX,t.lastY=t.nowY,t.nowX=l,t.nowY=r,t.distX=t.nowX-t.lastX,t.distY=t.nowY-t.lastY,t.lastDirX=t.dirX,t.lastDirY=t.dirY,t.dirX=0===t.distX?0:t.distX>0?1:-1,t.dirY=0===t.distY?0:t.distY>0?1:-1,o=Math.abs(t.distX)>Math.abs(t.distY)?1:0,n?(t.dirAx=o,void(t.moving=!0)):(t.dirAx!==o?(t.distAxX=0,t.distAxY=0):(t.distAxX+=Math.abs(t.distX),0!==t.dirX&&t.dirX!==t.lastDirX&&(t.distAxX=0),t.distAxY+=Math.abs(t.distY),0!==t.dirY&&t.dirY!==t.lastDirY&&(t.distAxY=0)),void(t.dirAx=o))},elementIsTreeNode:function(e){return"undefined"!=typeof e.attr("ui-tree-node")},elementIsTreeNodeHandle:function(e){return"undefined"!=typeof e.attr("ui-tree-handle")},elementIsTree:function(e){return"undefined"!=typeof e.attr("ui-tree")},elementIsTreeNodes:function(e){return"undefined"!=typeof e.attr("ui-tree-nodes")},elementIsPlaceholder:function(e){return e.hasClass(o.placeholderClass)},elementIsPlaceholderWrapper:function(e){return e.hasClass(o.placeHoldersWrapperClass)},elementContainsTreeNodeHandler:function(e){return e[0].querySelectorAll("[ui-tree-handle]").length>=1},treeNodeHandlerContainerOfElement:function(t){return e("ui-tree-handle",t[0])}}}])}(); \ No newline at end of file +!function(){"use strict";angular.module("ui.tree",[]).constant("treeConfig",{treeClass:"angular-ui-tree",emptyTreeClass:"angular-ui-tree-empty",hiddenClass:"angular-ui-tree-hidden",nodesClass:"angular-ui-tree-nodes",nodeClass:"angular-ui-tree-node",handleClass:"angular-ui-tree-handle",placeholderClass:"angular-ui-tree-placeholder",placeHoldersWrapperClass:"angular-ui-tree-placeholders-wrapper",dragClass:"angular-ui-tree-drag",dragWrapperClass:"angular-ui-tree-drag-wrapper",selectedClass:"angular-ui-tree-node-selected",dragThreshold:3,levelThreshold:30,defaultCollapsed:!1})}(),function(){"use strict";angular.module("ui.tree").controller("TreeHandleController",["$scope","$element",function(e,t){this.scope=e,e.$element=t,e.$nodeScope=null,e.$type="uiTreeHandle"}])}(),function(){"use strict";angular.module("ui.tree").controller("TreeNodeController",["$scope","$element",function(e,t){function n(e){var t,o,l,r=0,a=e.childNodes();if(!a||0===a.length)return 0;for(l=a.length-1;l>=0;l--)t=a[l],o=1+n(t),r=Math.max(r,o);return r}this.scope=e,e.$element=t,e.$modelValue=null,e.$parentNodeScope=null,e.$childNodesScope=null,e.$parentNodesScope=null,e.$treeScope=null,e.$handleScope=null,e.$type="uiTreeNode",e.$$allowNodeDrop=!1,e.collapsed=!1,e.selected=!1,e.$dragInfo=null,t.$scope=e,e.init=function(n){var o=n[0];e.$treeScope=n[1]?n[1].scope:null,e.$parentNodeScope=o.scope.$nodeScope,e.$modelValue=o.scope.$modelValue[e.$index],e.$parentNodesScope=o.scope,o.scope.initSubNode(e),t.on("$destroy",function(){o.scope.destroySubNode(e)})},e.index=function(){return e.$parentNodesScope.$modelValue.indexOf(e.$modelValue)},e.dragEnabled=function(){return!(e.$treeScope&&!e.$treeScope.dragEnabled)},e.isSibling=function(t){return e.$parentNodesScope==t.$parentNodesScope},e.isChild=function(t){var n=e.childNodes();return n&&n.indexOf(t)>-1},e.prev=function(){var t=e.index();return t>0?e.siblings()[t-1]:null},e.siblings=function(){return e.$parentNodesScope.childNodes()},e.childNodesCount=function(){return e.childNodes()?e.childNodes().length:0},e.hasChild=function(){return e.childNodesCount()>0},e.childNodes=function(){return e.$childNodesScope&&e.$childNodesScope.$modelValue?e.$childNodesScope.childNodes():null},e.accept=function(t,n){return e.$childNodesScope&&e.$childNodesScope.$modelValue&&e.$childNodesScope.accept(t,n)},e.remove=function(){return e.deselect(),e.$parentNodesScope.removeNode(e)},e.toggle=function(){e.collapsed=!e.collapsed},e.collapse=function(){e.collapsed=!0},e.expand=function(){e.collapsed=!1},e.depth=function(){var t=e.$parentNodeScope;return t?t.depth()+1:1},e.maxSubDepth=function(){return e.$childNodesScope?n(e.$childNodesScope):0},e.toggleSelected=function(){e.selected?e.deselect():e.select()},e.deselect=function(){e.selected&&e.$treeScope.$callbacks.deselect(e)&&(e.selected=!1,e.$treeScope.selecteds.splice(e.$treeScope.selecteds.indexOf(e.$element),1))},e.deselectTransaction=function(){e.selected&&e.$treeScope.$toDeselect.push(e)},e.select=function(){!e.selected&&e.$treeScope.$callbacks.select(e)&&(e.selected=!0,e.$treeScope.selecteds.push(e.$element))}}])}(),function(){"use strict";angular.module("ui.tree").controller("TreeNodesController",["$scope","$element",function(e,t){this.scope=e,e.$element=t,e.$modelValue=null,e.$nodeScope=null,e.$treeScope=null,e.$type="uiTreeNodes",e.$nodesMap={},e.nodropEnabled=!1,e.maxDepth=0,e.cloneEnabled=!1,e.initSubNode=function(t){return t.$modelValue?void(e.$nodesMap[t.$modelValue.$$hashKey]=t):null},e.destroySubNode=function(t){return t.$modelValue?void(e.$nodesMap[t.$modelValue.$$hashKey]=null):null},e.accept=function(t,n){return e.$treeScope.$callbacks.accept(t,e,n)},e.beforeDrag=function(t){return e.$treeScope.$callbacks.beforeDrag(t)},e.isParent=function(t){return t.$parentNodesScope==e},e.hasChild=function(){return e.$modelValue.length>0},e.safeApply=function(e){var t=this.$root.$$phase;"$apply"==t||"$digest"==t?e&&"function"==typeof e&&e():this.$apply(e)},e.removeNode=function(t){var n=e.$modelValue.indexOf(t.$modelValue);return n>-1?(e.safeApply(function(){e.$modelValue.splice(n,1)[0]}),e.$treeScope.$callbacks.removed(t)):null},e.insertNode=function(t,n){e.safeApply(function(){e.$modelValue.splice(t,0,n)})},e.childNodes=function(){var t,n=[];if(e.$modelValue)for(t=0;t0?e.depth()+t.maxSubDepth()+1>n:!1}}])}(),function(){"use strict";angular.module("ui.tree").controller("TreeController",["$scope","$element",function(e,t){this.scope=e,e.$element=t,e.$nodesScope=null,e.$type="uiTree",e.$emptyElm=null,e.$callbacks=null,e.dragEnabled=!0,e.emptyPlaceholderEnabled=!0,e.maxDepth=0,e.dragDelay=0,e.cloneEnabled=!1,e.nodropEnabled=!1,e.selecteds=[],e.$multiSelectKey=void 0,e.$multiSelect=!1,e.$toDeselect=[],e.isEmpty=function(){return e.$nodesScope&&e.$nodesScope.$modelValue&&0===e.$nodesScope.$modelValue.length},e.place=function(t){e.$nodesScope.$element.append(t),e.$emptyElm.remove()},this.resetEmptyElement=function(){e.$nodesScope.$modelValue&&0!==e.$nodesScope.$modelValue.length||!e.emptyPlaceholderEnabled?e.$emptyElm.remove():t.append(e.$emptyElm)},e.applyDeselectTransaction=function(){angular.forEach(e.$toDeselect,function(e){e.deselect()}),e.$toDeselect=[]},e.resetEmptyElement=this.resetEmptyElement}])}(),function(){"use strict";angular.module("ui.tree").directive("uiTree",["treeConfig","$window",function(e,t){return{restrict:"A",scope:!0,controller:"TreeController",link:function(n,o,l,r){var a,c,s,d={accept:null,beforeDrag:null},i={};angular.extend(i,e),i.treeClass&&o.addClass(i.treeClass),"table"===o.prop("tagName").toLowerCase()?(n.$emptyElm=angular.element(t.document.createElement("tr")),c=o.find("tr"),s=c.length>0?angular.element(c).children().length:1e6,a=angular.element(t.document.createElement("td")).attr("colspan",s),n.$emptyElm.append(a)):n.$emptyElm=angular.element(t.document.createElement("div")),i.emptyTreeClass&&n.$emptyElm.addClass(i.emptyTreeClass),n.$watch("$nodesScope.$modelValue.length",function(e){angular.isNumber(e)&&r.resetEmptyElement()},!0),n.$watch(l.dragEnabled,function(e){"boolean"==typeof e&&(n.dragEnabled=e)}),n.$watch(l.emptyPlaceholderEnabled,function(e){"boolean"==typeof e&&(n.emptyPlaceholderEnabled=e,r.resetEmptyElement())}),n.$watch(l.nodropEnabled,function(e){"boolean"==typeof e&&(n.nodropEnabled=e)}),n.$watch(l.cloneEnabled,function(e){"boolean"==typeof e&&(n.cloneEnabled=e)}),n.$watch(l.maxDepth,function(e){"number"==typeof e&&(n.maxDepth=e)}),n.$watch(l.dragDelay,function(e){"number"==typeof e&&(n.dragDelay=e)}),d.accept=function(e,t){return!(t.nodropEnabled||t.$treeScope.nodropEnabled||t.outOfDepth(e))},d.beforeDrag=function(){return!0},d.removed=function(){},d.dropped=function(){},d.dragStart=function(){},d.dragMove=function(){},d.dragStop=function(){},d.startSelect=function(){},d.select=function(){return!0},d.deselect=function(){return!0},d.endSelect=function(){},d.beforeDrop=function(){},n.$watch(l.uiTree,function(e){angular.forEach(e,function(e,t){d[t]&&"function"==typeof e&&(d[t]=e)}),n.$callbacks=d},!0),n.$watch(l.select,function(e){e=e?e:l.select,angular.isNumber(e)&&(n.$multiSelectKey=e)});var u=function(e){e.keyCode===n.$multiSelectKey&&(n.$multiSelect||n.$apply(function(){n.$multiSelect=!0,n.$callbacks.startSelect()}))},p=function(e){e.keyCode===n.$multiSelectKey&&n.$multiSelect&&n.$apply(function(){n.$multiSelect=!1,n.$callbacks.endSelect()})};angular.element(t.document).bind("keyup",p),angular.element(t.document).bind("keydown",u)}}}])}(),function(){"use strict";angular.module("ui.tree").directive("uiTreeHandle",["treeConfig",function(e){return{require:"^uiTreeNode",restrict:"A",scope:!0,controller:"TreeHandleController",link:function(t,n,o,l){var r={};angular.extend(r,e),r.handleClass&&n.addClass(r.handleClass),t!=l.scope&&(t.$nodeScope=l.scope,l.scope.$handleScope=t)}}}])}(),function(){"use strict";angular.module("ui.tree").directive("uiTreeNode",["treeConfig","UiTreeHelper","$window","$document","$timeout","$q","$rootElement","$filter",function(e,t,n,o,l,r,a,c){return{require:["^uiTreeNodes","^uiTree"],restrict:"A",controller:"TreeNodeController",link:function(s,d,i,u){var p,f,$,m,g,h,S,b,y,v,N,E,C,T,x,w,D,A,I,X,Y,V,H,k={},O="ontouchstart"in window,M=null,W=document.body,P=document.documentElement;if(angular.extend(k,e),k.nodeClass&&d.addClass(k.nodeClass),s.init(u),!s||!s.$treeScope)return void console.log("FATAL ERROR: scope of element or tree not defined");s.collapsed=!!t.getNodeAttribute(s,"collapsed")||e.defaultCollapsed,s.sourceOnly=s.nodropEnabled||s.$treeScope.nodropEnabled,s.$watch(i.collapsed,function(e){"boolean"==typeof e&&(s.collapsed=e)}),s.$watch("collapsed",function(e){t.setNodeAttribute(s,"collapsed",e),i.$set("collapsed",e)}),s.$on("angular-ui-tree:collapse-all",function(){s.collapsed=!0}),s.$on("angular-ui-tree:expand-all",function(){s.collapsed=!1}),s.selected=!!t.getNodeAttribute(s,"selected"),s.$watch(i[e.selectedClass],function(e){s.selected=angular.isDefined(e)}),s.$watch("selected",function(n){t.setNodeAttribute(s,"selected",n),i.$set(e.selectedClass,n)});var K=function(e){e.preventDefault(),e.stopPropagation(),L(s)||(q(),s.$apply(s.toggleSelected))},L=function(e,t){e=angular.isUndefined(e)?s:e,t=angular.isUndefined(t)?0:t;var n=!1;return null!==e&&(!n&&angular.isDefined(e.$parent)&&(n=L(e.$parent,t+1)),!n&&t>0&&(n=angular.isDefined(e.selected)?e.selected:!1)),n},q=function(){B(s),s.$treeScope.applyDeselectTransaction()},B=function(e){e=angular.isUndefined(e)?s:e,e.hasChild()&&angular.forEach(e.childNodes(),function(e){e&&(e.deselectTransaction(),B(e))})};y=function(l){if((O||2!==l.button&&3!==l.which)&&!(l.uiTreeDragging||l.originalEvent&&l.originalEvent.uiTreeDragging)){var r,i,u,y,v,N,E,C,T,x=angular.element(l.target);if(r=t.treeNodeHandlerContainerOfElement(x),r&&(x=angular.element(r)),i=d.clone(),C=t.elementIsTreeNode(x),T=t.elementIsTreeNodeHandle(x),(C||T)&&!(C&&t.elementContainsTreeNodeHandler(x)||(u=x.prop("tagName").toLowerCase(),"input"==u||"textarea"==u||"button"==u||"select"==u))){for(H=angular.element(l.target);H&&H[0]&&H[0]!==d;){if(t.nodrag(H))return;H=H.parent()}if(s.beforeDrag(s)){if(l.uiTreeDragging=!0,l.originalEvent&&(l.originalEvent.uiTreeDragging=!0),l.preventDefault(),v=t.eventObj(l),p=!0,y=d.prop("tagName"),"tr"===y.toLowerCase()?($=angular.element(n.document.createElement(y)),N=angular.element(n.document.createElement("td")).addClass(k.placeholderClass).attr("colspan",d[0].children.length),$.append(N)):$=angular.element(n.document.createElement(y)).addClass(k.placeholderClass),m=angular.element(n.document.createElement(y)),k.hiddenClass,f=t.positionStarted(v,d),g=angular.element(n.document.createElement(s.$parentNodesScope.$element.prop("tagName"))).addClass(s.$parentNodesScope.$element.attr("class")).addClass(k.dragClass),s.selected||k.hiddenClass&&(angular.forEach(s.$treeScope.selecteds,function(e){var t=e.$scope;t.deselectTransaction()}),s.$treeScope.applyDeselectTransaction(),s.$treeScope.selecteds=[]),angular.isDefined(s.$treeScope.selecteds)&&s.$treeScope.selecteds.length>1&&(s.$treeScope.selecteds=c("orderBy")(s.$treeScope.selecteds,function(e){return t.offset(angular.element(e)).top},!1)),angular.isDefined(s.$treeScope.selecteds)&&s.$treeScope.selecteds.length>0){$=angular.element(n.document.createElement("div")).addClass(e.placeHoldersWrapperClass),m=angular.element(n.document.createElement("div")),g=angular.element(n.document.createElement("div")).addClass(e.dragWrapperClass),f=t.positionStarted(v,s.$treeScope.selecteds[0]);var w=angular.element(s.$treeScope.selecteds[0]),D=angular.copy(t.offset(w));angular.forEach(s.$treeScope.selecteds,function(e){var l=angular.element(e),r=e.$scope;r.$dragInfo=t.dragInfo(r);var a,c=t.height(l),d=t.width(l),i=l.prop("tagName");if("tr"===i.toLowerCase()){a=angular.element(n.document.createElement(i));var u=angular.element(n.document.createElement("td")).addClass(k.placeholderClass);a.append(u)}else a=angular.element(n.document.createElement(i)).addClass(k.placeholderClass);a.css("height",c+"px"),$.append(a);var p=angular.element(n.document.createElement(i));k.hiddenClass&&p.addClass(k.hiddenClass),m.append(p);var f=angular.element(n.document.createElement(r.$parentNodesScope.$element.prop("tagName"))).addClass(r.$parentNodesScope.$element.attr("class"));f.css("width",d+"px");var h=l.clone();f.append(h),!r.$treeScope.cloneEnabled&&s.sourceOnly&&l.addClass(k.hiddenClass),g.append(f);var S=(s.$element[0].querySelector(".angular-ui-tree-handle")||s.$element[0]).currentStyle;S&&(document.body.setAttribute("ui-tree-cursor",o.find("body").css("cursor")||""),o.find("body").css({cursor:S.cursor+"!important"}))}),g.css("z-index",9999).addClass(k.dragClass),w.parent()[0].insertBefore($[0],w[0]),w.parent()[0].insertBefore(m[0],w[0]),o.find("body").append(g),g.css({left:D.left+"px",top:D.top+"px"}),h={placeholder:$,dragging:g},A(),s.sourceOnly&&$.css("display","none"),angular.forEach(s.$treeScope.selecteds,function(e){var t=e.$scope;t.$apply(function(){s.$callbacks.dragStart(t.$dragInfo.eventArgs(h,f))})})}else $.css("height",t.height(d)+"px"),g.css("width",t.width(d)+"px"),g.css("z-index",9999),s.$dragInfo=t.dragInfo(s),s.$treeScope.selecteds=[s.$element],E=(d[0].querySelector(".angular-ui-tree-handle")||d[0]).currentStyle,E&&(document.body.setAttribute("ui-tree-cursor",o.find("body").css("cursor")||""),o.find("body").css({cursor:E.cursor+"!important"})),s.sourceOnly&&$.css("display","none"),d.after($),d.after(m),g.append(s.$dragInfo.isClone()&&s.sourceOnly?i:d),a.append(g),g.css({left:v.pageX-f.offsetX+"px",top:v.pageY-f.offsetY+"px"}),h={placeholder:$,dragging:g},A(),angular.forEach(s.$treeScope.selecteds,function(e){s.$apply(function(){s.$treeScope.$callbacks.dragStart(e.$scope.$dragInfo.eventArgs(h,f))})});S=Math.max(W.scrollHeight,W.offsetHeight,P.clientHeight,P.scrollHeight,P.offsetHeight),b=Math.max(W.scrollWidth,W.offsetWidth,P.clientWidth,P.scrollWidth,P.offsetWidth)}}}},v=function(e){var o,l,r,a,c,d,i,u,m,y,v,N,E,C,T,x,w,D=t.eventObj(e);if(g){if(e.preventDefault(),n.getSelection?n.getSelection().removeAllRanges():n.document.selection&&n.document.selection.empty(),r=D.pageX-f.offsetX,a=D.pageY-f.offsetY,0>r&&(r=0),0>a&&(a=0),a+10>S&&(a=S-10),r+10>b&&(r=b-10),g.css({left:r+"px",top:a+"px"}),c=window.pageYOffset||n.document.documentElement.scrollTop,d=c+(window.innerHeight||n.document.clientHeight||n.document.clientHeight),dd&&(T=Math.min(S-d,10),window.scrollBy(0,T)),c>D.pageY&&window.scrollBy(0,-10),t.positionMoved(e,f,p),p)return void(p=!1);if(u=t.offset(g).left-t.offset($).left>=k.threshold,m=D.pageX-(n.pageXOffset||n.document.body.scrollLeft||n.document.documentElement.scrollLeft)-(n.document.documentElement.clientLeft||0),y=D.pageY-(n.pageYOffset||n.document.body.scrollTop||n.document.documentElement.scrollTop)-(n.document.documentElement.clientTop||0),angular.isFunction(g.hide)?g.hide():(v=g[0].style.display,g[0].style.display="none"),n.document.elementFromPoint(m,y),E=angular.element(n.document.elementFromPoint(m,y)),V=t.treeNodeHandlerContainerOfElement(E),V&&(E=angular.element(V)),angular.isFunction(g.show)?g.show():g[0].style.display=v,Y=!(t.elementIsTreeNodeHandle(E)||t.elementIsTreeNode(E)||t.elementIsTreeNodes(E)||t.elementIsTree(E)||t.elementIsPlaceholder(E)||t.elementIsPlaceholderWrapper(E)),Y&&($.remove(),M&&(M.resetEmptyElement(),M=null)),f.dirAx&&f.distAxX>=k.levelThreshold&&(f.distAxX=0,f.distX>0&&(o=s.$treeScope.selecteds[0].$scope.$dragInfo.prev(),o&&!o.collapsed&&o.accept(s,o.childNodesCount())&&(o.$childNodesScope.$element.append($),angular.forEach(s.$treeScope.selecteds,function(e,t){e.$scope.$dragInfo.moveTo(o.$childNodesScope,o.childNodes(),o.childNodesCount()+t)}))),f.distX<0&&(l=s.$treeScope.selecteds[0].$scope.$dragInfo.next(),l||(i=s.$treeScope.selecteds[0].$scope.$dragInfo.parentNode(),i&&i.$parentNodesScope.accept(s,i.index()+1)&&(i.$element.after($),angular.forEach(s.$treeScope.selecteds,function(e,t){e.$scope.$dragInfo.moveTo(i.$parentNodeScope,i.siblings(),i.index()+1+t)}))))),!f.dirAx){if(t.elementIsTree(E)?N=E.controller("uiTree").scope:t.elementIsTreeNodeHandle(E)?N=E.controller("uiTreeHandle").scope:t.elementIsTreeNode(E)?N=E.controller("uiTreeNode").scope:t.elementIsTreeNodes(E)?N=E.controller("uiTreeNodes").scope:t.elementIsPlaceholder(E)?N=E.controller("uiTreeNodes").scope:t.elementIsPlaceholderWrapper(E)?N=E.controller("uiTreeNodes").scope:E.controller("uiTreeNode")&&(N=E.controller("uiTreeNode").scope),C=!1,!N)return;if(!N.$treeScope||N.$parent.nodropEnabled||N.$treeScope.nodropEnabled||$.css("display",""),"uiTree"==N.$type&&N.dragEnabled&&(C=N.isEmpty()),"uiTreeHandle"==N.$type&&(N=N.$nodeScope),"uiTreeNode"!=N.$type&&!C)return;M&&$.parent()[0]!=M.$element[0]&&(M.resetEmptyElement(),M=null),C?(M=N,N.$nodesScope.accept(s,0)&&(N.place($),angular.forEach(s.$treeScope.selecteds,function(e,t){e.$scope.$dragInfo.moveTo(N.$nodesScope,N.$nodesScope.childNodes(),t)}))):N.dragEnabled()&&(E=N.$element,x=t.offset(E),w=N.horizontal?D.pageX-1&&(this.siblings.splice(o,1),this.source.index()0?this.siblings[this.index-1]:null},next:function(){return this.index0&&(o=e.originalEvent.touches[0].pageX,l=e.originalEvent.touches[0].pageY),n.offsetX=o-this.offset(t).left,n.offsetY=l-this.offset(t).top,n.startX=n.lastX=o,n.startY=n.lastY=l,n.nowX=n.nowY=n.distX=n.distY=n.dirAx=0,n.dirX=n.dirY=n.lastDirX=n.lastDirY=n.distAxX=n.distAxY=0,n},positionMoved:function(e,t,n){var o,l=e.pageX,r=e.pageY;return e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches.length>0&&(l=e.originalEvent.touches[0].pageX,r=e.originalEvent.touches[0].pageY),t.lastX=t.nowX,t.lastY=t.nowY,t.nowX=l,t.nowY=r,t.distX=t.nowX-t.lastX,t.distY=t.nowY-t.lastY,t.lastDirX=t.dirX,t.lastDirY=t.dirY,t.dirX=0===t.distX?0:t.distX>0?1:-1,t.dirY=0===t.distY?0:t.distY>0?1:-1,o=Math.abs(t.distX)>Math.abs(t.distY)?1:0,n?(t.dirAx=o,void(t.moving=!0)):(t.dirAx!==o?(t.distAxX=0,t.distAxY=0):(t.distAxX+=Math.abs(t.distX),0!==t.dirX&&t.dirX!==t.lastDirX&&(t.distAxX=0),t.distAxY+=Math.abs(t.distY),0!==t.dirY&&t.dirY!==t.lastDirY&&(t.distAxY=0)),void(t.dirAx=o))},elementIsTreeNode:function(e){return"undefined"!=typeof e.attr("ui-tree-node")},elementIsTreeNodeHandle:function(e){return"undefined"!=typeof e.attr("ui-tree-handle")},elementIsTree:function(e){return"undefined"!=typeof e.attr("ui-tree")},elementIsTreeNodes:function(e){return"undefined"!=typeof e.attr("ui-tree-nodes")},elementIsPlaceholder:function(e){return e.hasClass(o.placeholderClass)},elementIsPlaceholderWrapper:function(e){return e.hasClass(o.placeHoldersWrapperClass)},elementContainsTreeNodeHandler:function(e){return e[0].querySelectorAll("[ui-tree-handle]").length>=1},treeNodeHandlerContainerOfElement:function(t){return e("ui-tree-handle",t[0])}}}])}(); \ No newline at end of file diff --git a/app/src/components/toolbox/toolbox.controller.ts b/app/src/components/toolbox/toolbox.controller.ts index 1b0e82d..ed55d0e 100644 --- a/app/src/components/toolbox/toolbox.controller.ts +++ b/app/src/components/toolbox/toolbox.controller.ts @@ -96,8 +96,8 @@ module app.toolbox { } } - canBeRemoved(element: ControlToolboxElement): boolean{ - return this.toolboxService.canBeRemoved(element); + canBeRemoved(element: ControlToolboxElement, node:any): boolean{ + return !node.$nodeScope.selected && this.toolboxService.canBeRemoved(element); } isParentFolder(){ return this.toolboxService.currentPath.length == 0; diff --git a/app/src/components/toolbox/toolbox.html b/app/src/components/toolbox/toolbox.html index e35887e..d274219 100644 --- a/app/src/components/toolbox/toolbox.html +++ b/app/src/components/toolbox/toolbox.html @@ -24,7 +24,7 @@ {{element.getIcon()}} {{element.getLabel()}} - delete diff --git a/app/src/components/tree/tree.controller.ts b/app/src/components/tree/tree.controller.ts index 5d49e3c..1852f01 100644 --- a/app/src/components/tree/tree.controller.ts +++ b/app/src/components/tree/tree.controller.ts @@ -50,14 +50,12 @@ module app.tree { beforeDrag: (sourceNodeScope) => { var dragElement:TreeElement = sourceNodeScope.$modelValue; return !dragElement['root']; - }, - removed: (node) => { - var treeElement:TreeElement = node.$modelValue; - this.treeService.notifyObservers(new PreviewUpdateEvent(null, JSON.parse(this.treeService.exportUISchemaAsJSON()))); - this.decreasePlacedTimesOfChilds(treeElement); - treeService.modifiedTree(); } }; + + Profiler.getInstance().watch('detailLoader', function(timeTaken){ + console.log("Time to execute: " + timeTaken); + }); } /** @@ -65,6 +63,10 @@ module app.tree { * @param scope Scope Element from ui.tree. */ remove(scope):void { + var treeElement:TreeElement = scope.$nodeScope.$modelValue; + this.treeService.notifyObservers(new PreviewUpdateEvent(null, JSON.parse(this.treeService.exportUISchemaAsJSON()))); + this.decreasePlacedTimesOfChilds(treeElement); + this.treeService.modifiedTree(); this.undoService.snapshot(); scope.removeNode(scope); } @@ -74,7 +76,11 @@ module app.tree { * @param node */ showDetails(node:TreeElement):void { - this.detailService.setElement(node); + + Profiler.getInstance().startMeasure('detailLoader'); + this.detailService.setElement(node).then(function(){ + Profiler.getInstance().endMeasure('detailLoader'); + }); } /** diff --git a/app/src/shared/profiler.ts b/app/src/shared/profiler.ts new file mode 100644 index 0000000..24aab72 --- /dev/null +++ b/app/src/shared/profiler.ts @@ -0,0 +1,39 @@ +module app { + export class Profiler { + + watching:any = []; + + static profiler: Profiler; + + static getInstance():Profiler{ + if(!this.profiler){ + this.profiler = new Profiler(); + } + + return this.profiler; + } + + watch(ident:string, report:any){ + this.watching[ident] = { + report: report, + startTime: 0 + }; + + } + + startMeasure(ident:string){ + if(this.watching[ident]){ + this.watching[ident].startTime = performance.now(); + } + } + + endMeasure(ident:string){ + if(this.watching[ident]){ + var timeNow = performance.now(); + var timeTaken = timeNow - this.watching[ident].startTime; + + this.watching[ident].report(timeTaken); + } + } + } +} \ No newline at end of file diff --git a/bower.json b/bower.json index a5a4f78..95da298 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "jsonforms-editor", "description": "An editor for jsonforms", - "version": "0.0.10", + "version": "0.0.11", "homepage": "https://github.com/eclipsesource/JsonFormsEditor", "license": "MIT", "private": true, diff --git a/deploy.sh b/deploy.sh index 2b95448..7027c3c 100755 --- a/deploy.sh +++ b/deploy.sh @@ -12,6 +12,6 @@ git tag -a "v${rev}" -m "Created tag v${rev}" git push upstream "v${rev}" git remote remove heroku -heroku git:remote -a jsonformseditor +heroku git:remote -a jsonforms-editor heroku config:set NPM_CONFIG_PRODUCTION=false git push heroku master \ No newline at end of file diff --git a/package.json b/package.json index eb869f3..4dca362 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jsonforms-editor", "private": true, - "version": "0.0.10", + "version": "0.0.11", "description": "An editor for jsonforms", "repository": "https://github.com/eclipsesource/JsonFormsEditor", "license": "MIT", diff --git a/upload.sh b/upload.sh new file mode 100755 index 0000000..f84f73b --- /dev/null +++ b/upload.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +git remote remove heroku +heroku git:remote -a jsonforms-editor-staging +heroku config:set NPM_CONFIG_PRODUCTION=false +git push heroku master \ No newline at end of file