You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

luticate-utils.min.js 23KB

1
  1. !function(){angular.module("luticateUtils",[])}(),angular.module("luticateUtils").directive("luBasicTable",["dialogs","luticateDialogErrorHelper",function(a,b){return{restrict:"E",scope:{options:"&"},transclude:{"lu-basic-table-filter":"?lu-basic-table-filter"},templateUrl:"/luticate/lubasictable.html",link:function(a,c,d){a.items=[],a.pages=[],a.maxPage=1,a.tableOptions=a.options(),a.tableOptions.luBasicTableScope=a,null==a.tableOptions.tableName&&(a.tableOptions.tableName=a.$id),"string"==typeof a.tableOptions.luBusy&&(a.tableOptions.luBusy={group:a.tableOptions.luBusy}),null==a.tableOptions.luBusy&&(a.tableOptions.luBusy={group:"luBasicTableItemList_"+a.$id}),null==a.tableOptions.page&&(a.tableOptions.page=0),null==a.tableOptions.perPage&&(a.tableOptions.perPage=15),null==a.tableOptions.query&&(a.tableOptions.query=""),null==a.tableOptions.checkedItems&&(a.tableOptions.checkedItems=[]),null==a.tableOptions.canCheck&&(a.tableOptions.canCheck=function(){return!1}),null==a.tableOptions.canClick&&(a.tableOptions.canClick=function(a){return!1}),null==a.tableOptions.canFilter&&(a.tableOptions.canFilter=function(){return!0});var e=a.tableOptions.onItemClicked;a.tableOptions.onItemClicked=function(b){a.tableOptions.canClick(b)&&e(b)},null==a.tableOptions.onItemChecked&&(a.tableOptions.onItemChecked=function(a,b){}),a.tableOptions.onPageChanged||(a.tableOptions.onPageChanged=function(){}),a.tableOptions.getItemId||(a.tableOptions.getItemId=function(a){return a.Id}),a.loadPage=function(c){if(!(0>c||c>=a.maxPage)){a.tableOptions.checkedItems=[];var d={id:"promiseLoadItems_"+a.$id,groups:[a.tableOptions.luBusy.group]};a.tableOptions.getLoadPagePromise(c,a.tableOptions.perPage,a.tableOptions.query,d).then(function(b){a.tableOptions.page=c,a.items=b,a.pages=[],a.maxPage=Math.max(b.Count/a.tableOptions.perPage,1);for(var d=Math.max(0,a.tableOptions.page-5),e=Math.min(d+10,a.maxPage),f=d;e>f;++f)a.pages.push(f);a.tableOptions.onPageChanged()},b.errorDialog)}},a.toggleCheckedItem=function(b){var c=a.tableOptions.getItemId(b);a.toggleCheckedId(c,b)},a.toggleCheckedId=function(b,c){c=c||a.items.Data.find(function(c){return a.tableOptions.getItemId(c)==b});var d=a.tableOptions.checkedItems.indexOf(b);d>-1?(a.tableOptions.onItemChecked(c,!1),a.tableOptions.checkedItems.splice(d,1)):(a.tableOptions.onItemChecked(c,!0),a.tableOptions.checkedItems.push(b))},a.unCheckAll=function(){for(;0!=a.tableOptions.checkedItems.length;)a.toggleCheckedId(a.tableOptions.checkedItems[0])},a.checkAll=function(){a.unCheckAll();for(var b=0;b<a.items.Data.length;++b)a.toggleCheckedItem(a.items.Data[b])},a.toggleCheckAll=function(){a.tableOptions.checkedItems.length==a.items.Data.length?a.unCheckAll():a.checkAll()},a.isItemChecked=function(b){return a.tableOptions.checkedItems.indexOf(a.tableOptions.getItemId(b))>-1},a.onItemClicked=function(b){a.tableOptions.onItemClicked(b)},a.loadPage(a.tableOptions.page)}}}]),angular.module("luticateUtils").run(["$templateCache",function(a){a.put("/luticate/lubasictable.html",'<div lu-busy="tableOptions.luBusy"> <div class="col-sm-9"><ng-transclude ng-transclude="lu-basic-table-filter"></ng-transclude></div> <div class="col-sm-3" ng-show="tableOptions.canFilter()"><input placeholder="Filter" class="form-control" ng-model-options="{debounce: 500}" ng-model="tableOptions.query" ng-change="loadPage(0)"/></div> <table class="col-sm-12 table table-hover"> <thead> <tr> <th ng-show="tableOptions.canCheck()"> <input type="checkbox" ng-click="toggleCheckAll()" ng-checked="tableOptions.checkedItems.length == items.Data.length && items.Data.length != 0"> </th> <th class="col-sm-{{ col.width }}" ng-repeat="col in tableOptions.columns">{{ col.name }}</th> </tr> </thead> <tbody> <tr ng-repeat="item in items.Data" ng-style="{\'cursor\': tableOptions.canClick(item) ? \'pointer\' : \'\'}" ng-click="onItemClicked(item)"> <td ng-show="tableOptions.canCheck()"> <input name="tableOptions.checkedItems[]" type="checkbox" ng-checked="isItemChecked(item)" ng-click="$event.stopPropagation();toggleCheckedItem(item)" > </td> <td ng-repeat="col in tableOptions.columns">{{ col.getValue(item) }}</td> </tr> </tbody> </table> <div class="col-sm-12 text-center"> <div class="pagination"><ul> <li class="previous"> <a href="" class="fui-arrow-left" ng-click="loadPage(tableOptions.page - 1)"></a></li> <li ng-repeat="p in pages" ng-class="{ \'active\' : p == tableOptions.page}"> <a href="" ng-click="loadPage(p)">{{ p + 1 }}</a></li> <li class="next"> <a href="" class="fui-arrow-right" ng-click="loadPage(tableOptions.page + 1)"></a></li> </ul></div></div></div>')}]),angular.module("luticateUtils").directive("luBusy",["$compile","$http","luticatePromises","$templateCache","luticateDialogErrorHelper",function(a,b,c,d,e){return{restrict:"A",scope:{luBusy:"&"},link:function(f,g,h){function i(c,e){b.get(c,{cache:d}).success(function(b){var c=f.$new(),d='<div class="lu-busy lu-busy-backdrop lu-busy-backdrop-animation ng-hide" ng-show="'+e+'"></div>',h=a(d)(c);g.append(h);var i='<div class="lu-busy lu-busy-animation ng-hide" ng-show="'+e+'">'+b+"</div>",j=a(i)(c);g.append(j)}).error(function(a){throw new Error("Template specified for luBusy ("+c+") could not be loaded. "+a)})}f.isLoading=!1,f.hasError=!1;var j={group:h.luBusy,templateLoader:"/luticate/lubusy-loader.html",templateError:"/luticate/lubusy-error.html"};f.update=function(){var a=f.luBusy();null!=a&&("string"==typeof a?j.group=a:angular.extend(j,a));var b=c.getLoadersGroup(j.group);f.isLoading=!1,null!=b&&(f.isLoading=b.some(function(a){return 0==a.status}));var d=c.getErrorsGroup(j.group);f.hasError=!1,null!=d&&(f.hasError=d.some(function(a){return 2==a.status}))},f.loaderSplashIsActive=function(){return f.update(),f.isLoading&&!f.hasError},f.errorSplashIsActive=function(){return f.update(),f.hasError},f.showError=function(){var a=c.getErrorsGroup(j.group),b=null;null!=a&&(b=a.find(function(a){return 2==a.status})),null!=b&&e.errorDialog(b.value)},i(j.templateLoader,"loaderSplashIsActive()"),i(j.templateError,"errorSplashIsActive()")}}}]),angular.module("luticateUtils").run(["$templateCache",function(a){"use strict";a.put("/luticate/lubusy-loader.html",'<div class="lu-busy-default-wrapper" style="position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px;">\n\n <div class="lu-busy-default-sign">\n\n <div class="lu-busy-default-spinner">\n <div class="bar1"></div>\n <div class="bar2"></div>\n <div class="bar3"></div>\n <div class="bar4"></div>\n <div class="bar5"></div>\n <div class="bar6"></div>\n <div class="bar7"></div>\n <div class="bar8"></div>\n <div class="bar9"></div>\n <div class="bar10"></div>\n <div class="bar11"></div>\n <div class="bar12"></div>\n </div>\n\n <div class="lu-busy-default-text">Please wait...</div>\n\n </div>\n\n</div>'),a.put("/luticate/lubusy-error.html",'<div class="lu-busy-default-wrapper" style="position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px;">\n\n <div class="lu-busy-default-sign">\n\n <div class="lu-busy-default-error-text"><a href="" ng-click="showError()">Error</a></div>\n\n </div>\n\n</div>')}]),angular.module("luticateUtils").directive("luEditTable",["dialogs","luticateDialogErrorHelper","luticateAuthCache","luticateDialogOkCancelHelper",function(a,b,c,d){return{restrict:"E",scope:{options:"&"},transclude:{"lu-basic-table-filter":"?lu-basic-table-filter"},templateUrl:"/luticate/lutable.html",link:function(e,f,g){if(e.tableOptions=e.options(),e.tableOptions.luEditTableScope=e,null==e.tableOptions.onItemDeleted&&(e.tableOptions.onItemDeleted=function(a){}),null==e.tableOptions.onItemEdited&&(e.tableOptions.onItemEdited=function(a){}),null==e.tableOptions.onItemAdded&&(e.tableOptions.onItemAdded=function(a){}),null==e.tableOptions.onItemClicked&&(e.tableOptions.onItemClicked=function(b){var c=e.tableOptions.getEditController();a.create("views/modals/"+c.toLowerCase()+".html",c+"Controller",b).result.then(function(a){e.tableOptions.luBasicTableScope.loadPage(e.tableOptions.page),e.tableOptions.onItemEdited(a)})}),null==e.tableOptions.addItem&&(e.tableOptions.addItem=function(){var b=e.tableOptions.getEditController();a.create("views/modals/"+b.toLowerCase()+".html",b+"Controller",e.tableOptions.editData).result.then(function(a){e.tableOptions.luBasicTableScope.loadPage(e.tableOptions.page),e.tableOptions.onItemAdded(a)})}),null==e.tableOptions.canDel&&(e.tableOptions.canDel=function(){return!1}),"string"==typeof e.tableOptions.canDel){var h=e.tableOptions.canDel;e.tableOptions.canDel=function(){return c.hasEffectivePermission(h)}}if(e.tableOptions.canCheck=e.tableOptions.canDel,null==e.tableOptions.canEdit&&(e.tableOptions.canEdit=function(){return!1}),"string"==typeof e.tableOptions.canEdit){var i=e.tableOptions.canEdit;e.tableOptions.canEdit=function(a){return c.hasEffectivePermission(i)}}if(e.tableOptions.canClick=e.tableOptions.canEdit,null==e.tableOptions.canAdd&&(e.tableOptions.canAdd=function(){return!1}),"string"==typeof e.tableOptions.canAdd){var j=e.tableOptions.canAdd;e.tableOptions.canAdd=function(){return c.hasEffectivePermission(j)}}e.askDeleteItems=function(){d.okCancelDialog({title:"Delete items",text:"Do you really want to delete selected items?"}).result.then(function(){e.deleteItems()})},e.deleteItems=function(){if(0==e.tableOptions.checkedItems.length)return void e.tableOptions.luBasicTableScope.loadPage(e.tableOptions.page);var a={id:"promiseDelItems",loaderGroups:[e.tableOptions.luBusy.group]},c=e.tableOptions.checkedItems[0];e.tableOptions.getDelPromise(c,a).then(function(a){e.tableOptions.onItemDeleted(c),e.tableOptions.checkedItems.splice(0,1),e.deleteItems()},function(a){b.errorDialog(a).result.then(function(a){e.tableOptions.luBasicTableScope.loadPage(e.tableOptions.page)},function(a){})})}}}}]),angular.module("luticateUtils").run(["$templateCache",function(a){a.put("/luticate/lutable.html",'<lu-basic-table options="tableOptions"><lu-basic-table-filter><ng-transclude ng-transclude="lu-basic-table-filter"></ng-transclude></lu-basic-table-filter></lu-basic-table><div class="col-sm-12"> <button class="btn btn-danger" type="button" ng-click="askDeleteItems()" ng-disabled="tableOptions.checkedItems.length == 0" ng-show="tableOptions.canDel()"> <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete </button> <button class="btn btn-primary" type="button" ng-click="tableOptions.addItem()" ng-show="tableOptions.canAdd()"> <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add </button></div>')}]),function(){function a(a,b){for(var c=a.split(","),d=0;d<c.length;++d)if(!b.hasEffectivePermission(c[d]))return!1;return!0}angular.module("luticateUtils").directive("luShowPermission",["luticateAuthCache",function(b){return{restrict:"A",link:function(c,d,e){c.$watch(function(){return a(e.luShowPermission,b)},function(a){1==a?d.show():d.hide()})}}}]).directive("luEnablePermission",["luticateAuthCache",function(b){return{restrict:"A",link:function(c,d,e){c.$watch(function(){return a(e.luEnablePermission,b)},function(a){1==a?d.removeAttr("disabled"):d.attr("disabled","disabled")})}}}])}(),angular.module("luticateUtils").directive("luPermissionEdit",["dialogs","luticateDialogErrorHelper","luticateAuthPermissions","luticateAuthCache",function(a,b,c,d){return{restrict:"E",scope:{luModel:"&"},templateUrl:"/luticate/lupermissionedit.html",link:function(a,e,f){a.permissions=[],a.allPermissions=[],a.allPermissionsCleared=[],a.tmpPermission={Name:"",Value:!0},a.luModelOptions=a.luModel(),a.editPermission=function(c,d){var e={id:"promiseEditPermission_"+c.Name,loaderGroups:["permission_"+c.Name]};a.luModelOptions.getEditPermissionPromise(c.Name,d,e).then(function(a){c.Value=d},b.errorDialog)},a.delPermission=function(c){var d={id:"promiseDelPermission_"+c.Name,loaderGroups:["permission_"+c.Name]};a.luModelOptions.getDelPermissionPromise(c.Name,d).then(function(b){a.loadPermissions()},b.errorDialog)},a.addPermission=function(c){var d={id:"promiseAddPermission_"+c.Name,loaderGroups:["permission_add"]};a.luModelOptions.getAddPermissionPromise(c.Name,c.Value,d).then(function(b){a.loadPermissions()},b.errorDialog)},a.loadPermissions=function(){var c={id:"promiseLoadPermissions_",groups:["permissionList"]};a.luModelOptions.getGetAllPromise(null,null,c).then(function(b){a.permissions=b.Data,a.allPermissionsCleared=[];for(var c=0;c<a.allPermissions.length;++c){var d=a.allPermissions[c];null==a.permissions.find(function(a){return d.Name==a.Name})&&a.allPermissionsCleared.push(d)}a.allPermissionsCleared.length>0?a.tmpPermission.Name=a.allPermissionsCleared[0].Name:a.tmpPermission.Name=""},b.errorDialog)},a.loadAllPermissions=function(){var d={id:"promiseLoadAllPermissions",groups:["permissionList"]};c.getAll(null,d).then(function(b){a.allPermissions=b.Data,a.loadPermissions()},b.errorDialog)},d.hasEffectivePermission("LU_PERM_GET")?a.loadAllPermissions():a.loadPermissions()}}}]),angular.module("luticateUtils").run(["$templateCache",function(a){a.put("/luticate/lupermissionedit.html",'<div class="col-sm-12"> <div class="form-group form-horizontal col-sm-12" lu-busy="permissionList"> <div class="col-sm-6 form-group" ng-repeat="permission in permissions" lu-busy="{group: \'permission_\' + permission.Name}"> <label class="col-sm-6 control-label" title="{{ permission.Name }}">{{ permission.Name }}</label><div class="col-sm-6"> <div class="btn-group"> <button class="btn btn-primary dropdown-toggle btn-select" data-toggle="dropdown" href="" lu-enable-permission="{{ luModelOptions.permissions.edit }}"> {{ permission.Value ? \'Allow\' : \'Disallow\' }} <span class="caret"></span> </button> <ul class="dropdown-menu"> <li><a href="" ng-click="editPermission(permission, false)">Disallow</a></li><li><a href="" ng-click="editPermission(permission, true)">Allow</a></li></ul></div><div class="btn-group"> <button type="button" class="btn btn-danger" ng-click="delPermission(permission)" lu-show-permission="{{ luModelOptions.permissions.del }}"> <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> </button> </div> </div> </div> </div> <div class="clearfix"></div> <div class="col-sm-12" lu-busy="permission_add" lu-show-permission="{{ luModelOptions.permissions.add }}"> <div class="btn-group"> <button class="btn btn-primary dropdown-toggle btn-select" data-toggle="dropdown" href=""> {{ tmpPermission.Name }} <span class="caret"></span> </button> <ul class="dropdown-menu"> <li ng-repeat="permission in allPermissionsCleared"> <a href="" ng-click="tmpPermission.Name = permission.Name">{{ permission.Name}}</a></li></ul></div><div class="btn-group"> <button class="btn btn-primary dropdown-toggle btn-select" data-toggle="dropdown" href=""> {{ tmpPermission.Value ? \'Allow\' : \'Disallow\' }} <span class="caret"></span> </button> <ul class="dropdown-menu"> <li><a href="" ng-click="tmpPermission.Value = false">Disallow</a></li><li><a href="" ng-click="tmpPermission.Value = true">Allow</a></li></ul></div><button type="button" class="btn btn-primary" ng-click="addPermission(tmpPermission)" ng-disabled="allPermissionsCleared.length == 0"> <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add </button> </div> </div>')}]),angular.module("luticateUtils").directive("luPickerTable",[function(){return{restrict:"E",scope:{options:"&"},templateUrl:"/luticate/lupickertable.html",link:function(a,b,c){a.pickerOptions=a.options(),a.pickerOptions.luPickerTableScope=a,a.pickerOptions.pickedItems=[];var d=a.pickerOptions.onItemClicked;a.pickerOptions.onItemClicked=function(b){null!=d&&d(b),a.pickerOptions.luBasicTableScope.toggleCheckedItem(b)};var e=a.pickerOptions.onItemChecked;a.pickerOptions.onItemChecked=function(b,c){null!=e&&e(b,c);var d=a.pickerOptions.getItemId(b),f=a.pickerOptions.pickedItems.find(function(b){return a.pickerOptions.getItemId(b)==d}),g=a.pickerOptions.pickedItems.indexOf(f);g>-1?c||a.pickerOptions.pickedItems.splice(g,1):c&&a.pickerOptions.pickedItems.push(b)};var f=a.pickerOptions.onPageChanged;a.pickerOptions.onPageChanged=function(){null!=f&&f();for(var b=0;b<a.pickerOptions.pickedItems.length;++b)for(var c=a.pickerOptions.pickedItems[b],d=a.pickerOptions.getItemId(c),e=0;e<a.pickerOptions.luBasicTableScope.items.Data.length;++e){var g=a.pickerOptions.luBasicTableScope.items.Data[e];d==a.pickerOptions.getItemId(g)&&a.pickerOptions.checkedItems.push(d)}},a.pickerOptions.canCheck=function(){return!0},a.pickerOptions.canClick=function(){return!0},a.unPickItem=function(b){var c=a.pickerOptions.getItemId(b);null!=a.pickerOptions.checkedItems.find(function(a){return a==c})?a.pickerOptions.luBasicTableScope.toggleCheckedId(c,b):a.pickerOptions.onItemChecked(b,!1)}}}}]),angular.module("luticateUtils").run(["$templateCache",function(a){a.put("/luticate/lupickertable.html",'<div class="col-sm-3">Selected items:<div ng-repeat="item in pickerOptions.pickedItems" ng-click="unPickItem(item)"class="col-sm-12 form-control">{{ pickerOptions.getItemText(item) }}</div></div><lu-basic-table options="pickerOptions" class="col-sm-9"></lu-basic-table>')}]),function(){"use strict";angular.module("luticateUtils").factory("luticatePromises",[function(){var a={};return a.promises={},a.loaders=[],a.errors=[],a.build=function(b){a[b]={};for(var c in a.promises){var d=a.promises[c];d[b].forEach(function(c){null==a[b][c]&&(a[b][c]=[]),a[b][c].push(d)})}},a.initPromise=function(b){var c={loaders:[],errors:[],status:0,id:b.id};b.groups&&b.groups.forEach(function(a){c.loaders.push(a),c.errors.push(a)}),b.loaderGroups&&b.loaderGroups.forEach(function(a){c.loaders.push(a)}),b.errorGroups&&b.errorGroups.forEach(function(a){c.errors.push(a)}),a.promises[b.id]=c,a.build("loaders"),a.build("errors")},a.getLoadersGroup=function(b){return null==a.loaders[b]?null:a.loaders[b]},a.getErrorsGroup=function(b){return null==a.errors[b]?null:a.errors[b]},a.reject=function(b,c){a.promises[b.id].status=2,a.promises[b.id].value=c},a.resolve=function(b,c){a.promises[b.id].status=1,a.promises[b.id].value=c},a}])}(),function(){"use strict";angular.module("luticateUtils").factory("luticateRequest",["$q","$http","luticatePromises",function(a,b,c){function d(a,b,d,e){var f={Data:b,Status:d};a.reject(f),null!=e&&c.reject(e,f)}function e(a,b,d){a.resolve(b),null!=d&&c.resolve(d,b)}var f={};return f.get=function(a,b,c){return f.request(a,"GET",b,null,c)},f.post=function(a,b,c,d){return f.request(a,"POST",c,b,d)},f.put=function(a,b,c,d){return f.request(a,"PUT",c,b,d)},f["delete"]=function(a,b,c,d){return f.request(a,"DELETE",c,b,d)},f.request=function(f,g,h,i,j){null!=j&&c.initPromise(j);var k=a.defer();f=f.replace(/\/+$/,"");var l={url:f,method:g,params:h,data:null==i?null:$.param(i),headers:{"Content-Type":"application/x-www-form-urlencoded"}};return b(l).success(function(a,b){if(null==a||null!=a.Message){var c=null==a?"Failed to parse response":a.Message;d(k,c,b,j)}else e(k,a.Data,j)}).error(function(a,b){if(null==a||null!=a.Message){var c=null==a?"Failed to parse response":a.Message;d(k,c,b,j)}else d(k,a,b,j)}),k.promise},f}])}(),function(){"use strict";angular.module("luticateUtils").controller("luticateDialogError",["$scope","data","$state","luticateAuthCache",function(a,b,c,d){a.message=b.message,a.showLogin=401==b.data.Status,a.reconnect=function(){a.$dismiss(),d.removeUser(),c.go("login")}}]),angular.module("luticateUtils").factory("luticateDialogErrorHelper",["dialogs",function(a){var b={};return b.errorMessage=function(a){var b=a.Data;return b+=" (HTTP code: "+a.Status+")"},b.errorDialog=function(c){var d=b.errorMessage(c);return a.create("/luticateUtils/dialogerror.html","luticateDialogError",{message:d,data:c},{})},b}]),angular.module("luticateUtils").run(["$templateCache",function(a){a.put("/luticateUtils/dialogerror.html",'<div class="popin modal-content" xmlns="http://www.w3.org/1999/html"> <div class="modal-header">Error</div> <div class="modal-body"> <div class="form-group">{{ message }}</div> <div class="clearfix"></div> </div> <div class="modal-footer"> <button type="submit" class="btn btn-inverse" ng-click="$close()" ng-show="!showLogin">Close</button> <button type="submit" class="btn btn-inverse" ng-click="$close()" ng-show="showLogin">Cancel</button> <button type="button" class="btn btn-primary" ng-click="reconnect()" ng-show="showLogin">Login</button> </div> </div>')}])}(),function(){"use strict";angular.module("luticateUtils").controller("luticateDialogOkCancel",["$scope","data",function(a,b){a.text=b.text,a.title=b.title,a.submitForm=function(){a.$close()}}]),angular.module("luticateUtils").factory("luticateDialogOkCancelHelper",["dialogs",function(a){var b={};return b.okCancelDialog=function(b){return a.create("/luticateUtils/dialogokcancel-dialog.html","luticateDialogOkCancel",b,{})},b}]),angular.module("luticateUtils").run(["$templateCache",function(a){a.put("/luticateUtils/dialogokcancel-dialog.html",'<dialog-ok-cancel title="{{ title }}"> <div class="modal-body">{{ text }}</div></dialog-ok-cancel>')}])}(),angular.module("luticateUtils").directive("dialogClose",["luticateDialogErrorHelper",function(a){return{restrict:"EA",transclude:!0,templateUrl:"/luticateUtils/dialogclose-directive.html",link:function(a,b,c){a.title=c.title,a.__close=function(){a.onClosed&&a.onClosed(),a.$close()}}}}]),angular.module("luticateUtils").run(["$templateCache",function(a){a.put("/luticateUtils/dialogclose-directive.html",'<div class="popin modal-content" xmlns="http://www.w3.org/1999/html"><div class="modal-header">{{ title }}</div><div class="modal-body" lu-busy="modal"> <div class="form-group form-horizontal"> <ng-transclude></ng-transclude> </div> <div class="clearfix"></div></div><div class="modal-footer"> <button type="button" class="btn btn-inverse" ng-click="__close()">Close</button> </div> </div>')}]),function(){"use strict";angular.module("luticateUtils").directive("dialogOkCancel",["luticateDialogErrorHelper",function(a){return{restrict:"EA",transclude:!0,templateUrl:"/luticateUtils/dialogokcancel-directive.html",link:function(b,c,d){b.title=d.title,b.model={},b.pending=!1,b.submitted=!1,b.__submit=function(){b.submitted=!0,b.form.$valid&&(b.pending=!0,b.promise=b.submitForm(),b.promise?b.promise.then(function(a){b.onDone&&b.onDone(a),b.$close(a),b.pending=!1})["catch"](function(c){b.onError&&b.onError(c),a.errorDialog(c).result.then(function(a){},function(a){b.$dismiss(c)}),b.pending=!1}):(b.$close(),b.pending=!1))},b.__cancel=function(){b.onCanceled&&b.onCanceled(),b.$dismiss(),b.pending=!1}}}}]),angular.module("luticateUtils").run(["$templateCache",function(a){a.put("/luticateUtils/dialogokcancel-directive.html",'<div class="popin modal-content" xmlns="http://www.w3.org/1999/html"><form name="form" ng-submit="__submit()"><div class="modal-header">{{ title }}</div><div class="modal-body" lu-busy="modal"> <div class="form-group form-horizontal"> <ng-transclude></ng-transclude> </div> <div class="clearfix"></div></div><div class="modal-footer"> <button type="button" class="btn btn-inverse" ng-click="__cancel()">Cancel</button> <button type="submit" class="btn btn-primary" ng-enabled="!pending">OK</button> </div> </form> </div>')}])}();