nexus site path corrected
[portal.git] / ecomp-portal-FE / client / bower_components_external / angular-att-gridster / ui-gridster-tpls.js
1 /**
2 * FileName ui-gridster
3 * Version 0.1.0
4 * Build number 81850
5 * Date 03/14/2016
6 */
7
8
9 (function(angular, window){
10 angular.module("att.gridster", ["att.gridster.tpls", "att.gridster.utilities","att.gridster.gridster"]);
11 angular.module("att.gridster.tpls", ["template/gridster/gridster.html","template/gridster/gridsterItem.html","template/gridster/gridsterItemBody.html","template/gridster/gridsterItemFooter.html","template/gridster/gridsterItemHeader.html"]);
12 angular.module('att.gridster.utilities', [])
13     .factory('$extendObj', [function() {
14         var _extendDeep = function(dst) {
15             angular.forEach(arguments, function(obj) {
16                 if (obj !== dst) {
17                     angular.forEach(obj, function(value, key) {
18                         if (dst[key] && dst[key].constructor && dst[key].constructor === Object) {
19                             _extendDeep(dst[key], value);
20                         } else {
21                             dst[key] = value;
22                         }
23                     });
24                 }
25             });
26             return dst;
27         };
28         return {
29             extendDeep: _extendDeep
30         };
31     }])
32     .filter('unsafe', ['$sce', function($sce) {
33         return function(val) {
34             return $sce.trustAsHtml(val);
35         };
36     }]);
37
38 angular.module('att.gridster.gridster', ['attGridsterLib', 'att.gridster.utilities', 'ngSanitize'])
39         .config(['$compileProvider', function($compileProvider) {
40                 $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|javascript):/);
41             }])
42         .constant('attGridsterConfig',
43                 {
44                     columns: 3,
45                     margins: [10, 10],
46                     outerMargin: true,
47                     pushing: true,
48                     floating: true,
49                     swapping: true,
50                     draggable: {
51                         enabled: true
52                     }
53                 })
54         .directive('attGridster', ['attGridsterConfig', '$extendObj', function(attGridsterConfig, $extendObj) {
55                 return {
56                     restrict: 'EA',
57                     scope: {
58                         attGridsterOptions: '=?'
59                     },
60                     templateUrl: 'template/gridster/gridster.html',
61                     replace: false,
62                     transclude: true,
63                     controller: [function() {}],
64                     link: function(scope) {
65                         if (angular.isDefined(scope.attGridsterOptions)) {
66                             attGridsterConfig = $extendObj.extendDeep(attGridsterConfig, scope.attGridsterOptions);
67                         }
68                         scope.attGridsterConfig = attGridsterConfig;
69                     }
70                 };
71             }])
72         .directive('attGridsterItem', ['$timeout', function($timeout) {
73                 return {
74                     restrict: 'EA',
75                     require: ['^attGridster'],
76                     scope: {
77                         attGridsterItem: '='
78                     },
79                     templateUrl: 'template/gridster/gridsterItem.html',
80                     replace: false,
81                     transclude: true,
82                     controller: [function() {}]
83                 };
84             }])
85         .directive('attGridsterItemHeader', [function() {
86                 return {
87                     restrict: 'EA',
88                     require: ['^attGridsterItem'],
89                     scope: {
90                         headerText: '@',
91                         headerIcon: '@',
92                         subHeaderText: '@?'
93                     },
94                     templateUrl: 'template/gridster/gridsterItemHeader.html',
95                     replace: true,
96                     transclude: true,
97                     link: function(scope, element, attr) {
98                         if (attr.gripsImgPath) {
99                             scope.gripsImgPath = attr.gripsImgPath;
100                         } else {
101                             scope.gripsImgPath = 'images/grips.png';
102                         }
103
104                         if (angular.isDefined(scope.subHeaderText) && scope.subHeaderText) {
105                             angular.element(element[0].querySelector('span.gridster-item-sub-header-content')).attr("tabindex", "0");
106                             angular.element(element[0].querySelector('span.gridster-item-sub-header-content')).attr("aria-label", scope.subHeaderText);
107                         }
108                     }
109                 };
110             }])
111         .directive('attGridsterItemBody', [function() {
112                 return {
113                     restrict: 'EA',
114                     require: ['^attGridsterItem'],
115                     scope: {},
116                     templateUrl: 'template/gridster/gridsterItemBody.html',
117                     replace: true,
118                     transclude: true
119                 };
120             }])
121         .directive('attGridsterItemFooter', [function() {
122                 return {
123                     restrict: 'EA',
124                     require: ['^attGridsterItem'],
125                     scope: {},
126                     templateUrl: 'template/gridster/gridsterItemFooter.html',
127                     replace: true,
128                     transclude: true
129                 };
130             }]);
131 angular.module("template/gridster/gridster.html", []).run(["$templateCache", function($templateCache) {
132   $templateCache.put("template/gridster/gridster.html",
133     "<div gridster='attGridsterConfig'><div ng-transclude></div></div>");
134 }]);
135
136 angular.module("template/gridster/gridsterItem.html", []).run(["$templateCache", function($templateCache) {
137   $templateCache.put("template/gridster/gridsterItem.html",
138     "<div gridster-item='attGridsterItem' class=\"gridster-item-container\" ng-transclude></div>");
139 }]);
140
141 angular.module("template/gridster/gridsterItemBody.html", []).run(["$templateCache", function($templateCache) {
142   $templateCache.put("template/gridster/gridsterItemBody.html",
143     "<div class=\"gridster-item-body\" ng-transclude></div>");
144 }]);
145
146 angular.module("template/gridster/gridsterItemFooter.html", []).run(["$templateCache", function($templateCache) {
147   $templateCache.put("template/gridster/gridsterItemFooter.html",
148     "<div class=\"gridster-item-footer\" ng-transclude></div>");
149 }]);
150
151 angular.module("template/gridster/gridsterItemHeader.html", []).run(["$templateCache", function($templateCache) {
152   $templateCache.put("template/gridster/gridsterItemHeader.html",
153     "<div class=\"gridster-item-header\">\n" +
154     "    <img gridster-item-drag ng-src={{gripsImgPath}} alt=\"||\" aria-label=\"Tap or Click to move\" class=\"gridster-item-handle\" />\n" +
155   
156     "    <span class=\"gridster-item-header-content\" tabindex=\"0\" role=\"presentation\" aria-label=\"{{headerText}}\" ng-bind-html=\"headerText | unsafe\"></span>\n" +
157   /*  "  <span class=\"{{headerIcon}}\" style=\"font-size: 40px; color:black; float:left; margin-left:30px; margin-right: -2    0px;    line-height: 1.2; \"></span>"+*/
158     "    <span class=\"gridster-item-sub-header-content\" role=\"presentation\">{{subHeaderText}}</span>\n" +
159     "    <div class=\"gridster-item-header-buttons-container\" ng-transclude></div>\n" +
160     "</div>");
161 }]);
162
163 return {}
164 })(angular, window);