9 (function(angular, window){
10 angular.module("att.gridster", ["att.gridster.utilities","att.gridster.gridster"]);
11 angular.module('att.gridster.utilities', [])
12 .factory('$extendObj', [function() {
13 var _extendDeep = function(dst) {
14 angular.forEach(arguments, function(obj) {
16 angular.forEach(obj, function(value, key) {
17 if (dst[key] && dst[key].constructor && dst[key].constructor === Object) {
18 _extendDeep(dst[key], value);
28 extendDeep: _extendDeep
31 .filter('unsafe', ['$sce', function($sce) {
32 return function(val) {
33 return $sce.trustAsHtml(val);
37 angular.module('att.gridster.gridster', ['attGridsterLib', 'att.gridster.utilities', 'ngSanitize'])
38 .config(['$compileProvider', function($compileProvider) {
39 $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|javascript):/);
41 .constant('attGridsterConfig',
53 .directive('attGridster', ['attGridsterConfig', '$extendObj', function(attGridsterConfig, $extendObj) {
57 attGridsterOptions: '=?'
59 templateUrl: 'template/gridster/gridster.html',
62 controller: [function() {}],
63 link: function(scope) {
64 if (angular.isDefined(scope.attGridsterOptions)) {
65 attGridsterConfig = $extendObj.extendDeep(attGridsterConfig, scope.attGridsterOptions);
67 scope.attGridsterConfig = attGridsterConfig;
71 .directive('attGridsterItem', ['$timeout', function($timeout) {
74 require: ['^attGridster'],
78 templateUrl: 'template/gridster/gridsterItem.html',
81 controller: [function() {}]
84 .directive('attGridsterItemHeader', [function() {
87 require: ['^attGridsterItem'],
93 templateUrl: 'template/gridster/gridsterItemHeader.html',
96 link: function(scope, element, attr) {
97 if (attr.gripsImgPath) {
98 scope.gripsImgPath = attr.gripsImgPath;
100 scope.gripsImgPath = 'images/grips.png';
103 if (angular.isDefined(scope.subHeaderText) && scope.subHeaderText) {
104 angular.element(element[0].querySelector('span.gridster-item-sub-header-content')).attr("tabindex", "0");
105 angular.element(element[0].querySelector('span.gridster-item-sub-header-content')).attr("aria-label", scope.subHeaderText);
110 .directive('attGridsterItemBody', [function() {
113 require: ['^attGridsterItem'],
115 templateUrl: 'template/gridster/gridsterItemBody.html',
120 .directive('attGridsterItemFooter', [function() {
123 require: ['^attGridsterItem'],
125 templateUrl: 'template/gridster/gridsterItemFooter.html',