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) {
17 angular.forEach(obj, function(value, key) {
18 if (dst[key] && dst[key].constructor && dst[key].constructor === Object) {
19 _extendDeep(dst[key], value);
29 extendDeep: _extendDeep
32 .filter('unsafe', ['$sce', function($sce) {
33 return function(val) {
34 return $sce.trustAsHtml(val);
38 angular.module('att.gridster.gridster', ['attGridsterLib', 'att.gridster.utilities', 'ngSanitize'])
39 .config(['$compileProvider', function($compileProvider) {
40 $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|javascript):/);
42 .constant('attGridsterConfig',
54 .directive('attGridster', ['attGridsterConfig', '$extendObj', function(attGridsterConfig, $extendObj) {
58 attGridsterOptions: '=?'
60 templateUrl: 'template/gridster/gridster.html',
63 controller: [function() {}],
64 link: function(scope) {
65 if (angular.isDefined(scope.attGridsterOptions)) {
66 attGridsterConfig = $extendObj.extendDeep(attGridsterConfig, scope.attGridsterOptions);
68 scope.attGridsterConfig = attGridsterConfig;
72 .directive('attGridsterItem', ['$timeout', function($timeout) {
75 require: ['^attGridster'],
79 templateUrl: 'template/gridster/gridsterItem.html',
82 controller: [function() {}]
85 .directive('attGridsterItemHeader', [function() {
88 require: ['^attGridsterItem'],
94 templateUrl: 'template/gridster/gridsterItemHeader.html',
97 link: function(scope, element, attr) {
98 if (attr.gripsImgPath) {
99 scope.gripsImgPath = attr.gripsImgPath;
101 scope.gripsImgPath = 'images/grips.png';
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);
111 .directive('attGridsterItemBody', [function() {
114 require: ['^attGridsterItem'],
116 templateUrl: 'template/gridster/gridsterItemBody.html',
121 .directive('attGridsterItemFooter', [function() {
124 require: ['^attGridsterItem'],
126 templateUrl: 'template/gridster/gridsterItemFooter.html',
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>");
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>");
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>");
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>");
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" +
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" +